@lunora/client 1.0.0-alpha.68 → 1.0.0-alpha.69

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.
@@ -1,1040 +0,0 @@
1
- /** The registered function kinds a {@link FunctionReference} can describe. `stream` is a query that yields multiple frames over the WS. */
2
- type FunctionKind = "action" | "mutation" | "query" | "stream";
3
- /**
4
- * Opaque reference to a registered function emitted by `@lunora/codegen`.
5
- *
6
- * At runtime it carries the `<file>:<function>` identifier in `__lunoraRef`.
7
- * Generated declarations decorate this with phantom type parameters so the
8
- * client can infer args / return values per call site.
9
- */
10
- interface FunctionReference<Kind extends FunctionKind = FunctionKind, Args = unknown, Return = unknown> {
11
- /**
12
- * Phantom marker carrying the `Kind`/`Args`/`Return` type parameters for
13
- * inference. Never present at runtime; declared as a covariant (output)
14
- * position so a concrete reference stays assignable to a widened one.
15
- */
16
- readonly __lunoraPhantom?: {
17
- args: Args;
18
- kind: Kind;
19
- returns: Return;
20
- };
21
- readonly __lunoraRef: string;
22
- }
23
- /** Extract the args type from a {@link FunctionReference}. */
24
- type ArgsOf<F> = F extends FunctionReference<infer _K, infer A, infer _R> ? A : never;
25
- /** Extract the return type from a {@link FunctionReference}. */
26
- type ReturnOf<F> = F extends FunctionReference<infer _K, infer _A, infer R> ? R : never;
27
- /**
28
- * Typed reference to an HTTP-SSE stream route (`httpRoute.<verb>(path).stream()`)
29
- * emitted by `@lunora/codegen` as `httpStreams.<namespace>.<name>`.
30
- *
31
- * Distinct from {@link FunctionReference}: this is the **HTTP-SSE route stream**
32
- * (opened with `fetch` + `ReadableStream` against the route's own URL), not the
33
- * WS procedure stream (`kind: "stream"`). At runtime it carries the HTTP verb
34
- * and the route path; the phantom marker carries the chunk / searchParams /
35
- * params types so `httpStream` (and the framework hooks over it) infer the
36
- * chunk type end-to-end.
37
- * @experimental Reconnect/POST-body/wire-fidelity design questions are still open, so the shape may change.
38
- */
39
- interface HttpStreamRef<Chunk = unknown, SearchParams = unknown, Params = unknown> {
40
- /**
41
- * Phantom marker carrying the `Chunk`/`SearchParams`/`Params` type
42
- * parameters for inference. Never present at runtime; declared in a
43
- * covariant (output) position so a concrete reference stays assignable to
44
- * a widened one.
45
- */
46
- readonly __lunoraHttpStream?: {
47
- chunk: Chunk;
48
- params: Params;
49
- searchParams: SearchParams;
50
- };
51
- /** HTTP verb the route binds to (uppercased), e.g. `"GET"`. */
52
- readonly method: string;
53
- /** The route path as declared, e.g. `/api/tokens/:id` — `:name` segments are filled from `params`. */
54
- readonly path: string;
55
- }
56
- /**
57
- * The call-side args of an HTTP-SSE stream route: `:name` path params plus URL query params.
58
- * @experimental Part of the HTTP-SSE stream surface.
59
- */
60
- interface HttpStreamCallArgs<SearchParams = unknown, Params = unknown> {
61
- /** Values for the route path's `:name` segments. */
62
- params?: Params;
63
- /** URL query params, appended to the request URL (undefined entries are skipped). */
64
- searchParams?: SearchParams;
65
- }
66
- /**
67
- * Extract the chunk type from a {@link HttpStreamRef}.
68
- * @experimental Part of the HTTP-SSE stream surface.
69
- */
70
- type HttpStreamChunkOf<R> = R extends HttpStreamRef<infer Chunk, infer _S, infer _P> ? Chunk : never;
71
- /**
72
- * Extract the call-side args type from a {@link HttpStreamRef}.
73
- * @experimental Part of the HTTP-SSE stream surface.
74
- */
75
- type HttpStreamArgsOf<R> = R extends HttpStreamRef<infer _C, infer S, infer P> ? HttpStreamCallArgs<S, P> : never;
76
- type Unsubscribe = () => void;
77
- /**
78
- * Serializable result of `preloadQuery`. Produced on the server during SSR,
79
- * embedded in the rendered HTML, then handed to `usePreloadedQuery` on the
80
- * client so the first render shows the server value with no loading flash
81
- * before a live subscription attaches. Every field survives `JSON.stringify`.
82
- */
83
- interface Preloaded<T = unknown> {
84
- readonly __lunoraPreloaded: true;
85
- readonly args: Record<string, unknown>;
86
- readonly functionPath: string;
87
- readonly shardKey?: string;
88
- readonly value: T;
89
- }
90
- /**
91
- * Pluggable storage for the `x-d1-bookmark` value used to provide
92
- * read-your-writes between a mutation and subsequent queries.
93
- */
94
- interface BookmarkStorage {
95
- get: () => string | null;
96
- set: (value: string | null) => void;
97
- }
98
- interface ReconnectOptions {
99
- initialDelayMs?: number;
100
- jitter?: boolean;
101
- maxDelayMs?: number;
102
- }
103
- /** Which durable-storage operation failed, passed to {@link OfflineQueueOptions.onPersistenceError}. */
104
- type PersistenceOperation = "append" | "clear" | "load" | "remove";
105
- /** Context handed to a persistence-error handler. */
106
- interface PersistenceErrorContext {
107
- readonly error: unknown;
108
- /** The mutation id involved, when the failing op was scoped to one (`append`/`remove`). */
109
- readonly mutationId?: string;
110
- readonly operation: PersistenceOperation;
111
- }
112
- interface OfflineQueueOptions {
113
- maxItems?: number;
114
- /**
115
- * Invoked when a {@link PersistenceAdapter} call rejects (e.g. IndexedDB quota
116
- * exceeded). Without a handler, failures are logged via `console.warn` so they
117
- * are never fully silent. Note: a failed `append` means the write is queued in
118
- * memory but NOT durable — it will not survive a reload.
119
- */
120
- onPersistenceError?: (context: PersistenceErrorContext) => void;
121
- /**
122
- * Queue mutations issued before a shard's first successful WebSocket
123
- * connect (defaults to `false`). The standard behaviour (`LunoraClient`'s
124
- * `mutation()`) queues only when the targeted shard has been connected at
125
- * least once (`wasEverConnected`), so the registry / resubscribe handshake
126
- * has run. Set this to `true` for offline-first apps that want to enqueue
127
- * writes on the very first session before the WS is up.
128
- */
129
- queueBeforeFirstConnect?: boolean;
130
- }
131
- /**
132
- * Serializable shape of an offline mutation, durably stored by a
133
- * {@link PersistenceAdapter} so queued writes survive a reload/crash. The live
134
- * `resolve`/`reject` callbacks of an in-flight `QueuedMutation` are *not*
135
- * persisted — a restored mutation is replayed with no original awaiter.
136
- */
137
- interface PersistedMutation {
138
- args: Record<string, unknown>;
139
- /**
140
- * The client id that queued this write, persisted so a replay after a reload
141
- * lands in the SAME server-side dedup namespace it was issued under. The
142
- * standalone client's own `clientId` is minted per session, so replaying under
143
- * the live one would miss the `__idempotency` row for an anonymous caller and
144
- * re-run a write the server already committed. Absent on records written by
145
- * older client versions, which replay under the live id.
146
- */
147
- clientId?: string;
148
- functionPath: string;
149
- id: string;
150
- /**
151
- * Issuing identity fingerprint, persisted so a hydrated write replays only
152
- * under the identity that queued it (`null` = queued while signed out).
153
- * Absent on records written by older client versions, which replay under
154
- * the ambient identity for back-compat.
155
- */
156
- identity?: string | null;
157
- shardKey?: string;
158
- /**
159
- * App/schema version stamped at enqueue (from `LunoraClientOptions.persistenceVersion`).
160
- * On hydrate, a record whose `version` doesn't match the current one is dropped
161
- * and purged rather than replayed — so a write persisted by an older deploy
162
- * (with a now-changed function signature) can't replay against the new schema.
163
- * Absent when no `persistenceVersion` is configured (no version gating).
164
- */
165
- version?: string;
166
- }
167
- /**
168
- * Durable store for the offline mutation queue. The default client keeps the
169
- * queue in memory; supplying an adapter (e.g. `createIndexedDbPersistence`)
170
- * makes queued writes survive a page reload. Implementations must preserve FIFO
171
- * (enqueue) order in `PersistenceAdapter.load`.
172
- *
173
- * Replay semantics are at-least-once: a mutation is removed only after the
174
- * server confirms (or rejects) it, so a crash between commit and `remove` can
175
- * replay it again on the next load.
176
- */
177
- interface PersistenceAdapter {
178
- /** Append a mutation to durable storage (called on enqueue). */
179
- append: (mutation: PersistedMutation) => Promise<void>;
180
- /** Drop every persisted mutation (e.g. on logout). */
181
- clear: () => Promise<void>;
182
- /** Load all persisted mutations in FIFO order — called once at startup. */
183
- load: () => Promise<PersistedMutation[]>;
184
- /** Remove a mutation by id once it has been replayed (resolved or rejected). */
185
- remove: (id: string) => Promise<void>;
186
- }
187
- /**
188
- * One write handed to an {@link OutboxSink}. Mirrors {@link PersistedMutation}
189
- * plus the custom-mutator identity (`clientId`/`mutationId`/`idempotencyKey`)
190
- * the durable outbox needs to dedupe and watermark replays.
191
- */
192
- interface OutboxMutation {
193
- args: Record<string, unknown>;
194
- /** Stable per-client id; pairs with {@link OutboxMutation.mutationId} as `idempotencyKey`. */
195
- clientId: string;
196
- functionPath: string;
197
- /** `${clientId}:${mutationId}` — sent as `x-lunora-mutation-id` so a replay is server-idempotent. */
198
- idempotencyKey: string;
199
- /** Issuing identity fingerprint (`null` = signed out); drives the sink's identity guard. */
200
- identity: string | null;
201
- /** Monotonic per-client mutation id, backing the server `__client_watermark`. */
202
- mutationId: number;
203
- shardKey?: string;
204
- }
205
- /**
206
- * Pluggable durable outbox seam. When set on {@link LunoraClientOptions.outbox},
207
- * the client delegates offline write durability + at-least-once replay to this
208
- * sink instead of its built-in {@link PersistenceAdapter}-backed `OfflineQueue`.
209
- * `@lunora/db` supplies the blessed implementation (`createExecutorOutboxSink`,
210
- * backed by the TanStack `OfflineExecutor`); the interface itself is
211
- * dependency-free so `@lunora/client` stays TanStack-free.
212
- */
213
- interface OutboxSink {
214
- /**
215
- * Persist and schedule a write for replay. Rejects with an
216
- * `OFFLINE_QUEUE_OVERFLOW`-coded error when the sink's cap is exceeded, so
217
- * the caller can surface back-pressure to the issuing mutation.
218
- */
219
- enqueue: (mutation: OutboxMutation) => Promise<void>;
220
- }
221
- /**
222
- * One persisted query result in the durable read cache (Pillar 2). Keyed in the
223
- * store by `shardKey + functionPath + argsKey`; the record carries everything
224
- * needed to render offline on reload and to resume the live subscription.
225
- */
226
- interface CachedQuery {
227
- /**
228
- * Issuing identity fingerprint (same shape the offline queue stamps). A
229
- * cached value only hydrates when it matches the current identity, so a
230
- * signed-out cache never leaks into a new session. `null` = cached while
231
- * signed out.
232
- */
233
- identity: string | null;
234
- /**
235
- * The `cursor` high-watermark this value reflects, replayed as `sinceSeq`
236
- * on reconnect so the server can resume instead of re-snapshotting. Absent
237
- * when the value predates CDC / no cursor was advertised.
238
- */
239
- serverCursor?: number;
240
- /**
241
- * The CDC `epoch` the `serverCursor` belongs to, replayed as `sinceEpoch`
242
- * on reconnect so the server only resumes when the client is still on the
243
- * same changelog timeline. Absent when no epoch was advertised.
244
- */
245
- serverEpoch?: string;
246
- /** Wall-clock millis the value was written — drives LRU eviction. */
247
- ts: number;
248
- /** The full query result last seen from the server. */
249
- value: unknown;
250
- /**
251
- * App/schema version stamped when persisted (from `LunoraClientOptions.persistenceVersion`).
252
- * A cached value whose `version` doesn't match the current one is not hydrated —
253
- * so a result of a now-changed shape from an older deploy can't render. Absent
254
- * when no `persistenceVersion` is configured (no version gating).
255
- */
256
- version?: string;
257
- }
258
- /** A stored read-cache row: the {@link CachedQuery} plus the key it is stored under. */
259
- interface StoredQuery extends CachedQuery {
260
- key: string;
261
- }
262
- /**
263
- * Durable store for the client read cache (Pillar 2): query results survive a
264
- * reload so reads hydrate from disk and render immediately while the socket
265
- * reconnects. Opt-in via {@link LunoraClientOptions.queryCache}; omit to keep
266
- * reads in memory only (today's behaviour). Mirrors {@link PersistenceAdapter}'s
267
- * shape over the same IndexedDB plumbing.
268
- */
269
- interface QueryCacheAdapter {
270
- /** Drop every cached query (e.g. on logout / identity change). */
271
- clear: () => Promise<void>;
272
- /** Load every cached query — called once at startup to hydrate reads. */
273
- load: () => Promise<StoredQuery[]>;
274
- /** Upsert one cached query by key (called when a subscription value advances). */
275
- put: (key: string, entry: CachedQuery) => Promise<void>;
276
- /** Remove one cached query by key. */
277
- remove: (key: string) => Promise<void>;
278
- }
279
- /**
280
- * Resolves the WS `?token=` credential fresh at every (re)connect — the channel
281
- * for short-lived tokens (e.g. the ephemeral admin sub-token the worker mints
282
- * at `POST /_lunora/admin/ws-token`) instead of a static secret in the URL.
283
- * May return the token synchronously or as a Promise; returning `undefined`
284
- * connects without a token. A thrown error / rejected Promise fails that
285
- * connect attempt, and the client retries with its normal reconnect backoff.
286
- */
287
- type WsTokenProvider = () => Promise<string | undefined> | string | undefined;
288
- interface LunoraClientOptions {
289
- /**
290
- * Base path the worker mounts better-auth at, used by the client's
291
- * `getCurrentUser()` to reach the `get-session` route. Defaults to
292
- * `/api/auth` (matching `@lunora/auth`'s `DEFAULT_AUTH_BASE_PATH`).
293
- */
294
- authBasePath?: string;
295
- bookmarkStorage?: BookmarkStorage;
296
- /**
297
- * Stable per-client id backing the custom-mutator watermark. Sent on the
298
- * `connect` envelope (so the server can scope this client's
299
- * `__client_watermark`) and stamped onto every {@link OutboxMutation} the
300
- * {@link LunoraClientOptions.outbox} sink persists, where it pairs with the
301
- * monotonic mutation id to form the idempotency key. The `@lunora/db` path
302
- * persists a stable id alongside the outbox and passes it here; omit for the
303
- * standalone client, which generates an ephemeral per-session id.
304
- */
305
- clientId?: string;
306
- /**
307
- * Default app context sent in the `connect` envelope right after each socket
308
- * opens, forwarded to the server's `onConnect`/`onDisconnect` lifecycle hooks
309
- * as `event.context`. A per-shard context registered via
310
- * `setConnectionContext` overrides this for that shard. Omit when no lifecycle
311
- * hook needs connection context.
312
- */
313
- connectionContext?: Record<string, unknown>;
314
- /**
315
- * Fail-fast timeout (ms) for opening a subscription WebSocket. If the
316
- * handshake doesn't complete within this window — a hung dev proxy or a cold
317
- * worker that never upgrades — the client force-closes the socket and routes
318
- * through its normal reconnect/backoff (surfacing `offline` status) instead
319
- * of leaving the live channel silently stuck on the browser's much longer
320
- * default. Does not affect HTTP queries/mutations (those never ride the WS).
321
- * Defaults to 10000 (10s); set to `0` (or negative) to disable.
322
- */
323
- connectTimeoutMs?: number;
324
- /**
325
- * When `true`, tabs sharing the same origin (and the same signed-in identity)
326
- * coordinate via BroadcastChannel so only one tab — the "leader" — opens
327
- * WebSocket connections to the server. Reduces simultaneous WS connections,
328
- * bandwidth, and cross-tab state drift. Requires `BroadcastChannel`
329
- * (browser-only); silently ignored otherwise. Defaults to `false`.
330
- *
331
- * **The channel is one-directional: leader → follower.** The leader
332
- * broadcasts the values, errors, checkpoints and connection status of the
333
- * subscriptions *it* holds; there is no frame with which a follower can ask
334
- * the leader for anything.
335
- *
336
- * `subscribe` works on a follower and is how the relay delivers: the
337
- * registration is what the leader's broadcast key is matched against, so a
338
- * follower sees a value while the leader independently holds the same
339
- * `(fn, args, shardKey)`.
340
- *
341
- * Nothing else is served, because the leader broadcasts nothing for it and a
342
- * follower cannot ask. `subscribeShape` and `acquireConnectionContext` are
343
- * inert on a follower — framework code (`@lunora/db`'s shape sync, every
344
- * `usePresence` adapter) calls them from an effect the app cannot opt out
345
- * of, so throwing would unwind the tab rather than degrade one feature.
346
- * `whisper`, `whisperSubscribe`, `setConnectionContext` and `stream` are
347
- * only ever called by app code, which can handle a failure, so those throw
348
- * `NOT_IMPLEMENTED` rather than returning a handle that never fires. (The
349
- * brief window every tab spends claiming leadership at startup is not a
350
- * follower state: a lone tab self-promotes and its registered subscriptions
351
- * are sent then.) HTTP surfaces — `query`, `mutation`, `action`, the offline
352
- * queue's replay — are unaffected on every tab.
353
- *
354
- * So: enable this when your tabs run the SAME app views over plain
355
- * `subscribe`, and leave it off if tabs can sit on different routes or you
356
- * use shapes, whispers, streams, or connection context.
357
- */
358
- crossTabSync?: boolean;
359
- fetch?: typeof fetch;
360
- /**
361
- * Interval (ms) between keepalive pings sent on each open subscription
362
- * socket. The server answers them via the Durable Object's hibernation
363
- * auto-response WITHOUT waking the DO, so an idle socket stays alive across
364
- * hibernation without a billable wakeup. Defaults to 30000 (30s); set to
365
- * `0` (or a negative value) to disable the heartbeat entirely.
366
- */
367
- heartbeatIntervalMs?: number;
368
- /**
369
- * When `true` and a `queryCache` is active, framework hooks (React, Vue, …)
370
- * wait for the durable cache to finish hydrating before their first render
371
- * with an enabled subscription, so users see cached data instead of an
372
- * undefined flash before the socket round-trip. Defaults to `false`.
373
- *
374
- * Requires `queryCache` to be set (not `false`); silently ignored otherwise.
375
- */
376
- hydrateOnStart?: boolean;
377
- offlineQueue?: OfflineQueueOptions;
378
- /**
379
- * Durable outbox seam for offline writes. When supplied (the `@lunora/db`
380
- * path wires `createExecutorOutboxSink`), offline mutations are delegated to
381
- * the sink and the built-in {@link PersistenceAdapter}-backed `OfflineQueue`
382
- * is bypassed, so a db app has exactly one durable write path. Omit for the
383
- * standalone client, which keeps using {@link LunoraClientOptions.persistence}.
384
- */
385
- outbox?: OutboxSink;
386
- /**
387
- * Durable store for the offline mutation queue. Tri-state — an explicit
388
- * {@link PersistenceAdapter} is used as-is; `false` opts out (the queue stays
389
- * in memory, lost on reload); omitted (the default) auto-probes a durable
390
- * IndexedDB store when the `indexedDB` global is present (browsers), otherwise
391
- * in-memory, so SSR/Node/React-Native keep the in-memory behaviour and only
392
- * environments that can persist do. Pass `createAsyncStoragePersistence()` on
393
- * React Native.
394
- */
395
- persistence?: false | PersistenceAdapter;
396
- /**
397
- * App/schema version stamped onto every persisted queued write and cached
398
- * read. Bump it on a breaking change to a function signature or query shape:
399
- * on the next boot, persisted writes / cached reads stamped with a different
400
- * version are dropped (and purged) rather than replayed / hydrated against the
401
- * new schema. Omit to disable version gating (records are never invalidated by
402
- * version).
403
- *
404
- * **Adoption is itself an invalidation event:** records written before you set
405
- * `persistenceVersion` carry no version, so the first boot after enabling it
406
- * purges all currently-queued offline writes (and cached reads) as stale. Adopt
407
- * it on a build where that clean slate is acceptable — typically the same
408
- * breaking deploy you're protecting against — not purely speculatively.
409
- */
410
- persistenceVersion?: string;
411
- /**
412
- * Durable store for the read cache (Pillar 2). When active, query results
413
- * are persisted as their subscriptions advance and hydrated on construction
414
- * so a reload renders cached data before the socket reconnects, then resumes
415
- * the live subscription from the persisted cursor. Tri-state — an explicit
416
- * {@link QueryCacheAdapter} is used as-is; `false` opts out (reads stay in
417
- * memory only); omitted (the default) auto-probes IndexedDB exactly like
418
- * {@link LunoraClientOptions.persistence}.
419
- */
420
- queryCache?: QueryCacheAdapter | false;
421
- reconnect?: ReconnectOptions;
422
- url: string;
423
- WebSocket?: typeof WebSocket;
424
- /**
425
- * Credential appended to the WebSocket URL as `?token=…`. The server matches
426
- * it against `LUNORA_WS_BEARER` (to clear the upgrade gate) and/or
427
- * `LUNORA_ADMIN_TOKEN` (to authorize `__lunora_admin__:*` subscriptions —
428
- * what the studio supplies). Browsers can't set headers on the `WebSocket`
429
- * constructor, so the query parameter is the only channel; it ends up in
430
- * server logs and history, so prefer a short-lived rotating token in
431
- * production over a static secret.
432
- *
433
- * Pass a {@link WsTokenProvider} function to resolve the token fresh at
434
- * every (re)connect — the channel for short-lived credentials such as the
435
- * ephemeral admin sub-token minted by `POST /_lunora/admin/ws-token`: the
436
- * provider re-mints on each reconnect, including the one following a `4001`
437
- * token-expired drop, so a static master token never has to ride the URL.
438
- */
439
- wsToken?: string | WsTokenProvider;
440
- wsUrl?: string;
441
- }
442
- /** Wire envelope sent on `POST /_lunora/rpc`. */
443
- interface RpcEnvelope {
444
- args?: Record<string, unknown>;
445
- /**
446
- * Stable per-client identifier (custom-mutator push path). Pairs with
447
- * {@link RpcEnvelope.mutationId} to form `idempotencyKey` and scope the
448
- * server `__client_watermark`. Absent on plain `client.mutation` calls.
449
- */
450
- clientId?: string;
451
- functionPath: string;
452
- /**
453
- * Idempotency key (`${clientId}:${mutationId}`) for the custom-mutator push
454
- * path, mirrored into the `x-lunora-mutation-id` header. Absent on plain
455
- * `client.mutation` calls.
456
- */
457
- idempotencyKey?: string;
458
- /**
459
- * Monotonic per-client mutation id (custom-mutator push path), backing the
460
- * server-side per-client watermark: `id <= watermark` is a replay (skipped),
461
- * `id == watermark + 1` runs authoritatively, `id > watermark + 1` halts the
462
- * batch so the client resends from `watermark + 1`. Absent on plain
463
- * `client.mutation` calls.
464
- */
465
- mutationId?: number;
466
- shardKey?: string;
467
- }
468
- /**
469
- * Wire response from the shard's `/rpc` endpoint (forwarded by the runtime). A
470
- * watermarked custom-mutator push additionally carries `lastMutationId` — the
471
- * highest per-client sequence the DO has applied — which the client uses to keep
472
- * its `clientSeq` generator monotonic across reloads (see `LunoraClient.callMutator`).
473
- * A plain mutation on a CDC shard carries `commitCursor` — the cursor the write
474
- * committed at — which gates the drop of a per-call optimistic layer.
475
- */
476
- type RpcResponseBody = {
477
- error: {
478
- code: string;
479
- data?: unknown;
480
- message: string;
481
- };
482
- } | {
483
- commitCursor?: number;
484
- lastMutationId?: number;
485
- result: unknown;
486
- };
487
- /** Subscription protocol — client → server. */
488
- interface ClientSubscribeMessage {
489
- id: string;
490
- /**
491
- * `sinceSeq` is the persisted `cursor` high-watermark the client last saw
492
- * for this shard (Pillar 1b resume). Present only when a durable
493
- * {@link QueryCacheAdapter} restored a cached value with a cursor; the
494
- * server replies with a lightweight `resume` frame instead of a full
495
- * snapshot when nothing the query reads changed since it. Absent on a
496
- * first-time subscribe.
497
- */
498
- query: {
499
- args?: Record<string, unknown>;
500
- functionPath?: string;
501
- sinceEpoch?: string;
502
- sinceSeq?: number;
503
- table?: string;
504
- };
505
- type: "subscribe";
506
- }
507
- interface ClientUnsubscribeMessage {
508
- id: string;
509
- type: "unsubscribe";
510
- }
511
- /**
512
- * One-shot control frame sent right after the socket opens. Registers the
513
- * connection's app `context` (e.g. `{ roomId, sessionId }`) with the server and
514
- * fires the `onConnect` lifecycle hooks; the same context is replayed to
515
- * `onDisconnect` when the socket drops.
516
- */
517
- interface ClientConnectMessage {
518
- /**
519
- * Wire behaviours this client can handle that an older one cannot, so the
520
- * server can use them without breaking clients that can't. Currently just
521
- * `"pageDelta"`; see `shared/page-result.ts` for what it promises and why it
522
- * must be announced rather than assumed. Omitting it is always safe.
523
- */
524
- caps?: ReadonlyArray<string>;
525
- /**
526
- * Stable per-client id (persisted alongside the outbox). Lets the server
527
- * scope this connection's `__client_watermark` so custom-mutator pokes can
528
- * echo the right per-client `lastMutationId`. Omitted by clients that don't
529
- * use custom mutators.
530
- */
531
- clientId?: string;
532
- context?: Record<string, unknown>;
533
- id: string;
534
- type: "connect";
535
- }
536
- /**
537
- * Subscribe to a declarative **shape** — server-side partial replication scoped
538
- * by `shardBy` + the shape's predicate + RLS. The client sends the shape *name*
539
- * + validated `args`; the server resolves the trusted `where` (identity/RLS
540
- * `baseWhere` the client can't forge) and streams the matching rowset, then live
541
- * {@link ServerPokePartMessage} diffs. `id` namespaces the subscription and is
542
- * echoed as `shapeId` on every poke part.
543
- */
544
- interface ClientShapeSubscribeMessage {
545
- id: string;
546
- shape: {
547
- args?: Record<string, unknown>;
548
- name: string;
549
- };
550
- /**
551
- * Resume from this checkpoint (the `__cdc_log` cursor the client last
552
- * applied for this shape). When absent or below the server's retained floor
553
- * (`minCdcSeq`), the server re-seeds with a full insert-poke instead of a
554
- * delta.
555
- */
556
- sinceCheckpoint?: number;
557
- /**
558
- * The CDC epoch {@link ClientShapeSubscribeMessage.sinceCheckpoint} belongs
559
- * to. A mismatch (forked changelog timeline) forces a full re-seed even when
560
- * the cursor is numerically in range.
561
- */
562
- sinceEpoch?: string;
563
- type: "shape_subscribe";
564
- }
565
- /** Cancel a shape subscription started with the same `id`. */
566
- interface ClientShapeUnsubscribeMessage {
567
- id: string;
568
- type: "shape_unsubscribe";
569
- }
570
- interface ClientAckMessage {
571
- id: string;
572
- type: "ack";
573
- }
574
- /**
575
- * Start a streaming query. The id namespaces a fresh stream and is echoed on
576
- * every {@link ServerChunkMessage} the server pushes back. Cancel a running
577
- * stream by sending a {@link ClientUnsubscribeMessage} with the same id —
578
- * subscription and stream id-spaces share the cancel channel; the prefix
579
- * (`sub_*` vs `stream_*`) keeps the local registries searchable.
580
- */
581
- interface ClientStreamMessage {
582
- /**
583
- * Run generation the {@link ClientStreamMessage.sinceChunk} watermark
584
- * belongs to: the `generation` stamp carried by the chunk frames this
585
- * client already received, echoed back on a resume. The server refuses to
586
- * splice a different run's tail onto the held prefix — a mismatch fails
587
- * with `STREAM_INTERRUPTED` instead. Omitted on a first attach.
588
- */
589
- generation?: number;
590
- id: string;
591
- query: {
592
- args?: Record<string, unknown>;
593
- functionPath: string;
594
- shardKey?: string;
595
- };
596
- /**
597
- * Resume watermark: the highest chunk `seq` this client already received.
598
- * Only meaningful for a stream the server declared `durable` — the run
599
- * replays everything after it and then continues live, which is what turns
600
- * a reconnect into a resume instead of a lost generation. Omitted on a
601
- * first attach.
602
- *
603
- * Named `sinceChunk`, not `sinceSeq`, because a subscribe envelope already
604
- * carries a `query.sinceSeq` meaning the CDC cursor.
605
- */
606
- sinceChunk?: number;
607
- type: "stream";
608
- }
609
- /**
610
- * Join or leave a whisper `topic` — an app-chosen ephemeral channel scoped to a
611
- * shard. While joined, the client receives every {@link ServerWhisperMessage}
612
- * other members broadcast to the topic.
613
- */
614
- interface ClientWhisperSubscribeMessage {
615
- topic: string;
616
- type: "whisper_subscribe" | "whisper_unsubscribe";
617
- }
618
- /**
619
- * Broadcast ephemeral `data` to the topic's other members on the shard. The
620
- * payload is relayed verbatim with no server-side persistence (no SQLite/CDC
621
- * write) — for typing indicators, live cursors, presence pings. The sender does
622
- * not receive its own whisper.
623
- */
624
- interface ClientWhisperMessage {
625
- data?: unknown;
626
- topic: string;
627
- type: "whisper";
628
- }
629
- type ClientMessage = ClientAckMessage | ClientConnectMessage | ClientShapeSubscribeMessage | ClientShapeUnsubscribeMessage | ClientStreamMessage | ClientSubscribeMessage | ClientUnsubscribeMessage | ClientWhisperMessage | ClientWhisperSubscribeMessage;
630
- /** Subscription protocol — server → client. */
631
- interface ServerDataMessage {
632
- /**
633
- * The `__cdc_log` high-watermark covered by this frame (Pillar 1b). The
634
- * client persists it as the query's `serverCursor` and replays it as
635
- * `sinceSeq` on the next reconnect. Absent on shards that never enabled CDC.
636
- */
637
- cursor?: number;
638
- data?: unknown;
639
- delta?: unknown;
640
- /** The CDC epoch this frame's cursor belongs to (see {@link CachedQuery.serverEpoch}). */
641
- epoch?: string;
642
- id: string;
643
- /**
644
- * The highest custom-mutator `mutationId` from this client the server has
645
- * now applied (the per-client `__client_watermark`). Echoed so the client's
646
- * outbox can drop confirmed pending mutations and let TanStack DB collapse
647
- * the matching optimistic overlay. Absent on shards without custom mutators.
648
- */
649
- lastMutationId?: number;
650
- type: "data" | "delta";
651
- }
652
- /**
653
- * Lightweight resume acknowledgement (Pillar 1b): the server determined that
654
- * nothing the subscription reads changed since the client's `sinceSeq`, so it
655
- * skips re-sending the snapshot. The client keeps its cached value and only
656
- * advances `serverCursor` to `cursor`.
657
- */
658
- interface ServerResumeMessage {
659
- cursor?: number;
660
- /** The CDC epoch this resume's cursor belongs to (see {@link CachedQuery.serverEpoch}). */
661
- epoch?: string;
662
- id: string;
663
- /** Per-client custom-mutator watermark (see {@link ServerDataMessage.lastMutationId}). */
664
- lastMutationId?: number;
665
- type: "resume";
666
- }
667
- /**
668
- * Settled acknowledgement for a **list** subscription: a write touched one of
669
- * the subscription's read tables but produced a byte-identical result, so the
670
- * server suppressed the data frame. Sent ONLY to a `@lunora/db` custom-mutator
671
- * client (one that announced a `clientId`, hence has a server-side
672
- * `__client_watermark`) so its optimistic list overlay drops even when no data
673
- * frame arrives. Plain `useQuery` subscribers never receive it, and an older
674
- * client safely ignores the unknown frame.
675
- */
676
- interface ServerSettledMessage {
677
- cursor?: number;
678
- /** The CDC epoch this settled frame's cursor belongs to (see {@link CachedQuery.serverEpoch}). */
679
- epoch?: string;
680
- id: string;
681
- /**
682
- * The highest custom-mutator `mutationId` from this client the server has
683
- * now applied (the per-client `__client_watermark`). Forwarded to a
684
- * collection's `onCheckpoint` so it can drop the overlay for the confirmed
685
- * write whose result didn't change this list.
686
- */
687
- lastMutationId?: number;
688
- type: "settled";
689
- }
690
- interface ServerErrorMessage {
691
- error?: unknown;
692
- id?: string;
693
- message?: string;
694
- type: "error";
695
- }
696
- interface ServerAckMessage {
697
- id: string;
698
- type: "ack";
699
- }
700
- interface ServerCompleteMessage {
701
- id: string;
702
- type: "complete";
703
- }
704
- /** One frame of a streaming query — `data` carries the user-yielded chunk. */
705
- interface ServerChunkMessage {
706
- data: unknown;
707
- /**
708
- * Generation stamp of the **durable** run this chunk belongs to. The client
709
- * stores it beside {@link ServerChunkMessage.seq} and echoes it as
710
- * {@link ClientStreamMessage.generation} on a resume, so the server can
711
- * tell a genuine resume from an attempt to splice onto a different run
712
- * under the same key. Absent on an ephemeral stream.
713
- */
714
- generation?: number;
715
- id: string;
716
- /**
717
- * Monotonic position of this chunk within a **durable** run, starting at 1.
718
- * The client stores the last one it saw and replays it as
719
- * {@link ClientStreamMessage.sinceChunk} when the socket comes back. Absent
720
- * on an ephemeral stream, which has nothing to resume from.
721
- */
722
- seq?: number;
723
- type: "chunk";
724
- }
725
- /**
726
- * An ephemeral whisper relayed from another member of `topic` on the same shard
727
- * (AnyCable-style whispering). `data` is the sender's payload verbatim; `from`
728
- * is the sender's verified user id when known (absent for an anonymous sender).
729
- * Never persisted server-side.
730
- */
731
- interface ServerWhisperMessage {
732
- data: unknown;
733
- from?: string;
734
- topic: string;
735
- type: "whisper";
736
- }
737
- /**
738
- * One row-level change in a shape's replication stream — the wire form of the
739
- * DO's `__cdc_log` `CdcChange`. `insert`/`update` carry the post-image in
740
- * `value` (projected to the shape's `columns`); `delete` omits it, identifying
741
- * the removed row by `key` alone. The client applies these to its local
742
- * collection; an unknown `key` on a `delete` is a safe no-op (a row the client
743
- * never had in this shape).
744
- */
745
- interface RowOp {
746
- /** Row primary key (`_id`). */
747
- key: string;
748
- op: "delete" | "insert" | "update";
749
- /** Logical table the row belongs to. */
750
- table: string;
751
- /** Post-image document for insert/update; absent on delete. */
752
- value?: Record<string, unknown>;
753
- }
754
- /**
755
- * Opens a **poke** — an atomically-applied batch of shape diffs (Zero's poke
756
- * protocol). A `pokeStart` is followed by zero or more {@link ServerPokePartMessage}
757
- * frames and closed by exactly one {@link ServerPokeEndMessage}; the client
758
- * buffers every part and applies them in a single transaction at `pokeEnd`, so a
759
- * socket that drops mid-poke simply re-seeds on reconnect (no torn view).
760
- */
761
- interface ServerPokeStartMessage {
762
- /**
763
- * Poke-level fallback base, stamped by single-part senders. Per-shape
764
- * {@link ServerPokePartMessage.baseCheckpoint} takes precedence; this is what
765
- * a part without its own base falls back to.
766
- */
767
- baseCheckpoint?: number;
768
- /** CDC epoch this poke belongs to; a mismatch forces the client to re-seed rather than apply. */
769
- epoch?: string;
770
- /** Correlates this poke's `pokeStart`/`pokePart`/`pokeEnd` frames. */
771
- pokeId: string;
772
- type: "pokeStart";
773
- }
774
- /** One shape's slice of an in-flight poke: the row-ops to apply for `shapeId`. */
775
- interface ServerPokePartMessage {
776
- /**
777
- * The checkpoint this shape's view must be at for `rowsPatch` to splice on
778
- * cleanly. Per shape, because every shape on a socket has its own
779
- * delivered-through cursor. Absent when the server cannot name a base — the
780
- * gap check is then disarmed for this part, never guessed at.
781
- */
782
- baseCheckpoint?: number;
783
- /** Per-client custom-mutator watermark carried with this slice (see {@link ServerSettledMessage.lastMutationId}). */
784
- lastMutationId?: number;
785
- pokeId: string;
786
- /**
787
- * `true` when `rowsPatch` is the shape's COMPLETE membership, not a diff (a
788
- * full seed or re-seed). The client MUST drop its current view for this shape
789
- * before applying: a seed is inserts-only, so merging it leaves any row that
790
- * left the shape while the client was disconnected on screen forever.
791
- *
792
- * Never inferred from an absent {@link ServerPokePartMessage.baseCheckpoint} —
793
- * most live poke paths legitimately carry no base.
794
- */
795
- reset?: boolean;
796
- /** Ordered row-level changes for this shape, applied in sequence at `pokeEnd`. */
797
- rowsPatch: RowOp[];
798
- /** The {@link ClientShapeSubscribeMessage.id} these row-ops belong to. */
799
- shapeId: string;
800
- type: "pokePart";
801
- }
802
- /**
803
- * Closes a poke: the client commits the buffered parts atomically and advances
804
- * its checkpoint to {@link ServerPokeEndMessage.checkpoint} (the `__cdc_log`
805
- * cursor high-watermark the view now reflects), replayed as `sinceCheckpoint` on
806
- * the next reconnect.
807
- */
808
- interface ServerPokeEndMessage {
809
- /** The `__cdc_log` cursor the view is at after applying this poke. */
810
- checkpoint?: number;
811
- /** CDC epoch the {@link ServerPokeEndMessage.checkpoint} belongs to. */
812
- epoch?: string;
813
- pokeId: string;
814
- type: "pokeEnd";
815
- }
816
- type ServerMessage = ServerAckMessage | ServerChunkMessage | ServerCompleteMessage | ServerDataMessage | ServerErrorMessage | ServerPokeEndMessage | ServerPokePartMessage | ServerPokeStartMessage | ServerResumeMessage | ServerSettledMessage | ServerWhisperMessage;
817
- /**
818
- * The authenticated user as exposed client-side, mirroring better-auth's
819
- * `user` row (the `user` field of the `get-session` response). Kept minimal
820
- * and structural — only `id` is guaranteed; the rest are the common better-auth
821
- * fields, and the index signature carries any plugin-contributed extras.
822
- */
823
- interface User {
824
- readonly createdAt?: NullableTimestamp;
825
- readonly email?: null | string;
826
- readonly emailVerified?: boolean | null;
827
- readonly id: string;
828
- readonly image?: null | string;
829
- readonly name?: null | string;
830
- readonly [key: string]: unknown;
831
- readonly updatedAt?: NullableTimestamp;
832
- }
833
- /**
834
- * One pending scheduled function, as returned by the worker's
835
- * `GET /_lunora/admin/scheduled` endpoint. Mirrors `@lunora/scheduler`'s
836
- * `ScheduleRecord` structurally so the client carries no dependency on it.
837
- */
838
- interface ScheduleRecord {
839
- args: Record<string, unknown>;
840
- /**
841
- * Dispatch attempts already made. Absent (treated as 0) until the first
842
- * failure; on a dead-letter record it is the exhausted count (> the retry
843
- * budget). Surfaced so the studio can show how hard a job tried before it
844
- * was parked.
845
- */
846
- attempts?: number;
847
- enqueuedAt: number;
848
- functionPath: string;
849
- id: string;
850
- /** Logical workpool the job is routed to (concurrency-gated), when any. */
851
- pool?: string;
852
- scheduledFor: number;
853
- shardKey?: string;
854
- }
855
- /**
856
- * One workpool's live backlog, as returned by the worker's
857
- * `GET /_lunora/admin/scheduled/status` endpoint. Mirrors `@lunora/scheduler`'s
858
- * `SchedulerPoolStatus` structurally so the client carries no dependency on it.
859
- */
860
- interface SchedulerPoolStatus {
861
- /** Jobs currently dispatched-but-not-yet-completed (the held concurrency slots). */
862
- inFlight: number;
863
- /** The pool's concurrency cap. */
864
- maxConcurrency: number;
865
- /** The logical workpool name. */
866
- name: string;
867
- /** Pending jobs routed to this pool but not yet dispatched. */
868
- queued: number;
869
- }
870
- /**
871
- * The app-level scheduler backlog, as returned by the worker's
872
- * `GET /_lunora/admin/scheduled/status` endpoint. `pools` is the per-pool
873
- * breakdown; `backlog` and `inFlight` are the app-wide sums of `queued` and
874
- * `inFlight` across every pool — the headline numbers for the studio SLO
875
- * view. Mirrors `@lunora/scheduler`'s `SchedulerStatus` structurally.
876
- */
877
- interface SchedulerStatus {
878
- /** Sum of every pool's `queued` count — the total pending backlog. */
879
- backlog: number;
880
- /** Sum of every pool's `inFlight` count — the total held concurrency slots. */
881
- inFlight: number;
882
- /** Per-pool backlog breakdown. */
883
- pools: SchedulerPoolStatus[];
884
- }
885
- /**
886
- * One shard's request volume, as returned by the worker's
887
- * `POST /_lunora/admin/shard-traffic` endpoint. The cross-shard traffic feed
888
- * the studio's `hot_shard` advisor lint consumes: `requests` is the shard's
889
- * lifetime dispatch total, `shardKey` the DO id name (`""` for the root shard).
890
- */
891
- interface ShardTrafficEntry {
892
- requests: number;
893
- shardKey: string;
894
- }
895
- /**
896
- * The whole-shard-set traffic distribution returned by the worker's
897
- * `POST /_lunora/admin/shard-traffic` endpoint. `shards` is one entry per live
898
- * shard (a failed shard surfaces with `requests: 0`); `ok`/`failed` count the
899
- * shards that returned vs. errored. Shaped to feed the advisor's `hot_shard`
900
- * lint after the studio tags each entry with its sharded function `group`.
901
- */
902
- interface ShardTrafficResult {
903
- failed: number;
904
- ok: number;
905
- shards: ShardTrafficEntry[];
906
- }
907
- /**
908
- * One object in the storage bucket, as returned by the worker's
909
- * `GET /_lunora/admin/storage` endpoint. Mirrors `@lunora/storage`'s
910
- * `R2ObjectLike` structurally.
911
- */
912
- interface StorageObject {
913
- customMetadata?: Record<string, string>;
914
- etag: string;
915
- httpMetadata?: {
916
- contentType?: string;
917
- };
918
- key: string;
919
- size: number;
920
- /**
921
- * When the object was stored. R2 emits a `Date`, which JSON-serializes to an
922
- * ISO string over the wire; a mock may supply epoch ms — so consumers should
923
- * normalise via `new Date(uploaded)`. Absent if the backend didn't report it.
924
- */
925
- uploaded?: number | string;
926
- }
927
- /** One page of {@link StorageObject}s plus the cursor to fetch the next, if any. */
928
- interface StorageListPage {
929
- cursor?: string;
930
- objects: StorageObject[];
931
- }
932
- /**
933
- * One argument of a registered function, derived from its `v.*` validator by the
934
- * worker. A compact signature shape — enough to render a function's API without
935
- * the build-time codegen types.
936
- */
937
- interface FunctionArgumentDescriptor {
938
- /** Element validator kind for an `array` arg (one level), e.g. `string`. */
939
- element?: string;
940
- /** The (optional-unwrapped) validator kind, e.g. `string`, `id`, `object`. */
941
- kind: string;
942
- /** The argument name. */
943
- name: string;
944
- /** True when the arg is wrapped in `v.optional(...)`. */
945
- optional: boolean;
946
- /** Target table for an `id` arg (`v.id("table")`). */
947
- table?: string;
948
- }
949
- /**
950
- * One registered function, as returned by the worker's
951
- * `GET /_lunora/admin/functions` endpoint: its `<file>:<function>` path, which
952
- * client method (`query` / `mutation` / `action`) invokes it, and its argument
953
- * signature. `args` is absent on responses from an older worker.
954
- */
955
- interface FunctionDescriptor {
956
- args?: FunctionArgumentDescriptor[];
957
- kind: "action" | "mutation" | "query";
958
- path: string;
959
- }
960
- /** A `.global()` (D1-backed) table plus its row count, from `/_lunora/admin/global/tables`. */
961
- interface GlobalTableInfo {
962
- name: string;
963
- rowCount: number;
964
- }
965
- /** A window of rows from one global table, from `/_lunora/admin/global/table`. */
966
- interface GlobalTablePage {
967
- columns: string[];
968
- /** FK columns (local column → referenced table) for external tables with real `REFERENCES` constraints, from `PRAGMA foreign_key_list`. */
969
- refs?: Record<string, string>;
970
- rows: Record<string, unknown>[];
971
- total: number;
972
- }
973
- /**
974
- * One equality constraint a facet-value click adds to the global browser's view
975
- * (`column = value`). `value` is the raw stored scalar the facet returned, sent
976
- * as-is and bound server-side, so it never injects SQL.
977
- */
978
- interface GlobalFilterClause {
979
- column: string;
980
- value: unknown;
981
- }
982
- /** One distinct value of a faceted global column with its row count, from `/_lunora/admin/global/facet`. */
983
- interface GlobalFacetValue {
984
- count: number;
985
- value: unknown;
986
- }
987
- /** Per-column distinct-value summary for the global browser, from `/_lunora/admin/global/facet`. */
988
- interface GlobalFacetResult {
989
- truncated: boolean;
990
- values: GlobalFacetValue[];
991
- }
992
- /** A nullable timestamp field as better-auth serializes it: epoch-ms, ISO string, or null. */
993
- type NullableTimestamp = null | number | string;
994
- /** A workflow instance's lifecycle status. Mirrors Cloudflare's `InstanceStatus`. */
995
- type WorkflowInstanceStatus = "complete" | "errored" | "paused" | "queued" | "running" | "terminated" | "unknown" | "waiting" | "waitingForPause";
996
- /** The lifecycle mutations the status endpoint accepts. */
997
- type WorkflowInstanceAction = "pause" | "resume" | "terminate";
998
- /** One row of the workflow-instances list. */
999
- interface WorkflowInstanceSummary {
1000
- createdOn?: string;
1001
- endedOn?: string;
1002
- id: string;
1003
- startedOn?: string;
1004
- status: WorkflowInstanceStatus;
1005
- }
1006
- /** One durable step of an instance's execution timeline. */
1007
- interface WorkflowStepDetail {
1008
- /** 1-based attempt count (`> 1` means the step retried). */
1009
- attempts?: number;
1010
- end?: string;
1011
- error?: unknown;
1012
- name: string;
1013
- output?: unknown;
1014
- start?: string;
1015
- success?: boolean;
1016
- /** `step` / `sleep` / `waitForEvent` / … (Cloudflare's step `type`). */
1017
- type?: string;
1018
- }
1019
- /** A workflow instance's full detail: summary plus params/output/error and the step timeline. */
1020
- interface WorkflowInstanceDetail extends WorkflowInstanceSummary {
1021
- error?: unknown;
1022
- output?: unknown;
1023
- params?: unknown;
1024
- steps: WorkflowStepDetail[];
1025
- }
1026
- /** A page of workflow instances. */
1027
- interface WorkflowInstancePage {
1028
- /**
1029
- * Whether workflow inspection is configured on the worker (a Cloudflare
1030
- * account id + API token). `false` when the admin proxy reports it can't
1031
- * inspect instances; omitted (treated as configured) otherwise. Lets a
1032
- * caller render a "set credentials" state without a failed request.
1033
- */
1034
- configured?: boolean;
1035
- instances: WorkflowInstanceSummary[];
1036
- page: number;
1037
- perPage: number;
1038
- totalCount?: number;
1039
- }
1040
- export { ArgsOf as A, BookmarkStorage as B, CachedQuery as C, RpcEnvelope as D, RpcResponseBody as E, FunctionReference as F, GlobalTableInfo as G, HttpStreamRef as H, SchedulerPoolStatus as I, ServerMessage as J, ServerPokeEndMessage as K, LunoraClientOptions as L, ServerPokePartMessage as M, ServerPokeStartMessage as N, OfflineQueueOptions as O, Preloaded as P, QueryCacheAdapter as Q, ReturnOf as R, ShardTrafficResult as S, ShardTrafficEntry as T, User as U, StorageObject as V, WsTokenProvider as W, StoredQuery as X, WorkflowInstanceSummary as Y, WorkflowStepDetail as Z, Unsubscribe as a, ScheduleRecord as b, SchedulerStatus as c, WorkflowInstanceStatus as d, WorkflowInstancePage as e, WorkflowInstanceDetail as f, WorkflowInstanceAction as g, FunctionDescriptor as h, StorageListPage as i, GlobalFilterClause as j, GlobalTablePage as k, GlobalFacetResult as l, HttpStreamArgsOf as m, HttpStreamChunkOf as n, PersistenceAdapter as o, ReconnectOptions as p, ClientMessage as q, ClientShapeSubscribeMessage as r, ClientShapeUnsubscribeMessage as s, FunctionArgumentDescriptor as t, GlobalFacetValue as u, HttpStreamCallArgs as v, OutboxMutation as w, OutboxSink as x, PersistedMutation as y, RowOp as z };