@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.
- package/README.md +91 -59
- package/build/{ActionDevtoolsCore-baIHExfj.d.mts → ActionDevtoolsCore-CQ0vrvPD.d.cts} +2 -2
- package/build/{ActionDevtoolsCore-dApyYvTS.d.cts → ActionDevtoolsCore-CiLBYC3K.d.mts} +2 -2
- package/build/{ActionPayload.types-CQM1HRw_.d.cts → ActionPayload.types-Dx1JPyfs.d.mts} +133 -30
- package/build/{ActionPayload.types-DXGiw1SF.d.mts → ActionPayload.types-L9k0LyBd.d.cts} +133 -30
- package/build/devtools/browser/index.d.cts +1 -1
- package/build/devtools/browser/index.d.mts +1 -1
- package/build/devtools/server/index.d.cts +1 -1
- package/build/devtools/server/index.d.mts +1 -1
- package/build/httpAcceptorCarrier-DL8lf0xB.mjs +3906 -0
- package/build/httpAcceptorCarrier-DL8lf0xB.mjs.map +1 -0
- package/build/httpAcceptorCarrier-OnJxzsAD.cjs +4291 -0
- package/build/httpAcceptorCarrier-OnJxzsAD.cjs.map +1 -0
- package/build/index.cjs +368 -4139
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +2 -2
- package/build/index.d.mts +2 -2
- package/build/index.mjs +299 -4069
- package/build/index.mjs.map +1 -1
- package/build/platform/cloudflare/index.cjs +30 -2
- package/build/platform/cloudflare/index.cjs.map +1 -1
- package/build/platform/cloudflare/index.d.cts +55 -2
- package/build/platform/cloudflare/index.d.mts +55 -2
- package/build/platform/cloudflare/index.mjs +28 -2
- package/build/platform/cloudflare/index.mjs.map +1 -1
- package/build/react-query/index.d.cts +1 -1
- package/build/react-query/index.d.mts +1 -1
- package/package.json +4 -4
- package/build/wsAcceptorCarrier-BDJRIPfu.cjs +0 -103
- package/build/wsAcceptorCarrier-BDJRIPfu.cjs.map +0 -1
- package/build/wsAcceptorCarrier-CW2qX25W.mjs +0 -80
- 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` / `
|
|
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.
|
|
223
|
-
// webSocketClose/Error(ws) => server.
|
|
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,
|
|
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
|
-
- **`
|
|
231
|
-
|
|
232
|
-
handle directly
|
|
233
|
-
- **`pushToClient(target, request, opts?)`** — push a
|
|
234
|
-
(see
|
|
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`,
|
|
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
|
|
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
|
|
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
|
-
//
|
|
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,
|
|
396
|
-
> just the client coordinate, pass `channelCases` to `serveChannel`
|
|
397
|
-
>
|
|
398
|
-
> `
|
|
399
|
-
> (
|
|
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
|
|
406
|
-
|
|
407
|
-
|
|
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
|
|
431
|
+
import { ActionRuntime } from "@nice-code/action";
|
|
412
432
|
import {
|
|
413
|
-
|
|
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
|
-
//
|
|
426
|
-
|
|
427
|
-
|
|
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
|
-
|
|
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().
|
|
458
|
+
this.getServer().receive(ws, msg);
|
|
441
459
|
}
|
|
442
|
-
async webSocketClose(ws: WebSocket) { this.getServer().
|
|
443
|
-
async webSocketError(ws: WebSocket) { this.getServer().
|
|
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
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
- **`
|
|
453
|
-
`
|
|
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
|
|
458
|
-
|
|
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 =
|
|
487
|
+
const server = serveDurableObject(this.ctx, lobbyChannel, {
|
|
488
|
+
runtime,
|
|
462
489
|
clientEnv: RuntimeCoordinate.env("web"),
|
|
463
|
-
|
|
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,
|
|
470
|
-
|
|
471
|
-
|
|
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
|
-
`
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
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.
|
|
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
|
-
//
|
|
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 {
|
|
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-
|
|
79
|
+
//# sourceMappingURL=ActionDevtoolsCore-CQ0vrvPD.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
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
|
-
*
|
|
1534
|
-
*
|
|
1535
|
-
*
|
|
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
|
|
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
|
|
1652
|
-
* served together. Each domain takes only the cases whose ids it owns, so a
|
|
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,
|
|
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,
|
|
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
|
|
1965
|
-
*
|
|
1966
|
-
*
|
|
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>[],
|
|
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*
|
|
2324
|
-
*
|
|
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
|
-
*
|
|
2346
|
-
*
|
|
2347
|
-
*
|
|
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
|
-
|
|
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` / `
|
|
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) => { … } }, //
|
|
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.
|
|
2394
|
-
* // webSocketClose/Error(conn) => server.
|
|
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 $,
|
|
3268
|
-
//# sourceMappingURL=ActionPayload.types-
|
|
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
|