@dxos/versioning 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/lib/browser/index.mjs +417 -0
  2. package/dist/lib/browser/index.mjs.map +7 -0
  3. package/dist/lib/browser/meta.json +1 -0
  4. package/dist/lib/node-esm/index.mjs +418 -0
  5. package/dist/lib/node-esm/index.mjs.map +7 -0
  6. package/dist/lib/node-esm/meta.json +1 -0
  7. package/dist/types/src/Branch.d.ts +3 -0
  8. package/dist/types/src/Branch.d.ts.map +1 -0
  9. package/dist/types/src/History.d.ts +3 -0
  10. package/dist/types/src/History.d.ts.map +1 -0
  11. package/dist/types/src/Version.d.ts +3 -0
  12. package/dist/types/src/Version.d.ts.map +1 -0
  13. package/dist/types/src/diff.d.ts +35 -0
  14. package/dist/types/src/diff.d.ts.map +1 -0
  15. package/dist/types/src/diff.test.d.ts +2 -0
  16. package/dist/types/src/diff.test.d.ts.map +1 -0
  17. package/dist/types/src/index.d.ts +5 -0
  18. package/dist/types/src/index.d.ts.map +1 -0
  19. package/dist/types/src/internal/index.d.ts +3 -0
  20. package/dist/types/src/internal/index.d.ts.map +1 -0
  21. package/dist/types/src/internal/model.d.ts +53 -0
  22. package/dist/types/src/internal/model.d.ts.map +1 -0
  23. package/dist/types/src/internal/types.d.ts +69 -0
  24. package/dist/types/src/internal/types.d.ts.map +1 -0
  25. package/dist/types/src/model.test.d.ts +2 -0
  26. package/dist/types/src/model.test.d.ts.map +1 -0
  27. package/dist/types/tsconfig.tsbuildinfo +1 -0
  28. package/package.json +43 -0
  29. package/src/Branch.ts +21 -0
  30. package/src/History.ts +8 -0
  31. package/src/Version.ts +14 -0
  32. package/src/diff.test.ts +195 -0
  33. package/src/diff.ts +225 -0
  34. package/src/index.ts +8 -0
  35. package/src/internal/index.ts +6 -0
  36. package/src/internal/model.ts +189 -0
  37. package/src/internal/types.ts +76 -0
  38. package/src/model.test.ts +182 -0
