@openlfcp/shared-objects 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,159 +0,0 @@
1
- import { type DataUnitId, type PrincipalId, type ResourceId } from "@openlfcp/core";
2
- import { type CheckedChange } from "./automerge-bytes.js";
3
- import { type ObjectChange, type ReplicaOptions, SharedObjectsReplica } from "./replica.js";
4
- /**
5
- * The Shared Objects Data Profile handler (LFCP-033): what a profile-
6
- * agnostic Data Unit applier (@openlfcp/client DataUnitApplier) calls once
7
- * LFCP has accepted a unit. It matches the client's DataProfileHandler
8
- * structurally; this package depends on neither client nor wire.
9
- *
10
- * - decode: the §11 plaintext is one checked Automerge change, written by
11
- * the §8 actor of the unit's signing Principal (§8, §11, SO-SEC1);
12
- * - apply: the change merges into the replica, or waits in a buffer until
13
- * the changes it depends on arrive in other units (profile-pending), and
14
- * every buffered change it unblocks merges with it;
15
- * - one object becoming profile-invalid is a diagnostic, never a refusal:
16
- * the other objects stay usable (§77);
17
- * - exclude (§14.1, G-EP7): rebuilds the replica without given units.
18
- */
19
- /** An accepted unit as the applier passes it (structurally the client's ProfileUnit). */
20
- export interface SharedObjectsUnit {
21
- readonly unitId: DataUnitId;
22
- }
23
- export interface SharedObjectsDiagnostic {
24
- readonly objectId?: string;
25
- readonly code: string;
26
- readonly diagnostic?: string;
27
- readonly pointer?: string;
28
- readonly message: string;
29
- }
30
- export interface SharedObjectsApplyResult {
31
- readonly merged: readonly DataUnitId[];
32
- readonly objects: readonly string[];
33
- readonly diagnostics: readonly SharedObjectsDiagnostic[];
34
- readonly pending?: string;
35
- }
36
- /** The outcome of applyBatch: per unit merged, pending or rejected, and the objects once. */
37
- export interface SharedObjectsBatchResult {
38
- /** Units merged now: the batch's and buffered ones it released. */
39
- readonly merged: readonly DataUnitId[];
40
- /** Units buffered for Automerge dependencies (the batch's and earlier ones still waiting). */
41
- readonly pending: readonly DataUnitId[];
42
- /** Units whose change was refused (ACTOR_EQUIVOCATION, INVALID_AUTOMERGE_BYTES, …). */
43
- readonly rejected: readonly {
44
- readonly unitId: DataUnitId;
45
- readonly code: string;
46
- readonly message: string;
47
- }[];
48
- readonly objects: readonly string[];
49
- readonly diagnostics: readonly SharedObjectsDiagnostic[];
50
- }
51
- export interface SharedObjectsExcludeResult {
52
- readonly objects: readonly string[];
53
- readonly pending: readonly DataUnitId[];
54
- }
55
- /** A persisted handler state (structurally the storage ProfileCheckpoint). */
56
- export interface SharedObjectsCheckpoint {
57
- readonly resourceId: ResourceId;
58
- readonly dataProfile: string;
59
- readonly state: Uint8Array;
60
- readonly actorSeq: number;
61
- readonly units: readonly {
62
- readonly unitId: DataUnitId;
63
- readonly ref: string;
64
- }[];
65
- }
66
- /** The §13 Snapshot codec (structurally the wire DataProfileCodec): plaintext ↔ full save. */
67
- export interface SharedObjectsSnapshotCodec {
68
- readonly dataProfile: string;
69
- encode(save: Uint8Array): Uint8Array;
70
- decode(plaintext: Uint8Array): Uint8Array;
71
- }
72
- /** The §11 codec of one unit (structurally the wire DataProfileCodec). */
73
- export interface SharedObjectsCodec {
74
- readonly dataProfile: string;
75
- encode(change: CheckedChange): Uint8Array;
76
- decode(plaintext: Uint8Array): CheckedChange;
77
- }
78
- export declare class SharedObjectsDataProfile {
79
- #private;
80
- readonly dataProfile = "org.openlfcp.shared-objects.v1";
81
- constructor(replica: SharedObjectsReplica);
82
- /**
83
- * The local state to persist (structurally the storage ProfileCheckpoint,
84
- * LFCP-034/035): the Automerge full save, this actor's sequence (the §9
85
- * minSeq on restore) and which unit carried which merged change (for a
86
- * G-EP7 rebuild). Units buffered for Automerge dependencies are not in it:
87
- * they stay "profile-pending" in storage and are offered again on restore.
88
- */
89
- checkpoint(): SharedObjectsCheckpoint;
90
- /**
91
- * The handler of a persisted checkpoint. The replica refuses local writes
92
- * if its actor is behind the checkpoint's sequence (§9).
93
- */
94
- static restore(checkpoint: SharedObjectsCheckpoint, options: Pick<ReplicaOptions, "resource" | "principal">): SharedObjectsDataProfile;
95
- /** The current replica (a G-EP7 rebuild replaces it). */
96
- get replica(): SharedObjectsReplica;
97
- /** §98, §100: object change notifications for remote merges and rebuilds. */
98
- onObjectChanged(listener: (change: ObjectChange) => void): () => void;
99
- /**
100
- * Records which change one of this client's OWN units carries (the unit
101
- * was created from a local change, so it is merged already). A later
102
- * G-EP7 exclusion of that unit then rebuilds the replica without it, and
103
- * the checkpoint keeps the reference. Use it as createQueuedDataUnit's
104
- * onCreated.
105
- */
106
- recordLocal(unitId: DataUnitId, change: CheckedChange): void;
107
- /**
108
- * The §13 Snapshot codec (structurally the wire DataProfileCodec): an
109
- * Automerge full save framed as [1, save]; decoding requires a document
110
- * chunk. For receiveSnapshot and createSnapshot.
111
- */
112
- snapshotCodec(): SharedObjectsSnapshotCodec;
113
- /** The state to publish as a Snapshot: the replica's full save. */
114
- snapshotState(): Uint8Array;
115
- /**
116
- * Loads a received Snapshot's full save (§13, §66 step 3): the replica
117
- * becomes the save merged with everything it held, and buffered units
118
- * whose dependencies the Snapshot brings are merged. Returns the objects
119
- * that changed and the units merged from the buffer.
120
- */
121
- loadSnapshot(save: Uint8Array): {
122
- readonly objects: readonly string[];
123
- readonly merged: readonly DataUnitId[];
124
- };
125
- /**
126
- * Forgets the whole state (an empty replica that keeps the §9 sequence,
127
- * no merged or buffered units), so it can be rebuilt from accepted units
128
- * only (SNAP-EP: Snapshot-derived state dropped). Notifies the changes.
129
- */
130
- reset(): void;
131
- /** Whether this handler holds the unit's change (merged, recorded or buffered). */
132
- has(unitId: DataUnitId): boolean;
133
- /** The units waiting for Automerge dependencies. */
134
- pendingUnits(): DataUnitId[];
135
- codecFor(unit: {
136
- readonly resourceId: ResourceId;
137
- readonly actor: PrincipalId;
138
- }): SharedObjectsCodec;
139
- apply(unit: SharedObjectsUnit, change: CheckedChange): SharedObjectsApplyResult;
140
- /**
141
- * Applies many accepted units at once (catch-up, store replay, a
142
- * Snapshot's remainder): their changes and every buffered one go to the
143
- * replica in one receiveChanges call, which hands Automerge one batch
144
- * (§14.1 admission per change; one change per call is quadratic). A
145
- * refused change rejects only its unit; units missing a dependency are
146
- * buffered. Diagnostics are computed once, for the objects that changed.
147
- */
148
- applyBatch(units: readonly {
149
- readonly unit: SharedObjectsUnit;
150
- readonly value: CheckedChange;
151
- }[]): SharedObjectsBatchResult;
152
- /**
153
- * §14.1 (G-EP7): the state without `unitIds`, rebuilt from the
154
- * remaining changes. Merged units whose changes build on an excluded one
155
- * go back to the buffer and are reported as pending.
156
- */
157
- exclude(unitIds: readonly DataUnitId[]): SharedObjectsExcludeResult;
158
- }
159
- //# sourceMappingURL=data-profile.d.ts.map
@@ -1,311 +0,0 @@
1
- import { LfcpError, toHex, } from "@openlfcp/core";
2
- import { frameChange, frameSnapshot, unframeChange, unframeSnapshot, } from "./automerge-bytes.js";
3
- import { SharedObjectsReplica } from "./replica.js";
4
- import { ProfileInvalidError } from "./validate.js";
5
- import { deriveActorId, PROFILE_ID } from "./values.js";
6
- export class SharedObjectsDataProfile {
7
- dataProfile = PROFILE_ID;
8
- #replica;
9
- /** Merged units: unit ID hex → change hash. */
10
- #merged = new Map();
11
- /** LFCP-accepted units waiting for Automerge dependencies, by unit ID hex. */
12
- #pending = new Map();
13
- #listeners = new Set();
14
- constructor(replica) {
15
- this.#replica = replica;
16
- }
17
- /**
18
- * The local state to persist (structurally the storage ProfileCheckpoint,
19
- * LFCP-034/035): the Automerge full save, this actor's sequence (the §9
20
- * minSeq on restore) and which unit carried which merged change (for a
21
- * G-EP7 rebuild). Units buffered for Automerge dependencies are not in it:
22
- * they stay "profile-pending" in storage and are offered again on restore.
23
- */
24
- checkpoint() {
25
- return Object.freeze({
26
- resourceId: this.#replica.resource,
27
- dataProfile: PROFILE_ID,
28
- state: this.#replica.save(),
29
- actorSeq: this.#replica.actorSeq,
30
- units: Object.freeze([...this.#merged.values()]
31
- .map((m) => Object.freeze({ unitId: m.unitId, ref: m.hash }))
32
- .sort((a, b) => (toHex(a.unitId) < toHex(b.unitId) ? -1 : 1))),
33
- });
34
- }
35
- /**
36
- * The handler of a persisted checkpoint. The replica refuses local writes
37
- * if its actor is behind the checkpoint's sequence (§9).
38
- */
39
- static restore(checkpoint, options) {
40
- if (checkpoint.dataProfile !== PROFILE_ID)
41
- throw new LfcpError("DATA_PROFILE_MISMATCH", `a ${checkpoint.dataProfile} checkpoint is not ${PROFILE_ID}`);
42
- // This device's own persisted state: not held to the Snapshot limits (§13.1).
43
- const replica = SharedObjectsReplica.fromSave(checkpoint.state, { ...options, minSeq: checkpoint.actorSeq }, "local-state");
44
- const profile = new SharedObjectsDataProfile(replica);
45
- for (const u of checkpoint.units) {
46
- if (!replica.hasChange(u.ref))
47
- throw new LfcpError("PROFILE_INVALID", `the checkpoint names change ${u.ref}, which its state lacks`);
48
- profile.#merged.set(toHex(u.unitId), { unitId: u.unitId, hash: u.ref });
49
- }
50
- return profile;
51
- }
52
- /** The current replica (a G-EP7 rebuild replaces it). */
53
- get replica() {
54
- return this.#replica;
55
- }
56
- /** §98, §100: object change notifications for remote merges and rebuilds. */
57
- onObjectChanged(listener) {
58
- this.#listeners.add(listener);
59
- return () => this.#listeners.delete(listener);
60
- }
61
- #emit(changes) {
62
- for (const c of changes)
63
- for (const l of this.#listeners)
64
- l(c);
65
- }
66
- /**
67
- * Records which change one of this client's OWN units carries (the unit
68
- * was created from a local change, so it is merged already). A later
69
- * G-EP7 exclusion of that unit then rebuilds the replica without it, and
70
- * the checkpoint keeps the reference. Use it as createQueuedDataUnit's
71
- * onCreated.
72
- */
73
- recordLocal(unitId, change) {
74
- if (!this.#replica.hasChange(change.hash))
75
- throw new LfcpError("PROFILE_INVALID", "the change is not in this replica; record only local changes");
76
- this.#merged.set(toHex(unitId), { unitId, hash: change.hash });
77
- }
78
- /**
79
- * The §13 Snapshot codec (structurally the wire DataProfileCodec): an
80
- * Automerge full save framed as [1, save]; decoding requires a document
81
- * chunk. For receiveSnapshot and createSnapshot.
82
- */
83
- snapshotCodec() {
84
- return {
85
- dataProfile: PROFILE_ID,
86
- encode: (save) => frameSnapshot(save),
87
- decode: (plaintext) => unframeSnapshot(plaintext),
88
- };
89
- }
90
- /** The state to publish as a Snapshot: the replica's full save. */
91
- snapshotState() {
92
- return this.#replica.save();
93
- }
94
- /**
95
- * Loads a received Snapshot's full save (§13, §66 step 3): the replica
96
- * becomes the save merged with everything it held, and buffered units
97
- * whose dependencies the Snapshot brings are merged. Returns the objects
98
- * that changed and the units merged from the buffer.
99
- */
100
- loadSnapshot(save) {
101
- const before = this.#replica;
102
- const { replica } = before.mergeSave(save);
103
- this.#replica = replica;
104
- const merged = [...this.#applyBatch([]).result.merged];
105
- const changes = rebuildChanges(before, replica).map((c) => Object.freeze({ ...c, origin: "remote" }));
106
- this.#emit(changes);
107
- return Object.freeze({ objects: changes.map((c) => c.objectId), merged });
108
- }
109
- /**
110
- * Forgets the whole state (an empty replica that keeps the §9 sequence,
111
- * no merged or buffered units), so it can be rebuilt from accepted units
112
- * only (SNAP-EP: Snapshot-derived state dropped). Notifies the changes.
113
- */
114
- reset() {
115
- const before = this.#replica;
116
- this.#replica = before.emptied();
117
- this.#merged.clear();
118
- this.#pending.clear();
119
- this.#emit(rebuildChanges(before, this.#replica));
120
- }
121
- /** Whether this handler holds the unit's change (merged, recorded or buffered). */
122
- has(unitId) {
123
- const key = toHex(unitId);
124
- return this.#merged.has(key) || this.#pending.has(key);
125
- }
126
- /** The units waiting for Automerge dependencies. */
127
- pendingUnits() {
128
- return [...this.#pending.values()].map((b) => b.unitId);
129
- }
130
- codecFor(unit) {
131
- const actor = toHex(deriveActorId(unit.resourceId, unit.actor));
132
- // §8, §11 (SO-SEC1): a unit carries only changes of its signer's §8
133
- // actor, so no Principal can write into another Principal's Automerge
134
- // history. Anything else is PROFILE_INVALID / CHANGE_ACTOR_MISMATCH.
135
- const bound = (change) => {
136
- if (change.actor !== actor)
137
- throw new ProfileInvalidError("CHANGE_ACTOR_MISMATCH", `the change's Automerge actor ${change.actor} is not the §8 actor ${actor} of the unit's signer (§11, SO-SEC1)`);
138
- return change;
139
- };
140
- return {
141
- dataProfile: PROFILE_ID,
142
- encode: (change) => frameChange(bound(change).bytes),
143
- decode: (plaintext) => bound(unframeChange(plaintext)),
144
- };
145
- }
146
- apply(unit, change) {
147
- const key = toHex(unit.unitId);
148
- const r = this.#applyBatch([{ unit, value: change }]);
149
- const own = r.refused.get(key);
150
- if (own !== undefined)
151
- throw own;
152
- const self = r.result.merged.some((id) => toHex(id) === key);
153
- if (!self)
154
- return Object.freeze({
155
- merged: r.result.merged,
156
- objects: r.result.objects,
157
- diagnostics: r.result.diagnostics,
158
- pending: `waiting for Automerge changes ${r.missing.join(", ")}`,
159
- });
160
- // The unit first, then the buffered ones it released.
161
- return Object.freeze({
162
- merged: [unit.unitId, ...r.result.merged.filter((id) => toHex(id) !== key)],
163
- objects: r.result.objects,
164
- diagnostics: r.result.diagnostics,
165
- });
166
- }
167
- /**
168
- * Applies many accepted units at once (catch-up, store replay, a
169
- * Snapshot's remainder): their changes and every buffered one go to the
170
- * replica in one receiveChanges call, which hands Automerge one batch
171
- * (§14.1 admission per change; one change per call is quadratic). A
172
- * refused change rejects only its unit; units missing a dependency are
173
- * buffered. Diagnostics are computed once, for the objects that changed.
174
- */
175
- applyBatch(units) {
176
- return this.#applyBatch(units).result;
177
- }
178
- #applyBatch(units) {
179
- const byHash = new Map();
180
- const offer = (unitId, change) => byHash.set(change.hash, [...(byHash.get(change.hash) ?? []), unitId]);
181
- for (const b of this.#pending.values())
182
- offer(b.unitId, b.change);
183
- for (const { unit, value } of units) {
184
- this.#pending.set(toHex(unit.unitId), { unitId: unit.unitId, change: value });
185
- offer(unit.unitId, value);
186
- }
187
- const r = this.#replica.receiveChanges([...this.#pending.values()].map((b) => b.change));
188
- const merged = [];
189
- for (const c of [...r.applied, ...r.duplicates])
190
- for (const unitId of byHash.get(c.hash) ?? []) {
191
- this.#pending.delete(toHex(unitId));
192
- this.#merged.set(toHex(unitId), { unitId, hash: c.hash });
193
- merged.push(unitId);
194
- }
195
- const rejected = [];
196
- const refused = new Map();
197
- for (const { change, error } of r.refused)
198
- for (const unitId of byHash.get(change.hash) ?? []) {
199
- this.#pending.delete(toHex(unitId));
200
- rejected.push({ unitId, code: error.code, message: error.message });
201
- refused.set(toHex(unitId), error);
202
- }
203
- this.#emit(r.objects);
204
- const objects = [...new Set(r.objects.map((c) => c.objectId))].sort();
205
- const missing = [
206
- ...new Set(r.waiting.flatMap((c) => c.deps.filter((d) => !this.#replica.hasChange(d)))),
207
- ];
208
- return {
209
- result: Object.freeze({
210
- merged: Object.freeze(merged),
211
- pending: Object.freeze([...this.#pending.values()].map((b) => b.unitId)),
212
- rejected: Object.freeze(rejected),
213
- objects: Object.freeze(objects),
214
- diagnostics: Object.freeze(this.#diagnostics(objects)),
215
- }),
216
- refused,
217
- missing,
218
- };
219
- }
220
- /** §74.1 problems and §21 collisions of the given objects (§77: the rest are unaffected). */
221
- #diagnostics(objects) {
222
- if (objects.length === 0)
223
- return [];
224
- const validation = this.#replica.validate();
225
- const out = [];
226
- for (const id of objects) {
227
- for (const p of validation.objects.get(id) ?? [])
228
- out.push({
229
- objectId: id,
230
- code: p.code,
231
- diagnostic: p.diagnostic,
232
- pointer: p.pointer,
233
- message: p.message,
234
- });
235
- if (validation.collisions.includes(id))
236
- out.push({
237
- objectId: id,
238
- code: "OBJECT_ID_COLLISION",
239
- message: `${id}: concurrent objects share this Object ID (§21)`,
240
- });
241
- }
242
- return out;
243
- }
244
- /**
245
- * §14.1 (G-EP7): the state without `unitIds`, rebuilt from the
246
- * remaining changes. Merged units whose changes build on an excluded one
247
- * go back to the buffer and are reported as pending.
248
- */
249
- exclude(unitIds) {
250
- const hashes = [];
251
- for (const id of unitIds) {
252
- const key = toHex(id);
253
- this.#pending.delete(key);
254
- const m = this.#merged.get(key);
255
- if (m !== undefined) {
256
- hashes.push(m.hash);
257
- this.#merged.delete(key);
258
- }
259
- }
260
- if (hashes.length === 0)
261
- return Object.freeze({ objects: [], pending: [] });
262
- const before = this.#replica;
263
- const { replica, unapplied } = before.rebuildWithout(hashes);
264
- this.#replica = replica;
265
- const pending = [];
266
- for (const change of unapplied) {
267
- const entry = [...this.#merged].find(([, m]) => m.hash === change.hash);
268
- if (entry === undefined)
269
- continue; // a local change: kept out with its dependency
270
- this.#merged.delete(entry[0]);
271
- this.#pending.set(entry[0], { unitId: entry[1].unitId, change });
272
- pending.push(entry[1].unitId);
273
- }
274
- const changes = rebuildChanges(before, replica);
275
- this.#emit(changes);
276
- return Object.freeze({ objects: changes.map((c) => c.objectId), pending });
277
- }
278
- }
279
- /** §100 notifications for every object that differs between two replicas of one Resource. */
280
- function rebuildChanges(before, after) {
281
- const ids = [...new Set([...before.objectIds(), ...after.objectIds()])].sort();
282
- const beforeConflicts = before.conflicts();
283
- const afterConflicts = after.conflicts();
284
- const out = [];
285
- for (const id of ids) {
286
- const was = (before.getObject(id) ?? {});
287
- const now = (after.getObject(id) ?? {});
288
- const fields = [...new Set([...Object.keys(was), ...Object.keys(now)])]
289
- .filter((f) => JSON.stringify(was[f]) !== JSON.stringify(now[f]))
290
- .sort();
291
- const wasC = Object.keys(beforeConflicts[id] ?? {});
292
- const nowC = Object.keys(afterConflicts[id] ?? {});
293
- if (fields.length === 0 && JSON.stringify(wasC) === JSON.stringify(nowC))
294
- continue;
295
- out.push(Object.freeze({
296
- resource: after.resource,
297
- objectId: id,
298
- objectType: typeof now.type === "string"
299
- ? now.type
300
- : typeof was.type === "string"
301
- ? was.type
302
- : undefined,
303
- fields: Object.freeze(fields),
304
- conflictsAppeared: Object.freeze(nowC.filter((f) => !wasC.includes(f)).sort()),
305
- conflictsDisappeared: Object.freeze(wasC.filter((f) => !nowC.includes(f)).sort()),
306
- origin: "rebuild",
307
- }));
308
- }
309
- return out;
310
- }
311
- //# sourceMappingURL=data-profile.js.map
package/dist/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * SHARED-OBJECTS-PROFILE-01 (org.openlfcp.shared-objects.v1): the Shared
3
- * Task model and profile validation over logical state (LFCP-030), and its
4
- * Automerge binding (LFCP-031).
5
- */
6
- export declare const PACKAGE = "@openlfcp/shared-objects";
7
- export { type CheckedChange, checkChange, checkSaveHeader, frameChange, frameSnapshot, unframeChange, unframeSnapshot, } from "./automerge-bytes.js";
8
- export { CHANGE_LIMITS, type ChunkExpansion, checkChangeExpansion, checkSnapshotExpansion, MAX_DOCUMENT_DEPTH, SNAPSHOT_LIMITS_FLOOR, type SnapshotLimits, } from "./chunk-limits.js";
9
- export { type SharedObjectsApplyResult, type SharedObjectsBatchResult, type SharedObjectsCheckpoint, type SharedObjectsCodec, SharedObjectsDataProfile, type SharedObjectsDiagnostic, type SharedObjectsExcludeResult, type SharedObjectsSnapshotCodec, type SharedObjectsUnit, } from "./data-profile.js";
10
- export { type BatchReceiveResult, type BuiltReplica, type LocalChange, type ObjectChange, ObjectIdCollisionError, type ObjectStatus, type ReceiveResult, type ReplicaIntent, type ReplicaOptions, type ReplicaValidation, type ResolveFieldConflict, resolveFieldConflict, SCALAR_FIELDS, type ScalarField, type ScalarView, SharedObjectsReplica, type TaskView, } from "./replica.js";
11
- export { addTag, assign, cancel, clearDue, clearScheduled, complete, createTask, deleteTask, type NewTask, type ParsedTask, ProfileError, parseTask, removeTag, reopen, restoreTask, setDue, setPriority, setScheduled, setStatus, setTitle, type Task, type TaskChange, type TaskIntent, type TaskPriority, type TaskStatus, taskToJson, unassign, } from "./task.js";
12
- export { DIAGNOSTIC_ORDER, firstPerField, isMap, type Json, objectProblems, type ProfileDiagnostic, ProfileInvalidError, type ProfileProblem, pointerToken, type RootValidation, validateRoot, validateTransition, } from "./validate.js";
13
- export { deriveActorId, FRAMING_VERSION, frameProfilePayload, isLocalDate, isNamespacedValue, isPrincipalRef, isReverseDomain, isUtcTimestamp, PROFILE_ID, type PrincipalRef, parsePrincipalRef, principalRef, unframeProfilePayload, } from "./values.js";
14
- export { initializeAutomerge, isAutomergeInitialized } from "./wasm.js";
15
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * SHARED-OBJECTS-PROFILE-01 (org.openlfcp.shared-objects.v1): the Shared
3
- * Task model and profile validation over logical state (LFCP-030), and its
4
- * Automerge binding (LFCP-031).
5
- */
6
- export const PACKAGE = "@openlfcp/shared-objects";
7
- export { checkChange, checkSaveHeader, frameChange, frameSnapshot, unframeChange, unframeSnapshot, } from "./automerge-bytes.js";
8
- export { CHANGE_LIMITS, checkChangeExpansion, checkSnapshotExpansion, MAX_DOCUMENT_DEPTH, SNAPSHOT_LIMITS_FLOOR, } from "./chunk-limits.js";
9
- export { SharedObjectsDataProfile, } from "./data-profile.js";
10
- export { ObjectIdCollisionError, resolveFieldConflict, SCALAR_FIELDS, SharedObjectsReplica, } from "./replica.js";
11
- export { addTag, assign, cancel, clearDue, clearScheduled, complete, createTask, deleteTask, ProfileError, parseTask, removeTag, reopen, restoreTask, setDue, setPriority, setScheduled, setStatus, setTitle, taskToJson, unassign, } from "./task.js";
12
- export { DIAGNOSTIC_ORDER, firstPerField, isMap, objectProblems, ProfileInvalidError, pointerToken, validateRoot, validateTransition, } from "./validate.js";
13
- export { deriveActorId, FRAMING_VERSION, frameProfilePayload, isLocalDate, isNamespacedValue, isPrincipalRef, isReverseDomain, isUtcTimestamp, PROFILE_ID, parsePrincipalRef, principalRef, unframeProfilePayload, } from "./values.js";
14
- export { initializeAutomerge, isAutomergeInitialized } from "./wasm.js";
15
- //# sourceMappingURL=index.js.map
@@ -1,12 +0,0 @@
1
- import { LfcpError } from "@openlfcp/core";
2
- import type { ProfileDiagnostic } from "./validate.js";
3
- /**
4
- * PROFILE_INVALID thrown for a rejected profile plaintext or value, with
5
- * its §74.1 diagnostic: CHANGE_ACTOR_MISMATCH (§8, §11) or
6
- * INVALID_AUTOMERGE_BYTES (§11, §13).
7
- */
8
- export declare class ProfileInvalidError extends LfcpError {
9
- readonly diagnostic: ProfileDiagnostic;
10
- constructor(diagnostic: ProfileDiagnostic, message: string);
11
- }
12
- //# sourceMappingURL=profile-invalid.d.ts.map
@@ -1,15 +0,0 @@
1
- import { LfcpError } from "@openlfcp/core";
2
- /**
3
- * PROFILE_INVALID thrown for a rejected profile plaintext or value, with
4
- * its §74.1 diagnostic: CHANGE_ACTOR_MISMATCH (§8, §11) or
5
- * INVALID_AUTOMERGE_BYTES (§11, §13).
6
- */
7
- export class ProfileInvalidError extends LfcpError {
8
- diagnostic;
9
- constructor(diagnostic, message) {
10
- super("PROFILE_INVALID", message);
11
- this.name = "ProfileInvalidError";
12
- this.diagnostic = diagnostic;
13
- }
14
- }
15
- //# sourceMappingURL=profile-invalid.js.map