@agentshouse/mdruntime 0.1.0-c52f87bb83a70 → 0.1.0-c55c6f69061ee
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 +11 -9
- package/dist/adapter.d.ts +94 -63
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +2 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +28 -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 +16 -8
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +142 -94
- package/dist/change-set.d.ts +1 -7
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +1 -4
- package/dist/client.d.ts +10 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +54 -8
- package/dist/collection.d.ts +5 -3
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +24 -19
- package/dist/compile.d.ts +7 -2
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +125 -48
- package/dist/connection.d.ts +10 -10
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +1611 -1313
- 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 +17 -14
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +262 -159
- package/dist/durability.d.ts +1 -5
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +1 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +2 -1
- 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 +4 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +52 -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 +13 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- 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 +2 -1
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +9 -5
- 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 +10 -6
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +177 -100
- 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 +6 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -10
- 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 +13 -6
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +16 -5
- package/dist/overlay.js +1 -1
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -0
- package/dist/phrase.d.ts +3 -0
- package/dist/phrase.d.ts.map +1 -0
- package/dist/phrase.js +8 -0
- package/dist/query.d.ts +14 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +32 -2
- package/dist/reach.d.ts +13 -7
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +80 -64
- package/dist/react.d.ts +1 -0
- package/dist/react.d.ts.map +1 -1
- 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 +1 -0
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +26 -0
- package/dist/refresh.d.ts +10 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +104 -30
- package/dist/replica.d.ts +5 -5
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +7 -7
- package/dist/room-draft.d.ts +20 -3
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +131 -51
- package/dist/rows.d.ts +17 -7
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +120 -87
- package/dist/save.d.ts +2 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +13 -7
- package/dist/search.d.ts +12 -95
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -349
- package/dist/shared.d.ts +0 -1
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +0 -10
- 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 +34 -60
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +71 -275
- package/dist/stored.d.ts +42 -23
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +198 -210
- package/dist/tables.d.ts +79 -46
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +101 -53
- 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 +35 -96
- package/dist/wire.d.ts +6 -9
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +3 -3
- package/package.json +14 -18
- package/AGENTS.md +0 -310
- 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/earlier.d.ts +0 -10
- package/dist/chat/earlier.d.ts.map +0 -1
- package/dist/chat/earlier.js +0 -54
- package/dist/chat/house.d.ts +0 -25
- package/dist/chat/house.d.ts.map +0 -1
- package/dist/chat/house.js +0 -38
- package/dist/chat/input.d.ts +0 -11
- package/dist/chat/input.d.ts.map +0 -1
- package/dist/chat/input.js +0 -92
- package/dist/chat/kit.d.ts +0 -61
- 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 -28
- package/dist/chat/list.d.ts.map +0 -1
- package/dist/chat/list.js +0 -103
- package/dist/chat/markdown.d.ts +0 -21
- package/dist/chat/markdown.d.ts.map +0 -1
- package/dist/chat/markdown.js +0 -246
- package/dist/chat/message.d.ts +0 -7
- package/dist/chat/message.d.ts.map +0 -1
- package/dist/chat/message.js +0 -237
- package/dist/chat/messages.d.ts +0 -29
- package/dist/chat/messages.d.ts.map +0 -1
- package/dist/chat/messages.js +0 -190
- package/dist/chat/name.d.ts +0 -7
- package/dist/chat/name.d.ts.map +0 -1
- package/dist/chat/name.js +0 -37
- package/dist/chat/opened.d.ts +0 -12
- package/dist/chat/opened.d.ts.map +0 -1
- package/dist/chat/opened.js +0 -19
- package/dist/chat/overlay.d.ts +0 -32
- package/dist/chat/overlay.d.ts.map +0 -1
- package/dist/chat/overlay.js +0 -103
- package/dist/chat/parts.d.ts +0 -58
- package/dist/chat/parts.d.ts.map +0 -1
- package/dist/chat/parts.js +0 -120
- package/dist/chat/pieces.d.ts +0 -62
- package/dist/chat/pieces.d.ts.map +0 -1
- package/dist/chat/pieces.js +0 -1110
- 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 -68
- package/dist/chat/provider.d.ts.map +0 -1
- package/dist/chat/provider.js +0 -619
- package/dist/chat/question.d.ts +0 -9
- package/dist/chat/question.d.ts.map +0 -1
- package/dist/chat/question.js +0 -69
- 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 -37
- package/dist/chat/ready.d.ts.map +0 -1
- package/dist/chat/ready.js +0 -93
- package/dist/chat/room-file.d.ts +0 -8
- package/dist/chat/room-file.d.ts.map +0 -1
- package/dist/chat/room-file.js +0 -72
- package/dist/chat/steady.d.ts +0 -3
- package/dist/chat/steady.d.ts.map +0 -1
- package/dist/chat/steady.js +0 -26
- package/dist/chat/style.d.ts +0 -4
- package/dist/chat/style.d.ts.map +0 -1
- package/dist/chat/style.js +0 -306
- package/dist/chat.d.ts +0 -15
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js +0 -8
- package/dist/reads.d.ts +0 -11
- package/dist/reads.d.ts.map +0 -1
- package/dist/reads.js +0 -98
package/dist/collection.js
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import { parse, VERSION } from '@agentshouse/mdmodel';
|
|
2
2
|
import { beneath, normalize } from './paths.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { hashed } from './observation.js';
|
|
4
|
+
import { sortedKeys } from './shared.js';
|
|
5
5
|
export const MD_MODEL = { identity: '@agentshouse/mdmodel', version: VERSION };
|
|
6
|
+
const typesPrinted = new WeakMap();
|
|
7
|
+
function typesPrint(model) {
|
|
8
|
+
if (model.status === 'unavailable')
|
|
9
|
+
return '';
|
|
10
|
+
let print = typesPrinted.get(model.types);
|
|
11
|
+
if (print === undefined) {
|
|
12
|
+
print = hashed(JSON.stringify(model.types)).toString(36);
|
|
13
|
+
typesPrinted.set(model.types, print);
|
|
14
|
+
}
|
|
15
|
+
return print;
|
|
16
|
+
}
|
|
17
|
+
export function composedOf(composition) {
|
|
18
|
+
const { model, selection } = composition;
|
|
19
|
+
return {
|
|
20
|
+
composition,
|
|
21
|
+
fingerprint: JSON.stringify([
|
|
22
|
+
typesPrint(model),
|
|
23
|
+
selection === null ? null : [selection.roots, typesPrint(selection.model)],
|
|
24
|
+
]),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
6
27
|
export function selected(composition, path) {
|
|
7
28
|
return (composition.selection !== null &&
|
|
8
29
|
composition.selection.roots.some((root) => beneath(root, path)));
|
|
@@ -39,25 +60,9 @@ export function* documentsOf(collection) {
|
|
|
39
60
|
}
|
|
40
61
|
})();
|
|
41
62
|
}
|
|
42
|
-
export function* unreadable(text, paths = null) {
|
|
43
|
-
const named = paths ?? (yield* keysIn(text));
|
|
44
|
-
let least = null;
|
|
45
|
-
for (const path of named) {
|
|
46
|
-
const content = Object.hasOwn(text, path) ? text[path] : undefined;
|
|
47
|
-
if (content === undefined)
|
|
48
|
-
continue;
|
|
49
|
-
const read = parse(content, path);
|
|
50
|
-
if (!read.ok && (least === null || path < least.path)) {
|
|
51
|
-
least = { path, refused: { kind: 'refused', refusal: read.refusal } };
|
|
52
|
-
}
|
|
53
|
-
yield ROW_WEIGHT + content.length;
|
|
54
|
-
}
|
|
55
|
-
return least?.refused ?? null;
|
|
56
|
-
}
|
|
57
63
|
export function validRoot(root) {
|
|
58
64
|
return typeof root === 'string' && normalize(root) === root;
|
|
59
65
|
}
|
|
60
66
|
export function available(composition) {
|
|
61
|
-
return
|
|
62
|
-
(composition.selection === null || composition.selection.model.status !== 'unavailable'));
|
|
67
|
+
return composition.model.status !== 'unavailable';
|
|
63
68
|
}
|
package/dist/compile.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { Connection } from './tables.js';
|
|
1
|
+
import { type Plan, type QueryRows } from './query.js';
|
|
2
|
+
import type { Connection, Value } from './tables.js';
|
|
3
3
|
export type QueryRoom = {
|
|
4
4
|
readonly locator: string;
|
|
5
5
|
readonly key: number;
|
|
6
6
|
};
|
|
7
|
+
export type Fragment = {
|
|
8
|
+
readonly sql: string;
|
|
9
|
+
readonly bind: readonly Value[];
|
|
10
|
+
};
|
|
7
11
|
export type QueryAnswer = QueryRows & {
|
|
8
12
|
readonly more?: string;
|
|
9
13
|
};
|
|
14
|
+
export declare function selected(connection: Connection, plan: Plan, rooms: readonly QueryRoom[]): Fragment;
|
|
10
15
|
export declare function answerQuery(connection: Connection, plan: Plan, rooms: readonly QueryRoom[], budget?: number | null): QueryAnswer;
|
|
11
16
|
//# sourceMappingURL=compile.d.ts.map
|
package/dist/compile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,KAAK,IAAI,EAIT,KAAK,SAAS,EAIf,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,UAAU,EAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAU1D,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,CAAC;AAgtBjF,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAqTjE,wBAAgB,QAAQ,CACtB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,SAAS,EAAE,GAC1B,QAAQ,CAEV;AAED,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,GAAE,MAAM,GAAG,IAAW,GAC3B,WAAW,CAUb"}
|
package/dist/compile.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ARRAY_INDEX, parse, pointerSegments } from '@agentshouse/mdmodel';
|
|
2
2
|
import { binaryRecord } from './binary.js';
|
|
3
|
-
import {
|
|
3
|
+
import { bodied, } from './query.js';
|
|
4
|
+
import { documentKey, kindOf, pathOfKey, placedOf, roomOfKey } from './rows.js';
|
|
5
|
+
import { HOLDS_PHRASE } from './phrase.js';
|
|
4
6
|
import { byCodePoint, compared, cursorOf, FROM_START, MAXIMUM_WINDOW, } from './windows.js';
|
|
5
7
|
const VISIBLE = (alias) => `${alias}.visible = 1 AND ${alias}.present = 1 AND ${alias}.queried = 1`;
|
|
6
8
|
function fragment(sql, bind = []) {
|
|
@@ -12,11 +14,17 @@ function joined(parts, separator) {
|
|
|
12
14
|
bind: parts.flatMap((part) => part.bind),
|
|
13
15
|
};
|
|
14
16
|
}
|
|
17
|
+
function balanced(parts, separator) {
|
|
18
|
+
if (parts.length === 1)
|
|
19
|
+
return grouped(parts[0]);
|
|
20
|
+
const half = Math.ceil(parts.length / 2);
|
|
21
|
+
return grouped(joined([balanced(parts.slice(0, half), separator), balanced(parts.slice(half), separator)], separator));
|
|
22
|
+
}
|
|
15
23
|
function all(parts) {
|
|
16
|
-
return parts.length === 0 ? fragment('1') :
|
|
24
|
+
return parts.length === 0 ? fragment('1') : balanced(parts, ' AND ');
|
|
17
25
|
}
|
|
18
26
|
function any(parts) {
|
|
19
|
-
return parts.length === 0 ? fragment('0') :
|
|
27
|
+
return parts.length === 0 ? fragment('0') : balanced(parts, ' OR ');
|
|
20
28
|
}
|
|
21
29
|
function grouped(part) {
|
|
22
30
|
return { sql: `(${part.sql})`, bind: part.bind };
|
|
@@ -40,19 +48,31 @@ function same(alias, value) {
|
|
|
40
48
|
: fragment(`${alias}.kind = ? AND ${alias}.value = ?`, [held.kind, held.value]);
|
|
41
49
|
}
|
|
42
50
|
const BOUNDS = { gt: '>', gte: '>=', lt: '<', lte: '<=' };
|
|
51
|
+
function pointed(alias, field, reach) {
|
|
52
|
+
const { keys, places, glob } = placedOf(field, reach);
|
|
53
|
+
return fragment(`${alias}.keys = ? AND ${alias}.places ${glob ? 'GLOB' : '='} ?`, [keys, places]);
|
|
54
|
+
}
|
|
43
55
|
function heldValues(doc, field, alias, where) {
|
|
44
|
-
return
|
|
56
|
+
return joined([
|
|
57
|
+
fragment(`SELECT 1 FROM replica_values ${alias} WHERE ${alias}.doc = ${doc}.id AND `),
|
|
58
|
+
grouped(pointed(alias, field, 'value')),
|
|
59
|
+
fragment(' AND '),
|
|
60
|
+
grouped(where),
|
|
61
|
+
], '');
|
|
45
62
|
}
|
|
46
63
|
function exists(part) {
|
|
47
64
|
return { sql: `EXISTS (${part.sql})`, bind: part.bind };
|
|
48
65
|
}
|
|
49
|
-
function
|
|
66
|
+
function itemOf(held, where) {
|
|
67
|
+
return exists(joined([
|
|
68
|
+
fragment(`SELECT 1 FROM replica_values i WHERE i.doc = ${held}.doc AND i.keys = ${held}.keys AND i.places = ${held}.places AND i.item >= 0 AND `),
|
|
69
|
+
grouped(where),
|
|
70
|
+
], ''));
|
|
71
|
+
}
|
|
72
|
+
function matching(held, values) {
|
|
50
73
|
return any(values.map((value) => any([
|
|
51
74
|
same(held, value),
|
|
52
|
-
all([
|
|
53
|
-
fragment(`${held}.kind = 'array'`),
|
|
54
|
-
exists(heldValues(doc, field, 'i', all([fragment(`i.held = ${held}.held AND i.item >= 0`), same('i', value)]))),
|
|
55
|
-
]),
|
|
75
|
+
all([fragment(`${held}.kind = 'array'`), itemOf(held, same('i', value))]),
|
|
56
76
|
])));
|
|
57
77
|
}
|
|
58
78
|
function tested(doc, field, test) {
|
|
@@ -65,7 +85,7 @@ function tested(doc, field, test) {
|
|
|
65
85
|
}
|
|
66
86
|
if (test.op === 'ne' || test.op === 'nin') {
|
|
67
87
|
const values = test.op === 'ne' ? [test.value] : test.values;
|
|
68
|
-
const unmatched = matching('h',
|
|
88
|
+
const unmatched = matching('h', values);
|
|
69
89
|
return any([
|
|
70
90
|
fragment(`NOT ${reached.sql}`, reached.bind),
|
|
71
91
|
exists(heldValues(doc, field, 'h', all([fragment('h.item = -1'), fragment(`NOT (${unmatched.sql})`, unmatched.bind)]))),
|
|
@@ -86,7 +106,7 @@ function tested(doc, field, test) {
|
|
|
86
106
|
if (test.op === 'all') {
|
|
87
107
|
return exists(heldValues(doc, field, 'h', all([
|
|
88
108
|
fragment("h.item = -1 AND h.kind = 'array'"),
|
|
89
|
-
...test.values.map((value) =>
|
|
109
|
+
...test.values.map((value) => itemOf('h', same('i', value))),
|
|
90
110
|
])));
|
|
91
111
|
}
|
|
92
112
|
return exists(heldValues(doc, field, 'v', fragment("v.item = -1 AND v.kind = 'array' AND v.size = ?", [test.size])));
|
|
@@ -98,10 +118,33 @@ function conditioned(doc, condition) {
|
|
|
98
118
|
return any(condition.some.map((one) => conditioned(doc, one)));
|
|
99
119
|
return tested(doc, condition.field, condition.test);
|
|
100
120
|
}
|
|
101
|
-
function located(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
function located(alias) {
|
|
122
|
+
return fragment(`(SELECT k.locator FROM replica_keys k WHERE k.key = ${alias}.key)`);
|
|
123
|
+
}
|
|
124
|
+
function within(alias, path) {
|
|
125
|
+
return fragment(`(${alias}.path = ? OR (${alias}.path >= ? AND ${alias}.path < ?))`, [
|
|
126
|
+
path,
|
|
127
|
+
`${path}/`,
|
|
128
|
+
`${path}0`,
|
|
129
|
+
]);
|
|
130
|
+
}
|
|
131
|
+
function ancestors(area) {
|
|
132
|
+
const depth = area.path.split('/').length;
|
|
133
|
+
return area.open.flatMap((open) => {
|
|
134
|
+
const segments = open.split('/');
|
|
135
|
+
return segments.slice(depth - 1, -1).map((_, at) => segments.slice(0, depth + at).join('/'));
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function fenced(alias, key, area, folders) {
|
|
139
|
+
const opened = any([
|
|
140
|
+
...area.open.map((open) => within(alias, open)),
|
|
141
|
+
...(folders ? ancestors(area).map((path) => fragment(`${alias}.path = ?`, [path])) : []),
|
|
142
|
+
]);
|
|
143
|
+
return all([
|
|
144
|
+
fragment(`${alias}.key = ?`, [key]),
|
|
145
|
+
within(alias, area.path),
|
|
146
|
+
fragment(`NOT ${grouped(opened).sql}`, opened.bind),
|
|
147
|
+
]);
|
|
105
148
|
}
|
|
106
149
|
function reached(bound, alias) {
|
|
107
150
|
const reach = bound.reach;
|
|
@@ -115,20 +158,29 @@ function reached(bound, alias) {
|
|
|
115
158
|
const key = bound.keys.get(roomOfKey(held));
|
|
116
159
|
return key === undefined ? [] : [[key, pathOfKey(held)]];
|
|
117
160
|
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
]),
|
|
161
|
+
const outside = any(reach.areas.flatMap((area) => {
|
|
162
|
+
const key = bound.keys.get(area.room);
|
|
163
|
+
return key === undefined ? [] : [fenced(alias, key, area, false)];
|
|
164
|
+
}));
|
|
165
|
+
return all([
|
|
166
|
+
any([
|
|
167
|
+
...(rooms.length === 0 ? [] : [fragment(`${alias}.key IN ${list(rooms).sql}`, rooms)]),
|
|
168
|
+
...(documents.length === 0
|
|
169
|
+
? []
|
|
170
|
+
: [
|
|
171
|
+
fragment(`EXISTS (SELECT 1 FROM json_each(?) j WHERE j.value ->> 0 = ${alias}.key AND j.value ->> 1 = ${alias}.path)`, [JSON.stringify(documents)]),
|
|
172
|
+
]),
|
|
173
|
+
]),
|
|
174
|
+
...(reach.areas.length === 0 ? [] : [fragment(`NOT ${grouped(outside).sql}`, outside.bind)]),
|
|
125
175
|
]);
|
|
126
176
|
}
|
|
127
|
-
function
|
|
177
|
+
function unindexed(column) {
|
|
178
|
+
return `+${column}`;
|
|
179
|
+
}
|
|
180
|
+
function scoped(alias, scope, byPaths = false) {
|
|
181
|
+
const type = byPaths ? unindexed(`${alias}.type`) : `${alias}.type`;
|
|
128
182
|
return all([
|
|
129
|
-
...(scope.types === null
|
|
130
|
-
? []
|
|
131
|
-
: [fragment(`${alias}.type IN ${list(scope.types).sql}`, scope.types)]),
|
|
183
|
+
...(scope.types === null ? [] : [fragment(`${type} IN ${list(scope.types).sql}`, scope.types)]),
|
|
132
184
|
...(scope.pathPrefix === null || scope.pathPrefix === ''
|
|
133
185
|
? []
|
|
134
186
|
: [
|
|
@@ -144,14 +196,17 @@ function related(bound, plan) {
|
|
|
144
196
|
const parts = [];
|
|
145
197
|
if (plan.hop !== null) {
|
|
146
198
|
parts.push(exists(joined([
|
|
147
|
-
fragment(`SELECT 1 FROM replica_links l JOIN replica_entries m ON m.key = d.key AND m.path = l.target AND ${VISIBLE('m')} WHERE l.doc = d.id AND l.kind = 'field' AND
|
|
199
|
+
fragment(`SELECT 1 FROM replica_links l JOIN replica_entries m ON m.key = d.key AND m.path = l.target AND ${VISIBLE('m')} WHERE l.doc = d.id AND l.kind = 'field' AND`),
|
|
200
|
+
grouped(pointed('l', plan.hop.field, 'link')),
|
|
201
|
+
fragment('AND'),
|
|
148
202
|
grouped(all([scoped('m', plan.hop), reached(bound, 'm')])),
|
|
149
203
|
], ' ')));
|
|
150
204
|
}
|
|
151
205
|
if (plan.backlinks !== null) {
|
|
152
206
|
const field = plan.backlinks.field;
|
|
153
207
|
parts.push(exists(joined([
|
|
154
|
-
fragment(`SELECT 1 FROM replica_links l JOIN replica_entries s ON s.id = l.doc AND ${VISIBLE('s')} WHERE l.key = d.key AND l.target = d.path AND l.kind = 'field'
|
|
208
|
+
fragment(`SELECT 1 FROM replica_links l JOIN replica_entries s ON s.id = l.doc AND ${VISIBLE('s')} WHERE l.key = d.key AND l.target = d.path AND l.kind = 'field' AND`),
|
|
209
|
+
...(field === null ? [] : [grouped(pointed('l', field, 'link')), fragment('AND')]),
|
|
155
210
|
grouped(all([scoped('s', plan.backlinks), reached(bound, 's')])),
|
|
156
211
|
], ' ')));
|
|
157
212
|
}
|
|
@@ -164,8 +219,11 @@ function filtered(bound, plan) {
|
|
|
164
219
|
...(plan.paths === null ? [] : [fragment(`d.path IN ${list(plan.paths).sql}`, plan.paths)]),
|
|
165
220
|
...(plan.folder === null ? [] : [fragment('d.folder = ?', [plan.folder])]),
|
|
166
221
|
reached(bound, 'd'),
|
|
167
|
-
scoped('d', plan.root),
|
|
222
|
+
scoped('d', plan.root, plan.paths !== null),
|
|
168
223
|
...related(bound, plan),
|
|
224
|
+
...(plan.text === null
|
|
225
|
+
? []
|
|
226
|
+
: [fragment(`${HOLDS_PHRASE}(d.content, ?)`, [plan.text.toLowerCase()])]),
|
|
169
227
|
]);
|
|
170
228
|
}
|
|
171
229
|
function orderingOf(options) {
|
|
@@ -278,16 +336,20 @@ function following(parts, tie) {
|
|
|
278
336
|
}
|
|
279
337
|
return condition;
|
|
280
338
|
}
|
|
281
|
-
function keyTerm(
|
|
339
|
+
function keyTerm(key, ordering, index) {
|
|
282
340
|
if (key.of === 'field') {
|
|
283
341
|
const alias = `o${index}`;
|
|
284
342
|
return {
|
|
285
343
|
term: { ordering, kind: fragment(`${alias}.kind`), value: fragment(`${alias}.value`) },
|
|
286
|
-
join:
|
|
344
|
+
join: joined([
|
|
345
|
+
fragment(`LEFT JOIN replica_values ${alias} ON ${alias}.doc = d.id AND `),
|
|
346
|
+
grouped(pointed(alias, key.field, 'exact')),
|
|
347
|
+
fragment(` AND ${alias}.item = -1 AND ${alias}.kind NOT IN ('object', 'undefined')`),
|
|
348
|
+
], ''),
|
|
287
349
|
};
|
|
288
350
|
}
|
|
289
351
|
const expression = key.of === 'room'
|
|
290
|
-
? located(
|
|
352
|
+
? located('d')
|
|
291
353
|
: key.of === 'path'
|
|
292
354
|
? fragment('d.path')
|
|
293
355
|
: key.of === 'type'
|
|
@@ -369,9 +431,6 @@ function collating(connection) {
|
|
|
369
431
|
return name;
|
|
370
432
|
};
|
|
371
433
|
}
|
|
372
|
-
function bodied(shape) {
|
|
373
|
-
return shape.sections !== null || shape.preamble || shape.markdown;
|
|
374
|
-
}
|
|
375
434
|
function masked(pointers) {
|
|
376
435
|
const root = { whole: false, members: new Map() };
|
|
377
436
|
for (const pointer of pointers) {
|
|
@@ -427,24 +486,26 @@ function documentOf(shape, room, row, linked) {
|
|
|
427
486
|
const path = row.path;
|
|
428
487
|
const type = row.type;
|
|
429
488
|
const fileId = row.file_id ?? null;
|
|
489
|
+
const revision = row.revision ?? null;
|
|
490
|
+
const content = row.content ?? null;
|
|
491
|
+
const unheld = Number(row.unheld) === 1 ? { textHeld: false } : {};
|
|
430
492
|
if (type === null) {
|
|
431
493
|
const binary = row.binary === null ? null : JSON.parse(row.binary);
|
|
432
|
-
const content = row.content ?? null;
|
|
433
494
|
return {
|
|
434
495
|
room,
|
|
435
496
|
path,
|
|
436
497
|
...(binary === null
|
|
437
498
|
? {}
|
|
438
499
|
: {
|
|
439
|
-
binaryFile: binaryRecord(path, binary,
|
|
500
|
+
binaryFile: binaryRecord(path, binary, revision ?? undefined),
|
|
440
501
|
}),
|
|
441
|
-
...(shape.markdown && content !== null
|
|
442
|
-
|
|
443
|
-
: {}),
|
|
502
|
+
...(shape.markdown && content !== null ? { markdown: content } : {}),
|
|
503
|
+
...unheld,
|
|
444
504
|
...(shape.fileId ? { fileId } : {}),
|
|
505
|
+
...(shape.revision ? { revision } : {}),
|
|
445
506
|
};
|
|
446
507
|
}
|
|
447
|
-
const read = bodied(shape) ? parse(
|
|
508
|
+
const read = bodied(shape) && content !== null ? parse(content, path) : null;
|
|
448
509
|
const body = read?.ok === true ? read.document : null;
|
|
449
510
|
const fields = JSON.parse(row.fields ?? '{}');
|
|
450
511
|
return {
|
|
@@ -462,7 +523,8 @@ function documentOf(shape, room, row, linked) {
|
|
|
462
523
|
? {}
|
|
463
524
|
: { sections: sectionsOf(body.sections, shape.sections) }),
|
|
464
525
|
...(shape.preamble && body !== null ? { preamble: body.preamble } : {}),
|
|
465
|
-
...(shape.markdown &&
|
|
526
|
+
...(shape.markdown && content !== null ? { markdown: content } : {}),
|
|
527
|
+
...unheld,
|
|
466
528
|
...(shape.backlinks ? { backlinks: linked.get(documentKey(room, path)) ?? [] } : {}),
|
|
467
529
|
...(shape.change
|
|
468
530
|
? {
|
|
@@ -470,6 +532,7 @@ function documentOf(shape, room, row, linked) {
|
|
|
470
532
|
}
|
|
471
533
|
: {}),
|
|
472
534
|
...(shape.fileId ? { fileId } : {}),
|
|
535
|
+
...(shape.revision ? { revision } : {}),
|
|
473
536
|
};
|
|
474
537
|
}
|
|
475
538
|
function backlinksOf(connection, bound, rows) {
|
|
@@ -495,10 +558,10 @@ function backlinksOf(connection, bound, rows) {
|
|
|
495
558
|
return linked;
|
|
496
559
|
}
|
|
497
560
|
function documents(connection, bound, plan, shape, budget) {
|
|
498
|
-
const terms = shape.orderBy.map(({ key, options }, index) => keyTerm(
|
|
561
|
+
const terms = shape.orderBy.map(({ key, options }, index) => keyTerm(key, orderingOf(options), index));
|
|
499
562
|
const filter = filtered(bound, plan);
|
|
500
563
|
const cursor = plan.after?.values ?? null;
|
|
501
|
-
const room = located(
|
|
564
|
+
const room = located('d');
|
|
502
565
|
const tie = cursor === null
|
|
503
566
|
? null
|
|
504
567
|
: (() => {
|
|
@@ -516,7 +579,7 @@ function documents(connection, bound, plan, shape, budget) {
|
|
|
516
579
|
? null
|
|
517
580
|
: following(terms.map(({ term }, index) => beyond(bound, term, cursor[index])), tie);
|
|
518
581
|
const selected = joined([
|
|
519
|
-
fragment('SELECT d.id, d.key, d.path, d.type, d.binary, d.revision, d.fields, d.change, d.file_id'),
|
|
582
|
+
fragment('SELECT d.id, d.key, d.path, d.type, d.binary, d.revision, d.fields, d.change, d.file_id, d.content IS NULL AND d.outline IS NOT NULL AS unheld'),
|
|
520
583
|
...terms.map(({ term }, index) => joined([
|
|
521
584
|
fragment(`, ${term.kind.sql} AS k${index}`, term.kind.bind),
|
|
522
585
|
fragment(`, ${term.value.sql} AS v${index}`, term.value.bind),
|
|
@@ -592,8 +655,16 @@ function storedFolders(bound, plan) {
|
|
|
592
655
|
return null;
|
|
593
656
|
const keys = whole.map(({ key }) => key);
|
|
594
657
|
const prefix = plan.root.pathPrefix;
|
|
658
|
+
const outside = (bound.reach?.areas ?? []).flatMap((area) => {
|
|
659
|
+
const key = bound.keys.get(area.room);
|
|
660
|
+
if (key === undefined)
|
|
661
|
+
return [];
|
|
662
|
+
const fence = fenced('f', key, area, true);
|
|
663
|
+
return [fragment(`NOT ${grouped(fence).sql}`, fence.bind)];
|
|
664
|
+
});
|
|
595
665
|
return all([
|
|
596
666
|
fragment(`f.key IN ${list(keys).sql} AND f.layer = 0 AND f.present = 1`, keys),
|
|
667
|
+
...outside,
|
|
597
668
|
...(prefix === null || prefix === ''
|
|
598
669
|
? []
|
|
599
670
|
: [
|
|
@@ -608,7 +679,7 @@ function storedFolders(bound, plan) {
|
|
|
608
679
|
}
|
|
609
680
|
function groups(connection, bound, plan, shape) {
|
|
610
681
|
const keyed = shape.groupBy.map((key, index) => {
|
|
611
|
-
const { term, join } = keyTerm(
|
|
682
|
+
const { term, join } = keyTerm(key, GROUP_ORDER, index);
|
|
612
683
|
const kind = fragment(`COALESCE(${term.kind.sql}, 'null')`, term.kind.bind);
|
|
613
684
|
return { term: { ...term, kind }, join };
|
|
614
685
|
});
|
|
@@ -694,13 +765,19 @@ function groups(connection, bound, plan, shape) {
|
|
|
694
765
|
...(total === undefined ? {} : { total }),
|
|
695
766
|
};
|
|
696
767
|
}
|
|
697
|
-
|
|
698
|
-
|
|
768
|
+
function boundOf(connection, plan, rooms) {
|
|
769
|
+
return {
|
|
699
770
|
rooms: [...rooms].sort((left, right) => left.locator < right.locator ? -1 : left.locator > right.locator ? 1 : 0),
|
|
700
771
|
keys: new Map(rooms.map(({ locator, key }) => [locator, key])),
|
|
701
772
|
reach: plan.reach,
|
|
702
773
|
collate: collating(connection),
|
|
703
774
|
};
|
|
775
|
+
}
|
|
776
|
+
export function selected(connection, plan, rooms) {
|
|
777
|
+
return filtered(boundOf(connection, plan, rooms), plan);
|
|
778
|
+
}
|
|
779
|
+
export function answerQuery(connection, plan, rooms, budget = null) {
|
|
780
|
+
const bound = boundOf(connection, plan, rooms);
|
|
704
781
|
if (rooms.length === 0) {
|
|
705
782
|
return plan.shape.kind === 'groups'
|
|
706
783
|
? { groups: [], ...(plan.total ? { total: 0 } : {}) }
|
package/dist/connection.d.ts
CHANGED
|
@@ -7,14 +7,13 @@ import { type Adapter, type Authorization, type Member, type ProviderRefusal, ty
|
|
|
7
7
|
import { type ChatDraftSurface, type ConversationAgent, type ConversationEntry, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
|
|
8
8
|
import { type WrittenBy } from './change.js';
|
|
9
9
|
import type { Open } from './open.js';
|
|
10
|
-
import { type
|
|
11
|
-
import { type BinaryLinkAnswer, type CallResult, type HeldBinaryAnswer, type HistoryAnswer, type QueueEntry, type Resolution } from './outcome.js';
|
|
10
|
+
import { type AttachAnswer, type BinaryLinkAnswer, type CallResult, type HeldBinaryAnswer, type HeldShownAnswer, type HistoryAnswer, type QueueEntry, type Resolution } from './outcome.js';
|
|
12
11
|
import { type Recovery } from './recovery.js';
|
|
13
12
|
import { type SaveRefusal } from './save.js';
|
|
14
13
|
import { type RoomDraft, type RoomDraftParts, type RoomDraftWrite } from './room-draft.js';
|
|
15
14
|
import { type SyncStatus } from './status.js';
|
|
16
15
|
import { type RuntimeShell } from './durability.js';
|
|
17
|
-
import { type
|
|
16
|
+
import { type CodeAvailability, type Persistence, type Readiness, type Space } from './readiness.js';
|
|
18
17
|
import type { RuntimeDatabase } from './tables.js';
|
|
19
18
|
import { type NarrowedView, type PortReach, type RuntimeView } from './reach.js';
|
|
20
19
|
export type AppTypedSelection = {
|
|
@@ -55,6 +54,7 @@ export type MdRuntimeOptions = {
|
|
|
55
54
|
authorization?: Authorization;
|
|
56
55
|
signal?: AbortSignal;
|
|
57
56
|
recovery?: Recovery;
|
|
57
|
+
usableWhenHeld?: readonly string[];
|
|
58
58
|
};
|
|
59
59
|
export type SaveResult = {
|
|
60
60
|
outcome: 'saved';
|
|
@@ -73,7 +73,7 @@ export type SavedParts = {
|
|
|
73
73
|
export type RoomDraftSurface = {
|
|
74
74
|
list(): Promise<readonly RoomDraft[]>;
|
|
75
75
|
read(room: string, path: string): Promise<RoomDraft | null>;
|
|
76
|
-
write(room: string, path: string, revision: string | null, parts: unknown): Promise<RoomDraftWrite>;
|
|
76
|
+
write(room: string, path: string, revision: string | null, parts: unknown, next?: string): Promise<RoomDraftWrite>;
|
|
77
77
|
discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
|
|
78
78
|
};
|
|
79
79
|
export type PresentationSurface = {
|
|
@@ -84,7 +84,8 @@ export type PresentationSurface = {
|
|
|
84
84
|
export type BinaryFileSurface = {
|
|
85
85
|
read(room: string, path: string, revision?: string): Promise<HeldBinaryAnswer>;
|
|
86
86
|
link(room: string, path: string, revision?: string): Promise<BinaryLinkAnswer>;
|
|
87
|
-
|
|
87
|
+
show(room: string, path: string, revision?: string): Promise<HeldShownAnswer>;
|
|
88
|
+
attach(room: string, file: File): Promise<AttachAnswer>;
|
|
88
89
|
part(file: string, part: number): Promise<Uint8Array | null>;
|
|
89
90
|
};
|
|
90
91
|
export type HistoryQuery = {
|
|
@@ -93,7 +94,7 @@ export type HistoryQuery = {
|
|
|
93
94
|
};
|
|
94
95
|
export type MdRuntime = {
|
|
95
96
|
loaded(): Promise<void>;
|
|
96
|
-
rooms(): readonly AppRoom[]
|
|
97
|
+
rooms(): Promise<readonly AppRoom[]>;
|
|
97
98
|
query: {
|
|
98
99
|
(query: DocumentQuery): Promise<DocumentResult | PendingResult>;
|
|
99
100
|
(query: GroupQuery): Promise<GroupResult | PendingResult>;
|
|
@@ -123,6 +124,7 @@ export type MdRuntime = {
|
|
|
123
124
|
(topic: 'sync-status'): Promise<Observation<SyncStatus>>;
|
|
124
125
|
(topic: 'service-mode'): Promise<Observation<ServiceMode>>;
|
|
125
126
|
(topic: 'member'): Promise<Observation<Member | null>>;
|
|
127
|
+
(topic: 'authority-changes'): Promise<Observation<number>>;
|
|
126
128
|
(topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult | PendingResult>>;
|
|
127
129
|
(topic: 'query', query: GroupQuery): Promise<Observation<GroupResult | PendingResult>>;
|
|
128
130
|
(topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;
|
|
@@ -134,17 +136,15 @@ export type MdRuntime = {
|
|
|
134
136
|
};
|
|
135
137
|
reauthorize(): Promise<void>;
|
|
136
138
|
};
|
|
137
|
-
export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents';
|
|
139
|
+
export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'authority-changes' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents';
|
|
138
140
|
export type ReadinessPort = {
|
|
139
141
|
readonly target: string;
|
|
140
142
|
readonly code: CodeAvailability;
|
|
141
|
-
readonly
|
|
142
|
-
readonly search: SearchObligation;
|
|
143
|
+
readonly space: Space | null;
|
|
143
144
|
};
|
|
144
145
|
export type ComposedRuntime = RuntimeView & {
|
|
145
146
|
seed(entry: EntrySeed): void;
|
|
146
147
|
stop(): Promise<void>;
|
|
147
|
-
lose(locators: readonly string[]): Promise<void>;
|
|
148
148
|
persisted(answer: Persistence): void;
|
|
149
149
|
within(reach: PortReach | null, port: ReadinessPort): NarrowedView;
|
|
150
150
|
};
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAoB,KAAK,WAAW,EAAqB,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAOL,KAAK,aAAa,E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