sproutboat 0.33.0 → 0.34.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/CHANGELOG.md CHANGED
@@ -10,6 +10,28 @@ maintained going forward by the `release` skill.
10
10
 
11
11
  ## Unreleased
12
12
 
13
+ ## [0.34.0] - 2026-10-26
14
+
15
+ Built on `@sproutboat/runtime` 0.33.0, `@sproutboat/toolchain` 0.17.0 and
16
+ `@sproutboat/wire` 0.20.1.
17
+
18
+ ### Added
19
+
20
+ - **WebSockets from compatibility date 2026-10-30.** `WebSocketPair`, `WebSocket`
21
+ (`accept`, `send`, `close`, listeners), `new Response(null, { status: 101, webSocket })`,
22
+ `response.webSocket`, `WebSocketRequestResponsePair`, and the Durable Object hibernation API
23
+ (`acceptWebSocket`, `getWebSockets`, `getTags`, auto-responses, attachments,
24
+ `webSocketMessage` and `webSocketClose`). Behaviour follows workerd. Sockets reaching a client
25
+ are carried by sproutd (B19); a standalone executable or the platform answers a 101 with 501
26
+ for now, while a pair whose ends both stay in the worker (a Worker and its Durable Object)
27
+ works everywhere. Outbound `new WebSocket(url)` is not supported yet.
28
+ - Streamed request bodies on sproutd (B19), from compatibility date 2026-10-27.
29
+
30
+ ### Changed
31
+
32
+ - `types/sproutboat.d.ts` declares the WebSocket types and the hibernation handlers.
33
+ - The toolchain moves to 0.17.0, so compiled apps get a new fingerprint and rebuild once.
34
+
13
35
  ## [0.33.0] - 2026-10-25
14
36
 
15
37
  Built on `@sproutboat/runtime` 0.32.0, `@sproutboat/wire` 0.20.0 and
package/README.md CHANGED
@@ -168,7 +168,8 @@ Windows, build from WSL.
168
168
  ## Limits
169
169
 
170
170
  Capability profile `http-sync-v0`: one synchronous `fetch` handler, optional
171
- `scheduled` / `queue` handlers, no streaming, no WebSockets. Binding values are
171
+ `scheduled` / `queue` handlers. WebSockets (from compatibility date 2026-10-30) need
172
+ a host that carries them (sproutd). Binding values are
172
173
  text/JSON, one at a time over a 32 MiB loopback frame. Sprout uploads cap at
173
174
  16 MiB, assets at 64 MiB / 4096 files.
174
175
 
package/SURFACE.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > Generated by `src/surface.test.ts` from `src/surface.ts` + the pinned
4
4
  > toolchain constants. Do not edit by hand — run `UPDATE_SURFACE=1 bun test`.
5
5
 
6
- **Package:** `sproutboat` 0.33.0
6
+ **Package:** `sproutboat` 0.34.0
7
7
 
8
8
  ## Commands
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sproutboat",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "Wrangler-shaped CLI for Sproutboat. Deploys workers to any control plane via --api-url / SPROUTBOAT_API_URL.",
5
5
  "keywords": [
6
6
  "cli",
@@ -64,9 +64,9 @@
64
64
  "@sproutboat/artifact": "^0.3.0",
65
65
  "@sproutboat/assets": "^0.3.0",
66
66
  "@sproutboat/config": "^0.6.0",
67
- "@sproutboat/runtime": "^0.32.0",
68
- "@sproutboat/toolchain": "^0.16.1",
69
- "@sproutboat/wire": "^0.20.0"
67
+ "@sproutboat/runtime": "^0.33.0",
68
+ "@sproutboat/toolchain": "^0.17.0",
69
+ "@sproutboat/wire": "^0.20.1"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@oxlint/plugins": "1.85.0",
@@ -78,10 +78,10 @@
78
78
  "typescript": "7.0.2"
79
79
  },
80
80
  "optionalDependencies": {
81
- "@sproutboat/cli-darwin-arm64": "0.33.0",
82
- "@sproutboat/cli-darwin-x64": "0.33.0",
83
- "@sproutboat/cli-linux-arm64": "0.33.0",
84
- "@sproutboat/cli-linux-x64": "0.33.0"
81
+ "@sproutboat/cli-darwin-arm64": "0.34.0",
82
+ "@sproutboat/cli-darwin-x64": "0.34.0",
83
+ "@sproutboat/cli-linux-arm64": "0.34.0",
84
+ "@sproutboat/cli-linux-x64": "0.34.0"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=18"
@@ -272,6 +272,46 @@ declare global {
272
272
  id: DurableObjectId;
273
273
  /** Synchronous, like every other binding. */
274
274
  storage: DurableObjectStorage;
275
+ /**
276
+ * The WebSocket hibernation API, from compatibility date 2026-10-30. Messages and
277
+ * closes on an accepted socket go to the class's `webSocketMessage` and
278
+ * `webSocketClose`. On sproutd an open socket keeps the app's worker running.
279
+ */
280
+ acceptWebSocket(ws: WebSocket, tags?: string[]): void;
281
+ getWebSockets(tag?: string): WebSocket[];
282
+ getTags(ws: WebSocket): string[];
283
+ setWebSocketAutoResponse(pair?: WebSocketRequestResponsePair): void;
284
+ getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
285
+ }
286
+
287
+ // ---------------------------------------------------------- WebSockets
288
+
289
+ /**
290
+ * From compatibility date 2026-10-30, as in workerd. Return the client end in a
291
+ * `new Response(null, { status: 101, webSocket: client })` and talk on the server end.
292
+ * Client sockets are carried by sproutd; a standalone or platform sprout answers a 101
293
+ * with 501 for now. Inbound messages are capped at 32 MiB (1009 above it). Outbound
294
+ * WebSockets (`new WebSocket(url)`) are not supported.
295
+ */
296
+ class WebSocketPair {
297
+ 0: WebSocket;
298
+ 1: WebSocket;
299
+ }
300
+ class WebSocketRequestResponsePair {
301
+ constructor(request: string, response: string);
302
+ readonly request: string;
303
+ readonly response: string;
304
+ }
305
+ interface ResponseInit {
306
+ webSocket?: WebSocket | null;
307
+ }
308
+ interface Response {
309
+ readonly webSocket: WebSocket | null;
310
+ }
311
+ interface WebSocket {
312
+ accept(): void;
313
+ serializeAttachment(value: unknown): void;
314
+ deserializeAttachment(): unknown;
275
315
  }
276
316
 
277
317
  // -------------------------------------------------- Analytics Engine
@@ -366,6 +406,9 @@ declare global {
366
406
  fetch(request: Request): Response | Promise<Response>;
367
407
  /** Runs after `storage.setAlarm`, with no request in flight. */
368
408
  alarm?(): void | Promise<void>;
409
+ /** A message on a socket taken with `state.acceptWebSocket` (from 2026-10-30). */
410
+ webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise<void>;
411
+ webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise<void>;
369
412
  }
370
413
 
371
414
  // ------------------------------------------------------- Version metadata