@agentshouse/mdruntime 0.1.0-cde2b99d2fcbc → 0.1.0-ce131cb435f8b
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 +2 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +36 -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 +2 -1
- package/dist/chat/markdown.d.ts.map +1 -1
- package/dist/chat/markdown.js +7 -6
- package/dist/chat/message.d.ts.map +1 -1
- package/dist/chat/message.js +2 -2
- package/dist/chat/messages.d.ts +1 -0
- package/dist/chat/messages.d.ts.map +1 -1
- package/dist/chat/messages.js +4 -0
- package/dist/chat/provider.d.ts +1 -1
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +62 -79
- 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/style.js +5 -5
- 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 +1620 -397
- 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 +3 -0
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +62 -55
- 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 +484 -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 +18 -11
- package/dist/replica.d.ts +10 -5
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +96 -44
- package/dist/room-draft.d.ts +13 -1
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +2 -2
- 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 +9 -3
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +68 -22
- 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 +14 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +394 -0
- package/dist/status.d.ts +4 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/store.d.ts +64 -16
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +447 -178
- 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/collection.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type Document, type Validation } from '@agentshouse/mdmodel';
|
|
2
|
-
import type
|
|
1
|
+
import { type Document, type Frontmatter, type Validation } from '@agentshouse/mdmodel';
|
|
2
|
+
import { type ModelState } from './model.js';
|
|
3
3
|
import type { MdModelIdentity } from './adapter.js';
|
|
4
|
+
import { type Paths } from './shared.js';
|
|
4
5
|
import type { Refused } from './transfer.js';
|
|
6
|
+
import { type Later } from './turn.js';
|
|
5
7
|
export declare const MD_MODEL: MdModelIdentity;
|
|
6
8
|
export type Collection = {
|
|
7
9
|
text: Readonly<Record<string, string>>;
|
|
@@ -17,9 +19,22 @@ export type Composition = {
|
|
|
17
19
|
};
|
|
18
20
|
export declare function governing(composition: Composition, path: string): ModelState;
|
|
19
21
|
export declare function collectionOf(text: Readonly<Record<string, string>>, composition: Composition, previous?: Collection): Collection;
|
|
20
|
-
export declare function
|
|
22
|
+
export declare function collecting(text: Readonly<Record<string, string>>, composition: Composition, previous?: Collection): Generator<number, Collection, void>;
|
|
23
|
+
export declare function passingFrontmatter(collection: Collection, path: string): Frontmatter | undefined;
|
|
21
24
|
export declare function documentsOf(collection: Collection): Generator<readonly [string, Document]>;
|
|
22
|
-
export declare function unreadable(text: Readonly<Record<string, string>>, previous?: Readonly<Record<string, string>>): Refused | null
|
|
25
|
+
export declare function unreadable(text: Readonly<Record<string, string>>, previous?: Readonly<Record<string, string>>): Generator<number, Refused | null, void>;
|
|
23
26
|
export declare function validRoot(root: unknown): root is string;
|
|
24
|
-
export declare function validateCollection(text: Readonly<Record<string, string>>, binaryTargets: readonly string[], composition: Composition): Validation
|
|
27
|
+
export declare function validateCollection(text: Readonly<Record<string, string>>, binaryTargets: readonly string[], composition: Composition): Generator<number, Validation, void>;
|
|
28
|
+
type Held = {
|
|
29
|
+
text: Paths<string>;
|
|
30
|
+
binaries: Paths<unknown>;
|
|
31
|
+
};
|
|
32
|
+
export declare function indexReferrers(held: Held, composition: Composition): Later<void>;
|
|
33
|
+
export declare function referencesIndexed(held: Held, composition: Composition): boolean;
|
|
34
|
+
export declare function referring(held: Held, composition: Composition, targets: Iterable<string>): ReadonlySet<string> | null;
|
|
35
|
+
export declare function available(composition: Composition): boolean;
|
|
36
|
+
export declare function changedCleanly(next: Held, previous: Held & {
|
|
37
|
+
composition: Composition;
|
|
38
|
+
}, composition: Composition): Generator<number, boolean, void>;
|
|
39
|
+
export {};
|
|
25
40
|
//# sourceMappingURL=collection.d.ts.map
|
package/dist/collection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,QAAQ,EAEb,KAAK,WAAW,EAChB,KAAK,UAAU,EAEhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAkD,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAwC,KAAK,KAAK,EAAE,MAAM,WAAW,CAAC;AAE7E,eAAO,MAAM,QAAQ,EAAE,eAAwE,CAAC;AAIhG,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE;QAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,GAAG,IAAI,CAAC;CACnE,CAAC;AASF,wBAAgB,SAAS,CAAC,WAAW,EAAE,WAAW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,MAAM,CAAC,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CAC1B,CAAC;AAuKF,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CA4BhF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAE/E;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GACxB,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAQ5B;AAED,wBAAgB,SAAS,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAK3D;AAED,wBAAiB,cAAc,CAC7B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,IAAI,GAAG;IAAE,WAAW,EAAE,WAAW,CAAA;CAAE,EAC7C,WAAW,EAAE,WAAW,GACvB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAqElC"}
|
package/dist/collection.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { parse,
|
|
1
|
+
import { checkDocument, parseFrontmatter, references, sectionReferences, target, parse, resolves, validating, VERSION, } from '@agentshouse/mdmodel';
|
|
2
2
|
import { beneath, normalize } from './paths.js';
|
|
3
|
+
import { sameTyping } from './model.js';
|
|
4
|
+
import { differences, patched, patching, shared, sizeOf } from './shared.js';
|
|
5
|
+
import { after, finished, inUnits, ROW_WEIGHT } from './turn.js';
|
|
3
6
|
export const MD_MODEL = { identity: '@agentshouse/mdmodel', version: VERSION };
|
|
4
7
|
const NO_TYPES = { types: {} };
|
|
5
8
|
function selected(composition, path) {
|
|
@@ -12,46 +15,62 @@ export function governing(composition, path) {
|
|
|
12
15
|
: composition.model;
|
|
13
16
|
}
|
|
14
17
|
const parsedIn = new WeakMap();
|
|
18
|
+
function* carried(previous, text) {
|
|
19
|
+
const held = parsedIn.get(previous);
|
|
20
|
+
if (held === undefined)
|
|
21
|
+
return shared({});
|
|
22
|
+
const kept = yield* patching(held.base, held.added);
|
|
23
|
+
held.base = kept;
|
|
24
|
+
held.added = new Map();
|
|
25
|
+
return yield* patching(kept, [], yield* differences(previous.text, text));
|
|
26
|
+
}
|
|
27
|
+
function cachedIn(collection, path) {
|
|
28
|
+
const held = parsedIn.get(collection);
|
|
29
|
+
if (held === undefined)
|
|
30
|
+
return undefined;
|
|
31
|
+
if (held.added.has(path))
|
|
32
|
+
return held.added.get(path);
|
|
33
|
+
return Object.hasOwn(held.base, path) ? held.base[path] : undefined;
|
|
34
|
+
}
|
|
15
35
|
export function collectionOf(text, composition, previous) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
36
|
+
return finished(collecting(text, composition, previous));
|
|
37
|
+
}
|
|
38
|
+
export function* collecting(text, composition, previous) {
|
|
39
|
+
const parsed = {
|
|
40
|
+
base: previous === undefined ? shared({}) : yield* carried(previous, text),
|
|
41
|
+
added: new Map(),
|
|
42
|
+
};
|
|
23
43
|
const collection = {
|
|
24
44
|
text,
|
|
25
45
|
composition,
|
|
26
46
|
document(path) {
|
|
27
|
-
const held =
|
|
47
|
+
const held = cachedIn(collection, path);
|
|
28
48
|
if (held !== undefined)
|
|
29
49
|
return held ?? undefined;
|
|
30
50
|
const content = text[path];
|
|
31
51
|
if (content === undefined)
|
|
32
52
|
return undefined;
|
|
33
53
|
const read = parse(content, path);
|
|
34
|
-
parsed.set(path, read.ok ? read.document : null);
|
|
54
|
+
parsed.added.set(path, read.ok ? read.document : null);
|
|
35
55
|
return read.ok ? read.document : undefined;
|
|
36
56
|
},
|
|
37
57
|
};
|
|
38
58
|
parsedIn.set(collection, parsed);
|
|
39
59
|
return collection;
|
|
40
60
|
}
|
|
41
|
-
export function
|
|
42
|
-
const held =
|
|
61
|
+
export function passingFrontmatter(collection, path) {
|
|
62
|
+
const held = cachedIn(collection, path);
|
|
43
63
|
if (held !== undefined)
|
|
44
64
|
return held ?? undefined;
|
|
45
65
|
const content = collection.text[path];
|
|
46
66
|
if (content === undefined)
|
|
47
67
|
return undefined;
|
|
48
|
-
const read =
|
|
49
|
-
return read.ok ? read.
|
|
68
|
+
const read = parseFrontmatter(content, path);
|
|
69
|
+
return read.ok ? read.frontmatter : undefined;
|
|
50
70
|
}
|
|
51
71
|
export function* documentsOf(collection) {
|
|
52
|
-
const parsed = parsedIn.get(collection);
|
|
53
72
|
for (const path of Object.keys(collection.text).sort()) {
|
|
54
|
-
const held =
|
|
73
|
+
const held = cachedIn(collection, path);
|
|
55
74
|
if (held === null)
|
|
56
75
|
continue;
|
|
57
76
|
if (held !== undefined) {
|
|
@@ -63,47 +82,304 @@ export function* documentsOf(collection) {
|
|
|
63
82
|
yield [path, read.document];
|
|
64
83
|
}
|
|
65
84
|
}
|
|
66
|
-
export function unreadable(text, previous) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
85
|
+
export function* unreadable(text, previous) {
|
|
86
|
+
const paths = previous === undefined
|
|
87
|
+
? Object.keys(text)
|
|
88
|
+
: [...(yield* differences(previous, text))].filter((path) => text[path] !== undefined);
|
|
89
|
+
for (const path of paths.sort()) {
|
|
70
90
|
const read = parse(text[path], path);
|
|
71
91
|
if (!read.ok)
|
|
72
92
|
return { kind: 'refused', refusal: read.refusal };
|
|
93
|
+
yield ROW_WEIGHT + text[path].length;
|
|
73
94
|
}
|
|
74
95
|
return null;
|
|
75
96
|
}
|
|
76
97
|
export function validRoot(root) {
|
|
77
98
|
return typeof root === 'string' && normalize(root) === root;
|
|
78
99
|
}
|
|
79
|
-
function validateAgainst(documents, binaryTargets, model) {
|
|
100
|
+
function* validateAgainst(documents, binaryTargets, model) {
|
|
80
101
|
if (model.status === 'unavailable') {
|
|
81
|
-
const
|
|
102
|
+
for (const path of Object.keys(documents)) {
|
|
103
|
+
const content = documents[path];
|
|
82
104
|
const parsed = parse(content);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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;
|
|
87
115
|
}
|
|
88
|
-
return validate(documents, { binaryTargets }, model.status === 'unavailable' ? NO_TYPES : { types: model.types });
|
|
89
116
|
}
|
|
90
|
-
export function validateCollection(text, binaryTargets, composition) {
|
|
117
|
+
export function* validateCollection(text, binaryTargets, composition) {
|
|
91
118
|
const collection = {};
|
|
92
119
|
const selection = {};
|
|
93
|
-
for (const
|
|
120
|
+
for (const path of Object.keys(text)) {
|
|
94
121
|
if (selected(composition, path))
|
|
95
|
-
selection[path] =
|
|
122
|
+
selection[path] = text[path];
|
|
96
123
|
else
|
|
97
|
-
collection[path] =
|
|
124
|
+
collection[path] = text[path];
|
|
125
|
+
yield ROW_WEIGHT;
|
|
98
126
|
}
|
|
99
127
|
const verdicts = [
|
|
100
|
-
validateAgainst(collection, binaryTargets.filter((path) => !selected(composition, path)), composition.model),
|
|
128
|
+
yield* validateAgainst(collection, binaryTargets.filter((path) => !selected(composition, path)), composition.model),
|
|
101
129
|
];
|
|
102
130
|
if (composition.selection !== null) {
|
|
103
|
-
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));
|
|
104
132
|
}
|
|
105
133
|
const refusals = verdicts.filter((verdict) => verdict.verdict === 'refuse');
|
|
106
134
|
if (refusals.length === 0)
|
|
107
135
|
return verdicts[0];
|
|
108
136
|
return refusals.find((refusal) => refusal.rule !== 'model-unavailable') ?? refusals[0];
|
|
109
137
|
}
|
|
138
|
+
const NO_REFERRERS = shared({});
|
|
139
|
+
const referrersOf = new WeakMap();
|
|
140
|
+
function typing(left, right) {
|
|
141
|
+
return (sameTyping(left.model, right.model) &&
|
|
142
|
+
(left.selection === null || right.selection === null
|
|
143
|
+
? left.selection === right.selection
|
|
144
|
+
: sameTyping(left.selection.model, right.selection.model)) &&
|
|
145
|
+
JSON.stringify(left.selection?.roots ?? null) === JSON.stringify(right.selection?.roots ?? null));
|
|
146
|
+
}
|
|
147
|
+
function declared(content) {
|
|
148
|
+
if (content === undefined)
|
|
149
|
+
return undefined;
|
|
150
|
+
const read = parseFrontmatter(content);
|
|
151
|
+
return read.ok ? (read.frontmatter.type ?? 'any') : undefined;
|
|
152
|
+
}
|
|
153
|
+
function typedIn(content) {
|
|
154
|
+
const type = declared(content);
|
|
155
|
+
return type !== undefined && type !== 'any';
|
|
156
|
+
}
|
|
157
|
+
function modelOf(composition, path) {
|
|
158
|
+
const model = governing(composition, path);
|
|
159
|
+
return model.status === 'unavailable' ? null : { types: model.types };
|
|
160
|
+
}
|
|
161
|
+
function checked(path, content, composition) {
|
|
162
|
+
return checkDocument(path, content, modelOf(composition, path) ?? NO_TYPES);
|
|
163
|
+
}
|
|
164
|
+
function targetsOf(check) {
|
|
165
|
+
if (!check.ok)
|
|
166
|
+
return [];
|
|
167
|
+
return [...new Set(check.references.flatMap(({ target }) => (target === null ? [] : [target])))];
|
|
168
|
+
}
|
|
169
|
+
function referencedBy(path, content, composition) {
|
|
170
|
+
const model = modelOf(composition, path);
|
|
171
|
+
if (model === null)
|
|
172
|
+
return [];
|
|
173
|
+
const read = parseFrontmatter(content, path);
|
|
174
|
+
const type = read.ok ? read.frontmatter.type : undefined;
|
|
175
|
+
if (!read.ok || type === undefined || !Object.hasOwn(model.types, type))
|
|
176
|
+
return [];
|
|
177
|
+
const definition = model.types[type];
|
|
178
|
+
return [
|
|
179
|
+
...new Set([
|
|
180
|
+
...references(read.frontmatter, definition).flatMap(({ value }) => {
|
|
181
|
+
const found = target(path, value);
|
|
182
|
+
return found === null ? [] : [found];
|
|
183
|
+
}),
|
|
184
|
+
...sectionReferences(path, content, definition).flatMap(({ target }) => target === null ? [] : [target]),
|
|
185
|
+
]),
|
|
186
|
+
];
|
|
187
|
+
}
|
|
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);
|
|
196
|
+
return held;
|
|
197
|
+
};
|
|
198
|
+
const targeting = [];
|
|
199
|
+
const targetless = [];
|
|
200
|
+
for (const [path, found] of changed) {
|
|
201
|
+
const before = Object.hasOwn(index.targets, path) ? index.targets[path] : [];
|
|
202
|
+
for (const target of before)
|
|
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);
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
composition: index.composition,
|
|
226
|
+
targets: yield* patching(index.targets, targeting, targetless),
|
|
227
|
+
referrers: yield* patching(index.referrers, referred, unreferred),
|
|
228
|
+
};
|
|
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
|
+
}
|
|
263
|
+
function heldIndex(held, composition) {
|
|
264
|
+
const index = referrersOf.get(held.text);
|
|
265
|
+
return index !== undefined && typing(index.composition, composition) ? index : null;
|
|
266
|
+
}
|
|
267
|
+
const indexing = new WeakMap();
|
|
268
|
+
export function indexReferrers(held, composition) {
|
|
269
|
+
if (heldIndex(held, composition) !== null)
|
|
270
|
+
return;
|
|
271
|
+
const running = indexing.get(held.text);
|
|
272
|
+
if (running !== undefined)
|
|
273
|
+
return running;
|
|
274
|
+
const targets = new Map();
|
|
275
|
+
const referrers = new Map();
|
|
276
|
+
const filled = inUnits(Object.keys(held.text), (path) => {
|
|
277
|
+
const content = held.text[path];
|
|
278
|
+
const found = referencedBy(path, content, composition);
|
|
279
|
+
if (found.length > 0)
|
|
280
|
+
targets.set(path, found);
|
|
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
|
+
}
|
|
288
|
+
return ROW_WEIGHT + content.length;
|
|
289
|
+
});
|
|
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));
|
|
296
|
+
indexing.set(held.text, building);
|
|
297
|
+
return building;
|
|
298
|
+
}
|
|
299
|
+
export function referencesIndexed(held, composition) {
|
|
300
|
+
return heldIndex(held, composition) !== null;
|
|
301
|
+
}
|
|
302
|
+
export function referring(held, composition, targets) {
|
|
303
|
+
const index = heldIndex(held, composition);
|
|
304
|
+
if (index === null)
|
|
305
|
+
return null;
|
|
306
|
+
const found = new Set();
|
|
307
|
+
for (const target of targets) {
|
|
308
|
+
for (const file of Object.keys(referrersOfTarget(index, target)))
|
|
309
|
+
found.add(file);
|
|
310
|
+
}
|
|
311
|
+
return found;
|
|
312
|
+
}
|
|
313
|
+
export function available(composition) {
|
|
314
|
+
return (composition.model.status !== 'unavailable' &&
|
|
315
|
+
(composition.selection === null || composition.selection.model.status !== 'unavailable'));
|
|
316
|
+
}
|
|
317
|
+
export function* changedCleanly(next, previous, composition) {
|
|
318
|
+
if (!typing(previous.composition, composition))
|
|
319
|
+
return false;
|
|
320
|
+
const paths = new Set([
|
|
321
|
+
...(yield* differences(previous.text, next.text)),
|
|
322
|
+
...(yield* differences(previous.binaries, next.binaries, () => true)),
|
|
323
|
+
]);
|
|
324
|
+
const binary = (path) => Object.hasOwn(next.binaries, path);
|
|
325
|
+
const within = (file) => (path) => selected(composition, path) === selected(composition, file);
|
|
326
|
+
const reaching = (file, check) => {
|
|
327
|
+
if (!check.ok)
|
|
328
|
+
return false;
|
|
329
|
+
const part = within(file);
|
|
330
|
+
return check.references.every((reference) => resolves(reference, (path) => (part(path) ? declared(next.text[path]) : undefined), (path) => part(path) && binary(path)));
|
|
331
|
+
};
|
|
332
|
+
const changedTargets = new Map();
|
|
333
|
+
const shifted = [];
|
|
334
|
+
const admitted = (path) => {
|
|
335
|
+
const now = next.text[path];
|
|
336
|
+
const was = previous.text[path];
|
|
337
|
+
const modeled = modelOf(composition, path) !== null;
|
|
338
|
+
if ((now === undefined) !== (was === undefined) ||
|
|
339
|
+
declared(now) !== declared(was) ||
|
|
340
|
+
binary(path) !== Object.hasOwn(previous.binaries, path)) {
|
|
341
|
+
shifted.push(path);
|
|
342
|
+
}
|
|
343
|
+
if (!modeled && typedIn(was) && !typedIn(now))
|
|
344
|
+
return false;
|
|
345
|
+
if (now === undefined) {
|
|
346
|
+
if (modeled)
|
|
347
|
+
changedTargets.set(path, []);
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
if (binary(path))
|
|
351
|
+
return false;
|
|
352
|
+
if (!modeled) {
|
|
353
|
+
if (declared(now) === undefined)
|
|
354
|
+
return false;
|
|
355
|
+
return typedIn(now) || checked(path, now, composition).ok;
|
|
356
|
+
}
|
|
357
|
+
const check = checked(path, now, composition);
|
|
358
|
+
if (!reaching(path, check))
|
|
359
|
+
return false;
|
|
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);
|
|
367
|
+
}
|
|
368
|
+
const index = heldIndex(previous, composition);
|
|
369
|
+
if (index === null && shifted.length > 0)
|
|
370
|
+
return false;
|
|
371
|
+
for (const target of shifted) {
|
|
372
|
+
const files = index === null ? [] : Object.keys(referrersOfTarget(index, target));
|
|
373
|
+
for (const file of files) {
|
|
374
|
+
if (paths.has(file))
|
|
375
|
+
continue;
|
|
376
|
+
if (!reaching(file, checked(file, next.text[file], composition)))
|
|
377
|
+
return false;
|
|
378
|
+
yield ROW_WEIGHT + next.text[file].length;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
if (index !== null) {
|
|
382
|
+
referrersOf.set(next.text, changedTargets.size === 0 ? index : yield* reindexed(index, changedTargets));
|
|
383
|
+
}
|
|
384
|
+
return true;
|
|
385
|
+
}
|
package/dist/connection.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { type TypesResult } from './model.js';
|
|
2
2
|
import { type Observation } from './observation.js';
|
|
3
|
-
import { type DocumentQuery, type DocumentResult, type GroupQuery, type GroupResult } from './query.js';
|
|
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';
|
|
12
|
+
import { type Recovery } from './recovery.js';
|
|
11
13
|
import { type SaveRefusal } from './save.js';
|
|
12
|
-
import { type RoomDraft, type RoomDraftWrite } from './room-draft.js';
|
|
14
|
+
import { type RoomDraft, type RoomDraftParts, type RoomDraftWrite } from './room-draft.js';
|
|
13
15
|
import { type SyncStatus } from './status.js';
|
|
14
16
|
import { type RuntimeShell } from './durability.js';
|
|
17
|
+
import { type CapacityCause, type CodeAvailability, type Persistence, type Readiness, type SearchObligation } from './readiness.js';
|
|
15
18
|
import { type NarrowedView, type PortReach, type RuntimeView } from './reach.js';
|
|
16
19
|
export type AppTypedSelection = {
|
|
17
20
|
roots: readonly string[];
|
|
@@ -48,6 +51,7 @@ export type MdRuntimeOptions = {
|
|
|
48
51
|
shell: RuntimeShell;
|
|
49
52
|
authorization?: Authorization;
|
|
50
53
|
signal?: AbortSignal;
|
|
54
|
+
recovery?: Recovery;
|
|
51
55
|
};
|
|
52
56
|
export type SaveResult = {
|
|
53
57
|
outcome: 'saved';
|
|
@@ -59,6 +63,10 @@ export type SavedRoomDraft = {
|
|
|
59
63
|
readonly path: string;
|
|
60
64
|
readonly revision: string;
|
|
61
65
|
};
|
|
66
|
+
export type SavedParts = {
|
|
67
|
+
readonly path: string;
|
|
68
|
+
readonly parts: RoomDraftParts;
|
|
69
|
+
};
|
|
62
70
|
export type RoomDraftSurface = {
|
|
63
71
|
list(): Promise<readonly RoomDraft[]>;
|
|
64
72
|
read(room: string, path: string): RoomDraft | null;
|
|
@@ -68,9 +76,11 @@ export type RoomDraftSurface = {
|
|
|
68
76
|
export type PresentationSurface = {
|
|
69
77
|
read(app: string): Promise<unknown>;
|
|
70
78
|
write(app: string, value: unknown): Promise<void>;
|
|
79
|
+
edit(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
71
80
|
};
|
|
72
81
|
export type BinaryFileSurface = {
|
|
73
82
|
read(room: string, path: string, revision?: string): Promise<BinaryAnswer>;
|
|
83
|
+
link(room: string, path: string, revision?: string): Promise<BinaryLinkAnswer>;
|
|
74
84
|
readReference(reference: BinaryReference): Promise<BinaryAnswer>;
|
|
75
85
|
};
|
|
76
86
|
export type HistoryQuery = {
|
|
@@ -81,8 +91,8 @@ export type MdRuntime = {
|
|
|
81
91
|
loaded(): Promise<void>;
|
|
82
92
|
rooms(): readonly AppRoom[];
|
|
83
93
|
query: {
|
|
84
|
-
(query: DocumentQuery): Promise<DocumentResult>;
|
|
85
|
-
(query: GroupQuery): Promise<GroupResult>;
|
|
94
|
+
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
95
|
+
(query: GroupQuery): Promise<GroupResult | PendingResult>;
|
|
86
96
|
};
|
|
87
97
|
search(request: SearchRequest): Promise<SearchResult>;
|
|
88
98
|
types(locator: string): RoomSchemas;
|
|
@@ -91,21 +101,24 @@ export type MdRuntime = {
|
|
|
91
101
|
chatDraft: ChatDraftSurface;
|
|
92
102
|
presentation: PresentationSurface;
|
|
93
103
|
save(room: string, roomDrafts: readonly SavedRoomDraft[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
104
|
+
saveParts(room: string, parts: readonly SavedParts[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
94
105
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryAnswer>;
|
|
95
106
|
binaryFile: BinaryFileSurface;
|
|
96
107
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
97
108
|
reached(locator: string, roomVersion: string, path?: string): boolean;
|
|
98
109
|
log(): string;
|
|
99
110
|
persistence(): boolean;
|
|
111
|
+
retry(): Promise<void>;
|
|
100
112
|
observe: {
|
|
101
113
|
(topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;
|
|
114
|
+
(topic: 'readiness'): Promise<Observation<Readiness>>;
|
|
102
115
|
(topic: 'connection-refusal'): Promise<Observation<ConnectionRefusal | null>>;
|
|
103
116
|
(topic: 'storage-loss'): Promise<Observation<string | null>>;
|
|
104
117
|
(topic: 'sync-status'): Promise<Observation<SyncStatus>>;
|
|
105
118
|
(topic: 'service-mode'): Promise<Observation<ServiceMode>>;
|
|
106
119
|
(topic: 'member'): Promise<Observation<Member | null>>;
|
|
107
|
-
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult>>;
|
|
108
|
-
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult>>;
|
|
120
|
+
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
|
|
121
|
+
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
|
|
109
122
|
(topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;
|
|
110
123
|
(topic: 'room-drafts'): Promise<Observation<readonly RoomDraft[]>>;
|
|
111
124
|
(topic: 'presentation', app: string): Promise<Observation<unknown>>;
|
|
@@ -115,10 +128,19 @@ export type MdRuntime = {
|
|
|
115
128
|
};
|
|
116
129
|
reauthorize(): Promise<void>;
|
|
117
130
|
};
|
|
118
|
-
export type RuntimeTopic = 'rooms' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents';
|
|
131
|
+
export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents';
|
|
132
|
+
export type ReadinessPort = {
|
|
133
|
+
readonly target: string;
|
|
134
|
+
readonly code: CodeAvailability;
|
|
135
|
+
readonly capacity: CapacityCause | null;
|
|
136
|
+
readonly search: SearchObligation;
|
|
137
|
+
};
|
|
119
138
|
export type ComposedRuntime = RuntimeView & {
|
|
139
|
+
seed(entry: EntrySeed): void;
|
|
120
140
|
stop(): Promise<void>;
|
|
121
|
-
|
|
141
|
+
lose(locators: readonly string[]): Promise<void>;
|
|
142
|
+
persisted(answer: Persistence): void;
|
|
143
|
+
within(reach: PortReach | null, port: ReadinessPort): NarrowedView;
|
|
122
144
|
};
|
|
123
145
|
export declare function composeRuntime(options: MdRuntimeOptions): ComposedRuntime;
|
|
124
146
|
export {};
|
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,EAInB,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,OAA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