@agentshouse/mdruntime 0.1.0-c2c52158b7381 → 0.1.0-c2e8a6f99866d
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 +14 -10
- package/dist/adapter.d.ts +14 -5
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +13 -6
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +86 -88
- 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 +5 -9
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +10 -86
- package/dist/chat/list.d.ts.map +1 -1
- package/dist/chat/list.js +1 -1
- package/dist/chat/message.d.ts.map +1 -1
- package/dist/chat/message.js +8 -1
- package/dist/chat/messages.d.ts +1 -0
- package/dist/chat/messages.d.ts.map +1 -1
- package/dist/chat/messages.js +9 -1
- package/dist/chat/provider.d.ts +2 -0
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +17 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/collection.d.ts +5 -19
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +22 -360
- package/dist/compile.d.ts +11 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +712 -0
- package/dist/connection.d.ts +2 -2
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +1396 -624
- package/dist/conversation.d.ts +1 -1
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +26 -17
- package/dist/entry.d.ts +2 -1
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +17 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/live.d.ts +22 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +123 -0
- package/dist/memory.d.ts +1 -0
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +12 -0
- package/dist/observation.d.ts +12 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +84 -0
- package/dist/overlay.d.ts +0 -3
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +1 -151
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +15 -35
- package/dist/reads.js +1 -1
- package/dist/refresh.d.ts +10 -13
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +74 -70
- package/dist/replica.d.ts +55 -38
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +273 -214
- package/dist/rows.d.ts +29 -31
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +113 -69
- package/dist/save.d.ts +9 -10
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +59 -57
- package/dist/search.d.ts +2 -2
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +60 -28
- package/dist/shared.d.ts +0 -3
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +1 -31
- package/dist/store.d.ts +79 -62
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +164 -330
- package/dist/stored.d.ts +143 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +561 -0
- package/dist/tables.d.ts +246 -168
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +156 -25
- package/dist/turn.d.ts +1 -1
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +28 -20
- 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 +2 -1
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +30 -25
- package/package.json +2 -3
- package/dist/read-side.d.ts +0 -27
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -1179
package/dist/rows.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ARRAY_INDEX, escapePointer, references, target, } from '@agentshouse/mdmodel';
|
|
1
|
+
import { ARRAY_INDEX, bodyAfterFrontmatter, bodyLinks, escapePointer, parseFrontmatter, references, sectionReferences, target, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { governing } from './collection.js';
|
|
3
3
|
import { definitionOf } from './model.js';
|
|
4
4
|
function keyOf(...parts) {
|
|
@@ -10,6 +10,18 @@ export function documentKey(room, path) {
|
|
|
10
10
|
export function roomOfKey(key) {
|
|
11
11
|
return key.split('\u0000')[1];
|
|
12
12
|
}
|
|
13
|
+
export function pathOfKey(key) {
|
|
14
|
+
return key.split('\u0000')[2];
|
|
15
|
+
}
|
|
16
|
+
export function markdownPath(path) {
|
|
17
|
+
return path.endsWith('.md');
|
|
18
|
+
}
|
|
19
|
+
export function settingsTextPath(path) {
|
|
20
|
+
return /^settings\/.+\.ya?ml$/u.test(path);
|
|
21
|
+
}
|
|
22
|
+
export function folderOf(path) {
|
|
23
|
+
return path.slice(0, Math.max(path.lastIndexOf('/'), 0));
|
|
24
|
+
}
|
|
13
25
|
function plainObject(value) {
|
|
14
26
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
15
27
|
}
|
|
@@ -18,6 +30,54 @@ function compared(reading, exact, value) {
|
|
|
18
30
|
return value;
|
|
19
31
|
return (typeof value === 'string' ? target(reading.path, value) : null) ?? undefined;
|
|
20
32
|
}
|
|
33
|
+
export function kindOf(value) {
|
|
34
|
+
if (value === undefined)
|
|
35
|
+
return 'undefined';
|
|
36
|
+
if (value === null)
|
|
37
|
+
return 'null';
|
|
38
|
+
if (Array.isArray(value))
|
|
39
|
+
return 'array';
|
|
40
|
+
if (typeof value === 'object')
|
|
41
|
+
return 'object';
|
|
42
|
+
return typeof value;
|
|
43
|
+
}
|
|
44
|
+
function scalarOf(value) {
|
|
45
|
+
if (typeof value === 'string' || typeof value === 'number')
|
|
46
|
+
return value;
|
|
47
|
+
if (typeof value === 'boolean')
|
|
48
|
+
return value ? 1 : 0;
|
|
49
|
+
if (Array.isArray(value))
|
|
50
|
+
return JSON.stringify(value);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function held(reading, form, value, single) {
|
|
54
|
+
const at = reading.reached.get(form) ?? 0;
|
|
55
|
+
reading.reached.set(form, at + 1);
|
|
56
|
+
const kind = kindOf(value);
|
|
57
|
+
reading.values.push({
|
|
58
|
+
form,
|
|
59
|
+
held: at,
|
|
60
|
+
item: -1,
|
|
61
|
+
kind,
|
|
62
|
+
value: scalarOf(value),
|
|
63
|
+
size: Array.isArray(value) ? value.length : null,
|
|
64
|
+
single,
|
|
65
|
+
});
|
|
66
|
+
if (!Array.isArray(value))
|
|
67
|
+
return;
|
|
68
|
+
value.forEach((item, index) => {
|
|
69
|
+
const itemKind = kindOf(item);
|
|
70
|
+
reading.values.push({
|
|
71
|
+
form,
|
|
72
|
+
held: at,
|
|
73
|
+
item: index,
|
|
74
|
+
kind: itemKind,
|
|
75
|
+
value: itemKind === 'array' ? null : scalarOf(item),
|
|
76
|
+
size: null,
|
|
77
|
+
single: false,
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
21
81
|
function record(reading, node, forms, exact) {
|
|
22
82
|
const value = Array.isArray(node)
|
|
23
83
|
? node.map((item, index) => compared(reading, `${exact}/${index}`, item))
|
|
@@ -25,10 +85,7 @@ function record(reading, node, forms, exact) {
|
|
|
25
85
|
for (const form of forms) {
|
|
26
86
|
if (form.pending)
|
|
27
87
|
continue;
|
|
28
|
-
(reading
|
|
29
|
-
if (!form.through && value !== undefined && !plainObject(value)) {
|
|
30
|
-
reading.values[form.text] = value;
|
|
31
|
-
}
|
|
88
|
+
held(reading, form.text, value, !form.through && value !== undefined && !plainObject(value));
|
|
32
89
|
}
|
|
33
90
|
if (Array.isArray(node) || plainObject(node) || !reading.references.has(exact))
|
|
34
91
|
return;
|
|
@@ -64,79 +121,66 @@ function walk(reading, node, forms, exact) {
|
|
|
64
121
|
: [{ text: `${form.text}/${segment}`, through: form.through, pending: false }]), `${exact}/${segment}`);
|
|
65
122
|
}
|
|
66
123
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return path.endsWith('.md');
|
|
76
|
-
}
|
|
77
|
-
export function rowsOf(room, path, document, composition, change, fileId, binary) {
|
|
78
|
-
const key = documentKey(room, path);
|
|
79
|
-
if (document === null || !markdownPath(path)) {
|
|
80
|
-
return [
|
|
81
|
-
{
|
|
82
|
-
key,
|
|
83
|
-
kind: 'document',
|
|
84
|
-
room,
|
|
85
|
-
path,
|
|
86
|
-
type: null,
|
|
87
|
-
fields: {},
|
|
88
|
-
values: {},
|
|
89
|
-
reached: {},
|
|
90
|
-
directories: directoriesOf(path),
|
|
91
|
-
folder: folderOf(path),
|
|
92
|
-
text: null,
|
|
93
|
-
change,
|
|
94
|
-
fileId,
|
|
95
|
-
binary,
|
|
96
|
-
},
|
|
97
|
-
];
|
|
124
|
+
function bodyTargets(path, content) {
|
|
125
|
+
const seen = new Set();
|
|
126
|
+
const found = [];
|
|
127
|
+
for (const { target: reached } of bodyLinks(bodyAfterFrontmatter(content), path)) {
|
|
128
|
+
if (seen.has(reached))
|
|
129
|
+
continue;
|
|
130
|
+
seen.add(reached);
|
|
131
|
+
found.push({ kind: 'body', form: '', target: reached, field: '' });
|
|
98
132
|
}
|
|
99
|
-
|
|
133
|
+
return found;
|
|
134
|
+
}
|
|
135
|
+
function typedRows(path, content, document, composition) {
|
|
100
136
|
const definition = definitionOf(governing(composition, path), document.type);
|
|
101
137
|
const reading = {
|
|
102
138
|
path,
|
|
103
139
|
references: new Set(definition === undefined ? [] : references(document, definition).map((one) => one.pointer)),
|
|
104
|
-
values:
|
|
105
|
-
reached:
|
|
140
|
+
values: [],
|
|
141
|
+
reached: new Map(),
|
|
106
142
|
targets: new Map(),
|
|
107
143
|
};
|
|
108
144
|
for (const [name, value] of Object.entries(document.fields)) {
|
|
109
145
|
const segment = escapePointer(name);
|
|
110
146
|
walk(reading, value, [{ text: `/${segment}`, through: false, pending: false }], `/${segment}`);
|
|
111
147
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
148
|
+
const links = [];
|
|
149
|
+
for (const { field, target: reached, forms } of reading.targets.values()) {
|
|
150
|
+
for (const form of [...forms].sort()) {
|
|
151
|
+
links.push({ kind: 'field', form, target: reached, field });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (definition !== undefined) {
|
|
155
|
+
const sectioned = new Set();
|
|
156
|
+
for (const { target: reached } of sectionReferences(path, content, definition)) {
|
|
157
|
+
if (reached === null || sectioned.has(reached))
|
|
158
|
+
continue;
|
|
159
|
+
sectioned.add(reached);
|
|
160
|
+
links.push({ kind: 'section', form: '', target: reached, field: '' });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return { values: reading.values, links: [...links, ...bodyTargets(path, content)] };
|
|
164
|
+
}
|
|
165
|
+
export function derived(path, content, composition) {
|
|
166
|
+
const folder = folderOf(path);
|
|
167
|
+
const unread = { values: [], links: [], fields: null, folder, type: null };
|
|
168
|
+
if (content === null)
|
|
169
|
+
return { ...unread, declared: null, queried: true };
|
|
170
|
+
const read = parseFrontmatter(content, path);
|
|
171
|
+
const declared = read.ok ? (read.frontmatter.type ?? 'any') : null;
|
|
172
|
+
if (!markdownPath(path)) {
|
|
173
|
+
return { ...unread, declared, queried: true, links: bodyTargets(path, content) };
|
|
174
|
+
}
|
|
175
|
+
if (!read.ok)
|
|
176
|
+
return { ...unread, declared, queried: false };
|
|
177
|
+
const document = read.frontmatter;
|
|
178
|
+
return {
|
|
179
|
+
type: document.type ?? 'any',
|
|
180
|
+
declared,
|
|
181
|
+
queried: true,
|
|
182
|
+
folder,
|
|
183
|
+
fields: JSON.stringify(document.fields),
|
|
184
|
+
...typedRows(path, content, document, composition),
|
|
185
|
+
};
|
|
142
186
|
}
|
package/dist/save.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { type Validation } from '@agentshouse/mdmodel';
|
|
1
2
|
import type { OperationScopes, ProviderLimit } from './adapter.js';
|
|
2
3
|
import { type Change, type ChangeBatch, type Precondition, type WrittenBy } from './change.js';
|
|
3
4
|
import { type Composition } from './collection.js';
|
|
5
|
+
import { type Layer } from './overlay.js';
|
|
4
6
|
import type { VisibleLayer } from './replica.js';
|
|
5
7
|
import type { ChangedPart } from './room-draft.js';
|
|
6
|
-
import { type Later } from './turn.js';
|
|
7
8
|
export type SaveRefusal = {
|
|
8
9
|
code: string;
|
|
9
10
|
retryable: boolean;
|
|
@@ -25,12 +26,10 @@ export type SaveInput = {
|
|
|
25
26
|
bases: readonly Precondition[];
|
|
26
27
|
queued?: ReadonlySet<string>;
|
|
27
28
|
writtenBy?: WrittenBy;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
binaries: Readonly<Record<string, unknown>>;
|
|
31
|
-
composition: Composition;
|
|
32
|
-
};
|
|
29
|
+
unmodeled: boolean;
|
|
30
|
+
validate: Validator;
|
|
33
31
|
};
|
|
32
|
+
export type Validator = (resulting: Layer, touched: readonly string[]) => Promise<Validation>;
|
|
34
33
|
type Refusing = {
|
|
35
34
|
kind: 'refused';
|
|
36
35
|
refusal: SaveRefusal;
|
|
@@ -67,7 +66,6 @@ type VisibleOver = (queue: readonly ChangeBatch[]) => Generator<number, VisibleL
|
|
|
67
66
|
export declare function requeuing(queue: readonly ChangeBatch[], changes: readonly Change[], visible: VisibleLayer, changeable: (batch: ChangeBatch) => boolean, state: VisibleOver): Generator<number, Requeued, void>;
|
|
68
67
|
export declare function joined(queue: readonly ChangeBatch[], owner: ChangeBatch, extra: ChangeBatch): Joining;
|
|
69
68
|
export declare function limiting(queue: readonly ChangeBatch[], batch: ChangeBatch, limits: readonly ProviderLimit[], state: VisibleOver): Generator<number, SaveRefusal | null, void>;
|
|
70
|
-
type Clean = NonNullable<SaveInput['clean']>;
|
|
71
69
|
export declare const MOVE_DOCUMENTS = "move-documents";
|
|
72
70
|
export type MoveSide = {
|
|
73
71
|
room: string;
|
|
@@ -78,7 +76,8 @@ export type MoveSide = {
|
|
|
78
76
|
providerOwnedPaths: readonly string[];
|
|
79
77
|
visible: VisibleLayer;
|
|
80
78
|
queued: ReadonlySet<string>;
|
|
81
|
-
|
|
79
|
+
unmodeled: boolean;
|
|
80
|
+
validate: Validator;
|
|
82
81
|
};
|
|
83
82
|
export type MoveInput = {
|
|
84
83
|
source: MoveSide;
|
|
@@ -96,7 +95,7 @@ export type MoveResult = {
|
|
|
96
95
|
leaving: ChangeBatch;
|
|
97
96
|
arriving: ChangeBatch;
|
|
98
97
|
} | Refusing;
|
|
99
|
-
export declare function buildMove(input: MoveInput):
|
|
100
|
-
export declare function buildBatch(input: SaveInput):
|
|
98
|
+
export declare function buildMove(input: MoveInput): Promise<MoveResult>;
|
|
99
|
+
export declare function buildBatch(input: SaveInput): Promise<BatchResult>;
|
|
101
100
|
export {};
|
|
102
101
|
//# sourceMappingURL=save.d.ts.map
|
package/dist/save.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save.d.ts","sourceRoot":"","sources":["../src/save.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"save.d.ts","sourceRoot":"","sources":["../src/save.ts"],"names":[],"mappings":"AACA,OAAO,EAkBL,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,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AAC;IAC5B,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,QAAQ,CAAC;IACjB,WAAW,EAAE,QAAQ,CAAC;IACtB,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjE,cAAc,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAA;CAAE,GAAG,QAAQ,CAAC;AAmInG,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAE/D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAEjE"}
|
package/dist/save.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { definitionOf } from './model.js';
|
|
2
2
|
import { apply, ARRAY_INDEX, ATTACHMENT, links, parse, pointerSegments, references, relative, relativize, retarget, roomReferences, serialize, target, } from '@agentshouse/mdmodel';
|
|
3
3
|
import { immutable, leaving, queuedFile, departure, } from './change.js';
|
|
4
|
-
import {
|
|
4
|
+
import { collectionOf, documentsOf, governing, } from './collection.js';
|
|
5
5
|
import { changeBatchIdentity } from './identity.js';
|
|
6
6
|
import { overlaying } from './overlay.js';
|
|
7
7
|
import { covered, normalize } from './paths.js';
|
|
8
|
-
import {
|
|
9
|
-
import { ROW_WEIGHT, stepped } from './turn.js';
|
|
8
|
+
import { sorting } from './shared.js';
|
|
9
|
+
import { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
10
|
+
import { validatedCollection } from './validation.js';
|
|
10
11
|
function refuse(code, file, location) {
|
|
11
12
|
return {
|
|
12
13
|
kind: 'refused',
|
|
@@ -267,10 +268,6 @@ export function* effectiveIn(batch, locator, visible) {
|
|
|
267
268
|
? yield* leavingRewritten(batch, visible)
|
|
268
269
|
: yield* providerRewritten(batch, visible);
|
|
269
270
|
}
|
|
270
|
-
function* chained(...sets) {
|
|
271
|
-
for (const set of sets)
|
|
272
|
-
yield* set;
|
|
273
|
-
}
|
|
274
271
|
function* incoming(collection, removed, candidates) {
|
|
275
272
|
const found = new Map();
|
|
276
273
|
const note = (target, file) => {
|
|
@@ -584,18 +581,6 @@ function relativeChanges(input) {
|
|
|
584
581
|
return { ...change, fields, sections };
|
|
585
582
|
});
|
|
586
583
|
}
|
|
587
|
-
function* unmodeledType(collection, composition) {
|
|
588
|
-
if (available(composition))
|
|
589
|
-
return false;
|
|
590
|
-
for (const [path, document] of yield* documentsOf(collection)) {
|
|
591
|
-
if (document.type !== undefined &&
|
|
592
|
-
document.type !== 'any' &&
|
|
593
|
-
governing(composition, path).status === 'unavailable')
|
|
594
|
-
return true;
|
|
595
|
-
yield ROW_WEIGHT + collection.text[path].length;
|
|
596
|
-
}
|
|
597
|
-
return false;
|
|
598
|
-
}
|
|
599
584
|
function unqueueable(file) {
|
|
600
585
|
return { kind: 'refused', refusal: { code: 'unknown-revision', retryable: false, file } };
|
|
601
586
|
}
|
|
@@ -898,34 +883,54 @@ function typedText(content) {
|
|
|
898
883
|
const parsed = parse(content);
|
|
899
884
|
return parsed.ok && parsed.document.type !== undefined && parsed.document.type !== 'any';
|
|
900
885
|
}
|
|
901
|
-
function
|
|
886
|
+
function touchedLibrary(resulting, touched, composition) {
|
|
887
|
+
const entries = touched
|
|
888
|
+
.flatMap((path) => {
|
|
889
|
+
const content = resulting.documents[path];
|
|
890
|
+
const binary = resulting.binaries[path] !== undefined;
|
|
891
|
+
return content === undefined && !binary ? [] : [{ path, content: content ?? null }];
|
|
892
|
+
})
|
|
893
|
+
.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0));
|
|
894
|
+
const contents = new Map(entries.map(({ path, content }) => [path, content]));
|
|
895
|
+
const binaries = new Set(Object.keys(resulting.binaries).filter((path) => resulting.binaries[path] !== undefined));
|
|
896
|
+
return validatedCollection(() => Promise.resolve({ entries, next: null }), async (paths) => {
|
|
897
|
+
const known = new Map();
|
|
898
|
+
const pace = paced();
|
|
899
|
+
for (const path of paths) {
|
|
900
|
+
const content = contents.get(path);
|
|
901
|
+
if (binaries.has(path))
|
|
902
|
+
known.set(path, { type: undefined, binary: true });
|
|
903
|
+
else if (content !== undefined && content !== null) {
|
|
904
|
+
const read = parse(content, path);
|
|
905
|
+
if (read.ok)
|
|
906
|
+
known.set(path, { type: read.document.type ?? 'any', binary: false });
|
|
907
|
+
await pace(content.length + ROW_WEIGHT);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
return known;
|
|
911
|
+
}, composition);
|
|
912
|
+
}
|
|
913
|
+
async function judging(visible, resulting, composition, validate, removed, touched) {
|
|
902
914
|
if (removed.size > 0) {
|
|
903
|
-
const
|
|
904
|
-
const referenced = yield* incoming(collectionOf(resulting.documents, composition), removed, clean === null || referrers === null
|
|
905
|
-
? null
|
|
906
|
-
: chained(referrers, yield* differences(clean.text, resulting.documents)));
|
|
915
|
+
const referenced = await stepped(incoming(collectionOf(resulting.documents, composition), removed, null));
|
|
907
916
|
if (referenced !== null)
|
|
908
917
|
return referenced;
|
|
909
918
|
}
|
|
910
919
|
const typedPaths = [];
|
|
920
|
+
const pace = paced();
|
|
911
921
|
for (const path of touched) {
|
|
912
922
|
const before = visible.documents[path];
|
|
913
923
|
const after = resulting.documents[path];
|
|
914
924
|
if (typedText(before) || typedText(after))
|
|
915
925
|
typedPaths.push(path);
|
|
916
|
-
|
|
926
|
+
await pace((before?.length ?? 0) + (after?.length ?? 0) + ROW_WEIGHT);
|
|
917
927
|
}
|
|
918
928
|
const withoutModel = typedPaths.find((path) => governing(composition, path).status === 'unavailable');
|
|
919
929
|
if (withoutModel !== undefined)
|
|
920
930
|
return refuse('model-unavailable', withoutModel);
|
|
921
|
-
const verdict =
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
: yield* validateCollection(typedPaths.length > 0
|
|
925
|
-
? resulting.documents
|
|
926
|
-
: Object.fromEntries(touched.flatMap((path) => resulting.documents[path] === undefined
|
|
927
|
-
? []
|
|
928
|
-
: [[path, resulting.documents[path]]])), Object.keys(resulting.binaries), composition);
|
|
931
|
+
const verdict = typedPaths.length > 0
|
|
932
|
+
? await validate(resulting, touched)
|
|
933
|
+
: await touchedLibrary(resulting, touched, composition);
|
|
929
934
|
if (verdict.verdict === 'refuse') {
|
|
930
935
|
return {
|
|
931
936
|
kind: 'refused',
|
|
@@ -998,32 +1003,30 @@ function validationOf(validated) {
|
|
|
998
1003
|
},
|
|
999
1004
|
};
|
|
1000
1005
|
}
|
|
1001
|
-
function
|
|
1006
|
+
async function batching(input) {
|
|
1002
1007
|
const changes = relativeChanges(input);
|
|
1003
1008
|
const structural = changes.find((change) => change.kind === 'move' || change.kind === 'remove');
|
|
1004
|
-
if (structural !== undefined &&
|
|
1005
|
-
(yield* unmodeledType(input.visible.collection, input.composition)))
|
|
1009
|
+
if (structural !== undefined && input.unmodeled) {
|
|
1006
1010
|
return refuse('model-unavailable', structural.path);
|
|
1011
|
+
}
|
|
1007
1012
|
if (changes.length === 0)
|
|
1008
1013
|
return refuse('no-change');
|
|
1009
|
-
const rewritten =
|
|
1014
|
+
const rewritten = await stepped(rewrites(changes, input.visible));
|
|
1010
1015
|
if (rewritten.kind === 'refused')
|
|
1011
1016
|
return rewritten;
|
|
1012
1017
|
const refusal = guard(changes, input, 'delete');
|
|
1013
1018
|
if (refusal !== null)
|
|
1014
1019
|
return refusal;
|
|
1015
|
-
const preconditions =
|
|
1016
|
-
const predicted =
|
|
1017
|
-
const resulting =
|
|
1018
|
-
|
|
1019
|
-
]);
|
|
1020
|
-
const judged = yield* judging(input.visible, resulting, input.composition, input.clean !== undefined && available(input.composition) ? input.clean : null, new Set(changes.filter((change) => change.kind === 'remove').map((change) => change.path)), [...new Set(predicted.changes.flatMap(affected))]);
|
|
1020
|
+
const preconditions = await stepped(preconditionsOf(changes, input.visible, input.bases));
|
|
1021
|
+
const predicted = await stepped(anticipated(changes, preconditions, rewritten.changes, input.visible));
|
|
1022
|
+
const resulting = await stepped(overlaying(input.visible, [{ id: '', baseRoomVersion: input.baseRoomVersion, ...predicted }]));
|
|
1023
|
+
const judged = await judging(input.visible, resulting, input.composition, input.validate, new Set(changes.filter((change) => change.kind === 'remove').map((change) => change.path)), [...new Set(predicted.changes.flatMap(affected))]);
|
|
1021
1024
|
if (judged.kind === 'refused')
|
|
1022
1025
|
return judged;
|
|
1023
|
-
const crossing =
|
|
1026
|
+
const crossing = await stepped(admittedRooms(changes, input.visible, resulting, input.composition));
|
|
1024
1027
|
if (crossing !== null)
|
|
1025
1028
|
return crossing;
|
|
1026
|
-
const limited =
|
|
1029
|
+
const limited = await stepped(exceeding(input.providerLimits, changes, predicted.changes, resulting));
|
|
1027
1030
|
if (limited !== null)
|
|
1028
1031
|
return limited;
|
|
1029
1032
|
return {
|
|
@@ -1087,7 +1090,7 @@ function arrivalOf({ path, to }, source, moved) {
|
|
|
1087
1090
|
...(content === documents[path] ? heads : kept),
|
|
1088
1091
|
};
|
|
1089
1092
|
}
|
|
1090
|
-
function
|
|
1093
|
+
async function moving(input) {
|
|
1091
1094
|
const { source, destination, moves } = input;
|
|
1092
1095
|
if (moves.length === 0)
|
|
1093
1096
|
return refuse('no-change');
|
|
@@ -1107,9 +1110,8 @@ function* moving(input) {
|
|
|
1107
1110
|
if (typeof bound === 'number' && moves.length > bound) {
|
|
1108
1111
|
return refuse('provider-limit', undefined, MOVE_DOCUMENTS);
|
|
1109
1112
|
}
|
|
1110
|
-
if (
|
|
1113
|
+
if (source.unmodeled)
|
|
1111
1114
|
return refuse('model-unavailable', moves[0].path);
|
|
1112
|
-
}
|
|
1113
1115
|
const id = changeBatchIdentity();
|
|
1114
1116
|
const between = {
|
|
1115
1117
|
source: { room: source.room, baseRoomVersion: source.baseRoomVersion },
|
|
@@ -1129,9 +1131,9 @@ function* moving(input) {
|
|
|
1129
1131
|
...written,
|
|
1130
1132
|
between,
|
|
1131
1133
|
};
|
|
1132
|
-
const effective =
|
|
1133
|
-
const left =
|
|
1134
|
-
const sourceJudged =
|
|
1134
|
+
const effective = await stepped(leavingRewritten(leavingBatch, source.visible));
|
|
1135
|
+
const left = await stepped(overlaying(source.visible, [effective]));
|
|
1136
|
+
const sourceJudged = await judging(source.visible, left, source.composition, source.validate, new Set(moves.map(({ path }) => path)), [...new Set(effective.changes.map((change) => change.path))]);
|
|
1135
1137
|
if (sourceJudged.kind === 'refused')
|
|
1136
1138
|
return sourceJudged;
|
|
1137
1139
|
const arrivingBatch = {
|
|
@@ -1142,19 +1144,19 @@ function* moving(input) {
|
|
|
1142
1144
|
...written,
|
|
1143
1145
|
between,
|
|
1144
1146
|
};
|
|
1145
|
-
const arrived =
|
|
1146
|
-
const destinationJudged =
|
|
1147
|
+
const arrived = await stepped(overlaying(destination.visible, [arrivingBatch]));
|
|
1148
|
+
const destinationJudged = await judging(destination.visible, arrived, destination.composition, destination.validate, new Set(), moves.map(({ to }) => to));
|
|
1147
1149
|
if (destinationJudged.kind === 'refused')
|
|
1148
1150
|
return destinationJudged;
|
|
1149
|
-
const limited = (
|
|
1150
|
-
(
|
|
1151
|
+
const limited = (await stepped(exceeding(input.providerLimits, removals, effective.changes, left))) ??
|
|
1152
|
+
(await stepped(exceeding(input.providerLimits, arrivals, arrivals, arrived)));
|
|
1151
1153
|
if (limited !== null)
|
|
1152
1154
|
return limited;
|
|
1153
1155
|
return { kind: 'moved', leaving: immutable(leavingBatch), arriving: immutable(arrivingBatch) };
|
|
1154
1156
|
}
|
|
1155
1157
|
export function buildMove(input) {
|
|
1156
|
-
return
|
|
1158
|
+
return moving(input);
|
|
1157
1159
|
}
|
|
1158
1160
|
export function buildBatch(input) {
|
|
1159
|
-
return
|
|
1161
|
+
return batching(input);
|
|
1160
1162
|
}
|
package/dist/search.d.ts
CHANGED
|
@@ -71,8 +71,8 @@ export type SearchedMessage = {
|
|
|
71
71
|
text: string;
|
|
72
72
|
};
|
|
73
73
|
export type SearchSource = {
|
|
74
|
-
room(room: string):
|
|
75
|
-
|
|
74
|
+
room(room: string): AsyncIterable<readonly SearchedDocument[]>;
|
|
75
|
+
documents(room: string, paths: readonly string[]): Promise<readonly SearchedDocument[]>;
|
|
76
76
|
};
|
|
77
77
|
type HitCursor = readonly [number, string, string] | readonly [] | null;
|
|
78
78
|
export type SearchPlan = {
|
package/dist/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKtC,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;AAE7E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CA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