@agentshouse/mdruntime 0.1.0-c97456d63baba → 0.1.0-c9b1e59e5baeb
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 +221 -221
- package/README.md +8 -8
- package/dist/adapter.d.ts +35 -6
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +2 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +5 -1
- package/dist/change-set.d.ts +5 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +8 -2
- 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.js +1 -1
- package/dist/chat/list.d.ts +2 -1
- package/dist/chat/list.d.ts.map +1 -1
- package/dist/chat/list.js +40 -4
- package/dist/chat/markdown.d.ts +1 -0
- package/dist/chat/markdown.d.ts.map +1 -1
- package/dist/chat/markdown.js +78 -20
- package/dist/chat/message.d.ts.map +1 -1
- package/dist/chat/message.js +9 -2
- package/dist/chat/messages.d.ts.map +1 -1
- package/dist/chat/messages.js +36 -16
- package/dist/chat/overlay.d.ts +1 -0
- package/dist/chat/overlay.d.ts.map +1 -1
- package/dist/chat/overlay.js +10 -0
- 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 -0
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +22 -14
- 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 -1
- package/dist/chat/ready.d.ts.map +1 -1
- package/dist/chat/ready.js +1 -1
- 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 +1 -1
- package/dist/chat.d.ts +2 -2
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/client.d.ts +6 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -5
- package/dist/collection.d.ts +4 -3
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +128 -63
- package/dist/connection.d.ts +13 -5
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +506 -228
- package/dist/conversation.d.ts +11 -0
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +195 -41
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +3 -2
- package/dist/host.d.ts +9 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +58 -9
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/memory.d.ts +7 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +24 -11
- package/dist/observation.d.ts +2 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +9 -3
- package/dist/outcome.d.ts +8 -2
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +3 -0
- package/dist/overlay.d.ts +5 -4
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +197 -132
- package/dist/query.d.ts +27 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +36 -7
- package/dist/reach.d.ts +1 -2
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +17 -4
- package/dist/react.d.ts +3 -3
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -17
- package/dist/read-side.d.ts +3 -1
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +256 -69
- package/dist/reads.d.ts +11 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +98 -0
- package/dist/refresh.d.ts +4 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +39 -14
- package/dist/replica.d.ts +11 -5
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +79 -41
- package/dist/room-draft.d.ts +12 -0
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +11 -12
- package/dist/rows.d.ts +3 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +8 -1
- package/dist/save.d.ts +4 -2
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +195 -111
- package/dist/search.d.ts +27 -6
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +89 -7
- 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 +4 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +63 -33
- package/dist/store.d.ts +20 -4
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +404 -317
- package/dist/turn.d.ts +5 -3
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +26 -7
- 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 +16 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +4 -0
- package/package.json +2 -2
- package/dist/acquisition.d.ts +0 -14
- package/dist/acquisition.d.ts.map +0 -1
- package/dist/acquisition.js +0 -24
package/dist/collection.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { checkDocument, parseFrontmatter, references, sectionReferences, target, parse, resolves,
|
|
1
|
+
import { checkDocument, parseFrontmatter, references, sectionReferences, target, parse, resolves, validating, VERSION, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { beneath, normalize } from './paths.js';
|
|
3
3
|
import { sameTyping } from './model.js';
|
|
4
|
-
import {
|
|
5
|
-
import { inUnits, ROW_WEIGHT } from './turn.js';
|
|
4
|
+
import { differences, patched, patching, shared, sizeOf } from './shared.js';
|
|
5
|
+
import { after, finished, inUnits, ROW_WEIGHT } from './turn.js';
|
|
6
6
|
export const MD_MODEL = { identity: '@agentshouse/mdmodel', version: VERSION };
|
|
7
7
|
const NO_TYPES = { types: {} };
|
|
8
8
|
function selected(composition, path) {
|
|
@@ -15,14 +15,14 @@ export function governing(composition, path) {
|
|
|
15
15
|
: composition.model;
|
|
16
16
|
}
|
|
17
17
|
const parsedIn = new WeakMap();
|
|
18
|
-
function carried(previous, text) {
|
|
18
|
+
function* carried(previous, text) {
|
|
19
19
|
const held = parsedIn.get(previous);
|
|
20
20
|
if (held === undefined)
|
|
21
21
|
return shared({});
|
|
22
|
-
const kept =
|
|
22
|
+
const kept = yield* patching(held.base, held.added);
|
|
23
23
|
held.base = kept;
|
|
24
24
|
held.added = new Map();
|
|
25
|
-
return
|
|
25
|
+
return yield* patching(kept, [], yield* differences(previous.text, text));
|
|
26
26
|
}
|
|
27
27
|
function cachedIn(collection, path) {
|
|
28
28
|
const held = parsedIn.get(collection);
|
|
@@ -33,8 +33,11 @@ function cachedIn(collection, path) {
|
|
|
33
33
|
return Object.hasOwn(held.base, path) ? held.base[path] : undefined;
|
|
34
34
|
}
|
|
35
35
|
export function collectionOf(text, composition, previous) {
|
|
36
|
+
return finished(collecting(text, composition, previous));
|
|
37
|
+
}
|
|
38
|
+
export function* collecting(text, composition, previous) {
|
|
36
39
|
const parsed = {
|
|
37
|
-
base: previous === undefined ? shared({}) : carried(previous, text),
|
|
40
|
+
base: previous === undefined ? shared({}) : yield* carried(previous, text),
|
|
38
41
|
added: new Map(),
|
|
39
42
|
};
|
|
40
43
|
const collection = {
|
|
@@ -79,51 +82,60 @@ export function* documentsOf(collection) {
|
|
|
79
82
|
yield [path, read.document];
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
export function unreadable(text, previous) {
|
|
85
|
+
export function* unreadable(text, previous) {
|
|
83
86
|
const paths = previous === undefined
|
|
84
87
|
? Object.keys(text)
|
|
85
|
-
: [...
|
|
88
|
+
: [...(yield* differences(previous, text))].filter((path) => text[path] !== undefined);
|
|
86
89
|
for (const path of paths.sort()) {
|
|
87
90
|
const read = parse(text[path], path);
|
|
88
91
|
if (!read.ok)
|
|
89
92
|
return { kind: 'refused', refusal: read.refusal };
|
|
93
|
+
yield ROW_WEIGHT + text[path].length;
|
|
90
94
|
}
|
|
91
95
|
return null;
|
|
92
96
|
}
|
|
93
97
|
export function validRoot(root) {
|
|
94
98
|
return typeof root === 'string' && normalize(root) === root;
|
|
95
99
|
}
|
|
96
|
-
function validateAgainst(documents, binaryTargets, model) {
|
|
100
|
+
function* validateAgainst(documents, binaryTargets, model) {
|
|
97
101
|
if (model.status === 'unavailable') {
|
|
98
|
-
const
|
|
102
|
+
for (const path of Object.keys(documents)) {
|
|
103
|
+
const content = documents[path];
|
|
99
104
|
const parsed = parse(content);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
if (parsed.ok && parsed.document.type !== undefined && parsed.document.type !== 'any')
|
|
106
|
+
return { verdict: 'refuse', rule: 'model-unavailable', file: path };
|
|
107
|
+
yield ROW_WEIGHT + content.length;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const steps = validating(documents, { binaryTargets }, model.status === 'unavailable' ? NO_TYPES : { types: model.types });
|
|
111
|
+
for (let step = steps.next();; step = steps.next()) {
|
|
112
|
+
if (step.done === true)
|
|
113
|
+
return step.value;
|
|
114
|
+
yield ROW_WEIGHT + documents[step.value].length;
|
|
104
115
|
}
|
|
105
|
-
return validate(documents, { binaryTargets }, model.status === 'unavailable' ? NO_TYPES : { types: model.types });
|
|
106
116
|
}
|
|
107
|
-
export function validateCollection(text, binaryTargets, composition) {
|
|
117
|
+
export function* validateCollection(text, binaryTargets, composition) {
|
|
108
118
|
const collection = {};
|
|
109
119
|
const selection = {};
|
|
110
|
-
for (const
|
|
120
|
+
for (const path of Object.keys(text)) {
|
|
111
121
|
if (selected(composition, path))
|
|
112
|
-
selection[path] =
|
|
122
|
+
selection[path] = text[path];
|
|
113
123
|
else
|
|
114
|
-
collection[path] =
|
|
124
|
+
collection[path] = text[path];
|
|
125
|
+
yield ROW_WEIGHT;
|
|
115
126
|
}
|
|
116
127
|
const verdicts = [
|
|
117
|
-
validateAgainst(collection, binaryTargets.filter((path) => !selected(composition, path)), composition.model),
|
|
128
|
+
yield* validateAgainst(collection, binaryTargets.filter((path) => !selected(composition, path)), composition.model),
|
|
118
129
|
];
|
|
119
130
|
if (composition.selection !== null) {
|
|
120
|
-
verdicts.push(validateAgainst(selection, binaryTargets.filter((path) => selected(composition, path)), composition.selection.model));
|
|
131
|
+
verdicts.push(yield* validateAgainst(selection, binaryTargets.filter((path) => selected(composition, path)), composition.selection.model));
|
|
121
132
|
}
|
|
122
133
|
const refusals = verdicts.filter((verdict) => verdict.verdict === 'refuse');
|
|
123
134
|
if (refusals.length === 0)
|
|
124
135
|
return verdicts[0];
|
|
125
136
|
return refusals.find((refusal) => refusal.rule !== 'model-unavailable') ?? refusals[0];
|
|
126
137
|
}
|
|
138
|
+
const NO_REFERRERS = shared({});
|
|
127
139
|
const referrersOf = new WeakMap();
|
|
128
140
|
function typing(left, right) {
|
|
129
141
|
return (sameTyping(left.model, right.model) &&
|
|
@@ -173,32 +185,81 @@ function referencedBy(path, content, composition) {
|
|
|
173
185
|
]),
|
|
174
186
|
];
|
|
175
187
|
}
|
|
176
|
-
function
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
188
|
+
function referrersOfTarget(index, target) {
|
|
189
|
+
return Object.hasOwn(index.referrers, target) ? index.referrers[target] : NO_REFERRERS;
|
|
190
|
+
}
|
|
191
|
+
function* reindexed(index, changed) {
|
|
192
|
+
const moved = new Map();
|
|
193
|
+
const movesOf = (target) => {
|
|
194
|
+
const held = moved.get(target) ?? { gained: [], lost: [] };
|
|
195
|
+
moved.set(target, held);
|
|
184
196
|
return held;
|
|
185
197
|
};
|
|
198
|
+
const targeting = [];
|
|
199
|
+
const targetless = [];
|
|
186
200
|
for (const [path, found] of changed) {
|
|
187
201
|
const before = Object.hasOwn(index.targets, path) ? index.targets[path] : [];
|
|
188
202
|
for (const target of before)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
203
|
+
if (!found.includes(target))
|
|
204
|
+
movesOf(target).lost.push(path);
|
|
205
|
+
for (const target of found) {
|
|
206
|
+
if (!before.includes(target))
|
|
207
|
+
movesOf(target).gained.push([path, true]);
|
|
208
|
+
}
|
|
209
|
+
if (found.length > 0)
|
|
210
|
+
targeting.push([path, found]);
|
|
211
|
+
else
|
|
212
|
+
targetless.push(path);
|
|
213
|
+
yield ROW_WEIGHT * (1 + before.length + found.length);
|
|
214
|
+
}
|
|
215
|
+
const referred = [];
|
|
216
|
+
const unreferred = [];
|
|
217
|
+
for (const [target, { gained, lost }] of moved) {
|
|
218
|
+
const files = yield* patching(referrersOfTarget(index, target), gained, lost);
|
|
219
|
+
if (sizeOf(files) > 0)
|
|
220
|
+
referred.push([target, files]);
|
|
221
|
+
else
|
|
222
|
+
unreferred.push(target);
|
|
192
223
|
}
|
|
193
|
-
const emptied = [...referrers].filter(([, held]) => held.size === 0).map(([target]) => target);
|
|
194
224
|
return {
|
|
195
225
|
composition: index.composition,
|
|
196
|
-
targets:
|
|
197
|
-
referrers:
|
|
198
|
-
.filter(([, held]) => held.size > 0)
|
|
199
|
-
.map(([target, held]) => [target, [...held]]), emptied),
|
|
226
|
+
targets: yield* patching(index.targets, targeting, targetless),
|
|
227
|
+
referrers: yield* patching(index.referrers, referred, unreferred),
|
|
200
228
|
};
|
|
201
229
|
}
|
|
230
|
+
function storedIn(entries) {
|
|
231
|
+
let stored = shared({});
|
|
232
|
+
let unit = [];
|
|
233
|
+
return after(inUnits(entries, (entry) => {
|
|
234
|
+
unit.push(entry);
|
|
235
|
+
return ROW_WEIGHT;
|
|
236
|
+
}, () => {
|
|
237
|
+
stored = patched(stored, unit);
|
|
238
|
+
unit = [];
|
|
239
|
+
}), () => stored);
|
|
240
|
+
}
|
|
241
|
+
function storedReferrers(referrers) {
|
|
242
|
+
const sets = new Map();
|
|
243
|
+
let unit = new Map();
|
|
244
|
+
const pairs = function* () {
|
|
245
|
+
for (const [target, files] of referrers)
|
|
246
|
+
for (const file of files)
|
|
247
|
+
yield [target, file];
|
|
248
|
+
};
|
|
249
|
+
return after(inUnits(pairs(), ([target, file]) => {
|
|
250
|
+
const files = unit.get(target);
|
|
251
|
+
if (files === undefined)
|
|
252
|
+
unit.set(target, [file]);
|
|
253
|
+
else
|
|
254
|
+
files.push(file);
|
|
255
|
+
return ROW_WEIGHT;
|
|
256
|
+
}, () => {
|
|
257
|
+
for (const [target, files] of unit) {
|
|
258
|
+
sets.set(target, patched(sets.get(target) ?? NO_REFERRERS, files.map((file) => [file, true])));
|
|
259
|
+
}
|
|
260
|
+
unit = new Map();
|
|
261
|
+
}), () => storedIn(sets));
|
|
262
|
+
}
|
|
202
263
|
function heldIndex(held, composition) {
|
|
203
264
|
const index = referrersOf.get(held.text);
|
|
204
265
|
return index !== undefined && typing(index.composition, composition) ? index : null;
|
|
@@ -217,20 +278,21 @@ export function indexReferrers(held, composition) {
|
|
|
217
278
|
const found = referencedBy(path, content, composition);
|
|
218
279
|
if (found.length > 0)
|
|
219
280
|
targets.set(path, found);
|
|
220
|
-
for (const target of found)
|
|
221
|
-
|
|
281
|
+
for (const target of found) {
|
|
282
|
+
const files = referrers.get(target);
|
|
283
|
+
if (files === undefined)
|
|
284
|
+
referrers.set(target, [path]);
|
|
285
|
+
else
|
|
286
|
+
files.push(path);
|
|
287
|
+
}
|
|
222
288
|
return ROW_WEIGHT + content.length;
|
|
223
289
|
});
|
|
224
|
-
const indexed = () => {
|
|
225
|
-
referrersOf.set(held.text, {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
};
|
|
231
|
-
if (!(filled instanceof Promise))
|
|
232
|
-
return indexed();
|
|
233
|
-
const building = filled.then(indexed).finally(() => indexing.delete(held.text));
|
|
290
|
+
const indexed = after(filled, () => after(storedIn(targets), (storedTargets) => after(storedReferrers(referrers), (stored) => {
|
|
291
|
+
referrersOf.set(held.text, { composition, targets: storedTargets, referrers: stored });
|
|
292
|
+
})));
|
|
293
|
+
if (!(indexed instanceof Promise))
|
|
294
|
+
return;
|
|
295
|
+
const building = indexed.finally(() => indexing.delete(held.text));
|
|
234
296
|
indexing.set(held.text, building);
|
|
235
297
|
return building;
|
|
236
298
|
}
|
|
@@ -243,9 +305,7 @@ export function referring(held, composition, targets) {
|
|
|
243
305
|
return null;
|
|
244
306
|
const found = new Set();
|
|
245
307
|
for (const target of targets) {
|
|
246
|
-
|
|
247
|
-
continue;
|
|
248
|
-
for (const file of index.referrers[target])
|
|
308
|
+
for (const file of Object.keys(referrersOfTarget(index, target)))
|
|
249
309
|
found.add(file);
|
|
250
310
|
}
|
|
251
311
|
return found;
|
|
@@ -254,12 +314,12 @@ export function available(composition) {
|
|
|
254
314
|
return (composition.model.status !== 'unavailable' &&
|
|
255
315
|
(composition.selection === null || composition.selection.model.status !== 'unavailable'));
|
|
256
316
|
}
|
|
257
|
-
export function changedCleanly(next, previous, composition) {
|
|
317
|
+
export function* changedCleanly(next, previous, composition) {
|
|
258
318
|
if (!typing(previous.composition, composition))
|
|
259
319
|
return false;
|
|
260
320
|
const paths = new Set([
|
|
261
|
-
...
|
|
262
|
-
...
|
|
321
|
+
...(yield* differences(previous.text, next.text)),
|
|
322
|
+
...(yield* differences(previous.binaries, next.binaries, () => true)),
|
|
263
323
|
]);
|
|
264
324
|
const binary = (path) => Object.hasOwn(next.binaries, path);
|
|
265
325
|
const within = (file) => (path) => selected(composition, path) === selected(composition, file);
|
|
@@ -271,7 +331,7 @@ export function changedCleanly(next, previous, composition) {
|
|
|
271
331
|
};
|
|
272
332
|
const changedTargets = new Map();
|
|
273
333
|
const shifted = [];
|
|
274
|
-
|
|
334
|
+
const admitted = (path) => {
|
|
275
335
|
const now = next.text[path];
|
|
276
336
|
const was = previous.text[path];
|
|
277
337
|
const modeled = modelOf(composition, path) !== null;
|
|
@@ -285,36 +345,41 @@ export function changedCleanly(next, previous, composition) {
|
|
|
285
345
|
if (now === undefined) {
|
|
286
346
|
if (modeled)
|
|
287
347
|
changedTargets.set(path, []);
|
|
288
|
-
|
|
348
|
+
return true;
|
|
289
349
|
}
|
|
290
350
|
if (binary(path))
|
|
291
351
|
return false;
|
|
292
352
|
if (!modeled) {
|
|
293
353
|
if (declared(now) === undefined)
|
|
294
354
|
return false;
|
|
295
|
-
|
|
296
|
-
return false;
|
|
297
|
-
continue;
|
|
355
|
+
return typedIn(now) || checked(path, now, composition).ok;
|
|
298
356
|
}
|
|
299
357
|
const check = checked(path, now, composition);
|
|
300
358
|
if (!reaching(path, check))
|
|
301
359
|
return false;
|
|
302
360
|
changedTargets.set(path, targetsOf(check));
|
|
361
|
+
return true;
|
|
362
|
+
};
|
|
363
|
+
for (const path of paths) {
|
|
364
|
+
if (!admitted(path))
|
|
365
|
+
return false;
|
|
366
|
+
yield ROW_WEIGHT + (next.text[path]?.length ?? 0);
|
|
303
367
|
}
|
|
304
368
|
const index = heldIndex(previous, composition);
|
|
305
369
|
if (index === null && shifted.length > 0)
|
|
306
370
|
return false;
|
|
307
371
|
for (const target of shifted) {
|
|
308
|
-
const files = index
|
|
372
|
+
const files = index === null ? [] : Object.keys(referrersOfTarget(index, target));
|
|
309
373
|
for (const file of files) {
|
|
310
374
|
if (paths.has(file))
|
|
311
375
|
continue;
|
|
312
376
|
if (!reaching(file, checked(file, next.text[file], composition)))
|
|
313
377
|
return false;
|
|
378
|
+
yield ROW_WEIGHT + next.text[file].length;
|
|
314
379
|
}
|
|
315
380
|
}
|
|
316
381
|
if (index !== null) {
|
|
317
|
-
referrersOf.set(next.text, changedTargets.size === 0 ? index : reindexed(index, changedTargets));
|
|
382
|
+
referrersOf.set(next.text, changedTargets.size === 0 ? index : yield* reindexed(index, changedTargets));
|
|
318
383
|
}
|
|
319
384
|
return true;
|
|
320
385
|
}
|
package/dist/connection.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { type TypesResult } from './model.js';
|
|
2
2
|
import { type Observation } from './observation.js';
|
|
3
3
|
import { type DocumentQuery, type DocumentResult, type GroupQuery, type GroupResult, type PendingResult } from './query.js';
|
|
4
|
+
import { type EntrySeed } from './seed.js';
|
|
4
5
|
import { type SearchRequest, type SearchResult } from './search.js';
|
|
5
6
|
import { type Adapter, type Authorization, type Member, type ProviderRefusal, type ServiceMode } from './adapter.js';
|
|
6
7
|
import { type ChatDraftSurface, type ConversationAgent, type ConversationEntry, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
|
|
7
8
|
import { type WrittenBy } from './change.js';
|
|
8
9
|
import type { Open } from './open.js';
|
|
9
10
|
import { type BinaryReference } from './binary.js';
|
|
10
|
-
import { type BinaryAnswer, type CallResult, type HistoryAnswer, type QueueEntry } from './outcome.js';
|
|
11
|
+
import { type BinaryAnswer, type BinaryLinkAnswer, type CallResult, type HistoryAnswer, type QueueEntry } from './outcome.js';
|
|
11
12
|
import { type Recovery } from './recovery.js';
|
|
12
13
|
import { type SaveRefusal } from './save.js';
|
|
13
|
-
import { type RoomDraft, type RoomDraftWrite } from './room-draft.js';
|
|
14
|
+
import { type RoomDraft, type RoomDraftParts, type RoomDraftWrite } from './room-draft.js';
|
|
14
15
|
import { type SyncStatus } from './status.js';
|
|
15
16
|
import { type RuntimeShell } from './durability.js';
|
|
16
|
-
import { type
|
|
17
|
-
import { type CapacityCause, type CodeAvailability, type Persistence, type Readiness } from './readiness.js';
|
|
17
|
+
import { type CapacityCause, type CodeAvailability, type Persistence, type Readiness, type SearchObligation } from './readiness.js';
|
|
18
18
|
import { type NarrowedView, type PortReach, type RuntimeView } from './reach.js';
|
|
19
19
|
export type AppTypedSelection = {
|
|
20
20
|
roots: readonly string[];
|
|
@@ -63,6 +63,10 @@ export type SavedRoomDraft = {
|
|
|
63
63
|
readonly path: string;
|
|
64
64
|
readonly revision: string;
|
|
65
65
|
};
|
|
66
|
+
export type SavedParts = {
|
|
67
|
+
readonly path: string;
|
|
68
|
+
readonly parts: RoomDraftParts;
|
|
69
|
+
};
|
|
66
70
|
export type RoomDraftSurface = {
|
|
67
71
|
list(): Promise<readonly RoomDraft[]>;
|
|
68
72
|
read(room: string, path: string): RoomDraft | null;
|
|
@@ -72,9 +76,11 @@ export type RoomDraftSurface = {
|
|
|
72
76
|
export type PresentationSurface = {
|
|
73
77
|
read(app: string): Promise<unknown>;
|
|
74
78
|
write(app: string, value: unknown): Promise<void>;
|
|
79
|
+
edit(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
75
80
|
};
|
|
76
81
|
export type BinaryFileSurface = {
|
|
77
82
|
read(room: string, path: string, revision?: string): Promise<BinaryAnswer>;
|
|
83
|
+
link(room: string, path: string, revision?: string): Promise<BinaryLinkAnswer>;
|
|
78
84
|
readReference(reference: BinaryReference): Promise<BinaryAnswer>;
|
|
79
85
|
};
|
|
80
86
|
export type HistoryQuery = {
|
|
@@ -95,6 +101,7 @@ export type MdRuntime = {
|
|
|
95
101
|
chatDraft: ChatDraftSurface;
|
|
96
102
|
presentation: PresentationSurface;
|
|
97
103
|
save(room: string, roomDrafts: readonly SavedRoomDraft[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
104
|
+
saveParts(room: string, parts: readonly SavedParts[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
98
105
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
99
106
|
binaryFile: BinaryFileSurface;
|
|
100
107
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
@@ -126,11 +133,12 @@ export type ReadinessPort = {
|
|
|
126
133
|
readonly target: string;
|
|
127
134
|
readonly code: CodeAvailability;
|
|
128
135
|
readonly capacity: CapacityCause | null;
|
|
136
|
+
readonly search: SearchObligation;
|
|
129
137
|
};
|
|
130
138
|
export type ComposedRuntime = RuntimeView & {
|
|
139
|
+
seed(entry: EntrySeed): void;
|
|
131
140
|
stop(): Promise<void>;
|
|
132
141
|
lose(locators: readonly string[]): Promise<void>;
|
|
133
|
-
acquire(demand: RuntimeDemand): void;
|
|
134
142
|
persisted(answer: Persistence): void;
|
|
135
143
|
within(reach: PortReach | null, port: ReadinessPort): NarrowedView;
|
|
136
144
|
};
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAoB,KAAK,WAAW,EAAqB,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAEhB,KAAK,aAAa,EAKnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAgB,KAAK,SAAS,EAAe,MAAM,WAAW,CAAC;AAEtE,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,KAAK,OAAO,EAEZ,KAAK,aAAa,EAQlB,KAAK,MAAM,EASX,KAAK,eAAe,EAGpB,KAAK,WAAW,EAGjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAS3E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,aAAa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