json-patch-to-crdt 0.4.0 → 1.0.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.
@@ -118,13 +118,36 @@ interface LegacySerializedState {
118
118
  /** JSON-serializable form of a full CRDT state (document + clock). */
119
119
  type SerializedState = SerializedStateV1 | LegacySerializedState;
120
120
  /** Typed reasons for rejecting malformed serialized CRDT payloads. */
121
- type DeserializeErrorReason = "INVALID_SERIALIZED_SHAPE" | "INVALID_SERIALIZED_INVARIANT";
121
+ type DeserializeErrorReason = "INVALID_SERIALIZED_SHAPE" | "INVALID_SERIALIZED_INVARIANT" | "OPERATION_CANCELLED";
122
+ type ResourceBudgetKind = "patchOperations" | "objectEntries" | "sequenceElements" | "visitedNodes" | "serializedElements" | "arrayDiffCells";
123
+ interface ResourceBudget {
124
+ patchOperations?: number;
125
+ objectEntries?: number;
126
+ sequenceElements?: number;
127
+ visitedNodes?: number;
128
+ serializedElements?: number;
129
+ arrayDiffCells?: number;
130
+ }
131
+ interface ResourceBudgetExceededFailure {
132
+ code: 409;
133
+ reason: "RESOURCE_BUDGET_EXCEEDED";
134
+ message: string;
135
+ budget: ResourceBudgetKind;
136
+ limit: number;
137
+ actual: number;
138
+ path?: string;
139
+ opIndex?: number;
140
+ }
122
141
  /** Structured failure payload used by non-throwing deserialize helpers. */
123
142
  type DeserializeFailure = {
124
143
  code: 409;
125
144
  reason: DeserializeErrorReason;
126
145
  path: string;
127
146
  message: string;
147
+ } | ResourceBudgetExceededFailure | {
148
+ code: 409;
149
+ reason: "OPERATION_CANCELLED";
150
+ message: string;
128
151
  } | {
129
152
  code: 409;
130
153
  reason: "MAX_DEPTH_EXCEEDED";
@@ -231,6 +254,7 @@ type ApplyPatchAsActorOptions = {
231
254
  semantics?: PatchSemantics;
232
255
  strictParents?: boolean;
233
256
  jsonValidation?: JsonValidationMode;
257
+ signal?: AbortSignalLike;
234
258
  };
235
259
  /** Non-throwing result for internals-only `tryApplyPatchAsActor`. */
236
260
  type TryApplyPatchAsActorResult = ({
@@ -240,7 +264,12 @@ type TryApplyPatchAsActorResult = ({
240
264
  error: ApplyError;
241
265
  };
242
266
  /** Typed failure reason used across patch/merge helpers. */
243
- type PatchErrorReason = "INVALID_PATCH" | "INVALID_POINTER" | "MISSING_PARENT" | "MISSING_TARGET" | "INVALID_TARGET" | "OUT_OF_BOUNDS" | "TEST_FAILED" | "INVALID_MOVE" | "DOT_GENERATION_EXHAUSTED" | "MAX_DEPTH_EXCEEDED" | "LINEAGE_MISMATCH";
267
+ type PatchErrorReason = "INVALID_PATCH" | "INVALID_POINTER" | "MISSING_PARENT" | "MISSING_TARGET" | "INVALID_TARGET" | "OUT_OF_BOUNDS" | "TEST_FAILED" | "INVALID_MOVE" | "DOT_GENERATION_EXHAUSTED" | "MAX_DEPTH_EXCEEDED" | "RESOURCE_BUDGET_EXCEEDED" | "LINEAGE_MISMATCH" | "OPERATION_CANCELLED";
268
+ /** Minimal structural signal accepted by cancellable APIs. Compatible with AbortSignal. */
269
+ interface AbortSignalLike {
270
+ readonly aborted: boolean;
271
+ readonly reason?: unknown;
272
+ }
244
273
  /** Structured conflict payload used by non-throwing APIs. */
245
274
  type ApplyError = {
246
275
  ok: false; /** HTTP-friendly status code for conflict-style failures. */
@@ -248,7 +277,10 @@ type ApplyError = {
248
277
  reason: PatchErrorReason; /** Human-readable description of the failure. */
249
278
  message: string; /** Optional pointer/path context when available. */
250
279
  path?: string; /** Optional patch operation index when available. */
251
- opIndex?: number;
280
+ opIndex?: number; /** Resource-budget context when `reason` is `RESOURCE_BUDGET_EXCEEDED`. */
281
+ budget?: ResourceBudgetKind;
282
+ limit?: number;
283
+ actual?: number;
252
284
  };
253
285
  /** Result of applying a patch: success or structured conflict details. */
254
286
  type ApplyResult = {
@@ -270,11 +302,26 @@ type TryDeserializeStateResult = {
270
302
  ok: false;
271
303
  error: DeserializeFailure;
272
304
  };
305
+ /** Non-throwing validation-only result for serialized docs. */
306
+ type ValidateSerializedDocResult = {
307
+ ok: true;
308
+ } | {
309
+ ok: false;
310
+ error: DeserializeFailure;
311
+ };
312
+ /** Non-throwing validation-only result for serialized states. */
313
+ type ValidateSerializedStateResult = {
314
+ ok: true;
315
+ } | {
316
+ ok: false;
317
+ error: DeserializeFailure;
318
+ };
273
319
  /** How JSON Patch operations are interpreted during application. */
274
320
  type PatchSemantics = "base" | "sequential";
275
321
  /** Options for compile/validation helpers. */
276
322
  type CompilePatchOptions = {
277
323
  semantics?: PatchSemantics;
324
+ resourceBudget?: ResourceBudget;
278
325
  };
279
326
  /**
280
327
  * Options for immutable patch application (`applyPatch` / `tryApplyPatch`).
@@ -286,10 +333,13 @@ type ApplyPatchOptions = {
286
333
  base?: CrdtState;
287
334
  testAgainst?: "head" | "base";
288
335
  semantics?: PatchSemantics;
336
+ resourceBudget?: ResourceBudget;
289
337
  /**
290
338
  * Reject array inserts when the base parent path is missing.
291
- * Defaults to `false` to preserve legacy behavior that can auto-create
292
- * missing arrays for index `0` / append intents.
339
+ * Defaults to `true` for RFC 6902-compatible parent semantics.
340
+ * Use `withStrictRfc6902Parents(...)` for RFC 6902-compatible missing-parent
341
+ * behavior. Explicitly setting `false` preserves the legacy behavior that can
342
+ * auto-create missing arrays for index `0` / append intents.
293
343
  */
294
344
  strictParents?: boolean;
295
345
  /**
@@ -297,6 +347,7 @@ type ApplyPatchOptions = {
297
347
  * Defaults to `"none"` for backward compatibility.
298
348
  */
299
349
  jsonValidation?: JsonValidationMode;
350
+ signal?: AbortSignalLike;
300
351
  };
301
352
  /** Options for in-place patch application (`applyPatchInPlace` / `tryApplyPatchInPlace`). */
302
353
  type ApplyPatchInPlaceOptions = ApplyPatchOptions & {
@@ -324,6 +375,16 @@ type ValidatePatchResult = {
324
375
  ok: false;
325
376
  error: ApplyError;
326
377
  };
378
+ /**
379
+ * Merge strategy applied when two non-empty array sequences share no element lineage.
380
+ *
381
+ * - `"reject"` – abort the merge and return a `LINEAGE_MISMATCH` error (default).
382
+ * - `"atomic-replace"` – replace the losing array entirely with the one that has
383
+ * the higher representative dot (causal last-write-wins at the array level).
384
+ * - `"unsafe-union"` – union all elements from both sequences without any lineage
385
+ * check. Element ordering may be non-deterministic across peers.
386
+ */
387
+ type UnrelatedArraysStrategy = "reject" | "atomic-replace" | "unsafe-union";
327
388
  /** Options for `mergeState`. */
328
389
  type MergeStateOptions = {
329
390
  /**
@@ -332,19 +393,41 @@ type MergeStateOptions = {
332
393
  */
333
394
  actor?: ActorId;
334
395
  /**
335
- * Require array sequences to share element lineage before merging.
336
- * Defaults to `true`.
396
+ * Strategy for merging unrelated (non-overlapping) non-empty array sequences.
397
+ * Defaults to `"reject"`.
398
+ */
399
+ unrelatedArrays?: UnrelatedArraysStrategy;
400
+ /**
401
+ * @deprecated Use `unrelatedArrays` instead.
402
+ * When `true`, behaves like `unrelatedArrays: "reject"`.
403
+ * When `false`, behaves like `unrelatedArrays: "unsafe-union"`.
404
+ * Ignored when `unrelatedArrays` is also provided.
337
405
  */
338
406
  requireSharedOrigin?: boolean;
407
+ resourceBudget?: ResourceBudget;
408
+ signal?: AbortSignalLike;
339
409
  };
340
410
  /** Options for `mergeDoc`. */
341
411
  type MergeDocOptions = {
342
412
  /**
343
- * Require array sequences to share element lineage before merging.
344
- * Defaults to `true`.
413
+ * Strategy for merging unrelated (non-overlapping) non-empty array sequences.
414
+ * Defaults to `"reject"`.
415
+ */
416
+ unrelatedArrays?: UnrelatedArraysStrategy;
417
+ /**
418
+ * @deprecated Use `unrelatedArrays` instead.
419
+ * When `true`, behaves like `unrelatedArrays: "reject"`.
420
+ * When `false`, behaves like `unrelatedArrays: "unsafe-union"`.
421
+ * Ignored when `unrelatedArrays` is also provided.
345
422
  */
346
423
  requireSharedOrigin?: boolean;
424
+ resourceBudget?: ResourceBudget;
425
+ signal?: AbortSignalLike;
347
426
  };
427
+ interface DeserializeOptions {
428
+ resourceBudget?: ResourceBudget;
429
+ signal?: AbortSignalLike;
430
+ }
348
431
  /** Non-throwing result for `mergeDoc`. */
349
432
  type TryMergeDocResult = {
350
433
  ok: true;
@@ -399,6 +482,7 @@ type JsonPatchToCrdtOptions = {
399
482
  bumpCounterAbove?: (ctr: number) => void;
400
483
  semantics?: PatchSemantics;
401
484
  strictParents?: boolean;
485
+ resourceBudget?: ResourceBudget;
402
486
  };
403
487
  /** Options for `crdtToJsonPatch` and `diffJsonPatch`. */
404
488
  type DiffOptions = {
@@ -406,8 +490,8 @@ type DiffOptions = {
406
490
  * Array diff mode.
407
491
  * - `"lcs"` (default): index-level edits using LCS.
408
492
  * - `"lcs-linear"`: index-level edits using a lower-memory LCS variant.
409
- * This reduces memory use but still has `O(n * m)` time complexity and no
410
- * automatic fallback for very large unmatched windows.
493
+ * This reduces memory use but still has `O(n * m)` time complexity. Large
494
+ * unmatched windows fall back to atomic replacement by default.
411
495
  * - `"atomic"`: one-op root/field replacement for changed arrays.
412
496
  */
413
497
  arrayStrategy?: "atomic" | "lcs" | "lcs-linear";
@@ -420,16 +504,16 @@ type DiffOptions = {
420
504
  */
421
505
  lcsMaxCells?: number;
422
506
  /**
423
- * Optional guardrail for `arrayStrategy: "lcs-linear"`.
507
+ * Guardrail for `arrayStrategy: "lcs-linear"`.
424
508
  * Uses the trimmed unmatched window size
425
509
  * (`(unmatchedBase.length + 1) * (unmatchedNext.length + 1)`) as a proxy for
426
510
  * worst-case work. When the cap is exceeded, the diff falls back to an atomic
427
511
  * array replacement instead of running the linear-space traversal.
428
512
  *
429
- * Unlike `lcsMaxCells`, this is opt-in and defaults to no fallback so
430
- * existing `lcs-linear` callers keep their current behavior.
513
+ * Defaults to `250_000`.
431
514
  *
432
- * Set to `Number.POSITIVE_INFINITY` to always allow `lcs-linear`.
515
+ * Set to `Number.POSITIVE_INFINITY` to always allow `lcs-linear` and preserve
516
+ * the previous unbounded behavior.
433
517
  */
434
518
  lcsLinearMaxCells?: number;
435
519
  /**
@@ -447,6 +531,8 @@ type DiffOptions = {
447
531
  * Defaults to `"none"` for backward compatibility.
448
532
  */
449
533
  jsonValidation?: JsonValidationMode;
534
+ resourceBudget?: ResourceBudget;
535
+ signal?: AbortSignalLike;
450
536
  };
451
537
  /**
452
538
  * Internal sentinel key used in `IntentOp` to represent root-level operations.
@@ -454,11 +540,34 @@ type DiffOptions = {
454
540
  */
455
541
  declare const ROOT_KEY = "@@crdt/root";
456
542
  //#endregion
543
+ //#region src/safe.d.ts
544
+ interface SafeCreateStateOptions extends Omit<CreateStateOptions, "jsonValidation"> {}
545
+ interface SafeApplyPatchOptions extends Omit<ApplyPatchOptions, "jsonValidation"> {}
546
+ interface SafeDiffOptions extends Omit<DiffOptions, "jsonValidation"> {}
547
+ interface NormalizedCreateStateOptions extends Omit<CreateStateOptions, "jsonValidation"> {}
548
+ interface NormalizedApplyPatchOptions extends Omit<ApplyPatchOptions, "jsonValidation"> {}
549
+ interface NormalizedDiffOptions extends Omit<DiffOptions, "jsonValidation"> {}
550
+ /** Create a state with strict runtime JSON validation enabled by default. */
551
+ declare function createSafeState(initial: JsonValue, options: SafeCreateStateOptions): CrdtState;
552
+ /** Apply a patch with strict runtime JSON validation enabled by default. */
553
+ declare function applySafePatch(state: CrdtState, patch: JsonPatchOp[], options?: SafeApplyPatchOptions): CrdtState;
554
+ /** Diff JSON values with strict runtime JSON validation enabled by default. */
555
+ declare function diffSafeJsonPatch(base: JsonValue, next: JsonValue, options?: SafeDiffOptions): JsonPatchOp[];
556
+ /** Create a state with normalizing runtime JSON validation enabled by default. */
557
+ declare function createNormalizedState(initial: JsonValue, options: NormalizedCreateStateOptions): CrdtState;
558
+ /** Apply a patch with normalizing runtime JSON validation enabled by default. */
559
+ declare function applyNormalizedPatch(state: CrdtState, patch: JsonPatchOp[], options?: NormalizedApplyPatchOptions): CrdtState;
560
+ /** Diff JSON values with normalizing runtime JSON validation enabled by default. */
561
+ declare function diffNormalizedJsonPatch(base: JsonValue, next: JsonValue, options?: NormalizedDiffOptions): JsonPatchOp[];
562
+ //#endregion
457
563
  //#region src/state.d.ts
458
564
  /** Error thrown when a JSON Patch cannot be applied. Includes structured conflict metadata. */
459
565
  declare class PatchError extends Error {
460
566
  readonly code: 409;
461
567
  readonly reason: PatchErrorReason;
568
+ readonly budget?: ResourceBudgetKind;
569
+ readonly limit?: number;
570
+ readonly actual?: number;
462
571
  readonly path?: string;
463
572
  readonly opIndex?: number;
464
573
  constructor(error: ApplyError);
@@ -550,6 +659,24 @@ declare function nextDotForActor(vv: VersionVector, actor: ActorId): Dot;
550
659
  /** Record an observed dot in a version vector. */
551
660
  declare function observeDot(vv: VersionVector, dot: Dot): void;
552
661
  //#endregion
662
+ //#region src/budget.d.ts
663
+ declare class ResourceBudgetError extends Error {
664
+ readonly reason: "RESOURCE_BUDGET_EXCEEDED";
665
+ readonly code: 409;
666
+ readonly budget: ResourceBudgetKind;
667
+ readonly limit: number;
668
+ readonly actual: number;
669
+ readonly path?: string;
670
+ readonly opIndex?: number;
671
+ constructor(budget: ResourceBudgetKind, limit: number, actual: number, path?: string, opIndex?: number);
672
+ }
673
+ //#endregion
674
+ //#region src/cancellation.d.ts
675
+ declare class OperationCancelledError extends Error {
676
+ readonly reasonValue?: unknown;
677
+ constructor(reason?: unknown);
678
+ }
679
+ //#endregion
553
680
  //#region src/patch.d.ts
554
681
  /** Structured compile error used to map patch validation failures to typed reasons. */
555
682
  declare class PatchCompileError extends Error {
@@ -585,7 +712,7 @@ declare function compileJsonPatchToIntent(baseJson: JsonValue, patch: JsonPatchO
585
712
  * By default arrays use a deterministic LCS strategy.
586
713
  * Pass `{ arrayStrategy: "atomic" }` for single-op array replacement.
587
714
  * Pass `{ arrayStrategy: "lcs-linear" }` for a lower-memory LCS variant.
588
- * Use `lcsLinearMaxCells` to optionally cap worst-case `lcs-linear` work and
715
+ * Use `lcsLinearMaxCells` to cap worst-case `lcs-linear` work and
589
716
  * fall back to an atomic array replacement for very large unmatched windows.
590
717
  * Pass `{ emitMoves: true }` or `{ emitCopies: true }` to opt into RFC 6902
591
718
  * move/copy emission when a deterministic rewrite is available.
@@ -600,6 +727,34 @@ declare function stableJsonValueKey(value: JsonValue, structuralKeyCache?: WeakM
600
727
  /** Deep equality check for JSON values (null-safe, handles arrays and objects). */
601
728
  declare function jsonEquals(a: JsonValue, b: JsonValue): boolean;
602
729
  //#endregion
730
+ //#region src/options.d.ts
731
+ /** Options that reject legacy missing-parent array auto-creation. */
732
+ declare const strictRfc6902PatchOptions: {
733
+ readonly strictParents: true;
734
+ };
735
+ /**
736
+ * Build `applyPatch` options for strict RFC 6902 parent semantics.
737
+ *
738
+ * Use this when patches come from an RFC 6902 boundary and missing array
739
+ * parents should fail instead of being materialized.
740
+ */
741
+ declare function withStrictRfc6902Parents(): typeof strictRfc6902PatchOptions;
742
+ declare function withStrictRfc6902Parents<T extends ApplyPatchOptions>(options: T): T & typeof strictRfc6902PatchOptions;
743
+ /**
744
+ * Build `applyPatch` options for the legacy missing-parent array behavior.
745
+ *
746
+ * @deprecated Missing-parent array auto-creation is not RFC 6902 compatible.
747
+ * Prefer `withStrictRfc6902Parents(...)` unless you are preserving legacy data
748
+ * flows that intentionally materialize missing arrays for `/path/0` or
749
+ * `/path/-` inserts.
750
+ */
751
+ declare function withLegacyMissingArrayParents(): {
752
+ strictParents: false;
753
+ };
754
+ declare function withLegacyMissingArrayParents<T extends ApplyPatchOptions>(options: T): T & {
755
+ strictParents: false;
756
+ };
757
+ //#endregion
603
758
  //#region src/serialize.d.ts
604
759
  declare class DeserializeError extends Error {
605
760
  readonly code: 409;
@@ -610,9 +765,11 @@ declare class DeserializeError extends Error {
610
765
  /** Serialize a CRDT document to a JSON-safe representation (Maps become plain objects). */
611
766
  declare function serializeDoc(doc: Doc): SerializedDoc;
612
767
  /** Reconstruct a CRDT document from its serialized form. */
613
- declare function deserializeDoc(data: SerializedDoc): Doc;
768
+ declare function deserializeDoc(data: SerializedDoc, options?: DeserializeOptions): Doc;
614
769
  /** Non-throwing `deserializeDoc` variant with typed validation details. */
615
- declare function tryDeserializeDoc(data: SerializedDoc): TryDeserializeDocResult;
770
+ declare function tryDeserializeDoc(data: SerializedDoc, options?: DeserializeOptions): TryDeserializeDocResult;
771
+ /** Validate a serialized CRDT document without throwing or returning runtime state. */
772
+ declare function validateSerializedDoc(data: SerializedDoc, options?: DeserializeOptions): ValidateSerializedDocResult;
616
773
  /** Serialize a full CRDT state (document + clock) to a JSON-safe representation. */
617
774
  declare function serializeState(state: CrdtState): SerializedState;
618
775
  /**
@@ -621,15 +778,20 @@ declare function serializeState(state: CrdtState): SerializedState;
621
778
  * May throw `TraversalDepthError` when the payload exceeds the maximum
622
779
  * supported nesting depth.
623
780
  */
624
- declare function deserializeState(data: SerializedState): CrdtState;
781
+ declare function deserializeState(data: SerializedState, options?: DeserializeOptions): CrdtState;
625
782
  /** Non-throwing `deserializeState` variant with typed validation details. */
626
- declare function tryDeserializeState(data: SerializedState): TryDeserializeStateResult;
783
+ declare function tryDeserializeState(data: SerializedState, options?: DeserializeOptions): TryDeserializeStateResult;
784
+ /** Validate a serialized CRDT state without throwing or returning runtime state. */
785
+ declare function validateSerializedState(data: SerializedState, options?: DeserializeOptions): ValidateSerializedStateResult;
627
786
  //#endregion
628
787
  //#region src/merge.d.ts
629
788
  /** Error thrown by throwing merge helpers (`mergeDoc` / `mergeState`). */
630
789
  declare class MergeError extends Error {
631
790
  readonly code: 409;
632
791
  readonly reason: PatchErrorReason;
792
+ readonly budget?: ResourceBudgetKind;
793
+ readonly limit?: number;
794
+ readonly actual?: number;
633
795
  readonly path?: string;
634
796
  constructor(error: ApplyError);
635
797
  }
@@ -655,7 +817,7 @@ declare function tryMergeDoc(a: Doc, b: Doc, options?: MergeDocOptions): TryMerg
655
817
  * The merged clock keeps a stable actor identity:
656
818
  * - defaults to the actor from the first argument (`a`)
657
819
  * - can be overridden via `options.actor`
658
- * - optional `options.requireSharedOrigin` controls merge lineage checks
820
+ * - optional `options.unrelatedArrays` controls the merge strategy for non-overlapping sequences
659
821
  *
660
822
  * The merged counter is lifted to the highest counter already observed for
661
823
  * that actor across both input clocks and the merged document dots.
@@ -718,4 +880,4 @@ declare class TraversalDepthError extends Error {
718
880
  constructor(depth: number, maxDepth?: number);
719
881
  }
720
882
  //#endregion
721
- export { Clock as $, cloneClock as A, SerializedClock as At, forkState as B, TryDeserializeDocResult as Bt, diffJsonPatch as C, ObjEntry as Ct, stableJsonValueKey as D, ROOT_KEY as Dt, parseJsonPointer as E, PatchSemantics as Et, PatchError as F, TombstoneCompactionOptions as Ft, validateJsonPatch as G, VersionVector as Gt, tryApplyPatch as H, TryMergeDocResult as Ht, applyPatch as I, TombstoneCompactionStats as It, ApplyPatchAsActorOptions as J, ActorId as K, applyPatchAsActor as L, TryApplyPatchAsActorResult as Lt, nextDotForActor as M, SerializedNode as Mt, observeDot as N, SerializedRgaElem as Nt, stringifyJsonPointer as O, RgaElem as Ot, JsonValueValidationError as P, SerializedState as Pt, ApplyResult as Q, applyPatchInPlace as R, TryApplyPatchInPlaceResult as Rt, compileJsonPatchToIntent as S, Node as St, jsonEquals as T, PatchErrorReason as Tt, tryApplyPatchAsActor as U, TryMergeStateResult as Ut, toJson as V, TryDeserializeStateResult as Vt, tryApplyPatchInPlace as W, ValidatePatchResult as Wt, ApplyPatchInPlaceOptions as X, ApplyPatchAsActorResult as Y, ApplyPatchOptions as Z, serializeDoc as _, JsonValidationMode as _t, intersectVersionVectors as a, DeserializeErrorReason as at, tryDeserializeState as b, MergeDocOptions as bt, versionVectorCovers as c, Doc as ct, mergeState as d, ForkStateOptions as dt, CompactDocTombstonesResult as et, tryMergeDoc as f, IntentOp as ft, deserializeState as g, JsonPrimitive as gt, deserializeDoc as h, JsonPatchToCrdtOptions as ht, compactStateTombstones as i, CreateStateOptions as it, createClock as j, SerializedDoc as jt, ClockValidationError as k, RgaSeq as kt, MergeError as l, Dot as lt, DeserializeError as m, JsonPatchOp as mt, TraversalDepthError as n, CompilePatchOptions as nt, mergeVersionVectors as o, DeserializeFailure as ot, tryMergeState as p, JsonPatch as pt, ApplyError as q, compactDocTombstones as r, CrdtState as rt, observedVersionVector as s, DiffOptions as st, MAX_TRAVERSAL_DEPTH as t, CompactStateTombstonesResult as tt, mergeDoc as u, ElemId as ut, serializeState as v, JsonValue as vt, getAtJson as w, ObjNode as wt, PatchCompileError as x, MergeStateOptions as xt, tryDeserializeDoc as y, LwwReg as yt, createState as z, TryApplyPatchResult as zt };
883
+ export { NormalizedApplyPatchOptions as $, RgaSeq as $t, jsonEquals as A, Dot as At, observeDot as B, LwwReg as Bt, strictRfc6902PatchOptions as C, CrdtState as Ct, compileJsonPatchToIntent as D, DeserializeOptions as Dt, PatchCompileError as E, DeserializeFailure as Et, ResourceBudgetError as F, JsonPatchOp as Ft, applyPatchInPlace as G, ObjNode as Gt, PatchError as H, MergeStateOptions as Ht, ClockValidationError as I, JsonPatchToCrdtOptions as It, toJson as J, ROOT_KEY as Jt, createState as K, PatchErrorReason as Kt, cloneClock as L, JsonPrimitive as Lt, stableJsonValueKey as M, ForkStateOptions as Mt, stringifyJsonPointer as N, IntentOp as Nt, diffJsonPatch as O, DiffOptions as Ot, OperationCancelledError as P, JsonPatch as Pt, validateJsonPatch as Q, RgaElem as Qt, createClock as R, JsonValidationMode as Rt, validateSerializedState as S, CompilePatchOptions as St, withStrictRfc6902Parents as T, DeserializeErrorReason as Tt, applyPatch as U, Node as Ut, JsonValueValidationError as V, MergeDocOptions as Vt, applyPatchAsActor as W, ObjEntry as Wt, tryApplyPatchAsActor as X, ResourceBudgetExceededFailure as Xt, tryApplyPatch as Y, ResourceBudget as Yt, tryApplyPatchInPlace as Z, ResourceBudgetKind as Zt, serializeDoc as _, ValidateSerializedStateResult as _n, ApplyPatchOptions as _t, intersectVersionVectors as a, TombstoneCompactionOptions as an, applyNormalizedPatch as at, tryDeserializeState as b, CompactDocTombstonesResult as bt, versionVectorCovers as c, TryApplyPatchInPlaceResult as cn, createSafeState as ct, mergeState as d, TryDeserializeStateResult as dn, AbortSignalLike as dt, SerializedClock as en, NormalizedCreateStateOptions as et, tryMergeDoc as f, TryMergeDocResult as fn, ActorId as ft, deserializeState as g, ValidateSerializedDocResult as gn, ApplyPatchInPlaceOptions as gt, deserializeDoc as h, ValidatePatchResult as hn, ApplyPatchAsActorResult as ht, compactStateTombstones as i, SerializedState as in, SafeDiffOptions as it, parseJsonPointer as j, ElemId as jt, getAtJson as k, Doc as kt, MergeError as l, TryApplyPatchResult as ln, diffNormalizedJsonPatch as lt, DeserializeError as m, UnrelatedArraysStrategy as mn, ApplyPatchAsActorOptions as mt, TraversalDepthError as n, SerializedNode as nn, SafeApplyPatchOptions as nt, mergeVersionVectors as o, TombstoneCompactionStats as on, applySafePatch as ot, tryMergeState as p, TryMergeStateResult as pn, ApplyError as pt, forkState as q, PatchSemantics as qt, compactDocTombstones as r, SerializedRgaElem as rn, SafeCreateStateOptions as rt, observedVersionVector as s, TryApplyPatchAsActorResult as sn, createNormalizedState as st, MAX_TRAVERSAL_DEPTH as t, SerializedDoc as tn, NormalizedDiffOptions as tt, mergeDoc as u, TryDeserializeDocResult as un, diffSafeJsonPatch as ut, serializeState as v, VersionVector as vn, ApplyResult as vt, withLegacyMissingArrayParents as w, CreateStateOptions as wt, validateSerializedDoc as x, CompactStateTombstonesResult as xt, tryDeserializeDoc as y, Clock as yt, nextDotForActor as z, JsonValue as zt };
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { B as forkState, C as diffJsonPatch, Et as PatchSemantics, F as PatchError, Ft as TombstoneCompactionOptions, G as validateJsonPatch, H as tryApplyPatch, I as applyPatch, It as TombstoneCompactionStats, K as ActorId, P as JsonValueValidationError, Pt as SerializedState, R as applyPatchInPlace, Rt as TryApplyPatchInPlaceResult, Tt as PatchErrorReason, Ut as TryMergeStateResult, V as toJson, Vt as TryDeserializeStateResult, W as tryApplyPatchInPlace, Wt as ValidatePatchResult, X as ApplyPatchInPlaceOptions, Z as ApplyPatchOptions, _t as JsonValidationMode, a as intersectVersionVectors, at as DeserializeErrorReason, b as tryDeserializeState, c as versionVectorCovers, d as mergeState, dt as ForkStateOptions, g as deserializeState, gt as JsonPrimitive, i as compactStateTombstones, it as CreateStateOptions, k as ClockValidationError, l as MergeError, m as DeserializeError, mt as JsonPatchOp, n as TraversalDepthError, o as mergeVersionVectors, ot as DeserializeFailure, p as tryMergeState, pt as JsonPatch, q as ApplyError, rt as CrdtState, s as observedVersionVector, st as DiffOptions, t as MAX_TRAVERSAL_DEPTH, tt as CompactStateTombstonesResult, v as serializeState, vt as JsonValue, xt as MergeStateOptions, z as createState, zt as TryApplyPatchResult } from "./depth-CpJSyZE5.mjs";
2
- export { type ActorId, type ApplyError, type ApplyPatchInPlaceOptions, type ApplyPatchOptions, ClockValidationError, type CompactStateTombstonesResult, type CrdtState, type CreateStateOptions, DeserializeError, type DeserializeErrorReason, type DeserializeFailure, type DiffOptions, type ForkStateOptions, type JsonPatch, type JsonPatchOp, type JsonPrimitive, type JsonValidationMode, type JsonValue, JsonValueValidationError, MAX_TRAVERSAL_DEPTH, MergeError, type MergeStateOptions, PatchError, type PatchErrorReason, type PatchSemantics, type SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchInPlaceResult, type TryApplyPatchResult, type TryDeserializeStateResult, type TryMergeStateResult, type ValidatePatchResult, applyPatch, applyPatchInPlace, compactStateTombstones, createState, deserializeState, diffJsonPatch, forkState, intersectVersionVectors, mergeState, mergeVersionVectors, observedVersionVector, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryDeserializeState, tryMergeState, validateJsonPatch, versionVectorCovers };
1
+ import { $ as NormalizedApplyPatchOptions, C as strictRfc6902PatchOptions, Ct as CrdtState, Dt as DeserializeOptions, Et as DeserializeFailure, F as ResourceBudgetError, Ft as JsonPatchOp, G as applyPatchInPlace, H as PatchError, Ht as MergeStateOptions, I as ClockValidationError, J as toJson, K as createState, Kt as PatchErrorReason, Lt as JsonPrimitive, Mt as ForkStateOptions, O as diffJsonPatch, Ot as DiffOptions, P as OperationCancelledError, Pt as JsonPatch, Q as validateJsonPatch, Rt as JsonValidationMode, S as validateSerializedState, T as withStrictRfc6902Parents, Tt as DeserializeErrorReason, U as applyPatch, V as JsonValueValidationError, Xt as ResourceBudgetExceededFailure, Y as tryApplyPatch, Yt as ResourceBudget, Z as tryApplyPatchInPlace, Zt as ResourceBudgetKind, _ as serializeDoc, _n as ValidateSerializedStateResult, _t as ApplyPatchOptions, a as intersectVersionVectors, an as TombstoneCompactionOptions, at as applyNormalizedPatch, b as tryDeserializeState, c as versionVectorCovers, cn as TryApplyPatchInPlaceResult, ct as createSafeState, d as mergeState, dn as TryDeserializeStateResult, dt as AbortSignalLike, et as NormalizedCreateStateOptions, ft as ActorId, g as deserializeState, gn as ValidateSerializedDocResult, gt as ApplyPatchInPlaceOptions, h as deserializeDoc, hn as ValidatePatchResult, i as compactStateTombstones, in as SerializedState, it as SafeDiffOptions, kt as Doc, l as MergeError, ln as TryApplyPatchResult, lt as diffNormalizedJsonPatch, m as DeserializeError, mn as UnrelatedArraysStrategy, n as TraversalDepthError, nt as SafeApplyPatchOptions, o as mergeVersionVectors, on as TombstoneCompactionStats, ot as applySafePatch, p as tryMergeState, pn as TryMergeStateResult, pt as ApplyError, q as forkState, qt as PatchSemantics, rt as SafeCreateStateOptions, s as observedVersionVector, st as createNormalizedState, t as MAX_TRAVERSAL_DEPTH, tn as SerializedDoc, tt as NormalizedDiffOptions, un as TryDeserializeDocResult, ut as diffSafeJsonPatch, v as serializeState, w as withLegacyMissingArrayParents, wt as CreateStateOptions, x as validateSerializedDoc, xt as CompactStateTombstonesResult, y as tryDeserializeDoc, zt as JsonValue } from "./depth-C5m9qI-V.mjs";
2
+ export { type AbortSignalLike, type ActorId, type ApplyError, type ApplyPatchInPlaceOptions, type ApplyPatchOptions, ClockValidationError, type CompactStateTombstonesResult, type CrdtState, type CreateStateOptions, DeserializeError, type DeserializeErrorReason, type DeserializeFailure, type DeserializeOptions, type DiffOptions, type Doc, type ForkStateOptions, type JsonPatch, type JsonPatchOp, type JsonPrimitive, type JsonValidationMode, type JsonValue, JsonValueValidationError, MAX_TRAVERSAL_DEPTH, MergeError, type MergeStateOptions, type NormalizedApplyPatchOptions, type NormalizedCreateStateOptions, type NormalizedDiffOptions, OperationCancelledError, PatchError, type PatchErrorReason, type PatchSemantics, type ResourceBudget, ResourceBudgetError, type ResourceBudgetExceededFailure, type ResourceBudgetKind, type SafeApplyPatchOptions, type SafeCreateStateOptions, type SafeDiffOptions, type SerializedDoc, type SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchInPlaceResult, type TryApplyPatchResult, type TryDeserializeDocResult, type TryDeserializeStateResult, type TryMergeStateResult, type UnrelatedArraysStrategy, type ValidatePatchResult, type ValidateSerializedDocResult, type ValidateSerializedStateResult, applyNormalizedPatch, applyPatch, applyPatchInPlace, applySafePatch, compactStateTombstones, createNormalizedState, createSafeState, createState, deserializeDoc, deserializeState, diffJsonPatch, diffNormalizedJsonPatch, diffSafeJsonPatch, forkState, intersectVersionVectors, mergeState, mergeVersionVectors, observedVersionVector, serializeDoc, serializeState, strictRfc6902PatchOptions, toJson, tryApplyPatch, tryApplyPatchInPlace, tryDeserializeDoc, tryDeserializeState, tryMergeState, validateJsonPatch, validateSerializedDoc, validateSerializedState, versionVectorCovers, withLegacyMissingArrayParents, withStrictRfc6902Parents };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { B as forkState, C as diffJsonPatch, Et as PatchSemantics, F as PatchError, Ft as TombstoneCompactionOptions, G as validateJsonPatch, H as tryApplyPatch, I as applyPatch, It as TombstoneCompactionStats, K as ActorId, P as JsonValueValidationError, Pt as SerializedState, R as applyPatchInPlace, Rt as TryApplyPatchInPlaceResult, Tt as PatchErrorReason, Ut as TryMergeStateResult, V as toJson, Vt as TryDeserializeStateResult, W as tryApplyPatchInPlace, Wt as ValidatePatchResult, X as ApplyPatchInPlaceOptions, Z as ApplyPatchOptions, _t as JsonValidationMode, a as intersectVersionVectors, at as DeserializeErrorReason, b as tryDeserializeState, c as versionVectorCovers, d as mergeState, dt as ForkStateOptions, g as deserializeState, gt as JsonPrimitive, i as compactStateTombstones, it as CreateStateOptions, k as ClockValidationError, l as MergeError, m as DeserializeError, mt as JsonPatchOp, n as TraversalDepthError, o as mergeVersionVectors, ot as DeserializeFailure, p as tryMergeState, pt as JsonPatch, q as ApplyError, rt as CrdtState, s as observedVersionVector, st as DiffOptions, t as MAX_TRAVERSAL_DEPTH, tt as CompactStateTombstonesResult, v as serializeState, vt as JsonValue, xt as MergeStateOptions, z as createState, zt as TryApplyPatchResult } from "./depth-D88VeWb-.js";
2
- export { type ActorId, type ApplyError, type ApplyPatchInPlaceOptions, type ApplyPatchOptions, ClockValidationError, type CompactStateTombstonesResult, type CrdtState, type CreateStateOptions, DeserializeError, type DeserializeErrorReason, type DeserializeFailure, type DiffOptions, type ForkStateOptions, type JsonPatch, type JsonPatchOp, type JsonPrimitive, type JsonValidationMode, type JsonValue, JsonValueValidationError, MAX_TRAVERSAL_DEPTH, MergeError, type MergeStateOptions, PatchError, type PatchErrorReason, type PatchSemantics, type SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchInPlaceResult, type TryApplyPatchResult, type TryDeserializeStateResult, type TryMergeStateResult, type ValidatePatchResult, applyPatch, applyPatchInPlace, compactStateTombstones, createState, deserializeState, diffJsonPatch, forkState, intersectVersionVectors, mergeState, mergeVersionVectors, observedVersionVector, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryDeserializeState, tryMergeState, validateJsonPatch, versionVectorCovers };
1
+ import { $ as NormalizedApplyPatchOptions, C as strictRfc6902PatchOptions, Ct as CrdtState, Dt as DeserializeOptions, Et as DeserializeFailure, F as ResourceBudgetError, Ft as JsonPatchOp, G as applyPatchInPlace, H as PatchError, Ht as MergeStateOptions, I as ClockValidationError, J as toJson, K as createState, Kt as PatchErrorReason, Lt as JsonPrimitive, Mt as ForkStateOptions, O as diffJsonPatch, Ot as DiffOptions, P as OperationCancelledError, Pt as JsonPatch, Q as validateJsonPatch, Rt as JsonValidationMode, S as validateSerializedState, T as withStrictRfc6902Parents, Tt as DeserializeErrorReason, U as applyPatch, V as JsonValueValidationError, Xt as ResourceBudgetExceededFailure, Y as tryApplyPatch, Yt as ResourceBudget, Z as tryApplyPatchInPlace, Zt as ResourceBudgetKind, _ as serializeDoc, _n as ValidateSerializedStateResult, _t as ApplyPatchOptions, a as intersectVersionVectors, an as TombstoneCompactionOptions, at as applyNormalizedPatch, b as tryDeserializeState, c as versionVectorCovers, cn as TryApplyPatchInPlaceResult, ct as createSafeState, d as mergeState, dn as TryDeserializeStateResult, dt as AbortSignalLike, et as NormalizedCreateStateOptions, ft as ActorId, g as deserializeState, gn as ValidateSerializedDocResult, gt as ApplyPatchInPlaceOptions, h as deserializeDoc, hn as ValidatePatchResult, i as compactStateTombstones, in as SerializedState, it as SafeDiffOptions, kt as Doc, l as MergeError, ln as TryApplyPatchResult, lt as diffNormalizedJsonPatch, m as DeserializeError, mn as UnrelatedArraysStrategy, n as TraversalDepthError, nt as SafeApplyPatchOptions, o as mergeVersionVectors, on as TombstoneCompactionStats, ot as applySafePatch, p as tryMergeState, pn as TryMergeStateResult, pt as ApplyError, q as forkState, qt as PatchSemantics, rt as SafeCreateStateOptions, s as observedVersionVector, st as createNormalizedState, t as MAX_TRAVERSAL_DEPTH, tn as SerializedDoc, tt as NormalizedDiffOptions, un as TryDeserializeDocResult, ut as diffSafeJsonPatch, v as serializeState, w as withLegacyMissingArrayParents, wt as CreateStateOptions, x as validateSerializedDoc, xt as CompactStateTombstonesResult, y as tryDeserializeDoc, zt as JsonValue } from "./depth-vwQdqCBN.js";
2
+ export { type AbortSignalLike, type ActorId, type ApplyError, type ApplyPatchInPlaceOptions, type ApplyPatchOptions, ClockValidationError, type CompactStateTombstonesResult, type CrdtState, type CreateStateOptions, DeserializeError, type DeserializeErrorReason, type DeserializeFailure, type DeserializeOptions, type DiffOptions, type Doc, type ForkStateOptions, type JsonPatch, type JsonPatchOp, type JsonPrimitive, type JsonValidationMode, type JsonValue, JsonValueValidationError, MAX_TRAVERSAL_DEPTH, MergeError, type MergeStateOptions, type NormalizedApplyPatchOptions, type NormalizedCreateStateOptions, type NormalizedDiffOptions, OperationCancelledError, PatchError, type PatchErrorReason, type PatchSemantics, type ResourceBudget, ResourceBudgetError, type ResourceBudgetExceededFailure, type ResourceBudgetKind, type SafeApplyPatchOptions, type SafeCreateStateOptions, type SafeDiffOptions, type SerializedDoc, type SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchInPlaceResult, type TryApplyPatchResult, type TryDeserializeDocResult, type TryDeserializeStateResult, type TryMergeStateResult, type UnrelatedArraysStrategy, type ValidatePatchResult, type ValidateSerializedDocResult, type ValidateSerializedStateResult, applyNormalizedPatch, applyPatch, applyPatchInPlace, applySafePatch, compactStateTombstones, createNormalizedState, createSafeState, createState, deserializeDoc, deserializeState, diffJsonPatch, diffNormalizedJsonPatch, diffSafeJsonPatch, forkState, intersectVersionVectors, mergeState, mergeVersionVectors, observedVersionVector, serializeDoc, serializeState, strictRfc6902PatchOptions, toJson, tryApplyPatch, tryApplyPatchInPlace, tryDeserializeDoc, tryDeserializeState, tryMergeState, validateJsonPatch, validateSerializedDoc, validateSerializedState, versionVectorCovers, withLegacyMissingArrayParents, withStrictRfc6902Parents };
package/dist/index.js CHANGED
@@ -1,29 +1,45 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_compact = require('./compact-CXfvMNCT.js');
2
+ const require_compact = require('./compact-BUXv4MXQ.js');
3
3
 
4
4
  exports.ClockValidationError = require_compact.ClockValidationError;
5
5
  exports.DeserializeError = require_compact.DeserializeError;
6
6
  exports.JsonValueValidationError = require_compact.JsonValueValidationError;
7
7
  exports.MAX_TRAVERSAL_DEPTH = require_compact.MAX_TRAVERSAL_DEPTH;
8
8
  exports.MergeError = require_compact.MergeError;
9
+ exports.OperationCancelledError = require_compact.OperationCancelledError;
9
10
  exports.PatchError = require_compact.PatchError;
11
+ exports.ResourceBudgetError = require_compact.ResourceBudgetError;
10
12
  exports.TraversalDepthError = require_compact.TraversalDepthError;
13
+ exports.applyNormalizedPatch = require_compact.applyNormalizedPatch;
11
14
  exports.applyPatch = require_compact.applyPatch;
12
15
  exports.applyPatchInPlace = require_compact.applyPatchInPlace;
16
+ exports.applySafePatch = require_compact.applySafePatch;
13
17
  exports.compactStateTombstones = require_compact.compactStateTombstones;
18
+ exports.createNormalizedState = require_compact.createNormalizedState;
19
+ exports.createSafeState = require_compact.createSafeState;
14
20
  exports.createState = require_compact.createState;
21
+ exports.deserializeDoc = require_compact.deserializeDoc;
15
22
  exports.deserializeState = require_compact.deserializeState;
16
23
  exports.diffJsonPatch = require_compact.diffJsonPatch;
24
+ exports.diffNormalizedJsonPatch = require_compact.diffNormalizedJsonPatch;
25
+ exports.diffSafeJsonPatch = require_compact.diffSafeJsonPatch;
17
26
  exports.forkState = require_compact.forkState;
18
27
  exports.intersectVersionVectors = require_compact.intersectVersionVectors;
19
28
  exports.mergeState = require_compact.mergeState;
20
29
  exports.mergeVersionVectors = require_compact.mergeVersionVectors;
21
30
  exports.observedVersionVector = require_compact.observedVersionVector;
31
+ exports.serializeDoc = require_compact.serializeDoc;
22
32
  exports.serializeState = require_compact.serializeState;
33
+ exports.strictRfc6902PatchOptions = require_compact.strictRfc6902PatchOptions;
23
34
  exports.toJson = require_compact.toJson;
24
35
  exports.tryApplyPatch = require_compact.tryApplyPatch;
25
36
  exports.tryApplyPatchInPlace = require_compact.tryApplyPatchInPlace;
37
+ exports.tryDeserializeDoc = require_compact.tryDeserializeDoc;
26
38
  exports.tryDeserializeState = require_compact.tryDeserializeState;
27
39
  exports.tryMergeState = require_compact.tryMergeState;
28
40
  exports.validateJsonPatch = require_compact.validateJsonPatch;
29
- exports.versionVectorCovers = require_compact.versionVectorCovers;
41
+ exports.validateSerializedDoc = require_compact.validateSerializedDoc;
42
+ exports.validateSerializedState = require_compact.validateSerializedState;
43
+ exports.versionVectorCovers = require_compact.versionVectorCovers;
44
+ exports.withLegacyMissingArrayParents = require_compact.withLegacyMissingArrayParents;
45
+ exports.withStrictRfc6902Parents = require_compact.withStrictRfc6902Parents;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { Ct as TraversalDepthError, G as JsonValueValidationError, R as diffJsonPatch, S as tryApplyPatch, St as MAX_TRAVERSAL_DEPTH, T as validateJsonPatch, a as mergeState, b as forkState, bt as observedVersionVector, c as DeserializeError, f as serializeState, g as applyPatch, h as PatchError, m as tryDeserializeState, n as compactStateTombstones, pt as ClockValidationError, r as MergeError, s as tryMergeState, u as deserializeState, v as applyPatchInPlace, vt as intersectVersionVectors, w as tryApplyPatchInPlace, x as toJson, xt as versionVectorCovers, y as createState, yt as mergeVersionVectors } from "./compact-BcwxBNx_.mjs";
1
+ import { A as createState, At as mergeVersionVectors, C as createSafeState, D as applyPatch, E as PatchError, F as tryApplyPatchInPlace, Ft as OperationCancelledError, I as validateJsonPatch, It as ResourceBudgetError, M as toJson, Mt as versionVectorCovers, N as tryApplyPatch, Nt as MAX_TRAVERSAL_DEPTH, Pt as TraversalDepthError, S as createNormalizedState, T as diffSafeJsonPatch, Y as diffJsonPatch, _ as strictRfc6902PatchOptions, a as mergeState, b as applyNormalizedPatch, c as DeserializeError, d as serializeDoc, f as serializeState, g as validateSerializedState, h as validateSerializedDoc, j as forkState, jt as observedVersionVector, k as applyPatchInPlace, kt as intersectVersionVectors, l as deserializeDoc, m as tryDeserializeState, n as compactStateTombstones, nt as JsonValueValidationError, p as tryDeserializeDoc, r as MergeError, s as tryMergeState, u as deserializeState, v as withLegacyMissingArrayParents, w as diffNormalizedJsonPatch, wt as ClockValidationError, x as applySafePatch, y as withStrictRfc6902Parents } from "./compact-CncfNnDy.mjs";
2
2
 
3
- export { ClockValidationError, DeserializeError, JsonValueValidationError, MAX_TRAVERSAL_DEPTH, MergeError, PatchError, TraversalDepthError, applyPatch, applyPatchInPlace, compactStateTombstones, createState, deserializeState, diffJsonPatch, forkState, intersectVersionVectors, mergeState, mergeVersionVectors, observedVersionVector, serializeState, toJson, tryApplyPatch, tryApplyPatchInPlace, tryDeserializeState, tryMergeState, validateJsonPatch, versionVectorCovers };
3
+ export { ClockValidationError, DeserializeError, JsonValueValidationError, MAX_TRAVERSAL_DEPTH, MergeError, OperationCancelledError, PatchError, ResourceBudgetError, TraversalDepthError, applyNormalizedPatch, applyPatch, applyPatchInPlace, applySafePatch, compactStateTombstones, createNormalizedState, createSafeState, createState, deserializeDoc, deserializeState, diffJsonPatch, diffNormalizedJsonPatch, diffSafeJsonPatch, forkState, intersectVersionVectors, mergeState, mergeVersionVectors, observedVersionVector, serializeDoc, serializeState, strictRfc6902PatchOptions, toJson, tryApplyPatch, tryApplyPatchInPlace, tryDeserializeDoc, tryDeserializeState, tryMergeState, validateJsonPatch, validateSerializedDoc, validateSerializedState, versionVectorCovers, withLegacyMissingArrayParents, withStrictRfc6902Parents };
@@ -1,4 +1,4 @@
1
- import { $ as Clock, A as cloneClock, At as SerializedClock, B as forkState, Bt as TryDeserializeDocResult, C as diffJsonPatch, Ct as ObjEntry, D as stableJsonValueKey, Dt as ROOT_KEY, E as parseJsonPointer, Et as PatchSemantics, F as PatchError, Ft as TombstoneCompactionOptions, G as validateJsonPatch, Gt as VersionVector, H as tryApplyPatch, Ht as TryMergeDocResult, I as applyPatch, It as TombstoneCompactionStats, J as ApplyPatchAsActorOptions, K as ActorId, L as applyPatchAsActor, Lt as TryApplyPatchAsActorResult, M as nextDotForActor, Mt as SerializedNode, N as observeDot, Nt as SerializedRgaElem, O as stringifyJsonPointer, Ot as RgaElem, P as JsonValueValidationError, Pt as SerializedState, Q as ApplyResult, R as applyPatchInPlace, Rt as TryApplyPatchInPlaceResult, S as compileJsonPatchToIntent, St as Node, T as jsonEquals, Tt as PatchErrorReason, U as tryApplyPatchAsActor, Ut as TryMergeStateResult, V as toJson, Vt as TryDeserializeStateResult, W as tryApplyPatchInPlace, Wt as ValidatePatchResult, X as ApplyPatchInPlaceOptions, Y as ApplyPatchAsActorResult, Z as ApplyPatchOptions, _ as serializeDoc, _t as JsonValidationMode, a as intersectVersionVectors, at as DeserializeErrorReason, b as tryDeserializeState, bt as MergeDocOptions, c as versionVectorCovers, ct as Doc, d as mergeState, dt as ForkStateOptions, et as CompactDocTombstonesResult, f as tryMergeDoc, ft as IntentOp, g as deserializeState, gt as JsonPrimitive, h as deserializeDoc, ht as JsonPatchToCrdtOptions, i as compactStateTombstones, it as CreateStateOptions, j as createClock, jt as SerializedDoc, k as ClockValidationError, kt as RgaSeq, l as MergeError, lt as Dot, m as DeserializeError, mt as JsonPatchOp, n as TraversalDepthError, nt as CompilePatchOptions, o as mergeVersionVectors, ot as DeserializeFailure, p as tryMergeState, pt as JsonPatch, q as ApplyError, r as compactDocTombstones, rt as CrdtState, s as observedVersionVector, st as DiffOptions, t as MAX_TRAVERSAL_DEPTH, tt as CompactStateTombstonesResult, u as mergeDoc, ut as ElemId, v as serializeState, vt as JsonValue, w as getAtJson, wt as ObjNode, x as PatchCompileError, xt as MergeStateOptions, y as tryDeserializeDoc, yt as LwwReg, z as createState, zt as TryApplyPatchResult } from "./depth-CpJSyZE5.mjs";
1
+ import { $ as NormalizedApplyPatchOptions, $t as RgaSeq, A as jsonEquals, At as Dot, B as observeDot, Bt as LwwReg, C as strictRfc6902PatchOptions, Ct as CrdtState, D as compileJsonPatchToIntent, Dt as DeserializeOptions, E as PatchCompileError, Et as DeserializeFailure, F as ResourceBudgetError, Ft as JsonPatchOp, G as applyPatchInPlace, Gt as ObjNode, H as PatchError, Ht as MergeStateOptions, I as ClockValidationError, It as JsonPatchToCrdtOptions, J as toJson, Jt as ROOT_KEY, K as createState, Kt as PatchErrorReason, L as cloneClock, Lt as JsonPrimitive, M as stableJsonValueKey, Mt as ForkStateOptions, N as stringifyJsonPointer, Nt as IntentOp, O as diffJsonPatch, Ot as DiffOptions, P as OperationCancelledError, Pt as JsonPatch, Q as validateJsonPatch, Qt as RgaElem, R as createClock, Rt as JsonValidationMode, S as validateSerializedState, St as CompilePatchOptions, T as withStrictRfc6902Parents, Tt as DeserializeErrorReason, U as applyPatch, Ut as Node, V as JsonValueValidationError, Vt as MergeDocOptions, W as applyPatchAsActor, Wt as ObjEntry, X as tryApplyPatchAsActor, Xt as ResourceBudgetExceededFailure, Y as tryApplyPatch, Yt as ResourceBudget, Z as tryApplyPatchInPlace, Zt as ResourceBudgetKind, _ as serializeDoc, _n as ValidateSerializedStateResult, _t as ApplyPatchOptions, a as intersectVersionVectors, an as TombstoneCompactionOptions, at as applyNormalizedPatch, b as tryDeserializeState, bt as CompactDocTombstonesResult, c as versionVectorCovers, cn as TryApplyPatchInPlaceResult, ct as createSafeState, d as mergeState, dn as TryDeserializeStateResult, dt as AbortSignalLike, en as SerializedClock, et as NormalizedCreateStateOptions, f as tryMergeDoc, fn as TryMergeDocResult, ft as ActorId, g as deserializeState, gn as ValidateSerializedDocResult, gt as ApplyPatchInPlaceOptions, h as deserializeDoc, hn as ValidatePatchResult, ht as ApplyPatchAsActorResult, i as compactStateTombstones, in as SerializedState, it as SafeDiffOptions, j as parseJsonPointer, jt as ElemId, k as getAtJson, kt as Doc, l as MergeError, ln as TryApplyPatchResult, lt as diffNormalizedJsonPatch, m as DeserializeError, mn as UnrelatedArraysStrategy, mt as ApplyPatchAsActorOptions, n as TraversalDepthError, nn as SerializedNode, nt as SafeApplyPatchOptions, o as mergeVersionVectors, on as TombstoneCompactionStats, ot as applySafePatch, p as tryMergeState, pn as TryMergeStateResult, pt as ApplyError, q as forkState, qt as PatchSemantics, r as compactDocTombstones, rn as SerializedRgaElem, rt as SafeCreateStateOptions, s as observedVersionVector, sn as TryApplyPatchAsActorResult, st as createNormalizedState, t as MAX_TRAVERSAL_DEPTH, tn as SerializedDoc, tt as NormalizedDiffOptions, u as mergeDoc, un as TryDeserializeDocResult, ut as diffSafeJsonPatch, v as serializeState, vn as VersionVector, vt as ApplyResult, w as withLegacyMissingArrayParents, wt as CreateStateOptions, x as validateSerializedDoc, xt as CompactStateTombstonesResult, y as tryDeserializeDoc, yt as Clock, z as nextDotForActor, zt as JsonValue } from "./depth-C5m9qI-V.mjs";
2
2
 
3
3
  //#region src/doc.d.ts
4
4
  /**
@@ -9,8 +9,15 @@ import { $ as Clock, A as cloneClock, At as SerializedClock, B as forkState, Bt
9
9
  */
10
10
  declare function docFromJson(value: JsonValue, nextDot: () => Dot): Doc;
11
11
  /**
12
- * Legacy: create a doc using a single dot with counter offsets for array children.
13
- * Prefer `docFromJson(value, nextDot)` to ensure unique dots per node.
12
+ * Legacy helper for tests and fixtures that seeds an entire document from one dot.
13
+ *
14
+ * It reuses that dot for object entries and synthesizes array child counters from the
15
+ * same seed, which can produce low-quality causal metadata and unrealistic sequence
16
+ * identities in production CRDT state.
17
+ *
18
+ * Prefer `docFromJson(value, nextDot)` so every node receives a fresh unique dot.
19
+ *
20
+ * @deprecated Use `docFromJson(value, nextDot)` for production documents.
14
21
  */
15
22
  declare function docFromJsonWithDot(value: JsonValue, dot: Dot): Doc;
16
23
  /** Deep-clone a CRDT document. The clone is fully independent of the original. */
@@ -25,7 +32,8 @@ declare function cloneDoc(doc: Doc): Doc;
25
32
  * @param evalTestAgainst - Whether `test` ops are evaluated against `"head"` or `"base"`.
26
33
  * @param bumpCounterAbove - Optional hook that can fast-forward the underlying counter before inserts.
27
34
  * @param options - Optional behavior toggles.
28
- * @param options.strictParents - When `true`, reject array inserts whose base parent path is missing.
35
+ * @param options.strictParents - Reject array inserts whose base parent path is missing.
36
+ * Defaults to `true`; pass `false` only for legacy missing-parent array auto-creation.
29
37
  * @returns `{ ok: true }` on success, or `{ ok: false, code: 409, message }` on conflict.
30
38
  */
31
39
  declare function applyIntentsToCrdt(base: Doc, head: Doc, intents: IntentOp[], newDot: () => Dot, evalTestAgainst?: "head" | "base", bumpCounterAbove?: (ctr: number) => void, options?: {
@@ -128,4 +136,4 @@ declare function rgaCompactTombstones(seq: RgaSeq, isStable: (dot: Dot) => boole
128
136
  declare function rgaIdAtIndex(seq: RgaSeq, index: number): ElemId | undefined;
129
137
  declare function rgaPrevForInsertAtIndex(seq: RgaSeq, index: number): ElemId;
130
138
  //#endregion
131
- export { ActorId, ApplyError, type ApplyPatchAsActorOptions, type ApplyPatchAsActorResult, ApplyPatchInPlaceOptions, ApplyPatchOptions, type ApplyResult, type Clock, ClockValidationError, type CompactDocTombstonesResult, type CompactStateTombstonesResult, type CompilePatchOptions, CrdtState, CreateStateOptions, DeserializeError, DeserializeErrorReason, type DeserializeFailure, DiffOptions, type Doc, type Dot, type ElemId, ForkStateOptions, HEAD, type IntentOp, JsonPatch, JsonPatchOp, type JsonPatchToCrdtOptions, JsonPrimitive, JsonValidationMode, JsonValue, JsonValueValidationError, type LwwReg, MAX_TRAVERSAL_DEPTH, type MergeDocOptions, MergeError, MergeStateOptions, type Node, type ObjEntry, type ObjNode, PatchCompileError, PatchError, PatchErrorReason, PatchSemantics, ROOT_KEY, type RgaElem, type RgaSeq, type RgaValidationIssue, type RgaValidationResult, type SerializedClock, type SerializedDoc, type SerializedNode, type SerializedRgaElem, SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchAsActorResult, TryApplyPatchInPlaceResult, TryApplyPatchResult, type TryDeserializeDocResult, TryDeserializeStateResult, type TryMergeDocResult, TryMergeStateResult, ValidatePatchResult, type VersionVector, applyIntentsToCrdt, applyPatch, applyPatchAsActor, applyPatchInPlace, cloneClock, cloneDoc, compactDocTombstones, compactStateTombstones, compareDot, compileJsonPatchToIntent, crdtNodesToJsonPatch, crdtToFullReplace, crdtToJsonPatch, createClock, createState, deserializeDoc, deserializeState, diffJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, intersectVersionVectors, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, mergeVersionVectors, newObj, newReg, newSeq, nextDotForActor, objCompactTombstones, objRemove, objSet, observeDot, observedVersionVector, parseJsonPointer, rgaCompactTombstones, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaInsertAfterChecked, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stableJsonValueKey, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchAsActor, tryApplyPatchInPlace, tryDeserializeDoc, tryDeserializeState, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, validateRgaSeq, versionVectorCovers, vvHasDot, vvMerge };
139
+ export { type AbortSignalLike, ActorId, ApplyError, type ApplyPatchAsActorOptions, type ApplyPatchAsActorResult, ApplyPatchInPlaceOptions, ApplyPatchOptions, type ApplyResult, type Clock, ClockValidationError, type CompactDocTombstonesResult, type CompactStateTombstonesResult, type CompilePatchOptions, CrdtState, CreateStateOptions, DeserializeError, DeserializeErrorReason, type DeserializeFailure, type DeserializeOptions, DiffOptions, type Doc, type Dot, type ElemId, ForkStateOptions, HEAD, type IntentOp, JsonPatch, JsonPatchOp, type JsonPatchToCrdtOptions, JsonPrimitive, JsonValidationMode, JsonValue, JsonValueValidationError, type LwwReg, MAX_TRAVERSAL_DEPTH, type MergeDocOptions, MergeError, MergeStateOptions, type Node, NormalizedApplyPatchOptions, NormalizedCreateStateOptions, NormalizedDiffOptions, type ObjEntry, type ObjNode, OperationCancelledError, PatchCompileError, PatchError, PatchErrorReason, PatchSemantics, ROOT_KEY, type ResourceBudget, ResourceBudgetError, type ResourceBudgetExceededFailure, type ResourceBudgetKind, type RgaElem, type RgaSeq, type RgaValidationIssue, type RgaValidationResult, SafeApplyPatchOptions, SafeCreateStateOptions, SafeDiffOptions, type SerializedClock, type SerializedDoc, type SerializedNode, type SerializedRgaElem, SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchAsActorResult, TryApplyPatchInPlaceResult, TryApplyPatchResult, type TryDeserializeDocResult, TryDeserializeStateResult, type TryMergeDocResult, TryMergeStateResult, type UnrelatedArraysStrategy, ValidatePatchResult, type ValidateSerializedDocResult, type ValidateSerializedStateResult, type VersionVector, applyIntentsToCrdt, applyNormalizedPatch, applyPatch, applyPatchAsActor, applyPatchInPlace, applySafePatch, cloneClock, cloneDoc, compactDocTombstones, compactStateTombstones, compareDot, compileJsonPatchToIntent, crdtNodesToJsonPatch, crdtToFullReplace, crdtToJsonPatch, createClock, createNormalizedState, createSafeState, createState, deserializeDoc, deserializeState, diffJsonPatch, diffNormalizedJsonPatch, diffSafeJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, intersectVersionVectors, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, mergeVersionVectors, newObj, newReg, newSeq, nextDotForActor, objCompactTombstones, objRemove, objSet, observeDot, observedVersionVector, parseJsonPointer, rgaCompactTombstones, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaInsertAfterChecked, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stableJsonValueKey, strictRfc6902PatchOptions, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchAsActor, tryApplyPatchInPlace, tryDeserializeDoc, tryDeserializeState, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, validateRgaSeq, validateSerializedDoc, validateSerializedState, versionVectorCovers, vvHasDot, vvMerge, withLegacyMissingArrayParents, withStrictRfc6902Parents };
@@ -1,4 +1,4 @@
1
- import { $ as Clock, A as cloneClock, At as SerializedClock, B as forkState, Bt as TryDeserializeDocResult, C as diffJsonPatch, Ct as ObjEntry, D as stableJsonValueKey, Dt as ROOT_KEY, E as parseJsonPointer, Et as PatchSemantics, F as PatchError, Ft as TombstoneCompactionOptions, G as validateJsonPatch, Gt as VersionVector, H as tryApplyPatch, Ht as TryMergeDocResult, I as applyPatch, It as TombstoneCompactionStats, J as ApplyPatchAsActorOptions, K as ActorId, L as applyPatchAsActor, Lt as TryApplyPatchAsActorResult, M as nextDotForActor, Mt as SerializedNode, N as observeDot, Nt as SerializedRgaElem, O as stringifyJsonPointer, Ot as RgaElem, P as JsonValueValidationError, Pt as SerializedState, Q as ApplyResult, R as applyPatchInPlace, Rt as TryApplyPatchInPlaceResult, S as compileJsonPatchToIntent, St as Node, T as jsonEquals, Tt as PatchErrorReason, U as tryApplyPatchAsActor, Ut as TryMergeStateResult, V as toJson, Vt as TryDeserializeStateResult, W as tryApplyPatchInPlace, Wt as ValidatePatchResult, X as ApplyPatchInPlaceOptions, Y as ApplyPatchAsActorResult, Z as ApplyPatchOptions, _ as serializeDoc, _t as JsonValidationMode, a as intersectVersionVectors, at as DeserializeErrorReason, b as tryDeserializeState, bt as MergeDocOptions, c as versionVectorCovers, ct as Doc, d as mergeState, dt as ForkStateOptions, et as CompactDocTombstonesResult, f as tryMergeDoc, ft as IntentOp, g as deserializeState, gt as JsonPrimitive, h as deserializeDoc, ht as JsonPatchToCrdtOptions, i as compactStateTombstones, it as CreateStateOptions, j as createClock, jt as SerializedDoc, k as ClockValidationError, kt as RgaSeq, l as MergeError, lt as Dot, m as DeserializeError, mt as JsonPatchOp, n as TraversalDepthError, nt as CompilePatchOptions, o as mergeVersionVectors, ot as DeserializeFailure, p as tryMergeState, pt as JsonPatch, q as ApplyError, r as compactDocTombstones, rt as CrdtState, s as observedVersionVector, st as DiffOptions, t as MAX_TRAVERSAL_DEPTH, tt as CompactStateTombstonesResult, u as mergeDoc, ut as ElemId, v as serializeState, vt as JsonValue, w as getAtJson, wt as ObjNode, x as PatchCompileError, xt as MergeStateOptions, y as tryDeserializeDoc, yt as LwwReg, z as createState, zt as TryApplyPatchResult } from "./depth-D88VeWb-.js";
1
+ import { $ as NormalizedApplyPatchOptions, $t as RgaSeq, A as jsonEquals, At as Dot, B as observeDot, Bt as LwwReg, C as strictRfc6902PatchOptions, Ct as CrdtState, D as compileJsonPatchToIntent, Dt as DeserializeOptions, E as PatchCompileError, Et as DeserializeFailure, F as ResourceBudgetError, Ft as JsonPatchOp, G as applyPatchInPlace, Gt as ObjNode, H as PatchError, Ht as MergeStateOptions, I as ClockValidationError, It as JsonPatchToCrdtOptions, J as toJson, Jt as ROOT_KEY, K as createState, Kt as PatchErrorReason, L as cloneClock, Lt as JsonPrimitive, M as stableJsonValueKey, Mt as ForkStateOptions, N as stringifyJsonPointer, Nt as IntentOp, O as diffJsonPatch, Ot as DiffOptions, P as OperationCancelledError, Pt as JsonPatch, Q as validateJsonPatch, Qt as RgaElem, R as createClock, Rt as JsonValidationMode, S as validateSerializedState, St as CompilePatchOptions, T as withStrictRfc6902Parents, Tt as DeserializeErrorReason, U as applyPatch, Ut as Node, V as JsonValueValidationError, Vt as MergeDocOptions, W as applyPatchAsActor, Wt as ObjEntry, X as tryApplyPatchAsActor, Xt as ResourceBudgetExceededFailure, Y as tryApplyPatch, Yt as ResourceBudget, Z as tryApplyPatchInPlace, Zt as ResourceBudgetKind, _ as serializeDoc, _n as ValidateSerializedStateResult, _t as ApplyPatchOptions, a as intersectVersionVectors, an as TombstoneCompactionOptions, at as applyNormalizedPatch, b as tryDeserializeState, bt as CompactDocTombstonesResult, c as versionVectorCovers, cn as TryApplyPatchInPlaceResult, ct as createSafeState, d as mergeState, dn as TryDeserializeStateResult, dt as AbortSignalLike, en as SerializedClock, et as NormalizedCreateStateOptions, f as tryMergeDoc, fn as TryMergeDocResult, ft as ActorId, g as deserializeState, gn as ValidateSerializedDocResult, gt as ApplyPatchInPlaceOptions, h as deserializeDoc, hn as ValidatePatchResult, ht as ApplyPatchAsActorResult, i as compactStateTombstones, in as SerializedState, it as SafeDiffOptions, j as parseJsonPointer, jt as ElemId, k as getAtJson, kt as Doc, l as MergeError, ln as TryApplyPatchResult, lt as diffNormalizedJsonPatch, m as DeserializeError, mn as UnrelatedArraysStrategy, mt as ApplyPatchAsActorOptions, n as TraversalDepthError, nn as SerializedNode, nt as SafeApplyPatchOptions, o as mergeVersionVectors, on as TombstoneCompactionStats, ot as applySafePatch, p as tryMergeState, pn as TryMergeStateResult, pt as ApplyError, q as forkState, qt as PatchSemantics, r as compactDocTombstones, rn as SerializedRgaElem, rt as SafeCreateStateOptions, s as observedVersionVector, sn as TryApplyPatchAsActorResult, st as createNormalizedState, t as MAX_TRAVERSAL_DEPTH, tn as SerializedDoc, tt as NormalizedDiffOptions, u as mergeDoc, un as TryDeserializeDocResult, ut as diffSafeJsonPatch, v as serializeState, vn as VersionVector, vt as ApplyResult, w as withLegacyMissingArrayParents, wt as CreateStateOptions, x as validateSerializedDoc, xt as CompactStateTombstonesResult, y as tryDeserializeDoc, yt as Clock, z as nextDotForActor, zt as JsonValue } from "./depth-vwQdqCBN.js";
2
2
 
3
3
  //#region src/doc.d.ts
4
4
  /**
@@ -9,8 +9,15 @@ import { $ as Clock, A as cloneClock, At as SerializedClock, B as forkState, Bt
9
9
  */
10
10
  declare function docFromJson(value: JsonValue, nextDot: () => Dot): Doc;
11
11
  /**
12
- * Legacy: create a doc using a single dot with counter offsets for array children.
13
- * Prefer `docFromJson(value, nextDot)` to ensure unique dots per node.
12
+ * Legacy helper for tests and fixtures that seeds an entire document from one dot.
13
+ *
14
+ * It reuses that dot for object entries and synthesizes array child counters from the
15
+ * same seed, which can produce low-quality causal metadata and unrealistic sequence
16
+ * identities in production CRDT state.
17
+ *
18
+ * Prefer `docFromJson(value, nextDot)` so every node receives a fresh unique dot.
19
+ *
20
+ * @deprecated Use `docFromJson(value, nextDot)` for production documents.
14
21
  */
15
22
  declare function docFromJsonWithDot(value: JsonValue, dot: Dot): Doc;
16
23
  /** Deep-clone a CRDT document. The clone is fully independent of the original. */
@@ -25,7 +32,8 @@ declare function cloneDoc(doc: Doc): Doc;
25
32
  * @param evalTestAgainst - Whether `test` ops are evaluated against `"head"` or `"base"`.
26
33
  * @param bumpCounterAbove - Optional hook that can fast-forward the underlying counter before inserts.
27
34
  * @param options - Optional behavior toggles.
28
- * @param options.strictParents - When `true`, reject array inserts whose base parent path is missing.
35
+ * @param options.strictParents - Reject array inserts whose base parent path is missing.
36
+ * Defaults to `true`; pass `false` only for legacy missing-parent array auto-creation.
29
37
  * @returns `{ ok: true }` on success, or `{ ok: false, code: 409, message }` on conflict.
30
38
  */
31
39
  declare function applyIntentsToCrdt(base: Doc, head: Doc, intents: IntentOp[], newDot: () => Dot, evalTestAgainst?: "head" | "base", bumpCounterAbove?: (ctr: number) => void, options?: {
@@ -128,4 +136,4 @@ declare function rgaCompactTombstones(seq: RgaSeq, isStable: (dot: Dot) => boole
128
136
  declare function rgaIdAtIndex(seq: RgaSeq, index: number): ElemId | undefined;
129
137
  declare function rgaPrevForInsertAtIndex(seq: RgaSeq, index: number): ElemId;
130
138
  //#endregion
131
- export { ActorId, ApplyError, type ApplyPatchAsActorOptions, type ApplyPatchAsActorResult, ApplyPatchInPlaceOptions, ApplyPatchOptions, type ApplyResult, type Clock, ClockValidationError, type CompactDocTombstonesResult, type CompactStateTombstonesResult, type CompilePatchOptions, CrdtState, CreateStateOptions, DeserializeError, DeserializeErrorReason, type DeserializeFailure, DiffOptions, type Doc, type Dot, type ElemId, ForkStateOptions, HEAD, type IntentOp, JsonPatch, JsonPatchOp, type JsonPatchToCrdtOptions, JsonPrimitive, JsonValidationMode, JsonValue, JsonValueValidationError, type LwwReg, MAX_TRAVERSAL_DEPTH, type MergeDocOptions, MergeError, MergeStateOptions, type Node, type ObjEntry, type ObjNode, PatchCompileError, PatchError, PatchErrorReason, PatchSemantics, ROOT_KEY, type RgaElem, type RgaSeq, type RgaValidationIssue, type RgaValidationResult, type SerializedClock, type SerializedDoc, type SerializedNode, type SerializedRgaElem, SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchAsActorResult, TryApplyPatchInPlaceResult, TryApplyPatchResult, type TryDeserializeDocResult, TryDeserializeStateResult, type TryMergeDocResult, TryMergeStateResult, ValidatePatchResult, type VersionVector, applyIntentsToCrdt, applyPatch, applyPatchAsActor, applyPatchInPlace, cloneClock, cloneDoc, compactDocTombstones, compactStateTombstones, compareDot, compileJsonPatchToIntent, crdtNodesToJsonPatch, crdtToFullReplace, crdtToJsonPatch, createClock, createState, deserializeDoc, deserializeState, diffJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, intersectVersionVectors, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, mergeVersionVectors, newObj, newReg, newSeq, nextDotForActor, objCompactTombstones, objRemove, objSet, observeDot, observedVersionVector, parseJsonPointer, rgaCompactTombstones, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaInsertAfterChecked, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stableJsonValueKey, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchAsActor, tryApplyPatchInPlace, tryDeserializeDoc, tryDeserializeState, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, validateRgaSeq, versionVectorCovers, vvHasDot, vvMerge };
139
+ export { type AbortSignalLike, ActorId, ApplyError, type ApplyPatchAsActorOptions, type ApplyPatchAsActorResult, ApplyPatchInPlaceOptions, ApplyPatchOptions, type ApplyResult, type Clock, ClockValidationError, type CompactDocTombstonesResult, type CompactStateTombstonesResult, type CompilePatchOptions, CrdtState, CreateStateOptions, DeserializeError, DeserializeErrorReason, type DeserializeFailure, type DeserializeOptions, DiffOptions, type Doc, type Dot, type ElemId, ForkStateOptions, HEAD, type IntentOp, JsonPatch, JsonPatchOp, type JsonPatchToCrdtOptions, JsonPrimitive, JsonValidationMode, JsonValue, JsonValueValidationError, type LwwReg, MAX_TRAVERSAL_DEPTH, type MergeDocOptions, MergeError, MergeStateOptions, type Node, NormalizedApplyPatchOptions, NormalizedCreateStateOptions, NormalizedDiffOptions, type ObjEntry, type ObjNode, OperationCancelledError, PatchCompileError, PatchError, PatchErrorReason, PatchSemantics, ROOT_KEY, type ResourceBudget, ResourceBudgetError, type ResourceBudgetExceededFailure, type ResourceBudgetKind, type RgaElem, type RgaSeq, type RgaValidationIssue, type RgaValidationResult, SafeApplyPatchOptions, SafeCreateStateOptions, SafeDiffOptions, type SerializedClock, type SerializedDoc, type SerializedNode, type SerializedRgaElem, SerializedState, type TombstoneCompactionOptions, type TombstoneCompactionStats, TraversalDepthError, type TryApplyPatchAsActorResult, TryApplyPatchInPlaceResult, TryApplyPatchResult, type TryDeserializeDocResult, TryDeserializeStateResult, type TryMergeDocResult, TryMergeStateResult, type UnrelatedArraysStrategy, ValidatePatchResult, type ValidateSerializedDocResult, type ValidateSerializedStateResult, type VersionVector, applyIntentsToCrdt, applyNormalizedPatch, applyPatch, applyPatchAsActor, applyPatchInPlace, applySafePatch, cloneClock, cloneDoc, compactDocTombstones, compactStateTombstones, compareDot, compileJsonPatchToIntent, crdtNodesToJsonPatch, crdtToFullReplace, crdtToJsonPatch, createClock, createNormalizedState, createSafeState, createState, deserializeDoc, deserializeState, diffJsonPatch, diffNormalizedJsonPatch, diffSafeJsonPatch, docFromJson, docFromJsonWithDot, dotToElemId, forkState, getAtJson, intersectVersionVectors, jsonEquals, jsonPatchToCrdt, jsonPatchToCrdtSafe, lwwSet, materialize, mergeDoc, mergeState, mergeVersionVectors, newObj, newReg, newSeq, nextDotForActor, objCompactTombstones, objRemove, objSet, observeDot, observedVersionVector, parseJsonPointer, rgaCompactTombstones, rgaDelete, rgaIdAtIndex, rgaInsertAfter, rgaInsertAfterChecked, rgaLinearizeIds, rgaPrevForInsertAtIndex, serializeDoc, serializeState, stableJsonValueKey, strictRfc6902PatchOptions, stringifyJsonPointer, toJson, tryApplyPatch, tryApplyPatchAsActor, tryApplyPatchInPlace, tryDeserializeDoc, tryDeserializeState, tryJsonPatchToCrdt, tryMergeDoc, tryMergeState, validateJsonPatch, validateRgaSeq, validateSerializedDoc, validateSerializedState, versionVectorCovers, vvHasDot, vvMerge, withLegacyMissingArrayParents, withStrictRfc6902Parents };