@agentshouse/mdruntime 0.1.0-cefbc8bb8a1c0 → 0.1.0-cf1e7fdb9c600
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 +1 -1
- package/dist/adapter.d.ts +69 -49
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +5 -8
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +20 -21
- package/dist/chain.d.ts +2 -1
- package/dist/chain.d.ts.map +1 -1
- package/dist/client.d.ts +6 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +0 -1
- package/dist/collection.d.ts +2 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +1 -17
- package/dist/compile.d.ts +1 -6
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +97 -281
- package/dist/connection.d.ts +5 -7
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +816 -846
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation.d.ts +15 -13
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +133 -142
- package/dist/durability.d.ts +0 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/entry.d.ts +2 -2
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +14 -5
- package/dist/host.d.ts +3 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +12 -26
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -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 +2 -1
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +10 -7
- package/dist/memory.d.ts +9 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +132 -81
- package/dist/messages.d.ts +2 -2
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +15 -16
- package/dist/model.d.ts +1 -3
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -12
- package/dist/observation.d.ts +2 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +7 -2
- package/dist/outcome.d.ts +0 -3
- package/dist/outcome.d.ts.map +1 -1
- package/dist/query.d.ts +5 -209
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -505
- package/dist/reach.d.ts +7 -7
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +31 -44
- package/dist/react.d.ts +3 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/readiness.d.ts +2 -15
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +4 -10
- package/dist/refresh.d.ts +7 -5
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +46 -6
- package/dist/replica.d.ts +2 -2
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +5 -5
- package/dist/room-draft.d.ts +2 -1
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +65 -52
- package/dist/rows.d.ts +3 -19
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +36 -164
- package/dist/search.d.ts +12 -63
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +9 -52
- 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 +0 -4
- package/dist/status.d.ts.map +1 -1
- package/dist/store.d.ts +15 -19
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +40 -39
- package/dist/stored.d.ts +33 -6
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +87 -124
- package/dist/tables.d.ts +34 -33
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +21 -54
- 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 +39 -97
- 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 +1 -4
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +1 -1
- package/package.json +2 -2
- package/dist/fulltext.d.ts +0 -27
- package/dist/fulltext.d.ts.map +0 -1
- package/dist/fulltext.js +0 -370
- package/dist/reads.d.ts +0 -11
- package/dist/reads.d.ts.map +0 -1
- package/dist/reads.js +0 -91
- package/dist/words.d.ts +0 -19
- package/dist/words.d.ts.map +0 -1
- package/dist/words.js +0 -156
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;
|
|
@@ -101,6 +15,7 @@ export type QueryDocument = {
|
|
|
101
15
|
sections?: Readonly<Record<string, string>>;
|
|
102
16
|
preamble?: string;
|
|
103
17
|
markdown?: string;
|
|
18
|
+
textHeld?: false;
|
|
104
19
|
backlinks?: readonly Backlink[];
|
|
105
20
|
change?: HeadChange | null;
|
|
106
21
|
fileId?: string | null;
|
|
@@ -147,138 +62,19 @@ export type GroupResult = GroupRows & {
|
|
|
147
62
|
coverage: QueryCoverage;
|
|
148
63
|
};
|
|
149
64
|
export type QueryResult = DocumentResult | GroupResult | PendingResult;
|
|
150
|
-
export type QueryErrorCode = 'invalid-query' | 'unknown-type' | 'unknown-field' | 'wrong-kind';
|
|
151
|
-
export type RoomFacts = {
|
|
152
|
-
locator: string;
|
|
153
|
-
available: boolean;
|
|
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
|
-
}[];
|
|
234
|
-
};
|
|
235
65
|
export type PlanArea = {
|
|
236
66
|
room: string;
|
|
237
67
|
path: string;
|
|
238
|
-
|
|
68
|
+
open: readonly string[];
|
|
239
69
|
};
|
|
240
70
|
export type PlanReach = {
|
|
241
71
|
rooms: readonly string[];
|
|
242
72
|
documents: readonly string[];
|
|
243
73
|
areas: readonly PlanArea[];
|
|
244
74
|
};
|
|
245
|
-
export type
|
|
246
|
-
text: string;
|
|
247
|
-
values: readonly unknown[] | null;
|
|
248
|
-
};
|
|
249
|
-
export type Plan = {
|
|
250
|
-
key: string;
|
|
251
|
-
rooms: readonly string[] | null;
|
|
75
|
+
export type Plan = QueryPlan & {
|
|
252
76
|
reach: PlanReach | null;
|
|
253
77
|
locked: readonly string[];
|
|
254
|
-
root: Scope;
|
|
255
|
-
folder: string | null;
|
|
256
|
-
paths: readonly string[] | null;
|
|
257
|
-
hop: (Scope & {
|
|
258
|
-
field: string;
|
|
259
|
-
}) | null;
|
|
260
|
-
backlinks: (Scope & {
|
|
261
|
-
field: string | null;
|
|
262
|
-
}) | null;
|
|
263
|
-
shape: DocumentShape | GroupShape;
|
|
264
|
-
limit: number | null;
|
|
265
|
-
after: Continuation | null;
|
|
266
|
-
total: boolean;
|
|
267
78
|
};
|
|
268
|
-
export declare
|
|
269
|
-
readonly code: QueryErrorCode;
|
|
270
|
-
readonly retryable = false;
|
|
271
|
-
constructor(code: QueryErrorCode, at: string, problem: string);
|
|
272
|
-
}
|
|
273
|
-
type Entries = Readonly<Record<string, unknown>>;
|
|
274
|
-
export declare function invalid(at: string, problem: string): never;
|
|
275
|
-
export declare function plain(value: unknown): value is Entries;
|
|
276
|
-
export declare function known(value: Entries, allowed: readonly string[], at: string): void;
|
|
277
|
-
export declare function flag(input: unknown, at: string): boolean;
|
|
278
|
-
export declare function planOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
279
|
-
export declare function limitOf(input: unknown): number | null;
|
|
280
|
-
export declare function filterOf(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
281
|
-
export declare function queryKey(query: unknown): string;
|
|
282
|
-
export declare function identityOf(plan: Plan): string;
|
|
283
|
-
export {};
|
|
79
|
+
export declare function planWithin(input: unknown, facts: HeldRooms, reach?: PlanReach | null): Plan;
|
|
284
80
|
//# 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,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC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