@agentshouse/mdruntime 0.1.0-ca6edc1abd618 → 0.1.0-ca8707258fdde
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 +2 -2
- package/dist/acceptance.d.ts +26 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +384 -0
- package/dist/adapter.d.ts +102 -70
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +3 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +29 -47
- package/dist/bootstrap.d.ts +16 -14
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +272 -129
- package/dist/chain.d.ts +2 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/change.d.ts +1 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/chat-types.d.ts +3 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +2 -0
- package/dist/client.d.ts +20 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +55 -6
- package/dist/collection.d.ts +7 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +23 -17
- package/dist/compile.d.ts +6 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +278 -282
- package/dist/connection.d.ts +22 -44
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +1600 -3577
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation-row.d.ts +33 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +47 -0
- package/dist/conversation.d.ts +27 -18
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +484 -258
- package/dist/durability.d.ts +6 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +3 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +18 -8
- package/dist/figures.d.ts +48 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +197 -0
- package/dist/file.d.ts +2 -11
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +6 -4
- package/dist/host.d.ts +3 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +29 -32
- package/dist/identity.d.ts +0 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +0 -3
- package/dist/index.d.ts +20 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/install.d.ts +86 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +537 -0
- package/dist/job.d.ts +33 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +54 -0
- package/dist/live.d.ts +5 -4
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +62 -20
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- 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 +12 -5
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +216 -85
- package/dist/messages.d.ts +27 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +97 -19
- package/dist/model.d.ts +8 -10
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +5 -17
- package/dist/observation.d.ts +3 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +8 -3
- package/dist/outcome.d.ts +14 -5
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +19 -2
- package/dist/overlay.d.ts +1 -0
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +11 -0
- package/dist/parts.d.ts +59 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +118 -0
- 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 +18 -207
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/questions.d.ts +32 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +118 -0
- package/dist/reach.d.ts +18 -11
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +206 -126
- package/dist/react.d.ts +5 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/read.d.ts +7 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +17 -0
- package/dist/readiness.d.ts +3 -17
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +4 -10
- package/dist/reads.d.ts +34 -10
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +114 -86
- package/dist/recovery.d.ts +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +35 -1
- package/dist/refresh.d.ts +7 -5
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +33 -5
- package/dist/replica.d.ts +10 -11
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +52 -20
- package/dist/room-draft.d.ts +21 -5
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +98 -51
- package/dist/room-drafts.d.ts +29 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +216 -0
- package/dist/rows.d.ts +18 -16
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +45 -153
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +22 -13
- package/dist/saves.d.ts +96 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +999 -0
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- package/dist/seed.d.ts +16 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +66 -0
- package/dist/shared.d.ts +0 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +0 -10
- package/dist/socket/admission.d.ts +7 -0
- package/dist/socket/admission.d.ts.map +1 -0
- package/dist/socket/admission.js +39 -0
- package/dist/socket/answers.d.ts +6 -0
- package/dist/socket/answers.d.ts.map +1 -0
- package/dist/socket/answers.js +20 -0
- package/dist/socket/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket.d.ts +43 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +96 -0
- package/dist/source.d.ts +61 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +81 -0
- package/dist/status.d.ts +4 -5
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -7
- package/dist/store/fences.d.ts +16 -0
- package/dist/store/fences.d.ts.map +1 -0
- package/dist/store/fences.js +26 -0
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +34 -0
- package/dist/store/records.d.ts +212 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +408 -0
- package/dist/store/room-held.d.ts +8 -0
- package/dist/store/room-held.d.ts.map +1 -0
- package/dist/store/room-held.js +17 -0
- package/dist/store/watchers.d.ts +15 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +36 -0
- package/dist/store/writes.d.ts +24 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +125 -0
- package/dist/store.d.ts +76 -158
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +117 -403
- package/dist/stored.d.ts +66 -55
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +343 -273
- package/dist/tables.d.ts +118 -65
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +199 -99
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +129 -0
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/validation.d.ts +3 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +42 -100
- package/dist/windows.d.ts +1 -12
- package/dist/windows.d.ts.map +1 -1
- package/dist/windows.js +2 -75
- package/dist/wire.d.ts +23 -8
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +8 -2
- package/package.json +2 -2
- package/dist/fence.d.ts +0 -6
- package/dist/fence.d.ts.map +0 -1
- package/dist/fence.js +0 -10
- package/dist/fulltext.d.ts +0 -27
- package/dist/fulltext.d.ts.map +0 -1
- package/dist/fulltext.js +0 -368
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -150
package/dist/parts.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { closeLast, markerMoved, openJobs } from './job.js';
|
|
2
|
+
import { excerpt, list, record, text } from './read.js';
|
|
3
|
+
const MARKERS = ['mode', 'compaction', 'retry', 'model', 'job'];
|
|
4
|
+
function partOf(raw) {
|
|
5
|
+
const part = record(raw);
|
|
6
|
+
switch (text(part, 'type')) {
|
|
7
|
+
case 'text':
|
|
8
|
+
case 'reasoning': {
|
|
9
|
+
const said = text(part, 'text');
|
|
10
|
+
return said === null ? null : { type: part.type, text: said };
|
|
11
|
+
}
|
|
12
|
+
case 'commands':
|
|
13
|
+
return typeof part.count === 'number' ? { type: 'commands', count: part.count } : null;
|
|
14
|
+
case 'subagent':
|
|
15
|
+
return {
|
|
16
|
+
type: 'subagent',
|
|
17
|
+
description: text(part, 'description') ?? '',
|
|
18
|
+
done: part.status === 'done',
|
|
19
|
+
result: text(part, 'result'),
|
|
20
|
+
};
|
|
21
|
+
case 'message': {
|
|
22
|
+
const command = text(part, 'command');
|
|
23
|
+
return command === null ? null : { type: 'message', command, target: text(part, 'target') };
|
|
24
|
+
}
|
|
25
|
+
case 'image': {
|
|
26
|
+
const path = text(part, 'file');
|
|
27
|
+
const name = text(part, 'name');
|
|
28
|
+
return path === null || name === null
|
|
29
|
+
? null
|
|
30
|
+
: { type: 'image', path, name, mediaType: text(part, 'media_type') ?? '' };
|
|
31
|
+
}
|
|
32
|
+
case 'marker': {
|
|
33
|
+
const marker = text(part, 'marker');
|
|
34
|
+
return marker === null || !MARKERS.includes(marker)
|
|
35
|
+
? null
|
|
36
|
+
: { type: 'marker', marker: marker, text: text(part, 'text') ?? '' };
|
|
37
|
+
}
|
|
38
|
+
case 'plan':
|
|
39
|
+
return {
|
|
40
|
+
type: 'plan',
|
|
41
|
+
steps: list(part, 'entries').flatMap((entry) => {
|
|
42
|
+
const step = record(entry);
|
|
43
|
+
const content = text(step, 'content');
|
|
44
|
+
return content === null ? [] : [{ content, status: text(step, 'status') ?? '' }];
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
default:
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function partsOf(raw) {
|
|
52
|
+
return raw.flatMap((one) => partOf(one) ?? []);
|
|
53
|
+
}
|
|
54
|
+
export function contextIn(raw) {
|
|
55
|
+
const held = record(raw);
|
|
56
|
+
return typeof held.used === 'number' && typeof held.window === 'number' && held.window > 0
|
|
57
|
+
? { used: held.used, window: held.window }
|
|
58
|
+
: null;
|
|
59
|
+
}
|
|
60
|
+
export function counted(count) {
|
|
61
|
+
return count === 1 ? '1 command' : `${count} commands`;
|
|
62
|
+
}
|
|
63
|
+
export function runningLine(raw) {
|
|
64
|
+
const parts = partsOf(raw);
|
|
65
|
+
const note = [...parts].reverse().find((part) => part.type === 'text' && part.text.trim() !== '');
|
|
66
|
+
if (note?.type === 'text')
|
|
67
|
+
return excerpt(note.text);
|
|
68
|
+
const commands = parts.reduce((sum, part) => (part.type === 'commands' ? sum + part.count : sum), 0);
|
|
69
|
+
return commands === 0 ? null : counted(commands);
|
|
70
|
+
}
|
|
71
|
+
export function jobsOf(markers, turn) {
|
|
72
|
+
const running = (turn === null ? [] : partsOf(turn.parts)).flatMap((part) => part.type === 'marker' && part.marker === 'job'
|
|
73
|
+
? [{ said: part.text, at: turn?.started ?? null }]
|
|
74
|
+
: []);
|
|
75
|
+
return openJobs([...markers, ...running]);
|
|
76
|
+
}
|
|
77
|
+
export function stillRunning(turns, subagents) {
|
|
78
|
+
const open = [];
|
|
79
|
+
for (const { turn, parts, ended } of turns) {
|
|
80
|
+
for (const part of parts) {
|
|
81
|
+
if (part.type === 'subagent') {
|
|
82
|
+
const key = `subagent\u0000${part.description}`;
|
|
83
|
+
if (part.done)
|
|
84
|
+
closeLast(open, key);
|
|
85
|
+
else if (ended) {
|
|
86
|
+
open.push({
|
|
87
|
+
turn,
|
|
88
|
+
key,
|
|
89
|
+
work: { kind: 'subagent', title: part.description, next: null, activity: null },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (part.type !== 'marker' || part.marker !== 'job')
|
|
95
|
+
continue;
|
|
96
|
+
markerMoved(open, part.text, (job, key) => ended
|
|
97
|
+
? {
|
|
98
|
+
turn,
|
|
99
|
+
key,
|
|
100
|
+
work: {
|
|
101
|
+
kind: job.kind === 'started' ? 'job' : 'schedule',
|
|
102
|
+
title: job.label,
|
|
103
|
+
next: job.next,
|
|
104
|
+
activity: null,
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
: null);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const doing = [...subagents];
|
|
111
|
+
const under = new Map();
|
|
112
|
+
for (const { turn, work } of open) {
|
|
113
|
+
const at = work.kind === 'subagent' ? doing.findIndex((one) => one.description === work.title) : -1;
|
|
114
|
+
const shown = at === -1 ? work : { ...work, activity: doing.splice(at, 1)[0].activity };
|
|
115
|
+
under.set(turn, [...(under.get(turn) ?? []), shown]);
|
|
116
|
+
}
|
|
117
|
+
return under;
|
|
118
|
+
}
|
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,93 +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
4
|
import type { Open } from './open.js';
|
|
5
|
-
export type Value = string | number | boolean | null;
|
|
6
|
-
export type Predicate = Value | {
|
|
7
|
-
$eq: Value;
|
|
8
|
-
} | {
|
|
9
|
-
$ne: Value;
|
|
10
|
-
} | {
|
|
11
|
-
$in: readonly Value[];
|
|
12
|
-
} | {
|
|
13
|
-
$nin: readonly Value[];
|
|
14
|
-
} | {
|
|
15
|
-
$gt?: Value;
|
|
16
|
-
$gte?: Value;
|
|
17
|
-
$lt?: Value;
|
|
18
|
-
$lte?: Value;
|
|
19
|
-
} | {
|
|
20
|
-
$all: readonly Value[];
|
|
21
|
-
} | {
|
|
22
|
-
$size: number;
|
|
23
|
-
} | {
|
|
24
|
-
$exists: boolean;
|
|
25
|
-
};
|
|
26
|
-
export type Where = {
|
|
27
|
-
$and?: readonly Where[];
|
|
28
|
-
$or?: readonly Where[];
|
|
29
|
-
[field: string]: Predicate | readonly Where[] | undefined;
|
|
30
|
-
};
|
|
31
|
-
export type Related = {
|
|
32
|
-
types?: readonly string[];
|
|
33
|
-
where?: Where;
|
|
34
|
-
pathPrefix?: string;
|
|
35
|
-
};
|
|
36
|
-
export type Filter = {
|
|
37
|
-
rooms?: readonly string[];
|
|
38
|
-
types?: readonly string[];
|
|
39
|
-
where?: Where;
|
|
40
|
-
pathPrefix?: string;
|
|
41
|
-
folder?: string;
|
|
42
|
-
paths?: readonly string[];
|
|
43
|
-
hop?: Related & {
|
|
44
|
-
field: string;
|
|
45
|
-
};
|
|
46
|
-
backlinks?: Related & {
|
|
47
|
-
field?: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
export type Key = 'room' | 'path' | 'type' | 'folder' | {
|
|
51
|
-
field: string;
|
|
52
|
-
};
|
|
53
|
-
export type Select = 'all' | {
|
|
54
|
-
fields?: 'all' | readonly string[];
|
|
55
|
-
sections?: 'all' | readonly string[];
|
|
56
|
-
preamble?: true;
|
|
57
|
-
markdown?: true;
|
|
58
|
-
backlinks?: true;
|
|
59
|
-
change?: true;
|
|
60
|
-
fileId?: true;
|
|
61
|
-
revision?: true;
|
|
62
|
-
};
|
|
63
|
-
export type OrderOptions = {
|
|
64
|
-
nulls?: 'first' | 'last';
|
|
65
|
-
stringSort?: 'lexical' | 'locale';
|
|
66
|
-
locale?: string;
|
|
67
|
-
localeOptions?: Readonly<Record<string, unknown>>;
|
|
68
|
-
};
|
|
69
|
-
export type Direction = 'asc' | 'desc';
|
|
70
|
-
export type DocumentQuery = Filter & {
|
|
71
|
-
select: Select;
|
|
72
|
-
orderBy?: readonly ({
|
|
73
|
-
by: Key;
|
|
74
|
-
direction?: Direction;
|
|
75
|
-
} & OrderOptions)[];
|
|
76
|
-
limit?: number;
|
|
77
|
-
after?: string;
|
|
78
|
-
total?: true;
|
|
79
|
-
};
|
|
80
|
-
export type GroupQuery = Filter & {
|
|
81
|
-
groupBy: readonly Exclude<Key, 'path'>[];
|
|
82
|
-
orderBy?: readonly {
|
|
83
|
-
by: 'count' | Exclude<Key, 'path'>;
|
|
84
|
-
direction?: Direction;
|
|
85
|
-
}[];
|
|
86
|
-
limit?: number;
|
|
87
|
-
after?: string;
|
|
88
|
-
total?: true;
|
|
89
|
-
};
|
|
90
|
-
export type LocalQuery = DocumentQuery | GroupQuery;
|
|
91
5
|
export type Backlink = {
|
|
92
6
|
path: string;
|
|
93
7
|
type: string;
|
|
@@ -106,10 +20,20 @@ export type QueryDocument = {
|
|
|
106
20
|
fileId?: string | null;
|
|
107
21
|
revision?: string | null;
|
|
108
22
|
binaryFile?: BinaryFileRecord;
|
|
23
|
+
size?: number | null;
|
|
24
|
+
created?: string | null;
|
|
25
|
+
};
|
|
26
|
+
export type GroupTotal = {
|
|
27
|
+
count: number;
|
|
28
|
+
size: number;
|
|
109
29
|
};
|
|
110
30
|
export type QueryGroup = {
|
|
111
31
|
key: readonly unknown[];
|
|
112
32
|
count: number;
|
|
33
|
+
documents?: GroupTotal;
|
|
34
|
+
files?: GroupTotal;
|
|
35
|
+
updated?: string | null;
|
|
36
|
+
greatest?: unknown;
|
|
113
37
|
};
|
|
114
38
|
export type CoveredRoom = {
|
|
115
39
|
room: string;
|
|
@@ -147,132 +71,19 @@ export type GroupResult = GroupRows & {
|
|
|
147
71
|
coverage: QueryCoverage;
|
|
148
72
|
};
|
|
149
73
|
export type QueryResult = DocumentResult | GroupResult | PendingResult;
|
|
150
|
-
export type
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
types: readonly Definition[];
|
|
155
|
-
};
|
|
156
|
-
export type HeldRooms = {
|
|
157
|
-
listed: boolean;
|
|
158
|
-
rooms: readonly RoomFacts[];
|
|
159
|
-
};
|
|
160
|
-
export type Test = {
|
|
161
|
-
op: 'eq';
|
|
162
|
-
value: Value;
|
|
163
|
-
} | {
|
|
164
|
-
op: 'ne';
|
|
165
|
-
value: Value;
|
|
166
|
-
} | {
|
|
167
|
-
op: 'in';
|
|
168
|
-
values: readonly Value[];
|
|
169
|
-
} | {
|
|
170
|
-
op: 'nin';
|
|
171
|
-
values: readonly Value[];
|
|
172
|
-
} | {
|
|
173
|
-
op: 'range';
|
|
174
|
-
bounds: readonly (readonly ['gt' | 'gte' | 'lt' | 'lte', Value])[];
|
|
175
|
-
} | {
|
|
176
|
-
op: 'all';
|
|
177
|
-
values: readonly Value[];
|
|
178
|
-
} | {
|
|
179
|
-
op: 'size';
|
|
180
|
-
size: number;
|
|
181
|
-
} | {
|
|
182
|
-
op: 'exists';
|
|
183
|
-
exists: boolean;
|
|
184
|
-
};
|
|
185
|
-
export type Condition = {
|
|
186
|
-
every: readonly Condition[];
|
|
187
|
-
} | {
|
|
188
|
-
some: readonly Condition[];
|
|
189
|
-
} | {
|
|
190
|
-
field: string;
|
|
191
|
-
test: Test;
|
|
192
|
-
};
|
|
193
|
-
export type Scope = {
|
|
194
|
-
types: readonly string[] | null;
|
|
195
|
-
where: Condition | null;
|
|
196
|
-
pathPrefix: string | null;
|
|
197
|
-
};
|
|
198
|
-
export type KeyPlan = {
|
|
199
|
-
of: 'room';
|
|
200
|
-
} | {
|
|
201
|
-
of: 'path';
|
|
202
|
-
} | {
|
|
203
|
-
of: 'type';
|
|
204
|
-
} | {
|
|
205
|
-
of: 'folder';
|
|
206
|
-
} | {
|
|
207
|
-
of: 'field';
|
|
208
|
-
field: string;
|
|
209
|
-
};
|
|
210
|
-
export type DocumentShape = {
|
|
211
|
-
kind: 'documents';
|
|
212
|
-
fields: 'all' | readonly string[] | null;
|
|
213
|
-
sections: 'all' | readonly string[] | null;
|
|
214
|
-
preamble: boolean;
|
|
215
|
-
markdown: boolean;
|
|
216
|
-
backlinks: boolean;
|
|
217
|
-
change: boolean;
|
|
218
|
-
fileId: boolean;
|
|
219
|
-
revision: boolean;
|
|
220
|
-
orderBy: readonly {
|
|
221
|
-
key: KeyPlan;
|
|
222
|
-
options: OrderOptions & {
|
|
223
|
-
direction: Direction;
|
|
224
|
-
};
|
|
225
|
-
}[];
|
|
226
|
-
};
|
|
227
|
-
export type GroupShape = {
|
|
228
|
-
kind: 'groups';
|
|
229
|
-
groupBy: readonly KeyPlan[];
|
|
230
|
-
orderBy: readonly {
|
|
231
|
-
by: 'count' | number;
|
|
232
|
-
direction: Direction;
|
|
233
|
-
}[];
|
|
74
|
+
export type PlanArea = {
|
|
75
|
+
room: string;
|
|
76
|
+
path: string;
|
|
77
|
+
open: readonly string[];
|
|
234
78
|
};
|
|
235
79
|
export type PlanReach = {
|
|
236
80
|
rooms: readonly string[];
|
|
237
81
|
documents: readonly string[];
|
|
82
|
+
areas: readonly PlanArea[];
|
|
238
83
|
};
|
|
239
|
-
export type
|
|
240
|
-
text: string;
|
|
241
|
-
values: readonly unknown[] | null;
|
|
242
|
-
};
|
|
243
|
-
export type Plan = {
|
|
244
|
-
key: string;
|
|
245
|
-
rooms: readonly string[] | null;
|
|
84
|
+
export type Plan = QueryPlan & {
|
|
246
85
|
reach: PlanReach | null;
|
|
247
86
|
locked: readonly string[];
|
|
248
|
-
root: Scope;
|
|
249
|
-
folder: string | null;
|
|
250
|
-
paths: readonly string[] | null;
|
|
251
|
-
hop: (Scope & {
|
|
252
|
-
field: string;
|
|
253
|
-
}) | null;
|
|
254
|
-
backlinks: (Scope & {
|
|
255
|
-
field: string | null;
|
|
256
|
-
}) | null;
|
|
257
|
-
shape: DocumentShape | GroupShape;
|
|
258
|
-
limit: number | null;
|
|
259
|
-
after: Continuation | null;
|
|
260
|
-
total: boolean;
|
|
261
87
|
};
|
|
262
|
-
export declare
|
|
263
|
-
readonly code: QueryErrorCode;
|
|
264
|
-
readonly retryable = false;
|
|
265
|
-
constructor(code: QueryErrorCode, at: string, problem: string);
|
|
266
|
-
}
|
|
267
|
-
type Entries = Readonly<Record<string, unknown>>;
|
|
268
|
-
export declare function invalid(at: string, problem: string): never;
|
|
269
|
-
export declare function plain(value: unknown): value is Entries;
|
|
270
|
-
export declare function known(value: Entries, allowed: readonly string[], at: string): void;
|
|
271
|
-
export declare function flag(input: unknown, at: string): boolean;
|
|
272
|
-
export declare function planOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
273
|
-
export declare function limitOf(input: unknown): number | null;
|
|
274
|
-
export declare function filterOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
275
|
-
export declare function queryKey(query: unknown): string;
|
|
276
|
-
export declare function identityOf(plan: Plan): string;
|
|
277
|
-
export {};
|
|
88
|
+
export declare function planWithin(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
278
89
|
//# sourceMappingURL=query.d.ts.map
|
package/dist/query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAA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