@shivaedev/contract 0.27.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +170 -21
  3. package/dist/LiveServer.d.ts +30 -0
  4. package/dist/LiveServer.d.ts.map +1 -0
  5. package/dist/LiveServer.js +16 -0
  6. package/dist/LiveServer.js.map +1 -0
  7. package/dist/QueryServerReads.d.ts +5 -0
  8. package/dist/QueryServerReads.d.ts.map +1 -0
  9. package/dist/QueryServerReads.js +2 -0
  10. package/dist/QueryServerReads.js.map +1 -0
  11. package/dist/WebSocketRequired.d.ts +8 -0
  12. package/dist/WebSocketRequired.d.ts.map +1 -0
  13. package/dist/WebSocketRequired.js +4 -0
  14. package/dist/WebSocketRequired.js.map +1 -0
  15. package/dist/automaticLive.js +1 -1
  16. package/dist/automaticLive.js.map +1 -1
  17. package/dist/bind.d.ts +1 -2
  18. package/dist/bind.d.ts.map +1 -1
  19. package/dist/bind.js.map +1 -1
  20. package/dist/clientOptions.d.ts +1 -0
  21. package/dist/clientOptions.d.ts.map +1 -1
  22. package/dist/internal/automaticQuery.d.ts +1 -1
  23. package/dist/internal/automaticQuery.d.ts.map +1 -1
  24. package/dist/internal/automaticQuery.js +21 -4
  25. package/dist/internal/automaticQuery.js.map +1 -1
  26. package/dist/internal/clientOperations.d.ts.map +1 -1
  27. package/dist/internal/clientOperations.js +0 -4
  28. package/dist/internal/clientOperations.js.map +1 -1
  29. package/dist/internal/operationDeclaration.d.ts +6 -1
  30. package/dist/internal/operationDeclaration.d.ts.map +1 -1
  31. package/dist/internal/operationDeclaration.js.map +1 -1
  32. package/dist/internal/policyContext.d.ts +4 -0
  33. package/dist/internal/policyContext.d.ts.map +1 -0
  34. package/dist/internal/policyContext.js +7 -0
  35. package/dist/internal/policyContext.js.map +1 -0
  36. package/dist/internal/queryReactivity.d.ts.map +1 -1
  37. package/dist/internal/queryReactivity.js +10 -5
  38. package/dist/internal/queryReactivity.js.map +1 -1
  39. package/dist/internal/queryReadKeys.d.ts +5 -0
  40. package/dist/internal/queryReadKeys.d.ts.map +1 -0
  41. package/dist/internal/queryReadKeys.js +6 -0
  42. package/dist/internal/queryReadKeys.js.map +1 -0
  43. package/dist/internal/resolveQueries.d.ts +8 -0
  44. package/dist/internal/resolveQueries.d.ts.map +1 -0
  45. package/dist/internal/resolveQueries.js +8 -0
  46. package/dist/internal/resolveQueries.js.map +1 -0
  47. package/dist/internal/retryOnChange.d.ts.map +1 -1
  48. package/dist/internal/retryOnChange.js +8 -3
  49. package/dist/internal/retryOnChange.js.map +1 -1
  50. package/dist/internal/rpcClient.d.ts.map +1 -1
  51. package/dist/internal/rpcClient.js +11 -1
  52. package/dist/internal/rpcClient.js.map +1 -1
  53. package/dist/operation.d.ts +9 -9
  54. package/dist/operation.d.ts.map +1 -1
  55. package/dist/operation.js +2 -1
  56. package/dist/operation.js.map +1 -1
  57. package/dist/publicConfig.d.ts +1 -1
  58. package/dist/publicConfig.d.ts.map +1 -1
  59. package/dist/queryKeys.d.ts +9 -0
  60. package/dist/queryKeys.d.ts.map +1 -0
  61. package/dist/queryKeys.js +13 -0
  62. package/dist/queryKeys.js.map +1 -0
  63. package/dist/querySubscription.d.ts +1 -1
  64. package/dist/querySubscription.d.ts.map +1 -1
  65. package/dist/querySubscription.js +15 -3
  66. package/dist/querySubscription.js.map +1 -1
  67. package/dist/readPolicy.d.ts +1 -0
  68. package/dist/readPolicy.d.ts.map +1 -1
  69. package/dist/readPolicy.js +6 -3
  70. package/dist/readPolicy.js.map +1 -1
  71. package/dist/readPolicyErrors.d.ts +6 -0
  72. package/dist/readPolicyErrors.d.ts.map +1 -1
  73. package/dist/readPolicyErrors.js +5 -0
  74. package/dist/readPolicyErrors.js.map +1 -1
  75. package/dist/serverMetadata.d.ts +4 -5
  76. package/dist/serverMetadata.d.ts.map +1 -1
  77. package/dist/serverMetadata.js +5 -13
  78. package/dist/serverMetadata.js.map +1 -1
  79. package/dist/socketAuthentication.d.ts +18 -0
  80. package/dist/socketAuthentication.d.ts.map +1 -0
  81. package/dist/socketAuthentication.js +27 -0
  82. package/dist/socketAuthentication.js.map +1 -0
  83. package/dist/testing.d.ts +4 -2
  84. package/dist/testing.d.ts.map +1 -1
  85. package/dist/testing.js +35 -1
  86. package/dist/testing.js.map +1 -1
  87. package/dist/validateReadPolicies.d.ts +5 -0
  88. package/dist/validateReadPolicies.d.ts.map +1 -0
  89. package/dist/validateReadPolicies.js +25 -0
  90. package/dist/validateReadPolicies.js.map +1 -0
  91. package/package.json +7 -3
  92. package/src/LiveServer.ts +20 -0
  93. package/src/QueryServerReads.ts +8 -0
  94. package/src/WebSocketRequired.ts +3 -0
  95. package/src/automaticLive.ts +1 -1
  96. package/src/bind.ts +1 -5
  97. package/src/clientOptions.ts +1 -0
  98. package/src/internal/automaticQuery.ts +21 -5
  99. package/src/internal/clientOperations.ts +0 -6
  100. package/src/internal/operationDeclaration.ts +7 -1
  101. package/src/internal/policyContext.ts +8 -0
  102. package/src/internal/queryReactivity.ts +14 -5
  103. package/src/internal/queryReadKeys.ts +8 -0
  104. package/src/internal/resolveQueries.ts +10 -0
  105. package/src/internal/retryOnChange.ts +10 -3
  106. package/src/internal/rpcClient.ts +14 -5
  107. package/src/operation.ts +13 -13
  108. package/src/queryKeys.ts +23 -0
  109. package/src/querySubscription.ts +18 -4
  110. package/src/readPolicy.ts +7 -3
  111. package/src/readPolicyErrors.ts +5 -0
  112. package/src/serverMetadata.ts +7 -22
  113. package/src/socketAuthentication.ts +28 -0
  114. package/src/testing.ts +42 -2
  115. package/src/validateReadPolicies.ts +26 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.29.0 - 2026-10-31