@@ -0,0 +1,418 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ var __defProp = Object.defineProperty;
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
7
+
8
+ // src/Branch.ts
9
+ var Branch_exports = {};
10
+ __export(Branch_exports, {
11
+ Branch: () => Branch,
12
+ Status: () => BranchStatus,
13
+ create: () => createBranch,
14
+ discard: () => discardBranch,
15
+ find: () => findBranch,
16
+ label: () => branchLabel,
17
+ make: () => makeBranch,
18
+ merge: () => mergeBranch
19
+ });
20
+
21
+ // src/internal/types.ts
22
+ import * as Schema from "effect/Schema";
23
+ import { Key, Ref } from "@dxos/echo";
24
+ import { Text } from "@dxos/schema";
25
+ var Version = Schema.mutable(Schema.Struct({
26
+ id: Schema.String,
27
+ name: Schema.String,
28
+ target: Ref.Ref(Text.Text),
29
+ heads: Schema.mutable(Schema.Array(Schema.String)),
30
+ createdAt: Schema.String,
31
+ creator: Schema.optional(Schema.String),
32
+ message: Schema.optional(Schema.String)
33
+ }));
34
+ var BranchStatus = Schema.Literal("active", "merged", "archived");
35
+ var Branch = Schema.mutable(Schema.Struct({
36
+ id: Schema.String,
37
+ name: Schema.String,
38
+ content: Ref.Ref(Text.Text),
39
+ parent: Ref.Ref(Text.Text),
40
+ anchor: Schema.mutable(Schema.Array(Schema.String)),
41
+ status: BranchStatus,
42
+ createdAt: Schema.String,
43
+ creator: Schema.optional(Schema.String),
44
+ mergedAt: Schema.optional(Schema.String)
45
+ }));
46
+ var History = Schema.mutable(Schema.Struct({
47
+ branches: Schema.mutable(Schema.Array(Branch)),
48
+ versions: Schema.mutable(Schema.Array(Version))
49
+ }));
50
+ var makeVersion = (props) => ({
51
+ id: Key.EntityId.random(),
52
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
53
+ ...props
54
+ });
55
+ var makeBranch = (props) => ({
56
+ id: Key.EntityId.random(),
57
+ status: "active",
58
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
59
+ ...props
60
+ });
61
+
62
+ // src/internal/model.ts
63
+ import { Text as EchoText, Obj, Ref as Ref2 } from "@dxos/echo";
64
+ import { checkoutVersion } from "@dxos/echo-client";
65
+ import { invariant } from "@dxos/invariant";
66
+ import { Text as Text2 } from "@dxos/schema";
67
+
68
+ // src/diff.ts
69
+ import { diffLines, diffWordsWithSpace } from "diff";
70
+ var diffSpans = (before, after) => {
71
+ const spans = [];
72
+ let offset = 0;
73
+ for (const change of diffWordsWithSpace(before, after)) {
74
+ const kind = change.added ? "insert" : change.removed ? "delete" : "equal";
75
+ const length = kind === "delete" ? 0 : change.value.length;
76
+ spans.push({
77
+ kind,
78
+ from: offset,
79
+ to: offset + length,
80
+ text: change.value
81
+ });
82
+ offset += length;
83
+ }
84
+ return spans;
85
+ };
86
+ var diffStats = (spans) => spans.reduce((stats, span) => {
87
+ if (span.kind === "insert") {
88
+ stats.insertions += span.text.length;
89
+ } else if (span.kind === "delete") {
90
+ stats.deletions += span.text.length;
91
+ }
92
+ return stats;
93
+ }, {
94
+ insertions: 0,
95
+ deletions: 0
96
+ });
97
+ var merge3 = ({ base, ours, theirs }) => {
98
+ if (ours === base) {
99
+ return {
100
+ text: theirs,
101
+ conflicts: 0
102
+ };
103
+ }
104
+ if (theirs === base || ours === theirs) {
105
+ return {
106
+ text: ours,
107
+ conflicts: 0
108
+ };
109
+ }
110
+ const baseLines = splitLines(base);
111
+ const oursHunks = lineHunks(baseLines, splitLines(ours));
112
+ const theirsHunks = lineHunks(baseLines, splitLines(theirs));
113
+ const out = [];
114
+ let conflicts = 0;
115
+ let baseIndex = 0;
116
+ let oursCursor = 0;
117
+ let theirsCursor = 0;
118
+ while (baseIndex < baseLines.length || oursCursor < oursHunks.length || theirsCursor < theirsHunks.length) {
119
+ const oursHunk = oursHunks[oursCursor];
120
+ const theirsHunk = theirsHunks[theirsCursor];
121
+ const nextOurs = oursHunk?.baseStart ?? Infinity;
122
+ const nextTheirs = theirsHunk?.baseStart ?? Infinity;
123
+ const next = Math.min(nextOurs, nextTheirs);
124
+ while (baseIndex < Math.min(next, baseLines.length)) {
125
+ out.push(baseLines[baseIndex]);
126
+ baseIndex += 1;
127
+ }
128
+ if (next === Infinity) {
129
+ break;
130
+ }
131
+ const oursActive = oursHunk !== void 0 && oursHunk.baseStart === next;
132
+ const theirsActive = theirsHunk !== void 0 && theirsHunk.baseStart === next;
133
+ const identical = oursActive && theirsActive && sameLines(oursHunk.lines, theirsHunk.lines) && oursHunk.baseLength === theirsHunk.baseLength;
134
+ const overlap = !identical && oursHunk !== void 0 && theirsHunk !== void 0 && (nextOurs === nextTheirs || oursActive && nextTheirs < hunkEnd(oursHunk) || theirsActive && nextOurs < hunkEnd(theirsHunk));
135
+ if (overlap) {
136
+ const oursRegion = [
137
+ oursHunk
138
+ ];
139
+ const theirsRegion = [
140
+ theirsHunk
141
+ ];
142
+ oursCursor += 1;
143
+ theirsCursor += 1;
144
+ let unionEnd = Math.max(hunkEnd(oursHunk), hunkEnd(theirsHunk));
145
+ let expanded = true;
146
+ while (expanded) {
147
+ expanded = false;
148
+ while (oursCursor < oursHunks.length && oursHunks[oursCursor].baseStart < unionEnd) {
149
+ const hunk = oursHunks[oursCursor];
150
+ oursRegion.push(hunk);
151
+ unionEnd = Math.max(unionEnd, hunkEnd(hunk));
152
+ oursCursor += 1;
153
+ expanded = true;
154
+ }
155
+ while (theirsCursor < theirsHunks.length && theirsHunks[theirsCursor].baseStart < unionEnd) {
156
+ const hunk = theirsHunks[theirsCursor];
157
+ theirsRegion.push(hunk);
158
+ unionEnd = Math.max(unionEnd, hunkEnd(hunk));
159
+ theirsCursor += 1;
160
+ expanded = true;
161
+ }
162
+ }
163
+ out.push("<<<<<<< branch", ...sideContent(baseLines, theirsRegion, next, unionEnd), "=======", ...sideContent(baseLines, oursRegion, next, unionEnd), ">>>>>>> current");
164
+ conflicts += 1;
165
+ baseIndex = unionEnd;
166
+ } else if (identical) {
167
+ out.push(...oursHunk.lines);
168
+ baseIndex = next + oursHunk.baseLength;
169
+ oursCursor += 1;
170
+ theirsCursor += 1;
171
+ } else if (oursActive) {
172
+ out.push(...oursHunk.lines);
173
+ baseIndex = next + oursHunk.baseLength;
174
+ oursCursor += 1;
175
+ } else if (theirsHunk !== void 0) {
176
+ out.push(...theirsHunk.lines);
177
+ baseIndex = next + theirsHunk.baseLength;
178
+ theirsCursor += 1;
179
+ }
180
+ }
181
+ return {
182
+ text: joinLines(out, [
183
+ base,
184
+ ours,
185
+ theirs
186
+ ]),
187
+ conflicts
188
+ };
189
+ };
190
+ var hunkEnd = (hunk) => hunk.baseStart + hunk.baseLength;
191
+ var sideContent = (baseLines, hunks, unionStart, unionEnd) => {
192
+ const out = [];
193
+ let position = unionStart;
194
+ for (const hunk of hunks) {
195
+ out.push(...baseLines.slice(position, hunk.baseStart), ...hunk.lines);
196
+ position = Math.max(position, hunkEnd(hunk));
197
+ }
198
+ out.push(...baseLines.slice(position, unionEnd));
199
+ return out;
200
+ };
201
+ var lineHunks = (baseLines, sideLines) => {
202
+ const hunks = [];
203
+ let baseIndex = 0;
204
+ let pending;
205
+ for (const change of diffLines(joinForDiff(baseLines), joinForDiff(sideLines))) {
206
+ const lines = chunkLines(change.value);
207
+ if (change.added) {
208
+ pending = pending ?? {
209
+ baseStart: baseIndex,
210
+ baseLength: 0,
211
+ lines: []
212
+ };
213
+ pending.lines.push(...lines);
214
+ } else if (change.removed) {
215
+ pending = pending ?? {
216
+ baseStart: baseIndex,
217
+ baseLength: 0,
218
+ lines: []
219
+ };
220
+ pending.baseLength += lines.length;
221
+ baseIndex += lines.length;
222
+ } else {
223
+ if (pending) {
224
+ hunks.push(pending);
225
+ pending = void 0;
226
+ }
227
+ baseIndex += lines.length;
228
+ }
229
+ }
230
+ if (pending) {
231
+ hunks.push(pending);
232
+ }
233
+ return hunks;
234
+ };
235
+ var sameLines = (a, b) => a.length === b.length && a.every((line, index) => line === b[index]);
236
+ var splitLines = (text) => text === "" ? [] : stripTrailingNewline(text).split("\n");
237
+ var chunkLines = (value) => stripTrailingNewline(value).split("\n");
238
+ var stripTrailingNewline = (text) => text.endsWith("\n") ? text.slice(0, -1) : text;
239
+ var joinForDiff = (lines) => lines.length === 0 ? "" : `${lines.join("\n")}
240
+ `;
241
+ var joinLines = (lines, inputs) => {
242
+ const text = lines.join("\n");
243
+ const nonEmpty = inputs.filter((input) => input.length > 0);
244
+ const trailing = nonEmpty.length > 0 && nonEmpty.every((input) => input.endsWith("\n"));
245
+ return trailing && text.length > 0 ? `${text}
246
+ ` : text;
247
+ };
248
+
249
+ // src/internal/model.ts
250
+ var __dxlog_file = "/Users/burdon/Code/dxos/dxos/.claude/worktrees/worktree-guidance-6d5eb0/packages/sdk/versioning/src/internal/model.ts";
251
+ var ensureHistory = (doc) => {
252
+ if (!doc.history) {
253
+ Obj.update(doc, (doc2) => {
254
+ doc2.history = {
255
+ branches: [],
256
+ versions: []
257
+ };
258
+ });
259
+ }
260
+ const history = doc.history;
261
+ invariant(history, "history not initialized", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 20, S: void 0, A: ["history", "'history not initialized'"] });
262
+ return history;
263
+ };
264
+ var getHeads = (text) => {
265
+ const version = Obj.version(text);
266
+ invariant(version.versioned && version.automergeHeads, "text is not versioned (not persisted?)", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 25, S: void 0, A: ["version.versioned && version.automergeHeads", "'text is not versioned (not persisted?)'"] });
267
+ return [
268
+ ...version.automergeHeads
269
+ ];
270
+ };
271
+ var contentAt = (text, heads) => {
272
+ const snapshot = checkoutVersion(text, [
273
+ ...heads
274
+ ]);
275
+ if (snapshot && typeof snapshot === "object" && "content" in snapshot) {
276
+ const { content } = snapshot;
277
+ return typeof content === "string" ? content : "";
278
+ }
279
+ return "";
280
+ };
281
+ var createCheckpoint = (doc, props) => {
282
+ const text = props.target;
283
+ const version = makeVersion({
284
+ name: props.name,
285
+ target: Ref2.make(text),
286
+ heads: getHeads(text),
287
+ ...props.message !== void 0 && {
288
+ message: props.message
289
+ },
290
+ ...props.creator !== void 0 && {
291
+ creator: props.creator
292
+ }
293
+ });
294
+ const history = ensureHistory(doc);
295
+ Obj.update(doc, () => {
296
+ history.versions.push(version);
297
+ });
298
+ const stored = history.versions.find(({ id }) => id === version.id);
299
+ invariant(stored, "checkpoint not stored", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 63, S: void 0, A: ["stored", "'checkpoint not stored'"] });
300
+ return stored;
301
+ };
302
+ var versionLabel = (version) => version.name || new Date(version.createdAt).toLocaleString();
303
+ var branchLabel = (branch) => branch.name || new Date(branch.createdAt).toLocaleString();
304
+ var findBranch = (doc, text) => doc.history?.branches.find((branch) => branch.content.target?.id === text.id);
305
+ var createBranch = (doc, props) => {
306
+ const parent = props.parent;
307
+ const anchor = props.heads ? [
308
+ ...props.heads
309
+ ] : getHeads(parent);
310
+ const baseContent = contentAt(parent, anchor);
311
+ const branchText = Text2.make({
312
+ content: baseContent
313
+ });
314
+ const db = Obj.getDatabase(doc);
315
+ invariant(db, "document not in a database", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 83, S: void 0, A: ["db", "'document not in a database'"] });
316
+ db.add(branchText);
317
+ Obj.setParent(branchText, doc);
318
+ const branch = makeBranch({
319
+ name: props.name,
320
+ content: Ref2.make(branchText),
321
+ parent: Ref2.make(parent),
322
+ anchor,
323
+ ...props.creator !== void 0 && {
324
+ creator: props.creator
325
+ }
326
+ });
327
+ const history = ensureHistory(doc);
328
+ Obj.update(doc, () => {
329
+ history.branches.push(branch);
330
+ });
331
+ if (!history.versions.some((version) => sameHeads(version.heads, anchor))) {
332
+ const version = makeVersion({
333
+ name: `fork: ${branchLabel(branch)}`,
334
+ target: Ref2.make(parent),
335
+ heads: anchor
336
+ });
337
+ Obj.update(doc, () => {
338
+ history.versions.push(version);
339
+ });
340
+ }
341
+ const stored = history.branches.find(({ id }) => id === branch.id);
342
+ invariant(stored, "branch not stored", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 112, S: void 0, A: ["stored", "'branch not stored'"] });
343
+ return stored;
344
+ };
345
+ var restore = (doc, version) => {
346
+ const text = version.target.target;
347
+ invariant(text, "checkpoint target not loaded", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 117, S: void 0, A: ["text", "'checkpoint target not loaded'"] });
348
+ const historical = contentAt(text, version.heads);
349
+ Obj.update(text, () => {
350
+ EchoText.update(text, "content", historical);
351
+ });
352
+ };
353
+ var mergeBranch = (doc, branch) => {
354
+ const stored = resolveBranch(doc, branch);
355
+ invariant(stored.status === "active", "branch is not active", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 129, S: void 0, A: ["stored.status === 'active'", "'branch is not active'"] });
356
+ const parent = stored.parent.target;
357
+ const branchText = stored.content.target;
358
+ invariant(parent && branchText, "branch refs not loaded", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 132, S: void 0, A: ["parent && branchText", "'branch refs not loaded'"] });
359
+ const base = contentAt(parent, stored.anchor);
360
+ const { text, conflicts } = merge3({
361
+ base,
362
+ ours: parent.content,
363
+ theirs: branchText.content
364
+ });
365
+ Obj.update(parent, () => {
366
+ EchoText.update(parent, "content", text);
367
+ });
368
+ Obj.update(doc, () => {
369
+ stored.status = "merged";
370
+ stored.mergedAt = (/* @__PURE__ */ new Date()).toISOString();
371
+ });
372
+ createCheckpoint(doc, {
373
+ name: `merge: ${branchLabel(stored)}`,
374
+ target: parent
375
+ });
376
+ return {
377
+ conflicts
378
+ };
379
+ };
380
+ var discardBranch = (doc, branch) => {
381
+ const stored = resolveBranch(doc, branch);
382
+ Obj.update(doc, () => {
383
+ stored.status = "archived";
384
+ });
385
+ };
386
+ var resolveBranch = (doc, branch) => {
387
+ const stored = doc.history?.branches.find(({ id }) => id === branch.id);
388
+ invariant(stored, `branch not found: ${branch.id}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 162, S: void 0, A: ["stored", "`branch not found: ${branch.id}`"] });
389
+ return stored;
390
+ };
391
+ var sameHeads = (a, b) => a.length === b.length && a.every((head) => b.includes(head));
392
+
393
+ // src/History.ts
394
+ var History_exports = {};
395
+ __export(History_exports, {
396
+ History: () => History,
397
+ ensure: () => ensureHistory
398
+ });
399
+
400
+ // src/Version.ts
401
+ var Version_exports = {};
402
+ __export(Version_exports, {
403
+ Version: () => Version,
404
+ contentAt: () => contentAt,
405
+ create: () => createCheckpoint,
406
+ label: () => versionLabel,
407
+ make: () => makeVersion,
408
+ restore: () => restore
409
+ });
410
+ export {
411
+ Branch_exports as Branch,
412
+ History_exports as History,
413
+ Version_exports as Version,
414
+ diffSpans,
415
+ diffStats,
416
+ merge3
417
+ };
418
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/Branch.ts", "../../../src/internal/types.ts", "../../../src/internal/model.ts", "../../../src/diff.ts", "../../../src/History.ts", "../../../src/Version.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport {\n Branch,\n type MakeBranchProps as MakeProps,\n BranchStatus as Status,\n makeBranch as make,\n} from './internal/types';\nexport {\n type CreateBranchProps as CreateProps,\n type MergeResult,\n createBranch as create,\n discardBranch as discard,\n findBranch as find,\n branchLabel as label,\n mergeBranch as merge,\n} from './internal/model';\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Key, Ref } from '@dxos/echo';\nimport { Text } from '@dxos/schema';\n\n/**\n * Named checkpoint: a pointer to the automerge heads of a Text's backing document.\n * Heads are content-addressed change hashes, stable across peers, so a checkpoint is zero-copy.\n * Generic over any object holding a `history` field (see model.ts).\n */\nexport const Version = Schema.mutable(\n Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n target: Ref.Ref(Text.Text),\n heads: Schema.mutable(Schema.Array(Schema.String)),\n createdAt: Schema.String,\n creator: Schema.optional(Schema.String),\n message: Schema.optional(Schema.String),\n }),\n);\nexport interface Version extends Schema.Schema.Type<typeof Version> {}\n\nexport const BranchStatus = Schema.Literal('active', 'merged', 'archived');\nexport type BranchStatus = Schema.Schema.Type<typeof BranchStatus>;\n\n/**\n * A draft Text forked from a parent Text at a specific revision (anchor heads).\n * The branch tree is formed by `parent` references; the root is Document.content.\n */\nexport const Branch = Schema.mutable(\n Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n content: Ref.Ref(Text.Text),\n parent: Ref.Ref(Text.Text),\n anchor: Schema.mutable(Schema.Array(Schema.String)),\n status: BranchStatus,\n createdAt: Schema.String,\n creator: Schema.optional(Schema.String),\n mergedAt: Schema.optional(Schema.String),\n }),\n);\nexport interface Branch extends Schema.Schema.Type<typeof Branch> {}\n\nexport const History = Schema.mutable(\n Schema.Struct({\n branches: Schema.mutable(Schema.Array(Branch)),\n versions: Schema.mutable(Schema.Array(Version)),\n }),\n);\nexport interface History extends Schema.Schema.Type<typeof History> {}\n\nexport type MakeVersionProps = Pick<Version, 'target' | 'heads' | 'name'> &\n Partial<Pick<Version, 'creator' | 'message'>>;\n\n/** Constructs a Version checkpoint record with a generated id and creation timestamp. */\nexport const makeVersion = (props: MakeVersionProps): Version => ({\n id: Key.EntityId.random(),\n createdAt: new Date().toISOString(),\n ...props,\n});\n\nexport type MakeBranchProps = Pick<Branch, 'content' | 'parent' | 'anchor' | 'name'> & Partial<Pick<Branch, 'creator'>>;\n\n/** Constructs an active Branch record with a generated id and creation timestamp. */\nexport const makeBranch = (props: MakeBranchProps): Branch => ({\n id: Key.EntityId.random(),\n status: 'active',\n createdAt: new Date().toISOString(),\n ...props,\n});\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { Text as EchoText, Obj, Ref } from '@dxos/echo';\nimport { checkoutVersion } from '@dxos/echo-client';\nimport { invariant } from '@dxos/invariant';\nimport { Text } from '@dxos/schema';\n\nimport { merge3 } from '../diff';\nimport * as Versioning from './types';\n\n/** Any ECHO object that carries a versioning history (e.g. a markdown document). */\nexport type VersionedObject = Obj.Unknown & { history?: Versioning.History | undefined };\n\n/** Initializes the history struct on first use so existing documents need no migration. */\nexport const ensureHistory = (doc: VersionedObject): Versioning.History => {\n if (!doc.history) {\n Obj.update(doc, (doc) => {\n doc.history = { branches: [], versions: [] };\n });\n }\n const history = doc.history;\n invariant(history, 'history not initialized');\n return history;\n};\n\nconst getHeads = (text: Text.Text): string[] => {\n const version = Obj.version(text);\n invariant(version.versioned && version.automergeHeads, 'text is not versioned (not persisted?)');\n return [...version.automergeHeads];\n};\n\n/** @returns The Text content at the given automerge heads (read-only time travel). */\nexport const contentAt = (text: Text.Text, heads: readonly string[]): string => {\n // `checkoutVersion` returns `unknown` (raw historical data) — narrow via runtime checks.\n const snapshot = checkoutVersion(text, [...heads]);\n if (snapshot && typeof snapshot === 'object' && 'content' in snapshot) {\n const { content } = snapshot;\n return typeof content === 'string' ? content : '';\n }\n return '';\n};\n\nexport type CreateCheckpointProps = { target: Text.Text; name: string; message?: string; creator?: string };\n\n/**\n * Records a named checkpoint of the target Text's current automerge heads and appends it to\n * the object's history. Zero-copy: only the heads are stored.\n */\nexport const createCheckpoint = (doc: VersionedObject, props: CreateCheckpointProps): Versioning.Version => {\n const text = props.target;\n const version = Versioning.makeVersion({\n name: props.name,\n target: Ref.make(text),\n heads: getHeads(text),\n ...(props.message !== undefined && { message: props.message }),\n ...(props.creator !== undefined && { creator: props.creator }),\n });\n const history = ensureHistory(doc);\n Obj.update(doc, () => {\n history.versions.push(version);\n });\n\n // Return the stored record (the pushed plain object is detached from the database).\n const stored = history.versions.find(({ id }) => id === version.id);\n invariant(stored, 'checkpoint not stored');\n return stored;\n};\n\n/** Display label for a checkpoint: its name, or the formatted creation time when unnamed. */\nexport const versionLabel = (version: Versioning.Version): string =>\n version.name || new Date(version.createdAt).toLocaleString();\n\n/** Display label for a branch: its name, or the formatted creation time when unnamed. */\nexport const branchLabel = (branch: Versioning.Branch): string =>\n branch.name || new Date(branch.createdAt).toLocaleString();\n\n/** Find the branch record owning a given Text (undefined for the root). */\nexport const findBranch = (doc: VersionedObject, text: Text.Text): Versioning.Branch | undefined =>\n doc.history?.branches.find((branch) => branch.content.target?.id === text.id);\n\nexport type CreateBranchProps = {\n name: string;\n parent: Text.Text;\n heads?: readonly string[];\n creator?: string;\n};\n\n/**\n * Forks a draft branch: a new Text seeded with the parent's content at the anchor heads\n * (defaults to the parent's current heads), recorded in the object's history. The anchor is\n * auto-checkpointed so the fork point stays addressable in the timeline.\n */\nexport const createBranch = (doc: VersionedObject, props: CreateBranchProps): Versioning.Branch => {\n const parent = props.parent;\n const anchor = props.heads ? [...props.heads] : getHeads(parent);\n const baseContent = contentAt(parent, anchor);\n\n const branchText = Text.make({ content: baseContent });\n const db = Obj.getDatabase(doc);\n invariant(db, 'document not in a database');\n db.add(branchText);\n Obj.setParent(branchText, doc);\n\n const branch = Versioning.makeBranch({\n name: props.name,\n content: Ref.make(branchText),\n parent: Ref.make(parent),\n anchor,\n ...(props.creator !== undefined && { creator: props.creator }),\n });\n\n const history = ensureHistory(doc);\n Obj.update(doc, () => {\n history.branches.push(branch);\n });\n // The anchor must stay addressable by name in the timeline.\n if (!history.versions.some((version) => sameHeads(version.heads, anchor))) {\n const version = Versioning.makeVersion({\n name: `fork: ${branchLabel(branch)}`,\n target: Ref.make(parent),\n heads: anchor,\n });\n Obj.update(doc, () => {\n history.versions.push(version);\n });\n }\n\n // Return the stored record (the pushed plain object is detached from the database).\n const stored = history.branches.find(({ id }) => id === branch.id);\n invariant(stored, 'branch not stored');\n return stored;\n};\n\n/** Applies the checkpoint's content to the tip as a new forward edit — history is never rewritten. */\nexport const restore = (doc: VersionedObject, version: Versioning.Version): void => {\n const text = version.target.target;\n invariant(text, 'checkpoint target not loaded');\n const historical = contentAt(text, version.heads);\n Obj.update(text, () => {\n EchoText.update(text, 'content', historical);\n });\n};\n\nexport type MergeResult = { conflicts: number };\n\n/**\n * 3-way merge: base = parent@anchor, ours = parent tip, theirs = branch tip.\n * Conflicting hunks are left in the document with git-style markers for manual cleanup.\n */\nexport const mergeBranch = (doc: VersionedObject, branch: Versioning.Branch): MergeResult => {\n // Callers may hold a detached copy of the record — mutate the stored one.\n const stored = resolveBranch(doc, branch);\n invariant(stored.status === 'active', 'branch is not active');\n const parent = stored.parent.target;\n const branchText = stored.content.target;\n invariant(parent && branchText, 'branch refs not loaded');\n\n const base = contentAt(parent, stored.anchor);\n const { text, conflicts } = merge3({ base, ours: parent.content, theirs: branchText.content });\n Obj.update(parent, () => {\n EchoText.update(parent, 'content', text);\n });\n Obj.update(doc, () => {\n stored.status = 'merged';\n stored.mergedAt = new Date().toISOString();\n });\n\n createCheckpoint(doc, { name: `merge: ${branchLabel(stored)}`, target: parent });\n return { conflicts };\n};\n\n/** Archives the branch; its Text is retained for recovery. */\nexport const discardBranch = (doc: VersionedObject, branch: Versioning.Branch): void => {\n const stored = resolveBranch(doc, branch);\n Obj.update(doc, () => {\n stored.status = 'archived';\n });\n};\n\nconst resolveBranch = (doc: VersionedObject, branch: Versioning.Branch): Versioning.Branch => {\n const stored = doc.history?.branches.find(({ id }) => id === branch.id);\n invariant(stored, `branch not found: ${branch.id}`);\n return stored;\n};\n\nconst sameHeads = (a: readonly string[], b: readonly string[]) =>\n a.length === b.length && a.every((head) => b.includes(head));\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { diffLines, diffWordsWithSpace } from 'diff';\n\n/**\n * Shared diff unit consumed by all diff renderings (inline, side-by-side, gutter).\n * Offsets index into the AFTER text; deletions are zero-width and carry the offset where\n * the removed text used to be, so widgets can render the removed content in place.\n */\nexport type DiffSpan = {\n kind: 'equal' | 'insert' | 'delete';\n from: number;\n to: number;\n text: string;\n};\n\n/** Computes word-level {@link DiffSpan}s between two texts, offset into the after text. */\nexport const diffSpans = (before: string, after: string): DiffSpan[] => {\n const spans: DiffSpan[] = [];\n let offset = 0;\n for (const change of diffWordsWithSpace(before, after)) {\n const kind = change.added ? 'insert' : change.removed ? 'delete' : 'equal';\n const length = kind === 'delete' ? 0 : change.value.length;\n spans.push({ kind, from: offset, to: offset + length, text: change.value });\n offset += length;\n }\n return spans;\n};\n\nexport type DiffStats = { insertions: number; deletions: number };\n\n/** Character counts, used for the `+N −M` branch summaries. */\nexport const diffStats = (spans: DiffSpan[]): DiffStats =>\n spans.reduce(\n (stats, span) => {\n if (span.kind === 'insert') {\n stats.insertions += span.text.length;\n } else if (span.kind === 'delete') {\n stats.deletions += span.text.length;\n }\n return stats;\n },\n { insertions: 0, deletions: 0 },\n );\n\nexport type Merge3Props = { base: string; ours: string; theirs: string };\nexport type Merge3Result = { text: string; conflicts: number };\n\n/**\n * Line-based 3-way merge. Non-overlapping hunks apply automatically; overlapping hunks\n * produce git-style conflict markers with the branch (theirs) side first, since the merge\n * flow is review-then-accept and the branch content is what was just reviewed.\n */\nexport const merge3 = ({ base, ours, theirs }: Merge3Props): Merge3Result => {\n if (ours === base) {\n return { text: theirs, conflicts: 0 };\n }\n if (theirs === base || ours === theirs) {\n return { text: ours, conflicts: 0 };\n }\n\n const baseLines = splitLines(base);\n const oursHunks = lineHunks(baseLines, splitLines(ours));\n const theirsHunks = lineHunks(baseLines, splitLines(theirs));\n\n const out: string[] = [];\n let conflicts = 0;\n let baseIndex = 0;\n let oursCursor = 0;\n let theirsCursor = 0;\n\n while (baseIndex < baseLines.length || oursCursor < oursHunks.length || theirsCursor < theirsHunks.length) {\n const oursHunk = oursHunks[oursCursor];\n const theirsHunk = theirsHunks[theirsCursor];\n const nextOurs = oursHunk?.baseStart ?? Infinity;\n const nextTheirs = theirsHunk?.baseStart ?? Infinity;\n const next = Math.min(nextOurs, nextTheirs);\n\n // Copy unchanged base lines up to the next hunk.\n while (baseIndex < Math.min(next, baseLines.length)) {\n out.push(baseLines[baseIndex]);\n baseIndex += 1;\n }\n if (next === Infinity) {\n break;\n }\n\n const oursActive = oursHunk !== undefined && oursHunk.baseStart === next;\n const theirsActive = theirsHunk !== undefined && theirsHunk.baseStart === next;\n const identical =\n oursActive &&\n theirsActive &&\n sameLines(oursHunk.lines, theirsHunk.lines) &&\n oursHunk.baseLength === theirsHunk.baseLength;\n // Hunks conflict when their consumed base intervals overlap — same start, or a staggered\n // hunk beginning inside the interval the active hunk consumes (e.g. [0,2) vs [1,2)).\n const overlap =\n !identical &&\n oursHunk !== undefined &&\n theirsHunk !== undefined &&\n (nextOurs === nextTheirs ||\n (oursActive && nextTheirs < hunkEnd(oursHunk)) ||\n (theirsActive && nextOurs < hunkEnd(theirsHunk)));\n\n if (overlap) {\n // The conflict region is the connected union of every intersecting hunk on both sides —\n // a broad hunk can overlap several smaller ones, all of which must be consumed together.\n const oursRegion = [oursHunk];\n const theirsRegion = [theirsHunk];\n oursCursor += 1;\n theirsCursor += 1;\n let unionEnd = Math.max(hunkEnd(oursHunk), hunkEnd(theirsHunk));\n let expanded = true;\n while (expanded) {\n expanded = false;\n while (oursCursor < oursHunks.length && oursHunks[oursCursor].baseStart < unionEnd) {\n const hunk = oursHunks[oursCursor];\n oursRegion.push(hunk);\n unionEnd = Math.max(unionEnd, hunkEnd(hunk));\n oursCursor += 1;\n expanded = true;\n }\n while (theirsCursor < theirsHunks.length && theirsHunks[theirsCursor].baseStart < unionEnd) {\n const hunk = theirsHunks[theirsCursor];\n theirsRegion.push(hunk);\n unionEnd = Math.max(unionEnd, hunkEnd(hunk));\n theirsCursor += 1;\n expanded = true;\n }\n }\n\n out.push(\n '<<<<<<< branch',\n ...sideContent(baseLines, theirsRegion, next, unionEnd),\n '=======',\n ...sideContent(baseLines, oursRegion, next, unionEnd),\n '>>>>>>> current',\n );\n conflicts += 1;\n baseIndex = unionEnd;\n } else if (identical) {\n out.push(...oursHunk.lines);\n baseIndex = next + oursHunk.baseLength;\n oursCursor += 1;\n theirsCursor += 1;\n } else if (oursActive) {\n out.push(...oursHunk.lines);\n baseIndex = next + oursHunk.baseLength;\n oursCursor += 1;\n } else if (theirsHunk !== undefined) {\n out.push(...theirsHunk.lines);\n baseIndex = next + theirsHunk.baseLength;\n theirsCursor += 1;\n }\n }\n\n return { text: joinLines(out, [base, ours, theirs]), conflicts };\n};\n\ntype Hunk = { baseStart: number; baseLength: number; lines: string[] };\n\nconst hunkEnd = (hunk: Hunk) => hunk.baseStart + hunk.baseLength;\n\n/** One side's content for a conflict region: its hunks plus the union's base lines they leave unchanged. */\nconst sideContent = (baseLines: string[], hunks: Hunk[], unionStart: number, unionEnd: number): string[] => {\n const out: string[] = [];\n let position = unionStart;\n for (const hunk of hunks) {\n out.push(...baseLines.slice(position, hunk.baseStart), ...hunk.lines);\n position = Math.max(position, hunkEnd(hunk));\n }\n out.push(...baseLines.slice(position, unionEnd));\n return out;\n};\n\n/** Convert jsdiff line changes into base-anchored replacement hunks. */\nconst lineHunks = (baseLines: string[], sideLines: string[]): Hunk[] => {\n const hunks: Hunk[] = [];\n let baseIndex = 0;\n let pending: Hunk | undefined;\n for (const change of diffLines(joinForDiff(baseLines), joinForDiff(sideLines))) {\n const lines = chunkLines(change.value);\n if (change.added) {\n pending = pending ?? { baseStart: baseIndex, baseLength: 0, lines: [] };\n pending.lines.push(...lines);\n } else if (change.removed) {\n pending = pending ?? { baseStart: baseIndex, baseLength: 0, lines: [] };\n pending.baseLength += lines.length;\n baseIndex += lines.length;\n } else {\n if (pending) {\n hunks.push(pending);\n pending = undefined;\n }\n baseIndex += lines.length;\n }\n }\n if (pending) {\n hunks.push(pending);\n }\n return hunks;\n};\n\nconst sameLines = (a: string[], b: string[]) => a.length === b.length && a.every((line, index) => line === b[index]);\n\nconst splitLines = (text: string): string[] => (text === '' ? [] : stripTrailingNewline(text).split('\\n'));\n\n// Unlike whole-document splitting, a diff chunk is never empty — a chunk of '\\n' is one blank\n// line (jsdiff attaches the terminator to its line), so no empty-string special case applies.\nconst chunkLines = (value: string): string[] => stripTrailingNewline(value).split('\\n');\n\nconst stripTrailingNewline = (text: string) => (text.endsWith('\\n') ? text.slice(0, -1) : text);\n\n// diffLines needs a trailing newline so the last line compares as a whole line.\nconst joinForDiff = (lines: string[]) => (lines.length === 0 ? '' : `${lines.join('\\n')}\\n`);\n\nconst joinLines = (lines: string[], inputs: string[]) => {\n const text = lines.join('\\n');\n // Preserve a trailing newline when every non-empty input has one.\n const nonEmpty = inputs.filter((input) => input.length > 0);\n const trailing = nonEmpty.length > 0 && nonEmpty.every((input) => input.endsWith('\\n'));\n return trailing && text.length > 0 ? `${text}\\n` : text;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport { History } from './internal/types';\nexport { type VersionedObject, ensureHistory as ensure } from './internal/model';\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport { type MakeVersionProps as MakeProps, Version, makeVersion as make } from './internal/types';\nexport {\n type CreateCheckpointProps as CreateProps,\n contentAt,\n createCheckpoint as create,\n versionLabel as label,\n restore,\n} from './internal/model';\n"],
5
+ "mappings": ";;;;;;;;AAAA;;;;;;;;;;;;;ACIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,WAAW;AACzB,SAASC,YAAY;AAOd,IAAMC,UAAiBC,eACrBC,cAAO;EACZC,IAAWC;EACXC,MAAaD;EACbE,QAAQR,IAAIA,IAAIC,KAAKA,IAAI;EACzBQ,OAAcN,eAAeO,aAAaJ,aAAM,CAAA;EAChDK,WAAkBL;EAClBM,SAAgBC,gBAAgBP,aAAM;EACtCQ,SAAgBD,gBAAgBP,aAAM;AACxC,CAAA,CAAA;AAIK,IAAMS,eAAsBC,eAAQ,UAAU,UAAU,UAAA;AAOxD,IAAMC,SAAgBd,eACpBC,cAAO;EACZC,IAAWC;EACXC,MAAaD;EACbY,SAASlB,IAAIA,IAAIC,KAAKA,IAAI;EAC1BkB,QAAQnB,IAAIA,IAAIC,KAAKA,IAAI;EACzBmB,QAAejB,eAAeO,aAAaJ,aAAM,CAAA;EACjDe,QAAQN;EACRJ,WAAkBL;EAClBM,SAAgBC,gBAAgBP,aAAM;EACtCgB,UAAiBT,gBAAgBP,aAAM;AACzC,CAAA,CAAA;AAIK,IAAMiB,UAAiBpB,eACr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AAA;EAEF,CAAA;;IAEE7C,gBAAkB,CAAC,KAAA,WAAA;AACnB,QAAA,SAAOiB,IAAAA,SAAAA,SAAAA,KAAAA,CAAAA,EAAAA,GAAAA,MAAAA,OAAAA,OAAAA,EAAAA;AACT,YAAA,QAAA,qBAAA,OAAA,EAAA,IAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,KAAA,GAAA,QAAA,GAAA,CAAA,UAAA,kCAAA,EAAA,CAAA;AAEA,SAAM6B;;;;;AE3LN;;;;;;;ACAA;;;;;;;;;",
6
+ "names": ["Schema", "Key", "Ref", "Text", "Version", "mutable", "Struct", "id", "String", "name", "target", "heads", "Array", "createdAt", "creator", "optional", "message", "BranchStatus", "Literal", "Branch", "content", "parent", "anchor", "status", "mergedAt", "History", "branches", "versions", "makeVersion", "props", "EntityId", "random", "Date", "toISOString", "makeBranch", "Text", "EchoText", "Obj", "Ref", "checkoutVersion", "invariant", "diffLines", "diffWordsWithSpace", "diffSpans", "before", "after", "spans", "offset", "change", "kind", "added", "removed", "length", "value", "push", "from", "to", "text", "diffStats", "reduce", "stats", "span", "insertions", "deletions", "merge3", "base", "ours", "theirs", "conflicts", "baseLines", "splitLines", "oursHunks", "lineHunks", "theirsHunks", "out", "baseIndex", "oursCursor", "theirsCursor", "oursHunk", "theirsHunk", "nextOurs", "baseStart", "Infinity", "nextTheirs", "next", "Math", "min", "oursActive", "undefined", "theirsActive", "identical", "sameLines", "lines", "baseLength", "overlap", "hunkEnd", "oursRegion", "theirsRegion", "unionEnd", "max", "expanded", "hunk", "sideContent", "joinLines", "hunks", "unionStart", "position", "slice", "sideLines", "pending", "joinForDiff", "chunkLines", "a", "b", "every", "line", "index", "stripTrailingNewline", "split", "endsWith", "join", "inputs", "nonEmpty", "filter", "input", "trailing", "doc", "history", "branches", "versions", "invariant", "getHeads", "version", "versioned", "automergeHeads", "snapshot", "content", "makeVersion", "name", "props", "target", "text", "heads", "message", "undefined", "creator", "Obj", "stored", "findBranch", "find", "branch", "id", "anchor", "parent", "baseContent", "branchText", "Text", "db", "setParent", "Versioning", "make", "branchLabel", "Ref", "update", "historical", "contentAt", "EchoText", "resolveBranch", "base", "conflicts", "merge3", "ours", "theirs", "mergedAt", "createCheckpoint", "status", "sameHeads"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/internal/types.ts":{"bytes":7963,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/diff.ts":{"bytes":27656,"imports":[{"path":"diff","kind":"import-statement","external":true}],"format":"esm"},"src/internal/model.ts":{"bytes":24412,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/diff.ts","kind":"import-statement","original":"../diff"},{"path":"src/internal/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/Branch.ts":{"bytes":1548,"imports":[{"path":"src/internal/types.ts","kind":"import-statement","original":"./internal/types"},{"path":"src/internal/model.ts","kind":"import-statement","original":"./internal/model"}],"format":"esm"},"src/History.ts":{"bytes":776,"imports":[{"path":"src/internal/types.ts","kind":"import-statement","original":"./internal/types"},{"path":"src/internal/model.ts","kind":"import-statement","original":"./internal/model"}],"format":"esm"},"src/Version.ts":{"bytes":1203,"imports":[{"path":"src/internal/types.ts","kind":"import-statement","original":"./internal/types"},{"path":"src/internal/model.ts","kind":"import-statement","original":"./internal/model"}],"format":"esm"},"src/index.ts":{"bytes":796,"imports":[{"path":"src/Branch.ts","kind":"import-statement","original":"./Branch"},{"path":"src/History.ts","kind":"import-statement","original":"./History"},{"path":"src/Version.ts","kind":"import-statement","original":"./Version"},{"path":"src/diff.ts","kind":"import-statement","original":"./diff"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":31192},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"diff","kind":"import-statement","external":true}],"exports":["Branch","History","Version","diffSpans","diffStats","merge3"],"entryPoint":"src/index.ts","inputs":{"src/Branch.ts":{"bytesInOutput":279},"src/internal/types.ts":{"bytesInOutput":1257},"src/internal/model.ts":{"bytesInOutput":5653},"src/diff.ts":{"bytesInOutput":5944},"src/index.ts":{"bytesInOutput":0},"src/History.ts":{"bytesInOutput":114},"src/Version.ts":{"bytesInOutput":229}},"bytes":14055}}}
@@ -0,0 +1,3 @@
1
+ export { Branch, type MakeBranchProps as MakeProps, BranchStatus as Status, makeBranch as make, } from './internal/types';
2
+ export { type CreateBranchProps as CreateProps, type MergeResult, createBranch as create, discardBranch as discard, findBranch as find, branchLabel as label, mergeBranch as merge, } from './internal/model';
3
+ //# sourceMappingURL=Branch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Branch.d.ts","sourceRoot":"","sources":["../../../src/Branch.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,MAAM,EACN,KAAK,eAAe,IAAI,SAAS,EACjC,YAAY,IAAI,MAAM,EACtB,UAAU,IAAI,IAAI,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,iBAAiB,IAAI,WAAW,EACrC,KAAK,WAAW,EAChB,YAAY,IAAI,MAAM,EACtB,aAAa,IAAI,OAAO,EACxB,UAAU,IAAI,IAAI,EAClB,WAAW,IAAI,KAAK,EACpB,WAAW,IAAI,KAAK,GACrB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { History } from './internal/types';
2
+ export { type VersionedObject, ensureHistory as ensure } from './internal/model';
3
+ //# sourceMappingURL=History.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"History.d.ts","sourceRoot":"","sources":["../../../src/History.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,eAAe,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { type MakeVersionProps as MakeProps, Version, makeVersion as make } from './internal/types';
2
+ export { type CreateCheckpointProps as CreateProps, contentAt, createCheckpoint as create, versionLabel as label, restore, } from './internal/model';
3
+ //# sourceMappingURL=Version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Version.d.ts","sourceRoot":"","sources":["../../../src/Version.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,IAAI,SAAS,EAAE,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EACL,KAAK,qBAAqB,IAAI,WAAW,EACzC,SAAS,EACT,gBAAgB,IAAI,MAAM,EAC1B,YAAY,IAAI,KAAK,EACrB,OAAO,GACR,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared diff unit consumed by all diff renderings (inline, side-by-side, gutter).
3
+ * Offsets index into the AFTER text; deletions are zero-width and carry the offset where
4
+ * the removed text used to be, so widgets can render the removed content in place.
5
+ */
6
+ export type DiffSpan = {
7
+ kind: 'equal' | 'insert' | 'delete';
8
+ from: number;
9
+ to: number;
10
+ text: string;
11
+ };
12
+ /** Computes word-level {@link DiffSpan}s between two texts, offset into the after text. */
13
+ export declare const diffSpans: (before: string, after: string) => DiffSpan[];
14
+ export type DiffStats = {
15
+ insertions: number;
16
+ deletions: number;
17
+ };
18
+ /** Character counts, used for the `+N −M` branch summaries. */
19
+ export declare const diffStats: (spans: DiffSpan[]) => DiffStats;
20
+ export type Merge3Props = {
21
+ base: string;
22
+ ours: string;
23
+ theirs: string;
24
+ };
25
+ export type Merge3Result = {
26
+ text: string;
27
+ conflicts: number;
28
+ };
29
+ /**
30
+ * Line-based 3-way merge. Non-overlapping hunks apply automatically; overlapping hunks
31
+ * produce git-style conflict markers with the branch (theirs) side first, since the merge
32
+ * flow is review-then-accept and the branch content is what was just reviewed.
33
+ */
34
+ export declare const merge3: ({ base, ours, theirs }: Merge3Props) => Merge3Result;
35
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/diff.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,SAAS,WAAY,MAAM,SAAS,MAAM,KAAG,QAAQ,EAUjE,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,+DAA+D;AAC/D,eAAO,MAAM,SAAS,UAAW,QAAQ,EAAE,KAAG,SAW3C,CAAC;AAEJ,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,MAAM,2BAA4B,WAAW,KAAG,YAwG5D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=diff.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.test.d.ts","sourceRoot":"","sources":["../../../src/diff.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * as Branch from './Branch';
2
+ export * as History from './History';
3
+ export * as Version from './Version';
4
+ export * from './diff';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './model';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}