@nice-code/action 0.21.0 → 0.22.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.
Files changed (32) hide show
  1. package/README.md +91 -59
  2. package/build/{ActionDevtoolsCore-baIHExfj.d.mts → ActionDevtoolsCore-CQ0vrvPD.d.cts} +2 -2
  3. package/build/{ActionDevtoolsCore-dApyYvTS.d.cts → ActionDevtoolsCore-CiLBYC3K.d.mts} +2 -2
  4. package/build/{ActionPayload.types-CQM1HRw_.d.cts → ActionPayload.types-Dx1JPyfs.d.mts} +133 -30
  5. package/build/{ActionPayload.types-DXGiw1SF.d.mts → ActionPayload.types-L9k0LyBd.d.cts} +133 -30
  6. package/build/devtools/browser/index.d.cts +1 -1
  7. package/build/devtools/browser/index.d.mts +1 -1
  8. package/build/devtools/server/index.d.cts +1 -1
  9. package/build/devtools/server/index.d.mts +1 -1
  10. package/build/httpAcceptorCarrier-DL8lf0xB.mjs +3906 -0
  11. package/build/httpAcceptorCarrier-DL8lf0xB.mjs.map +1 -0
  12. package/build/httpAcceptorCarrier-OnJxzsAD.cjs +4291 -0
  13. package/build/httpAcceptorCarrier-OnJxzsAD.cjs.map +1 -0
  14. package/build/index.cjs +368 -4139
  15. package/build/index.cjs.map +1 -1
  16. package/build/index.d.cts +2 -2
  17. package/build/index.d.mts +2 -2
  18. package/build/index.mjs +299 -4069
  19. package/build/index.mjs.map +1 -1
  20. package/build/platform/cloudflare/index.cjs +30 -2
  21. package/build/platform/cloudflare/index.cjs.map +1 -1
  22. package/build/platform/cloudflare/index.d.cts +55 -2
  23. package/build/platform/cloudflare/index.d.mts +55 -2
  24. package/build/platform/cloudflare/index.mjs +28 -2
  25. package/build/platform/cloudflare/index.mjs.map +1 -1
  26. package/build/react-query/index.d.cts +1 -1
  27. package/build/react-query/index.d.mts +1 -1
  28. package/package.json +4 -4
  29. package/build/wsAcceptorCarrier-BDJRIPfu.cjs +0 -103
  30. package/build/wsAcceptorCarrier-BDJRIPfu.cjs.map +0 -1
  31. package/build/wsAcceptorCarrier-CW2qX25W.mjs +0 -80
  32. package/build/wsAcceptorCarrier-CW2qX25W.mjs.map +0 -1
