@agentshouse/mdruntime 0.1.0-ca4dc698bd0c4 → 0.1.0-ca58768ab31fe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -16
- package/dist/adapter.d.ts +146 -79
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +5 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +38 -4
- package/dist/binary.d.ts +0 -5
- package/dist/binary.d.ts.map +1 -1
- package/dist/binary.js +1 -1
- package/dist/bootstrap.d.ts +27 -11
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +181 -99
- package/dist/chain.d.ts +12 -0
- package/dist/chain.d.ts.map +1 -0
- package/dist/chain.js +64 -0
- package/dist/change-set.d.ts +9 -16
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +11 -88
- package/dist/change.d.ts +31 -1
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +10 -1
- package/dist/client.d.ts +24 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +98 -11
- package/dist/collection.d.ts +11 -21
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +39 -291
- package/dist/compile.d.ts +11 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +586 -0
- package/dist/connection.d.ts +33 -17
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +3082 -1404
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/{chat/context.js → context.js} +1 -4
- package/dist/conversation.d.ts +31 -15
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +524 -223
- package/dist/digest.d.ts +7 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +113 -0
- package/dist/durability.d.ts +7 -4
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +5 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +30 -27
- package/dist/file.d.ts +2 -19
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +7 -122
- package/dist/host.d.ts +6 -8
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +98 -24
- package/dist/identity.d.ts +0 -2
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -6
- package/dist/index.d.ts +20 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/job.d.ts +14 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +28 -0
- package/dist/live.d.ts +23 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +127 -0
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +218 -0
- package/dist/memory.d.ts +17 -7
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +209 -103
- package/dist/messages.d.ts +28 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +89 -0
- package/dist/model.d.ts +10 -5
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +8 -14
- package/dist/name.d.ts +4 -0
- package/dist/name.d.ts.map +1 -0
- package/dist/name.js +122 -0
- package/dist/observation.d.ts +17 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +100 -5
- package/dist/opened.d.ts +22 -0
- package/dist/opened.d.ts.map +1 -0
- package/dist/opened.js +107 -0
- package/dist/outcome.d.ts +45 -7
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +39 -0
- package/dist/overlay.d.ts +3 -5
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +95 -156
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/query.d.ts +17 -185
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -464
- package/dist/reach.d.ts +16 -8
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +221 -90
- package/dist/react.d.ts +6 -4
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +7 -17
- package/dist/readiness.d.ts +14 -17
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +2 -8
- package/dist/recovery.d.ts +3 -2
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +34 -7
- package/dist/refresh.d.ts +17 -14
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +136 -52
- package/dist/replica.d.ts +56 -33
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +298 -182
- package/dist/room-draft.d.ts +37 -6
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +161 -74
- package/dist/rows.d.ts +22 -29
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +58 -112
- package/dist/save.d.ts +53 -14
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +529 -185
- package/dist/search.d.ts +15 -77
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -184
- 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 +7 -3
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +119 -66
- package/dist/status.d.ts +4 -3
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -1
- package/dist/store.d.ts +90 -98
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +303 -661
- package/dist/stored.d.ts +129 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +495 -0
- package/dist/tables.d.ts +328 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +587 -0
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/turn.d.ts +5 -3
- package/dist/turn.d.ts.map +1 -1
- package/dist/turn.js +51 -21
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +104 -0
- package/dist/windows.d.ts +11 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +16 -0
- package/dist/wire.d.ts +172 -33
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +57 -32
- package/package.json +18 -19
- package/AGENTS.md +0 -300
- package/dist/acquisition.d.ts +0 -14
- package/dist/acquisition.d.ts.map +0 -1
- package/dist/acquisition.js +0 -24
- package/dist/chat/acts.d.ts +0 -33
- package/dist/chat/acts.d.ts.map +0 -1
- package/dist/chat/acts.js +0 -36
- package/dist/chat/context.d.ts +0 -3
- package/dist/chat/context.d.ts.map +0 -1
- package/dist/chat/input.d.ts +0 -9
- package/dist/chat/input.d.ts.map +0 -1
- package/dist/chat/input.js +0 -99
- package/dist/chat/kit.d.ts +0 -60
- package/dist/chat/kit.d.ts.map +0 -1
- package/dist/chat/kit.js +0 -123
- package/dist/chat/lasting.d.ts +0 -6
- package/dist/chat/lasting.d.ts.map +0 -1
- package/dist/chat/lasting.js +0 -19
- package/dist/chat/list.d.ts +0 -26
- package/dist/chat/list.d.ts.map +0 -1
- package/dist/chat/list.js +0 -62
- package/dist/chat/markdown.d.ts +0 -20
- package/dist/chat/markdown.d.ts.map +0 -1
- package/dist/chat/markdown.js +0 -188
- package/dist/chat/message.d.ts +0 -6
- package/dist/chat/message.d.ts.map +0 -1
- package/dist/chat/message.js +0 -192
- package/dist/chat/messages.d.ts +0 -21
- package/dist/chat/messages.d.ts.map +0 -1
- package/dist/chat/messages.js +0 -151
- package/dist/chat/name.d.ts +0 -6
- package/dist/chat/name.d.ts.map +0 -1
- package/dist/chat/name.js +0 -37
- package/dist/chat/opened.d.ts +0 -11
- package/dist/chat/opened.d.ts.map +0 -1
- package/dist/chat/opened.js +0 -17
- package/dist/chat/overlay.d.ts +0 -31
- package/dist/chat/overlay.d.ts.map +0 -1
- package/dist/chat/overlay.js +0 -97
- package/dist/chat/parts.d.ts +0 -57
- package/dist/chat/parts.d.ts.map +0 -1
- package/dist/chat/parts.js +0 -119
- package/dist/chat/process.d.ts +0 -20
- package/dist/chat/process.d.ts.map +0 -1
- package/dist/chat/process.js +0 -32
- package/dist/chat/provider.d.ts +0 -63
- package/dist/chat/provider.d.ts.map +0 -1
- package/dist/chat/provider.js +0 -620
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -80
- package/dist/chat/questions.d.ts +0 -31
- package/dist/chat/questions.d.ts.map +0 -1
- package/dist/chat/questions.js +0 -111
- package/dist/chat/read.d.ts +0 -5
- package/dist/chat/read.d.ts.map +0 -1
- package/dist/chat/read.js +0 -13
- package/dist/chat/ready.d.ts +0 -33
- package/dist/chat/ready.d.ts.map +0 -1
- package/dist/chat/ready.js +0 -91
- package/dist/chat/style.d.ts +0 -4
- package/dist/chat/style.d.ts.map +0 -1
- package/dist/chat/style.js +0 -302
- package/dist/chat.d.ts +0 -14
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js +0 -8
- package/dist/read-side.d.ts +0 -25
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -639
package/dist/outcome.js
CHANGED
|
@@ -1,9 +1,48 @@
|
|
|
1
|
+
export const UNREADABLE = {
|
|
2
|
+
kind: 'unreadable',
|
|
3
|
+
code: 'room-not-readable',
|
|
4
|
+
fields: {},
|
|
5
|
+
retryable: false,
|
|
6
|
+
};
|
|
7
|
+
export const LOCKED_UNREADABLE = {
|
|
8
|
+
kind: 'unreadable',
|
|
9
|
+
code: 'room-locked',
|
|
10
|
+
fields: {},
|
|
11
|
+
retryable: true,
|
|
12
|
+
};
|
|
13
|
+
export const ABSENT_TARGET = {
|
|
14
|
+
kind: 'absent',
|
|
15
|
+
code: 'reference-absent',
|
|
16
|
+
fields: {},
|
|
17
|
+
retryable: false,
|
|
18
|
+
};
|
|
1
19
|
export function absentBinary(path) {
|
|
2
20
|
return { kind: 'absent', code: 'binary-file-absent', fields: { path }, retryable: false };
|
|
3
21
|
}
|
|
4
22
|
export function binaryAnswer(result) {
|
|
5
23
|
return result.kind === 'binary' || result.kind === 'rejected' ? result : failure(result);
|
|
6
24
|
}
|
|
25
|
+
const OCTET_STREAM = 'application/octet-stream';
|
|
26
|
+
export function binaryLinkAnswer(result, held) {
|
|
27
|
+
if (result.kind === 'link') {
|
|
28
|
+
return {
|
|
29
|
+
kind: 'link',
|
|
30
|
+
url: result.url,
|
|
31
|
+
name: result.name,
|
|
32
|
+
mediaType: result.mediaType ?? held ?? OCTET_STREAM,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return result.kind === 'rejected' ? result : failure(result);
|
|
36
|
+
}
|
|
37
|
+
export function attachAnswer(result) {
|
|
38
|
+
if (result.kind === 'attached')
|
|
39
|
+
return { kind: 'attached', path: result.path };
|
|
40
|
+
return result.kind === 'rejected' ? result : failure(result);
|
|
41
|
+
}
|
|
42
|
+
export const ROOM_LOCKED = 'room-locked';
|
|
43
|
+
export function lockedRoom(locator) {
|
|
44
|
+
return { kind: ROOM_LOCKED, locator, code: ROOM_LOCKED, fields: {}, retryable: true };
|
|
45
|
+
}
|
|
7
46
|
export const OFFLINE = { kind: 'offline' };
|
|
8
47
|
export const UNCERTAIN = {
|
|
9
48
|
kind: 'transport-uncertainty',
|
package/dist/overlay.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { BinaryFile, HeadChange } from './adapter.js';
|
|
|
2
2
|
import type { ChangeBatch } from './change.js';
|
|
3
3
|
export type Heads = {
|
|
4
4
|
revisions: Readonly<Record<string, string>>;
|
|
5
|
+
fileIds: Readonly<Record<string, string>>;
|
|
5
6
|
changes: Readonly<Record<string, HeadChange>>;
|
|
6
7
|
};
|
|
7
8
|
export type HeldBinary = ({
|
|
@@ -17,11 +18,8 @@ export type Layer = Heads & {
|
|
|
17
18
|
documents: Readonly<Record<string, string>>;
|
|
18
19
|
binaries: Readonly<Record<string, HeldBinary>>;
|
|
19
20
|
};
|
|
20
|
-
export declare function acceptedBinaries(files: Readonly<Record<string, BinaryFile>>):
|
|
21
|
+
export declare function acceptedBinaries(files: Readonly<Record<string, BinaryFile>>): Generator<readonly [string, HeldBinary]>;
|
|
21
22
|
export declare function sameBinary(left: HeldBinary | undefined, right: HeldBinary | undefined): boolean;
|
|
22
23
|
export declare function sameChange(left: HeadChange | undefined, right: HeadChange | undefined): boolean;
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function sameLayerText(left: Layer, right: Layer): boolean;
|
|
25
|
-
export declare function changedPaths(left: Layer, right: Layer): ReadonlySet<string>;
|
|
26
|
-
export declare function overlayChanged(base: Layer, queue: readonly ChangeBatch[], previousBase: Layer, previousQueue: readonly ChangeBatch[], previousVisible: Layer): Layer;
|
|
24
|
+
export declare function overlaying(base: Layer, queue: readonly ChangeBatch[], unapplied?: () => void): Generator<number, Layer, void>;
|
|
27
25
|
//# sourceMappingURL=overlay.d.ts.map
|
package/dist/overlay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../src/overlay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../src/overlay.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAU,WAAW,EAAgB,MAAM,aAAa,CAAC;AAIrE,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,CAAC,GAC7C;IACE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEN,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG;IAC1B,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CAChD,CAAC;AAEF,wBAAiB,gBAAgB,CAC/B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAC1C,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAE1C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAW/F;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAQ/F;AAqMD,wBAAiB,UAAU,CACzB,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,SAAS,CAAC,EAAE,MAAM,IAAI,GACrB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAoChC"}
|
package/dist/overlay.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { apply, parse, serialize } from '@agentshouse/mdmodel';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { apply, frontmatterValue, parse, serialize, } from '@agentshouse/mdmodel';
|
|
2
|
+
import { drafted, entriesIn, settling } from './shared.js';
|
|
3
|
+
import { ROW_WEIGHT } from './turn.js';
|
|
4
|
+
export function* acceptedBinaries(files) {
|
|
5
|
+
for (const [path, file] of entriesIn(files))
|
|
6
|
+
yield [path, { state: 'accepted', ...file }];
|
|
5
7
|
}
|
|
6
8
|
export function sameBinary(left, right) {
|
|
7
9
|
if (left === undefined || right === undefined)
|
|
@@ -11,7 +13,7 @@ export function sameBinary(left, right) {
|
|
|
11
13
|
left.mediaType === right.mediaType &&
|
|
12
14
|
left.sha256 === right.sha256 &&
|
|
13
15
|
(left.state === 'accepted'
|
|
14
|
-
? right.state === 'accepted'
|
|
16
|
+
? right.state === 'accepted'
|
|
15
17
|
: right.state === 'pending' && left.localId === right.localId));
|
|
16
18
|
}
|
|
17
19
|
export function sameChange(left, right) {
|
|
@@ -23,10 +25,13 @@ export function sameChange(left, right) {
|
|
|
23
25
|
left.author?.name === right.author?.name);
|
|
24
26
|
}
|
|
25
27
|
const EMPTY_FRONTMATTER = '---\n---\n';
|
|
28
|
+
function isPart(change) {
|
|
29
|
+
return change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble';
|
|
30
|
+
}
|
|
26
31
|
function at(path, name) {
|
|
27
32
|
return `${path} ${name}`;
|
|
28
33
|
}
|
|
29
|
-
function priorsOf(preconditions) {
|
|
34
|
+
function* priorsOf(preconditions) {
|
|
30
35
|
const fields = new Map();
|
|
31
36
|
const sections = new Map();
|
|
32
37
|
const preambles = new Map();
|
|
@@ -40,6 +45,7 @@ function priorsOf(preconditions) {
|
|
|
40
45
|
if (precondition.kind === 'preamble') {
|
|
41
46
|
preambles.set(precondition.path, precondition.value);
|
|
42
47
|
}
|
|
48
|
+
yield ROW_WEIGHT;
|
|
43
49
|
}
|
|
44
50
|
return {
|
|
45
51
|
field: (path, name) => fields.get(at(path, name)),
|
|
@@ -55,51 +61,50 @@ function compose(fields, sections) {
|
|
|
55
61
|
const opened = parse(skeleton);
|
|
56
62
|
if (!opened.ok)
|
|
57
63
|
return skeleton;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const next = apply(document, { kind: 'field', name, value, prior: undefined });
|
|
61
|
-
if (next.outcome === 'applied')
|
|
62
|
-
document = next.document;
|
|
63
|
-
}
|
|
64
|
-
return serialize(document);
|
|
64
|
+
const next = apply(opened.document, Object.entries(fields).flatMap(([name, value]) => frontmatterValue(value) ? [{ kind: 'field', name, value, prior: undefined }] : []));
|
|
65
|
+
return serialize(next.outcome === 'applied' ? next.document : opened.document);
|
|
65
66
|
}
|
|
66
|
-
function edited(
|
|
67
|
-
if (change.kind === 'field')
|
|
68
|
-
return
|
|
67
|
+
function edited(change, priors) {
|
|
68
|
+
if (change.kind === 'field')
|
|
69
|
+
return {
|
|
69
70
|
kind: 'field',
|
|
70
71
|
name: change.name,
|
|
71
72
|
value: change.value,
|
|
72
73
|
prior: priors.field(change.path, change.name),
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
kind: 'preamble',
|
|
78
|
-
value: change.value,
|
|
79
|
-
prior: priors.preamble(change.path),
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
if (change.kind !== 'section')
|
|
83
|
-
return null;
|
|
84
|
-
return apply(document, {
|
|
74
|
+
};
|
|
75
|
+
if (change.kind === 'preamble')
|
|
76
|
+
return { kind: 'preamble', value: change.value, prior: priors.preamble(change.path) };
|
|
77
|
+
return {
|
|
85
78
|
kind: 'section',
|
|
86
79
|
name: change.name,
|
|
87
80
|
value: change.value,
|
|
88
81
|
prior: priors.section(change.path, change.name),
|
|
89
|
-
}
|
|
82
|
+
};
|
|
90
83
|
}
|
|
91
|
-
function edit(staged,
|
|
92
|
-
const
|
|
84
|
+
function edit(staged, changes, priors) {
|
|
85
|
+
const path = changes[0].path;
|
|
86
|
+
delete staged.revisions[path];
|
|
87
|
+
const text = staged.documents[path];
|
|
93
88
|
if (text === undefined)
|
|
94
|
-
return
|
|
95
|
-
const parsed = parse(text,
|
|
89
|
+
return changes.length;
|
|
90
|
+
const parsed = parse(text, path);
|
|
96
91
|
if (!parsed.ok)
|
|
97
|
-
return
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
return changes.length;
|
|
93
|
+
const wanted = changes.map((change) => edited(change, priors));
|
|
94
|
+
const first = apply(parsed.document, wanted);
|
|
95
|
+
if (first.outcome === 'refuse')
|
|
96
|
+
return changes.length;
|
|
97
|
+
if (first.outcome === 'applied') {
|
|
98
|
+
staged.documents[path] = serialize(first.document);
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
const stale = new Set(first.stale);
|
|
102
|
+
const kept = wanted.filter((_, at) => !stale.has(at));
|
|
103
|
+
const rest = apply(parsed.document, kept);
|
|
104
|
+
if (rest.outcome !== 'applied')
|
|
105
|
+
return changes.length;
|
|
106
|
+
staged.documents[path] = serialize(rest.document);
|
|
107
|
+
return first.stale.length;
|
|
103
108
|
}
|
|
104
109
|
function relocate(staged, from, to) {
|
|
105
110
|
const text = staged.documents[from];
|
|
@@ -119,29 +124,32 @@ function relocate(staged, from, to) {
|
|
|
119
124
|
}
|
|
120
125
|
function moveHead(heads, from, to) {
|
|
121
126
|
const revision = heads.revisions[from];
|
|
127
|
+
const fileId = heads.fileIds[from];
|
|
122
128
|
const change = heads.changes[from];
|
|
123
129
|
delete heads.revisions[from];
|
|
130
|
+
delete heads.fileIds[from];
|
|
124
131
|
delete heads.changes[from];
|
|
132
|
+
delete heads.fileIds[to];
|
|
125
133
|
delete heads.changes[to];
|
|
126
134
|
if (revision !== undefined)
|
|
127
135
|
heads.revisions[to] = revision;
|
|
136
|
+
if (fileId !== undefined)
|
|
137
|
+
heads.fileIds[to] = fileId;
|
|
128
138
|
if (change !== undefined)
|
|
129
139
|
heads.changes[to] = change;
|
|
130
140
|
}
|
|
131
141
|
function erase(staged, path) {
|
|
132
142
|
delete staged.documents[path];
|
|
133
143
|
delete staged.revisions[path];
|
|
144
|
+
delete staged.fileIds[path];
|
|
134
145
|
delete staged.changes[path];
|
|
135
146
|
delete staged.binaries[path];
|
|
136
147
|
}
|
|
137
|
-
function stage(staged, change
|
|
138
|
-
if (change.kind === 'field' || change.kind === 'section' || change.kind === 'preamble') {
|
|
139
|
-
delete staged.revisions[change.path];
|
|
140
|
-
return edit(staged, change, priors);
|
|
141
|
-
}
|
|
148
|
+
function stage(staged, change) {
|
|
142
149
|
if (change.kind === 'create') {
|
|
143
150
|
staged.documents[change.path] =
|
|
144
151
|
'content' in change ? change.content : compose(change.fields, change.sections);
|
|
152
|
+
delete staged.fileIds[change.path];
|
|
145
153
|
delete staged.changes[change.path];
|
|
146
154
|
return true;
|
|
147
155
|
}
|
|
@@ -169,132 +177,63 @@ function stage(staged, change, priors) {
|
|
|
169
177
|
if (change.kind === 'move') {
|
|
170
178
|
return relocate(staged, change.path, change.to);
|
|
171
179
|
}
|
|
180
|
+
if (change.kind === 'arrival') {
|
|
181
|
+
erase(staged, change.path);
|
|
182
|
+
if ('content' in change)
|
|
183
|
+
staged.documents[change.path] = change.content;
|
|
184
|
+
else
|
|
185
|
+
staged.binaries[change.path] = { state: 'accepted', ...change.binary };
|
|
186
|
+
arrive(staged, change);
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
172
189
|
erase(staged, change.path);
|
|
173
190
|
return true;
|
|
174
191
|
}
|
|
175
|
-
|
|
192
|
+
function arrive(heads, change) {
|
|
193
|
+
if (change.revision !== undefined)
|
|
194
|
+
heads.revisions[change.path] = change.revision;
|
|
195
|
+
if (change.fileId !== undefined)
|
|
196
|
+
heads.fileIds[change.path] = change.fileId;
|
|
197
|
+
if (change.change !== undefined)
|
|
198
|
+
heads.changes[change.path] = change.change;
|
|
199
|
+
}
|
|
200
|
+
export function* overlaying(base, queue, unapplied) {
|
|
176
201
|
const staged = {
|
|
177
202
|
documents: drafted(base.documents),
|
|
178
203
|
binaries: drafted(base.binaries),
|
|
179
204
|
revisions: drafted(base.revisions),
|
|
205
|
+
fileIds: drafted(base.fileIds),
|
|
180
206
|
changes: drafted(base.changes),
|
|
181
207
|
};
|
|
182
208
|
for (const batch of queue) {
|
|
183
|
-
const priors = priorsOf(batch.preconditions);
|
|
184
|
-
for (
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
documents: settled(staged.documents),
|
|
191
|
-
binaries: settled(staged.binaries),
|
|
192
|
-
revisions: settled(staged.revisions),
|
|
193
|
-
changes: settled(staged.changes),
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function pathsOf(batch) {
|
|
197
|
-
return batch.changes.flatMap((change) => change.kind === 'move' ? [change.path, change.to] : [change.path]);
|
|
198
|
-
}
|
|
199
|
-
export function sameLayerText(left, right) {
|
|
200
|
-
return (differing(left.documents, right.documents).size === 0 &&
|
|
201
|
-
differing(left.binaries, right.binaries, sameBinary).size === 0);
|
|
202
|
-
}
|
|
203
|
-
export function changedPaths(left, right) {
|
|
204
|
-
return new Set([
|
|
205
|
-
...differing(left.documents, right.documents),
|
|
206
|
-
...differing(left.revisions, right.revisions),
|
|
207
|
-
...differing(left.changes, right.changes, sameChange),
|
|
208
|
-
...differing(left.binaries, right.binaries, sameBinary),
|
|
209
|
-
]);
|
|
210
|
-
}
|
|
211
|
-
function replayHeads(base, queue) {
|
|
212
|
-
const heads = { revisions: drafted(base.revisions), changes: drafted(base.changes) };
|
|
213
|
-
for (const batch of queue) {
|
|
214
|
-
for (const change of batch.changes) {
|
|
215
|
-
if (change.kind === 'remove') {
|
|
216
|
-
delete heads.revisions[change.path];
|
|
217
|
-
delete heads.changes[change.path];
|
|
218
|
-
}
|
|
219
|
-
else if (change.kind === 'create') {
|
|
220
|
-
delete heads.changes[change.path];
|
|
221
|
-
}
|
|
222
|
-
else if (change.kind === 'replace' ||
|
|
223
|
-
change.kind === 'field' ||
|
|
224
|
-
change.kind === 'section' ||
|
|
225
|
-
change.kind === 'preamble') {
|
|
226
|
-
delete heads.revisions[change.path];
|
|
227
|
-
}
|
|
228
|
-
else if (change.kind === 'binary') {
|
|
229
|
-
delete heads.revisions[change.path];
|
|
230
|
-
delete heads.changes[change.path];
|
|
231
|
-
}
|
|
232
|
-
else if (change.kind === 'move') {
|
|
233
|
-
moveHead(heads, change.path, change.to);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return { revisions: settled(heads.revisions), changes: settled(heads.changes) };
|
|
238
|
-
}
|
|
239
|
-
export function overlayChanged(base, queue, previousBase, previousQueue, previousVisible) {
|
|
240
|
-
const before = previousQueue.map((batch) => JSON.stringify(batch));
|
|
241
|
-
const after = queue.map((batch) => JSON.stringify(batch));
|
|
242
|
-
if (before.length === after.length &&
|
|
243
|
-
before.every((id, index) => id === after[index]) &&
|
|
244
|
-
sameLayerText(base, previousBase)) {
|
|
245
|
-
return {
|
|
246
|
-
documents: previousVisible.documents,
|
|
247
|
-
binaries: previousVisible.binaries,
|
|
248
|
-
...replayHeads(base, queue),
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
const affected = new Set(changedPaths(base, previousBase));
|
|
252
|
-
const oldIds = new Set(before);
|
|
253
|
-
const newIds = new Set(after);
|
|
254
|
-
for (const batch of previousQueue) {
|
|
255
|
-
if (!newIds.has(JSON.stringify(batch)))
|
|
256
|
-
for (const path of pathsOf(batch))
|
|
257
|
-
affected.add(path);
|
|
258
|
-
}
|
|
259
|
-
for (const batch of queue) {
|
|
260
|
-
if (!oldIds.has(JSON.stringify(batch)))
|
|
261
|
-
for (const path of pathsOf(batch))
|
|
262
|
-
affected.add(path);
|
|
263
|
-
}
|
|
264
|
-
let expanded = true;
|
|
265
|
-
while (expanded) {
|
|
266
|
-
expanded = false;
|
|
267
|
-
for (const batch of queue) {
|
|
268
|
-
const touched = pathsOf(batch);
|
|
269
|
-
if (!touched.some((path) => affected.has(path)))
|
|
209
|
+
const priors = yield* priorsOf(batch.preconditions);
|
|
210
|
+
for (let index = 0; index < batch.changes.length; index += 1) {
|
|
211
|
+
const change = batch.changes[index];
|
|
212
|
+
if (!isPart(change)) {
|
|
213
|
+
if (!stage(staged, change))
|
|
214
|
+
unapplied?.();
|
|
215
|
+
yield ROW_WEIGHT;
|
|
270
216
|
continue;
|
|
271
|
-
for (const path of touched) {
|
|
272
|
-
if (affected.has(path))
|
|
273
|
-
continue;
|
|
274
|
-
affected.add(path);
|
|
275
|
-
expanded = true;
|
|
276
217
|
}
|
|
218
|
+
const run = [change];
|
|
219
|
+
while (index + 1 < batch.changes.length) {
|
|
220
|
+
const next = batch.changes[index + 1];
|
|
221
|
+
if (!isPart(next) || next.path !== change.path)
|
|
222
|
+
break;
|
|
223
|
+
run.push(next);
|
|
224
|
+
index += 1;
|
|
225
|
+
}
|
|
226
|
+
const text = staged.documents[change.path] ?? '';
|
|
227
|
+
for (let left = edit(staged, run, priors); left > 0; left -= 1)
|
|
228
|
+
unapplied?.();
|
|
229
|
+
yield ROW_WEIGHT + text.length;
|
|
277
230
|
}
|
|
278
231
|
}
|
|
279
|
-
const documents = {};
|
|
280
|
-
const revisions = {};
|
|
281
|
-
const changes = {};
|
|
282
|
-
const binaries = {};
|
|
283
|
-
for (const path of affected) {
|
|
284
|
-
if (base.documents[path] !== undefined)
|
|
285
|
-
documents[path] = base.documents[path];
|
|
286
|
-
if (base.revisions[path] !== undefined)
|
|
287
|
-
revisions[path] = base.revisions[path];
|
|
288
|
-
if (base.changes[path] !== undefined)
|
|
289
|
-
changes[path] = base.changes[path];
|
|
290
|
-
if (base.binaries[path] !== undefined)
|
|
291
|
-
binaries[path] = base.binaries[path];
|
|
292
|
-
}
|
|
293
|
-
const staged = overlay({ documents, revisions, changes, binaries }, queue.filter((batch) => pathsOf(batch).some((path) => affected.has(path))));
|
|
294
232
|
return {
|
|
295
|
-
documents:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
233
|
+
documents: yield* settling(staged.documents),
|
|
234
|
+
binaries: yield* settling(staged.binaries),
|
|
235
|
+
revisions: yield* settling(staged.revisions),
|
|
236
|
+
fileIds: yield* settling(staged.fileIds),
|
|
237
|
+
changes: yield* settling(staged.changes),
|
|
299
238
|
};
|
|
300
239
|
}
|
package/dist/paths.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function normalize(path: string): string | null;
|
|
2
2
|
export declare function beneath(prefix: string, path: string): boolean;
|
|
3
3
|
export declare function covered(prefixes: readonly string[], path: string): boolean;
|
|
4
|
+
export declare function ancestors(path: string): readonly string[];
|
|
4
5
|
//# sourceMappingURL=paths.d.ts.map
|
package/dist/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK1E"}
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK1E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAGzD"}
|
package/dist/paths.js
CHANGED
|
@@ -22,3 +22,7 @@ export function covered(prefixes, path) {
|
|
|
22
22
|
return normalized !== null && (normalized === '' || beneath(normalized, path));
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
export function ancestors(path) {
|
|
26
|
+
const parts = path.split('/');
|
|
27
|
+
return parts.slice(1).map((_, at) => parts.slice(0, at + 1).join('/'));
|
|
28
|
+
}
|
package/dist/query.d.ts
CHANGED
|
@@ -1,84 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type HeldRooms, type QueryPlan } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { HeadChange } from './adapter.js';
|
|
3
3
|
import type { BinaryFileRecord } from './binary.js';
|
|
4
|
-
|
|
5
|
-
export type Predicate = Value | {
|
|
6
|
-
$eq: Value;
|
|
7
|
-
} | {
|
|
8
|
-
$ne: Value;
|
|
9
|
-
} | {
|
|
10
|
-
$in: readonly Value[];
|
|
11
|
-
} | {
|
|
12
|
-
$nin: readonly Value[];
|
|
13
|
-
} | {
|
|
14
|
-
$gt?: Value;
|
|
15
|
-
$gte?: Value;
|
|
16
|
-
$lt?: Value;
|
|
17
|
-
$lte?: Value;
|
|
18
|
-
} | {
|
|
19
|
-
$all: readonly Value[];
|
|
20
|
-
} | {
|
|
21
|
-
$size: number;
|
|
22
|
-
} | {
|
|
23
|
-
$exists: boolean;
|
|
24
|
-
};
|
|
25
|
-
export type Where = {
|
|
26
|
-
$and?: readonly Where[];
|
|
27
|
-
$or?: readonly Where[];
|
|
28
|
-
[field: string]: Predicate | readonly Where[] | undefined;
|
|
29
|
-
};
|
|
30
|
-
export type Related = {
|
|
31
|
-
types?: readonly string[];
|
|
32
|
-
where?: Where;
|
|
33
|
-
pathPrefix?: string;
|
|
34
|
-
};
|
|
35
|
-
export type Filter = {
|
|
36
|
-
rooms?: readonly string[];
|
|
37
|
-
types?: readonly string[];
|
|
38
|
-
where?: Where;
|
|
39
|
-
pathPrefix?: string;
|
|
40
|
-
hop?: Related & {
|
|
41
|
-
field: string;
|
|
42
|
-
};
|
|
43
|
-
backlinks?: Related & {
|
|
44
|
-
field?: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export type Key = 'room' | 'path' | 'type' | {
|
|
48
|
-
field: string;
|
|
49
|
-
};
|
|
50
|
-
export type Select = 'all' | {
|
|
51
|
-
fields?: 'all' | readonly string[];
|
|
52
|
-
sections?: 'all' | readonly string[];
|
|
53
|
-
preamble?: true;
|
|
54
|
-
markdown?: true;
|
|
55
|
-
backlinks?: true;
|
|
56
|
-
change?: true;
|
|
57
|
-
};
|
|
58
|
-
export type OrderOptions = {
|
|
59
|
-
nulls?: 'first' | 'last';
|
|
60
|
-
stringSort?: 'lexical' | 'locale';
|
|
61
|
-
locale?: string;
|
|
62
|
-
localeOptions?: Readonly<Record<string, unknown>>;
|
|
63
|
-
};
|
|
64
|
-
export type Direction = 'asc' | 'desc';
|
|
65
|
-
export type DocumentQuery = Filter & {
|
|
66
|
-
select: Select;
|
|
67
|
-
orderBy?: readonly ({
|
|
68
|
-
by: Key;
|
|
69
|
-
direction?: Direction;
|
|
70
|
-
} & OrderOptions)[];
|
|
71
|
-
limit?: number;
|
|
72
|
-
};
|
|
73
|
-
export type GroupQuery = Filter & {
|
|
74
|
-
groupBy: readonly Exclude<Key, 'path'>[];
|
|
75
|
-
orderBy?: readonly {
|
|
76
|
-
by: 'count' | Exclude<Key, 'path'>;
|
|
77
|
-
direction?: Direction;
|
|
78
|
-
}[];
|
|
79
|
-
limit?: number;
|
|
80
|
-
};
|
|
81
|
-
export type LocalQuery = DocumentQuery | GroupQuery;
|
|
4
|
+
import type { Open } from './open.js';
|
|
82
5
|
export type Backlink = {
|
|
83
6
|
path: string;
|
|
84
7
|
type: string;
|
|
@@ -94,6 +17,8 @@ export type QueryDocument = {
|
|
|
94
17
|
markdown?: string;
|
|
95
18
|
backlinks?: readonly Backlink[];
|
|
96
19
|
change?: HeadChange | null;
|
|
20
|
+
fileId?: string | null;
|
|
21
|
+
revision?: string | null;
|
|
97
22
|
binaryFile?: BinaryFileRecord;
|
|
98
23
|
};
|
|
99
24
|
export type QueryGroup = {
|
|
@@ -110,7 +35,7 @@ export type QueryCoverage = {
|
|
|
110
35
|
indexes: readonly string[];
|
|
111
36
|
overlay: readonly string[];
|
|
112
37
|
};
|
|
113
|
-
export type Awaits = 'acquisition' | 'preparation' | '
|
|
38
|
+
export type Awaits = Open<'acquisition' | 'preparation' | 'unlock'>;
|
|
114
39
|
export type PendingRoom = {
|
|
115
40
|
room: string;
|
|
116
41
|
awaits: Awaits;
|
|
@@ -120,9 +45,13 @@ export type PendingResult = {
|
|
|
120
45
|
};
|
|
121
46
|
export type DocumentRows = {
|
|
122
47
|
documents: readonly QueryDocument[];
|
|
48
|
+
next?: string;
|
|
49
|
+
total?: number;
|
|
123
50
|
};
|
|
124
51
|
export type GroupRows = {
|
|
125
52
|
groups: readonly QueryGroup[];
|
|
53
|
+
next?: string;
|
|
54
|
+
total?: number;
|
|
126
55
|
};
|
|
127
56
|
export type QueryRows = DocumentRows | GroupRows;
|
|
128
57
|
export type DocumentResult = DocumentRows & {
|
|
@@ -132,116 +61,19 @@ export type GroupResult = GroupRows & {
|
|
|
132
61
|
coverage: QueryCoverage;
|
|
133
62
|
};
|
|
134
63
|
export type QueryResult = DocumentResult | GroupResult | PendingResult;
|
|
135
|
-
export type
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
types: readonly Definition[];
|
|
140
|
-
};
|
|
141
|
-
export type HeldRooms = {
|
|
142
|
-
listed: boolean;
|
|
143
|
-
rooms: readonly RoomFacts[];
|
|
144
|
-
};
|
|
145
|
-
export type Test = {
|
|
146
|
-
op: 'eq';
|
|
147
|
-
value: Value;
|
|
148
|
-
} | {
|
|
149
|
-
op: 'ne';
|
|
150
|
-
value: Value;
|
|
151
|
-
} | {
|
|
152
|
-
op: 'in';
|
|
153
|
-
values: readonly Value[];
|
|
154
|
-
} | {
|
|
155
|
-
op: 'nin';
|
|
156
|
-
values: readonly Value[];
|
|
157
|
-
} | {
|
|
158
|
-
op: 'range';
|
|
159
|
-
bounds: readonly (readonly ['gt' | 'gte' | 'lt' | 'lte', Value])[];
|
|
160
|
-
} | {
|
|
161
|
-
op: 'all';
|
|
162
|
-
values: readonly Value[];
|
|
163
|
-
} | {
|
|
164
|
-
op: 'size';
|
|
165
|
-
size: number;
|
|
166
|
-
} | {
|
|
167
|
-
op: 'exists';
|
|
168
|
-
exists: boolean;
|
|
169
|
-
};
|
|
170
|
-
export type Condition = {
|
|
171
|
-
every: readonly Condition[];
|
|
172
|
-
} | {
|
|
173
|
-
some: readonly Condition[];
|
|
174
|
-
} | {
|
|
175
|
-
field: string;
|
|
176
|
-
test: Test;
|
|
177
|
-
};
|
|
178
|
-
export type Scope = {
|
|
179
|
-
types: readonly string[] | null;
|
|
180
|
-
where: Condition | null;
|
|
181
|
-
pathPrefix: string | null;
|
|
182
|
-
};
|
|
183
|
-
export type KeyPlan = {
|
|
184
|
-
of: 'room';
|
|
185
|
-
} | {
|
|
186
|
-
of: 'path';
|
|
187
|
-
} | {
|
|
188
|
-
of: 'type';
|
|
189
|
-
} | {
|
|
190
|
-
of: 'field';
|
|
191
|
-
field: string;
|
|
192
|
-
};
|
|
193
|
-
export type DocumentShape = {
|
|
194
|
-
kind: 'documents';
|
|
195
|
-
fields: 'all' | readonly string[] | null;
|
|
196
|
-
sections: 'all' | readonly string[] | null;
|
|
197
|
-
preamble: boolean;
|
|
198
|
-
markdown: boolean;
|
|
199
|
-
backlinks: boolean;
|
|
200
|
-
change: boolean;
|
|
201
|
-
orderBy: readonly {
|
|
202
|
-
key: KeyPlan;
|
|
203
|
-
options: OrderOptions & {
|
|
204
|
-
direction: Direction;
|
|
205
|
-
};
|
|
206
|
-
}[];
|
|
207
|
-
};
|
|
208
|
-
export type GroupShape = {
|
|
209
|
-
kind: 'groups';
|
|
210
|
-
groupBy: readonly KeyPlan[];
|
|
211
|
-
orderBy: readonly {
|
|
212
|
-
by: 'count' | number;
|
|
213
|
-
direction: Direction;
|
|
214
|
-
}[];
|
|
64
|
+
export type PlanArea = {
|
|
65
|
+
room: string;
|
|
66
|
+
path: string;
|
|
67
|
+
open: readonly string[];
|
|
215
68
|
};
|
|
216
69
|
export type PlanReach = {
|
|
217
70
|
rooms: readonly string[];
|
|
218
71
|
documents: readonly string[];
|
|
72
|
+
areas: readonly PlanArea[];
|
|
219
73
|
};
|
|
220
|
-
export type Plan = {
|
|
221
|
-
rooms: readonly string[] | null;
|
|
74
|
+
export type Plan = QueryPlan & {
|
|
222
75
|
reach: PlanReach | null;
|
|
223
|
-
|
|
224
|
-
hop: (Scope & {
|
|
225
|
-
field: string;
|
|
226
|
-
}) | null;
|
|
227
|
-
backlinks: (Scope & {
|
|
228
|
-
field: string | null;
|
|
229
|
-
}) | null;
|
|
230
|
-
shape: DocumentShape | GroupShape;
|
|
231
|
-
limit: number | null;
|
|
76
|
+
locked: readonly string[];
|
|
232
77
|
};
|
|
233
|
-
export declare
|
|
234
|
-
readonly code: QueryErrorCode;
|
|
235
|
-
readonly retryable = false;
|
|
236
|
-
constructor(code: QueryErrorCode, at: string, problem: string);
|
|
237
|
-
}
|
|
238
|
-
type Entries = Readonly<Record<string, unknown>>;
|
|
239
|
-
export declare function invalid(at: string, problem: string): never;
|
|
240
|
-
export declare function plain(value: unknown): value is Entries;
|
|
241
|
-
export declare function known(value: Entries, allowed: readonly string[], at: string): void;
|
|
242
|
-
export declare function planOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
243
|
-
export declare function limitOf(input: unknown): number | null;
|
|
244
|
-
export declare function filterOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
245
|
-
export declare function identityOf(plan: Plan): string;
|
|
246
|
-
export {};
|
|
78
|
+
export declare function planWithin(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
247
79
|
//# sourceMappingURL=query.d.ts.map
|