@agentshouse/mdruntime 0.1.0-cb95ca2c884cf → 0.1.0-cba6f2439bb25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -15
- package/dist/adapter.d.ts +113 -33
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +5 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +38 -4
- package/dist/attempt.d.ts.map +1 -1
- package/dist/attempt.js +14 -1
- package/dist/binary.d.ts +0 -5
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +1 -1
- package/dist/bootstrap.d.ts +28 -9
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +178 -80
- package/dist/chain.d.ts +11 -0
- package/dist/chain.d.ts.map +1 -0
- package/dist/chain.js +64 -0
- package/dist/change-set.d.ts +9 -14
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +11 -63
- package/dist/change.d.ts +31 -1
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +10 -1
- package/dist/client.d.ts +24 -12
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +98 -11
- package/dist/collection.d.ts +12 -6
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +51 -76
- package/dist/compile.d.ts +16 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +771 -0
- package/dist/connection.d.ts +46 -16
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +3666 -820
- package/dist/conversation.d.ts +33 -12
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +659 -201
- package/dist/digest.d.ts +7 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +113 -0
- package/dist/durability.d.ts +5 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +20 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +151 -0
- package/dist/fence.d.ts +6 -0
- package/dist/fence.d.ts.map +1 -0
- package/dist/fence.js +10 -0
- package/dist/file.d.ts +2 -19
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +7 -122
- package/dist/fulltext.d.ts +27 -0
- package/dist/fulltext.d.ts.map +1 -0
- package/dist/fulltext.js +370 -0
- package/dist/host.d.ts +15 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +128 -16
- package/dist/identity.d.ts +1 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +3 -0
- package/dist/index.d.ts +14 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/live.d.ts +22 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +124 -0
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +208 -0
- package/dist/memory.d.ts +11 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +98 -28
- package/dist/messages.d.ts +28 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +90 -0
- package/dist/model.d.ts +10 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +17 -2
- package/dist/name.d.ts +4 -0
- package/dist/name.d.ts.map +1 -0
- package/dist/name.js +122 -0
- package/dist/observation.d.ts +20 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +113 -12
- package/dist/opened.d.ts +22 -0
- package/dist/opened.d.ts.map +1 -0
- package/dist/opened.js +107 -0
- package/dist/outcome.d.ts +49 -4
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +40 -0
- package/dist/overlay.d.ts +3 -4
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +100 -182
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/query.d.ts +66 -4
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +48 -7
- package/dist/reach.d.ts +18 -6
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +225 -71
- package/dist/react.d.ts +8 -6
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -17
- package/dist/readiness.d.ts +63 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +33 -0
- package/dist/reads.d.ts +11 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +91 -0
- package/dist/recovery.d.ts +25 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +198 -0
- package/dist/refresh.d.ts +16 -15
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +113 -49
- package/dist/replica.d.ts +56 -33
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +298 -151
- package/dist/room-draft.d.ts +34 -4
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +105 -31
- package/dist/rows.d.ts +37 -37
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +173 -104
- package/dist/save.d.ts +52 -9
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +539 -171
- package/dist/search.d.ts +39 -28
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +37 -105
- package/dist/seed.d.ts +16 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +75 -0
- package/dist/shared.d.ts +16 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +431 -0
- package/dist/status.d.ts +9 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -1
- package/dist/store.d.ts +114 -75
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +342 -442
- package/dist/stored.d.ts +135 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +568 -0
- package/dist/tables.d.ts +352 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +621 -0
- package/dist/turn.d.ts +9 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +75 -0
- package/dist/validation.d.ts +30 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +162 -0
- package/dist/windows.d.ts +22 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +89 -0
- package/dist/wire.d.ts +168 -32
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +56 -31
- package/dist/words.d.ts +19 -0
- package/dist/words.d.ts.map +1 -0
- package/dist/words.js +156 -0
- package/package.json +22 -19
- package/AGENTS.md +0 -299
- package/dist/chat/acts.d.ts +0 -34
- package/dist/chat/acts.d.ts.map +0 -1
- package/dist/chat/acts.js +0 -36
- package/dist/chat/context.d.ts +0 -3
- package/dist/chat/context.d.ts.map +0 -1
- package/dist/chat/context.js +0 -10
- package/dist/chat/input.d.ts +0 -9
- package/dist/chat/input.d.ts.map +0 -1
- package/dist/chat/input.js +0 -99
- package/dist/chat/kit.d.ts +0 -60
- package/dist/chat/kit.d.ts.map +0 -1
- package/dist/chat/kit.js +0 -123
- package/dist/chat/lasting.d.ts +0 -6
- package/dist/chat/lasting.d.ts.map +0 -1
- package/dist/chat/lasting.js +0 -19
- package/dist/chat/list.d.ts +0 -20
- package/dist/chat/list.d.ts.map +0 -1
- package/dist/chat/list.js +0 -59
- package/dist/chat/markdown.d.ts +0 -19
- package/dist/chat/markdown.d.ts.map +0 -1
- package/dist/chat/markdown.js +0 -187
- package/dist/chat/message.d.ts +0 -6
- package/dist/chat/message.d.ts.map +0 -1
- package/dist/chat/message.js +0 -192
- package/dist/chat/messages.d.ts +0 -21
- package/dist/chat/messages.d.ts.map +0 -1
- package/dist/chat/messages.js +0 -151
- package/dist/chat/name.d.ts +0 -6
- package/dist/chat/name.d.ts.map +0 -1
- package/dist/chat/name.js +0 -37
- package/dist/chat/opened.d.ts +0 -11
- package/dist/chat/opened.d.ts.map +0 -1
- package/dist/chat/opened.js +0 -17
- package/dist/chat/overlay.d.ts +0 -31
- package/dist/chat/overlay.d.ts.map +0 -1
- package/dist/chat/overlay.js +0 -97
- package/dist/chat/parts.d.ts +0 -57
- package/dist/chat/parts.d.ts.map +0 -1
- package/dist/chat/parts.js +0 -119
- package/dist/chat/process.d.ts +0 -20
- package/dist/chat/process.d.ts.map +0 -1
- package/dist/chat/process.js +0 -32
- package/dist/chat/provider.d.ts +0 -63
- package/dist/chat/provider.d.ts.map +0 -1
- package/dist/chat/provider.js +0 -645
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -80
- package/dist/chat/questions.d.ts +0 -31
- package/dist/chat/questions.d.ts.map +0 -1
- package/dist/chat/questions.js +0 -111
- package/dist/chat/read.d.ts +0 -5
- package/dist/chat/read.d.ts.map +0 -1
- package/dist/chat/read.js +0 -13
- package/dist/chat/ready.d.ts +0 -33
- package/dist/chat/ready.d.ts.map +0 -1
- package/dist/chat/ready.js +0 -91
- package/dist/chat/style.d.ts +0 -4
- package/dist/chat/style.d.ts.map +0 -1
- package/dist/chat/style.js +0 -302
- package/dist/chat.d.ts +0 -14
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js +0 -8
- package/dist/read-side.d.ts +0 -18
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -440
package/dist/replica.js
CHANGED
|
@@ -1,174 +1,199 @@
|
|
|
1
1
|
import { equalValue, parse } from '@agentshouse/mdmodel';
|
|
2
2
|
import { immutable, landing } from './change.js';
|
|
3
|
-
import { collectionOf
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { collectionOf } from './collection.js';
|
|
4
|
+
import { storedModel } from './model.js';
|
|
5
|
+
import { acceptedBinaries, overlaying } from './overlay.js';
|
|
6
|
+
import { effectiveIn, rewriting } from './save.js';
|
|
7
|
+
import { ROW_WEIGHT } from './turn.js';
|
|
8
|
+
export function compositionOf(record, builtIn) {
|
|
7
9
|
return {
|
|
8
10
|
model: record.model,
|
|
9
11
|
selection: record.typedSelection === null
|
|
10
12
|
? null
|
|
11
|
-
: { roots: record.typedSelection.roots, model:
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export function confirmedOf(record, previous) {
|
|
15
|
-
return {
|
|
16
|
-
record,
|
|
17
|
-
collection: collectionOf(record.documents, compositionOf(record), previous?.collection),
|
|
13
|
+
: { roots: record.typedSelection.roots, model: builtIn },
|
|
18
14
|
};
|
|
19
15
|
}
|
|
20
16
|
export function sameMembership(record, other) {
|
|
21
17
|
return (JSON.stringify(record.typedSelection?.roots ?? null) ===
|
|
22
18
|
JSON.stringify(other.typedSelection?.roots ?? null));
|
|
23
19
|
}
|
|
24
|
-
export function
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return refused;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else if (textChanged) {
|
|
42
|
-
const refused = unreadable(record.documents, previous?.record.documents);
|
|
43
|
-
if (refused !== null)
|
|
44
|
-
return refused;
|
|
20
|
+
export function storedRecord(record) {
|
|
21
|
+
const { key: _key, ...stored } = record;
|
|
22
|
+
return JSON.stringify({ ...stored, model: storedModel(stored.model) });
|
|
23
|
+
}
|
|
24
|
+
const PROBES = new Set([
|
|
25
|
+
'then',
|
|
26
|
+
'toJSON',
|
|
27
|
+
'constructor',
|
|
28
|
+
'valueOf',
|
|
29
|
+
'toString',
|
|
30
|
+
]);
|
|
31
|
+
class UnreadPath extends Error {
|
|
32
|
+
constructor(path) {
|
|
33
|
+
super(`the replica slice holds no row for ${path}`);
|
|
45
34
|
}
|
|
46
|
-
return { kind: 'staged', confirmed: confirmedOf(record, previous) };
|
|
47
35
|
}
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
function strict(values, held) {
|
|
37
|
+
const guard = (property) => {
|
|
38
|
+
if (typeof property === 'string' && !held.has(property) && !PROBES.has(property)) {
|
|
39
|
+
throw new UnreadPath(property);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return new Proxy(values, {
|
|
43
|
+
get(target, property, receiver) {
|
|
44
|
+
guard(property);
|
|
45
|
+
return Reflect.get(target, property, receiver);
|
|
46
|
+
},
|
|
47
|
+
has(target, property) {
|
|
48
|
+
guard(property);
|
|
49
|
+
return Reflect.has(target, property);
|
|
50
|
+
},
|
|
51
|
+
getOwnPropertyDescriptor(target, property) {
|
|
52
|
+
guard(property);
|
|
53
|
+
return Reflect.getOwnPropertyDescriptor(target, property);
|
|
54
|
+
},
|
|
55
|
+
});
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
for (const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
export function* slicing(entries, paths) {
|
|
58
|
+
const held = new Set(paths);
|
|
59
|
+
for (const entry of entries)
|
|
60
|
+
held.add(entry.path);
|
|
61
|
+
const documents = {};
|
|
62
|
+
const binaries = {};
|
|
63
|
+
const revisions = {};
|
|
64
|
+
const fileIds = {};
|
|
65
|
+
const changes = {};
|
|
66
|
+
const written = {};
|
|
67
|
+
for (const entry of entries) {
|
|
68
|
+
if (entry.binary !== null)
|
|
69
|
+
binaries[entry.path] = entry.binary;
|
|
70
|
+
else if (entry.content !== null)
|
|
71
|
+
documents[entry.path] = entry.content;
|
|
72
|
+
if (entry.revision !== null)
|
|
73
|
+
revisions[entry.path] = entry.revision;
|
|
74
|
+
if (entry.fileId !== null)
|
|
75
|
+
fileIds[entry.path] = entry.fileId;
|
|
76
|
+
if (entry.change !== null)
|
|
77
|
+
changes[entry.path] = entry.change;
|
|
78
|
+
if (entry.written !== null)
|
|
79
|
+
written[entry.path] = entry.written;
|
|
80
|
+
yield ROW_WEIGHT;
|
|
66
81
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
82
|
+
return {
|
|
83
|
+
documents: strict(documents, held),
|
|
84
|
+
binaries: strict(binaries, held),
|
|
85
|
+
revisions: strict(revisions, held),
|
|
86
|
+
fileIds: strict(fileIds, held),
|
|
87
|
+
changes: strict(changes, held),
|
|
88
|
+
written: strict(written, held),
|
|
89
|
+
held,
|
|
90
|
+
};
|
|
71
91
|
}
|
|
72
|
-
export function
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
92
|
+
export function entryAt(layer, path) {
|
|
93
|
+
const content = layer.documents[path];
|
|
94
|
+
const binary = layer.binaries[path];
|
|
95
|
+
if (content === undefined && binary === undefined)
|
|
96
|
+
return null;
|
|
97
|
+
return {
|
|
98
|
+
path,
|
|
99
|
+
content: content ?? null,
|
|
100
|
+
binary: binary ?? null,
|
|
101
|
+
revision: layer.revisions[path] ?? null,
|
|
102
|
+
fileId: layer.fileIds[path] ?? null,
|
|
103
|
+
change: layer.changes[path] ?? null,
|
|
104
|
+
written: layer.written?.[path] ?? null,
|
|
80
105
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
}
|
|
107
|
+
export function* slicingWith(slice, set, removed) {
|
|
108
|
+
const entries = new Map();
|
|
109
|
+
for (const path of slice.held) {
|
|
110
|
+
const entry = entryAt(slice, path);
|
|
111
|
+
if (entry !== null)
|
|
112
|
+
entries.set(path, { ...entry, type: null });
|
|
113
|
+
yield ROW_WEIGHT;
|
|
84
114
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
115
|
+
for (const path of removed)
|
|
116
|
+
entries.delete(path);
|
|
117
|
+
for (const entry of set)
|
|
118
|
+
entries.set(entry.path, { ...entry, type: null });
|
|
119
|
+
return yield* slicing([...entries.values()], [...slice.held, ...set.map(({ path }) => path), ...removed]);
|
|
120
|
+
}
|
|
121
|
+
function changePaths(change) {
|
|
122
|
+
return change.kind === 'move' ? [change.path, change.to] : [change.path];
|
|
123
|
+
}
|
|
124
|
+
export function touchedBy(queue) {
|
|
125
|
+
const paths = new Set();
|
|
126
|
+
for (const batch of queue) {
|
|
127
|
+
for (const change of batch.changes)
|
|
128
|
+
for (const path of changePaths(change))
|
|
129
|
+
paths.add(path);
|
|
130
|
+
for (const precondition of batch.preconditions)
|
|
131
|
+
paths.add(precondition.path);
|
|
132
|
+
for (const move of batch.between?.moves ?? [])
|
|
133
|
+
paths.add(move.path);
|
|
91
134
|
}
|
|
92
|
-
return
|
|
93
|
-
...confirmed.record,
|
|
94
|
-
roomVersion,
|
|
95
|
-
documents: nextDocuments,
|
|
96
|
-
revisions: nextRevisions,
|
|
97
|
-
changes: nextChanges,
|
|
98
|
-
written: nextWritten,
|
|
99
|
-
binaries: returnedBinaries(confirmed.record.binaries, submitted, accepted),
|
|
100
|
-
}, confirmed);
|
|
135
|
+
return paths;
|
|
101
136
|
}
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
old.collection.composition.selection?.model === composition.selection?.model &&
|
|
115
|
-
JSON.stringify(old.collection.composition.selection?.roots) ===
|
|
116
|
-
JSON.stringify(composition.selection?.roots);
|
|
117
|
-
const collection = hasMove
|
|
118
|
-
? reuseRewrite
|
|
119
|
-
? old.collection
|
|
120
|
-
: collectionOf(before.documents, composition, old?.collection ?? confirmed.collection)
|
|
121
|
-
: undefined;
|
|
122
|
-
const effective = collection === undefined
|
|
123
|
-
? batch
|
|
124
|
-
: reuseRewrite
|
|
125
|
-
? old.effective
|
|
126
|
-
: providerRewritten(batch, { ...before, collection });
|
|
127
|
-
layer =
|
|
128
|
-
old === undefined
|
|
129
|
-
? overlay(before, [effective])
|
|
130
|
-
: overlayChanged(before, [effective], old.before, [old.effective], old.after);
|
|
131
|
-
replay.push({
|
|
132
|
-
id: batch.id,
|
|
133
|
-
before,
|
|
134
|
-
after: layer,
|
|
135
|
-
effective,
|
|
136
|
-
...(collection === undefined ? {} : { collection }),
|
|
137
|
-
});
|
|
137
|
+
export function movedBy(queue, locator) {
|
|
138
|
+
const paths = new Set();
|
|
139
|
+
for (const batch of queue) {
|
|
140
|
+
if (!rewriting(batch, locator))
|
|
141
|
+
continue;
|
|
142
|
+
for (const change of batch.changes)
|
|
143
|
+
if (change.kind === 'move')
|
|
144
|
+
paths.add(change.path);
|
|
145
|
+
if (batch.between?.source.room === locator) {
|
|
146
|
+
for (const move of batch.between.moves)
|
|
147
|
+
paths.add(move.path);
|
|
148
|
+
}
|
|
138
149
|
}
|
|
139
|
-
return
|
|
150
|
+
return paths;
|
|
140
151
|
}
|
|
141
|
-
export function
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
export function* replaying(confirmed, queue, locator, composition) {
|
|
153
|
+
let layer = confirmed;
|
|
154
|
+
const touched = new Set();
|
|
155
|
+
for (const batch of queue) {
|
|
156
|
+
const effective = rewriting(batch, locator)
|
|
157
|
+
? yield* effectiveIn(batch, locator, {
|
|
158
|
+
...layer,
|
|
159
|
+
collection: collectionOf(layer.documents, composition),
|
|
160
|
+
})
|
|
161
|
+
: batch;
|
|
162
|
+
for (const change of effective.changes)
|
|
163
|
+
for (const path of changePaths(change))
|
|
164
|
+
touched.add(path);
|
|
165
|
+
layer = yield* overlaying(layer, [effective]);
|
|
166
|
+
yield ROW_WEIGHT;
|
|
156
167
|
}
|
|
157
|
-
const { layer, replay } = predicted(confirmed, batches, previous);
|
|
158
168
|
return {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
replay,
|
|
162
|
-
visible: {
|
|
163
|
-
...layer,
|
|
164
|
-
collection: collectionOf(layer.documents, compositionOf(confirmed.record), previous?.visible.collection ?? confirmed.collection),
|
|
165
|
-
},
|
|
169
|
+
visible: { ...layer, collection: collectionOf(layer.documents, composition) },
|
|
170
|
+
touched,
|
|
166
171
|
};
|
|
167
172
|
}
|
|
173
|
+
export function* overlayOf(visible, touched) {
|
|
174
|
+
const rows = [];
|
|
175
|
+
for (const path of touched) {
|
|
176
|
+
yield ROW_WEIGHT;
|
|
177
|
+
const entry = entryAt(visible, path);
|
|
178
|
+
rows.push(entry === null
|
|
179
|
+
? {
|
|
180
|
+
path,
|
|
181
|
+
present: false,
|
|
182
|
+
content: null,
|
|
183
|
+
binary: null,
|
|
184
|
+
revision: null,
|
|
185
|
+
fileId: null,
|
|
186
|
+
change: null,
|
|
187
|
+
written: null,
|
|
188
|
+
}
|
|
189
|
+
: { ...entry, written: null, present: true });
|
|
190
|
+
}
|
|
191
|
+
return rows;
|
|
192
|
+
}
|
|
168
193
|
function present(layer, path) {
|
|
169
194
|
return layer.documents[path] !== undefined || layer.binaries[path] !== undefined;
|
|
170
195
|
}
|
|
171
|
-
function holds(layer, preconditions) {
|
|
196
|
+
export function holds(layer, preconditions) {
|
|
172
197
|
const parsed = new Map();
|
|
173
198
|
const documentAt = (path) => {
|
|
174
199
|
if (!parsed.has(path)) {
|
|
@@ -233,12 +258,19 @@ function effects(change) {
|
|
|
233
258
|
{ kind: 'present', path: change.to },
|
|
234
259
|
];
|
|
235
260
|
}
|
|
236
|
-
if (change.kind === 'binary')
|
|
261
|
+
if (change.kind === 'binary' || change.kind === 'arrival')
|
|
237
262
|
return [{ kind: 'present', path }];
|
|
238
263
|
return [{ kind: 'absent', path }];
|
|
239
264
|
}
|
|
240
265
|
export function landed(batch, confirmed, current = {}) {
|
|
241
|
-
const
|
|
266
|
+
const documents = new Proxy(confirmed.documents, {
|
|
267
|
+
get(target, property, receiver) {
|
|
268
|
+
if (typeof property === 'string' && Object.hasOwn(current, property))
|
|
269
|
+
return current[property];
|
|
270
|
+
return Reflect.get(target, property, receiver);
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
const layer = { ...confirmed, documents };
|
|
242
274
|
return batch.changes.every((change, index) => {
|
|
243
275
|
if (change.kind === 'replace' || (change.kind === 'create' && 'content' in change)) {
|
|
244
276
|
const at = landing(batch.changes, index, change.path);
|
|
@@ -256,32 +288,147 @@ export function landed(batch, confirmed, current = {}) {
|
|
|
256
288
|
});
|
|
257
289
|
});
|
|
258
290
|
}
|
|
259
|
-
|
|
291
|
+
function founded(batch, layer) {
|
|
292
|
+
let changed = false;
|
|
293
|
+
const preconditions = batch.preconditions.map((precondition) => {
|
|
294
|
+
if (precondition.kind !== 'content')
|
|
295
|
+
return precondition;
|
|
296
|
+
const revision = layer.revisions[precondition.path];
|
|
297
|
+
if (revision === undefined || layer.documents[precondition.path] !== precondition.content) {
|
|
298
|
+
return precondition;
|
|
299
|
+
}
|
|
300
|
+
changed = true;
|
|
301
|
+
return { kind: 'revision', path: precondition.path, revision };
|
|
302
|
+
});
|
|
303
|
+
return changed ? immutable({ ...batch, preconditions }) : batch;
|
|
304
|
+
}
|
|
305
|
+
export function* standing(confirmed, queue, withdrawable, local, locator, composition) {
|
|
260
306
|
if (!queue.some(withdrawable))
|
|
261
|
-
return [];
|
|
262
|
-
|
|
263
|
-
let layer = confirmed.record;
|
|
307
|
+
return { withdrawn: [], kept: queue };
|
|
308
|
+
let layer = confirmed;
|
|
264
309
|
const withdrawn = [];
|
|
310
|
+
const kept = [];
|
|
265
311
|
for (const batch of queue) {
|
|
266
312
|
if (withdrawable(batch) && !holds(layer, batch.preconditions)) {
|
|
267
313
|
withdrawn.push(batch);
|
|
268
314
|
continue;
|
|
269
315
|
}
|
|
270
|
-
const effective = batch
|
|
271
|
-
?
|
|
316
|
+
const effective = rewriting(batch, locator)
|
|
317
|
+
? yield* effectiveIn(batch, locator, {
|
|
272
318
|
...layer,
|
|
273
319
|
collection: collectionOf(layer.documents, composition),
|
|
274
320
|
})
|
|
275
321
|
: batch;
|
|
276
322
|
let unapplied = false;
|
|
277
|
-
const next =
|
|
323
|
+
const next = yield* overlaying(layer, [effective], () => {
|
|
278
324
|
unapplied = true;
|
|
279
325
|
});
|
|
280
326
|
if (local && unapplied) {
|
|
281
327
|
withdrawn.push(batch);
|
|
282
328
|
continue;
|
|
283
329
|
}
|
|
330
|
+
kept.push(local || !withdrawable(batch) ? batch : founded(batch, layer));
|
|
284
331
|
layer = next;
|
|
285
332
|
}
|
|
286
|
-
return withdrawn;
|
|
333
|
+
return { withdrawn, kept };
|
|
334
|
+
}
|
|
335
|
+
export function returnedPaths(submitted, accepted) {
|
|
336
|
+
const paths = new Set([
|
|
337
|
+
...Object.keys(accepted.documents),
|
|
338
|
+
...Object.keys(accepted.revisions),
|
|
339
|
+
...Object.keys(accepted.fileIds ?? {}),
|
|
340
|
+
...Object.keys(accepted.changes),
|
|
341
|
+
...Object.keys(accepted.binaryFiles ?? {}),
|
|
342
|
+
...accepted.removals,
|
|
343
|
+
]);
|
|
344
|
+
for (const change of submitted.changes) {
|
|
345
|
+
if (change.kind === 'move') {
|
|
346
|
+
paths.add(change.path);
|
|
347
|
+
paths.add(change.to);
|
|
348
|
+
}
|
|
349
|
+
if (change.kind === 'arrival')
|
|
350
|
+
paths.add(change.path);
|
|
351
|
+
}
|
|
352
|
+
return paths;
|
|
353
|
+
}
|
|
354
|
+
export function* returning(confirmed, submitted, accepted, writtenAt) {
|
|
355
|
+
const documents = new Map();
|
|
356
|
+
const binaries = new Map();
|
|
357
|
+
const revisions = new Map();
|
|
358
|
+
const fileIds = new Map();
|
|
359
|
+
const changes = new Map();
|
|
360
|
+
const written = new Map();
|
|
361
|
+
const read = (changed, held, path) => (changed.has(path) ? changed.get(path) : held[path]);
|
|
362
|
+
for (const [path, content] of Object.entries(accepted.documents)) {
|
|
363
|
+
yield ROW_WEIGHT;
|
|
364
|
+
documents.set(path, content);
|
|
365
|
+
fileIds.set(path, undefined);
|
|
366
|
+
written.set(path, writtenAt);
|
|
367
|
+
}
|
|
368
|
+
for (const [path, revision] of Object.entries(accepted.revisions)) {
|
|
369
|
+
yield ROW_WEIGHT;
|
|
370
|
+
revisions.set(path, revision);
|
|
371
|
+
fileIds.set(path, undefined);
|
|
372
|
+
if (confirmed.revisions[path] !== revision)
|
|
373
|
+
changes.set(path, undefined);
|
|
374
|
+
}
|
|
375
|
+
for (const [path, fileId] of Object.entries(accepted.fileIds ?? {}))
|
|
376
|
+
fileIds.set(path, fileId);
|
|
377
|
+
for (const [path, change] of Object.entries(accepted.changes))
|
|
378
|
+
changes.set(path, change);
|
|
379
|
+
for (const path of accepted.removals) {
|
|
380
|
+
documents.set(path, undefined);
|
|
381
|
+
revisions.set(path, undefined);
|
|
382
|
+
fileIds.set(path, undefined);
|
|
383
|
+
changes.set(path, undefined);
|
|
384
|
+
written.set(path, undefined);
|
|
385
|
+
}
|
|
386
|
+
for (const change of submitted.changes) {
|
|
387
|
+
if (change.kind === 'arrival' && 'binary' in change) {
|
|
388
|
+
if (accepted.revisions[change.path] !== undefined) {
|
|
389
|
+
binaries.set(change.path, { state: 'accepted', ...change.binary });
|
|
390
|
+
}
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
if (change.kind !== 'move')
|
|
394
|
+
continue;
|
|
395
|
+
const moved = read(binaries, confirmed.binaries, change.path);
|
|
396
|
+
if (moved === undefined || accepted.revisions[change.to] === undefined)
|
|
397
|
+
continue;
|
|
398
|
+
binaries.set(change.to, moved);
|
|
399
|
+
binaries.set(change.path, undefined);
|
|
400
|
+
}
|
|
401
|
+
for (const [path, binary] of acceptedBinaries(accepted.binaryFiles ?? {}))
|
|
402
|
+
binaries.set(path, binary);
|
|
403
|
+
for (const path of accepted.removals)
|
|
404
|
+
binaries.set(path, undefined);
|
|
405
|
+
const paths = new Set([
|
|
406
|
+
...documents.keys(),
|
|
407
|
+
...binaries.keys(),
|
|
408
|
+
...revisions.keys(),
|
|
409
|
+
...fileIds.keys(),
|
|
410
|
+
...changes.keys(),
|
|
411
|
+
...written.keys(),
|
|
412
|
+
]);
|
|
413
|
+
const set = [];
|
|
414
|
+
const removed = [];
|
|
415
|
+
for (const path of paths) {
|
|
416
|
+
yield ROW_WEIGHT;
|
|
417
|
+
const content = read(documents, confirmed.documents, path);
|
|
418
|
+
const binary = read(binaries, confirmed.binaries, path);
|
|
419
|
+
if (content === undefined && binary === undefined) {
|
|
420
|
+
removed.push(path);
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
set.push({
|
|
424
|
+
path,
|
|
425
|
+
content: binary === undefined ? (content ?? null) : null,
|
|
426
|
+
binary: binary ?? null,
|
|
427
|
+
revision: read(revisions, confirmed.revisions, path) ?? null,
|
|
428
|
+
fileId: read(fileIds, confirmed.fileIds, path) ?? null,
|
|
429
|
+
change: read(changes, confirmed.changes, path) ?? null,
|
|
430
|
+
written: read(written, confirmed.written, path) ?? null,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
return { set, removed };
|
|
287
434
|
}
|
package/dist/room-draft.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export type RoomDraftParts = {
|
|
|
32
32
|
readonly creation?: RoomDraftCreation;
|
|
33
33
|
readonly move?: {
|
|
34
34
|
readonly to: string;
|
|
35
|
+
readonly room?: string;
|
|
35
36
|
readonly base?: string | null;
|
|
36
37
|
};
|
|
37
38
|
readonly removal?: {
|
|
@@ -39,11 +40,12 @@ export type RoomDraftParts = {
|
|
|
39
40
|
};
|
|
40
41
|
readonly file?: {
|
|
41
42
|
readonly blob: Blob;
|
|
43
|
+
readonly base?: string | null;
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
46
|
export type HeldFile = {
|
|
45
|
-
readonly blob: Blob;
|
|
46
47
|
readonly localId: string;
|
|
48
|
+
readonly name?: string;
|
|
47
49
|
readonly byteLength: number;
|
|
48
50
|
readonly mediaType: string;
|
|
49
51
|
readonly sha256: string;
|
|
@@ -69,6 +71,7 @@ type HeldParts = {
|
|
|
69
71
|
readonly creation?: RoomDraftCreation;
|
|
70
72
|
readonly move?: {
|
|
71
73
|
readonly to: string;
|
|
74
|
+
readonly room?: string;
|
|
72
75
|
readonly base: string | null;
|
|
73
76
|
};
|
|
74
77
|
readonly removal?: {
|
|
@@ -87,7 +90,7 @@ type ChangedUnderneath = {
|
|
|
87
90
|
readonly file?: string | null;
|
|
88
91
|
};
|
|
89
92
|
export type ReturnReason = ProviderRefusal & {
|
|
90
|
-
readonly kind: 'conflicted' | 'rejected' | 'expired' | 'withdrawn'
|
|
93
|
+
readonly kind: Open<'conflicted' | 'rejected' | 'expired' | 'withdrawn'>;
|
|
91
94
|
};
|
|
92
95
|
export declare function returnedBy(kind: 'expired' | 'withdrawn'): ReturnReason;
|
|
93
96
|
export type RoomDraft = {
|
|
@@ -110,7 +113,7 @@ export type RoomDraftWrite = {
|
|
|
110
113
|
export declare function staleWrite(current: RoomDraft | null): RoomDraftWrite;
|
|
111
114
|
export type ChangedPart = {
|
|
112
115
|
readonly path: string;
|
|
113
|
-
readonly part: Open<'field' | 'section' | 'preamble' | 'markdown' | '
|
|
116
|
+
readonly part: Open<'field' | 'section' | 'preamble' | 'markdown' | 'move' | 'removal' | 'file'>;
|
|
114
117
|
readonly name?: string;
|
|
115
118
|
};
|
|
116
119
|
export type RoomDraftRecord = {
|
|
@@ -125,15 +128,42 @@ export type SavedDraft = {
|
|
|
125
128
|
readonly parts: HeldParts;
|
|
126
129
|
};
|
|
127
130
|
export declare function readParts(value: unknown): RoomDraftParts;
|
|
131
|
+
export declare function gatheredParts(earlier: unknown, later: unknown): unknown;
|
|
128
132
|
export declare function held(current: HeldParts | undefined, parts: RoomDraftParts, file?: HeldFile): HeldParts;
|
|
129
133
|
export declare function underneath(parts: HeldParts, path: string, visible: VisibleLayer | undefined): ChangedUnderneath;
|
|
130
134
|
export declare function heldFile(blob: Blob, base: string | null): Promise<HeldFile>;
|
|
131
135
|
export declare function binaryBase(visible: VisibleLayer | undefined, path: string): string | null;
|
|
132
|
-
export declare function changedParts(path: string,
|
|
136
|
+
export declare function changedParts(path: string, parts: HeldParts, visible: VisibleLayer | undefined): readonly ChangedPart[];
|
|
137
|
+
export type TextParts = {
|
|
138
|
+
readonly fields?: Readonly<Record<string, {
|
|
139
|
+
readonly value: unknown;
|
|
140
|
+
}>>;
|
|
141
|
+
readonly sections?: Readonly<Record<string, {
|
|
142
|
+
readonly value: string;
|
|
143
|
+
}>>;
|
|
144
|
+
readonly preamble?: {
|
|
145
|
+
readonly value: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
export declare function partsAfter(markdown: string, parts: TextParts): string;
|
|
133
149
|
export declare function returnedInto(existing: HeldParts | undefined, returned: HeldParts): HeldParts;
|
|
134
150
|
export declare function moveTarget(move: {
|
|
135
151
|
readonly to: string;
|
|
136
152
|
}): string;
|
|
153
|
+
export declare function readSavedParts(named: readonly {
|
|
154
|
+
readonly path: string;
|
|
155
|
+
readonly parts: unknown;
|
|
156
|
+
}[]): readonly {
|
|
157
|
+
readonly path: string;
|
|
158
|
+
readonly parts: RoomDraftParts;
|
|
159
|
+
}[];
|
|
160
|
+
export declare function partsChanges(named: readonly {
|
|
161
|
+
readonly path: string;
|
|
162
|
+
readonly parts: unknown;
|
|
163
|
+
}[]): {
|
|
164
|
+
readonly changes: readonly Change[];
|
|
165
|
+
readonly preconditions: readonly Precondition[];
|
|
166
|
+
};
|
|
137
167
|
export declare function changesOf(path: string, parts: HeldParts): {
|
|
138
168
|
changes: readonly Change[];
|
|
139
169
|
bases: readonly Precondition[];
|
package/dist/room-draft.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-draft.d.ts","sourceRoot":"","sources":["../src/room-draft.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"room-draft.d.ts","sourceRoot":"","sources":["../src/room-draft.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA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