@agentshouse/mdruntime 0.1.0-cfbf80d8d4644 → 0.1.0-cfcf93be6310b
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 +24 -11
- package/dist/adapter.d.ts +182 -47
- 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 +53 -6
- package/dist/attempt.d.ts +16 -0
- package/dist/attempt.d.ts.map +1 -0
- package/dist/attempt.js +70 -0
- package/dist/binary.d.ts +18 -0
- package/dist/binary.d.ts.map +1 -0
- package/dist/binary.js +8 -0
- package/dist/bootstrap.d.ts +33 -5
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +202 -48
- 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 -56
- package/dist/change.d.ts +45 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +34 -0
- package/dist/client.d.ts +38 -17
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +156 -20
- package/dist/collection.d.ts +13 -14
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +52 -56
- 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 +59 -20
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +4080 -879
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation.d.ts +51 -20
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +732 -242
- 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 +4 -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 +152 -0
- package/dist/expectation.d.ts +21 -0
- package/dist/expectation.d.ts.map +1 -0
- package/dist/expectation.js +70 -0
- package/dist/failure.d.ts +13 -0
- package/dist/failure.d.ts.map +1 -0
- package/dist/failure.js +19 -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/host.d.ts +11 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +128 -24
- package/dist/identity.d.ts +4 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +16 -1
- package/dist/index.d.ts +22 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/job.d.ts +14 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +28 -0
- package/dist/live.d.ts +23 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +127 -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 +20 -7
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +253 -92
- 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 +19 -4
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +10 -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 +22 -4
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +120 -14
- package/dist/open.d.ts +2 -0
- package/dist/open.d.ts.map +1 -0
- package/dist/open.js +1 -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 +72 -5
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +81 -1
- package/dist/overlay.d.ts +15 -5
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +136 -180
- 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 +75 -5
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +119 -26
- package/dist/reach.d.ts +18 -4
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +234 -69
- package/dist/react.d.ts +32 -19
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +13 -21
- package/dist/readiness.d.ts +50 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +27 -0
- package/dist/recovery.d.ts +26 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +224 -0
- package/dist/refresh.d.ts +20 -7
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +167 -59
- package/dist/replica.d.ts +59 -33
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +324 -157
- package/dist/room-draft.d.ts +59 -11
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +276 -80
- package/dist/rows.d.ts +40 -34
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +202 -80
- package/dist/save.d.ts +73 -4
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +825 -152
- package/dist/search.d.ts +15 -54
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -121
- 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 +15 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +421 -0
- package/dist/status.d.ts +7 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -9
- package/dist/store.d.ts +118 -59
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +354 -344
- 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 +9 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +75 -0
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +104 -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 +170 -33
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +69 -31
- package/package.json +26 -15
- package/AGENTS.md +0 -232
- package/dist/attachment.d.ts +0 -3
- package/dist/attachment.d.ts.map +0 -1
- package/dist/attachment.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 -377
package/dist/overlay.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
import { apply, parse, serialize } from '@agentshouse/mdmodel';
|
|
1
|
+
import { apply, frontmatterValue, parse, serialize, } from '@agentshouse/mdmodel';
|
|
2
|
+
import { drafted, entriesIn, settling } from './shared.js';
|
|
3
|
+
import { ROW_WEIGHT } from './turn.js';
|
|
4
|
+
export function* acceptedBinaries(files) {
|
|
5
|
+
for (const [path, file] of entriesIn(files))
|
|
6
|
+
yield [path, { state: 'accepted', ...file }];
|
|
7
|
+
}
|
|
8
|
+
export function sameBinary(left, right) {
|
|
9
|
+
if (left === undefined || right === undefined)
|
|
10
|
+
return left === right;
|
|
11
|
+
return (left.state === right.state &&
|
|
12
|
+
left.byteLength === right.byteLength &&
|
|
13
|
+
left.mediaType === right.mediaType &&
|
|
14
|
+
left.sha256 === right.sha256 &&
|
|
15
|
+
(left.state === 'accepted'
|
|
16
|
+
? right.state === 'accepted'
|
|
17
|
+
: right.state === 'pending' && left.localId === right.localId));
|
|
18
|
+
}
|
|
2
19
|
export function sameChange(left, right) {
|
|
3
20
|
if (left === undefined || right === undefined)
|
|
4
21
|
return left === right;
|
|
@@ -8,10 +25,13 @@ export function sameChange(left, right) {
|
|
|
8
25
|
left.author?.name === right.author?.name);
|
|
9
26
|
}
|
|
10
27
|
const EMPTY_FRONTMATTER = '---\n---\n';
|
|
28
|
+
function isPart(change) {
|
|
29
|
+
return change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble';
|
|
30
|
+
}
|
|
11
31
|
function at(path, name) {
|
|
12
32
|
return `${path} ${name}`;
|
|
13
33
|
}
|
|
14
|
-
function priorsOf(preconditions) {
|
|
34
|
+
function* priorsOf(preconditions) {
|
|
15
35
|
const fields = new Map();
|
|
16
36
|
const sections = new Map();
|
|
17
37
|
const preambles = new Map();
|
|
@@ -25,6 +45,7 @@ function priorsOf(preconditions) {
|
|
|
25
45
|
if (precondition.kind === 'preamble') {
|
|
26
46
|
preambles.set(precondition.path, precondition.value);
|
|
27
47
|
}
|
|
48
|
+
yield ROW_WEIGHT;
|
|
28
49
|
}
|
|
29
50
|
return {
|
|
30
51
|
field: (path, name) => fields.get(at(path, name)),
|
|
@@ -40,49 +61,50 @@ function compose(fields, sections) {
|
|
|
40
61
|
const opened = parse(skeleton);
|
|
41
62
|
if (!opened.ok)
|
|
42
63
|
return skeleton;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const next = apply(document, { kind: 'field', name, value, prior: undefined });
|
|
46
|
-
if (next.outcome === 'applied')
|
|
47
|
-
document = next.document;
|
|
48
|
-
}
|
|
49
|
-
return serialize(document);
|
|
64
|
+
const next = apply(opened.document, Object.entries(fields).flatMap(([name, value]) => frontmatterValue(value) ? [{ kind: 'field', name, value, prior: undefined }] : []));
|
|
65
|
+
return serialize(next.outcome === 'applied' ? next.document : opened.document);
|
|
50
66
|
}
|
|
51
|
-
function edited(
|
|
52
|
-
if (change.kind === 'field')
|
|
53
|
-
return
|
|
67
|
+
function edited(change, priors) {
|
|
68
|
+
if (change.kind === 'field')
|
|
69
|
+
return {
|
|
54
70
|
kind: 'field',
|
|
55
71
|
name: change.name,
|
|
56
72
|
value: change.value,
|
|
57
73
|
prior: priors.field(change.path, change.name),
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
kind: 'preamble',
|
|
63
|
-
value: change.value,
|
|
64
|
-
prior: priors.preamble(change.path),
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
if (change.kind !== 'section')
|
|
68
|
-
return null;
|
|
69
|
-
return apply(document, {
|
|
74
|
+
};
|
|
75
|
+
if (change.kind === 'preamble')
|
|
76
|
+
return { kind: 'preamble', value: change.value, prior: priors.preamble(change.path) };
|
|
77
|
+
return {
|
|
70
78
|
kind: 'section',
|
|
71
79
|
name: change.name,
|
|
72
80
|
value: change.value,
|
|
73
81
|
prior: priors.section(change.path, change.name),
|
|
74
|
-
}
|
|
82
|
+
};
|
|
75
83
|
}
|
|
76
|
-
function edit(staged,
|
|
77
|
-
const
|
|
84
|
+
function edit(staged, changes, priors) {
|
|
85
|
+
const path = changes[0].path;
|
|
86
|
+
delete staged.revisions[path];
|
|
87
|
+
const text = staged.documents[path];
|
|
78
88
|
if (text === undefined)
|
|
79
|
-
return;
|
|
80
|
-
const parsed = parse(text,
|
|
89
|
+
return changes.length;
|
|
90
|
+
const parsed = parse(text, path);
|
|
81
91
|
if (!parsed.ok)
|
|
82
|
-
return;
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
return changes.length;
|
|
93
|
+
const wanted = changes.map((change) => edited(change, priors));
|
|
94
|
+
const first = apply(parsed.document, wanted);
|
|
95
|
+
if (first.outcome === 'refuse')
|
|
96
|
+
return changes.length;
|
|
97
|
+
if (first.outcome === 'applied') {
|
|
98
|
+
staged.documents[path] = serialize(first.document);
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
const stale = new Set(first.stale);
|
|
102
|
+
const kept = wanted.filter((_, at) => !stale.has(at));
|
|
103
|
+
const rest = apply(parsed.document, kept);
|
|
104
|
+
if (rest.outcome !== 'applied')
|
|
105
|
+
return changes.length;
|
|
106
|
+
staged.documents[path] = serialize(rest.document);
|
|
107
|
+
return first.stale.length;
|
|
86
108
|
}
|
|
87
109
|
function relocate(staged, from, to) {
|
|
88
110
|
const text = staged.documents[from];
|
|
@@ -90,194 +112,128 @@ function relocate(staged, from, to) {
|
|
|
90
112
|
delete staged.documents[from];
|
|
91
113
|
staged.documents[to] = text;
|
|
92
114
|
}
|
|
93
|
-
else if (staged.
|
|
94
|
-
staged.
|
|
115
|
+
else if (staged.binaries[from] !== undefined) {
|
|
116
|
+
staged.binaries[to] = staged.binaries[from];
|
|
117
|
+
delete staged.binaries[from];
|
|
95
118
|
}
|
|
96
119
|
else {
|
|
97
|
-
return;
|
|
120
|
+
return false;
|
|
98
121
|
}
|
|
99
122
|
moveHead(staged, from, to);
|
|
123
|
+
return true;
|
|
100
124
|
}
|
|
101
125
|
function moveHead(heads, from, to) {
|
|
102
126
|
const revision = heads.revisions[from];
|
|
127
|
+
const fileId = heads.fileIds[from];
|
|
103
128
|
const change = heads.changes[from];
|
|
104
129
|
delete heads.revisions[from];
|
|
130
|
+
delete heads.fileIds[from];
|
|
105
131
|
delete heads.changes[from];
|
|
132
|
+
delete heads.fileIds[to];
|
|
106
133
|
delete heads.changes[to];
|
|
107
134
|
if (revision !== undefined)
|
|
108
135
|
heads.revisions[to] = revision;
|
|
136
|
+
if (fileId !== undefined)
|
|
137
|
+
heads.fileIds[to] = fileId;
|
|
109
138
|
if (change !== undefined)
|
|
110
139
|
heads.changes[to] = change;
|
|
111
140
|
}
|
|
112
141
|
function erase(staged, path) {
|
|
113
142
|
delete staged.documents[path];
|
|
114
143
|
delete staged.revisions[path];
|
|
144
|
+
delete staged.fileIds[path];
|
|
115
145
|
delete staged.changes[path];
|
|
116
|
-
staged.
|
|
146
|
+
delete staged.binaries[path];
|
|
117
147
|
}
|
|
118
|
-
function stage(staged, change
|
|
119
|
-
if (change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble') {
|
|
120
|
-
edit(staged, change, priors);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
148
|
+
function stage(staged, change) {
|
|
123
149
|
if (change.kind === 'create') {
|
|
124
150
|
staged.documents[change.path] =
|
|
125
151
|
'content' in change ? change.content : compose(change.fields, change.sections);
|
|
152
|
+
delete staged.fileIds[change.path];
|
|
126
153
|
delete staged.changes[change.path];
|
|
127
|
-
return;
|
|
154
|
+
return true;
|
|
128
155
|
}
|
|
129
156
|
if (change.kind === 'replace') {
|
|
157
|
+
delete staged.revisions[change.path];
|
|
130
158
|
if (staged.documents[change.path] === undefined)
|
|
131
|
-
return;
|
|
159
|
+
return false;
|
|
132
160
|
staged.documents[change.path] = change.content;
|
|
133
|
-
return;
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
if (change.kind === 'binary') {
|
|
164
|
+
if (staged.documents[change.path] !== undefined)
|
|
165
|
+
return false;
|
|
166
|
+
staged.binaries[change.path] = {
|
|
167
|
+
state: 'pending',
|
|
168
|
+
localId: change.localId,
|
|
169
|
+
byteLength: change.byteLength,
|
|
170
|
+
mediaType: change.mediaType,
|
|
171
|
+
sha256: change.sha256,
|
|
172
|
+
};
|
|
173
|
+
delete staged.revisions[change.path];
|
|
174
|
+
delete staged.changes[change.path];
|
|
175
|
+
return true;
|
|
134
176
|
}
|
|
135
177
|
if (change.kind === 'move') {
|
|
136
|
-
relocate(staged, change.path, change.to);
|
|
137
|
-
|
|
178
|
+
return relocate(staged, change.path, change.to);
|
|
179
|
+
}
|
|
180
|
+
if (change.kind === 'arrival') {
|
|
181
|
+
erase(staged, change.path);
|
|
182
|
+
if ('content' in change)
|
|
183
|
+
staged.documents[change.path] = change.content;
|
|
184
|
+
else
|
|
185
|
+
staged.binaries[change.path] = { state: 'accepted', ...change.binary };
|
|
186
|
+
arrive(staged, change);
|
|
187
|
+
return true;
|
|
138
188
|
}
|
|
139
189
|
erase(staged, change.path);
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
function arrive(heads, change) {
|
|
193
|
+
if (change.revision !== undefined)
|
|
194
|
+
heads.revisions[change.path] = change.revision;
|
|
195
|
+
if (change.fileId !== undefined)
|
|
196
|
+
heads.fileIds[change.path] = change.fileId;
|
|
197
|
+
if (change.change !== undefined)
|
|
198
|
+
heads.changes[change.path] = change.change;
|
|
140
199
|
}
|
|
141
|
-
export function
|
|
200
|
+
export function* overlaying(base, queue, unapplied) {
|
|
142
201
|
const staged = {
|
|
143
|
-
documents:
|
|
144
|
-
|
|
145
|
-
revisions:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
for (const batch of queue) {
|
|
149
|
-
const priors = priorsOf(batch.preconditions);
|
|
150
|
-
for (const change of batch.changes)
|
|
151
|
-
stage(staged, change, priors);
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
documents: staged.documents,
|
|
155
|
-
binaryTargets: [...staged.binaryTargets].sort(),
|
|
156
|
-
revisions: staged.revisions,
|
|
157
|
-
changes: staged.changes,
|
|
202
|
+
documents: drafted(base.documents),
|
|
203
|
+
binaries: drafted(base.binaries),
|
|
204
|
+
revisions: drafted(base.revisions),
|
|
205
|
+
fileIds: drafted(base.fileIds),
|
|
206
|
+
changes: drafted(base.changes),
|
|
158
207
|
};
|
|
159
|
-
}
|
|
160
|
-
function pathsOf(batch) {
|
|
161
|
-
return batch.changes.flatMap((change) => change.kind === 'move' ? [change.path, change.to] : [change.path]);
|
|
162
|
-
}
|
|
163
|
-
export function sameLayerText(left, right) {
|
|
164
|
-
const paths = Object.keys(left.documents);
|
|
165
|
-
return (paths.length === Object.keys(right.documents).length &&
|
|
166
|
-
paths.every((path) => left.documents[path] === right.documents[path]) &&
|
|
167
|
-
left.binaryTargets.length === right.binaryTargets.length &&
|
|
168
|
-
left.binaryTargets.every((path) => right.binaryTargets.includes(path)));
|
|
169
|
-
}
|
|
170
|
-
function replayHeads(base, queue) {
|
|
171
|
-
const heads = { revisions: { ...base.revisions }, changes: { ...base.changes } };
|
|
172
208
|
for (const batch of queue) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
else if (change.kind === 'move') {
|
|
182
|
-
moveHead(heads, change.path, change.to);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return heads;
|
|
187
|
-
}
|
|
188
|
-
export function overlayChanged(base, queue, previousBase, previousQueue, previousVisible) {
|
|
189
|
-
const before = previousQueue.map((batch) => JSON.stringify(batch));
|
|
190
|
-
const after = queue.map((batch) => JSON.stringify(batch));
|
|
191
|
-
if (before.length === after.length &&
|
|
192
|
-
before.every((id, index) => id === after[index]) &&
|
|
193
|
-
sameLayerText(base, previousBase)) {
|
|
194
|
-
return {
|
|
195
|
-
documents: previousVisible.documents,
|
|
196
|
-
binaryTargets: previousVisible.binaryTargets,
|
|
197
|
-
...replayHeads(base, queue),
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
const affected = new Set();
|
|
201
|
-
const paths = new Set([
|
|
202
|
-
...Object.keys(base.documents),
|
|
203
|
-
...Object.keys(previousBase.documents),
|
|
204
|
-
...Object.keys(base.revisions),
|
|
205
|
-
...Object.keys(previousBase.revisions),
|
|
206
|
-
...Object.keys(base.changes),
|
|
207
|
-
...Object.keys(previousBase.changes),
|
|
208
|
-
...base.binaryTargets,
|
|
209
|
-
...previousBase.binaryTargets,
|
|
210
|
-
]);
|
|
211
|
-
for (const path of paths) {
|
|
212
|
-
if (base.documents[path] !== previousBase.documents[path] ||
|
|
213
|
-
base.revisions[path] !== previousBase.revisions[path] ||
|
|
214
|
-
!sameChange(base.changes[path], previousBase.changes[path]) ||
|
|
215
|
-
base.binaryTargets.includes(path) !== previousBase.binaryTargets.includes(path))
|
|
216
|
-
affected.add(path);
|
|
217
|
-
}
|
|
218
|
-
const oldIds = new Set(before);
|
|
219
|
-
const newIds = new Set(after);
|
|
220
|
-
for (const batch of previousQueue) {
|
|
221
|
-
if (!newIds.has(JSON.stringify(batch)))
|
|
222
|
-
for (const path of pathsOf(batch))
|
|
223
|
-
affected.add(path);
|
|
224
|
-
}
|
|
225
|
-
for (const batch of queue) {
|
|
226
|
-
if (!oldIds.has(JSON.stringify(batch)))
|
|
227
|
-
for (const path of pathsOf(batch))
|
|
228
|
-
affected.add(path);
|
|
229
|
-
}
|
|
230
|
-
let expanded = true;
|
|
231
|
-
while (expanded) {
|
|
232
|
-
expanded = false;
|
|
233
|
-
for (const batch of queue) {
|
|
234
|
-
const touched = pathsOf(batch);
|
|
235
|
-
if (!touched.some((path) => affected.has(path)))
|
|
209
|
+
const priors = yield* priorsOf(batch.preconditions);
|
|
210
|
+
for (let index = 0; index < batch.changes.length; index += 1) {
|
|
211
|
+
const change = batch.changes[index];
|
|
212
|
+
if (!isPart(change)) {
|
|
213
|
+
if (!stage(staged, change))
|
|
214
|
+
unapplied?.();
|
|
215
|
+
yield ROW_WEIGHT;
|
|
236
216
|
continue;
|
|
237
|
-
for (const path of touched) {
|
|
238
|
-
if (affected.has(path))
|
|
239
|
-
continue;
|
|
240
|
-
affected.add(path);
|
|
241
|
-
expanded = true;
|
|
242
217
|
}
|
|
218
|
+
const run = [change];
|
|
219
|
+
while (index + 1 < batch.changes.length) {
|
|
220
|
+
const next = batch.changes[index + 1];
|
|
221
|
+
if (!isPart(next) || next.path !== change.path)
|
|
222
|
+
break;
|
|
223
|
+
run.push(next);
|
|
224
|
+
index += 1;
|
|
225
|
+
}
|
|
226
|
+
const text = staged.documents[change.path] ?? '';
|
|
227
|
+
for (let left = edit(staged, run, priors); left > 0; left -= 1)
|
|
228
|
+
unapplied?.();
|
|
229
|
+
yield ROW_WEIGHT + text.length;
|
|
243
230
|
}
|
|
244
231
|
}
|
|
245
|
-
const documents = {};
|
|
246
|
-
const revisions = {};
|
|
247
|
-
const changes = {};
|
|
248
|
-
for (const path of affected) {
|
|
249
|
-
if (base.documents[path] !== undefined)
|
|
250
|
-
documents[path] = base.documents[path];
|
|
251
|
-
if (base.revisions[path] !== undefined)
|
|
252
|
-
revisions[path] = base.revisions[path];
|
|
253
|
-
if (base.changes[path] !== undefined)
|
|
254
|
-
changes[path] = base.changes[path];
|
|
255
|
-
}
|
|
256
|
-
const staged = overlay({
|
|
257
|
-
documents,
|
|
258
|
-
revisions,
|
|
259
|
-
changes,
|
|
260
|
-
binaryTargets: base.binaryTargets.filter((path) => affected.has(path)),
|
|
261
|
-
}, queue.filter((batch) => pathsOf(batch).some((path) => affected.has(path))));
|
|
262
|
-
const mergedDocuments = { ...previousVisible.documents };
|
|
263
|
-
const mergedRevisions = { ...previousVisible.revisions };
|
|
264
|
-
const mergedChanges = { ...previousVisible.changes };
|
|
265
|
-
const mergedTargets = new Set(previousVisible.binaryTargets);
|
|
266
|
-
for (const path of affected) {
|
|
267
|
-
delete mergedDocuments[path];
|
|
268
|
-
delete mergedRevisions[path];
|
|
269
|
-
delete mergedChanges[path];
|
|
270
|
-
mergedTargets.delete(path);
|
|
271
|
-
}
|
|
272
|
-
Object.assign(mergedDocuments, staged.documents);
|
|
273
|
-
Object.assign(mergedRevisions, staged.revisions);
|
|
274
|
-
Object.assign(mergedChanges, staged.changes);
|
|
275
|
-
for (const path of staged.binaryTargets)
|
|
276
|
-
mergedTargets.add(path);
|
|
277
232
|
return {
|
|
278
|
-
documents:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
233
|
+
documents: yield* settling(staged.documents),
|
|
234
|
+
binaries: yield* settling(staged.binaries),
|
|
235
|
+
revisions: yield* settling(staged.revisions),
|
|
236
|
+
fileIds: yield* settling(staged.fileIds),
|
|
237
|
+
changes: yield* settling(staged.changes),
|
|
282
238
|
};
|
|
283
239
|
}
|
package/dist/paths.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function normalize(path: string): string | null;
|
|
2
2
|
export declare function beneath(prefix: string, path: string): boolean;
|
|
3
3
|
export declare function covered(prefixes: readonly string[], path: string): boolean;
|
|
4
|
+
export declare function ancestors(path: string): readonly string[];
|
|
4
5
|
//# sourceMappingURL=paths.d.ts.map
|
package/dist/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK1E"}
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK1E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAGzD"}
|
package/dist/paths.js
CHANGED
|
@@ -22,3 +22,7 @@ export function covered(prefixes, path) {
|
|
|
22
22
|
return normalized !== null && (normalized === '' || beneath(normalized, path));
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
export function ancestors(path) {
|
|
26
|
+
const parts = path.split('/');
|
|
27
|
+
return parts.slice(1).map((_, at) => parts.slice(0, at + 1).join('/'));
|
|
28
|
+
}
|
package/dist/phrase.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phrase.d.ts","sourceRoot":"","sources":["../src/phrase.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAMpF"}
|
package/dist/phrase.js
ADDED
package/dist/query.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Definition } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { HeadChange } from './adapter.js';
|
|
3
|
+
import type { BinaryFileRecord } from './binary.js';
|
|
4
|
+
import type { Open } from './open.js';
|
|
3
5
|
export type Value = string | number | boolean | null;
|
|
4
6
|
export type Predicate = Value | {
|
|
5
7
|
$eq: Value;
|
|
@@ -36,14 +38,17 @@ export type Filter = {
|
|
|
36
38
|
types?: readonly string[];
|
|
37
39
|
where?: Where;
|
|
38
40
|
pathPrefix?: string;
|
|
41
|
+
folder?: string;
|
|
42
|
+
paths?: readonly string[];
|
|
39
43
|
hop?: Related & {
|
|
40
44
|
field: string;
|
|
41
45
|
};
|
|
42
46
|
backlinks?: Related & {
|
|
43
47
|
field?: string;
|
|
44
48
|
};
|
|
49
|
+
text?: string;
|
|
45
50
|
};
|
|
46
|
-
export type Key = 'room' | 'path' | 'type' | {
|
|
51
|
+
export type Key = 'room' | 'path' | 'type' | 'folder' | {
|
|
47
52
|
field: string;
|
|
48
53
|
};
|
|
49
54
|
export type Select = 'all' | {
|
|
@@ -53,6 +58,8 @@ export type Select = 'all' | {
|
|
|
53
58
|
markdown?: true;
|
|
54
59
|
backlinks?: true;
|
|
55
60
|
change?: true;
|
|
61
|
+
fileId?: true;
|
|
62
|
+
revision?: true;
|
|
56
63
|
};
|
|
57
64
|
export type OrderOptions = {
|
|
58
65
|
nulls?: 'first' | 'last';
|
|
@@ -68,6 +75,8 @@ export type DocumentQuery = Filter & {
|
|
|
68
75
|
direction?: Direction;
|
|
69
76
|
} & OrderOptions)[];
|
|
70
77
|
limit?: number;
|
|
78
|
+
after?: string;
|
|
79
|
+
total?: true;
|
|
71
80
|
};
|
|
72
81
|
export type GroupQuery = Filter & {
|
|
73
82
|
groupBy: readonly Exclude<Key, 'path'>[];
|
|
@@ -76,6 +85,8 @@ export type GroupQuery = Filter & {
|
|
|
76
85
|
direction?: Direction;
|
|
77
86
|
}[];
|
|
78
87
|
limit?: number;
|
|
88
|
+
after?: string;
|
|
89
|
+
total?: true;
|
|
79
90
|
};
|
|
80
91
|
export type LocalQuery = DocumentQuery | GroupQuery;
|
|
81
92
|
export type Backlink = {
|
|
@@ -91,20 +102,53 @@ export type QueryDocument = {
|
|
|
91
102
|
sections?: Readonly<Record<string, string>>;
|
|
92
103
|
preamble?: string;
|
|
93
104
|
markdown?: string;
|
|
105
|
+
textHeld?: false;
|
|
94
106
|
backlinks?: readonly Backlink[];
|
|
95
107
|
change?: HeadChange | null;
|
|
108
|
+
fileId?: string | null;
|
|
109
|
+
revision?: string | null;
|
|
110
|
+
binaryFile?: BinaryFileRecord;
|
|
96
111
|
};
|
|
97
112
|
export type QueryGroup = {
|
|
98
113
|
key: readonly unknown[];
|
|
99
114
|
count: number;
|
|
100
115
|
};
|
|
101
|
-
export type
|
|
116
|
+
export type CoveredRoom = {
|
|
117
|
+
room: string;
|
|
118
|
+
generation: string;
|
|
119
|
+
current: boolean;
|
|
120
|
+
};
|
|
121
|
+
export type QueryCoverage = {
|
|
122
|
+
rooms: readonly CoveredRoom[];
|
|
123
|
+
indexes: readonly string[];
|
|
124
|
+
overlay: readonly string[];
|
|
125
|
+
};
|
|
126
|
+
export type Awaits = Open<'acquisition' | 'preparation' | 'unlock'>;
|
|
127
|
+
export type PendingRoom = {
|
|
128
|
+
room: string;
|
|
129
|
+
awaits: Awaits;
|
|
130
|
+
};
|
|
131
|
+
export type PendingResult = {
|
|
132
|
+
pending: readonly PendingRoom[];
|
|
133
|
+
};
|
|
134
|
+
export type DocumentRows = {
|
|
102
135
|
documents: readonly QueryDocument[];
|
|
136
|
+
next?: string;
|
|
137
|
+
total?: number;
|
|
103
138
|
};
|
|
104
|
-
export type
|
|
139
|
+
export type GroupRows = {
|
|
105
140
|
groups: readonly QueryGroup[];
|
|
141
|
+
next?: string;
|
|
142
|
+
total?: number;
|
|
143
|
+
};
|
|
144
|
+
export type QueryRows = DocumentRows | GroupRows;
|
|
145
|
+
export type DocumentResult = DocumentRows & {
|
|
146
|
+
coverage: QueryCoverage;
|
|
106
147
|
};
|
|
107
|
-
export type
|
|
148
|
+
export type GroupResult = GroupRows & {
|
|
149
|
+
coverage: QueryCoverage;
|
|
150
|
+
};
|
|
151
|
+
export type QueryResult = DocumentResult | GroupResult | PendingResult;
|
|
108
152
|
export type QueryErrorCode = 'invalid-query' | 'unknown-type' | 'unknown-field' | 'wrong-kind';
|
|
109
153
|
export type RoomFacts = {
|
|
110
154
|
locator: string;
|
|
@@ -159,6 +203,8 @@ export type KeyPlan = {
|
|
|
159
203
|
of: 'path';
|
|
160
204
|
} | {
|
|
161
205
|
of: 'type';
|
|
206
|
+
} | {
|
|
207
|
+
of: 'folder';
|
|
162
208
|
} | {
|
|
163
209
|
of: 'field';
|
|
164
210
|
field: string;
|
|
@@ -171,6 +217,8 @@ export type DocumentShape = {
|
|
|
171
217
|
markdown: boolean;
|
|
172
218
|
backlinks: boolean;
|
|
173
219
|
change: boolean;
|
|
220
|
+
fileId: boolean;
|
|
221
|
+
revision: boolean;
|
|
174
222
|
orderBy: readonly {
|
|
175
223
|
key: KeyPlan;
|
|
176
224
|
options: OrderOptions & {
|
|
@@ -178,6 +226,7 @@ export type DocumentShape = {
|
|
|
178
226
|
};
|
|
179
227
|
}[];
|
|
180
228
|
};
|
|
229
|
+
export declare function bodied(shape: DocumentShape): boolean;
|
|
181
230
|
export type GroupShape = {
|
|
182
231
|
kind: 'groups';
|
|
183
232
|
groupBy: readonly KeyPlan[];
|
|
@@ -186,33 +235,54 @@ export type GroupShape = {
|
|
|
186
235
|
direction: Direction;
|
|
187
236
|
}[];
|
|
188
237
|
};
|
|
238
|
+
export type PlanArea = {
|
|
239
|
+
room: string;
|
|
240
|
+
path: string;
|
|
241
|
+
open: readonly string[];
|
|
242
|
+
};
|
|
189
243
|
export type PlanReach = {
|
|
190
244
|
rooms: readonly string[];
|
|
191
245
|
documents: readonly string[];
|
|
246
|
+
areas: readonly PlanArea[];
|
|
247
|
+
};
|
|
248
|
+
export type Continuation = {
|
|
249
|
+
text: string;
|
|
250
|
+
values: readonly unknown[] | null;
|
|
192
251
|
};
|
|
193
252
|
export type Plan = {
|
|
253
|
+
key: string;
|
|
194
254
|
rooms: readonly string[] | null;
|
|
195
255
|
reach: PlanReach | null;
|
|
256
|
+
locked: readonly string[];
|
|
196
257
|
root: Scope;
|
|
258
|
+
folder: string | null;
|
|
259
|
+
paths: readonly string[] | null;
|
|
197
260
|
hop: (Scope & {
|
|
198
261
|
field: string;
|
|
199
262
|
}) | null;
|
|
200
263
|
backlinks: (Scope & {
|
|
201
264
|
field: string | null;
|
|
202
265
|
}) | null;
|
|
266
|
+
text: string | null;
|
|
203
267
|
shape: DocumentShape | GroupShape;
|
|
204
268
|
limit: number | null;
|
|
269
|
+
after: Continuation | null;
|
|
270
|
+
total: boolean;
|
|
205
271
|
};
|
|
206
272
|
export declare class QueryError extends Error {
|
|
273
|
+
readonly code: QueryErrorCode;
|
|
274
|
+
readonly retryable = false;
|
|
207
275
|
constructor(code: QueryErrorCode, at: string, problem: string);
|
|
208
276
|
}
|
|
209
277
|
type Entries = Readonly<Record<string, unknown>>;
|
|
210
278
|
export declare function invalid(at: string, problem: string): never;
|
|
211
279
|
export declare function plain(value: unknown): value is Entries;
|
|
212
280
|
export declare function known(value: Entries, allowed: readonly string[], at: string): void;
|
|
281
|
+
export declare function flag(input: unknown, at: string): boolean;
|
|
213
282
|
export declare function planOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
214
283
|
export declare function limitOf(input: unknown): number | null;
|
|
215
284
|
export declare function filterOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
285
|
+
export declare function queryKey(query: unknown): string;
|
|
216
286
|
export declare function identityOf(plan: Plan): string;
|
|
217
287
|
export {};
|
|
218
288
|
//# sourceMappingURL=query.d.ts.map
|
package/dist/query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAItC,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAErD,MAAM,MAAM,SAAS,GACjB,KAAK,GACL;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,GACd;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,GACd;IAAE,GAAG,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GAC1B;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GAC1B;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