@agentshouse/mdruntime 0.1.0-ca9afacd5aebd → 0.1.0-cae97ad2e9142
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 +99 -36
- 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 +21 -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 +31 -9
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +155 -64
- 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 +49 -9
- package/dist/collection.d.ts +7 -6
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +30 -77
- package/dist/compile.d.ts +16 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +767 -0
- package/dist/connection.d.ts +42 -15
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +3415 -810
- package/dist/conversation.d.ts +30 -9
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +549 -181
- 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 +19 -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 -10
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -120
- package/dist/fulltext.d.ts +27 -0
- package/dist/fulltext.d.ts.map +1 -0
- package/dist/fulltext.js +368 -0
- package/dist/host.d.ts +15 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +126 -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 +15 -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/memory.d.ts +10 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +54 -26
- 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 +4 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +11 -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 +19 -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 +38 -4
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +26 -0
- package/dist/overlay.d.ts +3 -4
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +100 -182
- 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 +17 -6
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +205 -68
- 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 +64 -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 +100 -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 +297 -162
- package/dist/room-draft.d.ts +17 -2
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +65 -25
- package/dist/rows.d.ts +35 -37
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +165 -105
- package/dist/save.d.ts +50 -9
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +528 -166
- 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 +4 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/store.d.ts +116 -74
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +353 -444
- package/dist/stored.d.ts +150 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +564 -0
- package/dist/tables.d.ts +354 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +624 -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 +164 -32
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +55 -31
- package/dist/words.d.ts +19 -0
- package/dist/words.d.ts.map +1 -0
- package/dist/words.js +150 -0
- package/package.json +27 -24
- package/AGENTS.md +0 -318
- 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,185 +1,198 @@
|
|
|
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 { acceptedBinaries, overlaying } from './overlay.js';
|
|
5
|
+
import { effectiveIn, rewriting } from './save.js';
|
|
6
|
+
import { ROW_WEIGHT } from './turn.js';
|
|
7
|
+
export function compositionOf(record, builtIn) {
|
|
7
8
|
return {
|
|
8
9
|
model: record.model,
|
|
9
10
|
selection: record.typedSelection === null
|
|
10
11
|
? 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),
|
|
12
|
+
: { roots: record.typedSelection.roots, model: builtIn },
|
|
18
13
|
};
|
|
19
14
|
}
|
|
20
15
|
export function sameMembership(record, other) {
|
|
21
16
|
return (JSON.stringify(record.typedSelection?.roots ?? null) ===
|
|
22
17
|
JSON.stringify(other.typedSelection?.roots ?? null));
|
|
23
18
|
}
|
|
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;
|
|
19
|
+
export function storedRecord(record) {
|
|
20
|
+
const { key: _key, ...stored } = record;
|
|
21
|
+
return JSON.stringify(stored);
|
|
22
|
+
}
|
|
23
|
+
const PROBES = new Set([
|
|
24
|
+
'then',
|
|
25
|
+
'toJSON',
|
|
26
|
+
'constructor',
|
|
27
|
+
'valueOf',
|
|
28
|
+
'toString',
|
|
29
|
+
]);
|
|
30
|
+
class UnreadPath extends Error {
|
|
31
|
+
constructor(path) {
|
|
32
|
+
super(`the replica slice holds no row for ${path}`);
|
|
45
33
|
}
|
|
46
|
-
return { kind: 'staged', confirmed: confirmedOf(record, previous) };
|
|
47
34
|
}
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
function strict(values, held) {
|
|
36
|
+
const guard = (property) => {
|
|
37
|
+
if (typeof property === 'string' && !held.has(property) && !PROBES.has(property)) {
|
|
38
|
+
throw new UnreadPath(property);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return new Proxy(values, {
|
|
42
|
+
get(target, property, receiver) {
|
|
43
|
+
guard(property);
|
|
44
|
+
return Reflect.get(target, property, receiver);
|
|
45
|
+
},
|
|
46
|
+
has(target, property) {
|
|
47
|
+
guard(property);
|
|
48
|
+
return Reflect.has(target, property);
|
|
49
|
+
},
|
|
50
|
+
getOwnPropertyDescriptor(target, property) {
|
|
51
|
+
guard(property);
|
|
52
|
+
return Reflect.getOwnPropertyDescriptor(target, property);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
for (const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
56
|
+
export function* slicing(entries, paths) {
|
|
57
|
+
const held = new Set(paths);
|
|
58
|
+
for (const entry of entries)
|
|
59
|
+
held.add(entry.path);
|
|
60
|
+
const documents = {};
|
|
61
|
+
const binaries = {};
|
|
62
|
+
const revisions = {};
|
|
63
|
+
const fileIds = {};
|
|
64
|
+
const changes = {};
|
|
65
|
+
const written = {};
|
|
66
|
+
for (const entry of entries) {
|
|
67
|
+
if (entry.binary !== null)
|
|
68
|
+
binaries[entry.path] = entry.binary;
|
|
69
|
+
else if (entry.content !== null)
|
|
70
|
+
documents[entry.path] = entry.content;
|
|
71
|
+
if (entry.revision !== null)
|
|
72
|
+
revisions[entry.path] = entry.revision;
|
|
73
|
+
if (entry.fileId !== null)
|
|
74
|
+
fileIds[entry.path] = entry.fileId;
|
|
75
|
+
if (entry.change !== null)
|
|
76
|
+
changes[entry.path] = entry.change;
|
|
77
|
+
if (entry.written !== null)
|
|
78
|
+
written[entry.path] = entry.written;
|
|
79
|
+
yield ROW_WEIGHT;
|
|
78
80
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
return {
|
|
82
|
+
documents: strict(documents, held),
|
|
83
|
+
binaries: strict(binaries, held),
|
|
84
|
+
revisions: strict(revisions, held),
|
|
85
|
+
fileIds: strict(fileIds, held),
|
|
86
|
+
changes: strict(changes, held),
|
|
87
|
+
written: strict(written, held),
|
|
88
|
+
held,
|
|
89
|
+
};
|
|
82
90
|
}
|
|
83
|
-
export function
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
export function entryAt(layer, path) {
|
|
92
|
+
const content = layer.documents[path];
|
|
93
|
+
const binary = layer.binaries[path];
|
|
94
|
+
if (content === undefined && binary === undefined)
|
|
95
|
+
return null;
|
|
96
|
+
return {
|
|
97
|
+
path,
|
|
98
|
+
content: content ?? null,
|
|
99
|
+
binary: binary ?? null,
|
|
100
|
+
revision: layer.revisions[path] ?? null,
|
|
101
|
+
fileId: layer.fileIds[path] ?? null,
|
|
102
|
+
change: layer.changes[path] ?? null,
|
|
103
|
+
written: layer.written?.[path] ?? null,
|
|
91
104
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
105
|
+
}
|
|
106
|
+
export function* slicingWith(slice, set, removed) {
|
|
107
|
+
const entries = new Map();
|
|
108
|
+
for (const path of slice.held) {
|
|
109
|
+
const entry = entryAt(slice, path);
|
|
110
|
+
if (entry !== null)
|
|
111
|
+
entries.set(path, { ...entry, type: null });
|
|
112
|
+
yield ROW_WEIGHT;
|
|
95
113
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
114
|
+
for (const path of removed)
|
|
115
|
+
entries.delete(path);
|
|
116
|
+
for (const entry of set)
|
|
117
|
+
entries.set(entry.path, { ...entry, type: null });
|
|
118
|
+
return yield* slicing([...entries.values()], [...slice.held, ...set.map(({ path }) => path), ...removed]);
|
|
119
|
+
}
|
|
120
|
+
function changePaths(change) {
|
|
121
|
+
return change.kind === 'move' ? [change.path, change.to] : [change.path];
|
|
122
|
+
}
|
|
123
|
+
export function touchedBy(queue) {
|
|
124
|
+
const paths = new Set();
|
|
125
|
+
for (const batch of queue) {
|
|
126
|
+
for (const change of batch.changes)
|
|
127
|
+
for (const path of changePaths(change))
|
|
128
|
+
paths.add(path);
|
|
129
|
+
for (const precondition of batch.preconditions)
|
|
130
|
+
paths.add(precondition.path);
|
|
131
|
+
for (const move of batch.between?.moves ?? [])
|
|
132
|
+
paths.add(move.path);
|
|
102
133
|
}
|
|
103
|
-
return
|
|
104
|
-
...confirmed.record,
|
|
105
|
-
roomVersion,
|
|
106
|
-
documents: nextDocuments,
|
|
107
|
-
revisions: nextRevisions,
|
|
108
|
-
changes: nextChanges,
|
|
109
|
-
written: nextWritten,
|
|
110
|
-
binaries: returnedBinaries(confirmed.record.binaries, submitted, accepted),
|
|
111
|
-
}, confirmed);
|
|
134
|
+
return paths;
|
|
112
135
|
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
old.collection.composition.selection?.model === composition.selection?.model &&
|
|
126
|
-
JSON.stringify(old.collection.composition.selection?.roots) ===
|
|
127
|
-
JSON.stringify(composition.selection?.roots);
|
|
128
|
-
const collection = hasMove
|
|
129
|
-
? reuseRewrite
|
|
130
|
-
? old.collection
|
|
131
|
-
: collectionOf(before.documents, composition, old?.collection ?? confirmed.collection)
|
|
132
|
-
: undefined;
|
|
133
|
-
const effective = collection === undefined
|
|
134
|
-
? batch
|
|
135
|
-
: reuseRewrite
|
|
136
|
-
? old.effective
|
|
137
|
-
: providerRewritten(batch, { ...before, collection });
|
|
138
|
-
layer =
|
|
139
|
-
old === undefined
|
|
140
|
-
? overlay(before, [effective])
|
|
141
|
-
: overlayChanged(before, [effective], old.before, [old.effective], old.after);
|
|
142
|
-
replay.push({
|
|
143
|
-
id: batch.id,
|
|
144
|
-
before,
|
|
145
|
-
after: layer,
|
|
146
|
-
effective,
|
|
147
|
-
...(collection === undefined ? {} : { collection }),
|
|
148
|
-
});
|
|
136
|
+
export function movedBy(queue, locator) {
|
|
137
|
+
const paths = new Set();
|
|
138
|
+
for (const batch of queue) {
|
|
139
|
+
if (!rewriting(batch, locator))
|
|
140
|
+
continue;
|
|
141
|
+
for (const change of batch.changes)
|
|
142
|
+
if (change.kind === 'move')
|
|
143
|
+
paths.add(change.path);
|
|
144
|
+
if (batch.between?.source.room === locator) {
|
|
145
|
+
for (const move of batch.between.moves)
|
|
146
|
+
paths.add(move.path);
|
|
147
|
+
}
|
|
149
148
|
}
|
|
150
|
-
return
|
|
149
|
+
return paths;
|
|
151
150
|
}
|
|
152
|
-
export function
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
151
|
+
export function* replaying(confirmed, queue, locator, composition) {
|
|
152
|
+
let layer = confirmed;
|
|
153
|
+
const touched = new Set();
|
|
154
|
+
for (const batch of queue) {
|
|
155
|
+
const effective = rewriting(batch, locator)
|
|
156
|
+
? yield* effectiveIn(batch, locator, {
|
|
157
|
+
...layer,
|
|
158
|
+
collection: collectionOf(layer.documents, composition),
|
|
159
|
+
})
|
|
160
|
+
: batch;
|
|
161
|
+
for (const change of effective.changes)
|
|
162
|
+
for (const path of changePaths(change))
|
|
163
|
+
touched.add(path);
|
|
164
|
+
layer = yield* overlaying(layer, [effective]);
|
|
165
|
+
yield ROW_WEIGHT;
|
|
167
166
|
}
|
|
168
|
-
const { layer, replay } = predicted(confirmed, batches, previous);
|
|
169
167
|
return {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
replay,
|
|
173
|
-
visible: {
|
|
174
|
-
...layer,
|
|
175
|
-
collection: collectionOf(layer.documents, compositionOf(confirmed.record), previous?.visible.collection ?? confirmed.collection),
|
|
176
|
-
},
|
|
168
|
+
visible: { ...layer, collection: collectionOf(layer.documents, composition) },
|
|
169
|
+
touched,
|
|
177
170
|
};
|
|
178
171
|
}
|
|
172
|
+
export function* overlayOf(visible, touched) {
|
|
173
|
+
const rows = [];
|
|
174
|
+
for (const path of touched) {
|
|
175
|
+
yield ROW_WEIGHT;
|
|
176
|
+
const entry = entryAt(visible, path);
|
|
177
|
+
rows.push(entry === null
|
|
178
|
+
? {
|
|
179
|
+
path,
|
|
180
|
+
present: false,
|
|
181
|
+
content: null,
|
|
182
|
+
binary: null,
|
|
183
|
+
revision: null,
|
|
184
|
+
fileId: null,
|
|
185
|
+
change: null,
|
|
186
|
+
written: null,
|
|
187
|
+
}
|
|
188
|
+
: { ...entry, written: null, present: true });
|
|
189
|
+
}
|
|
190
|
+
return rows;
|
|
191
|
+
}
|
|
179
192
|
function present(layer, path) {
|
|
180
193
|
return layer.documents[path] !== undefined || layer.binaries[path] !== undefined;
|
|
181
194
|
}
|
|
182
|
-
function holds(layer, preconditions) {
|
|
195
|
+
export function holds(layer, preconditions) {
|
|
183
196
|
const parsed = new Map();
|
|
184
197
|
const documentAt = (path) => {
|
|
185
198
|
if (!parsed.has(path)) {
|
|
@@ -244,12 +257,19 @@ function effects(change) {
|
|
|
244
257
|
{ kind: 'present', path: change.to },
|
|
245
258
|
];
|
|
246
259
|
}
|
|
247
|
-
if (change.kind === 'binary')
|
|
260
|
+
if (change.kind === 'binary' || change.kind === 'arrival')
|
|
248
261
|
return [{ kind: 'present', path }];
|
|
249
262
|
return [{ kind: 'absent', path }];
|
|
250
263
|
}
|
|
251
264
|
export function landed(batch, confirmed, current = {}) {
|
|
252
|
-
const
|
|
265
|
+
const documents = new Proxy(confirmed.documents, {
|
|
266
|
+
get(target, property, receiver) {
|
|
267
|
+
if (typeof property === 'string' && Object.hasOwn(current, property))
|
|
268
|
+
return current[property];
|
|
269
|
+
return Reflect.get(target, property, receiver);
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
const layer = { ...confirmed, documents };
|
|
253
273
|
return batch.changes.every((change, index) => {
|
|
254
274
|
if (change.kind === 'replace' || (change.kind === 'create' && 'content' in change)) {
|
|
255
275
|
const at = landing(batch.changes, index, change.path);
|
|
@@ -267,32 +287,147 @@ export function landed(batch, confirmed, current = {}) {
|
|
|
267
287
|
});
|
|
268
288
|
});
|
|
269
289
|
}
|
|
270
|
-
|
|
290
|
+
function founded(batch, layer) {
|
|
291
|
+
let changed = false;
|
|
292
|
+
const preconditions = batch.preconditions.map((precondition) => {
|
|
293
|
+
if (precondition.kind !== 'content')
|
|
294
|
+
return precondition;
|
|
295
|
+
const revision = layer.revisions[precondition.path];
|
|
296
|
+
if (revision === undefined || layer.documents[precondition.path] !== precondition.content) {
|
|
297
|
+
return precondition;
|
|
298
|
+
}
|
|
299
|
+
changed = true;
|
|
300
|
+
return { kind: 'revision', path: precondition.path, revision };
|
|
301
|
+
});
|
|
302
|
+
return changed ? immutable({ ...batch, preconditions }) : batch;
|
|
303
|
+
}
|
|
304
|
+
export function* standing(confirmed, queue, withdrawable, local, locator, composition) {
|
|
271
305
|
if (!queue.some(withdrawable))
|
|
272
|
-
return [];
|
|
273
|
-
|
|
274
|
-
let layer = confirmed.record;
|
|
306
|
+
return { withdrawn: [], kept: queue };
|
|
307
|
+
let layer = confirmed;
|
|
275
308
|
const withdrawn = [];
|
|
309
|
+
const kept = [];
|
|
276
310
|
for (const batch of queue) {
|
|
277
311
|
if (withdrawable(batch) && !holds(layer, batch.preconditions)) {
|
|
278
312
|
withdrawn.push(batch);
|
|
279
313
|
continue;
|
|
280
314
|
}
|
|
281
|
-
const effective = batch
|
|
282
|
-
?
|
|
315
|
+
const effective = rewriting(batch, locator)
|
|
316
|
+
? yield* effectiveIn(batch, locator, {
|
|
283
317
|
...layer,
|
|
284
318
|
collection: collectionOf(layer.documents, composition),
|
|
285
319
|
})
|
|
286
320
|
: batch;
|
|
287
321
|
let unapplied = false;
|
|
288
|
-
const next =
|
|
322
|
+
const next = yield* overlaying(layer, [effective], () => {
|
|
289
323
|
unapplied = true;
|
|
290
324
|
});
|
|
291
325
|
if (local && unapplied) {
|
|
292
326
|
withdrawn.push(batch);
|
|
293
327
|
continue;
|
|
294
328
|
}
|
|
329
|
+
kept.push(local || !withdrawable(batch) ? batch : founded(batch, layer));
|
|
295
330
|
layer = next;
|
|
296
331
|
}
|
|
297
|
-
return withdrawn;
|
|
332
|
+
return { withdrawn, kept };
|
|
333
|
+
}
|
|
334
|
+
export function returnedPaths(submitted, accepted) {
|
|
335
|
+
const paths = new Set([
|
|
336
|
+
...Object.keys(accepted.documents),
|
|
337
|
+
...Object.keys(accepted.revisions),
|
|
338
|
+
...Object.keys(accepted.fileIds ?? {}),
|
|
339
|
+
...Object.keys(accepted.changes),
|
|
340
|
+
...Object.keys(accepted.binaryFiles ?? {}),
|
|
341
|
+
...accepted.removals,
|
|
342
|
+
]);
|
|
343
|
+
for (const change of submitted.changes) {
|
|
344
|
+
if (change.kind === 'move') {
|
|
345
|
+
paths.add(change.path);
|
|
346
|
+
paths.add(change.to);
|
|
347
|
+
}
|
|
348
|
+
if (change.kind === 'arrival')
|
|
349
|
+
paths.add(change.path);
|
|
350
|
+
}
|
|
351
|
+
return paths;
|
|
352
|
+
}
|
|
353
|
+
export function* returning(confirmed, submitted, accepted, writtenAt) {
|
|
354
|
+
const documents = new Map();
|
|
355
|
+
const binaries = new Map();
|
|
356
|
+
const revisions = new Map();
|
|
357
|
+
const fileIds = new Map();
|
|
358
|
+
const changes = new Map();
|
|
359
|
+
const written = new Map();
|
|
360
|
+
const read = (changed, held, path) => (changed.has(path) ? changed.get(path) : held[path]);
|
|
361
|
+
for (const [path, content] of Object.entries(accepted.documents)) {
|
|
362
|
+
yield ROW_WEIGHT;
|
|
363
|
+
documents.set(path, content);
|
|
364
|
+
fileIds.set(path, undefined);
|
|
365
|
+
written.set(path, writtenAt);
|
|
366
|
+
}
|
|
367
|
+
for (const [path, revision] of Object.entries(accepted.revisions)) {
|
|
368
|
+
yield ROW_WEIGHT;
|
|
369
|
+
revisions.set(path, revision);
|
|
370
|
+
fileIds.set(path, undefined);
|
|
371
|
+
if (confirmed.revisions[path] !== revision)
|
|
372
|
+
changes.set(path, undefined);
|
|
373
|
+
}
|
|
374
|
+
for (const [path, fileId] of Object.entries(accepted.fileIds ?? {}))
|
|
375
|
+
fileIds.set(path, fileId);
|
|
376
|
+
for (const [path, change] of Object.entries(accepted.changes))
|
|
377
|
+
changes.set(path, change);
|
|
378
|
+
for (const path of accepted.removals) {
|
|
379
|
+
documents.set(path, undefined);
|
|
380
|
+
revisions.set(path, undefined);
|
|
381
|
+
fileIds.set(path, undefined);
|
|
382
|
+
changes.set(path, undefined);
|
|
383
|
+
written.set(path, undefined);
|
|
384
|
+
}
|
|
385
|
+
for (const change of submitted.changes) {
|
|
386
|
+
if (change.kind === 'arrival' && 'binary' in change) {
|
|
387
|
+
if (accepted.revisions[change.path] !== undefined) {
|
|
388
|
+
binaries.set(change.path, { state: 'accepted', ...change.binary });
|
|
389
|
+
}
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
if (change.kind !== 'move')
|
|
393
|
+
continue;
|
|
394
|
+
const moved = read(binaries, confirmed.binaries, change.path);
|
|
395
|
+
if (moved === undefined || accepted.revisions[change.to] === undefined)
|
|
396
|
+
continue;
|
|
397
|
+
binaries.set(change.to, moved);
|
|
398
|
+
binaries.set(change.path, undefined);
|
|
399
|
+
}
|
|
400
|
+
for (const [path, binary] of acceptedBinaries(accepted.binaryFiles ?? {}))
|
|
401
|
+
binaries.set(path, binary);
|
|
402
|
+
for (const path of accepted.removals)
|
|
403
|
+
binaries.set(path, undefined);
|
|
404
|
+
const paths = new Set([
|
|
405
|
+
...documents.keys(),
|
|
406
|
+
...binaries.keys(),
|
|
407
|
+
...revisions.keys(),
|
|
408
|
+
...fileIds.keys(),
|
|
409
|
+
...changes.keys(),
|
|
410
|
+
...written.keys(),
|
|
411
|
+
]);
|
|
412
|
+
const set = [];
|
|
413
|
+
const removed = [];
|
|
414
|
+
for (const path of paths) {
|
|
415
|
+
yield ROW_WEIGHT;
|
|
416
|
+
const content = read(documents, confirmed.documents, path);
|
|
417
|
+
const binary = read(binaries, confirmed.binaries, path);
|
|
418
|
+
if (content === undefined && binary === undefined) {
|
|
419
|
+
removed.push(path);
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
set.push({
|
|
423
|
+
path,
|
|
424
|
+
content: binary === undefined ? (content ?? null) : 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 };
|
|
298
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?: {
|
|
@@ -42,8 +43,8 @@ export type RoomDraftParts = {
|
|
|
42
43
|
};
|
|
43
44
|
};
|
|
44
45
|
export type HeldFile = {
|
|
45
|
-
readonly blob: Blob;
|
|
46
46
|
readonly localId: string;
|
|
47
|
+
readonly name?: string;
|
|
47
48
|
readonly byteLength: number;
|
|
48
49
|
readonly mediaType: string;
|
|
49
50
|
readonly sha256: string;
|
|
@@ -69,6 +70,7 @@ type HeldParts = {
|
|
|
69
70
|
readonly creation?: RoomDraftCreation;
|
|
70
71
|
readonly move?: {
|
|
71
72
|
readonly to: string;
|
|
73
|
+
readonly room?: string;
|
|
72
74
|
readonly base: string | null;
|
|
73
75
|
};
|
|
74
76
|
readonly removal?: {
|
|
@@ -87,7 +89,7 @@ type ChangedUnderneath = {
|
|
|
87
89
|
readonly file?: string | null;
|
|
88
90
|
};
|
|
89
91
|
export type ReturnReason = ProviderRefusal & {
|
|
90
|
-
readonly kind: 'conflicted' | 'rejected' | 'expired' | 'withdrawn'
|
|
92
|
+
readonly kind: Open<'conflicted' | 'rejected' | 'expired' | 'withdrawn'>;
|
|
91
93
|
};
|
|
92
94
|
export declare function returnedBy(kind: 'expired' | 'withdrawn'): ReturnReason;
|
|
93
95
|
export type RoomDraft = {
|
|
@@ -125,11 +127,24 @@ export type SavedDraft = {
|
|
|
125
127
|
readonly parts: HeldParts;
|
|
126
128
|
};
|
|
127
129
|
export declare function readParts(value: unknown): RoomDraftParts;
|
|
130
|
+
export declare function gatheredParts(earlier: unknown, later: unknown): unknown;
|
|
128
131
|
export declare function held(current: HeldParts | undefined, parts: RoomDraftParts, file?: HeldFile): HeldParts;
|
|
129
132
|
export declare function underneath(parts: HeldParts, path: string, visible: VisibleLayer | undefined): ChangedUnderneath;
|
|
130
133
|
export declare function heldFile(blob: Blob, base: string | null): Promise<HeldFile>;
|
|
131
134
|
export declare function binaryBase(visible: VisibleLayer | undefined, path: string): string | null;
|
|
132
135
|
export declare function changedParts(path: string, report: ChangedUnderneath): readonly ChangedPart[];
|
|
136
|
+
export type TextParts = {
|
|
137
|
+
readonly fields?: Readonly<Record<string, {
|
|
138
|
+
readonly value: unknown;
|
|
139
|
+
}>>;
|
|
140
|
+
readonly sections?: Readonly<Record<string, {
|
|
141
|
+
readonly value: string;
|
|
142
|
+
}>>;
|
|
143
|
+
readonly preamble?: {
|
|
144
|
+
readonly value: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export declare function partsAfter(markdown: string, parts: TextParts): string;
|
|
133
148
|
export declare function returnedInto(existing: HeldParts | undefined, returned: HeldParts): HeldParts;
|
|
134
149
|
export declare function moveTarget(move: {
|
|
135
150
|
readonly to: string;
|
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;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD,GACD;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CACxB,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC,CACxE,CAAC;IACF,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,M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