loro-repo 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/storage/filesystem.d.cts +1 -1
- package/dist/storage/filesystem.d.ts +1 -1
- package/dist/storage/indexeddb.d.cts +1 -1
- package/dist/storage/indexeddb.d.ts +1 -1
- package/dist/storage/sqlite.d.cts +1 -1
- package/dist/storage/sqlite.d.ts +1 -1
- package/dist/transport/broadcast-channel.d.cts +1 -1
- package/dist/transport/broadcast-channel.d.ts +1 -1
- package/dist/transport/streams.cjs +291 -56
- package/dist/transport/streams.cjs.map +1 -1
- package/dist/transport/streams.d.cts +16 -19
- package/dist/transport/streams.d.ts +16 -19
- package/dist/transport/streams.js +291 -57
- package/dist/transport/streams.js.map +1 -1
- package/dist/transport/websocket.d.cts +1 -1
- package/dist/transport/websocket.d.ts +1 -1
- package/dist/types.cjs +10 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +16 -2
- package/dist/types.d.ts +16 -2
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -290,10 +290,21 @@ CRDT import and before `beforeRemoteCursorSave`; the adapter keeps the existing
|
|
|
290
290
|
"persist CRDT state, then advance cursor" boundary. Each room owns an independent
|
|
291
291
|
instance, so one room's failure does not stop other rooms.
|
|
292
292
|
|
|
293
|
-
This API requires `@loro-dev/streams-crdt@^0.
|
|
293
|
+
This API requires `@loro-dev/streams-crdt@^0.16.2`, specifically its common
|
|
294
294
|
protected-payload boundary and `payloadProtectionRequired` guard. No 0.12.x
|
|
295
295
|
encryption compatibility shim is retained; the adapter passes the published
|
|
296
|
-
|
|
296
|
+
opaque `streamUrl` transport target directly.
|
|
297
|
+
|
|
298
|
+
A trusted snapshot-admission host can import
|
|
299
|
+
`encodeStreamsRoomAdditionalData(namespace, room, envelopeAdditionalData)` from
|
|
300
|
+
`loro-repo/transport/streams` to reconstruct the exact AAD supplied to the provider.
|
|
301
|
+
Use authenticated application namespace and logical room, not uploaded identity
|
|
302
|
+
claims or routing URLs. This helper changes no wire bytes and does not perform
|
|
303
|
+
signature verification or grant publication permission.
|
|
304
|
+
|
|
305
|
+
Structured errors retain a whitelisted `payloadProtectionReason`, including
|
|
306
|
+
`missing_read_key` versus `decrypt_failed`, on `RepoTransportError`. Provider
|
|
307
|
+
messages and causes remain sanitized. See the [compatibility decision](../../docs/plans/2026-10-10-streams-protection-host.md).
|
|
297
308
|
|
|
298
309
|
## Replica-bound Streams checkpoints (IndexedDB)
|
|
299
310
|
|
|
@@ -605,3 +616,10 @@ Set `LORO_WEBSOCKET_E2E=1` when running websocket end-to-end specs.
|
|
|
605
616
|
## Contributing
|
|
606
617
|
|
|
607
618
|
Follow Conventional Commits, run `pnpm --filter loro-repo check` before opening a PR, and keep `prd/` docs aligned with behavior changes.
|
|
619
|
+
|
|
620
|
+
## Streams synchronization diagnostics
|
|
621
|
+
|
|
622
|
+
Streams transport errors expose `streamsCode`, `streamsContext`, `failureKind`
|
|
623
|
+
and the upstream `retryable` policy on `RepoTransportError`. Read the
|
|
624
|
+
[consumer contract](../../docs/streams-error-context.md) for trusted fields,
|
|
625
|
+
single/multiple transport reports, join/wait errors and diagnostic logging.
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as RepoTransportError, A as RepoFlockDocHandle, B as RepoRoomPhase, C as RepoDocSnapshot, D as RepoEventKind, E as RepoEventFilter, F as RepoReconnectOptions, G as RepoRoomWaitStatus, H as RepoRoomSubscription, I as RepoResourceLease, J as RepoStreamsErrorContext, K as RepoStorageError, L as RepoRoomAttachmentEntry, M as RepoFlockDocMeta, N as RepoFlockDocSnapshot, O as RepoEventListener, P as RepoHealthSnapshot, Q as RepoSyncReport, R as RepoRoomDescriptor, S as RepoDocObservation, T as RepoEventBy, U as RepoRoomWaitOptions, V as RepoRoomRoute, W as RepoRoomWaitResult, X as RepoSyncOptions, Y as RepoSyncError, Z as RepoSyncOutcome, _ as RepoDiagnosticSink, _t as TransportRoomStatus, a as JsonObject, at as RepoTransportRoomEntry, b as RepoDocLease, bt as TransportSyncResult, c as ListFlockDocQuery, ct as RepoTransportSyncFailure, d as META_ROOM_ID, dt as StorageAdapter, et as RepoTransportErrorCode, f as ObserveDocsOptions, ft as StorageSavePayload, g as RepoDiagnosticEvent, gt as TransportJoinParams, h as RepoAttachmentReport, ht as TransportConnectionStatus, i as EvictDocOptions, it as RepoTransportPhase, j as RepoFlockDocLease, k as RepoEventType, l as LoadedFlockReplica, lt as RepoTransportSyncReport, m as ReplicaCheckpointTarget, mt as TransportAdapter, n as DeleteDocOptions, nt as RepoTransportHealth, o as JsonValue, ot as RepoTransportRoomStatus, p as RemoveTransportOptions, pt as SyncScope, q as RepoStorageErrorCode, r as EphemeralTransportCapability, rt as RepoTransportOptions, s as ListDocQuery, st as RepoTransportRoomSubscription, t as DEFAULT_TRANSPORT_ID, tt as RepoTransportFailureKind, u as LoroRepoOptions, ut as RepoWatchHandle, v as RepoDocExistenceState, vt as TransportSubscription, w as RepoEvent, x as RepoDocMeta, xt as supportsEphemeralRooms, y as RepoDocHandle, yt as TransportSyncRequest, z as RepoRoomKind } from "./types.cjs";
|
|
2
2
|
import { RemoteCursorStore } from "@loro-dev/streams-crdt";
|
|
3
3
|
import { Flock } from "@loro-dev/flock-wasm";
|
|
4
4
|
import { EphemeralStore, LoroDoc } from "loro-crdt";
|
|
@@ -262,5 +262,5 @@ declare class LoroRepo<Meta extends JsonObject = JsonObject> {
|
|
|
262
262
|
destroy(): Promise<void>;
|
|
263
263
|
}
|
|
264
264
|
//#endregion
|
|
265
|
-
export { DEFAULT_TRANSPORT_ID, DeleteDocOptions, EphemeralTransportCapability, EvictDocOptions, JsonObject, JsonValue, ListDocQuery, ListFlockDocQuery, LoadedFlockReplica, LoroRepo, LoroRepoOptions, META_ROOM_ID, ObserveDocsOptions, RemoveTransportOptions, ReplicaCheckpointTarget, RepoAttachmentReport, RepoDiagnosticEvent, RepoDiagnosticSink, RepoDocExistenceState, RepoDocHandle, RepoDocLease, RepoDocMeta, RepoDocObservation, RepoDocSnapshot, RepoEvent, RepoEventBy, RepoEventFilter, RepoEventKind, RepoEventListener, RepoEventType, RepoFlockDocHandle, RepoFlockDocLease, RepoFlockDocMeta, RepoFlockDocSnapshot, RepoHealthSnapshot, RepoReconnectOptions, RepoResourceLease, RepoRoomAttachmentEntry, RepoRoomDescriptor, RepoRoomKind, RepoRoomPhase, RepoRoomRoute, RepoRoomSubscription, RepoRoomWaitOptions, RepoRoomWaitResult, RepoRoomWaitStatus, RepoStorageError, RepoStorageErrorCode, RepoSyncError, RepoSyncOptions, RepoSyncOutcome, RepoSyncReport, RepoTransportError, RepoTransportErrorCode, RepoTransportHealth, RepoTransportOptions, RepoTransportPhase, RepoTransportRoomEntry, RepoTransportRoomStatus, RepoTransportRoomSubscription, RepoTransportSyncFailure, RepoTransportSyncReport, RepoWatchHandle, ResourceBusyError, StaleReplicaError, StorageAdapter, StorageSavePayload, SyncScope, TransportAdapter, TransportConnectionStatus, TransportJoinParams, TransportRoomStatus, TransportSubscription, TransportSyncRequest, TransportSyncResult, supportsEphemeralRooms };
|
|
265
|
+
export { DEFAULT_TRANSPORT_ID, DeleteDocOptions, EphemeralTransportCapability, EvictDocOptions, JsonObject, JsonValue, ListDocQuery, ListFlockDocQuery, LoadedFlockReplica, LoroRepo, LoroRepoOptions, META_ROOM_ID, ObserveDocsOptions, RemoveTransportOptions, ReplicaCheckpointTarget, RepoAttachmentReport, RepoDiagnosticEvent, RepoDiagnosticSink, RepoDocExistenceState, RepoDocHandle, RepoDocLease, RepoDocMeta, RepoDocObservation, RepoDocSnapshot, RepoEvent, RepoEventBy, RepoEventFilter, RepoEventKind, RepoEventListener, RepoEventType, RepoFlockDocHandle, RepoFlockDocLease, RepoFlockDocMeta, RepoFlockDocSnapshot, RepoHealthSnapshot, RepoReconnectOptions, RepoResourceLease, RepoRoomAttachmentEntry, RepoRoomDescriptor, RepoRoomKind, RepoRoomPhase, RepoRoomRoute, RepoRoomSubscription, RepoRoomWaitOptions, RepoRoomWaitResult, RepoRoomWaitStatus, RepoStorageError, RepoStorageErrorCode, RepoStreamsErrorContext, RepoSyncError, RepoSyncOptions, RepoSyncOutcome, RepoSyncReport, RepoTransportError, RepoTransportErrorCode, RepoTransportFailureKind, RepoTransportHealth, RepoTransportOptions, RepoTransportPhase, RepoTransportRoomEntry, RepoTransportRoomStatus, RepoTransportRoomSubscription, RepoTransportSyncFailure, RepoTransportSyncReport, RepoWatchHandle, ResourceBusyError, StaleReplicaError, StorageAdapter, StorageSavePayload, SyncScope, TransportAdapter, TransportConnectionStatus, TransportJoinParams, TransportRoomStatus, TransportSubscription, TransportSyncRequest, TransportSyncResult, supportsEphemeralRooms };
|
|
266
266
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as RepoTransportError, A as RepoFlockDocHandle, B as RepoRoomPhase, C as RepoDocSnapshot, D as RepoEventKind, E as RepoEventFilter, F as RepoReconnectOptions, G as RepoRoomWaitStatus, H as RepoRoomSubscription, I as RepoResourceLease, J as RepoStreamsErrorContext, K as RepoStorageError, L as RepoRoomAttachmentEntry, M as RepoFlockDocMeta, N as RepoFlockDocSnapshot, O as RepoEventListener, P as RepoHealthSnapshot, Q as RepoSyncReport, R as RepoRoomDescriptor, S as RepoDocObservation, T as RepoEventBy, U as RepoRoomWaitOptions, V as RepoRoomRoute, W as RepoRoomWaitResult, X as RepoSyncOptions, Y as RepoSyncError, Z as RepoSyncOutcome, _ as RepoDiagnosticSink, _t as TransportRoomStatus, a as JsonObject, at as RepoTransportRoomEntry, b as RepoDocLease, bt as TransportSyncResult, c as ListFlockDocQuery, ct as RepoTransportSyncFailure, d as META_ROOM_ID, dt as StorageAdapter, et as RepoTransportErrorCode, f as ObserveDocsOptions, ft as StorageSavePayload, g as RepoDiagnosticEvent, gt as TransportJoinParams, h as RepoAttachmentReport, ht as TransportConnectionStatus, i as EvictDocOptions, it as RepoTransportPhase, j as RepoFlockDocLease, k as RepoEventType, l as LoadedFlockReplica, lt as RepoTransportSyncReport, m as ReplicaCheckpointTarget, mt as TransportAdapter, n as DeleteDocOptions, nt as RepoTransportHealth, o as JsonValue, ot as RepoTransportRoomStatus, p as RemoveTransportOptions, pt as SyncScope, q as RepoStorageErrorCode, r as EphemeralTransportCapability, rt as RepoTransportOptions, s as ListDocQuery, st as RepoTransportRoomSubscription, t as DEFAULT_TRANSPORT_ID, tt as RepoTransportFailureKind, u as LoroRepoOptions, ut as RepoWatchHandle, v as RepoDocExistenceState, vt as TransportSubscription, w as RepoEvent, x as RepoDocMeta, xt as supportsEphemeralRooms, y as RepoDocHandle, yt as TransportSyncRequest, z as RepoRoomKind } from "./types.js";
|
|
2
2
|
import { Flock } from "@loro-dev/flock-wasm";
|
|
3
3
|
import { EphemeralStore, LoroDoc } from "loro-crdt";
|
|
4
4
|
import { RemoteCursorStore } from "@loro-dev/streams-crdt";
|
|
@@ -262,5 +262,5 @@ declare class LoroRepo<Meta extends JsonObject = JsonObject> {
|
|
|
262
262
|
destroy(): Promise<void>;
|
|
263
263
|
}
|
|
264
264
|
//#endregion
|
|
265
|
-
export { DEFAULT_TRANSPORT_ID, DeleteDocOptions, EphemeralTransportCapability, EvictDocOptions, JsonObject, JsonValue, ListDocQuery, ListFlockDocQuery, LoadedFlockReplica, LoroRepo, LoroRepoOptions, META_ROOM_ID, ObserveDocsOptions, RemoveTransportOptions, ReplicaCheckpointTarget, RepoAttachmentReport, RepoDiagnosticEvent, RepoDiagnosticSink, RepoDocExistenceState, RepoDocHandle, RepoDocLease, RepoDocMeta, RepoDocObservation, RepoDocSnapshot, RepoEvent, RepoEventBy, RepoEventFilter, RepoEventKind, RepoEventListener, RepoEventType, RepoFlockDocHandle, RepoFlockDocLease, RepoFlockDocMeta, RepoFlockDocSnapshot, RepoHealthSnapshot, RepoReconnectOptions, RepoResourceLease, RepoRoomAttachmentEntry, RepoRoomDescriptor, RepoRoomKind, RepoRoomPhase, RepoRoomRoute, RepoRoomSubscription, RepoRoomWaitOptions, RepoRoomWaitResult, RepoRoomWaitStatus, RepoStorageError, RepoStorageErrorCode, RepoSyncError, RepoSyncOptions, RepoSyncOutcome, RepoSyncReport, RepoTransportError, RepoTransportErrorCode, RepoTransportHealth, RepoTransportOptions, RepoTransportPhase, RepoTransportRoomEntry, RepoTransportRoomStatus, RepoTransportRoomSubscription, RepoTransportSyncFailure, RepoTransportSyncReport, RepoWatchHandle, ResourceBusyError, StaleReplicaError, StorageAdapter, StorageSavePayload, SyncScope, TransportAdapter, TransportConnectionStatus, TransportJoinParams, TransportRoomStatus, TransportSubscription, TransportSyncRequest, TransportSyncResult, supportsEphemeralRooms };
|
|
265
|
+
export { DEFAULT_TRANSPORT_ID, DeleteDocOptions, EphemeralTransportCapability, EvictDocOptions, JsonObject, JsonValue, ListDocQuery, ListFlockDocQuery, LoadedFlockReplica, LoroRepo, LoroRepoOptions, META_ROOM_ID, ObserveDocsOptions, RemoveTransportOptions, ReplicaCheckpointTarget, RepoAttachmentReport, RepoDiagnosticEvent, RepoDiagnosticSink, RepoDocExistenceState, RepoDocHandle, RepoDocLease, RepoDocMeta, RepoDocObservation, RepoDocSnapshot, RepoEvent, RepoEventBy, RepoEventFilter, RepoEventKind, RepoEventListener, RepoEventType, RepoFlockDocHandle, RepoFlockDocLease, RepoFlockDocMeta, RepoFlockDocSnapshot, RepoHealthSnapshot, RepoReconnectOptions, RepoResourceLease, RepoRoomAttachmentEntry, RepoRoomDescriptor, RepoRoomKind, RepoRoomPhase, RepoRoomRoute, RepoRoomSubscription, RepoRoomWaitOptions, RepoRoomWaitResult, RepoRoomWaitStatus, RepoStorageError, RepoStorageErrorCode, RepoStreamsErrorContext, RepoSyncError, RepoSyncOptions, RepoSyncOutcome, RepoSyncReport, RepoTransportError, RepoTransportErrorCode, RepoTransportFailureKind, RepoTransportHealth, RepoTransportOptions, RepoTransportPhase, RepoTransportRoomEntry, RepoTransportRoomStatus, RepoTransportRoomSubscription, RepoTransportSyncFailure, RepoTransportSyncReport, RepoWatchHandle, ResourceBusyError, StaleReplicaError, StorageAdapter, StorageSavePayload, SyncScope, TransportAdapter, TransportConnectionStatus, TransportJoinParams, TransportRoomStatus, TransportSubscription, TransportSyncRequest, TransportSyncResult, supportsEphemeralRooms };
|
|
266
266
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as RepoStorageError,
|
|
1
|
+
import { K as RepoStorageError, dt as StorageAdapter, ft as StorageSavePayload, l as LoadedFlockReplica, q as RepoStorageErrorCode } from "../types.cjs";
|
|
2
2
|
import { Flock } from "@loro-dev/flock-wasm";
|
|
3
3
|
import { LoroDoc } from "loro-crdt";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as RepoStorageError,
|
|
1
|
+
import { K as RepoStorageError, dt as StorageAdapter, ft as StorageSavePayload, l as LoadedFlockReplica, q as RepoStorageErrorCode } from "../types.js";
|
|
2
2
|
import { Flock } from "@loro-dev/flock-wasm";
|
|
3
3
|
import { LoroDoc } from "loro-crdt";
|
|
4
4
|
|
package/dist/storage/sqlite.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bt as TransportSyncResult, gt as TransportJoinParams, mt as TransportAdapter, vt as TransportSubscription } from "../types.cjs";
|
|
2
2
|
import { Flock } from "@loro-dev/flock-wasm";
|
|
3
3
|
import { EphemeralStore, LoroDoc } from "loro-crdt";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bt as TransportSyncResult, gt as TransportJoinParams, mt as TransportAdapter, vt as TransportSubscription } from "../types.js";
|
|
2
2
|
import { Flock } from "@loro-dev/flock-wasm";
|
|
3
3
|
import { EphemeralStore, LoroDoc } from "loro-crdt";
|
|
4
4
|
|