4
+
5
+ ### Added
6
+
7
+ - `rpcBoundaryHandlers(group, boundary, handlers)` applies one boundary and unexpected mapping to a native RPC handler map, including Effect and Stream handlers and native RPC wrappers.
8
+ - Contract changes streams declare `WebSocketRequired` so HTTP clients can decode the protocol error.
9
+ - React query hooks, including `useLoaderQuery` and loader-backed editor queries, expose `denied` for a `QueryReadDenied` refusal so screens can replace retained data.
10
+ - Queries can declare a `serverReads(payload, viewer)` Effect to load additional read keys on the server after every subscription policy allows access. Its services come from the owning query handler; failures use the query's declared rejections. Bound clients refresh from the resulting hints without receiving record IDs in their payloads.
11
+
12
+ ### Changed
13
+
14
+ - A `$changes` batch remains all-or-nothing: one denied query rejects or ends live updates for the whole batch. Split queries with independent permissions into separate `$changes` requests; automatic bound queries already subscribe separately.
15
+
16
+ ### Fixed
17
+
18
+ - Hosted `$changes` subscriptions over HTTP fail with a message saying they need the WebSocket protocol.
19
+ - Live queries refused with `QueryReadDenied` remain refused through matching invalidations and resume events until their input or viewer changes. They stop automatic subscription attempts and refused reads.
20
+ - `queryRoute` sends read denials to the route's not-found component, just like missing records.
21
+
22
+ ### Breaking
23
+
24
+ - `queryKeys` moves from `serverMetadata.ts` to `queryKeys.ts` and now checks every referenced query's read policy before resolving payload and server-derived keys, and preserves their errors and service requirements. Change imports to `@shivaedev/contract/queryKeys.ts`. Custom adapters must provide those services, pass the server-resolved viewer, and handle declared rejections, `MissingReadPolicy` and `QueryReadDenied`; use `querySubscription` to capture handler services and ongoing authorization.
25
+
26
+ ## 0.28.0 - 2026-10-31
27
+
28
+ ### Added
29
+
30
+ - `layerMemoryProtocol(group)` in `testing.ts` connects `makeClient` to native RPC handlers and middleware in process, including live hints and query refreshes, without a socket or a separate `AtomRpc.Service` per contract.
31
+ - Native clients can pass `bearerToken` to `makeClient` to authenticate the shared RPC WebSocket in its first frame, without upgrade headers or credentials in URLs. The server applies its existing session and read policies, closes invalid or expired authentication with code 1008, and closes authenticated bearer sockets when their session is revoked. Native resume reconciles live query values.
32
+ - Contract exports the `signedIn` read policy and `validateReadPolicies(group)` for native hosts to validate their RPC group during Layer construction.
33
+ - Contract exposes `LiveServer` through `defineService`, with a native `.layer` requiring Reactivity. Its `stream` and `subscribe` methods return Effects containing native Streams, retaining subscription failures and caller requirements.
34
+
35
+ ### Fixed
36
+
37
+ - Live subscriptions use policy services provided inside the owning query's handlers layer, just as RPC reads do. Request-local session context takes precedence when the policy checks access to live hints.
38
+ - Admin's built-in Users and Jobs queries and Work Board's daemon diagnostics queries explicitly declare read policies; existing permission and loopback boundaries continue to own access.
39
+
40
+ ### Breaking
41
+
42
+ - Every contract query requires a `readPolicy`, including plain RPC reads. Add `readPolicy: signedIn` for any signed-in viewer, an explicit `() => Effect.succeed(true)` for public reads, or an application policy for restricted reads. Plain calls without a policy now fail closed with `MissingReadPolicy` even on native servers that bypass startup validation.
43
+ - The application server Layer fails with typed `MissingReadPolicies` before listening when untyped queries omit policies. Handle this boot error if your application narrows startup failures; its `queries` field lists every affected RPC. Query atom error types now follow their native RPC errors without an extra client-side `MissingReadPolicy` branch. Custom `ChangesQueries` annotations must now include their query definitions in `queries` alongside `resolve`.
44
+ - Server's `AppChanges` is replaced by `LiveServer` from `@shivaedev/contract/LiveServer.ts`. Replace `AppChanges` imports and requirements with `LiveServer` (use `Context.Service.Identifier<typeof LiveServer>` for its identifier type). PostgreSQL `appHost` and `appDatabase` provide it automatically; HTTP-only apps provide `LiveServer.layer` with Reactivity instead of `Layer.effect(AppChanges, makeLiveServer)`. Call `resync()` instead of reading `resync`, and use `Stream.unwrap` around the Effects returned by `stream` and `subscribe`.
45
+ - Server composition helpers (`appHostHttp`, `migratedHost`, `deferredHost`, `hostRpcRoutes` and `hostChanges`) resolve the contract service directly. Remove their live-service tag argument; calls to the former `databaseLayer(options, tag)` become `appDatabase(options)`.
46
+ - Work Board's `publishChanges` and Work Fleet's `daemonSnapshots` now require contract's `LiveServer` instead of server's `AppChanges`. Custom compositions must provide `LiveServer.layer` with Reactivity; their standard hosts already do so.
47
+ - Import server's `appDatabase` and `DatabaseConfig` directly from `@shivaedev/server/appDatabase.ts`; `appHost.ts` no longer forwards `appDatabase`, and `databaseLayer.ts` is removed.
48
+
3
49
  ## 0.27.0 - 2026-10-31
4
50
 
5
51
  ### Added
