@agentshouse/mdruntime 0.1.0-c3903a68dcbbf → 0.1.0-c5b50992a4193
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +75 -41
- package/README.md +11 -11
- package/dist/adapter.d.ts +81 -51
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +1 -9
- package/dist/attached-model.d.ts +11 -0
- package/dist/attached-model.d.ts.map +1 -0
- package/dist/attached-model.js +47 -0
- package/dist/bootstrap.d.ts +5 -3
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +3 -3
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +2 -6
- package/dist/client.d.ts +4 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -16
- package/dist/collection.d.ts +0 -2
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +2 -12
- package/dist/connection.d.ts +11 -28
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +535 -643
- package/dist/conversation.d.ts +22 -11
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +250 -105
- package/dist/host.d.ts +7 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +37 -57
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/memory.d.ts +11 -5
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +84 -27
- package/dist/model.d.ts +11 -11
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -3
- package/dist/observation.d.ts +2 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +24 -14
- package/dist/outcome.d.ts +5 -21
- package/dist/outcome.d.ts.map +1 -1
- package/dist/paths.d.ts +0 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +0 -16
- package/dist/query.d.ts +8 -3
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +75 -36
- package/dist/reach.d.ts +40 -0
- package/dist/reach.d.ts.map +1 -0
- package/dist/reach.js +270 -0
- package/dist/react.d.ts +32 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +62 -0
- package/dist/read-side.d.ts +4 -0
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +116 -54
- package/dist/refresh.d.ts +2 -1
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +7 -3
- package/dist/replica.d.ts +5 -5
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +16 -21
- package/dist/room-draft.d.ts +3 -0
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +6 -4
- package/dist/rows.d.ts +2 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +75 -38
- package/dist/save.d.ts +1 -2
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +92 -51
- package/dist/store.d.ts +6 -16
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +10 -32
- package/dist/wire.d.ts +51 -16
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +50 -65
- package/package.json +14 -2
package/dist/observation.js
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
export function rowsOf(result) {
|
|
2
2
|
return 'groups' in result ? result.groups : result.documents;
|
|
3
3
|
}
|
|
4
|
+
export function applied(keyed, change) {
|
|
5
|
+
const rows = rowsOf(keyed.result);
|
|
6
|
+
const byKey = new Map(keyed.keys.map((key, index) => [key, rows[index]]));
|
|
7
|
+
for (const key of change.removed)
|
|
8
|
+
byKey.delete(key);
|
|
9
|
+
for (const [key, row] of change.changed)
|
|
10
|
+
byKey.set(key, row);
|
|
11
|
+
const keys = change.order ?? keyed.keys.filter((key) => byKey.has(key));
|
|
12
|
+
const next = keys.map((key) => byKey.get(key));
|
|
13
|
+
return {
|
|
14
|
+
result: 'groups' in keyed.result
|
|
15
|
+
? { groups: next }
|
|
16
|
+
: { documents: next },
|
|
17
|
+
keys,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
4
20
|
function keyedResult(first) {
|
|
5
|
-
|
|
6
|
-
const rows = rowsOf(first.result);
|
|
7
|
-
const byKey = new Map(first.keys.map((key, index) => [key, rows[index]]));
|
|
8
|
-
let keys = first.keys;
|
|
21
|
+
let keyed = first;
|
|
9
22
|
return {
|
|
10
23
|
value: first.result,
|
|
11
24
|
next(message) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
byKey.delete(key);
|
|
15
|
-
for (const [key, row] of change.changed)
|
|
16
|
-
byKey.set(key, row);
|
|
17
|
-
keys = change.order ?? keys.filter((key) => byKey.has(key));
|
|
18
|
-
const next = keys.map((key) => byKey.get(key));
|
|
19
|
-
return grouped
|
|
20
|
-
? { groups: next }
|
|
21
|
-
: { documents: next };
|
|
25
|
+
keyed = applied(keyed, message);
|
|
26
|
+
return keyed.result;
|
|
22
27
|
},
|
|
23
28
|
};
|
|
24
29
|
}
|
|
@@ -83,3 +88,8 @@ export function opened(watch, keyed) {
|
|
|
83
88
|
}
|
|
84
89
|
});
|
|
85
90
|
}
|
|
91
|
+
export function observing(watch) {
|
|
92
|
+
return (topic, ...input) => opened((deliver) => watch(topic, input, (message) => {
|
|
93
|
+
deliver(structuredClone(message));
|
|
94
|
+
}), topic === 'query');
|
|
95
|
+
}
|
package/dist/outcome.d.ts
CHANGED
|
@@ -1,27 +1,8 @@
|
|
|
1
|
-
import type { ActionResult
|
|
1
|
+
import type { ActionResult } from './adapter.js';
|
|
2
2
|
import type { ChangeBatch } from './change.js';
|
|
3
|
-
export type AffectedState = Readonly<Record<string, string>>;
|
|
4
3
|
export type CallResult = ActionResult | {
|
|
5
4
|
kind: 'undeclared';
|
|
6
5
|
};
|
|
7
|
-
export type AcceptedOutcome = {
|
|
8
|
-
kind: 'accepted';
|
|
9
|
-
roomVersion: string;
|
|
10
|
-
author?: string;
|
|
11
|
-
time?: string;
|
|
12
|
-
};
|
|
13
|
-
export type SubmissionOutcome = AcceptedOutcome | (ProviderRefusal & {
|
|
14
|
-
kind: 'conflicted';
|
|
15
|
-
roomVersion?: string;
|
|
16
|
-
affected: AffectedState;
|
|
17
|
-
}) | (ProviderRefusal & {
|
|
18
|
-
kind: 'rejected';
|
|
19
|
-
affected: AffectedState;
|
|
20
|
-
}) | {
|
|
21
|
-
kind: 'expired';
|
|
22
|
-
} | {
|
|
23
|
-
kind: 'withdrawn';
|
|
24
|
-
};
|
|
25
6
|
export type Submission = {
|
|
26
7
|
readonly state: 'waiting' | 'submitted';
|
|
27
8
|
} | {
|
|
@@ -30,5 +11,8 @@ export type Submission = {
|
|
|
30
11
|
};
|
|
31
12
|
export type QueueEntry = {
|
|
32
13
|
readonly batch: ChangeBatch;
|
|
33
|
-
} & Submission
|
|
14
|
+
} & (Submission | {
|
|
15
|
+
readonly state: 'accepted';
|
|
16
|
+
readonly roomVersion: string;
|
|
17
|
+
});
|
|
34
18
|
//# sourceMappingURL=outcome.d.ts.map
|
package/dist/outcome.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../src/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../src/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAE/D,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,WAAW,CAAA;CAAE,GAC3C;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAAG,CACvD,UAAU,GACV;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAC/D,CAAC"}
|
package/dist/paths.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare function normalize(path: string): string | null;
|
|
2
|
-
export declare function relative(from: string, target: string): string;
|
|
3
2
|
export declare function beneath(prefix: string, path: string): boolean;
|
|
4
3
|
export declare function covered(prefixes: readonly string[], path: string): boolean;
|
|
5
4
|
//# 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":"
|
|
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"}
|
package/dist/paths.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
function dirname(path) {
|
|
2
|
-
const index = path.lastIndexOf('/');
|
|
3
|
-
return index === -1 ? '' : path.slice(0, index);
|
|
4
|
-
}
|
|
5
1
|
export function normalize(path) {
|
|
6
2
|
const parts = [];
|
|
7
3
|
for (const part of path.split('/')) {
|
|
@@ -17,18 +13,6 @@ export function normalize(path) {
|
|
|
17
13
|
}
|
|
18
14
|
return parts.join('/');
|
|
19
15
|
}
|
|
20
|
-
export function relative(from, target) {
|
|
21
|
-
const base = dirname(from)
|
|
22
|
-
.split('/')
|
|
23
|
-
.filter((part) => part !== '');
|
|
24
|
-
const parts = target.split('/');
|
|
25
|
-
let shared = 0;
|
|
26
|
-
while (shared < base.length && shared + 1 < parts.length && base[shared] === parts[shared]) {
|
|
27
|
-
shared += 1;
|
|
28
|
-
}
|
|
29
|
-
const up = Array.from({ length: base.length - shared }, () => '..');
|
|
30
|
-
return [...up, ...parts.slice(shared)].join('/');
|
|
31
|
-
}
|
|
32
16
|
export function beneath(prefix, path) {
|
|
33
17
|
return path === prefix || path.startsWith(`${prefix}/`);
|
|
34
18
|
}
|
package/dist/query.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Definition } from '@agentshouse/mdmodel';
|
|
2
2
|
import type { HeadChange } from './adapter.js';
|
|
3
3
|
export type Value = string | number | boolean | null;
|
|
4
4
|
export type Predicate = Value | {
|
|
@@ -186,8 +186,13 @@ export type GroupShape = {
|
|
|
186
186
|
direction: Direction;
|
|
187
187
|
}[];
|
|
188
188
|
};
|
|
189
|
+
export type PlanReach = {
|
|
190
|
+
rooms: readonly string[];
|
|
191
|
+
documents: readonly string[];
|
|
192
|
+
};
|
|
189
193
|
export type Plan = {
|
|
190
194
|
rooms: readonly string[] | null;
|
|
195
|
+
reach: PlanReach | null;
|
|
191
196
|
root: Scope;
|
|
192
197
|
hop: (Scope & {
|
|
193
198
|
field: string;
|
|
@@ -205,9 +210,9 @@ type Entries = Readonly<Record<string, unknown>>;
|
|
|
205
210
|
export declare function invalid(at: string, problem: string): never;
|
|
206
211
|
export declare function plain(value: unknown): value is Entries;
|
|
207
212
|
export declare function known(value: Entries, allowed: readonly string[], at: string): void;
|
|
208
|
-
export declare function planOf(input: unknown, facts: HeldRooms): Plan;
|
|
213
|
+
export declare function planOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
209
214
|
export declare function limitOf(input: unknown): number | null;
|
|
210
|
-
export declare function filterOf(input: unknown, facts: HeldRooms): Plan;
|
|
215
|
+
export declare function filterOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
211
216
|
export declare function identityOf(plan: Plan): string;
|
|
212
217
|
export {};
|
|
213
218
|
//# 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,KAAK,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAErD,MAAM,MAAM,SAAS,GACjB,KAAK,GACL;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,GACd;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,GACd;IAAE,GAAG,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GAC1B;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,GAC1B;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzB,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IAC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C;AAejD,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAE1D;AAMD,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAOtD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,QAI3E;AAsZD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,GAAE,SAAS,GAAG,IAAW,GAAG,IAAI,CAkB7F;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAMrD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,GAAE,SAAS,GAAG,IAAW,GAAG,IAAI,CAI/F;AAaD,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE7C"}
|
package/dist/query.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { pointerFacts, } from '@agentshouse/mdmodel';
|
|
2
|
+
import { referenceField } from './model.js';
|
|
1
3
|
import { normalize } from './paths.js';
|
|
2
4
|
export class QueryError extends Error {
|
|
3
5
|
constructor(code, at, problem) {
|
|
@@ -11,6 +13,7 @@ const RELATED = ['types', 'where', 'pathPrefix', 'field'];
|
|
|
11
13
|
const PARTS = ['fields', 'sections', 'preamble', 'markdown', 'backlinks', 'change'];
|
|
12
14
|
const ORDER = ['by', 'direction', 'nulls', 'stringSort', 'locale', 'localeOptions'];
|
|
13
15
|
const CALENDAR_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
16
|
+
const STRAY_ESCAPE = /~(?![01])/u;
|
|
14
17
|
export function invalid(at, problem) {
|
|
15
18
|
throw new QueryError('invalid-query', at, problem);
|
|
16
19
|
}
|
|
@@ -68,23 +71,29 @@ function calendarDate(value) {
|
|
|
68
71
|
const date = new Date(Date.UTC(year, month - 1, day));
|
|
69
72
|
return (date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day);
|
|
70
73
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
function itemOf(facts) {
|
|
75
|
+
return facts.type === 'array' ? facts.items : facts;
|
|
76
|
+
}
|
|
77
|
+
function fits(facts, value) {
|
|
78
|
+
const item = itemOf(facts);
|
|
79
|
+
if (item?.type === undefined)
|
|
80
|
+
return true;
|
|
81
|
+
if (item.values !== undefined)
|
|
82
|
+
return item.values.includes(value);
|
|
83
|
+
if (item.type === 'number')
|
|
74
84
|
return typeof value === 'number';
|
|
75
|
-
if (
|
|
85
|
+
if (item.type === 'integer')
|
|
86
|
+
return Number.isSafeInteger(value);
|
|
87
|
+
if (item.type === 'boolean')
|
|
88
|
+
return typeof value === 'boolean';
|
|
89
|
+
if (item.type !== 'string' || typeof value !== 'string')
|
|
76
90
|
return false;
|
|
77
|
-
if (item.
|
|
78
|
-
return item.values.includes(value);
|
|
79
|
-
if (item.kind === 'date')
|
|
80
|
-
return calendarDate(value);
|
|
81
|
-
if (item.kind === 'reference')
|
|
91
|
+
if (item.reference !== undefined)
|
|
82
92
|
return value !== '' && normalize(value) === value;
|
|
93
|
+
if (item.format === 'date')
|
|
94
|
+
return calendarDate(value);
|
|
83
95
|
return true;
|
|
84
96
|
}
|
|
85
|
-
function reference(spec) {
|
|
86
|
-
return spec.kind === 'reference' || (spec.kind === 'list' && spec.of.kind === 'reference');
|
|
87
|
-
}
|
|
88
97
|
function typing(facts, rooms, types, at) {
|
|
89
98
|
const read = rooms === null ? facts.rooms : facts.rooms.filter((room) => rooms.includes(room.locator));
|
|
90
99
|
const acquiring = !facts.listed &&
|
|
@@ -102,22 +111,46 @@ function typing(facts, rooms, types, at) {
|
|
|
102
111
|
types: types === null ? declared : declared.filter((type) => types.includes(type.name)),
|
|
103
112
|
};
|
|
104
113
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
114
|
+
function pointer(input, at) {
|
|
115
|
+
if (typeof input !== 'string' || !input.startsWith('/') || STRAY_ESCAPE.test(input)) {
|
|
116
|
+
invalid(at, 'expects a JSON Pointer');
|
|
117
|
+
}
|
|
118
|
+
return input;
|
|
119
|
+
}
|
|
120
|
+
function specs(typed, input, at) {
|
|
121
|
+
const field = pointer(input, at);
|
|
122
|
+
const declared = typed.types.flatMap((type) => {
|
|
123
|
+
const spec = pointerFacts(type, field);
|
|
124
|
+
return spec === undefined ? [] : [spec];
|
|
125
|
+
});
|
|
107
126
|
if (declared.length === 0 && !typed.untyped) {
|
|
108
127
|
throw new QueryError('unknown-field', at, `no MD Type it reads declares ${field}`);
|
|
109
128
|
}
|
|
110
|
-
|
|
129
|
+
if (!declared.some((spec) => spec.conditional))
|
|
130
|
+
return declared;
|
|
131
|
+
return declared.map((spec) => ({
|
|
132
|
+
facts: { prose: false },
|
|
133
|
+
through: several(spec),
|
|
134
|
+
conditional: true,
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
function several(spec) {
|
|
138
|
+
return spec.through || spec.facts.type === 'array';
|
|
139
|
+
}
|
|
140
|
+
function single(spec) {
|
|
141
|
+
return spec.facts.type !== undefined && spec.facts.type !== 'array';
|
|
142
|
+
}
|
|
143
|
+
function every(declared, holds) {
|
|
144
|
+
return declared.length > 0 && declared.every(holds);
|
|
111
145
|
}
|
|
112
146
|
function kind(declared, checked, at) {
|
|
113
|
-
if (checked === null ||
|
|
147
|
+
if (checked === null ||
|
|
148
|
+
declared.length === 0 ||
|
|
149
|
+
declared.some((spec) => fits(spec.facts, checked))) {
|
|
114
150
|
return;
|
|
115
151
|
}
|
|
116
152
|
throw new QueryError('wrong-kind', at, `${JSON.stringify(checked)} is not of its field's kind`);
|
|
117
153
|
}
|
|
118
|
-
function listed(declared, list) {
|
|
119
|
-
return declared.length > 0 && declared.every((spec) => (spec.kind === 'list') === list);
|
|
120
|
-
}
|
|
121
154
|
function test(declared, input, at) {
|
|
122
155
|
if (!plain(input)) {
|
|
123
156
|
const equal = value(input, at);
|
|
@@ -131,8 +164,11 @@ function test(declared, input, at) {
|
|
|
131
164
|
const stray = operators.find((operator) => !RANGE.includes(operator));
|
|
132
165
|
if (stray !== undefined)
|
|
133
166
|
invalid(place(at, stray), 'cannot join a range');
|
|
134
|
-
if (
|
|
167
|
+
if (every(declared, (spec) => spec.facts.type === 'array'))
|
|
135
168
|
invalid(at, 'a range on a list');
|
|
169
|
+
if (every(declared, (spec) => spec.facts.type === 'boolean' || spec.facts.type === 'object')) {
|
|
170
|
+
throw new QueryError('wrong-kind', at, 'its field does not compare in order');
|
|
171
|
+
}
|
|
136
172
|
return {
|
|
137
173
|
op: 'range',
|
|
138
174
|
bounds: RANGE.filter((operator) => operators.includes(operator)).map((operator) => {
|
|
@@ -165,7 +201,7 @@ function test(declared, input, at) {
|
|
|
165
201
|
return { op: 'nin', values: compared };
|
|
166
202
|
if (compared.includes(null))
|
|
167
203
|
invalid(where, 'a list holds no null');
|
|
168
|
-
if (
|
|
204
|
+
if (every(declared, single))
|
|
169
205
|
invalid(where, 'the field is not a list');
|
|
170
206
|
return { op: 'all', values: compared };
|
|
171
207
|
}
|
|
@@ -173,7 +209,7 @@ function test(declared, input, at) {
|
|
|
173
209
|
if (!Number.isSafeInteger(operand) || operand < 0) {
|
|
174
210
|
invalid(where, 'expects a nonnegative integer');
|
|
175
211
|
}
|
|
176
|
-
if (
|
|
212
|
+
if (every(declared, single))
|
|
177
213
|
invalid(where, 'the field is not a list');
|
|
178
214
|
return { op: 'size', size: operand };
|
|
179
215
|
}
|
|
@@ -186,7 +222,7 @@ function condition(typed, input, at) {
|
|
|
186
222
|
invalid(at, 'expects an object of field predicates');
|
|
187
223
|
const conditions = [];
|
|
188
224
|
for (const name of Object.keys(input).sort()) {
|
|
189
|
-
const where = place(at, name);
|
|
225
|
+
const where = name.startsWith('/') ? `${at}${name}` : place(at, name);
|
|
190
226
|
const entry = input[name];
|
|
191
227
|
if (name === '$and' || name === '$or') {
|
|
192
228
|
const nested = list(entry, where).map((item, index) => condition(typed, item, `${where}[${index}]`));
|
|
@@ -215,19 +251,19 @@ function scope(facts, rooms, input, at) {
|
|
|
215
251
|
pathPrefix: input.pathPrefix === undefined ? null : directory(input.pathPrefix, place(at, 'pathPrefix')),
|
|
216
252
|
};
|
|
217
253
|
}
|
|
218
|
-
function
|
|
219
|
-
if (typeof field !== 'string')
|
|
220
|
-
invalid(at, 'expects a field name');
|
|
254
|
+
function referenceName(typed, field, at) {
|
|
221
255
|
const declared = specs(typed, field, at);
|
|
222
|
-
if (declared.length > 0 &&
|
|
256
|
+
if (declared.length > 0 &&
|
|
257
|
+
!declared.some((spec) => spec.conditional || referenceField(spec.facts))) {
|
|
223
258
|
invalid(at, 'not a reference field');
|
|
259
|
+
}
|
|
224
260
|
return field;
|
|
225
261
|
}
|
|
226
262
|
function hopOf(facts, rooms, root, input) {
|
|
227
263
|
if (!plain(input))
|
|
228
264
|
invalid('hop', 'expects an object');
|
|
229
265
|
known(input, RELATED, 'hop');
|
|
230
|
-
const field =
|
|
266
|
+
const field = referenceName(root, input.field, 'hop.field');
|
|
231
267
|
const { types, where, pathPrefix } = scope(facts, rooms, input, 'hop');
|
|
232
268
|
return { types, where, pathPrefix, field };
|
|
233
269
|
}
|
|
@@ -236,14 +272,16 @@ function backlinksOf(facts, rooms, input) {
|
|
|
236
272
|
invalid('backlinks', 'expects an object');
|
|
237
273
|
known(input, RELATED, 'backlinks');
|
|
238
274
|
const { typed, types, where, pathPrefix } = scope(facts, rooms, input, 'backlinks');
|
|
239
|
-
const field = input.field === undefined ? null :
|
|
275
|
+
const field = input.field === undefined ? null : referenceName(typed, input.field, 'backlinks.field');
|
|
240
276
|
return { types, where, pathPrefix, field };
|
|
241
277
|
}
|
|
242
278
|
function keyPlan(typed, input, at, path) {
|
|
243
279
|
if (input === 'room' || input === 'type' || (path && input === 'path'))
|
|
244
280
|
return { of: input };
|
|
245
|
-
if (plain(input) &&
|
|
246
|
-
specs(typed, input.field, place(at, 'field'))
|
|
281
|
+
if (plain(input) && Object.hasOwn(input, 'field') && Object.keys(input).length === 1) {
|
|
282
|
+
if (specs(typed, input.field, place(at, 'field')).some(several)) {
|
|
283
|
+
invalid(place(at, 'field'), 'a path that can hold several values');
|
|
284
|
+
}
|
|
247
285
|
return { of: 'field', field: input.field };
|
|
248
286
|
}
|
|
249
287
|
return invalid(at, path ? 'expects room, path, type or a field' : 'expects room, type or a field');
|
|
@@ -301,10 +339,10 @@ function parts(typed, input, at, fields) {
|
|
|
301
339
|
return 'all';
|
|
302
340
|
const named = list(input, at);
|
|
303
341
|
named.forEach((name, index) => {
|
|
304
|
-
if (typeof name !== 'string')
|
|
305
|
-
invalid(`${at}[${index}]`, 'expects a name');
|
|
306
342
|
if (fields)
|
|
307
343
|
specs(typed, name, `${at}[${index}]`);
|
|
344
|
+
else if (typeof name !== 'string')
|
|
345
|
+
invalid(`${at}[${index}]`, 'expects a name');
|
|
308
346
|
});
|
|
309
347
|
return named;
|
|
310
348
|
}
|
|
@@ -372,7 +410,7 @@ function groupShape(typed, input) {
|
|
|
372
410
|
});
|
|
373
411
|
return { kind: 'groups', groupBy, orderBy };
|
|
374
412
|
}
|
|
375
|
-
export function planOf(input, facts) {
|
|
413
|
+
export function planOf(input, facts, reach = null) {
|
|
376
414
|
if (!plain(input))
|
|
377
415
|
invalid('query', 'expects a query object');
|
|
378
416
|
const grouped = input.groupBy !== undefined;
|
|
@@ -386,6 +424,7 @@ export function planOf(input, facts) {
|
|
|
386
424
|
const { typed, ...root } = scope(facts, rooms, input, '');
|
|
387
425
|
return {
|
|
388
426
|
rooms,
|
|
427
|
+
reach,
|
|
389
428
|
root,
|
|
390
429
|
hop: input.hop === undefined ? null : hopOf(facts, rooms, typed, input.hop),
|
|
391
430
|
backlinks: input.backlinks === undefined ? null : backlinksOf(facts, rooms, input.backlinks),
|
|
@@ -401,11 +440,11 @@ export function limitOf(input) {
|
|
|
401
440
|
}
|
|
402
441
|
return input;
|
|
403
442
|
}
|
|
404
|
-
export function filterOf(input, facts) {
|
|
443
|
+
export function filterOf(input, facts, reach = null) {
|
|
405
444
|
if (!plain(input))
|
|
406
445
|
invalid('documents', 'expects a filter object');
|
|
407
446
|
known(input, FILTER, '');
|
|
408
|
-
return planOf({ ...input, select: {} }, facts);
|
|
447
|
+
return planOf({ ...input, select: {} }, facts, reach);
|
|
409
448
|
}
|
|
410
449
|
function canonical(value) {
|
|
411
450
|
if (Array.isArray(value))
|
package/dist/reach.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { MdRuntime, RuntimeTopic } from './connection.js';
|
|
2
|
+
import type { Plan, PlanReach, QueryResult } from './query.js';
|
|
3
|
+
import type { SearchResult } from './search.js';
|
|
4
|
+
export type ReachedDocument = {
|
|
5
|
+
readonly room: string;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
};
|
|
8
|
+
export type PortReach = {
|
|
9
|
+
readonly rooms: readonly string[];
|
|
10
|
+
readonly documents: readonly ReachedDocument[];
|
|
11
|
+
readonly conversations: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type Deliver = (message: unknown) => void;
|
|
14
|
+
export type Watch = (topic: RuntimeTopic, input: readonly unknown[], deliver: Deliver) => () => void;
|
|
15
|
+
export type RuntimeView = {
|
|
16
|
+
md: MdRuntime;
|
|
17
|
+
watch: Watch;
|
|
18
|
+
};
|
|
19
|
+
export type NarrowedView = RuntimeView & {
|
|
20
|
+
narrow(reach: PortReach | null): void;
|
|
21
|
+
};
|
|
22
|
+
export type Reachable = RuntimeView & {
|
|
23
|
+
plan(input: unknown, reach: PortReach | null): Plan;
|
|
24
|
+
query(plan: Plan): Promise<QueryResult>;
|
|
25
|
+
watchPlan(plan: Plan, deliver: (message: unknown) => void): () => void;
|
|
26
|
+
search(input: unknown, reach: PortReach | null): Promise<SearchResult>;
|
|
27
|
+
};
|
|
28
|
+
export declare function holds(reach: PortReach | null, room: string): boolean;
|
|
29
|
+
export declare function governs(reach: PortReach | null, room: {
|
|
30
|
+
readonly locator: string;
|
|
31
|
+
readonly typedSelection: {
|
|
32
|
+
roots: readonly string[];
|
|
33
|
+
} | null;
|
|
34
|
+
}): {
|
|
35
|
+
readonly collection: boolean;
|
|
36
|
+
readonly selection: boolean;
|
|
37
|
+
};
|
|
38
|
+
export declare function planReach(reach: PortReach | null): PlanReach | null;
|
|
39
|
+
export declare function narrowed(runtime: Reachable, given: PortReach | null): NarrowedView;
|
|
40
|
+
//# sourceMappingURL=reach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reach.d.ts","sourceRoot":"","sources":["../src/reach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,SAAS,EAAe,YAAY,EAAc,MAAM,iBAAiB,CAAC;AAMjG,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEjD,MAAM,MAAM,KAAK,GAAG,CAClB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,SAAS,OAAO,EAAE,EACzB,OAAO,EAAE,OAAO,KACb,MAAM,IAAI,CAAC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