package/README.md CHANGED
@@ -45,6 +45,10 @@ The high-level entry points — `connectChannel` (dial out) and `serveChannel` (
45
45
  reach for 95% of the time. The lower-level handler/carrier/transport objects they desugar to are
46
46
  documented at the end under [Lower-level building blocks](#lower-level-building-blocks).
47
47
 
48
+ > **Code blocks below are labelled by where they run:** `// shared.ts` (imported by both ends),
49
+ > `// server.ts` (the acceptor), `// client.ts` (the connector). A typical app is exactly these three
50
+ > files.
51
+
48
52
  ---
49
53
 
50
54
  ## Defining actions
@@ -52,6 +56,7 @@ documented at the end under [Lower-level building blocks](#lower-level-building-
52
56
  ### 1. Create a root domain (shared between both ends)
53
57
 
54
58
  ```ts
59
+ // shared.ts
55
60
  import { createActionRootDomain, actionSchema } from "@nice-code/action";
56
61
  import * as v from "valibot";
57
62
 
@@ -159,6 +164,7 @@ A **local handler** runs actions in the current process. Build one and register
159
164
  is what answers incoming requests.
160
165
 
161
166
  ```ts
167
+ // server.ts
162
168
  import { ActionRuntime, createLocalHandler, RuntimeCoordinate } from "@nice-code/action";
163
169
 
164
170
  export const serverCoord = RuntimeCoordinate.env("backend");
@@ -194,9 +200,10 @@ for local-first clients that resolve a few actions themselves and forward the re
194
200
 
195
201
  `serveChannel` is the one call that stands up an acceptor: it builds the crypto identity **once**, fans it
196
202
  across every carrier, registers your handlers, wires hibernation, and returns a server object whose
197
- `fetch` / `duplex` / `pushToClient` you forward straight to the host.
203
+ `fetch` / `receive` / `drop` / `pushToClient` you forward straight to the host.
198
204
 
199
205
  ```ts
206
+ // server.ts
200
207
  import {
201
208
  ActionRuntime,
202
209
  RuntimeCoordinate,
@@ -217,29 +224,35 @@ const server = serveChannel(runtime, appChannel, {
217
224
  ],
218
225
  });
219
226
 
220
- // Wire the host's events to the server:
227
+ // Wire the host's events to the server — `receive`/`drop` are the universal forwarding seam:
221
228
  // fetch(req) => server.fetch(req)
222
- // webSocketMessage(ws, msg) => server.duplex?.receive(ws, msg)
223
- // webSocketClose/Error(ws) => server.duplex?.drop(ws)
229
+ // webSocketMessage(ws, msg) => server.receive(ws, msg)
230
+ // webSocketClose/Error(ws) => server.drop(ws)
224
231
  ```
225
232
 
226
- `serveChannel(runtime, channel, options)` returns `{ handlers, fetch, duplex?, pushToClient }`:
233
+ `serveChannel(runtime, channel, options)` returns `{ handlers, fetch, receive, drop, pushToClient, broadcast }`:
227
234
 
228
235
  - **`fetch`** — a web-standard handler that does the WS upgrade, the (secure or plain) HTTP action POST,
229
236
  CORS preflight, and a `404` fallback. Forward the host's `fetch` straight to it.
230
- - **`duplex`** the `{ receive, drop }` lifecycle for the *sole* duplex carrier (a shortcut for the
231
- common single-WebSocket case; `undefined` when there are zero or several then feed each carrier
232
- handle directly).
233
- - **`pushToClient(target, request, opts?)`** — push a server-initiated action to one connected client
234
- (see [Bi-directional](#bi-directional-communication-acceptor--connector)).
237
+ - **`receive(conn, frame)` / `drop(conn)`** the universal connection lifecycle; forward your host's
238
+ message and close/error events here. Routes to the sole duplex carrier (the common single-WebSocket
239
+ case); with several duplex carriers, feed each carrier handle directly.
240
+ - **`pushToClient(target, request, opts?)`** / **`broadcast(makeRequest, opts?)`** — push a
241
+ server-initiated action to one / every connected client (see
242
+ [Bi-directional](#bi-directional-communication-acceptor--connector)).
235
243
  - **`handlers`** — the acceptor handlers it built, one per duplex carrier (reach for these for per-handler
236
244
  `broadcast`).
237
245
 
238
246
  Key options: `clientEnv` (required), `storage` (required only when a carrier is secure — the default),
239
- `carriers`, `handlers`, plus `securityLevel` / `link` / `verifyKeyResolver` / `defaultTimeout`.
247
+ `carriers`, `handlers`, `channelCases` (connection-aware cases see below), plus `securityLevel` /
248
+ `link` / `verifyKeyResolver` / `defaultTimeout`.
240
249
 
241
250
  > On Cloudflare, [`@nice-code/action/platform/cloudflare`](#cloudflare-durable-objects) collapses the
242
- > Durable Object carrier + storage boilerplate to one-liners.
251
+ > Durable Object carrier + storage + lifecycle boilerplate into a single `serveDurableObject` call.
252
+ >
253
+ > Serving in another environment (Bun, Node, …)? `serveChannel`'s carriers are environment-neutral, and
254
+ > `serveHost(runtime, channel, hostAdapter, options)` folds a reusable `{ carriers, storage, onServed }`
255
+ > host adapter into it — the same seam `serveDurableObject` is built on.
243
256
 
244
257
  ### Connecting — `connectChannel`
245
258
 
@@ -251,6 +264,7 @@ from `onPush` — all derived from the channel, no restated lists. It's the exac
251
264
  `serveChannel`.
252
265
 
253
266
  ```ts
267
+ // client.ts
254
268
  import {
255
269
  ActionRuntime,
256
270
  RuntimeCoordinate,
@@ -292,10 +306,11 @@ connectChannel(clientRuntime, appChannel, {
292
306
 
293
307
  ## Calling actions
294
308
 
295
- Once a runtime is wired, calling an action looks the same regardless of where it resolves (locally or
296
- over a carrier):
309
+ Once a runtime is wired, calling an action looks the same on **any** side client or server — and
310
+ regardless of where it resolves (locally or over a carrier):
297
311
 
298
312
  ```ts
313
+ // any runtime with the domain wired
299
314
  // Run and get the output directly (throws on a declared/transport error)
300
315
  const output = await userDomain.action.getUser
301
316
  .request({ userId: "u_123" })
@@ -325,7 +340,7 @@ connection — no second channel, no polling. The shape:
325
340
  ### Shared channel
326
341
 
327
342
  ```ts
328
- // Bidirectional: client sends `start_feed`; server pushes `position_update` back.
343
+ // shared.ts — bidirectional: client sends `start_feed`; server pushes `position_update` back.
329
344
  export const lobbyDomain = appRoot.createChildDomain({
330
345
  domain: "lobby",
331
346
  actions: {
@@ -347,6 +362,7 @@ export const appChannel = defineSecureChannel({
347
362
  ### Connector side — handle pushes with `onPush`
348
363
 
349
364
  ```ts
365
+ // client.ts
350
366
  connectChannel(clientRuntime, appChannel, {
351
367
  peer: serverCoord,
352
368
  storage,
@@ -366,6 +382,7 @@ connectChannel(clientRuntime, appChannel, {
366
382
  The local handler reads `action.context.originClient` to know who asked, then pushes to them:
367
383
 
368
384
  ```ts
385
+ // server.ts
369
386
  const lobbyHandler = createLocalHandler().forDomainActionCases(lobbyDomain, {
370
387
  start_feed: async (action) => {
371
388
  let delivered = 0;
@@ -392,26 +409,28 @@ server.broadcast(
392
409
  );
393
410
  ```
394
411
 
395
- > **When a handler needs the originating connection itself** (to register it in a room, etc.) rather than
396
- > just the client coordinate, pass `channelCases` to `serveChannel` — each case receives the request *and*
397
- > that client's live connection. With several duplex carriers (no sole handler), reach for a specific
398
- > `server.handlers[i].broadcast(...)` and `acceptChannelConnections(handler, channel, { ... })` directly
399
- > (see [Lower-level building blocks](#lower-level-building-blocks)).
412
+ > **When a handler needs the originating connection itself** (to register it in a room, track per-socket
413
+ > state, etc.) rather than just the client coordinate, pass `channelCases` to `serveChannel` /
414
+ > `serveDurableObject` each case receives the request *and* an `IConnectionContext` (`conn.state` /
415
+ > `conn.setState` / `conn.broadcast({ exceptSelf }) ` / `conn.pushBack` / `conn.connection`). With several
416
+ > duplex carriers (no sole handler), reach for a specific `server.handlers[i].broadcast(...)` and
417
+ > `acceptChannelConnections(handler, channel, { ... })` directly (see
418
+ > [Lower-level building blocks](#lower-level-building-blocks)).
400
419
 
401
420
  ---
402
421
 
403
422
  ## Cloudflare Durable Objects
404
423
 
405
- `@nice-code/action/platform/cloudflare` collapses the DO boilerplate (the `WebSocketPair` upgrade, the
406
- hibernation attachment wiring, and the DO-storage adapter) into one-liners you hand to `serveChannel`.
407
- The core library stays platform-agnostic nothing here is reachable from the main entry.
424
+ `@nice-code/action/platform/cloudflare` collapses the *entire* DO transport stack the hibernatable
425
+ secure WebSocket, an HTTP fallback, the DO-storage crypto identity, and the `ping`/`pong` keepalive
426
+ into a single `serveDurableObject` call, leaving the DO to forward its four socket lifecycle methods. The
427
+ core library stays platform-agnostic — nothing here is reachable from the main entry.
408
428
 
409
429
  ```ts
410
430
  import { DurableObject } from "cloudflare:workers";
411
- import { ActionRuntime, serveChannel, httpAcceptorCarrier } from "@nice-code/action";
431
+ import { ActionRuntime } from "@nice-code/action";
412
432
  import {
413
- durableObjectWsCarrier,
414
- durableObjectStorage,
433
+ serveDurableObject,
415
434
  type TDurableObjectChannelServer,
416
435
  } from "@nice-code/action/platform/cloudflare";
417
436
 
@@ -422,13 +441,12 @@ export class MyDurableObject extends DurableObject {
422
441
  if (this._server != null) return this._server;
423
442
  const runtime = new ActionRuntime(serverCoord);
424
443
 
425
- // One WS carrier (duplex pushes + hibernation persistence) + a secure HTTP fallback (exchange),
426
- // both sharing one crypto identity built from this DO's storage, surviving eviction.
427
- this._server = serveChannel(runtime, appChannel, {
444
+ // Hibernatable secure WS + plain HTTP fallback + DO-storage crypto identity + keepalive, all folded in.
445
+ this._server = serveDurableObject(this.ctx, appChannel, {
446
+ runtime,
428
447
  clientEnv: RuntimeCoordinate.env("frontend"),
429
- storage: durableObjectStorage(this.ctx, { keyPrefix: "ws:" }),
448
+ keyPrefix: "ws:",
430
449
  handlers: [userHandler],
431
- carriers: [durableObjectWsCarrier(this.ctx), httpAcceptorCarrier()],
432
450
  });
433
451
  return this._server;
434
452
  }
@@ -437,40 +455,53 @@ export class MyDurableObject extends DurableObject {
437
455
  return this.getServer().fetch(request);
438
456
  }
439
457
  async webSocketMessage(ws: WebSocket, msg: string | ArrayBuffer) {
440
- this.getServer().duplex?.receive(ws, msg);
458
+ this.getServer().receive(ws, msg);
441
459
  }
442
- async webSocketClose(ws: WebSocket) { this.getServer().duplex?.drop(ws); }
443
- async webSocketError(ws: WebSocket) { this.getServer().duplex?.drop(ws); }
460
+ async webSocketClose(ws: WebSocket) { this.getServer().drop(ws); }
461
+ async webSocketError(ws: WebSocket) { this.getServer().drop(ws); }
444
462
  }
445
463
  ```
446
464
 
447
- - **`durableObjectWsCarrier(ctx, { secure? })`** a hibernatable-WebSocket acceptor carrier with `send`,
448
- the `WebSocketPair` upgrade, and the socket-attachment access all derived from the DO's `ctx`. Pass
449
- `secure: false` for a plain WS endpoint (then no `storage` is needed for it). It exposes the attachment to
450
- `serveChannel`, which owns the layout: it persists the routing binding there and (when `connectionState`
451
- is requested) co-stores per-connection app state in the *same* slot, so both survive eviction.
452
- - **`durableObjectStorage(ctx, { keyPrefix? })`** — wraps the DO's storage as a `StorageAdapter` for
453
- `serveChannel`'s `storage`.
465
+ `serveDurableObject(ctx, channel, options)` takes the same `serveChannel` surface (`clientEnv`,
466
+ `handlers`, `channelCases`, `connectionState`, …) plus the host knobs:
467
+
468
+ - **`runtime`** this DO's runtime.
469
+ - **`keyPrefix`** namespace for the DO-storage crypto-identity keys.
470
+ - **`httpFallback`** — `"plain"` (default), `"secure"` (handshake-protected exchange sharing the WS
471
+ identity), or `false` (WebSocket only).
472
+ - **`secure`** — whether the WebSocket itself runs the handshake (default `true`).
473
+
474
+ For finer control the lower-level pieces are still exported: `cloudflareDurableObjectHost(ctx, opts)`
475
+ builds just the `{ carriers, storage, onServed }` host adapter (hand it to `serveHost`), and
476
+ `durableObjectWsCarrier` / `durableObjectStorage` build the individual carrier / storage adapter.
454
477
 
455
478
  ### Per-connection state + broadcast (stateful DOs)
456
479
 
457
- A presence/room DO that tracks who's on each socket and fans messages out adds two `serveChannel` knobs —
458
- no `handlers[0]`, no hand-wired attachment store:
480
+ A presence/room DO that tracks who's on each socket and fans messages out adds two knobs —
481
+ `connectionState` (typed per-socket app state, co-stored with the routing binding so both survive a wake)
482
+ and `channelCases`. Each case gets an **`IConnectionContext`** as its second argument — the originating
483
+ connection plus everything a case reaches for, so it never threads `ws` through `server.connections` /
484
+ `server.broadcast` by hand:
459
485
 
460
486
  ```ts
461
- const server = serveChannel(runtime, lobbyChannel, {
487
+ const server = serveDurableObject(this.ctx, lobbyChannel, {
488
+ runtime,
462
489
  clientEnv: RuntimeCoordinate.env("web"),
463
- storage: durableObjectStorage(this.ctx, { keyPrefix: "lobby-ws:" }),
464
- carriers: [durableObjectWsCarrier(this.ctx), httpAcceptorCarrier({ secure: false })],
465
- // Co-store each player's identity with the routing binding in the socket attachment (survives a wake).
490
+ keyPrefix: "lobby-ws:",
466
491
  connectionState: { schema: vs_player },
467
- // Connection-aware cases: each gets the request + the originating socket.
468
492
  channelCases: {
469
- join: (action, ws) => {
470
- if (ws) server.connections.set(ws, action.input); // typed by the schema
471
- server.broadcast(() => lobbyPush.action.player_joined.request(action.input), { except: ws });
493
+ join: (action, conn) => {
494
+ conn.setState(action.input); // typed by the schema; co-stored with the binding
495
+ conn.broadcast(() => lobbyPush.action.player_joined.request(action.input), { exceptSelf: true });
472
496
  return { players: this.roster() };
473
497
  },
498
+ move: (action, conn) => {
499
+ const player = conn.state; // this socket's typed app state (or null)
500
+ if (!player) return; // a move before join is dropped
501
+ conn.broadcast(() => lobbyPush.action.player_moved.request({ id: player.id, ...action.input }), {
502
+ exceptSelf: true,
503
+ });
504
+ },
474
505
  },
475
506
  });
476
507
 
@@ -478,12 +509,12 @@ const server = serveChannel(runtime, lobbyChannel, {
478
509
  for (const [, player] of server.connections.entries()) this.players.set(player.id, player);
479
510
  ```
480
511
 
481
- `connectionState` narrows the return so `server.connections` is non-optional, and `server.broadcast`
482
- fans out over the sole duplex carrier. The store's `read`/`write` are pluggable, so a DO that prefers to
483
- keep state in its SQLite/KV storage rather than the socket attachment can supply its own.
484
-
485
- Because the WS carrier persists each connection's binding on bind and replays it on construction, results
486
- and pushes still route to the right socket after the object wakes from eviction.
512
+ The `IConnectionContext` (`conn`) gives a case: `conn.state` / `conn.setState(x)` / `conn.clearState()`
513
+ (the typed app state), `conn.broadcast(makeRequest, { exceptSelf })`, `conn.pushBack(request)` (push down
514
+ this same socket), and `conn.connection` (the raw socket, `null` on the HTTP-exchange path). Passing
515
+ `connectionState` narrows the return so `server.connections` is non-optional. Because the WS carrier
516
+ persists each connection's binding on bind and replays it on construction, results and pushes still route
517
+ to the right socket after the object wakes from eviction.
487
518
 
488
519
  ---
489
520
 
@@ -514,7 +545,8 @@ plain HTTP fallback by giving the acceptor a `httpAcceptorCarrier({ secure: fals
514
545
  `serveChannel` accepts **any number of duplex carriers** (e.g. WebSocket + WebRTC) plus at most one
515
546
  exchange carrier. They all share one crypto identity and one runtime, and each result/push routes back
516
547
  over the carrier its client actually connected on (connection-aware return routing). With several duplex
517
- carriers, `server.duplex` is `undefined` — feed each carrier handle's own `receive`/`drop` directly.
548
+ carriers, `server.receive`/`server.drop` throw (they can't pick a carrier) — feed each carrier handle's
549
+ own `receive`/`drop` directly.
518
550
 
519
551
  ```ts
520
552
  const ws = wsAcceptorCarrier({ send: wsSend, upgrade, attachmentStore });
@@ -541,7 +573,7 @@ predicate is re-evaluated per action dispatch, so the transport switches on the
541
573
  holds, with no reconnect.
542
574
 
543
575
  ```ts
544
- // Prefer the secure socket, but only once a session id exists; fall back to HTTP meanwhile.
576
+ // client.ts — prefer the secure socket, but only once a session id exists; fall back to HTTP meanwhile.
545
577
  connectChannel(runtime, appChannel, {
546
578
  peer: serverCoord,
547
579
  storage,
@@ -1,4 +1,4 @@
1
- import { Pr as IRuntimeCoordinate, _ as TActionProgress } from "./ActionPayload.types-DXGiw1SF.mjs";
1
+ import { _ as TActionProgress, zr as IRuntimeCoordinate } from "./ActionPayload.types-L9k0LyBd.cjs";
2
2
  //#region ../nice-devtools-shared/src/components/PanelChrome.d.ts
3
3
  /** Where a devtools panel is docked. */
4
4
  type TDevtoolsPosition = "dock-bottom" | "dock-top" | "dock-left" | "dock-right";
@@ -76,4 +76,4 @@ declare class ActionDevtoolsCore {
76
76
  }
77
77
  //#endregion
78
78
  export { TDevtoolsActionStatus as a, IDevtoolsObservableDomain as i, IActionDevtoolsCoreOptions as n, TDevtoolsListener as o, IDevtoolsActionEntry as r, TDevtoolsPosition as s, ActionDevtoolsCore as t };
79
- //# sourceMappingURL=ActionDevtoolsCore-baIHExfj.d.mts.map
79
+ //# sourceMappingURL=ActionDevtoolsCore-CQ0vrvPD.d.cts.map
@@ -1,4 +1,4 @@
1
- import { Pr as IRuntimeCoordinate, _ as TActionProgress } from "./ActionPayload.types-CQM1HRw_.cjs";
1
+ import { _ as TActionProgress, zr as IRuntimeCoordinate } from "./ActionPayload.types-Dx1JPyfs.mjs";
2
2
  //#region ../nice-devtools-shared/src/components/PanelChrome.d.ts
3
3
  /** Where a devtools panel is docked. */
4
4
  type TDevtoolsPosition = "dock-bottom" | "dock-top" | "dock-left" | "dock-right";
@@ -76,4 +76,4 @@ declare class ActionDevtoolsCore {
76
76
  }
77
77
  //#endregion
78
78
  export { TDevtoolsActionStatus as a, IDevtoolsObservableDomain as i, IActionDevtoolsCoreOptions as n, TDevtoolsListener as o, IDevtoolsActionEntry as r, TDevtoolsPosition as s, ActionDevtoolsCore as t };
79
- //# sourceMappingURL=ActionDevtoolsCore-dApyYvTS.d.cts.map
79
+ //# sourceMappingURL=ActionDevtoolsCore-CiLBYC3K.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { INiceErrorDomainProps, InferNiceError, NiceError, NiceErrorDomain, err_cast_not_nice } from "@nice-code/error";
2
- import { StandardSchemaV1 } from "@standard-schema/spec";
3
2
  import { RuntimeName } from "std-env";
4
3
  import { ClientCryptoKeyLink, StorageAdapter, TSerializedCryptoKeyData_Ed25519_Raw, TSerializedCryptoKeyData_X25519_Raw, TTypeAndId } from "@nice-code/util";
5
4
  import * as v from "valibot";
5
+ import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
 
7
7
  //#region src/ActionDefinition/Schema/ActionSchema.types.d.ts
8
8
  type TTransportedValue<RAW_VAL, SERDE_VAL> = [RAW_VAL] | [RAW_VAL, SERDE_VAL];
@@ -1529,12 +1529,21 @@ type IAcceptorHandlerOptions<TConn> = IAcceptorHandlerBaseOptions<TConn> & ({
1529
1529
  formatMessage?: never;
1530
1530
  });
1531
1531
  /**
1532
- * A connection-aware execution case (see {@link AcceptorHandler.forConnectionDomainCases}). It
1533
- * receives the primed request plus the originating client's live connection (already resolved from the
1534
- * request's `originClient`, `undefined` if the socket is gone), and may return the action's raw output,
1535
- * a result payload, or nothing (auto-wrapped as an empty success) exactly like a local handler case.
1532
+ * A connection-aware execution case (see {@link AcceptorHandler.forConnectionDomainCases}). It receives
1533
+ * the primed request plus a per-invocation `context` — whatever the wiring's context mapper produces from
1534
+ * the originating connection. The low-level handler passes the raw connection (`TConn | undefined`); the
1535
+ * higher-level `serveChannel` enriches it into an `IConnectionContext` (state + broadcast + pushBack). A
1536
+ * case may return the action's raw output, a result payload, or nothing (auto-wrapped as an empty
1537
+ * success) — exactly like a local handler case.
1536
1538
  */
1537
- type TAcceptorConnectionCaseFn<DOM extends IActionDomain, ID extends keyof DOM["actionSchema"] & string, TConn> = (action: TDistributeActionPayload_Request<DOM, ID>, connection: TConn | undefined) => ReturnType<THandleActionExecutionFn<DOM, ID>> | void;
1539
+ type TAcceptorCaseFn<DOM extends IActionDomain, ID extends keyof DOM["actionSchema"] & string, TCtx> = (action: TDistributeActionPayload_Request<DOM, ID>, context: TCtx) => ReturnType<THandleActionExecutionFn<DOM, ID>> | void;
1540
+ /**
1541
+ * The connection-aware case the bare {@link AcceptorHandler} serves: its `context` is the originating
1542
+ * client's live connection (resolved from the request's `originClient`, `undefined` if the socket is
1543
+ * gone). It's {@link TAcceptorCaseFn} fixed to `TConn | undefined` — the un-enriched shape used by
1544
+ * {@link AcceptorHandler.forConnectionDomainCases} and `acceptChannelConnections`.
1545
+ */
1546
+ type TAcceptorConnectionCaseFn<DOM extends IActionDomain, ID extends keyof DOM["actionSchema"] & string, TConn> = TAcceptorCaseFn<DOM, ID, TConn | undefined>;
1538
1547
  /**
1539
1548
  * Server-side handler for backends that accept many client connections over a single open channel
1540
1549
  * (WebSockets, Durable Objects, …). It is transport-agnostic: you feed it inbound frames with
@@ -1648,11 +1657,15 @@ declare class AcceptorHandler<TConn = unknown> extends PeerLinkHandler {
1648
1657
  forConnectionDomainCases<FOR_DOM extends IActionDomain>(domain: ActionDomain<FOR_DOM>, cases: { [ID in keyof FOR_DOM["actionSchema"] & string]?: TAcceptorConnectionCaseFn<FOR_DOM, ID, TConn> }): ActionLocalHandler;
1649
1658
  /**
1650
1659
  * Like {@link forConnectionDomainCases} but spanning several domains with one merged case map — used
1651
- * by channel-derived wiring (`acceptChannelConnections`) where the channel's `toAcceptor` domains are
1652
- * served together. Each domain takes only the cases whose ids it owns, so a single map can cover
1653
- * several domains and unrelated ids are ignored.
1660
+ * by channel-derived wiring (`acceptChannelConnections` / `serveChannel`) where the channel's
1661
+ * `toAcceptor` domains are served together. Each domain takes only the cases whose ids it owns, so a
1662
+ * single map can cover several domains and unrelated ids are ignored.
1663
+ *
1664
+ * `mapContext` turns the resolved connection into whatever the case's second argument should be: the
1665
+ * raw connection for the low-level helper, or an enriched `IConnectionContext` for `serveChannel`. It's
1666
+ * called once per inbound action, after the originating connection is resolved.
1654
1667
  */
1655
- forConnectionDomainCasesMulti(domains: readonly ActionDomain<any>[], cases: Record<string, TAcceptorConnectionCaseFn<any, any, TConn> | undefined>): ActionLocalHandler;
1668
+ forConnectionDomainCasesMulti<TCtx>(domains: readonly ActionDomain<any>[], cases: Record<string, TAcceptorCaseFn<any, any, TCtx> | undefined>, mapContext: (connection: TConn | undefined, request: ActionPayload_Request<any, any>) => TCtx): ActionLocalHandler;
1656
1669
  /**
1657
1670
  * Fan a server-initiated request out to every currently-bound connection. A fresh request is built
1658
1671
  * per connection (each push mutates its own action context) and dispatched fire-and-forget. Pass
@@ -1958,14 +1971,16 @@ interface IConnectChannelOptions<TO_CONNECTOR extends readonly ActionDomain<any>
1958
1971
  * Returns the {@link ConnectorHandler} so the caller can later `clearTransportCache()` it.
1959
1972
  */
1960
1973
  declare function connectChannel<TO_ACCEPTOR extends readonly ActionDomain<any>[], TO_CONNECTOR extends readonly ActionDomain<any>[]>(runtime: ActionRuntime, channel: ISecureChannel<TO_ACCEPTOR, TO_CONNECTOR>, options: IConnectChannelOptions<TO_CONNECTOR>): ConnectorHandler;
1961
- type TDomainAcceptorCases<D, TConn> = D extends ActionDomain<infer DEF> ? { [ID in keyof DEF["actionSchema"] & string]?: TAcceptorConnectionCaseFn<DEF, ID, TConn> } : never;
1974
+ type TDomainAcceptorCases<D, TCtx> = D extends ActionDomain<infer DEF> ? { [ID in keyof DEF["actionSchema"] & string]?: TAcceptorCaseFn<DEF, ID, TCtx> } : never;
1962
1975
  /**
1963
1976
  * The connection-aware case map for a channel's acceptor side: the merged set of every
1964
- * connector→acceptor (`toAcceptor`) action handler, each receiving the primed request plus the
1965
- * originating connection. Derived from the channel's `toAcceptorDomains`, so the keys and input/output
1966
- * types follow the channel.
1977
+ * connector→acceptor (`toAcceptor`) action handler, each receiving the primed request plus a per-action
1978
+ * `context`. `TCtx` is whatever the wiring supplies as that second argument — the raw connection
1979
+ * (`TConn | undefined`) for the low-level `acceptChannelConnections`, or an enriched `IConnectionContext`
1980
+ * for `serveChannel`'s `channelCases`. Derived from the channel's `toAcceptorDomains`, so the keys and
1981
+ * input/output types follow the channel.
1967
1982
  */
1968
- type TChannelAcceptorCases<TO_ACCEPTOR extends readonly ActionDomain<any>[], TConn> = TUnionToIntersection<TDomainAcceptorCases<TO_ACCEPTOR[number], TConn>>;
1983
+ type TChannelAcceptorCases<TO_ACCEPTOR extends readonly ActionDomain<any>[], TCtx> = TUnionToIntersection<TDomainAcceptorCases<TO_ACCEPTOR[number], TCtx>>;
1969
1984
  /**
1970
1985
  * Register an acceptor handler's execution for a channel straight from its definition: the channel's
1971
1986
  * `toAcceptor` domains are served together with one merged, connection-aware case map (each case gets
@@ -1975,8 +1990,11 @@ type TChannelAcceptorCases<TO_ACCEPTOR extends readonly ActionDomain<any>[], TCo
1975
1990
  * ```ts
1976
1991
  * runtime.addHandlers([acceptChannelConnections(serverHandler, channel, { … }), serverHandler]);
1977
1992
  * ```
1993
+ *
1994
+ * The case's second argument is the raw connection (`TConn | undefined`). For the richer state +
1995
+ * broadcast + pushBack context, serve the channel through `serveChannel`'s `channelCases` instead.
1978
1996
  */
1979
- declare function acceptChannelConnections<TO_ACCEPTOR extends readonly ActionDomain<any>[], TConn>(serverHandler: AcceptorHandler<TConn>, channel: IActionChannel<TO_ACCEPTOR, any>, cases: TChannelAcceptorCases<TO_ACCEPTOR, TConn>): ActionLocalHandler;
1997
+ declare function acceptChannelConnections<TO_ACCEPTOR extends readonly ActionDomain<any>[], TConn>(serverHandler: AcceptorHandler<TConn>, channel: IActionChannel<TO_ACCEPTOR, any>, cases: TChannelAcceptorCases<TO_ACCEPTOR, TConn | undefined>): ActionLocalHandler;
1980
1998
  interface IAcceptChannelOptions<TConn> {
1981
1999
  /**
1982
2000
  * Coordinate of the *connecting clients* (typically env-only, e.g. `RuntimeCoordinate.env("web_app")`),
@@ -2274,6 +2292,43 @@ interface IServeConnectionStateOptions<TApp> {
2274
2292
  */
2275
2293
  schema?: StandardSchemaV1<unknown, TApp>;
2276
2294
  }
2295
+ /**
2296
+ * The per-action handle a `serveChannel` `channelCases` case receives as its second argument — the
2297
+ * originating connection enriched with everything a case typically reaches for, so it never threads
2298
+ * `ws` through `this.connections` / `this.server` by hand:
2299
+ *
2300
+ * - {@link state} / {@link setState} / {@link clearState} — the connection's typed app state (when
2301
+ * `connectionState` is configured), co-stored with the routing binding so it survives hibernation.
2302
+ * - {@link broadcast} — fan a server push to every other connection (skip self with `exceptSelf`).
2303
+ * - {@link pushBack} — push a server-initiated action down *this* same connection.
2304
+ *
2305
+ * Over the HTTP-exchange path there is no live socket: {@link connection} is `null`, {@link state} reads
2306
+ * `null`, {@link setState}/{@link clearState} are no-ops, and {@link pushBack} throws (an exchange reply
2307
+ * rides its own request — it can't carry an unsolicited push).
2308
+ */
2309
+ interface IConnectionContext<TConn, TApp = unknown> {
2310
+ /** The originating live connection, or `null` on the HTTP-exchange path (escape hatch). */
2311
+ connection: TConn | null;
2312
+ /** The originating client's coordinate (`= action.context.originClient`). */
2313
+ origin: RuntimeCoordinate;
2314
+ /** This connection's app state, or `null` if unset / no live socket. */
2315
+ state: TApp | null;
2316
+ /** Set this connection's app state (no-op without a live socket). Preserves the routing binding. */
2317
+ setState: (value: TApp) => void;
2318
+ /** Clear this connection's app state but keep the routing binding (no-op without a live socket). */
2319
+ clearState: () => void;
2320
+ /** Fan a server-initiated action out to every connection; `exceptSelf` skips this one. */
2321
+ broadcast: <DOM extends IActionDomain, ID extends keyof DOM["actionSchema"] & string>(makeRequest: () => ActionPayload_Request<DOM, ID>, options?: {
2322
+ exceptSelf?: boolean;
2323
+ where?: (connection: TConn) => boolean;
2324
+ timeout?: number;
2325
+ onError?: (error: unknown, connection: TConn) => void;
2326
+ }) => void;
2327
+ /** Push a server-initiated action down this same connection. Throws if there is no live socket. */
2328
+ pushBack: <DOM extends IActionDomain, ID extends keyof DOM["actionSchema"] & string>(request: ActionPayload_Request<DOM, ID>, options?: {
2329
+ timeout?: number;
2330
+ }) => RunningAction<DOM, ID>;
2331
+ }
2277
2332
  interface IServeChannelOptions<TO_ACCEPTOR extends readonly ActionDomain<any>[], TConn, TApp = unknown> {
2278
2333
  /**
2279
2334
  * Coordinate of the *connecting clients* (typically env-only, e.g. `RuntimeCoordinate.env("web_app")`),
@@ -2320,10 +2375,11 @@ interface IServeChannelOptions<TO_ACCEPTOR extends readonly ActionDomain<any>[],
2320
2375
  connectionState?: IServeConnectionStateOptions<TApp>;
2321
2376
  /**
2322
2377
  * Connection-aware action cases for the channel's acceptor (`toAcceptor`) domains — each case receives the
2323
- * primed request *and* the originating connection (the connection-aware dual of `handlers`). Registered on
2324
- * the runtime for you. Requires exactly one duplex carrier.
2378
+ * primed request *and* an {@link IConnectionContext} (the connection plus its typed `state` and
2379
+ * `broadcast`/`pushBack`). The connection-aware dual of `handlers`, registered on the runtime for you.
2380
+ * Requires exactly one duplex carrier.
2325
2381
  */
2326
- channelCases?: TChannelAcceptorCases<TO_ACCEPTOR, TConn>;
2382
+ channelCases?: TChannelAcceptorCases<TO_ACCEPTOR, IConnectionContext<TConn, TApp>>;
2327
2383
  }
2328
2384
  /**
2329
2385
  * One server serving a secure channel over several carriers — the accept-in dual of `connectChannel`,
@@ -2342,11 +2398,17 @@ interface IChannelServer<TConn, TApp = unknown> {
2342
2398
  */
2343
2399
  fetch: (request: Request) => Promise<Response>;
2344
2400
  /**
2345
- * Convenience lifecycle for the *sole* duplex carrier `receive` inbound frames, `drop` on close. Set
2346
- * only when exactly one duplex carrier was provided; with several, feed each carrier handle directly
2347
- * (every duplex carrier is its own lifecycle handle). `undefined` when there are zero or multiple.
2401
+ * Feed one inbound frame from a live connection into the server forward your host's "message" event
2402
+ * here (a Durable Object's `webSocketMessage`, a Bun `websocket.message`, a Node `ws.on("message")`).
2403
+ * Routes to the sole duplex carrier; throws with a clear message when there are zero or several duplex
2404
+ * carriers (for the multi-carrier case feed each `handlers[i]` / carrier handle directly).
2348
2405
  */
2349
- duplex?: IDuplexConnectionRouter<TConn>;
2406
+ receive: (connection: TConn, frame: string | Uint8Array | ArrayBuffer) => void;
2407
+ /**
2408
+ * Forget a connection on close/error — forward your host's "close"/"error" event here. Routes to the
2409
+ * sole duplex carrier; a no-op when there are none (an HTTP-only server has no sockets to drop).
2410
+ */
2411
+ drop: (connection: TConn) => void;
2350
2412
  /**
2351
2413
  * Push a server-initiated action to a connected client (the runtime is bound in, so unlike
2352
2414
  * {@link AcceptorHandler.pushToClient} you pass only the target + request). It routes through the duplex
@@ -2380,21 +2442,24 @@ interface IChannelServer<TConn, TApp = unknown> {
2380
2442
  * `(runtime, channel)` and fans them across every carrier, so the WebSocket and the secure-HTTP endpoint
2381
2443
  * can never drift apart. It registers your handlers (plus the duplex acceptor it builds) on the runtime,
2382
2444
  * wires hibernation when the duplex carrier exposes an attachment store, and returns a single
2383
- * {@link IChannelServer} whose `fetch` / `duplex` / `pushToClient` / `broadcast` you forward straight to
2384
- * the host:
2445
+ * {@link IChannelServer} whose `fetch` / `receive` / `drop` / `pushToClient` / `broadcast` you forward
2446
+ * straight to the host:
2385
2447
  * ```ts
2386
2448
  * const server = serveChannel(runtime, channel, {
2387
2449
  * clientEnv, storage,
2388
2450
  * carriers: [wsAcceptorCarrier({ send, upgrade, attachmentStore }), httpAcceptorCarrier()],
2389
2451
  * connectionState: { schema: vs_player }, // optional: co-store per-connection app state (survives hibernation)
2390
- * channelCases: { join: (action, conn) => { … } }, // optional: connection-aware action cases
2452
+ * channelCases: { join: (action, conn) => { conn.setState(action.input); … } }, // connection-aware cases
2391
2453
  * });
2392
2454
  * // fetch(req) => server.fetch(req)
2393
- * // webSocketMessage(conn, m) => server.duplex?.receive(conn, m)
2394
- * // webSocketClose/Error(conn) => server.duplex?.drop(conn)
2455
+ * // webSocketMessage(conn, m) => server.receive(conn, m)
2456
+ * // webSocketClose/Error(conn) => server.drop(conn)
2395
2457
  * // server.connections.get(conn) / server.broadcast(() => push.request(…), { except: conn })
2396
2458
  * ```
2397
2459
  *
2460
+ * On Cloudflare, `serveDurableObject` folds the whole DO transport stack (carriers + storage + keepalive)
2461
+ * into this — reach for it instead of assembling the carriers by hand.
2462
+ *
2398
2463
  * `TConn` (the live-connection token a duplex carrier hands back through `send`/`receive`/`drop`) is
2399
2464
  * inferred from the carriers — `WebSocket` for `wsAcceptorCarrier`, the data-channel type for a WebRTC
2400
2465
  * carrier, and so on — so it stays carrier-agnostic. Passing `connectionState` narrows the return so
@@ -2407,6 +2472,44 @@ declare function serveChannel<TO_ACCEPTOR extends readonly ActionDomain<any>[],
2407
2472
  };
2408
2473
  declare function serveChannel<TO_ACCEPTOR extends readonly ActionDomain<any>[] = readonly ActionDomain<any>[], TO_CONNECTOR extends readonly ActionDomain<any>[] = readonly ActionDomain<any>[], TConn = unknown, TApp = unknown>(runtime: ActionRuntime, channel: ISecureChannel<TO_ACCEPTOR, TO_CONNECTOR>, options: IServeChannelOptions<TO_ACCEPTOR, TConn, TApp>): IChannelServer<TConn, TApp>;
2409
2474
  //#endregion
2475
+ //#region src/ActionRuntime/Channel/serveHost.d.ts
2476
+ /**
2477
+ * An environment-neutral description of *where* a channel is served — the accept-in dual of a connector's
2478
+ * transport stack, factored out so a platform adapter (a Cloudflare Durable Object, a Bun/Node WebSocket
2479
+ * server, …) supplies only what differs per environment while the channel + case wiring stays identical.
2480
+ * A host bundles:
2481
+ *
2482
+ * - the {@link carriers} the channel is served over (e.g. a WebSocket + an HTTP fallback),
2483
+ * - the {@link storage} backing the server's crypto identity, and
2484
+ * - an {@link onServed} hook run once the server exists (e.g. registering a keepalive auto-response).
2485
+ *
2486
+ * Build one with a platform helper (`cloudflareDurableObjectHost`) and hand it to {@link serveHost}.
2487
+ */
2488
+ interface IChannelHostAdapter<TConn> {
2489
+ /** The carriers this channel is served over — the accept-in dual of `connectChannel`'s `transports`. */
2490
+ carriers: readonly TAcceptorCarrier<TConn>[];
2491
+ /** Backing store for the server's crypto identity + TOFU pins. Required when any carrier is secure. */
2492
+ storage?: StorageAdapter;
2493
+ /** Run once after the server is built — e.g. register a transport keepalive. */
2494
+ onServed?: (server: IChannelServer<TConn, unknown>) => void;
2495
+ }
2496
+ /** {@link serveChannel}'s options minus what the host adapter supplies (`carriers`, `storage`). */
2497
+ type TServeHostOptions<TO_ACCEPTOR extends readonly ActionDomain<any>[], TConn, TApp = unknown> = Omit<IServeChannelOptions<TO_ACCEPTOR, TConn, TApp>, "carriers" | "storage">;
2498
+ /**
2499
+ * Serve a channel over a {@link IChannelHostAdapter} — the environment-neutral core every platform helper
2500
+ * (e.g. `serveDurableObject`) composes. It folds the host's carriers + storage into `serveChannel`, then
2501
+ * runs the host's `onServed` hook. Everything else (`clientEnv`, `channelCases`, `connectionState`,
2502
+ * `handlers`, …) is the same `serveChannel` surface, so moving a server between environments is swapping
2503
+ * the host adapter and nothing else. Passing `connectionState` narrows the return so `server.connections`
2504
+ * is non-optional, exactly as with `serveChannel`.
2505
+ */
2506
+ declare function serveHost<TO_ACCEPTOR extends readonly ActionDomain<any>[], TO_CONNECTOR extends readonly ActionDomain<any>[], TConn, TApp>(runtime: ActionRuntime, channel: ISecureChannel<TO_ACCEPTOR, TO_CONNECTOR>, host: IChannelHostAdapter<TConn>, options: TServeHostOptions<TO_ACCEPTOR, TConn, TApp> & {
2507
+ connectionState: IServeConnectionStateOptions<TApp>;
2508
+ }): IChannelServer<TConn, TApp> & {
2509
+ connections: ConnectionStateStore<TConn, TApp>;
2510
+ };
2511
+ declare function serveHost<TO_ACCEPTOR extends readonly ActionDomain<any>[] = readonly ActionDomain<any>[], TO_CONNECTOR extends readonly ActionDomain<any>[] = readonly ActionDomain<any>[], TConn = unknown, TApp = unknown>(runtime: ActionRuntime, channel: ISecureChannel<TO_ACCEPTOR, TO_CONNECTOR>, host: IChannelHostAdapter<TConn>, options: TServeHostOptions<TO_ACCEPTOR, TConn, TApp>): IChannelServer<TConn, TApp>;
2512
+ //#endregion
2410
2513
  //#region src/ActionRuntime/Transport/SecureSession/exchangeAcceptor.d.ts
2411
2514
  /** Acceptor secure config for the exchange (HTTP) endpoint — same identity an `AcceptorHandler` uses. */
2412
2515
  interface IExchangeAcceptorSecurity {
@@ -3264,5 +3367,5 @@ interface IActionPayload_Result_JsonObject<DOM extends IActionDomain = IActionDo
3264
3367
  type TActionPayload_Any_Instance<DOM extends IActionDomain = IActionDomain, ID extends keyof DOM["actionSchema"] & string = keyof DOM["actionSchema"] & string> = ActionPayload_Request<DOM, ID> | ActionPayload_Result<DOM, ID> | ActionPayload_Progress<DOM, ID>;
3265
3368
  type TActionPayload_Any_JsonObject<DOM extends IActionDomain = IActionDomain, ID extends keyof DOM["actionSchema"] & string = keyof DOM["actionSchema"] & string> = IActionPayload_Request_JsonObject<DOM, ID> | IActionPayload_Progress_JsonObject<DOM, ID> | IActionPayload_Result_JsonObject<DOM, ID>;
3266
3369
  //#endregion
3267
- export { wsAcceptorCarrier as $, ESecurityLevel as $n, actionSchema as $r, TCarrier as $t, encodeExchange as A, ITransportStatusInfo_Base as An, TRunningActionUpdate as Ar, createHibernatableWsServerAdapter as At, IActionFrameCrypto as B, TOnResolveIncomingRequestJson as Bn, IActionDomain as Br, TChannelPushHandlers as Bt, decodeActionFrame as C, IActionTransportResolvers as Cn, ERunningActionFinishedType as Cr, IAcceptorAttachmentStore as Ct, TExchangeRequest as D, ITransportRouteActionParams as Dn, IRunningActionUpdate_Progress as Dr, isExchangeAcceptorCarrier as Dt, TExchangeReply as E, ITransportMethod_SendActionData_Input as En, IRunningActionUpdate_Abort as Er, TAcceptorCarrier as Et, EErrId_NiceTransport as F, IUpdateActionRunConfig_Output as Fn, IRuntimeCoordinateSpecifics as Fr, IAcceptChannelOptions as Ft, IHttpCarrierRequest as G, TTransportCache as Gn, TDomainActionId as Gr, ISecureChannel as Gt, createActionFrameCrypto as H, TOnResolveIncomingResponseJson as Hn, IActionRootDomain as Hr, acceptChannelConnections as Ht, err_nice_transport as I, TGetTransportFn as In, IRuntimeFullCoordinates as Ir, IActionChannel as It, IHttpAcceptorCarrierOptions as J, TTransportStatusInfo_GetTransport_Output as Jn, TPossibleDomainId as Jr, createBinaryWireSessionFactory as Jt, TCarrierFetch as K, TTransportInitializationFinishedInfo as Kn, TInferInputFromSchema as Kr, defineSecureChannel as Kt, ExchangeTransport as L, TOnResolveAnyIncomingActionData as Ln, RuntimeCoordinate as Lr, IConnectChannelOptions as Lt, LinkTransport as M, ITransportStatusInfo_Initializing as Mn, TRunningActionUpdateListener as Mr, IConnectionAttachment as Mt, IActionTransportReadyData_Link as N, ITransportStatusInfo_Ready as Nn, ActionPayload_Result as Nr, IConnectionStateStoreOptions as Nt, decodeExchangeReply as O, ITransportRouteClientParams as On, IRunningActionUpdate_Started as Or, IDuplexConnectionRouter as Ot, TLinkFormatMessage as P, ITransportStatusInfo_Unsupported as Pn, IRuntimeCoordinate as Pr, createConnectionStateStore as Pt, IWsAcceptorCarrierOptions as Q, EHandshakeMessageType as Qn, TInferActionError as Qr, IExchangeCarrierSource as Qt, IExchangeTransportOptions as R, TOnResolveAnyIncomingActionData_Json as Rn, TRuntimeCoordinateEnvId as Rr, IConnectTransport as Rt, IActionFrameDecoder as S, IActionTransportReadyData_Methods as Sn, IActionCore_JsonObject as Sr, serveChannel as St, err_nice_action as T, ITransportDispatchAction as Tn, ERunningActionUpdateType as Tr, IExchangeAcceptorCarrier as Tt, createBinaryWireAdapter as U, TSendActionDataMethod as Un, TActionDomainChildDef as Ur, connectChannel as Ut, IActionFrameCryptoConfig as V, TOnResolveIncomingResponse as Vn, IActionDomainChildOptions as Vr, acceptChannel as Vt, IHttpCarrierOptions as W, TSendReturnDataMethod as Wn, TActionDomainSchema as Wr, defineChannel as Wt, IWsCarrierOptions as X, ITransportConnectionContext as Xn, ActionSchema as Xr, IDuplexCarrierSource as Xt, httpAcceptorCarrier as Y, TUpdateActionRunConfig as Yn, TPossibleDomainIdList as Yr, IDuplexCarrier as Yt, wsCarrier as Z, Transport as Zn, EActionResponseMode as Zr, IExchangeCarrier as Zt, TActionProgress as _, ETransportStatus as _n, MaybePromise as _r, IExchangeAcceptorConfig as _t, IActionPayload_Data_Base as a, TActionChannelFormatMessage as an, IServerHandshakeConfig as ar, rtcDataChannelByteChannel as at, isActionPayload_Request_JsonObject as b, IActionTransportReady as bn, ActionPayload_Request as br, IServeChannelOptions as bt, IActionPayload_Request_JsonObject as c, IActionWireFormat as cn, createInMemoryTofuVerifyKeyResolver as cr, IInMemoryChannelPair as ct, IActionProgress_Custom as d, ActionDomain as dn, decodeHandshakeMessage as dr, err_nice_external_client as dt, TActionSchemaOptions as ei, TFrame$1 as en, IClientHandshakeConfig as er, EErrId_NiceTransport_WebSocket as et, IActionProgress_None as f, ActionRootDomain as fn, encodeHandshakeMessage as fr, ISecureAcceptorHandlerOptions as ft, TActionPayload_Any_JsonObject as g, ETransportShape as gn, createLocalHandler as gr, ExchangeAcceptor as gt, TActionPayload_Any_Instance as h, createConnectorHandler as hn, ActionLocalHandler as hr, createActionFetchHandler as ht, IActionPayload_Base_JsonObject as i, TAcceptorConnectionCaseFn as in, IHandshakeResult as ir, IRtcDataChannelLike as it, ILinkTransportOptions as j, ITransportStatusInfo_Failed as jn, TRunningActionUpdateFinished as jr, ConnectionStateStore as jt, decodeExchangeRequest as k, ITransportRouteInfo as kn, IRunningActionUpdate_Success as kr, IHibernatableWsServerAdapterOptions as kt, IActionPayload_Result as l, createActionRootDomain as ln, createServerHandshake as lr, IInMemoryServerEndpoint as lt, IActionRouteItemHandler as m, ConnectorHandler as mn, PeerLinkHandler as mr, IActionFetchHandlerOptions as mt, EActionProgressType as n, TTransportedValue as ni, IAcceptorConnectionBinding as nn, IClientVerifyKeyResolver as nr, IRtcCarrierOptions as nt, IActionPayload_Progress as o, TActionConnectionEncoding as on, THandshakeMessage as or, IInMemoryCarrier as ot, IActionProgress_Percentage as p, ActionRuntime as pn, runtimeLinkId as pr, createSecureAcceptorHandler as pt, httpCarrier as q, TTransportStatusInfo as qn, TInferOutputFromSchema as qr, IBinaryWireSessionOptions as qt, IActionPayload_Base as r, IAcceptorHandlerOptions as rn, IHandshakeEncryptionKeyMaterial as rr, rtcCarrier as rt, IActionPayload_Progress_JsonObject as s, createAcceptorHandler as sn, createClientHandshake as sr, inMemoryCarrier as st, EActionPayloadType as t, TActionSerializationDefinition as ti, AcceptorHandler as tn, IClientVerifyKeyResolveInput as tr, err_nice_transport_ws as tt, IActionPayload_Result_JsonObject as u, ActionCore as un, createStorageTofuVerifyKeyResolver as ur, createInMemoryChannelPair as ut, TActionResultOutcome as v, IActionTransportDef as vn, RunningAction as vr, IExchangeAcceptorSecurity as vt, EErrId_NiceAction as w, ISecureClientConfig as wn, ERunningActionState as wr, IDuplexAcceptorCarrier as wt, isActionPayload_Any_JsonObject as x, IActionTransportReadyData_Base as xn, IActionCore as xr, IServeConnectionStateOptions as xt, isActionPayload_Result_JsonObject as y, IActionTransportInitialized as yn, ActionPayload_Progress as yr, IChannelServer as yt, IActionTransportReadyData_Exchange as z, TOnResolveIncomingRequest as zn, TRuntimeCoordinateStringId as zr, TChannelAcceptorCases as zt };
3268
- //# sourceMappingURL=ActionPayload.types-CQM1HRw_.d.cts.map
3370
+ export { wsAcceptorCarrier as $, TTransportStatusInfo_GetTransport_Output as $n, TPossibleDomainId as $r, IDuplexCarrier as $t, encodeExchange as A, ITransportDispatchAction as An, ERunningActionUpdateType as Ar, TAcceptorCarrier as At, IActionFrameCrypto as B, IUpdateActionRunConfig_Output as Bn, IRuntimeCoordinateSpecifics as Br, IActionChannel as Bt, decodeActionFrame as C, IActionTransportDef as Cn, RunningAction as Cr, IConnectionContext as Ct, TExchangeRequest as D, IActionTransportReadyData_Methods as Dn, IActionCore_JsonObject as Dr, IAcceptorAttachmentStore as Dt, TExchangeReply as E, IActionTransportReadyData_Base as En, IActionCore as Er, serveChannel as Et, EErrId_NiceTransport as F, ITransportStatusInfo_Base as Fn, TRunningActionUpdate as Fr, ConnectionStateStore as Ft, IHttpCarrierRequest as G, TOnResolveIncomingRequestJson as Gn, IActionDomain as Gr, acceptChannel as Gt, createActionFrameCrypto as H, TOnResolveAnyIncomingActionData as Hn, RuntimeCoordinate as Hr, IConnectTransport as Ht, err_nice_transport as I, ITransportStatusInfo_Failed as In, TRunningActionUpdateFinished as Ir, IConnectionAttachment as It, IHttpAcceptorCarrierOptions as J, TSendActionDataMethod as Jn, TActionDomainChildDef as Jr, defineChannel as Jt, TCarrierFetch as K, TOnResolveIncomingResponse as Kn, IActionDomainChildOptions as Kr, acceptChannelConnections as Kt, ExchangeTransport as L, ITransportStatusInfo_Initializing as Ln, TRunningActionUpdateListener as Lr, IConnectionStateStoreOptions as Lt, LinkTransport as M, ITransportRouteActionParams as Mn, IRunningActionUpdate_Progress as Mr, IDuplexConnectionRouter as Mt, IActionTransportReadyData_Link as N, ITransportRouteClientParams as Nn, IRunningActionUpdate_Started as Nr, IHibernatableWsServerAdapterOptions as Nt, decodeExchangeReply as O, IActionTransportResolvers as On, ERunningActionFinishedType as Or, IDuplexAcceptorCarrier as Ot, TLinkFormatMessage as P, ITransportRouteInfo as Pn, IRunningActionUpdate_Success as Pr, createHibernatableWsServerAdapter as Pt, IWsAcceptorCarrierOptions as Q, TTransportStatusInfo as Qn, TInferOutputFromSchema as Qr, createBinaryWireSessionFactory as Qt, IExchangeTransportOptions as R, ITransportStatusInfo_Ready as Rn, ActionPayload_Result as Rr, createConnectionStateStore as Rt, IActionFrameDecoder as S, ETransportStatus as Sn, MaybePromise as Sr, IChannelServer as St, err_nice_action as T, IActionTransportReady as Tn, ActionPayload_Request as Tr, IServeConnectionStateOptions as Tt, createBinaryWireAdapter as U, TOnResolveAnyIncomingActionData_Json as Un, TRuntimeCoordinateEnvId as Ur, TChannelAcceptorCases as Ut, IActionFrameCryptoConfig as V, TGetTransportFn as Vn, IRuntimeFullCoordinates as Vr, IConnectChannelOptions as Vt, IHttpCarrierOptions as W, TOnResolveIncomingRequest as Wn, TRuntimeCoordinateStringId as Wr, TChannelPushHandlers as Wt, IWsCarrierOptions as X, TTransportCache as Xn, TDomainActionId as Xr, defineSecureChannel as Xt, httpAcceptorCarrier as Y, TSendReturnDataMethod as Yn, TActionDomainSchema as Yr, ISecureChannel as Yt, wsCarrier as Z, TTransportInitializationFinishedInfo as Zn, TInferInputFromSchema as Zr, IBinaryWireSessionOptions as Zt, TActionProgress as _, ActionRootDomain as _n, encodeHandshakeMessage as _r, IExchangeAcceptorConfig as _t, IActionPayload_Data_Base as a, TActionSchemaOptions as ai, AcceptorHandler as an, IClientHandshakeConfig as ar, rtcDataChannelByteChannel as at, isActionPayload_Request_JsonObject as b, createConnectorHandler as bn, ActionLocalHandler as br, TServeHostOptions as bt, IActionPayload_Request_JsonObject as c, TAcceptorCaseFn as cn, IHandshakeEncryptionKeyMaterial as cr, IInMemoryChannelPair as ct, IActionProgress_Custom as d, TActionConnectionEncoding as dn, THandshakeMessage as dr, err_nice_external_client as dt, TPossibleDomainIdList as ei, IDuplexCarrierSource as en, TUpdateActionRunConfig as er, EErrId_NiceTransport_WebSocket as et, IActionProgress_None as f, createAcceptorHandler as fn, createClientHandshake as fr, ISecureAcceptorHandlerOptions as ft, TActionPayload_Any_JsonObject as g, ActionDomain as gn, decodeHandshakeMessage as gr, ExchangeAcceptor as gt, TActionPayload_Any_Instance as h, ActionCore as hn, createStorageTofuVerifyKeyResolver as hr, createActionFetchHandler as ht, IActionPayload_Base_JsonObject as i, actionSchema as ii, TFrame$1 as in, ESecurityLevel as ir, IRtcDataChannelLike as it, ILinkTransportOptions as j, ITransportMethod_SendActionData_Input as jn, IRunningActionUpdate_Abort as jr, isExchangeAcceptorCarrier as jt, decodeExchangeRequest as k, ISecureClientConfig as kn, ERunningActionState as kr, IExchangeAcceptorCarrier as kt, IActionPayload_Result as l, TAcceptorConnectionCaseFn as ln, IHandshakeResult as lr, IInMemoryServerEndpoint as lt, IActionRouteItemHandler as m, createActionRootDomain as mn, createServerHandshake as mr, IActionFetchHandlerOptions as mt, EActionProgressType as n, EActionResponseMode as ni, IExchangeCarrierSource as nn, Transport as nr, IRtcCarrierOptions as nt, IActionPayload_Progress as o, TActionSerializationDefinition as oi, IAcceptorConnectionBinding as on, IClientVerifyKeyResolveInput as or, IInMemoryCarrier as ot, IActionProgress_Percentage as p, IActionWireFormat as pn, createInMemoryTofuVerifyKeyResolver as pr, createSecureAcceptorHandler as pt, httpCarrier as q, TOnResolveIncomingResponseJson as qn, IActionRootDomain as qr, connectChannel as qt, IActionPayload_Base as r, TInferActionError as ri, TCarrier as rn, EHandshakeMessageType as rr, rtcCarrier as rt, IActionPayload_Progress_JsonObject as s, TTransportedValue as si, IAcceptorHandlerOptions as sn, IClientVerifyKeyResolver as sr, inMemoryCarrier as st, EActionPayloadType as t, ActionSchema as ti, IExchangeCarrier as tn, ITransportConnectionContext as tr, err_nice_transport_ws as tt, IActionPayload_Result_JsonObject as u, TActionChannelFormatMessage as un, IServerHandshakeConfig as ur, createInMemoryChannelPair as ut, TActionResultOutcome as v, ActionRuntime as vn, runtimeLinkId as vr, IExchangeAcceptorSecurity as vt, EErrId_NiceAction as w, IActionTransportInitialized as wn, ActionPayload_Progress as wr, IServeChannelOptions as wt, isActionPayload_Any_JsonObject as x, ETransportShape as xn, createLocalHandler as xr, serveHost as xt, isActionPayload_Result_JsonObject as y, ConnectorHandler as yn, PeerLinkHandler as yr, IChannelHostAdapter as yt, IActionTransportReadyData_Exchange as z, ITransportStatusInfo_Unsupported as zn, IRuntimeCoordinate as zr, IAcceptChannelOptions as zt };
3371
+ //# sourceMappingURL=ActionPayload.types-Dx1JPyfs.d.mts.map