@agentshouse/mdruntime 0.1.0-c969b8dee6cc8 → 0.1.0-c96e80d38e5f0
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 +19 -16
- package/dist/adapter.d.ts +134 -76
- 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/binary.d.ts +0 -5
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +1 -1
- package/dist/bootstrap.d.ts +25 -10
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +180 -103
- 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 -16
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +11 -89
- 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 +13 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +80 -7
- package/dist/collection.d.ts +10 -21
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +39 -291
- package/dist/compile.d.ts +16 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +789 -0
- package/dist/connection.d.ts +19 -15
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +3020 -1417
- package/dist/conversation.d.ts +23 -14
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +337 -179
- 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 +2 -5
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +4 -1
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +19 -23
- package/dist/file.d.ts +2 -19
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +7 -122
- package/dist/host.d.ts +4 -10
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +49 -31
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +14 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/live.d.ts +22 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +123 -0
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +218 -0
- package/dist/memory.d.ts +11 -7
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +198 -107
- package/dist/messages.d.ts +28 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +89 -0
- package/dist/model.d.ts +6 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -10
- 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 +13 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +84 -0
- 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 +40 -8
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +38 -2
- package/dist/overlay.d.ts +2 -5
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +87 -172
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/phrase.d.ts +3 -0
- package/dist/phrase.d.ts.map +1 -0
- package/dist/phrase.js +8 -0
- package/dist/query.d.ts +15 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +33 -2
- package/dist/reach.d.ts +13 -4
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +200 -81
- package/dist/react.d.ts +1 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +14 -17
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +2 -8
- package/dist/recovery.d.ts +3 -2
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +34 -7
- package/dist/refresh.d.ts +18 -15
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +155 -58
- package/dist/replica.d.ts +54 -36
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +282 -189
- package/dist/room-draft.d.ts +22 -4
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +154 -67
- package/dist/rows.d.ts +39 -31
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +178 -101
- package/dist/save.d.ts +52 -14
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +513 -185
- package/dist/search.d.ts +12 -95
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -266
- package/dist/shared.d.ts +7 -3
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +119 -66
- package/dist/status.d.ts +4 -3
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -1
- package/dist/store.d.ts +91 -103
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +330 -693
- package/dist/stored.d.ts +162 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +549 -0
- package/dist/tables.d.ts +353 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +585 -0
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/turn.d.ts +5 -3
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +51 -21
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +101 -0
- package/dist/windows.d.ts +2 -6
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +30 -34
- package/dist/wire.d.ts +18 -5
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +6 -2
- package/package.json +18 -19
- package/AGENTS.md +0 -305
- package/dist/acquisition.d.ts +0 -14
- package/dist/acquisition.d.ts.map +0 -1
- package/dist/acquisition.js +0 -24
- package/dist/chat/acts.d.ts +0 -33
- 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/earlier.d.ts +0 -10
- package/dist/chat/earlier.d.ts.map +0 -1
- package/dist/chat/earlier.js +0 -54
- 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 -61
- 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 -27
- package/dist/chat/list.d.ts.map +0 -1
- package/dist/chat/list.js +0 -99
- package/dist/chat/markdown.d.ts +0 -20
- package/dist/chat/markdown.d.ts.map +0 -1
- package/dist/chat/markdown.js +0 -188
- 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 -22
- package/dist/chat/messages.d.ts.map +0 -1
- package/dist/chat/messages.js +0 -155
- 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 -628
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -69
- 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 -34
- 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 -25
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -767
- package/dist/reads.d.ts +0 -11
- package/dist/reads.d.ts.map +0 -1
- package/dist/reads.js +0 -98
package/dist/replica.js
CHANGED
|
@@ -1,208 +1,197 @@
|
|
|
1
1
|
import { equalValue, parse } from '@agentshouse/mdmodel';
|
|
2
2
|
import { immutable, landing } from './change.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
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) {
|
|
8
9
|
return {
|
|
9
10
|
model: record.model,
|
|
10
11
|
selection: record.typedSelection === null
|
|
11
12
|
? null
|
|
12
|
-
: { roots: record.typedSelection.roots, model:
|
|
13
|
+
: { roots: record.typedSelection.roots, model: builtIn },
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const revisions = shared(record.revisions);
|
|
19
|
-
const fileIds = shared(record.fileIds);
|
|
20
|
-
const changes = shared(record.changes);
|
|
21
|
-
const written = shared(record.written);
|
|
22
|
-
return documents === record.documents &&
|
|
23
|
-
binaries === record.binaries &&
|
|
24
|
-
revisions === record.revisions &&
|
|
25
|
-
fileIds === record.fileIds &&
|
|
26
|
-
changes === record.changes &&
|
|
27
|
-
written === record.written
|
|
28
|
-
? record
|
|
29
|
-
: { ...record, documents, binaries, revisions, fileIds, changes, written };
|
|
16
|
+
export function storedRecord(record) {
|
|
17
|
+
const { key: _key, ...stored } = record;
|
|
18
|
+
return JSON.stringify({ ...stored, model: storedModel(stored.model) });
|
|
30
19
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
function cleanly(record, previous) {
|
|
43
|
-
if (previous === undefined)
|
|
44
|
-
return false;
|
|
45
|
-
const before = previous.record;
|
|
46
|
-
return changedCleanly({ text: record.documents, binaries: record.binaries }, { text: before.documents, binaries: before.binaries, composition: compositionOf(before) }, compositionOf(record));
|
|
20
|
+
const PROBES = new Set([
|
|
21
|
+
'then',
|
|
22
|
+
'toJSON',
|
|
23
|
+
'constructor',
|
|
24
|
+
'valueOf',
|
|
25
|
+
'toString',
|
|
26
|
+
]);
|
|
27
|
+
class UnreadPath extends Error {
|
|
28
|
+
constructor(path) {
|
|
29
|
+
super(`the replica slice holds no row for ${path}`);
|
|
30
|
+
}
|
|
47
31
|
}
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (modeled &&
|
|
53
|
-
(textChanged ||
|
|
54
|
-
record.model !== previous?.record.model ||
|
|
55
|
-
record.selectionModel !== previous?.record.selectionModel) &&
|
|
56
|
-
!cleanly(record, previous)) {
|
|
57
|
-
const verdict = validateCollection(record.documents, Object.keys(record.binaries), compositionOf(record));
|
|
58
|
-
if (verdict.verdict === 'refuse' && verdict.rule !== 'model-unavailable') {
|
|
59
|
-
return { kind: 'refused', refusal: verdict };
|
|
60
|
-
}
|
|
61
|
-
if (verdict.verdict === 'refuse') {
|
|
62
|
-
const refused = unreadable(record.documents, previous?.record.documents);
|
|
63
|
-
if (refused !== null)
|
|
64
|
-
return refused;
|
|
32
|
+
function strict(values, held) {
|
|
33
|
+
const guard = (property) => {
|
|
34
|
+
if (typeof property === 'string' && !held.has(property) && !PROBES.has(property)) {
|
|
35
|
+
throw new UnreadPath(property);
|
|
65
36
|
}
|
|
37
|
+
};
|
|
38
|
+
return new Proxy(values, {
|
|
39
|
+
get(target, property, receiver) {
|
|
40
|
+
guard(property);
|
|
41
|
+
return Reflect.get(target, property, receiver);
|
|
42
|
+
},
|
|
43
|
+
has(target, property) {
|
|
44
|
+
guard(property);
|
|
45
|
+
return Reflect.has(target, property);
|
|
46
|
+
},
|
|
47
|
+
getOwnPropertyDescriptor(target, property) {
|
|
48
|
+
guard(property);
|
|
49
|
+
return Reflect.getOwnPropertyDescriptor(target, property);
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export function* slicing(entries, paths) {
|
|
54
|
+
const held = new Set(paths);
|
|
55
|
+
for (const entry of entries)
|
|
56
|
+
held.add(entry.path);
|
|
57
|
+
const documents = {};
|
|
58
|
+
const binaries = {};
|
|
59
|
+
const revisions = {};
|
|
60
|
+
const fileIds = {};
|
|
61
|
+
const changes = {};
|
|
62
|
+
const written = {};
|
|
63
|
+
for (const entry of entries) {
|
|
64
|
+
if (entry.binary !== null)
|
|
65
|
+
binaries[entry.path] = entry.binary;
|
|
66
|
+
else if (entry.content !== null)
|
|
67
|
+
documents[entry.path] = entry.content;
|
|
68
|
+
if (entry.revision !== null)
|
|
69
|
+
revisions[entry.path] = entry.revision;
|
|
70
|
+
if (entry.fileId !== null)
|
|
71
|
+
fileIds[entry.path] = entry.fileId;
|
|
72
|
+
if (entry.change !== null)
|
|
73
|
+
changes[entry.path] = entry.change;
|
|
74
|
+
if (entry.written !== null)
|
|
75
|
+
written[entry.path] = entry.written;
|
|
76
|
+
yield ROW_WEIGHT;
|
|
66
77
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
return {
|
|
79
|
+
documents: strict(documents, held),
|
|
80
|
+
binaries: strict(binaries, held),
|
|
81
|
+
revisions: strict(revisions, held),
|
|
82
|
+
fileIds: strict(fileIds, held),
|
|
83
|
+
changes: strict(changes, held),
|
|
84
|
+
written: strict(written, held),
|
|
85
|
+
held,
|
|
86
|
+
};
|
|
73
87
|
}
|
|
74
|
-
export function
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
88
|
+
export function entryAt(layer, path) {
|
|
89
|
+
const content = layer.documents[path];
|
|
90
|
+
const binary = layer.binaries[path];
|
|
91
|
+
if (content === undefined && binary === undefined)
|
|
92
|
+
return null;
|
|
93
|
+
return {
|
|
94
|
+
path,
|
|
95
|
+
content: content ?? null,
|
|
96
|
+
outline: null,
|
|
97
|
+
binary: binary ?? null,
|
|
98
|
+
revision: layer.revisions[path] ?? null,
|
|
99
|
+
fileId: layer.fileIds[path] ?? null,
|
|
100
|
+
change: layer.changes[path] ?? null,
|
|
101
|
+
written: layer.written?.[path] ?? null,
|
|
102
|
+
};
|
|
81
103
|
}
|
|
82
|
-
function
|
|
83
|
-
const
|
|
84
|
-
for (const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
continue;
|
|
90
|
-
binaries[change.to] = moved;
|
|
91
|
-
delete binaries[change.path];
|
|
104
|
+
export function* slicingWith(slice, set, removed) {
|
|
105
|
+
const entries = new Map();
|
|
106
|
+
for (const path of slice.held) {
|
|
107
|
+
const entry = entryAt(slice, path);
|
|
108
|
+
if (entry !== null)
|
|
109
|
+
entries.set(path, { ...entry, type: null });
|
|
110
|
+
yield ROW_WEIGHT;
|
|
92
111
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
112
|
+
for (const path of removed)
|
|
113
|
+
entries.delete(path);
|
|
114
|
+
for (const entry of set)
|
|
115
|
+
entries.set(entry.path, { ...entry, type: null });
|
|
116
|
+
return yield* slicing([...entries.values()], [...slice.held, ...set.map(({ path }) => path), ...removed]);
|
|
97
117
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
nextWritten[path] = writtenAt;
|
|
112
|
-
for (const [path, revision] of Object.entries(revisions)) {
|
|
113
|
-
if (confirmed.record.revisions[path] !== revision)
|
|
114
|
-
delete nextChanges[path];
|
|
115
|
-
}
|
|
116
|
-
Object.assign(nextChanges, changes);
|
|
117
|
-
for (const path of removals) {
|
|
118
|
-
delete nextDocuments[path];
|
|
119
|
-
delete nextRevisions[path];
|
|
120
|
-
delete nextFileIds[path];
|
|
121
|
-
delete nextChanges[path];
|
|
122
|
-
delete nextWritten[path];
|
|
118
|
+
function changePaths(change) {
|
|
119
|
+
return change.kind === 'move' ? [change.path, change.to] : [change.path];
|
|
120
|
+
}
|
|
121
|
+
export function touchedBy(queue) {
|
|
122
|
+
const paths = new Set();
|
|
123
|
+
for (const batch of queue) {
|
|
124
|
+
for (const change of batch.changes)
|
|
125
|
+
for (const path of changePaths(change))
|
|
126
|
+
paths.add(path);
|
|
127
|
+
for (const precondition of batch.preconditions)
|
|
128
|
+
paths.add(precondition.path);
|
|
129
|
+
for (const move of batch.between?.moves ?? [])
|
|
130
|
+
paths.add(move.path);
|
|
123
131
|
}
|
|
124
|
-
return
|
|
125
|
-
...confirmed.record,
|
|
126
|
-
roomVersion,
|
|
127
|
-
documents: settled(nextDocuments),
|
|
128
|
-
revisions: settled(nextRevisions),
|
|
129
|
-
fileIds: settled(nextFileIds),
|
|
130
|
-
changes: settled(nextChanges),
|
|
131
|
-
written: settled(nextWritten),
|
|
132
|
-
binaries: returnedBinaries(confirmed.record.binaries, submitted, accepted),
|
|
133
|
-
}, confirmed);
|
|
132
|
+
return paths;
|
|
134
133
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
old.collection.composition.selection?.model === composition.selection?.model &&
|
|
148
|
-
JSON.stringify(old.collection.composition.selection?.roots) ===
|
|
149
|
-
JSON.stringify(composition.selection?.roots);
|
|
150
|
-
const collection = hasMove
|
|
151
|
-
? reuseRewrite
|
|
152
|
-
? old.collection
|
|
153
|
-
: collectionOf(before.documents, composition, old?.collection ?? confirmed.collection)
|
|
154
|
-
: undefined;
|
|
155
|
-
const effective = collection === undefined
|
|
156
|
-
? batch
|
|
157
|
-
: reuseRewrite
|
|
158
|
-
? old.effective
|
|
159
|
-
: providerRewritten(batch, { ...before, collection });
|
|
160
|
-
layer =
|
|
161
|
-
old === undefined
|
|
162
|
-
? overlay(before, [effective])
|
|
163
|
-
: overlayChanged(before, [effective], old.before, [old.effective], old.after);
|
|
164
|
-
replay.push({
|
|
165
|
-
id: batch.id,
|
|
166
|
-
before,
|
|
167
|
-
after: layer,
|
|
168
|
-
effective,
|
|
169
|
-
...(collection === undefined ? {} : { collection }),
|
|
170
|
-
});
|
|
134
|
+
export function movedBy(queue, locator) {
|
|
135
|
+
const paths = new Set();
|
|
136
|
+
for (const batch of queue) {
|
|
137
|
+
if (!rewriting(batch, locator))
|
|
138
|
+
continue;
|
|
139
|
+
for (const change of batch.changes)
|
|
140
|
+
if (change.kind === 'move')
|
|
141
|
+
paths.add(change.path);
|
|
142
|
+
if (batch.between?.source.room === locator) {
|
|
143
|
+
for (const move of batch.between.moves)
|
|
144
|
+
paths.add(move.path);
|
|
145
|
+
}
|
|
171
146
|
}
|
|
172
|
-
return
|
|
147
|
+
return paths;
|
|
173
148
|
}
|
|
174
|
-
export function
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
};
|
|
149
|
+
export function* replaying(confirmed, queue, locator, composition) {
|
|
150
|
+
let layer = confirmed;
|
|
151
|
+
const touched = new Set();
|
|
152
|
+
for (const batch of queue) {
|
|
153
|
+
const effective = rewriting(batch, locator)
|
|
154
|
+
? yield* effectiveIn(batch, locator, {
|
|
155
|
+
...layer,
|
|
156
|
+
collection: collectionOf(layer.documents, composition),
|
|
157
|
+
})
|
|
158
|
+
: batch;
|
|
159
|
+
for (const change of effective.changes)
|
|
160
|
+
for (const path of changePaths(change))
|
|
161
|
+
touched.add(path);
|
|
162
|
+
layer = yield* overlaying(layer, [effective]);
|
|
163
|
+
yield ROW_WEIGHT;
|
|
190
164
|
}
|
|
191
|
-
const { layer, replay } = predicted(confirmed, batches, previous);
|
|
192
165
|
return {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
replay,
|
|
196
|
-
visible: {
|
|
197
|
-
...layer,
|
|
198
|
-
collection: collectionOf(layer.documents, compositionOf(confirmed.record), previous?.visible.collection ?? confirmed.collection),
|
|
199
|
-
},
|
|
166
|
+
visible: { ...layer, collection: collectionOf(layer.documents, composition) },
|
|
167
|
+
touched,
|
|
200
168
|
};
|
|
201
169
|
}
|
|
170
|
+
export function* overlayOf(visible, touched) {
|
|
171
|
+
const rows = [];
|
|
172
|
+
for (const path of touched) {
|
|
173
|
+
yield ROW_WEIGHT;
|
|
174
|
+
const entry = entryAt(visible, path);
|
|
175
|
+
rows.push(entry === null
|
|
176
|
+
? {
|
|
177
|
+
path,
|
|
178
|
+
present: false,
|
|
179
|
+
content: null,
|
|
180
|
+
outline: null,
|
|
181
|
+
binary: null,
|
|
182
|
+
revision: null,
|
|
183
|
+
fileId: null,
|
|
184
|
+
change: null,
|
|
185
|
+
written: null,
|
|
186
|
+
}
|
|
187
|
+
: { ...entry, written: null, present: true });
|
|
188
|
+
}
|
|
189
|
+
return rows;
|
|
190
|
+
}
|
|
202
191
|
function present(layer, path) {
|
|
203
192
|
return layer.documents[path] !== undefined || layer.binaries[path] !== undefined;
|
|
204
193
|
}
|
|
205
|
-
function holds(layer, preconditions) {
|
|
194
|
+
export function holds(layer, preconditions) {
|
|
206
195
|
const parsed = new Map();
|
|
207
196
|
const documentAt = (path) => {
|
|
208
197
|
if (!parsed.has(path)) {
|
|
@@ -267,15 +256,19 @@ function effects(change) {
|
|
|
267
256
|
{ kind: 'present', path: change.to },
|
|
268
257
|
];
|
|
269
258
|
}
|
|
270
|
-
if (change.kind === 'binary')
|
|
259
|
+
if (change.kind === 'binary' || change.kind === 'arrival')
|
|
271
260
|
return [{ kind: 'present', path }];
|
|
272
261
|
return [{ kind: 'absent', path }];
|
|
273
262
|
}
|
|
274
263
|
export function landed(batch, confirmed, current = {}) {
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
264
|
+
const documents = new Proxy(confirmed.documents, {
|
|
265
|
+
get(target, property, receiver) {
|
|
266
|
+
if (typeof property === 'string' && Object.hasOwn(current, property))
|
|
267
|
+
return current[property];
|
|
268
|
+
return Reflect.get(target, property, receiver);
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
const layer = { ...confirmed, documents };
|
|
279
272
|
return batch.changes.every((change, index) => {
|
|
280
273
|
if (change.kind === 'replace' || (change.kind === 'create' && 'content' in change)) {
|
|
281
274
|
const at = landing(batch.changes, index, change.path);
|
|
@@ -307,11 +300,10 @@ function founded(batch, layer) {
|
|
|
307
300
|
});
|
|
308
301
|
return changed ? immutable({ ...batch, preconditions }) : batch;
|
|
309
302
|
}
|
|
310
|
-
export function standing(confirmed, queue, withdrawable, local) {
|
|
303
|
+
export function* standing(confirmed, queue, withdrawable, local, locator, composition) {
|
|
311
304
|
if (!queue.some(withdrawable))
|
|
312
305
|
return { withdrawn: [], kept: queue };
|
|
313
|
-
|
|
314
|
-
let layer = confirmed.record;
|
|
306
|
+
let layer = confirmed;
|
|
315
307
|
const withdrawn = [];
|
|
316
308
|
const kept = [];
|
|
317
309
|
for (const batch of queue) {
|
|
@@ -319,14 +311,14 @@ export function standing(confirmed, queue, withdrawable, local) {
|
|
|
319
311
|
withdrawn.push(batch);
|
|
320
312
|
continue;
|
|
321
313
|
}
|
|
322
|
-
const effective = batch
|
|
323
|
-
?
|
|
314
|
+
const effective = rewriting(batch, locator)
|
|
315
|
+
? yield* effectiveIn(batch, locator, {
|
|
324
316
|
...layer,
|
|
325
317
|
collection: collectionOf(layer.documents, composition),
|
|
326
318
|
})
|
|
327
319
|
: batch;
|
|
328
320
|
let unapplied = false;
|
|
329
|
-
const next =
|
|
321
|
+
const next = yield* overlaying(layer, [effective], () => {
|
|
330
322
|
unapplied = true;
|
|
331
323
|
});
|
|
332
324
|
if (local && unapplied) {
|
|
@@ -338,3 +330,104 @@ export function standing(confirmed, queue, withdrawable, local) {
|
|
|
338
330
|
}
|
|
339
331
|
return { withdrawn, kept };
|
|
340
332
|
}
|
|
333
|
+
export function returnedPaths(submitted, accepted) {
|
|
334
|
+
const paths = new Set([
|
|
335
|
+
...Object.keys(accepted.documents),
|
|
336
|
+
...Object.keys(accepted.revisions),
|
|
337
|
+
...Object.keys(accepted.fileIds ?? {}),
|
|
338
|
+
...Object.keys(accepted.changes),
|
|
339
|
+
...Object.keys(accepted.binaryFiles ?? {}),
|
|
340
|
+
...accepted.removals,
|
|
341
|
+
]);
|
|
342
|
+
for (const change of submitted.changes) {
|
|
343
|
+
if (change.kind === 'move') {
|
|
344
|
+
paths.add(change.path);
|
|
345
|
+
paths.add(change.to);
|
|
346
|
+
}
|
|
347
|
+
if (change.kind === 'arrival')
|
|
348
|
+
paths.add(change.path);
|
|
349
|
+
}
|
|
350
|
+
return paths;
|
|
351
|
+
}
|
|
352
|
+
export function* returning(confirmed, submitted, accepted, writtenAt) {
|
|
353
|
+
const documents = new Map();
|
|
354
|
+
const binaries = new Map();
|
|
355
|
+
const revisions = new Map();
|
|
356
|
+
const fileIds = new Map();
|
|
357
|
+
const changes = new Map();
|
|
358
|
+
const written = new Map();
|
|
359
|
+
const read = (changed, held, path) => (changed.has(path) ? changed.get(path) : held[path]);
|
|
360
|
+
for (const [path, content] of Object.entries(accepted.documents)) {
|
|
361
|
+
yield ROW_WEIGHT;
|
|
362
|
+
documents.set(path, content);
|
|
363
|
+
fileIds.set(path, undefined);
|
|
364
|
+
written.set(path, writtenAt);
|
|
365
|
+
}
|
|
366
|
+
for (const [path, revision] of Object.entries(accepted.revisions)) {
|
|
367
|
+
yield ROW_WEIGHT;
|
|
368
|
+
revisions.set(path, revision);
|
|
369
|
+
fileIds.set(path, undefined);
|
|
370
|
+
if (confirmed.revisions[path] !== revision)
|
|
371
|
+
changes.set(path, undefined);
|
|
372
|
+
}
|
|
373
|
+
for (const [path, fileId] of Object.entries(accepted.fileIds ?? {}))
|
|
374
|
+
fileIds.set(path, fileId);
|
|
375
|
+
for (const [path, change] of Object.entries(accepted.changes))
|
|
376
|
+
changes.set(path, change);
|
|
377
|
+
for (const path of accepted.removals) {
|
|
378
|
+
documents.set(path, undefined);
|
|
379
|
+
revisions.set(path, undefined);
|
|
380
|
+
fileIds.set(path, undefined);
|
|
381
|
+
changes.set(path, undefined);
|
|
382
|
+
written.set(path, undefined);
|
|
383
|
+
}
|
|
384
|
+
for (const change of submitted.changes) {
|
|
385
|
+
if (change.kind === 'arrival' && 'binary' in change) {
|
|
386
|
+
if (accepted.revisions[change.path] !== undefined) {
|
|
387
|
+
binaries.set(change.path, { state: 'accepted', ...change.binary });
|
|
388
|
+
}
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
if (change.kind !== 'move')
|
|
392
|
+
continue;
|
|
393
|
+
const moved = read(binaries, confirmed.binaries, change.path);
|
|
394
|
+
if (moved === undefined || accepted.revisions[change.to] === undefined)
|
|
395
|
+
continue;
|
|
396
|
+
binaries.set(change.to, moved);
|
|
397
|
+
binaries.set(change.path, undefined);
|
|
398
|
+
}
|
|
399
|
+
for (const [path, binary] of acceptedBinaries(accepted.binaryFiles ?? {}))
|
|
400
|
+
binaries.set(path, binary);
|
|
401
|
+
for (const path of accepted.removals)
|
|
402
|
+
binaries.set(path, undefined);
|
|
403
|
+
const paths = new Set([
|
|
404
|
+
...documents.keys(),
|
|
405
|
+
...binaries.keys(),
|
|
406
|
+
...revisions.keys(),
|
|
407
|
+
...fileIds.keys(),
|
|
408
|
+
...changes.keys(),
|
|
409
|
+
...written.keys(),
|
|
410
|
+
]);
|
|
411
|
+
const set = [];
|
|
412
|
+
const removed = [];
|
|
413
|
+
for (const path of paths) {
|
|
414
|
+
yield ROW_WEIGHT;
|
|
415
|
+
const content = read(documents, confirmed.documents, path);
|
|
416
|
+
const binary = read(binaries, confirmed.binaries, path);
|
|
417
|
+
if (content === undefined && binary === undefined) {
|
|
418
|
+
removed.push(path);
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
set.push({
|
|
422
|
+
path,
|
|
423
|
+
content: binary === undefined ? (content ?? null) : null,
|
|
424
|
+
outline: null,
|
|
425
|
+
binary: binary ?? null,
|
|
426
|
+
revision: read(revisions, confirmed.revisions, path) ?? null,
|
|
427
|
+
fileId: read(fileIds, confirmed.fileIds, path) ?? null,
|
|
428
|
+
change: read(changes, confirmed.changes, path) ?? null,
|
|
429
|
+
written: read(written, confirmed.written, path) ?? null,
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
return { set, removed };
|
|
433
|
+
}
|
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?: {
|
|
@@ -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 = {
|
|
@@ -124,12 +127,13 @@ export type SavedDraft = {
|
|
|
124
127
|
readonly path: string;
|
|
125
128
|
readonly parts: HeldParts;
|
|
126
129
|
};
|
|
127
|
-
export declare function readParts(value: unknown): RoomDraftParts;
|
|
130
|
+
export declare function readParts(value: unknown, path: string): 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[];
|
|
133
137
|
export type TextParts = {
|
|
134
138
|
readonly fields?: Readonly<Record<string, {
|
|
135
139
|
readonly value: unknown;
|
|
@@ -146,6 +150,20 @@ export declare function returnedInto(existing: HeldParts | undefined, returned:
|
|
|
146
150
|
export declare function moveTarget(move: {
|
|
147
151
|
readonly to: string;
|
|
148
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
|
+
};
|
|
149
167
|
export declare function changesOf(path: string, parts: HeldParts): {
|
|
150
168
|
changes: readonly Change[];
|
|
151
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","sourceR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