tandem-kit-core 0.0.0 → 0.1.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 (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -1
  3. package/dist/src/browser.d.ts +19 -0
  4. package/dist/src/browser.js +19 -0
  5. package/dist/src/client-tools.d.ts +31 -0
  6. package/dist/src/client-tools.js +82 -0
  7. package/dist/src/client.d.ts +179 -0
  8. package/dist/src/client.js +213 -0
  9. package/dist/src/delta.d.ts +16 -0
  10. package/dist/src/delta.js +99 -0
  11. package/dist/src/durable.d.ts +39 -0
  12. package/dist/src/durable.js +104 -0
  13. package/dist/src/errors.d.ts +5 -0
  14. package/dist/src/errors.js +10 -0
  15. package/dist/src/eventlog-file.d.ts +12 -0
  16. package/dist/src/eventlog-file.js +39 -0
  17. package/dist/src/eventlog.d.ts +31 -0
  18. package/dist/src/eventlog.js +63 -0
  19. package/dist/src/events.d.ts +15 -0
  20. package/dist/src/events.js +79 -0
  21. package/dist/src/events.json +80 -0
  22. package/dist/src/files.d.ts +34 -0
  23. package/dist/src/files.js +122 -0
  24. package/dist/src/fsutil.d.ts +8 -0
  25. package/dist/src/fsutil.js +68 -0
  26. package/dist/src/hash.d.ts +3 -0
  27. package/dist/src/hash.js +65 -0
  28. package/dist/src/images.d.ts +24 -0
  29. package/dist/src/images.js +70 -0
  30. package/dist/src/index.d.ts +25 -0
  31. package/dist/src/index.js +25 -0
  32. package/dist/src/json.d.ts +10 -0
  33. package/dist/src/json.js +68 -0
  34. package/dist/src/merge.d.ts +34 -0
  35. package/dist/src/merge.js +111 -0
  36. package/dist/src/persist.d.ts +49 -0
  37. package/dist/src/persist.js +29 -0
  38. package/dist/src/proposals-file.d.ts +12 -0
  39. package/dist/src/proposals-file.js +36 -0
  40. package/dist/src/proposals.d.ts +149 -0
  41. package/dist/src/proposals.js +296 -0
  42. package/dist/src/reconcile.d.ts +63 -0
  43. package/dist/src/reconcile.js +61 -0
  44. package/dist/src/replica.d.ts +147 -0
  45. package/dist/src/replica.js +320 -0
  46. package/dist/src/revisions-file.d.ts +14 -0
  47. package/dist/src/revisions-file.js +28 -0
  48. package/dist/src/revisions.d.ts +78 -0
  49. package/dist/src/revisions.js +152 -0
  50. package/dist/src/revisions.json +19 -0
  51. package/dist/src/schema.d.ts +12 -0
  52. package/dist/src/schema.js +49 -0
  53. package/dist/src/session-state.d.ts +36 -0
  54. package/dist/src/session-state.js +95 -0
  55. package/dist/src/sse.d.ts +17 -0
  56. package/dist/src/sse.js +59 -0
  57. package/dist/src/workcopy.d.ts +145 -0
  58. package/dist/src/workcopy.js +556 -0
  59. package/package.json +34 -4
@@ -0,0 +1,152 @@
1
+ import { diff } from "./delta.js";
2
+ import { TandemError } from "./errors.js";
3
+ import { fieldOk, isTimestamp, nowIso } from "./events.js";
4
+ import spec from './revisions.json' with { type: 'json' };
5
+ export const REVISION_FORMAT = spec.format;
6
+ export class MemoryRevisionStore {
7
+ keep;
8
+ revisions = [];
9
+ constructor(keep) {
10
+ this.keep = keep;
11
+ }
12
+ append(revision) {
13
+ this.revisions.push(revision);
14
+ if (this.keep !== undefined && this.revisions.length > this.keep)
15
+ this.revisions.splice(0, this.revisions.length - this.keep);
16
+ }
17
+ list() {
18
+ return this.revisions.slice();
19
+ }
20
+ head() {
21
+ return this.revisions.at(-1);
22
+ }
23
+ }
24
+ const FIELDS = spec.fields;
25
+ const REQUIRES_OF = new Set(spec.requires_of);
26
+ const KNOWN = Object.keys(FIELDS);
27
+ export function validateRevision(record) {
28
+ if (typeof record !== 'object' || record === null || Array.isArray(record))
29
+ return ['not_object'];
30
+ const rec = record;
31
+ const errors = [];
32
+ if (typeof rec.format === 'string' && rec.format !== REVISION_FORMAT)
33
+ errors.push('bad_format');
34
+ for (const [name, rule] of Object.entries(FIELDS)) {
35
+ const optional = rule.endsWith('?');
36
+ if (!(name in rec) || rec[name] === undefined) {
37
+ if (!optional)
38
+ errors.push(`missing_field:${name}`);
39
+ }
40
+ else if (!fieldOk(rule, rec[name]) || (name === 'at' && !isTimestamp(rec[name]))) {
41
+ errors.push(`bad_field:${name}`);
42
+ }
43
+ }
44
+ if (typeof rec.op === 'string' && REQUIRES_OF.has(rec.op) && (!('of' in rec) || rec.of === undefined))
45
+ errors.push('missing_field:of');
46
+ return errors;
47
+ }
48
+ export function makeRevision(previous, input) {
49
+ const digits = previous ? /(\d+)$/.exec(previous.id) : null;
50
+ const count = digits ? Number(digits[1]) : 0;
51
+ const record = {
52
+ format: REVISION_FORMAT,
53
+ id: input.id ?? `r${count + 1}`,
54
+ parent: previous ? previous.id : null,
55
+ version: input.version ?? (previous ? previous.version + 1 : 0),
56
+ actor: input.actor,
57
+ reason: input.reason ?? null,
58
+ at: input.at ?? nowIso(),
59
+ op: input.op ?? (previous ? 'write' : 'init'),
60
+ delta: previous ? diff(previous.state, input.state) : [],
61
+ state: input.state,
62
+ findings: input.findings ?? [],
63
+ };
64
+ if (input.of !== undefined)
65
+ record.of = input.of;
66
+ if (input.via !== undefined)
67
+ record.via = input.via;
68
+ return record;
69
+ }
70
+ export function encodeRevision(record) {
71
+ const out = {};
72
+ const source = { ...record, format: record.format ?? REVISION_FORMAT };
73
+ for (const key of KNOWN)
74
+ if (source[key] !== undefined)
75
+ out[key] = source[key];
76
+ for (const key of Object.keys(source).sort())
77
+ if (!(key in out) && source[key] !== undefined)
78
+ out[key] = source[key];
79
+ return JSON.stringify(out);
80
+ }
81
+ export function decodeRevision(line) {
82
+ let record;
83
+ try {
84
+ record = JSON.parse(line);
85
+ }
86
+ catch {
87
+ throw new TandemError(400, 'bad_request', 'a revision record is not JSON');
88
+ }
89
+ const errors = validateRevision(record);
90
+ if (errors.length)
91
+ throw new TandemError(400, 'bad_request', `bad revision record: ${errors.join(', ')}`);
92
+ return record;
93
+ }
94
+ export function revisionLine(record, portable = false) {
95
+ return portable ? encodeRevision(record) : JSON.stringify(record);
96
+ }
97
+ // every revision a text of json lines holds. a line that is not a json object (a write cut short, a stray edit) is skipped
98
+ export function parseRevisionLines(text) {
99
+ const out = [];
100
+ for (const line of (text ?? '').split('\n')) {
101
+ if (!line.trim())
102
+ continue;
103
+ try {
104
+ const record = JSON.parse(line);
105
+ if (typeof record === 'object' && record !== null && !Array.isArray(record))
106
+ out.push(record);
107
+ }
108
+ catch {
109
+ continue;
110
+ }
111
+ }
112
+ return out;
113
+ }
114
+ // revisions as json lines in any text the app owns: localStorage, IndexedDB behind a cache, a database column, a file it reads itself.
115
+ // reads once when the store is made and writes on every append, so it works wherever a Workcopy runs
116
+ export class TextRevisionStore {
117
+ source;
118
+ options;
119
+ revisions;
120
+ text;
121
+ constructor(source, options = {}) {
122
+ this.source = source;
123
+ this.options = options;
124
+ this.revisions = parseRevisionLines(source.read());
125
+ if (options.keep !== undefined && this.revisions.length > options.keep)
126
+ this.revisions.splice(0, this.revisions.length - options.keep);
127
+ this.text = this.revisions.map((r) => `${revisionLine(r, options.portable)}\n`).join('');
128
+ }
129
+ append(revision) {
130
+ const line = `${revisionLine(revision, this.options.portable)}\n`;
131
+ this.revisions.push(revision);
132
+ const trimmed = this.options.keep !== undefined && this.revisions.length > this.options.keep;
133
+ if (trimmed) {
134
+ this.revisions.splice(0, this.revisions.length - this.options.keep);
135
+ this.text = this.revisions.map((r) => `${revisionLine(r, this.options.portable)}\n`).join('');
136
+ this.source.write(this.text);
137
+ return;
138
+ }
139
+ this.text += line;
140
+ if (this.source.append)
141
+ this.source.append(line);
142
+ else
143
+ this.source.write(this.text);
144
+ }
145
+ list() {
146
+ return this.revisions.slice();
147
+ }
148
+ head() {
149
+ return this.revisions.at(-1);
150
+ }
151
+ }
152
+ export const storageRevisionStore = (storage, key, options = {}) => new TextRevisionStore({ read: () => storage.getItem(key), write: (text) => storage.setItem(key, text) }, options);
@@ -0,0 +1,19 @@
1
+ {
2
+ "format": "tandem/revision/1",
3
+ "fields": {
4
+ "format": "string?",
5
+ "id": "string",
6
+ "parent": "string|null",
7
+ "version": "integer",
8
+ "actor": "string",
9
+ "reason": "string|null",
10
+ "at": "string",
11
+ "op": "enum:init,write,revert",
12
+ "of": "string?",
13
+ "via": "string?",
14
+ "delta": "array",
15
+ "state": "any",
16
+ "findings": "array"
17
+ },
18
+ "requires_of": ["revert"]
19
+ }
@@ -0,0 +1,12 @@
1
+ import { type Json } from './json.js';
2
+ export interface JsonSchema {
3
+ type?: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
4
+ properties?: Record<string, JsonSchema>;
5
+ required?: string[];
6
+ items?: JsonSchema;
7
+ enum?: Json[];
8
+ additionalProperties?: boolean;
9
+ description?: string;
10
+ [keyword: string]: unknown;
11
+ }
12
+ export declare function validateSchema(schema: JsonSchema, value: unknown, path?: string): string[];
@@ -0,0 +1,49 @@
1
+ import { isObject } from "./json.js";
2
+ function typeOk(type, value) {
3
+ switch (type) {
4
+ case 'string':
5
+ return typeof value === 'string';
6
+ case 'number':
7
+ return typeof value === 'number' && Number.isFinite(value);
8
+ case 'integer':
9
+ return Number.isInteger(value);
10
+ case 'boolean':
11
+ return typeof value === 'boolean';
12
+ case 'object':
13
+ return isObject(value);
14
+ case 'array':
15
+ return Array.isArray(value);
16
+ case 'null':
17
+ return value === null;
18
+ default:
19
+ return true;
20
+ }
21
+ }
22
+ export function validateSchema(schema, value, path = '$') {
23
+ const errors = [];
24
+ if (schema.type && !typeOk(schema.type, value))
25
+ return [`${path}: expected ${schema.type}`];
26
+ if (schema.enum && !schema.enum.some((item) => JSON.stringify(item) === JSON.stringify(value))) {
27
+ errors.push(`${path}: must be one of ${schema.enum.map((item) => JSON.stringify(item)).join(', ')}`);
28
+ }
29
+ if (isObject(value)) {
30
+ for (const key of schema.required ?? []) {
31
+ if (!(key in value))
32
+ errors.push(`${path}.${key}: required`);
33
+ }
34
+ for (const [key, sub] of Object.entries(schema.properties ?? {})) {
35
+ if (key in value)
36
+ errors.push(...validateSchema(sub, value[key], `${path}.${key}`));
37
+ }
38
+ if (schema.additionalProperties === false) {
39
+ for (const key of Object.keys(value)) {
40
+ if (!(key in (schema.properties ?? {})))
41
+ errors.push(`${path}.${key}: not allowed`);
42
+ }
43
+ }
44
+ }
45
+ if (Array.isArray(value) && schema.items) {
46
+ value.forEach((item, i) => errors.push(...validateSchema(schema.items, item, `${path}[${i}]`)));
47
+ }
48
+ return errors;
49
+ }
@@ -0,0 +1,36 @@
1
+ import type { TandemEvent } from './events.js';
2
+ export interface PendingPrompt {
3
+ id: string;
4
+ kind: 'approval' | 'question';
5
+ }
6
+ export interface SessionState {
7
+ session: string | null;
8
+ harness: string | null;
9
+ model: string | null;
10
+ status: 'idle' | 'running' | 'ended';
11
+ turn: number;
12
+ last_seq: number;
13
+ settings: {
14
+ model: string | null;
15
+ effort: string | null;
16
+ permission_mode: string;
17
+ } | null;
18
+ pending: PendingPrompt[];
19
+ compacting: boolean;
20
+ context: {
21
+ tokens: number | null;
22
+ max: number | null;
23
+ percent: number | null;
24
+ } | null;
25
+ usage: {
26
+ steps: number;
27
+ output_tokens: number;
28
+ elapsed_s: number;
29
+ cost_usd: number | null;
30
+ } | null;
31
+ clashes: string[];
32
+ doc_version: number | null;
33
+ }
34
+ export declare function initialSessionState(): SessionState;
35
+ export declare function reduceSession(state: SessionState, event: TandemEvent): SessionState;
36
+ export declare function foldSession(events: TandemEvent[], from?: SessionState): SessionState;
@@ -0,0 +1,95 @@
1
+ export function initialSessionState() {
2
+ return {
3
+ session: null,
4
+ harness: null,
5
+ model: null,
6
+ status: 'idle',
7
+ turn: 0,
8
+ last_seq: 0,
9
+ settings: null,
10
+ pending: [],
11
+ compacting: false,
12
+ context: null,
13
+ usage: null,
14
+ clashes: [],
15
+ doc_version: null,
16
+ };
17
+ }
18
+ export function reduceSession(state, event) {
19
+ if (event.seq !== undefined && event.seq <= state.last_seq)
20
+ return state;
21
+ const next = { ...state, last_seq: Math.max(state.last_seq, event.seq ?? 0) };
22
+ const dropPrompt = (id) => state.pending.filter((p) => p.id !== id);
23
+ switch (event.type) {
24
+ case 'session_started':
25
+ next.session = event.session;
26
+ next.harness = event.harness;
27
+ next.model = event.model ?? null;
28
+ break;
29
+ case 'turn_started':
30
+ next.status = 'running';
31
+ next.turn = event.turn;
32
+ break;
33
+ case 'turn_finished':
34
+ next.status = 'idle';
35
+ next.pending = [];
36
+ next.compacting = false;
37
+ break;
38
+ case 'ended':
39
+ next.status = 'ended';
40
+ next.pending = [];
41
+ next.compacting = false;
42
+ break;
43
+ case 'settings':
44
+ next.settings = {
45
+ model: event.model,
46
+ effort: event.effort,
47
+ permission_mode: event.permission_mode,
48
+ };
49
+ break;
50
+ case 'approval':
51
+ next.pending = [...dropPrompt(event.id), { id: event.id, kind: 'approval' }];
52
+ break;
53
+ case 'question':
54
+ next.pending = [...dropPrompt(event.id), { id: event.id, kind: 'question' }];
55
+ break;
56
+ case 'approval_resolved':
57
+ case 'question_answered':
58
+ case 'prompt_closed':
59
+ next.pending = dropPrompt(event.id);
60
+ break;
61
+ case 'compaction':
62
+ next.compacting = event.phase === 'started';
63
+ break;
64
+ case 'context':
65
+ next.context = {
66
+ tokens: event.tokens,
67
+ max: event.max,
68
+ percent: event.percent ?? null,
69
+ };
70
+ break;
71
+ case 'usage':
72
+ next.usage = {
73
+ steps: event.steps,
74
+ output_tokens: event.output_tokens,
75
+ elapsed_s: event.elapsed_s,
76
+ cost_usd: event.cost_usd ?? null,
77
+ };
78
+ break;
79
+ case 'clash':
80
+ next.clashes = [...state.clashes.filter((id) => id !== event.id), event.id];
81
+ break;
82
+ case 'clash_resolved':
83
+ next.clashes = state.clashes.filter((id) => id !== event.id);
84
+ break;
85
+ case 'change':
86
+ next.doc_version = event.version;
87
+ break;
88
+ default:
89
+ break;
90
+ }
91
+ return next;
92
+ }
93
+ export function foldSession(events, from = initialSessionState()) {
94
+ return events.reduce(reduceSession, from);
95
+ }
@@ -0,0 +1,17 @@
1
+ import type { TandemEvent } from './events.js';
2
+ export interface SseMessage {
3
+ id?: string;
4
+ event?: string;
5
+ data: string;
6
+ }
7
+ export declare function formatSse(event: TandemEvent): string;
8
+ export declare const SSE_KEEPALIVE = ": keepalive\n\n";
9
+ export declare class SseParser {
10
+ private buffer;
11
+ private id;
12
+ private event;
13
+ private data;
14
+ feed(chunk: string): SseMessage[];
15
+ private line;
16
+ }
17
+ export declare function parseSse(text: string): SseMessage[];
@@ -0,0 +1,59 @@
1
+ export function formatSse(event) {
2
+ const head = event.seq === undefined ? '' : `id: ${event.seq}\n`;
3
+ return `${head}event: ${event.type}\ndata: ${JSON.stringify(event)}\n\n`;
4
+ }
5
+ export const SSE_KEEPALIVE = ': keepalive\n\n';
6
+ export class SseParser {
7
+ buffer = '';
8
+ id;
9
+ event;
10
+ data = [];
11
+ feed(chunk) {
12
+ this.buffer += chunk;
13
+ const out = [];
14
+ let at;
15
+ while ((at = this.buffer.indexOf('\n')) !== -1) {
16
+ const line = this.buffer.slice(0, at).replace(/\r$/, '');
17
+ this.buffer = this.buffer.slice(at + 1);
18
+ const message = this.line(line);
19
+ if (message)
20
+ out.push(message);
21
+ }
22
+ return out;
23
+ }
24
+ line(line) {
25
+ if (line === '') {
26
+ if (!this.data.length) {
27
+ this.event = undefined;
28
+ return undefined;
29
+ }
30
+ const message = { data: this.data.join('\n') };
31
+ if (this.id !== undefined)
32
+ message.id = this.id;
33
+ if (this.event !== undefined)
34
+ message.event = this.event;
35
+ this.data = [];
36
+ this.event = undefined;
37
+ this.id = undefined;
38
+ return message;
39
+ }
40
+ if (line.startsWith(':'))
41
+ return undefined;
42
+ const colon = line.indexOf(':');
43
+ const field = colon === -1 ? line : line.slice(0, colon);
44
+ let value = colon === -1 ? '' : line.slice(colon + 1);
45
+ if (value.startsWith(' '))
46
+ value = value.slice(1);
47
+ if (field === 'data')
48
+ this.data.push(value);
49
+ else if (field === 'id')
50
+ this.id = value;
51
+ else if (field === 'event')
52
+ this.event = value;
53
+ return undefined;
54
+ }
55
+ }
56
+ export function parseSse(text) {
57
+ const parser = new SseParser();
58
+ return parser.feed(text.endsWith('\n') ? text : `${text}\n`);
59
+ }
@@ -0,0 +1,145 @@
1
+ import { type Delta, type Path } from './delta.js';
2
+ import { EventLog } from './eventlog.js';
3
+ import { type Json } from './json.js';
4
+ import { type MergeOptions, type MergeResult } from './merge.js';
5
+ import { type ClashStore, type SavePolicy, type SnapshotStore } from './persist.js';
6
+ import { type SyncRequest, type SyncResponse } from './reconcile.js';
7
+ import { type Finding, type Revision, type RevisionStore } from './revisions.js';
8
+ export interface MergeContext {
9
+ actor: string;
10
+ writerWins: boolean;
11
+ }
12
+ export interface DocAdapter {
13
+ validate?(state: Json, ctx: {
14
+ actor: string;
15
+ }): Finding[];
16
+ merge?(base: Json, mine: Json, theirs: Json, ctx: MergeContext): MergeResult;
17
+ keyed?: MergeOptions['keyed'];
18
+ summarize?(before: Json, after: Json): string;
19
+ print?(state: Json): string;
20
+ }
21
+ export interface WorkcopyOptions {
22
+ name?: string;
23
+ initial: Json;
24
+ adapter?: DocAdapter;
25
+ store?: RevisionStore;
26
+ log?: EventLog;
27
+ clashes?: ClashStore;
28
+ snapshot?: SnapshotStore;
29
+ keptStates?: number;
30
+ save?: SavePolicy;
31
+ autosave?: {
32
+ quietMs: number;
33
+ maxMs: number;
34
+ } | false;
35
+ wins?: (actor: string) => boolean;
36
+ clock?: () => string;
37
+ }
38
+ export interface WriteRequest {
39
+ version: number;
40
+ base?: Json;
41
+ delta?: Delta;
42
+ state?: Json;
43
+ actor: string;
44
+ reason?: string;
45
+ commit?: boolean;
46
+ prefer?: 'writer' | 'current';
47
+ via?: string;
48
+ }
49
+ export interface ClashRecord {
50
+ id: string;
51
+ path: Path;
52
+ kept: Json | null;
53
+ dropped: Json | null;
54
+ kept_actor: string;
55
+ dropped_actor: string;
56
+ }
57
+ export type WriteStatus = 'ok' | 'rebased' | 'rejected' | 'stale';
58
+ export type RevertScope = 'state' | 'change';
59
+ export interface RevertOptions {
60
+ actor?: string;
61
+ reason?: string;
62
+ scope?: RevertScope;
63
+ dryRun?: boolean;
64
+ onClash?: 'keep-current' | 'refuse';
65
+ }
66
+ export interface UndoOptions {
67
+ actor?: string;
68
+ stack?: boolean;
69
+ scope?: RevertScope;
70
+ onClash?: RevertOptions['onClash'];
71
+ }
72
+ export interface WriteResult {
73
+ status: WriteStatus;
74
+ version: number;
75
+ changed: boolean;
76
+ findings: Finding[];
77
+ clashes: ClashRecord[];
78
+ state?: Json;
79
+ revision?: string;
80
+ }
81
+ export declare class Workcopy {
82
+ readonly name: string;
83
+ readonly log: EventLog;
84
+ private readonly adapter;
85
+ private readonly store;
86
+ private readonly clashStore;
87
+ private readonly snapshotStore;
88
+ private readonly keptStates;
89
+ private readonly policy;
90
+ private readonly wins;
91
+ private readonly clock;
92
+ private draft;
93
+ private versionNo;
94
+ private lastWriter;
95
+ private readonly remembered;
96
+ private readonly open;
97
+ private closedIds;
98
+ private contentIds;
99
+ private pending;
100
+ private quietTimer;
101
+ private maxTimer;
102
+ private clashCount;
103
+ private revisionCount;
104
+ private readonly initialState;
105
+ constructor(options: WorkcopyOptions);
106
+ get initial(): Json;
107
+ get pristine(): boolean;
108
+ get seq(): number;
109
+ get closedClashes(): string[];
110
+ useContentClashIds(): void;
111
+ get savePolicy(): SavePolicy;
112
+ get version(): number;
113
+ get state(): Json;
114
+ get clashes(): ClashRecord[];
115
+ get head(): Revision;
116
+ private last;
117
+ revisions(): Revision[];
118
+ revisionsSince(revisionId: string | null): Revision[];
119
+ fork(state?: Json): Workcopy;
120
+ write(req: WriteRequest): WriteResult;
121
+ commit(): Revision | undefined;
122
+ turnEnded(): Revision | undefined;
123
+ actorsSince(seq: number, ignoreVia?: string): string[];
124
+ revert(revisionId: string, options?: RevertOptions): WriteResult;
125
+ private revertChange;
126
+ undo(options?: UndoOptions): WriteResult;
127
+ private nextToUndo;
128
+ resolveClash(id: string, choice: 'kept' | 'dropped', actor?: string): WriteResult;
129
+ reconcile(req: SyncRequest): SyncResponse;
130
+ dispose(): void;
131
+ private recordClash;
132
+ private openClash;
133
+ private closeClash;
134
+ private persistClashes;
135
+ private persist;
136
+ adoptClashes(records: ClashRecord[], closed: string[]): {
137
+ opened: ClashRecord[];
138
+ closed: string[];
139
+ };
140
+ private accept;
141
+ private commitRevert;
142
+ private revision;
143
+ private schedule;
144
+ private clearTimers;
145
+ }