package/README.md CHANGED
@@ -159,6 +159,8 @@ export const NotesHandlers = Notes.toLayer(
159
159
 
160
160
  Save this module as `handlers.ts`. An application can put repository and service calls in these handlers. The contract checks handler result and rejection types; it does not implement persistence, authorization or transactions. This in-memory server keeps the reserved change stream open without publishing hints. When a Platform host supplies that handler, build application handlers from `Notes.application` and keep `Notes` as the host and client group.
161
161
 
162
+ To map unexpected failures once for a handler registration, declare `boundary = rpcBoundary(schema, options)` once and use `rpcBoundaryHandlers(Notes.application, boundary, handlers)` from [`@shivaedev/errors`](https://github.com/ShivaeDev/platform/tree/main/packages/errors#mapping-unexpected-failures-at-the-handler-edge), then pass the map to `Notes.application.toLayer`. Each operation declares the boundary's rejection schema; payloads, successful results and required services retain their native types.
163
+
162
164
  Native `.middleware(M)` returns a contract that retains its declarations. For example, a native middleware service can supply request identity:
163
165
 
164
166
  ```ts
@@ -225,6 +227,8 @@ const rename = runtime.fn(api.rename.run);
225
227
 
226
228
  Browsers send the session cookie at upgrade. Mounting a query opens its subscription before running its first authorized read; unmounting cancels that subscription without restarting the socket or another query. Changed keys rerun only their readers, and equal results retain the bound atom's value. Connection failures use Effect RPC's reconnect backoff; subscriptions resume and mounted queries read again because there is no retained key history. `LiveConnection.status` reports `connecting`, `live` or `reconnecting`.
227
229
 
230
+ For a native WebView, pass the signed session credential as `bearerToken` to `makeClient`. The browser WebSocket constructor needs no upgrade headers. The client adds `auth=frame` to the RPC URL and sends `{"_tag":"Authenticate","token":"<credential>"}` as its first text frame on every connection, before native RPC traffic. The bearer never enters the URL. Use a host session provider that admits bearer sessions and configure the WebView's Origin on the host. Authentication failures close the socket with code 1008 and reason `Authentication required`; an unavailable session provider closes it with code 1011 and reason `Authentication unavailable`. Sign-out or session expiry also closes an established bearer socket. Bind the client's service with a native `resume` source as shown below to reconcile live reads when the shell resumes.
231
+
228
232
  `group` supplies a larger native RPC group containing the contract, such as an admin registry. The result is a native client Layer for `ManagedRuntime.make`, plus the native `Client` service, atom `runtime` and scoped `client` Effect. Session-scoped contracts require `registry`. For Node clients, supply upgrade `headers` and `webSocketConstructor: NodeSocket.layerWebSocketConstructorWS` from `@effect/platform-node`. A native `protocol` Layer selects another transport explicitly. A `protocol: (identity) => layer` factory follows the live session identity instead: the client rebuilds its transport when that identity changes. The scoped `client` Effect uses `undefined` as the factory identity. Return a shared Layer for clients that should share a socket within one session. Use `live: false` for ordinary clients without subscriptions.
229
233
 
230
234
  ### 3. Every day: read and change
@@ -285,6 +289,7 @@ const Preferences = contract("preferences", {
285
289
  keyScope: "session",
286
290
  queries: [
287
291
  query("self", {
292
+ readPolicy: signedIn,
288
293
  reads: () => [preferences.item("self")],
289
294
  success: Schema.String,
290
295
  }),
@@ -328,6 +333,8 @@ The automatic live connection exposed at `api[LiveConnection]` includes a writab
328
333
 
329
334
  Database hosts from `@shivaedev/server` serve the contract's reserved `<contract>.$changes` stream automatically. With the native WebSocket protocol, `bind` and a React `SessionBoundary` connect query atoms without an application subscribe operation or `live()` call. The boundary finds bound APIs returned directly by `connect` or as properties such as `client.api`. See [automatic changes](https://github.com/ShivaeDev/platform/blob/main/docs/framework/changes.md) for defaults.
330
335
 
336
+ Subscribing to the hosted `$changes` stream over HTTP fails with `WebSocketRequired` from `@shivaedev/contract/WebSocketRequired.ts`; its message names the stream and says it needs the WebSocket protocol.
337
+
331
338
  A native shell supplies its lifecycle events through `bind`'s optional `resume` source:
332
339
 
333
340
  ```ts
@@ -433,7 +440,9 @@ const status = registry.get(updates.status);
433
440
 
434
441
  While paused, live coordination keeps observing hints and suppresses automatic refresh. `status.pending` saturates at 256 observations. Unpausing reconciles the explicit scope and resets the count. A resume signal also requests reconciliation: an injected native source and visible browser `online` and `visibilitychange` events request it, while hidden events do not.
435
442
 
436
- `status` exposes `connection`, `failure`, `needsResync` and `pending`. Expected stream rejections settle with `connection: "failed"` and their typed cause in `failure`. A denied read, `NotFound`, or another declared rejection makes no further subscription attempts while the page remains open. Automatic queries reopen when the viewer identity changes or a matching change invalidation arrives; resume events and unrelated hints leave them settled. Low-level `live()` listens to `retryKeys`, defaulting to its `resyncKeys`, for matching invalidations. Transport errors and server defects reconnect with jittered exponential backoff, starting at `retryDelay` (one second by default) and capped at a nominal 30 seconds. A reconnection reconciles changes missed while disconnected, and successful delivery clears the stream failure. Native query atoms keep previous successful data during a read failure and reject stale responses after invalidation. Query failures remain in their own `AsyncResult`; stream failures appear in `status.failure`.
443
+ `status` exposes `connection`, `failure`, `needsResync` and `pending`. Expected stream rejections settle with `connection: "failed"` and their typed cause in `failure`. Typed rejections do not retry on a timer. A `QueryReadDenied` refusal stays settled through matching change invalidations and resume events; changing the query input or viewer identity starts a new subscription. Other expected rejections can reopen on matching invalidations. Low-level `live()` listens to `retryKeys`, defaulting to its `resyncKeys`, for matching invalidations. Transport errors and server defects reconnect with jittered exponential backoff, starting at `retryDelay` (one second by default) and capped at a nominal 30 seconds. A reconnection reconciles changes missed while disconnected, and successful delivery clears the stream failure. Native query atoms keep previous successful data during a read failure and reject stale responses after invalidation. Query failures remain in their own `AsyncResult`; stream failures appear in `status.failure`.
444
+
445
+ A `$changes` request is authorized as a whole: one denied member rejects or ends the entire batch, including its other queries. Split queries with independent permissions into separate `$changes` requests. Automatic bound query atoms already subscribe separately.
437
446
 
438
447
  The resume signal is a scoped native atom. Disposing the registry removes its browser listeners, cleans up an injected source, including one used only through `live`, and releases the stream subscription:
439
448
 
@@ -447,34 +456,170 @@ Call the release functions and dispose the registry when the application's root
447
456
 
448
457
  ### Server hint streams
449
458
 
459
+ Import `LiveServer` from `@shivaedev/contract/LiveServer.ts`. Provide `LiveServer.layer` with the server's `Reactivity` Layer; PostgreSQL `appHost` apps already provide it. Yield `LiveServer` to obtain the shared service. Its methods return Effects: unwrap `hints.stream(keys, context)` or `hints.subscribe(subscription, context, read?)` with `Stream.unwrap`, and call `hints.resync()` to reconcile its active streams. Subscription policy failures and caller requirements remain on the returned Stream.
460
+
450
461
  Import `makeLiveServer` from `@shivaedev/contract/makeLiveServer.ts` and create it once with the server's `Reactivity` service. After application authorization, return `hints.stream([orders.item(id)])` from the native streaming RPC handler. Each subscription starts with `Resync`; invalidating its read keys produces `Changed` with those declared keys. `hints.resync` sends `Resync` to every live stream owned by that helper, including streams for otherwise unrelated keys. Independent helpers keep their resync scopes separate even when they share Reactivity. The native stream owns registration and interruption. Keep this server helper separate from the browser's `live` coordinator.
451
462
 
452
463
  Each stream queues at most 256 hints. Overflow discards the pending hints and retains one `Resync`; further hints are absorbed until that reconciliation hint is pulled. A stalled consumer can then read current query results without replaying the write backlog. This bounds the helper's queue by hint count, not by bytes: each hint's keys depend on the subscription. Transport buffers remain the transport's responsibility.
453
464
 
454
465
  ### Query policies, record keys and buckets
455
466
 
456
- A query declares its decoded input, result, `readPolicy` and `reads` together. `readPolicy(payload, viewer)` returns an Effect boolean. `viewer` is the session's `Option<{ id: string }>`; the browser does not send the identity. `QueryReadPolicy<Payload, E, R>` preserves typed failures and required services. Declare policy errors in the query's `rejections` and provide its services when building the handler Layer; those requirements also apply to the generated change subscription. Policies may use browser-safe Effect service tags whose implementations the server supplies. A failing access check reaches the client as its declared error, including during live reads; only a successful `false` denies access.
467
+ A query declares its decoded input, result, `readPolicy` and `reads` together. `readPolicy(payload, viewer)` returns an Effect boolean. `viewer` is the session's `Option<{ id: string }>`; the browser does not send the identity. `signedIn` from `readPolicy.ts` allows any signed-in viewer and refuses a signed-out viewer. `QueryReadPolicy<Payload, E, R>` preserves typed failures and required services. Declare policy errors in the query's `rejections`; a failing access check reaches the client as its declared error, including during live reads. Only a successful `false` denies access. [Policy services](#policy-services) explains richer session requirements and where to provide implementations.
457
468
 
458
469
  ```ts
459
- import { Effect, Option, Schema } from "effect";
470
+ import { Option, Schema } from "effect";
460
471
  import { collection } from "@shivaedev/changes/keys.ts";
461
472
  import { query } from "@shivaedev/contract/operation.ts";
473
+ import { signedIn } from "@shivaedev/contract/readPolicy.ts";
462
474
 
463
475
  const notes = collection("notes", Schema.Number, { userId: Schema.String });
464
476
  const Mine = query("mine", {
465
477
  payload: { title: Schema.String },
466
478
  success: Schema.Array(Schema.String),
467
- readPolicy: (_input, viewer) => Effect.succeed(Option.isSome(viewer)),
479
+ readPolicy: signedIn,
468
480
  reads: (_input, viewer) => (Option.isSome(viewer) ? [notes.bucket.userId(viewer.value.id)] : []),
469
481
  });
470
482
  ```
471
483
 
484
+ For dependencies that need server data, add `serverReads(payload, viewer)`, an Effect returning extra keys. Keep `reads` for keys the browser can derive, or return `[]` there. The server checks every referenced query's policy before it runs any `serverReads`, and resolves it with the owning query handler's services. Declare its failures in the query's `rejections`, as with policy failures. A denied subscription never runs the resolver.
485
+
486
+ ```ts
487
+ import { Context, Effect, Schema } from "effect";
488
+ import type { Key } from "@shivaedev/changes/keys.ts";
489
+ import { query } from "@shivaedev/contract/operation.ts";
490
+ import { signedIn } from "@shivaedev/contract/readPolicy.ts";
491
+
492
+ class TimelineData extends Context.Service<
493
+ TimelineData,
494
+ {
495
+ readonly readKeys: (workspaceId: string) => Effect.Effect<readonly Key[]>;
496
+ }
497
+ >()("app/TimelineData") {}
498
+
499
+ const Timeline = query("timeline", {
500
+ payload: { workspaceId: Schema.String },
501
+ success: Schema.Array(Schema.String),
502
+ readPolicy: signedIn,
503
+ reads: () => [],
504
+ serverReads: ({ workspaceId }) => Effect.flatMap(TimelineData, (data) => data.readKeys(workspaceId)),
505
+ });
506
+ ```
507
+
508
+ Provide `TimelineData` on the server to load the workspace's lists and return their keys. Use an application policy that checks workspace access; derived keys are refresh dependencies and grant no read access. Each write must publish the same keys. Keys are resolved once when the subscription opens. If new lists can join the workspace while it remains open, include a workspace bucket that every record write in that workspace also publishes, or reopen the subscription when membership changes. The browser never runs `serverReads`; changed hints identify the affected query for its normal authorized reread.
509
+
510
+ Return `false` when denial may be disclosed; the caller receives `QueryReadDenied`. For a private item whose existence the viewer must not learn, fail with a declared `NotFound` for both an absent item and an item owned by someone else:
511
+
512
+ ```ts
513
+ import { Context, Effect, Option, Schema } from "effect";
514
+ import { query } from "@shivaedev/contract/operation.ts";
515
+ import { NotFound } from "@shivaedev/errors/taxonomy.ts";
516
+
517
+ class NoteOwner extends Context.Service<NoteOwner, (id: number) => Effect.Effect<Option.Option<string>>>()("app/NoteOwner") {}
518
+ const PrivateNote = query("privateNote", {
519
+ payload: { id: Schema.Number },
520
+ readPolicy: ({ id }, viewer) =>
521
+ Effect.gen(function* () {
522
+ if (Option.isNone(viewer)) {
523
+ return false;
524
+ }
525
+ const owner = yield* (yield* NoteOwner)(id);
526
+ if (Option.isNone(owner) || owner.value !== viewer.value.id) {
527
+ return yield* new NotFound({ message: "Note not found" });
528
+ }
529
+ return true;
530
+ }),
531
+ reads: () => [],
532
+ rejections: { NotFound },
533
+ success: Schema.String,
534
+ });
535
+ ```
536
+
537
+ The server provides `NoteOwner`; the shared declaration holds only its browser-safe service tag. The same typed rejection reaches ordinary reads and live subscriptions.
538
+
472
539
  A record key, `notes.item(id)`, names one record. A bucket, `notes.bucket.userId(id)`, names every row with that field value. Declare bucket fields on the collection model with their schemas. A list may add title, state or other filters to its input and handler, but those filters never narrow its bucket. It reruns whenever any row in that bucket changes, including a row excluded by the filter. Writers explicitly announce the record and affected buckets with the same constructors from `@shivaedev/changes/keys.ts`.
473
540
 
474
- The same query policy guards running the query and subscribing to it. A subscription names query references, never arbitrary record or bucket keys. The entire subscription is refused with `QueryReadDenied` if any referenced query is denied. Without `readPolicy`, a query has no authorized live subscription: `MissingReadPolicy` tells its author to declare one. Bound query atoms also refuse a missing policy before their first read. Ordinary one-off `run` calls remain available. Reads outside a declared query acquire no automatic subscription.
541
+ The same query policy guards running the query and subscribing to it. A subscription is meant to carry one query. It names query references, never arbitrary record or bucket keys. If a subscription mixes queries the viewer may and may not read, the entire subscription is refused with `QueryReadDenied`; it delivers no partial set of hints. Every query requires `readPolicy` at declaration, including queries used only through one-off `run` calls. TypeScript rejects a policy-less declaration before handlers or a live server can be built. Platform’s application host validates the complete RPC group while building its Layer, before listening; untyped declarations missing policies fail with `MissingReadPolicies`, whose `queries` and `message` name every affected RPC. Native hosts can run `validateReadPolicies(group)` during their own Layer construction. `MissingReadPolicy` remains a request-time refusal for untyped declarations served through native servers that bypass that boot check, on plain calls and subscriptions alike. Reads outside a declared query acquire no automatic subscription.
475
542
 
476
543
  The session middleware supplies the viewer and runs `authorizeReads(effect, request, viewer)`. Custom middleware calls that function after resolving its session and declares `MissingReadPolicy` and `QueryReadDenied` in its error schema. Before delivering changed keys, the stream rechecks the owning query's policy without memoization. In a session-backed host, a signed-out, revoked or expired session ends the subscription with `Unauthorized`; a signed-in viewer whose policy refuses ends it with `QueryReadDenied`. This distinction is the same whether a change hint or the session revalidation interval detects session removal. A client refresh runs the same authorized query that produced its first value; hints carry no row values.
477
544
 
545
+ ### Policy services
546
+
547
+ Use the policy's `viewer` argument for the viewer ID. Read richer session context from Effect requirements. For example, a policy service can require `SessionUserWithProviderAccounts` from `@shivaedev/identity/identity.ts` and yield its `providerAccounts` Effect. Apply `AuthenticatedUserWithProviderAccounts` middleware to the contract and supply `authenticatedUserWithProviderAccountsLayer(sessionPolicy)` from `@shivaedev/identity/server/session.ts` alongside its handlers. The middleware provides this request-local context for both RPC calls and live change hints, including each policy recheck before a hint is delivered.
548
+
549
+ Keep the policy service tag and query declaration browser-safe; put its implementation on the server. Its method retains the session service in its requirements so the session is read when the policy runs:
550
+
551
+ ```ts
552
+ import { Context, Effect, Option, Schema } from "effect";
553
+ import { contract } from "@shivaedev/contract/contract.ts";
554
+ import { query } from "@shivaedev/contract/operation.ts";
555
+ import type { Viewer } from "@shivaedev/contract/readPolicy.ts";
556
+ import { AuthUnavailable, Unauthorized } from "@shivaedev/errors/taxonomy.ts";
557
+ import { SessionUserWithProviderAccounts } from "@shivaedev/identity/identity.ts";
558
+ import { AuthenticatedUserWithProviderAccounts } from "@shivaedev/identity/middleware.ts";
559
+
560
+ class ReadAccess extends Context.Service<
561
+ ReadAccess,
562
+ {
563
+ readonly allows: (
564
+ accountId: string,
565
+ viewer: Option.Option<Viewer>,
566
+ ) => Effect.Effect<boolean, AuthUnavailable | Unauthorized, SessionUserWithProviderAccounts>;
567
+ }
568
+ >()("app/ReadAccess") {}
569
+
570
+ const Get = query("get", {
571
+ payload: { accountId: Schema.String },
572
+ readPolicy: ({ accountId }, viewer) => Effect.flatMap(ReadAccess, (access) => access.allows(accountId, viewer)),
573
+ reads: () => [],
574
+ rejections: { AuthUnavailable, Unauthorized },
575
+ success: Schema.String,
576
+ });
577
+ const Documents = contract("documents", { queries: [Get] }).middleware(AuthenticatedUserWithProviderAccounts);
578
+ ```
579
+
580
+ Provide the implementation from the query's handlers layer with native `Layer.provide`:
581
+
582
+ ```ts
583
+ import { Effect, Layer, Option } from "effect";
584
+
585
+ const ReadAccessLive = Layer.succeed(ReadAccess, {
586
+ allows: (accountId, viewer) =>
587
+ Effect.gen(function* () {
588
+ const user = yield* SessionUserWithProviderAccounts;
589
+ const accounts = yield* user.providerAccounts;
590
+ return (
591
+ Option.isSome(viewer)
592
+ && viewer.value.id === user.id
593
+ && accounts.some((account) => account.providerId === "github" && account.accountId === accountId)
594
+ );
595
+ }),
596
+ });
597
+ const DocumentHandlers = Documents.application
598
+ .toLayer({
599
+ "documents.get": ({ accountId }) => Effect.succeed(`Document for ${accountId}`),
600
+ })
601
+ .pipe(Layer.provide(ReadAccessLive));
602
+ ```
603
+
604
+ The generated subscription uses the owning query handler's captured services too, so this handler-only provision serves subscriptions as well as RPC calls. Request-local services take precedence over captured services; a session value installed while building handlers cannot replace the current viewer's session. The policy runs again for live hints; its allow or deny result is not cached.
605
+
606
+ ### In-memory clients in story kits
607
+
608
+ `layerMemoryProtocol(group)` from `@shivaedev/contract/testing.ts` connects the native RPC client and server in the same process. Provide the group's handlers and middleware with `Layer.provide`, then pass the protocol to the application's client factory:
609
+
610
+ ```ts
611
+ import { Layer } from "effect";
612
+ import { makeClient } from "@shivaedev/contract/bind.ts";
613
+ import { layerMemoryProtocol } from "@shivaedev/contract/testing.ts";
614
+
615
+ const client = makeClient(Notes, {
616
+ protocol: layerMemoryProtocol(Notes).pipe(Layer.provide(handlers)),
617
+ url: "memory://notes",
618
+ });
619
+ ```
620
+
621
+ The URL identifies the client configuration; the in-memory protocol opens no socket. The client's direct calls and bound query atoms use the real handlers, schema decoding and middleware. Live subscriptions deliver the server's initial resync and changed hints, and mounted queries refresh from those hints. Closing a subscription interrupts its server stream. The protocol does not add handlers or publish changes: provide the same live handlers and change source that the application serves over WebSocket.
622
+
478
623
  ### Live hints in stories
479
624
 
480
625
  Use `watchHints` and `heard` from `@shivaedev/contract/testing.ts` in an application's story kit. Pass each viewer's authenticated live stream to `watchHints`; it starts a scoped subscription and waits for its first hint before returning the viewer handle.
@@ -493,22 +638,26 @@ expect(yield* heard(bob, [notes.item(1)], { within: "50 millis" })).toBe(false);
493
638
 
494
639
  Import the module that defines the name; the package has no root entry.
495
640
 
496
- | Module | Functions and schemas |
497
- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
498
- | `operation.ts` | `query(name, { payload?, success?, rejections?, readPolicy?, reads })`; `command(name, { payload?, success?, rejections?, invalidates })`; `stream(name, { payload?, success, rejections?, reads })`. |
499
- | `contract.ts` | `contract(name, { queries?, commands?, streams?, keyScope? })`, returning a native RPC group with `declaration: { name, queries, commands, streams, keyScope }`. |
500
- | `rejection.ts` | `fieldRejection(struct, fields?)`; lower-level `rejectionSet(specs)`, which constructs the rejection classes, union schema and failure helpers used by operations. |
501
- | `bind.ts` | `bind(contract, atomRpcService, { registry?, live?, resume?, resumeWindow? }?)`, requiring the registry for session-scoped contracts and exposing `{ query, run }` for queries, `{ run }` Effects for commands and `{ run }` native Streams for streams; `makeClient(contract, { url, protocol?, headers?, webSocketConstructor?, group?, registry?, live? })`, which builds the shared WebSocket client and binds it. |
502
- | `queryCoalesceWindow.ts` | `queryCoalesceWindow(query)`, a writable atom for a bound query's live changed-hint window. |
503
- | `live.ts` | `LiveHint` schema; `live(runtime, { stream, resyncKeys, coalesceWindow?, initialResync?, keyContext?, resume?, retryDelay?, retryKeys? })`, exposing `connection`, `coalesceWindow`, `paused` and `status`. |
504
- | `querySubscription.ts` | `querySubscription(rpc, references, viewer)` checks each referenced query and captures its scopes and ongoing authorization. |
505
- | `makeLiveServer.ts` | `makeLiveServer`, an Effect requiring `Reactivity` that creates scoped server hint streams and a `resync` Effect. |
506
- | `readPolicy.ts` | `QueryReadPolicy`, `Viewer`, `authorizeReads(effect, request, viewer)`, `CurrentViewer`. |
507
- | `readPolicyErrors.ts` | `MissingReadPolicy` and `QueryReadDenied`. |
508
- | `serverMetadata.ts` | `KeyScope`, `QueryDefinition.definition`, `CommandInvalidation.invalidates`, `ChangesQueries.resolve(references)`, the Effect `queryKeys(queries, references)` and `changesRpc(name, queries)` for server adapters. |
509
- | `resume.ts` | `resumeSignal({ window?, native? })`, returning a native numeric signal atom. |
510
- | `clientActivity.ts` | `clientActivity(client)` exposes a native activity Stream with a `current` Effect; `isClientIdle(state)` checks finite work. |
511
- | `testing.ts` | `watchHints(stream)` starts a scoped viewer subscription; `heard(viewer, keys, { within? }?)` waits for matching changed keys. |
641
+ | Module | Functions and schemas |
642
+ | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
643
+ | `operation.ts` | `query(name, { payload?, success?, rejections?, readPolicy, reads, serverReads? })`; `command(name, { payload?, success?, rejections?, invalidates })`; `stream(name, { payload?, success, rejections?, reads })`. |
644
+ | `contract.ts` | `contract(name, { queries?, commands?, streams?, keyScope? })`, returning a native RPC group with `declaration: { name, queries, commands, streams, keyScope }`. |
645
+ | `rejection.ts` | `fieldRejection(struct, fields?)`; lower-level `rejectionSet(specs)`, which constructs the rejection classes, union schema and failure helpers used by operations. |
646
+ | `bind.ts` | `bind(contract, atomRpcService, { registry?, live?, resume?, resumeWindow? }?)`, requiring the registry for session-scoped contracts and exposing `{ query, run }` for queries, `{ run }` Effects for commands and `{ run }` native Streams for streams; `makeClient(contract, { url, protocol?, headers?, webSocketConstructor?, group?, registry?, live? })`, which builds the shared WebSocket client and binds it. |
647
+ | `queryCoalesceWindow.ts` | `queryCoalesceWindow(query)`, a writable atom for a bound query's live changed-hint window. |
648
+ | `live.ts` | `LiveHint` schema; `live(runtime, { stream, resyncKeys, coalesceWindow?, initialResync?, keyContext?, resume?, retryDelay?, retryKeys? })`, exposing `connection`, `coalesceWindow`, `paused` and `status`. |
649
+ | `querySubscription.ts` | `querySubscription(rpc, references, viewer)` checks each referenced query, resolves its payload and server-derived keys, and captures its scopes and ongoing authorization. |
650
+ | `LiveServer.ts` | `LiveServer`, the shared live server service and its `.layer`, requiring `Reactivity`. |
651
+ | `makeLiveServer.ts` | `makeLiveServer`, an Effect requiring `Reactivity` that creates scoped server hint streams and a `resync` Effect. |
652
+ | `readPolicy.ts` | `QueryReadPolicy`, `Viewer`, `signedIn`, `authorizeReads(effect, request, viewer)`, `CurrentViewer`. |
653
+ | `validateReadPolicies.ts` | `validateReadPolicies(group)`, an Effect that fails with `MissingReadPolicies` when any served or subscribable query omits its policy. |
654
+ | `readPolicyErrors.ts` | `MissingReadPolicies` (boot), `MissingReadPolicy` (native-server request fallback) and `QueryReadDenied`. |
655
+ | `serverMetadata.ts` | `KeyScope`, `QueryDefinition.definition`, `CommandInvalidation.invalidates`, `ChangesQueries.queries`, `ChangesQueries.resolve(references)` and `changesRpc(name, queries)` for server adapters. |
656
+ | `queryKeys.ts` | `queryKeys(queries, references, viewer?)` authorizes references and resolves payload and server-derived keys using the provided services. |
657
+ | `QueryServerReads.ts` | `QueryServerReads<Payload, E, R>`, the server-only resolver type. |
658
+ | `resume.ts` | `resumeSignal({ window?, native? })`, returning a native numeric signal atom. |
659
+ | `clientActivity.ts` | `clientActivity(client)` exposes a native activity Stream with a `current` Effect; `isClientIdle(state)` checks finite work. |
660
+ | `testing.ts` | `layerMemoryProtocol(group)` supplies an in-memory native RPC protocol backed by the group’s handlers and middleware; `watchHints(stream)` starts a scoped viewer subscription; `heard(viewer, keys, { within? }?)` waits for matching changed keys. |
512
661
 
513
662
  A query atom takes native query options as its optional second argument, for example `api.get.query({ id: 1 }, { timeToLive: "1 minute" })`. A native resume source receives a callback and returns a cleanup function.
514
663
 
@@ -0,0 +1,30 @@
1
+ import { Effect } from "effect";
2
+ import * as Reactivity from "effect/reactivity/Reactivity";
3
+ import type { Key, KeyContext } from "@shivaedev/changes/keys.ts";
4
+ import type { QueryRerun, QuerySubscription } from "#querySubscription.ts";
5
+ export declare const LiveServer: import("effect/Context").Service<"@shivaedev/contract/LiveServer", Readonly<{
6
+ readonly resync: () => Effect.Effect<number, never, never>;
7
+ readonly stream: (keys: readonly Key[], context?: KeyContext | undefined) => Effect.Effect<import("effect/Stream").Stream<{
8
+ readonly _tag: "Changed";
9
+ readonly keys: readonly ({
10
+ readonly _tag: "Bucket";
11
+ readonly collection: string;
12
+ readonly field: string;
13
+ readonly value: string | number;
14
+ } | {
15
+ readonly _tag: "List";
16
+ readonly collection: string;
17
+ } | {
18
+ readonly _tag: "Item";
19
+ readonly collection: string;
20
+ readonly id: string | number;
21
+ })[];
22
+ readonly queryIndexes?: readonly number[] | undefined;
23
+ } | {
24
+ readonly _tag: "Resync";
25
+ }, never, never>, never, never>;
26
+ readonly subscribe: <E, R>(subscription: QuerySubscription<E, R>, context?: KeyContext, read?: QueryRerun<E, R>) => Effect.Effect<import("effect/Stream").Stream<import("./queryUpdate.ts").QueryUpdate, E | import("./readPolicyErrors.ts").QueryReadDenied, R>, never, never>;
27
+ }>> & {
28
+ readonly layer: import("effect/Layer").Layer<"@shivaedev/contract/LiveServer", never, Reactivity.Reactivity>;
29
+ };
30
+ //# sourceMappingURL=LiveServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveServer.d.ts","sourceRoot":"","sources":["../src/LiveServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAIlE,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;yBAMK,CAAC,EAAE,CAAC,gBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,UAAU,SAAS,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;;;CAKpH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Effect } from "effect";
2
+ import * as Reactivity from "effect/reactivity/Reactivity";
3
+ import { defineService } from "@shivaedev/service/defineService.ts";
4
+ import { genericMethod } from "@shivaedev/service/genericMethod.ts";
5
+ import { makeLiveServer } from "#makeLiveServer.ts";
6
+ export const LiveServer = defineService({
7
+ id: "@shivaedev/contract/LiveServer",
8
+ initialize: makeLiveServer,
9
+ methods: (server) => ({
10
+ resync: () => server.resync,
11
+ stream: (keys, context) => Effect.succeed(server.stream(keys, context)),
12
+ subscribe: genericMethod((subscription, context, read) => Effect.succeed(read === undefined ? server.subscribe(subscription, context) : server.subscribe(subscription, context, read))),
13
+ }),
14
+ requires: [Reactivity.Reactivity],
15
+ });
16
+ //# sourceMappingURL=LiveServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveServer.js","sourceRoot":"","sources":["../src/LiveServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;IACvC,EAAE,EAAE,gCAAgC;IACpC,UAAU,EAAE,cAAc;IAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACrB,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM;QAC3B,MAAM,EAAE,CAAC,IAAoB,EAAE,OAAoB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpG,SAAS,EAAE,aAAa,CAAC,CAAO,YAAqC,EAAE,OAAoB,EAAE,IAAuB,EAAE,EAAE,CACvH,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAC5H;KACD,CAAC;IACF,QAAQ,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;CACjC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Effect, Option } from "effect";
2
+ import type { Key } from "@shivaedev/changes/keys.ts";
3
+ import type { Viewer } from "#readPolicy.ts";
4
+ export type QueryServerReads<TPayload, E = never, R = never> = (payload: TPayload, viewer: Option.Option<Viewer>) => Effect.Effect<readonly Key[], E, R>;
5
+ //# sourceMappingURL=QueryServerReads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryServerReads.d.ts","sourceRoot":"","sources":["../src/QueryServerReads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,gBAAgB,CAAC,QAAQ,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,IAAI,CAC9D,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KACzB,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=QueryServerReads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryServerReads.js","sourceRoot":"","sources":["../src/QueryServerReads.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { Schema } from "effect";
2
+ declare const WebSocketRequired_base: Schema.Class<WebSocketRequired, Schema.TaggedStruct<"WebSocketRequired", {
3
+ readonly message: Schema.String;
4
+ }>, import("effect/Cause").YieldableError>;
5
+ export declare class WebSocketRequired extends WebSocketRequired_base {
6
+ }
7
+ export {};
8
+ //# sourceMappingURL=WebSocketRequired.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebSocketRequired.d.ts","sourceRoot":"","sources":["../src/WebSocketRequired.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;AAEhC,qBAAa,iBAAkB,SAAQ,sBAAwF;CAAG"}
@@ -0,0 +1,4 @@
1
+ import { Schema } from "effect";
2
+ export class WebSocketRequired extends Schema.TaggedError()("WebSocketRequired", { message: Schema.String }) {
3
+ }
4
+ //# sourceMappingURL=WebSocketRequired.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebSocketRequired.js","sourceRoot":"","sources":["../src/WebSocketRequired.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,EAAqB,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;CAAG"}
@@ -32,7 +32,7 @@ export function automaticLive(service, name, owner, resume, enabled = true, resu
32
32
  }
33
33
  const ready = Atom.make(false);
34
34
  const delivery = queryDelivery(atom, decode, paused);
35
- const source = delivery.atom;
35
+ const source = decode === undefined ? delivery.atom.pipe(Atom.setIdleTTL(0)) : delivery.atom;
36
36
  const subscription = live(service.runtime, {
37
37
  initialResync: false,
38
38
  keyContext: owner?.context,
@@ -1 +1 @@
1
- {"version":3,"file":"automaticLive.js","sourceRoot":"","sources":["../src/automaticLive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAe,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEpE,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAI/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAmB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAwC,YAAY,EAAE,MAAM,YAAY,CAAC;AAKhF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;AAW/E,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAa5F,MAAM,UAAU,aAAa,CAC5B,OAAsB,EACtB,IAAY,EACZ,KAAoB,EACpB,MAAqB,EACrB,OAAO,GAAG,IAA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M,CAAC,GAAG,IAAI,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CACxH,QAAQ,CAAC,MAAM,EACf,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CACjD;SACD,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,cAAc,CAAC;YAC5B,WAAW;YACX,IAAI;YACJ,cAAc;YACd,UAAU;YACV,MAAM;YACN,MAAM,EAAE,MAAM,KAAK,SAAS;YAC5B,KAAK;YACL,MAAM;YACN,MAAM;YACN,QAAQ;YACR,YAAY;SACZ,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QACnD,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;AAC1G,CAAC"}
package/dist/bind.d.ts CHANGED
@@ -11,7 +11,6 @@ import { type LiveBound } from "#automaticLive.ts";
11
11
  import type { ClientOptions, MadeClient } from "#clientOptions.ts";
12
12
  import type { Contract, Tag } from "#contract.ts";
13
13
  import type { CommandShape, QueryShape, StreamShape } from "#operation.ts";
14
- import type { MissingReadPolicy } from "#readPolicyErrors.ts";
15
14
  import type { ResumeSource, ResumeWindow } from "#resume.ts";
16
15
  export type Failure<R extends Rpc.Any> = R extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer TMiddleware, infer _Requires> ? Rpc.ErrorExit<R> | TMiddleware["error"]["Type"] | RpcClientError : never;
17
16
  export type RunFailure<R extends Rpc.Any> = R extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer TMiddleware, infer _Requires> ? Failure<R> | TMiddleware["~ClientError"] : never;
@@ -21,7 +20,7 @@ export interface QueryOptions {
21
20
  readonly timeToLive?: Duration.Input;
22
21
  }
23
22
  export interface BoundQuery<R extends Rpc.Any, TSelf> {
24
- readonly query: (payload: Rpc.Payload<R>, options?: QueryOptions) => Atom.Atom<AsyncResult.AsyncResult<Rpc.Success<R>, Failure<R> | MissingReadPolicy>>;
23
+ readonly query: (payload: Rpc.Payload<R>, options?: QueryOptions) => Atom.Atom<AsyncResult.AsyncResult<Rpc.Success<R>, Failure<R>>>;
25
24
  readonly run: (payload: Rpc.Payload<R>) => Effect.Effect<Rpc.Success<R>, RunFailure<R>, TSelf>;
26
25
  }
27
26
  export interface BoundCommand<R extends Rpc.Any, TSelf> {
@@ -1 +1 @@
1
- {"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../src/bind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,KAAK,YAAY,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM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;QAClB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,CAAU,CAAC;QACvH,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAU,CAAC;QACvH,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,CAAU,CAAC;KAClG,CAAC,EACF,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,YAAY,EAAE,CAC5C,CAAC;AACH,CAAC;AAgBD,MAAM,UAAU,UAAU,CACzB,QAEC,EACD,OAGC;IAED,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,IAAI,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5F,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;AAC3C,CAAC"}
@@ -9,6 +9,7 @@ import type { Bound } from "#bind.ts";
9
9
  import type { ActiveClient } from "#clientActivity.ts";
10
10
  import type { CommandShape, QueryShape, StreamShape } from "#operation.ts";
11
11
  export interface ClientOptions {
12
+ readonly bearerToken?: string;
12
13
  readonly headers?: Readonly<Record<string, string>>;
13
14
  readonly live?: boolean;
14
15
  readonly protocol?: Layer.Layer<RpcClient.Protocol> | ((identity: string | undefined) => Layer.Layer<RpcClient.Protocol>);
@@ -1 +1 @@
1
- {"version":3,"file":"clientOptions.d.ts","sourceRoot":"","sources":["../src/clientOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE3E,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1H,QAAQ,CAAC,GAAG,EAAE,M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gB,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;IAC/I,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;CACzE,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Duration } from "effect";
1
+ import { type Duration } from "effect";
2
2
  import * as AsyncResult from "effect/reactivity/AsyncResult";
3
3
  import * as Atom from "effect/reactivity/Atom";
4
4
  import type { LiveBound, LiveConnection } from "#automaticLive.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"automaticQuery.d.ts","sourceRoot":"","sources":["../../src/internal/automaticQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,UAAU,WAAW,CAAC,CAAC,EAAE,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvD,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,C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