foldkit-sync 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +543 -893
- package/dist/entity.d.mts +231 -0
- package/dist/entity.d.mts.map +1 -0
- package/dist/entity.mjs +204 -0
- package/dist/entity.mjs.map +1 -0
- package/dist/index.d.mts +51 -485
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +132 -331
- package/dist/index.mjs.map +1 -1
- package/dist/journal.d.mts +132 -0
- package/dist/journal.d.mts.map +1 -0
- package/dist/journal.mjs +204 -0
- package/dist/journal.mjs.map +1 -0
- package/dist/sync-CP5UGs4r.d.mts +547 -0
- package/dist/sync-CP5UGs4r.d.mts.map +1 -0
- package/dist/transport-hlEQpHIv.mjs +359 -0
- package/dist/transport-hlEQpHIv.mjs.map +1 -0
- package/package.json +25 -8
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
import { Config, Context, Duration, Effect, Layer, Metric, Option, Schema, Stream } from "effect";
|
|
2
|
+
//#region src/ids.d.ts
|
|
3
|
+
/** Identifies the replicated document a replica or operation belongs to. */
|
|
4
|
+
declare const DocumentId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/DocumentId">;
|
|
5
|
+
type DocumentId = typeof DocumentId.Type;
|
|
6
|
+
/** Identifies one replica (writer identity) within a document. */
|
|
7
|
+
declare const ReplicaId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/ReplicaId">;
|
|
8
|
+
type ReplicaId = typeof ReplicaId.Type;
|
|
9
|
+
/** The stable identity of one operation within a document. */
|
|
10
|
+
declare const OpId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/OpId">;
|
|
11
|
+
type OpId = typeof OpId.Type;
|
|
12
|
+
/**
|
|
13
|
+
* A position in the committed document order. `0` is the start; a committed
|
|
14
|
+
* operation's `serverSequence` and a replica's `cursor` are the same family.
|
|
15
|
+
*/
|
|
16
|
+
declare const Sequence: Schema.brand<Schema.Number, "@foldkit-sync/Sequence">;
|
|
17
|
+
type Sequence = typeof Sequence.Type;
|
|
18
|
+
/** A replica's own operation counter within a document; 1-based. */
|
|
19
|
+
declare const LocalSequence: Schema.brand<Schema.Number, "@foldkit-sync/LocalSequence">;
|
|
20
|
+
type LocalSequence = typeof LocalSequence.Type;
|
|
21
|
+
/**
|
|
22
|
+
* Decode-and-brand helpers. A branded schema constructs the same value with
|
|
23
|
+
* `DocumentId.make('todos')`, which is the spelling to lead with; these stay
|
|
24
|
+
* for callers that already have them.
|
|
25
|
+
*/
|
|
26
|
+
declare const documentId: (value: string) => DocumentId;
|
|
27
|
+
declare const replicaId: (value: string) => ReplicaId;
|
|
28
|
+
declare const opId: (value: string) => OpId;
|
|
29
|
+
declare const sequence: (value: number) => Sequence;
|
|
30
|
+
declare const localSequence: (value: number) => LocalSequence;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/errors.d.ts
|
|
33
|
+
declare const StorageError_base: Schema.Class<StorageError, Schema.TaggedStruct<"StorageError", {
|
|
34
|
+
readonly message: Schema.String;
|
|
35
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
36
|
+
}>, import("effect/Cause").YieldableError>;
|
|
37
|
+
/** The persisted storage could not be read or written. */
|
|
38
|
+
declare class StorageError extends StorageError_base {}
|
|
39
|
+
declare const UnsupportedClockVersionError_base: Schema.Class<UnsupportedClockVersionError, Schema.TaggedStruct<"UnsupportedClockVersionError", {
|
|
40
|
+
readonly schemaVersion: Schema.NullOr<Schema.Number>;
|
|
41
|
+
readonly message: Schema.String;
|
|
42
|
+
}>, import("effect/Cause").YieldableError>;
|
|
43
|
+
/** The stored clock state targets a schema version this build does not support. */
|
|
44
|
+
declare class UnsupportedClockVersionError extends UnsupportedClockVersionError_base {}
|
|
45
|
+
declare const WrongReplicaStorageError_base: Schema.Class<WrongReplicaStorageError, Schema.TaggedStruct<"WrongReplicaStorageError", {
|
|
46
|
+
readonly documentId: Schema.String;
|
|
47
|
+
readonly replicaId: Schema.String;
|
|
48
|
+
readonly message: Schema.String;
|
|
49
|
+
}>, import("effect/Cause").YieldableError>;
|
|
50
|
+
/** The storage holds a different replica's state. */
|
|
51
|
+
declare class WrongReplicaStorageError extends WrongReplicaStorageError_base {}
|
|
52
|
+
declare const InvalidReplicaHistoryError_base: Schema.Class<InvalidReplicaHistoryError, Schema.TaggedStruct<"InvalidReplicaHistoryError", {
|
|
53
|
+
readonly message: Schema.String;
|
|
54
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
55
|
+
}>, import("effect/Cause").YieldableError>;
|
|
56
|
+
/** The persisted replica history is internally inconsistent. */
|
|
57
|
+
declare class InvalidReplicaHistoryError extends InvalidReplicaHistoryError_base {}
|
|
58
|
+
declare const InvalidExchangeError_base: Schema.Class<InvalidExchangeError, Schema.TaggedStruct<"InvalidExchangeError", {
|
|
59
|
+
readonly message: Schema.String;
|
|
60
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
61
|
+
}>, import("effect/Cause").YieldableError>;
|
|
62
|
+
/** The server's exchange response did not match the protocol schema. */
|
|
63
|
+
declare class InvalidExchangeError extends InvalidExchangeError_base {}
|
|
64
|
+
declare const InvalidOutboxError_base: Schema.Class<InvalidOutboxError, Schema.TaggedStruct<"InvalidOutboxError", {
|
|
65
|
+
readonly message: Schema.String;
|
|
66
|
+
}>, import("effect/Cause").YieldableError>;
|
|
67
|
+
/** A persisted pending operation could not have been produced by this replica. */
|
|
68
|
+
declare class InvalidOutboxError extends InvalidOutboxError_base {}
|
|
69
|
+
declare const CheckpointRegressionError_base: Schema.Class<CheckpointRegressionError, Schema.TaggedStruct<"CheckpointRegressionError", {
|
|
70
|
+
readonly cursor: Schema.Number;
|
|
71
|
+
readonly checkpointCursor: Schema.Number;
|
|
72
|
+
readonly message: Schema.String;
|
|
73
|
+
}>, import("effect/Cause").YieldableError>;
|
|
74
|
+
/** The server sent a checkpoint older than the replica's cursor. */
|
|
75
|
+
declare class CheckpointRegressionError extends CheckpointRegressionError_base {}
|
|
76
|
+
declare const CommittedOrderError_base: Schema.Class<CommittedOrderError, Schema.TaggedStruct<"CommittedOrderError", {
|
|
77
|
+
readonly expected: Schema.Number;
|
|
78
|
+
readonly actual: Schema.Number;
|
|
79
|
+
readonly message: Schema.String;
|
|
80
|
+
}>, import("effect/Cause").YieldableError>;
|
|
81
|
+
/** Committed operations were not contiguous from the replica's cursor. */
|
|
82
|
+
declare class CommittedOrderError extends CommittedOrderError_base {}
|
|
83
|
+
declare const ForeignRejectionError_base: Schema.Class<ForeignRejectionError, Schema.TaggedStruct<"ForeignRejectionError", {
|
|
84
|
+
readonly opId: Schema.String;
|
|
85
|
+
readonly message: Schema.String;
|
|
86
|
+
}>, import("effect/Cause").YieldableError>;
|
|
87
|
+
/** The server rejected an operation the replica never sent. */
|
|
88
|
+
declare class ForeignRejectionError extends ForeignRejectionError_base {}
|
|
89
|
+
declare const ForeignAcknowledgementError_base: Schema.Class<ForeignAcknowledgementError, Schema.TaggedStruct<"ForeignAcknowledgementError", {
|
|
90
|
+
readonly opId: Schema.String;
|
|
91
|
+
readonly message: Schema.String;
|
|
92
|
+
}>, import("effect/Cause").YieldableError>;
|
|
93
|
+
/**
|
|
94
|
+
* The server answered an operation this request never sent, or both
|
|
95
|
+
* acknowledged and rejected it. Acting on either would let a faulty or hostile
|
|
96
|
+
* server delete local work.
|
|
97
|
+
*/
|
|
98
|
+
declare class ForeignAcknowledgementError extends ForeignAcknowledgementError_base {}
|
|
99
|
+
declare const ReplicaClosedError_base: Schema.Class<ReplicaClosedError, Schema.TaggedStruct<"ReplicaClosedError", {
|
|
100
|
+
readonly message: Schema.String;
|
|
101
|
+
}>, import("effect/Cause").YieldableError>;
|
|
102
|
+
/** The replica was closed while work was still being submitted. */
|
|
103
|
+
declare class ReplicaClosedError extends ReplicaClosedError_base {}
|
|
104
|
+
declare const UnsupportedReplicaVersionError_base: Schema.Class<UnsupportedReplicaVersionError, Schema.TaggedStruct<"UnsupportedReplicaVersionError", {
|
|
105
|
+
readonly protocolVersion: Schema.NullOr<Schema.Number>;
|
|
106
|
+
readonly schemaVersion: Schema.NullOr<Schema.Number>;
|
|
107
|
+
readonly message: Schema.String;
|
|
108
|
+
}>, import("effect/Cause").YieldableError>;
|
|
109
|
+
/** The stored replica state targets a protocol or schema version this build does not support. */
|
|
110
|
+
declare class UnsupportedReplicaVersionError extends UnsupportedReplicaVersionError_base {}
|
|
111
|
+
declare const ReplayError_base: Schema.Class<ReplayError, Schema.TaggedStruct<"ReplayError", {
|
|
112
|
+
readonly message: Schema.String;
|
|
113
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
114
|
+
}>, import("effect/Cause").YieldableError>;
|
|
115
|
+
/**
|
|
116
|
+
* `replay` threw for a submitted Message, so it could never be applied here or
|
|
117
|
+
* on any other replica; nothing was written.
|
|
118
|
+
*/
|
|
119
|
+
declare class ReplayError extends ReplayError_base {}
|
|
120
|
+
type ReplicaError = StorageError | ReplayError | WrongReplicaStorageError | InvalidReplicaHistoryError | InvalidExchangeError | UnsupportedReplicaVersionError | InvalidOutboxError | CheckpointRegressionError | CommittedOrderError | ForeignRejectionError | ForeignAcknowledgementError | ReplicaClosedError;
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/indexedDb.d.ts
|
|
123
|
+
/** One submitted operation, as `Storage.append` records it. */
|
|
124
|
+
interface OutboxEntry {
|
|
125
|
+
/** The replica's revision once this operation is in its outbox. */
|
|
126
|
+
readonly revision: number;
|
|
127
|
+
readonly nextLocalSequence: number;
|
|
128
|
+
/**
|
|
129
|
+
* The operation's local sequence. An entry with the sequence of one already in the
|
|
130
|
+
* outbox replaces it: a coalesced submit rewrites the last operation.
|
|
131
|
+
*/
|
|
132
|
+
readonly localSequence: number;
|
|
133
|
+
/** The operation, encoded. */
|
|
134
|
+
readonly operation: unknown;
|
|
135
|
+
}
|
|
136
|
+
/** Persists a replica's state with compare-and-swap on its revision. */
|
|
137
|
+
interface Storage {
|
|
138
|
+
/**
|
|
139
|
+
* The saved state, with every operation appended since in its `pending` (replacing the
|
|
140
|
+
* one of the same local sequence), and the last one's `revision` and `nextLocalSequence`.
|
|
141
|
+
*/
|
|
142
|
+
load: () => Effect.Effect<unknown, StorageError>;
|
|
143
|
+
/** Replaces the whole state, and with it every appended operation. */
|
|
144
|
+
save: (state: unknown, expectedRevision: number | null) => Effect.Effect<void, StorageError>;
|
|
145
|
+
/**
|
|
146
|
+
* Optional. Records one submitted operation without rewriting the rest of the state, so
|
|
147
|
+
* a submit costs the operation's size rather than the document's. Without it, a submit
|
|
148
|
+
* saves the whole state.
|
|
149
|
+
*/
|
|
150
|
+
append?: (entry: OutboxEntry, expectedRevision: number) => Effect.Effect<void, StorageError>;
|
|
151
|
+
/** Idempotent; the caller closes the connection explicitly. */
|
|
152
|
+
close: Effect.Effect<void>;
|
|
153
|
+
}
|
|
154
|
+
/** One database per document/replica; CAS prevents two tabs from sharing a writer identity. */
|
|
155
|
+
declare const indexedDb: (name: string | Config.Config<string>, factory?: IDBFactory | undefined) => Effect.Effect<Required<Storage>, StorageError, import("effect/Scope").Scope>;
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/transport.d.ts
|
|
158
|
+
declare const TransportError_base: Schema.Class<TransportError, Schema.TaggedStruct<"SyncTransportError", {
|
|
159
|
+
readonly message: Schema.String;
|
|
160
|
+
}>, import("effect/Cause").YieldableError>;
|
|
161
|
+
/** The wire failure of a transport. A refusal is a result, not an error. */
|
|
162
|
+
declare class TransportError extends TransportError_base {}
|
|
163
|
+
/** One request/response frame, as it crosses a wire. */
|
|
164
|
+
interface ExchangeFrame {
|
|
165
|
+
readonly id: string;
|
|
166
|
+
readonly cursor: number;
|
|
167
|
+
readonly pending: ReadonlyArray<Operation>;
|
|
168
|
+
readonly epoch?: string | undefined;
|
|
169
|
+
}
|
|
170
|
+
interface ExchangeReply {
|
|
171
|
+
readonly id: string;
|
|
172
|
+
readonly result?: unknown;
|
|
173
|
+
readonly error?: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Sent by a server, unasked, when the document may have changed. It carries no
|
|
177
|
+
* data: the replica exchanges from its own cursor, so a notice that is lost,
|
|
178
|
+
* late, or one of many is harmless.
|
|
179
|
+
*/
|
|
180
|
+
interface NotifyFrame {
|
|
181
|
+
readonly notify: true;
|
|
182
|
+
}
|
|
183
|
+
interface TransportShape {
|
|
184
|
+
/** `epoch` is the server history the replica's cursor points into, when it knows one. */
|
|
185
|
+
readonly exchange: (cursor: number, pending: ReadonlyArray<Operation>, epoch?: string | undefined) => Effect.Effect<unknown, TransportError>;
|
|
186
|
+
/**
|
|
187
|
+
* Emits when the server may have something new, for a transport that can hear
|
|
188
|
+
* it: `Replica.start` exchanges on each. A wake-up, not data.
|
|
189
|
+
*/
|
|
190
|
+
readonly changes?: Stream.Stream<void> | undefined;
|
|
191
|
+
/**
|
|
192
|
+
* The connection itself, for another protocol to share, such as presence: a send goes to
|
|
193
|
+
* the socket open now and is dropped while none is, and messages from every socket the
|
|
194
|
+
* transport opens arrive here. It is the transport's to close.
|
|
195
|
+
*/
|
|
196
|
+
readonly socket?: SocketLike | undefined;
|
|
197
|
+
}
|
|
198
|
+
declare const Transport_base: Context.ServiceClass<Transport, "foldkit-sync/Transport", TransportShape>;
|
|
199
|
+
/**
|
|
200
|
+
* The seam the replica syncs through.
|
|
201
|
+
*
|
|
202
|
+
* A service, not a concrete client, so an application substitutes an in-process
|
|
203
|
+
* transport, a socket, or a test double without the replica knowing. A refusal
|
|
204
|
+
* arrives in the exchange result; only a wire failure is a `TransportError`.
|
|
205
|
+
*/
|
|
206
|
+
declare class Transport extends Transport_base {}
|
|
207
|
+
/** A transport backed by an in-process handler, for tests and single-process demos. */
|
|
208
|
+
declare const layerLoopback: (handler: (cursor: number, pending: ReadonlyArray<Operation>, epoch?: string | undefined) => unknown | Promise<unknown>) => Layer.Layer<Transport>;
|
|
209
|
+
/** Wraps the promise-based client the replica already speaks. */
|
|
210
|
+
declare const layerFromPromise: (transport: TransportClient) => Layer.Layer<Transport>;
|
|
211
|
+
/** Bridges the service back to the promise client the replica consumes. */
|
|
212
|
+
declare const toPromise: (transport: TransportShape) => TransportClient;
|
|
213
|
+
/**
|
|
214
|
+
* Serves one accepted socket, answering each exchange frame.
|
|
215
|
+
*
|
|
216
|
+
* The counterpart to `layerSocket`: the handler returns the exchange result, or
|
|
217
|
+
* throws and the failure is written back as an error frame. With `changes`, a
|
|
218
|
+
* subscription to the document's commits, the socket is also sent a
|
|
219
|
+
* `NotifyFrame` after each, so a client hears of others' edits without polling.
|
|
220
|
+
* Returns a function that stops serving.
|
|
221
|
+
*/
|
|
222
|
+
declare const serveSocket: (socket: SocketLike, options: {
|
|
223
|
+
readonly exchange: (cursor: number, pending: ReadonlyArray<Operation>, epoch?: string | undefined) => unknown | Promise<unknown>;
|
|
224
|
+
/** Subscribes to the document's commits; returns the unsubscribe. */
|
|
225
|
+
readonly changes?: ((listener: () => void) => () => void) | undefined;
|
|
226
|
+
}) => (() => void);
|
|
227
|
+
/** The minimal socket the layer needs; the global `WebSocket` satisfies it. */
|
|
228
|
+
interface SocketLike {
|
|
229
|
+
send(data: string): void;
|
|
230
|
+
close(): void;
|
|
231
|
+
onMessage(listener: (data: string) => void): () => void;
|
|
232
|
+
onClose(listener: () => void): () => void;
|
|
233
|
+
/**
|
|
234
|
+
* Optional. When provided, exchanges wait for it before sending, so a
|
|
235
|
+
* transport can connect asynchronously. Absent means already connected.
|
|
236
|
+
*/
|
|
237
|
+
onOpen?(listener: () => void): () => void;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Where `layerSocket` connects: a `url` for the platform `WebSocket`, or a
|
|
241
|
+
* `makeSocket` that opens any other `SocketLike` (a port, a test socket), called
|
|
242
|
+
* again on every reconnect.
|
|
243
|
+
*/
|
|
244
|
+
type SocketOptions = SocketTuning & ({
|
|
245
|
+
readonly url: string;
|
|
246
|
+
readonly makeSocket?: undefined;
|
|
247
|
+
} | {
|
|
248
|
+
readonly makeSocket: () => SocketLike;
|
|
249
|
+
readonly url?: undefined;
|
|
250
|
+
});
|
|
251
|
+
interface SocketTuning {
|
|
252
|
+
/**
|
|
253
|
+
* Consecutive failed connections after which queued work fails and new
|
|
254
|
+
* exchanges fail fast until a connection is healthy again. Reconnecting goes
|
|
255
|
+
* on regardless. Default 5.
|
|
256
|
+
*/
|
|
257
|
+
readonly maxRetries?: number | undefined;
|
|
258
|
+
/** Base delay of the exponential reconnect backoff. Default `50 millis`. */
|
|
259
|
+
readonly retryBase?: Duration.Input | undefined;
|
|
260
|
+
/** Longest wait between reconnect attempts. Default `5 seconds`. */
|
|
261
|
+
readonly maxRetryDelay?: Duration.Input | undefined;
|
|
262
|
+
/** Exchanges queued or in flight before new ones fail. Default 64. */
|
|
263
|
+
readonly maxQueue?: number | undefined;
|
|
264
|
+
}
|
|
265
|
+
/** The default socket factory: the platform `WebSocket`, as a `SocketLike`. */
|
|
266
|
+
declare const nativeSocket: (url: string) => SocketLike;
|
|
267
|
+
/**
|
|
268
|
+
* A socket over a `MessagePort`, for either end: its frames are the port's
|
|
269
|
+
* string messages, and anything else on the port is ignored. A port tells
|
|
270
|
+
* neither end when the other goes, so `onClose` fires once, on `close()` or
|
|
271
|
+
* when `signal` aborts; a host that serves a pane aborts it when the pane is
|
|
272
|
+
* gone, which stops `serveSocket` and anything else listening.
|
|
273
|
+
*/
|
|
274
|
+
declare const portSocket: (port: MessagePort, options?: {
|
|
275
|
+
readonly signal?: AbortSignal | undefined;
|
|
276
|
+
}) => SocketLike;
|
|
277
|
+
/**
|
|
278
|
+
* A WebSocket client transport.
|
|
279
|
+
*
|
|
280
|
+
* One connection is live at a time. While it is connecting, exchanges queue; if
|
|
281
|
+
* it closes, the transport reconnects on an exponential, jittered backoff and
|
|
282
|
+
* re-sends every queued and in-flight frame with its original id, so a lost
|
|
283
|
+
* reply is answered rather than dropped and a late reply cannot resolve a newer
|
|
284
|
+
* frame. It never stops reconnecting: after `maxRetries` consecutive failures
|
|
285
|
+
* queued work fails with a `TransportError`, and exchanges fail fast while no
|
|
286
|
+
* socket is up, until a socket opens. The count resets only when a connection
|
|
287
|
+
* proves healthy, by answering a frame or by staying open for `maxRetryDelay`:
|
|
288
|
+
* a server that accepts a socket and drops it at once is backed off like one
|
|
289
|
+
* that refuses it. A queue over `maxQueue` fails new
|
|
290
|
+
* exchanges with backpressure. The socket is released when the layer's scope
|
|
291
|
+
* ends.
|
|
292
|
+
*/
|
|
293
|
+
declare const layerSocket: (options: SocketOptions) => Layer.Layer<Transport, TransportError>;
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/sync.d.ts
|
|
296
|
+
/** Wire and persisted-format versions. A bump must handle the older value explicitly. */
|
|
297
|
+
declare const PROTOCOL_VERSION = 1;
|
|
298
|
+
declare const SCHEMA_VERSION = 1;
|
|
299
|
+
/** A client-authored operation envelope. `message` is the application's encoded Message. */
|
|
300
|
+
declare const OperationSchema: Schema.Struct<{
|
|
301
|
+
readonly protocolVersion: Schema.Literal<1>;
|
|
302
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
303
|
+
readonly documentId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/DocumentId">;
|
|
304
|
+
readonly replicaId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/ReplicaId">;
|
|
305
|
+
readonly localSequence: Schema.brand<Schema.Number, "@foldkit-sync/LocalSequence">;
|
|
306
|
+
readonly opId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/OpId">;
|
|
307
|
+
readonly baseCursor: Schema.brand<Schema.Number, "@foldkit-sync/Sequence">;
|
|
308
|
+
readonly message: Schema.Unknown;
|
|
309
|
+
}>;
|
|
310
|
+
type Operation = typeof OperationSchema.Type;
|
|
311
|
+
/** An operation the server committed, with its authoritative order and actor. */
|
|
312
|
+
declare const CommittedSchema: Schema.Struct<{
|
|
313
|
+
readonly serverSequence: Schema.brand<Schema.Number, "@foldkit-sync/Sequence">;
|
|
314
|
+
readonly actorId: Schema.NonEmptyString;
|
|
315
|
+
readonly protocolVersion: Schema.Literal<1>;
|
|
316
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
317
|
+
readonly documentId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/DocumentId">;
|
|
318
|
+
readonly replicaId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/ReplicaId">;
|
|
319
|
+
readonly localSequence: Schema.brand<Schema.Number, "@foldkit-sync/LocalSequence">;
|
|
320
|
+
readonly opId: Schema.brand<Schema.NonEmptyString, "@foldkit-sync/OpId">;
|
|
321
|
+
readonly baseCursor: Schema.brand<Schema.Number, "@foldkit-sync/Sequence">;
|
|
322
|
+
readonly message: Schema.Unknown;
|
|
323
|
+
}>;
|
|
324
|
+
/** Named to avoid colliding with `foldkit-durable`'s `Committed`. */
|
|
325
|
+
type CommittedOperation = typeof CommittedSchema.Type;
|
|
326
|
+
/** Counters and a histogram an application can scrape. */
|
|
327
|
+
declare const syncMetrics: {
|
|
328
|
+
exchanges: Metric.Counter<number>;
|
|
329
|
+
applied: Metric.Counter<number>;
|
|
330
|
+
checkpoints: Metric.Counter<number>;
|
|
331
|
+
exchangePending: Metric.Histogram<number>;
|
|
332
|
+
};
|
|
333
|
+
interface Checkpoint<Shared> {
|
|
334
|
+
readonly cursor: Sequence;
|
|
335
|
+
readonly model: Shared;
|
|
336
|
+
}
|
|
337
|
+
interface Exchange<Shared> {
|
|
338
|
+
/** Server-committed operations as they arrived; validated against `CommittedOperation` on adoption. */
|
|
339
|
+
readonly operations: ReadonlyArray<unknown>;
|
|
340
|
+
readonly rejected: ReadonlyArray<OpId>;
|
|
341
|
+
/**
|
|
342
|
+
* Why some of `rejected` were refused, in words the server chose for a person:
|
|
343
|
+
* a policy's reason, never an internal error. One without a reason is still rejected.
|
|
344
|
+
*/
|
|
345
|
+
readonly reasons?: ReadonlyArray<{
|
|
346
|
+
readonly opId: OpId;
|
|
347
|
+
readonly reason: string;
|
|
348
|
+
}> | undefined;
|
|
349
|
+
/** Sends from the request that are durably committed, so the replica can drop them. */
|
|
350
|
+
readonly acknowledged?: ReadonlyArray<OpId> | undefined;
|
|
351
|
+
/** The snapshot a replica predating compaction adopts in place of the log. */
|
|
352
|
+
readonly checkpoint?: Checkpoint<Shared> | undefined;
|
|
353
|
+
/** The server sent only part of what is after the cursor; the replica asks again. */
|
|
354
|
+
readonly more?: boolean | undefined;
|
|
355
|
+
/**
|
|
356
|
+
* The identity of the server's history. The replica sends back the one it last saw; a
|
|
357
|
+
* server that finds another answers from the start of its own history, and the replica,
|
|
358
|
+
* seeing a new epoch, rebuilds its committed state from that answer and keeps its outbox.
|
|
359
|
+
*/
|
|
360
|
+
readonly epoch?: string | undefined;
|
|
361
|
+
}
|
|
362
|
+
interface ReplicaState<Shared> {
|
|
363
|
+
readonly protocolVersion: typeof PROTOCOL_VERSION;
|
|
364
|
+
readonly schemaVersion: typeof SCHEMA_VERSION;
|
|
365
|
+
readonly documentId: DocumentId;
|
|
366
|
+
readonly replicaId: ReplicaId;
|
|
367
|
+
readonly revision: number;
|
|
368
|
+
readonly nextLocalSequence: LocalSequence;
|
|
369
|
+
readonly cursor: Sequence;
|
|
370
|
+
readonly committed: Shared;
|
|
371
|
+
readonly committedIds: ReadonlyArray<string>;
|
|
372
|
+
readonly pending: ReadonlyArray<Operation>;
|
|
373
|
+
/** The server history `cursor` points into, once an exchange has named one. */
|
|
374
|
+
readonly epoch?: string;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* What the promise-based edge adapter consumes; the Effect `Transport` service
|
|
378
|
+
* is the primary seam.
|
|
379
|
+
*/
|
|
380
|
+
interface TransportClient {
|
|
381
|
+
/** `epoch` is the server history the replica's cursor points into, when it knows one. */
|
|
382
|
+
exchange(cursor: Sequence, pending: ReadonlyArray<Operation>, epoch?: string | undefined): Promise<unknown>;
|
|
383
|
+
}
|
|
384
|
+
/** A redacted view of a replica's state, for a UI to explain and recover. */
|
|
385
|
+
interface ReplicaStatus {
|
|
386
|
+
readonly pending: number;
|
|
387
|
+
readonly cursor: Sequence;
|
|
388
|
+
/** The last exchange failure, cleared by a successful exchange. */
|
|
389
|
+
readonly lastError: string | undefined;
|
|
390
|
+
/** Operations the server refused, most recent first, with its reason when it gave one. */
|
|
391
|
+
readonly rejected: ReadonlyArray<Rejection>;
|
|
392
|
+
/**
|
|
393
|
+
* The server history the cursor points into, once a server named one. A new
|
|
394
|
+
* one means the server was reset: what the replica had committed is gone.
|
|
395
|
+
*/
|
|
396
|
+
readonly epoch: Option.Option<string>;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* An operation the server refused, and why, when it said. It carries the
|
|
400
|
+
* operation itself: the replica drops it from the outbox in the same step,
|
|
401
|
+
* so what it changed can be read from here rather than looked up in time.
|
|
402
|
+
*/
|
|
403
|
+
interface Rejection {
|
|
404
|
+
readonly opId: OpId;
|
|
405
|
+
readonly reason: Option.Option<string>;
|
|
406
|
+
readonly operation: Operation;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* A consistent status and optimistic-shared pair, read from one replica state.
|
|
410
|
+
* `Replica.changes` emits it so a UI can hold a single subscription.
|
|
411
|
+
*/
|
|
412
|
+
interface ReplicaSnapshot<Shared> {
|
|
413
|
+
readonly status: ReplicaStatus;
|
|
414
|
+
readonly shared: Shared;
|
|
415
|
+
/** The server-confirmed state the optimistic `shared` is built on. */
|
|
416
|
+
readonly committed: Shared;
|
|
417
|
+
/**
|
|
418
|
+
* The local sequence the next submitted operation takes. Only a successful
|
|
419
|
+
* submit moves it, so a caller that submits one Message at a time can tell
|
|
420
|
+
* from one snapshot whether `shared` already holds it.
|
|
421
|
+
*/
|
|
422
|
+
readonly nextLocalSequence: LocalSequence;
|
|
423
|
+
}
|
|
424
|
+
interface Replica<Message, Shared> {
|
|
425
|
+
/** The id this replica's operations carry, one per tab: what its commits are stamped with. */
|
|
426
|
+
readonly replicaId: ReplicaId;
|
|
427
|
+
/** The optimistic projection: committed state with pending operations replayed. */
|
|
428
|
+
readonly shared: Effect.Effect<Shared>;
|
|
429
|
+
/**
|
|
430
|
+
* The server-confirmed state through `cursor`, with no pending operation
|
|
431
|
+
* applied. A pending edit reaches it only once the server commits it, and a
|
|
432
|
+
* rejected one never does.
|
|
433
|
+
*/
|
|
434
|
+
readonly committed: Effect.Effect<Shared>;
|
|
435
|
+
readonly pending: Effect.Effect<ReadonlyArray<Operation>>;
|
|
436
|
+
readonly cursor: Effect.Effect<Sequence>;
|
|
437
|
+
/**
|
|
438
|
+
* Waiting/recovery information without exposing Messages or the Model. It is a
|
|
439
|
+
* snapshot; `statusChanges` re-emits it after every submit and exchange.
|
|
440
|
+
*/
|
|
441
|
+
readonly status: Effect.Effect<ReplicaStatus>;
|
|
442
|
+
/** The status, re-emitted after every submit and exchange. */
|
|
443
|
+
readonly statusChanges: Stream.Stream<ReplicaStatus>;
|
|
444
|
+
/**
|
|
445
|
+
* The status and the optimistic shared value together, re-emitted after every
|
|
446
|
+
* submit and exchange, so a UI can subscribe once instead of to both.
|
|
447
|
+
*/
|
|
448
|
+
readonly changes: Stream.Stream<ReplicaSnapshot<Shared>>;
|
|
449
|
+
/** The status, `shared`, `committed` and next local sequence, read from one replica state. */
|
|
450
|
+
readonly snapshot: Effect.Effect<ReplicaSnapshot<Shared>>;
|
|
451
|
+
readonly submit: (message: Message) => Effect.Effect<void, ReplicaError>;
|
|
452
|
+
/** Reconciles against the server. The `Transport` service must be provided. */
|
|
453
|
+
readonly synchronize: Effect.Effect<void, ReplicaError | TransportError, Transport>;
|
|
454
|
+
/**
|
|
455
|
+
* The exchange loop: exchanges once, then after every `submit` and every
|
|
456
|
+
* notice on the transport's `changes`, until the replica closes or the fiber
|
|
457
|
+
* is interrupted. A failed exchange is recorded
|
|
458
|
+
* in `status.lastError` and retried on a backoff (from 0.5 s, doubling up to
|
|
459
|
+
* 30 s), or at once on the next `submit`, so the fiber never fails. Fork it
|
|
460
|
+
* with `Effect.forkScoped` and provide `Transport`.
|
|
461
|
+
*/
|
|
462
|
+
readonly start: Effect.Effect<void, never, Transport>;
|
|
463
|
+
readonly close: Effect.Effect<void>;
|
|
464
|
+
}
|
|
465
|
+
interface SyncDefinition<Message, Shared, MessageEncoded, SharedEncoded> {
|
|
466
|
+
readonly documentId: DocumentId;
|
|
467
|
+
readonly message: Schema.Codec<Message, MessageEncoded, never, never>;
|
|
468
|
+
readonly shared: Schema.Codec<Shared, SharedEncoded, never, never>;
|
|
469
|
+
readonly empty: Shared;
|
|
470
|
+
readonly durable: (message: Message) => boolean;
|
|
471
|
+
readonly replay: (shared: Shared, message: Message) => Shared;
|
|
472
|
+
/**
|
|
473
|
+
* Optional. Merges a durable Message into the one submitted before it, while that one
|
|
474
|
+
* has not been sent: one operation instead of two, for a burst of typing. Replaying the
|
|
475
|
+
* result must equal replaying `last` then `next`. Undefined keeps them apart.
|
|
476
|
+
*/
|
|
477
|
+
readonly coalesce?: ((last: Message, next: Message) => Message | undefined) | undefined;
|
|
478
|
+
/**
|
|
479
|
+
* Optional. Writes what the server's commit decided into a durable Message, on the
|
|
480
|
+
* server only: the journal stores, reduces and sends the stamped Message, so every
|
|
481
|
+
* replica replays the same one in place of what it sent.
|
|
482
|
+
*/
|
|
483
|
+
readonly stamp?: ((message: Message, commit: CommitStamp) => Message) | undefined;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* What a commit decided, for `stamp`: the operation's place in the order, who
|
|
487
|
+
* committed it, and from which replica. `actorId` is the principal, shared by
|
|
488
|
+
* every tab a person has open; `replicaId` tells those tabs apart.
|
|
489
|
+
*/
|
|
490
|
+
interface CommitStamp {
|
|
491
|
+
readonly sequence: number;
|
|
492
|
+
readonly actorId: string;
|
|
493
|
+
readonly replicaId: string;
|
|
494
|
+
}
|
|
495
|
+
interface Sync<Message, Shared> {
|
|
496
|
+
readonly documentId: DocumentId;
|
|
497
|
+
/** Whether a Message is one the replica records and replays. */
|
|
498
|
+
readonly durable: (message: Message) => boolean;
|
|
499
|
+
/**
|
|
500
|
+
* Low-level wire codecs for adapters and the transport. Most applications use
|
|
501
|
+
* `journalContract` and `openReplica`; these are exposed for a custom
|
|
502
|
+
* transport or a server that must speak the operation envelope directly.
|
|
503
|
+
*/
|
|
504
|
+
readonly codec: {
|
|
505
|
+
readonly normalizeOperation: (input: unknown) => Operation;
|
|
506
|
+
readonly operationFrom: (input: unknown, documentId: DocumentId) => Operation;
|
|
507
|
+
readonly committedFrom: (input: unknown, documentId: DocumentId) => CommittedOperation;
|
|
508
|
+
readonly decodeExchange: (input: unknown) => Exchange<Shared>;
|
|
509
|
+
};
|
|
510
|
+
/** The codecs and pure reducer `foldkit-durable`'s `makeJournal` consumes. */
|
|
511
|
+
readonly journalContract: () => JournalContract<Operation, Shared>;
|
|
512
|
+
readonly openReplica: (replicaId: ReplicaId, storage: Storage) => Effect.Effect<Replica<Message, Shared>, ReplicaError>;
|
|
513
|
+
}
|
|
514
|
+
/** Structural match for `foldkit-durable`'s journal options; Sync stays independent. */
|
|
515
|
+
interface JournalContract<Operation, Shared> {
|
|
516
|
+
/** The replica each operation came from, which Durable binds to its first committer. */
|
|
517
|
+
readonly replicaId: (operation: Operation) => string;
|
|
518
|
+
/** Sync's operation id includes the replica, even after Durable compacts its payload. */
|
|
519
|
+
readonly legacyReplicaId: (opId: string) => string;
|
|
520
|
+
readonly operation: {
|
|
521
|
+
/** Operations are stored in their encoded form, so this is the identity. */
|
|
522
|
+
readonly encode: (operation: Operation) => Operation;
|
|
523
|
+
readonly decode: (input: unknown) => Operation;
|
|
524
|
+
};
|
|
525
|
+
readonly snapshot: {
|
|
526
|
+
readonly encode: (snapshot: Shared) => unknown;
|
|
527
|
+
readonly decode: (input: unknown) => Shared;
|
|
528
|
+
};
|
|
529
|
+
readonly empty: () => Shared;
|
|
530
|
+
readonly reduce: (snapshot: Shared, operation: Operation) => Shared;
|
|
531
|
+
/** Present when the definition stamps: Durable's `stamp`, over the operation's Message. */
|
|
532
|
+
readonly stamp?: (operation: Operation, commit: {
|
|
533
|
+
readonly sequence: number;
|
|
534
|
+
readonly actorId: string;
|
|
535
|
+
}) => Operation;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Binds the replicated-state protocol to one application contract.
|
|
539
|
+
*
|
|
540
|
+
* The returned codecs decide what is a valid operation and what the shared
|
|
541
|
+
* projection means; the replica owns the local outbox, optimistic projection,
|
|
542
|
+
* and reconciliation as Effects, and never runs a second reducer.
|
|
543
|
+
*/
|
|
544
|
+
declare const defineSync: <Message, Shared, MessageEncoded, SharedEncoded>(definition: SyncDefinition<Message, Shared, MessageEncoded, SharedEncoded>) => Sync<Message, Shared>;
|
|
545
|
+
//#endregion
|
|
546
|
+
export { Sequence as $, serveSocket as A, InvalidOutboxError as B, TransportError as C, layerSocket as D, layerLoopback as E, CheckpointRegressionError as F, StorageError as G, ReplayError as H, CommittedOrderError as I, WrongReplicaStorageError as J, UnsupportedClockVersionError as K, ForeignAcknowledgementError as L, OutboxEntry as M, Storage as N, nativeSocket as O, indexedDb as P, ReplicaId as Q, ForeignRejectionError as R, Transport as S, layerFromPromise as T, ReplicaClosedError as U, InvalidReplicaHistoryError as V, ReplicaError as W, LocalSequence as X, DocumentId as Y, OpId as Z, ExchangeFrame as _, JournalContract as a, SocketLike as b, Replica as c, ReplicaStatus as d, documentId as et, Sync as f, syncMetrics as g, defineSync as h, Exchange as i, sequence as it, toPromise as j, portSocket as k, ReplicaSnapshot as l, TransportClient as m, CommitStamp as n, opId as nt, Operation as o, SyncDefinition as p, UnsupportedReplicaVersionError as q, CommittedOperation as r, replicaId as rt, Rejection as s, Checkpoint as t, localSequence as tt, ReplicaState as u, ExchangeReply as v, TransportShape as w, SocketOptions as x, NotifyFrame as y, InvalidExchangeError as z };
|
|
547
|
+
//# sourceMappingURL=sync-CP5UGs4r.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-CP5UGs4r.d.mts","names":[],"sources":["../src/ids.ts","../src/errors.ts","../src/indexedDb.ts","../src/transport.ts","../src/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