@agentshouse/mdruntime 0.1.0-ca9afacd5aebd → 0.1.0-caee7332d2235
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/AGENTS.md +271 -290
- package/README.md +8 -8
- package/dist/adapter.d.ts +52 -10
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attempt.d.ts.map +1 -1
- package/dist/attempt.js +14 -1
- package/dist/bootstrap.d.ts +3 -2
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +33 -7
- package/dist/change-set.d.ts +7 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +41 -10
- package/dist/chat/acts.d.ts +3 -4
- package/dist/chat/acts.d.ts.map +1 -1
- package/dist/chat/acts.js +10 -10
- package/dist/chat/earlier.d.ts +10 -0
- package/dist/chat/earlier.d.ts.map +1 -0
- package/dist/chat/earlier.js +54 -0
- package/dist/chat/kit.d.ts +2 -1
- package/dist/chat/kit.d.ts.map +1 -1
- package/dist/chat/kit.js +3 -3
- package/dist/chat/list.d.ts +8 -1
- package/dist/chat/list.d.ts.map +1 -1
- package/dist/chat/list.js +48 -8
- package/dist/chat/markdown.d.ts +3 -1
- package/dist/chat/markdown.d.ts.map +1 -1
- package/dist/chat/markdown.js +85 -26
- package/dist/chat/message.d.ts.map +1 -1
- package/dist/chat/message.js +3 -3
- package/dist/chat/messages.d.ts +1 -0
- package/dist/chat/messages.d.ts.map +1 -1
- package/dist/chat/messages.js +35 -15
- package/dist/chat/pieces.d.ts +62 -0
- package/dist/chat/pieces.d.ts.map +1 -0
- package/dist/chat/pieces.js +1110 -0
- package/dist/chat/provider.d.ts +1 -1
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +65 -80
- package/dist/chat/question.d.ts +1 -1
- package/dist/chat/question.d.ts.map +1 -1
- package/dist/chat/question.js +7 -18
- package/dist/chat/ready.d.ts +1 -0
- package/dist/chat/ready.d.ts.map +1 -1
- package/dist/chat/ready.js +4 -4
- package/dist/chat/steady.d.ts +3 -0
- package/dist/chat/steady.d.ts.map +1 -0
- package/dist/chat/steady.js +26 -0
- package/dist/chat/style.js +4 -4
- package/dist/chat.d.ts +1 -1
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/client.d.ts +17 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +19 -6
- package/dist/collection.d.ts +20 -5
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +309 -33
- package/dist/connection.d.ts +31 -9
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +1602 -386
- package/dist/conversation.d.ts +20 -7
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +474 -163
- package/dist/durability.d.ts +7 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +17 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +157 -0
- package/dist/fence.d.ts +6 -0
- package/dist/fence.d.ts.map +1 -0
- package/dist/fence.js +10 -0
- package/dist/host.d.ts +15 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +94 -12
- package/dist/identity.d.ts +2 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +6 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/memory.d.ts +8 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +33 -6
- package/dist/model.d.ts +4 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +10 -1
- package/dist/observation.d.ts +7 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +29 -12
- package/dist/outcome.d.ts +12 -2
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +4 -0
- package/dist/overlay.d.ts +5 -3
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +203 -159
- package/dist/query.d.ts +56 -4
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +36 -7
- package/dist/reach.d.ts +6 -3
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +30 -5
- package/dist/react.d.ts +8 -6
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -17
- package/dist/read-side.d.ts +16 -7
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +486 -100
- package/dist/readiness.d.ts +53 -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 +98 -0
- package/dist/recovery.d.ts +25 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +197 -0
- package/dist/refresh.d.ts +4 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +44 -18
- package/dist/replica.d.ts +11 -5
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +111 -56
- package/dist/room-draft.d.ts +13 -1
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +11 -12
- package/dist/rows.d.ts +6 -13
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +10 -13
- package/dist/save.d.ts +10 -4
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +216 -108
- package/dist/search.d.ts +49 -6
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +192 -47
- 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 +398 -0
- package/dist/status.d.ts +4 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/store.d.ts +61 -12
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +580 -268
- package/dist/turn.d.ts +9 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +64 -0
- package/dist/windows.d.ts +26 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +93 -0
- package/dist/wire.d.ts +152 -32
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +52 -31
- package/package.json +12 -8
package/dist/overlay.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { apply, parse, serialize } from '@agentshouse/mdmodel';
|
|
1
|
+
import { apply, frontmatterValue, parse, serialize, } from '@agentshouse/mdmodel';
|
|
2
|
+
import { differences, drafted, patching, settling } from './shared.js';
|
|
3
|
+
import { ROW_WEIGHT } from './turn.js';
|
|
2
4
|
export function acceptedBinaries(files) {
|
|
3
5
|
return Object.fromEntries(Object.entries(files).map(([path, file]) => [path, { state: 'accepted', ...file }]));
|
|
4
6
|
}
|
|
@@ -22,10 +24,13 @@ export function sameChange(left, right) {
|
|
|
22
24
|
left.author?.name === right.author?.name);
|
|
23
25
|
}
|
|
24
26
|
const EMPTY_FRONTMATTER = '---\n---\n';
|
|
27
|
+
function isPart(change) {
|
|
28
|
+
return change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble';
|
|
29
|
+
}
|
|
25
30
|
function at(path, name) {
|
|
26
31
|
return `${path} ${name}`;
|
|
27
32
|
}
|
|
28
|
-
function priorsOf(preconditions) {
|
|
33
|
+
function* priorsOf(preconditions) {
|
|
29
34
|
const fields = new Map();
|
|
30
35
|
const sections = new Map();
|
|
31
36
|
const preambles = new Map();
|
|
@@ -39,6 +44,7 @@ function priorsOf(preconditions) {
|
|
|
39
44
|
if (precondition.kind === 'preamble') {
|
|
40
45
|
preambles.set(precondition.path, precondition.value);
|
|
41
46
|
}
|
|
47
|
+
yield ROW_WEIGHT;
|
|
42
48
|
}
|
|
43
49
|
return {
|
|
44
50
|
field: (path, name) => fields.get(at(path, name)),
|
|
@@ -54,51 +60,50 @@ function compose(fields, sections) {
|
|
|
54
60
|
const opened = parse(skeleton);
|
|
55
61
|
if (!opened.ok)
|
|
56
62
|
return skeleton;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const next = apply(document, { kind: 'field', name, value, prior: undefined });
|
|
60
|
-
if (next.outcome === 'applied')
|
|
61
|
-
document = next.document;
|
|
62
|
-
}
|
|
63
|
-
return serialize(document);
|
|
63
|
+
const next = apply(opened.document, Object.entries(fields).flatMap(([name, value]) => frontmatterValue(value) ? [{ kind: 'field', name, value, prior: undefined }] : []));
|
|
64
|
+
return serialize(next.outcome === 'applied' ? next.document : opened.document);
|
|
64
65
|
}
|
|
65
|
-
function edited(
|
|
66
|
-
if (change.kind === 'field')
|
|
67
|
-
return
|
|
66
|
+
function edited(change, priors) {
|
|
67
|
+
if (change.kind === 'field')
|
|
68
|
+
return {
|
|
68
69
|
kind: 'field',
|
|
69
70
|
name: change.name,
|
|
70
71
|
value: change.value,
|
|
71
72
|
prior: priors.field(change.path, change.name),
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
kind: 'preamble',
|
|
77
|
-
value: change.value,
|
|
78
|
-
prior: priors.preamble(change.path),
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
if (change.kind !== 'section')
|
|
82
|
-
return null;
|
|
83
|
-
return apply(document, {
|
|
73
|
+
};
|
|
74
|
+
if (change.kind === 'preamble')
|
|
75
|
+
return { kind: 'preamble', value: change.value, prior: priors.preamble(change.path) };
|
|
76
|
+
return {
|
|
84
77
|
kind: 'section',
|
|
85
78
|
name: change.name,
|
|
86
79
|
value: change.value,
|
|
87
80
|
prior: priors.section(change.path, change.name),
|
|
88
|
-
}
|
|
81
|
+
};
|
|
89
82
|
}
|
|
90
|
-
function edit(staged,
|
|
91
|
-
const
|
|
83
|
+
function edit(staged, changes, priors) {
|
|
84
|
+
const path = changes[0].path;
|
|
85
|
+
delete staged.revisions[path];
|
|
86
|
+
const text = staged.documents[path];
|
|
92
87
|
if (text === undefined)
|
|
93
|
-
return
|
|
94
|
-
const parsed = parse(text,
|
|
88
|
+
return changes.length;
|
|
89
|
+
const parsed = parse(text, path);
|
|
95
90
|
if (!parsed.ok)
|
|
96
|
-
return
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
return changes.length;
|
|
92
|
+
const wanted = changes.map((change) => edited(change, priors));
|
|
93
|
+
const first = apply(parsed.document, wanted);
|
|
94
|
+
if (first.outcome === 'refuse')
|
|
95
|
+
return changes.length;
|
|
96
|
+
if (first.outcome === 'applied') {
|
|
97
|
+
staged.documents[path] = serialize(first.document);
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
const stale = new Set(first.stale);
|
|
101
|
+
const kept = wanted.filter((_, at) => !stale.has(at));
|
|
102
|
+
const rest = apply(parsed.document, kept);
|
|
103
|
+
if (rest.outcome !== 'applied')
|
|
104
|
+
return changes.length;
|
|
105
|
+
staged.documents[path] = serialize(rest.document);
|
|
106
|
+
return first.stale.length;
|
|
102
107
|
}
|
|
103
108
|
function relocate(staged, from, to) {
|
|
104
109
|
const text = staged.documents[from];
|
|
@@ -118,32 +123,37 @@ function relocate(staged, from, to) {
|
|
|
118
123
|
}
|
|
119
124
|
function moveHead(heads, from, to) {
|
|
120
125
|
const revision = heads.revisions[from];
|
|
126
|
+
const fileId = heads.fileIds[from];
|
|
121
127
|
const change = heads.changes[from];
|
|
122
128
|
delete heads.revisions[from];
|
|
129
|
+
delete heads.fileIds[from];
|
|
123
130
|
delete heads.changes[from];
|
|
131
|
+
delete heads.fileIds[to];
|
|
124
132
|
delete heads.changes[to];
|
|
125
133
|
if (revision !== undefined)
|
|
126
134
|
heads.revisions[to] = revision;
|
|
135
|
+
if (fileId !== undefined)
|
|
136
|
+
heads.fileIds[to] = fileId;
|
|
127
137
|
if (change !== undefined)
|
|
128
138
|
heads.changes[to] = change;
|
|
129
139
|
}
|
|
130
140
|
function erase(staged, path) {
|
|
131
141
|
delete staged.documents[path];
|
|
132
142
|
delete staged.revisions[path];
|
|
143
|
+
delete staged.fileIds[path];
|
|
133
144
|
delete staged.changes[path];
|
|
134
145
|
delete staged.binaries[path];
|
|
135
146
|
}
|
|
136
|
-
function stage(staged, change
|
|
137
|
-
if (change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble') {
|
|
138
|
-
return edit(staged, change, priors);
|
|
139
|
-
}
|
|
147
|
+
function stage(staged, change) {
|
|
140
148
|
if (change.kind === 'create') {
|
|
141
149
|
staged.documents[change.path] =
|
|
142
150
|
'content' in change ? change.content : compose(change.fields, change.sections);
|
|
151
|
+
delete staged.fileIds[change.path];
|
|
143
152
|
delete staged.changes[change.path];
|
|
144
153
|
return true;
|
|
145
154
|
}
|
|
146
155
|
if (change.kind === 'replace') {
|
|
156
|
+
delete staged.revisions[change.path];
|
|
147
157
|
if (staged.documents[change.path] === undefined)
|
|
148
158
|
return false;
|
|
149
159
|
staged.documents[change.path] = change.content;
|
|
@@ -169,153 +179,187 @@ function stage(staged, change, priors) {
|
|
|
169
179
|
erase(staged, change.path);
|
|
170
180
|
return true;
|
|
171
181
|
}
|
|
172
|
-
export function
|
|
182
|
+
export function* overlaying(base, queue, unapplied) {
|
|
173
183
|
const staged = {
|
|
174
|
-
documents:
|
|
175
|
-
binaries:
|
|
176
|
-
revisions:
|
|
177
|
-
|
|
184
|
+
documents: drafted(base.documents),
|
|
185
|
+
binaries: drafted(base.binaries),
|
|
186
|
+
revisions: drafted(base.revisions),
|
|
187
|
+
fileIds: drafted(base.fileIds),
|
|
188
|
+
changes: drafted(base.changes),
|
|
178
189
|
};
|
|
179
190
|
for (const batch of queue) {
|
|
180
|
-
const priors = priorsOf(batch.preconditions);
|
|
181
|
-
for (
|
|
182
|
-
|
|
191
|
+
const priors = yield* priorsOf(batch.preconditions);
|
|
192
|
+
for (let index = 0; index < batch.changes.length; index += 1) {
|
|
193
|
+
const change = batch.changes[index];
|
|
194
|
+
if (!isPart(change)) {
|
|
195
|
+
if (!stage(staged, change))
|
|
196
|
+
unapplied?.();
|
|
197
|
+
yield ROW_WEIGHT;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
const run = [change];
|
|
201
|
+
while (index + 1 < batch.changes.length) {
|
|
202
|
+
const next = batch.changes[index + 1];
|
|
203
|
+
if (!isPart(next) || next.path !== change.path)
|
|
204
|
+
break;
|
|
205
|
+
run.push(next);
|
|
206
|
+
index += 1;
|
|
207
|
+
}
|
|
208
|
+
const text = staged.documents[change.path] ?? '';
|
|
209
|
+
for (let left = edit(staged, run, priors); left > 0; left -= 1)
|
|
183
210
|
unapplied?.();
|
|
211
|
+
yield ROW_WEIGHT + text.length;
|
|
184
212
|
}
|
|
185
213
|
}
|
|
186
214
|
return {
|
|
187
|
-
documents: staged.documents,
|
|
188
|
-
binaries: staged.binaries,
|
|
189
|
-
revisions: staged.revisions,
|
|
190
|
-
|
|
215
|
+
documents: yield* settling(staged.documents),
|
|
216
|
+
binaries: yield* settling(staged.binaries),
|
|
217
|
+
revisions: yield* settling(staged.revisions),
|
|
218
|
+
fileIds: yield* settling(staged.fileIds),
|
|
219
|
+
changes: yield* settling(staged.changes),
|
|
191
220
|
};
|
|
192
221
|
}
|
|
193
|
-
function pathsOf(batch) {
|
|
194
|
-
|
|
222
|
+
function* pathsOf(batch) {
|
|
223
|
+
const paths = new Set();
|
|
224
|
+
for (const change of batch.changes) {
|
|
225
|
+
paths.add(change.path);
|
|
226
|
+
if (change.kind === 'move')
|
|
227
|
+
paths.add(change.to);
|
|
228
|
+
yield ROW_WEIGHT;
|
|
229
|
+
}
|
|
230
|
+
return paths;
|
|
195
231
|
}
|
|
196
|
-
export function
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
paths.every((path) => left.documents[path] === right.documents[path]) &&
|
|
200
|
-
sameBinaries(left.binaries, right.binaries));
|
|
232
|
+
export function* sameText(left, right) {
|
|
233
|
+
return ((yield* differences(left.documents, right.documents)).size === 0 &&
|
|
234
|
+
(yield* differences(left.binaries, right.binaries, sameBinary)).size === 0);
|
|
201
235
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
236
|
+
export function* changedPaths(left, right) {
|
|
237
|
+
return new Set([
|
|
238
|
+
...(yield* differences(left.documents, right.documents)),
|
|
239
|
+
...(yield* differences(left.revisions, right.revisions)),
|
|
240
|
+
...(yield* differences(left.fileIds, right.fileIds)),
|
|
241
|
+
...(yield* differences(left.changes, right.changes, sameChange)),
|
|
242
|
+
...(yield* differences(left.binaries, right.binaries, sameBinary)),
|
|
243
|
+
]);
|
|
206
244
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
245
|
+
function* sameItems(left, right) {
|
|
246
|
+
if (left.length !== right.length)
|
|
247
|
+
return false;
|
|
248
|
+
for (let index = 0; index < left.length; index += 1) {
|
|
249
|
+
const item = JSON.stringify(left[index]);
|
|
250
|
+
if (item !== JSON.stringify(right[index]))
|
|
251
|
+
return false;
|
|
252
|
+
yield ROW_WEIGHT + item.length;
|
|
253
|
+
}
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
function* sameBatch(left, right) {
|
|
257
|
+
if (left === right)
|
|
258
|
+
return true;
|
|
259
|
+
const { changes, preconditions, ...rest } = left;
|
|
260
|
+
const { changes: others, preconditions: priors, ...held } = right;
|
|
261
|
+
return (JSON.stringify(rest) === JSON.stringify(held) &&
|
|
262
|
+
(yield* sameItems(changes, others)) &&
|
|
263
|
+
(yield* sameItems(preconditions, priors)));
|
|
264
|
+
}
|
|
265
|
+
function* replayHeads(base, batch) {
|
|
266
|
+
const heads = {
|
|
267
|
+
revisions: drafted(base.revisions),
|
|
268
|
+
fileIds: drafted(base.fileIds),
|
|
269
|
+
changes: drafted(base.changes),
|
|
270
|
+
};
|
|
271
|
+
for (const change of batch.changes) {
|
|
272
|
+
if (change.kind === 'remove') {
|
|
273
|
+
delete heads.revisions[change.path];
|
|
274
|
+
delete heads.fileIds[change.path];
|
|
275
|
+
delete heads.changes[change.path];
|
|
225
276
|
}
|
|
277
|
+
else if (change.kind === 'create') {
|
|
278
|
+
delete heads.fileIds[change.path];
|
|
279
|
+
delete heads.changes[change.path];
|
|
280
|
+
}
|
|
281
|
+
else if (change.kind === 'replace' ||
|
|
282
|
+
change.kind === 'field' ||
|
|
283
|
+
change.kind === 'section' ||
|
|
284
|
+
change.kind === 'preamble') {
|
|
285
|
+
delete heads.revisions[change.path];
|
|
286
|
+
}
|
|
287
|
+
else if (change.kind === 'binary') {
|
|
288
|
+
delete heads.revisions[change.path];
|
|
289
|
+
delete heads.changes[change.path];
|
|
290
|
+
}
|
|
291
|
+
else if (change.kind === 'move') {
|
|
292
|
+
moveHead(heads, change.path, change.to);
|
|
293
|
+
}
|
|
294
|
+
yield ROW_WEIGHT;
|
|
226
295
|
}
|
|
227
|
-
return
|
|
296
|
+
return {
|
|
297
|
+
revisions: yield* settling(heads.revisions),
|
|
298
|
+
fileIds: yield* settling(heads.fileIds),
|
|
299
|
+
changes: yield* settling(heads.changes),
|
|
300
|
+
};
|
|
228
301
|
}
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
302
|
+
function* repatched(held, paths, value) {
|
|
303
|
+
const set = [];
|
|
304
|
+
const removed = [];
|
|
305
|
+
for (const path of paths) {
|
|
306
|
+
const found = value(path);
|
|
307
|
+
if (found === undefined)
|
|
308
|
+
removed.push(path);
|
|
309
|
+
else
|
|
310
|
+
set.push([path, found]);
|
|
311
|
+
yield ROW_WEIGHT;
|
|
312
|
+
}
|
|
313
|
+
return yield* patching(held, set, removed);
|
|
314
|
+
}
|
|
315
|
+
export function* overlayChanged(base, batch, previousBase, previousBatch, previousVisible) {
|
|
316
|
+
const same = yield* sameBatch(batch, previousBatch);
|
|
317
|
+
if (same && (yield* sameText(base, previousBase))) {
|
|
235
318
|
return {
|
|
236
319
|
documents: previousVisible.documents,
|
|
237
320
|
binaries: previousVisible.binaries,
|
|
238
|
-
...replayHeads(base,
|
|
321
|
+
...(yield* replayHeads(base, batch)),
|
|
239
322
|
};
|
|
240
323
|
}
|
|
241
|
-
const affected = new Set();
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
...Object.keys(previousBase.revisions),
|
|
247
|
-
...Object.keys(base.changes),
|
|
248
|
-
...Object.keys(previousBase.changes),
|
|
249
|
-
...Object.keys(base.binaries),
|
|
250
|
-
...Object.keys(previousBase.binaries),
|
|
251
|
-
]);
|
|
252
|
-
for (const path of paths) {
|
|
253
|
-
if (base.documents[path] !== previousBase.documents[path] ||
|
|
254
|
-
base.revisions[path] !== previousBase.revisions[path] ||
|
|
255
|
-
!sameChange(base.changes[path], previousBase.changes[path]) ||
|
|
256
|
-
!sameBinary(base.binaries[path], previousBase.binaries[path]))
|
|
324
|
+
const affected = new Set(yield* changedPaths(base, previousBase));
|
|
325
|
+
const touched = yield* pathsOf(batch);
|
|
326
|
+
let replayed = !same;
|
|
327
|
+
if (replayed)
|
|
328
|
+
for (const path of yield* pathsOf(previousBatch))
|
|
257
329
|
affected.add(path);
|
|
330
|
+
for (const path of touched) {
|
|
331
|
+
if (affected.has(path))
|
|
332
|
+
replayed = true;
|
|
333
|
+
yield ROW_WEIGHT;
|
|
258
334
|
}
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
for (const
|
|
267
|
-
|
|
268
|
-
for (const path of pathsOf(batch))
|
|
269
|
-
affected.add(path);
|
|
270
|
-
}
|
|
271
|
-
let expanded = true;
|
|
272
|
-
while (expanded) {
|
|
273
|
-
expanded = false;
|
|
274
|
-
for (const batch of queue) {
|
|
275
|
-
const touched = pathsOf(batch);
|
|
276
|
-
if (!touched.some((path) => affected.has(path)))
|
|
277
|
-
continue;
|
|
278
|
-
for (const path of touched) {
|
|
279
|
-
if (affected.has(path))
|
|
280
|
-
continue;
|
|
281
|
-
affected.add(path);
|
|
282
|
-
expanded = true;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
const documents = {};
|
|
287
|
-
const revisions = {};
|
|
288
|
-
const changes = {};
|
|
289
|
-
const binaries = {};
|
|
290
|
-
for (const path of affected) {
|
|
335
|
+
const restricted = {
|
|
336
|
+
documents: {},
|
|
337
|
+
revisions: {},
|
|
338
|
+
fileIds: {},
|
|
339
|
+
changes: {},
|
|
340
|
+
binaries: {},
|
|
341
|
+
};
|
|
342
|
+
for (const path of replayed ? touched : []) {
|
|
343
|
+
affected.add(path);
|
|
291
344
|
if (base.documents[path] !== undefined)
|
|
292
|
-
documents[path] = base.documents[path];
|
|
345
|
+
restricted.documents[path] = base.documents[path];
|
|
293
346
|
if (base.revisions[path] !== undefined)
|
|
294
|
-
revisions[path] = base.revisions[path];
|
|
347
|
+
restricted.revisions[path] = base.revisions[path];
|
|
348
|
+
if (base.fileIds[path] !== undefined)
|
|
349
|
+
restricted.fileIds[path] = base.fileIds[path];
|
|
295
350
|
if (base.changes[path] !== undefined)
|
|
296
|
-
changes[path] = base.changes[path];
|
|
351
|
+
restricted.changes[path] = base.changes[path];
|
|
297
352
|
if (base.binaries[path] !== undefined)
|
|
298
|
-
binaries[path] = base.binaries[path];
|
|
299
|
-
|
|
300
|
-
const staged = overlay({ documents, revisions, changes, binaries }, queue.filter((batch) => pathsOf(batch).some((path) => affected.has(path))));
|
|
301
|
-
const mergedDocuments = { ...previousVisible.documents };
|
|
302
|
-
const mergedRevisions = { ...previousVisible.revisions };
|
|
303
|
-
const mergedChanges = { ...previousVisible.changes };
|
|
304
|
-
const mergedBinaries = { ...previousVisible.binaries };
|
|
305
|
-
for (const path of affected) {
|
|
306
|
-
delete mergedDocuments[path];
|
|
307
|
-
delete mergedRevisions[path];
|
|
308
|
-
delete mergedChanges[path];
|
|
309
|
-
delete mergedBinaries[path];
|
|
353
|
+
restricted.binaries[path] = base.binaries[path];
|
|
354
|
+
yield ROW_WEIGHT;
|
|
310
355
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
Object.assign(mergedChanges, staged.changes);
|
|
314
|
-
Object.assign(mergedBinaries, staged.binaries);
|
|
356
|
+
const staged = replayed ? yield* overlaying(restricted, [batch]) : base;
|
|
357
|
+
const from = (path) => (touched.has(path) ? staged : base);
|
|
315
358
|
return {
|
|
316
|
-
documents:
|
|
317
|
-
revisions:
|
|
318
|
-
|
|
319
|
-
|
|
359
|
+
documents: yield* repatched(previousVisible.documents, affected, (path) => from(path).documents[path]),
|
|
360
|
+
revisions: yield* repatched(previousVisible.revisions, affected, (path) => from(path).revisions[path]),
|
|
361
|
+
fileIds: yield* repatched(previousVisible.fileIds, affected, (path) => from(path).fileIds[path]),
|
|
362
|
+
changes: yield* repatched(previousVisible.changes, affected, (path) => from(path).changes[path]),
|
|
363
|
+
binaries: yield* repatched(previousVisible.binaries, affected, (path) => from(path).binaries[path]),
|
|
320
364
|
};
|
|
321
365
|
}
|
package/dist/query.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Definition } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { HeadChange } from './adapter.js';
|
|
3
3
|
import type { BinaryFileRecord } from './binary.js';
|
|
4
|
+
import type { Open } from './open.js';
|
|
4
5
|
export type Value = string | number | boolean | null;
|
|
5
6
|
export type Predicate = Value | {
|
|
6
7
|
$eq: Value;
|
|
@@ -37,6 +38,8 @@ export type Filter = {
|
|
|
37
38
|
types?: readonly string[];
|
|
38
39
|
where?: Where;
|
|
39
40
|
pathPrefix?: string;
|
|
41
|
+
folder?: string;
|
|
42
|
+
paths?: readonly string[];
|
|
40
43
|
hop?: Related & {
|
|
41
44
|
field: string;
|
|
42
45
|
};
|
|
@@ -44,7 +47,7 @@ export type Filter = {
|
|
|
44
47
|
field?: string;
|
|
45
48
|
};
|
|
46
49
|
};
|
|
47
|
-
export type Key = 'room' | 'path' | 'type' | {
|
|
50
|
+
export type Key = 'room' | 'path' | 'type' | 'folder' | {
|
|
48
51
|
field: string;
|
|
49
52
|
};
|
|
50
53
|
export type Select = 'all' | {
|
|
@@ -54,6 +57,7 @@ export type Select = 'all' | {
|
|
|
54
57
|
markdown?: true;
|
|
55
58
|
backlinks?: true;
|
|
56
59
|
change?: true;
|
|
60
|
+
fileId?: true;
|
|
57
61
|
};
|
|
58
62
|
export type OrderOptions = {
|
|
59
63
|
nulls?: 'first' | 'last';
|
|
@@ -69,6 +73,8 @@ export type DocumentQuery = Filter & {
|
|
|
69
73
|
direction?: Direction;
|
|
70
74
|
} & OrderOptions)[];
|
|
71
75
|
limit?: number;
|
|
76
|
+
after?: string;
|
|
77
|
+
total?: true;
|
|
72
78
|
};
|
|
73
79
|
export type GroupQuery = Filter & {
|
|
74
80
|
groupBy: readonly Exclude<Key, 'path'>[];
|
|
@@ -77,6 +83,8 @@ export type GroupQuery = Filter & {
|
|
|
77
83
|
direction?: Direction;
|
|
78
84
|
}[];
|
|
79
85
|
limit?: number;
|
|
86
|
+
after?: string;
|
|
87
|
+
total?: true;
|
|
80
88
|
};
|
|
81
89
|
export type LocalQuery = DocumentQuery | GroupQuery;
|
|
82
90
|
export type Backlink = {
|
|
@@ -94,19 +102,49 @@ export type QueryDocument = {
|
|
|
94
102
|
markdown?: string;
|
|
95
103
|
backlinks?: readonly Backlink[];
|
|
96
104
|
change?: HeadChange | null;
|
|
105
|
+
fileId?: string | null;
|
|
97
106
|
binaryFile?: BinaryFileRecord;
|
|
98
107
|
};
|
|
99
108
|
export type QueryGroup = {
|
|
100
109
|
key: readonly unknown[];
|
|
101
110
|
count: number;
|
|
102
111
|
};
|
|
103
|
-
export type
|
|
112
|
+
export type CoveredRoom = {
|
|
113
|
+
room: string;
|
|
114
|
+
generation: string;
|
|
115
|
+
current: boolean;
|
|
116
|
+
};
|
|
117
|
+
export type QueryCoverage = {
|
|
118
|
+
rooms: readonly CoveredRoom[];
|
|
119
|
+
indexes: readonly string[];
|
|
120
|
+
overlay: readonly string[];
|
|
121
|
+
};
|
|
122
|
+
export type Awaits = Open<'acquisition' | 'preparation' | 'index'>;
|
|
123
|
+
export type PendingRoom = {
|
|
124
|
+
room: string;
|
|
125
|
+
awaits: Awaits;
|
|
126
|
+
};
|
|
127
|
+
export type PendingResult = {
|
|
128
|
+
pending: readonly PendingRoom[];
|
|
129
|
+
};
|
|
130
|
+
export type DocumentRows = {
|
|
104
131
|
documents: readonly QueryDocument[];
|
|
132
|
+
next?: string;
|
|
133
|
+
total?: number;
|
|
105
134
|
};
|
|
106
|
-
export type
|
|
135
|
+
export type GroupRows = {
|
|
107
136
|
groups: readonly QueryGroup[];
|
|
137
|
+
next?: string;
|
|
138
|
+
total?: number;
|
|
139
|
+
};
|
|
140
|
+
export type QueryRows = DocumentRows | GroupRows;
|
|
141
|
+
export type DocumentResult = DocumentRows & {
|
|
142
|
+
coverage: QueryCoverage;
|
|
143
|
+
};
|
|
144
|
+
export type GroupResult = GroupRows & {
|
|
145
|
+
coverage: QueryCoverage;
|
|
108
146
|
};
|
|
109
|
-
export type QueryResult = DocumentResult | GroupResult;
|
|
147
|
+
export type QueryResult = DocumentResult | GroupResult | PendingResult;
|
|
110
148
|
export type QueryErrorCode = 'invalid-query' | 'unknown-type' | 'unknown-field' | 'wrong-kind';
|
|
111
149
|
export type RoomFacts = {
|
|
112
150
|
locator: string;
|
|
@@ -161,6 +199,8 @@ export type KeyPlan = {
|
|
|
161
199
|
of: 'path';
|
|
162
200
|
} | {
|
|
163
201
|
of: 'type';
|
|
202
|
+
} | {
|
|
203
|
+
of: 'folder';
|
|
164
204
|
} | {
|
|
165
205
|
of: 'field';
|
|
166
206
|
field: string;
|
|
@@ -173,6 +213,7 @@ export type DocumentShape = {
|
|
|
173
213
|
markdown: boolean;
|
|
174
214
|
backlinks: boolean;
|
|
175
215
|
change: boolean;
|
|
216
|
+
fileId: boolean;
|
|
176
217
|
orderBy: readonly {
|
|
177
218
|
key: KeyPlan;
|
|
178
219
|
options: OrderOptions & {
|
|
@@ -192,10 +233,17 @@ export type PlanReach = {
|
|
|
192
233
|
rooms: readonly string[];
|
|
193
234
|
documents: readonly string[];
|
|
194
235
|
};
|
|
236
|
+
export type Continuation = {
|
|
237
|
+
text: string;
|
|
238
|
+
values: readonly unknown[] | null;
|
|
239
|
+
};
|
|
195
240
|
export type Plan = {
|
|
241
|
+
key: string;
|
|
196
242
|
rooms: readonly string[] | null;
|
|
197
243
|
reach: PlanReach | null;
|
|
198
244
|
root: Scope;
|
|
245
|
+
folder: string | null;
|
|
246
|
+
paths: readonly string[] | null;
|
|
199
247
|
hop: (Scope & {
|
|
200
248
|
field: string;
|
|
201
249
|
}) | null;
|
|
@@ -204,6 +252,8 @@ export type Plan = {
|
|
|
204
252
|
}) | null;
|
|
205
253
|
shape: DocumentShape | GroupShape;
|
|
206
254
|
limit: number | null;
|
|
255
|
+
after: Continuation | null;
|
|
256
|
+
total: boolean;
|
|
207
257
|
};
|
|
208
258
|
export declare class QueryError extends Error {
|
|
209
259
|
readonly code: QueryErrorCode;
|
|
@@ -214,9 +264,11 @@ type Entries = Readonly<Record<string, unknown>>;
|
|
|
214
264
|
export declare function invalid(at: string, problem: string): never;
|
|
215
265
|
export declare function plain(value: unknown): value is Entries;
|
|
216
266
|
export declare function known(value: Entries, allowed: readonly string[], at: string): void;
|
|
267
|
+
export declare function flag(input: unknown, at: string): boolean;
|
|
217
268
|
export declare function planOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
218
269
|
export declare function limitOf(input: unknown): number | null;
|
|
219
270
|
export declare function filterOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
271
|
+
export declare function queryKey(query: unknown): string;
|
|
220
272
|
export declare function identityOf(plan: Plan): string;
|
|
221
273
|
export {};
|
|
222
274
|
//# 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,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;
|
|
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;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzB,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IACxB,GAAG,C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