@agentshouse/mdmodel 0.1.0-cabd61587647f → 0.1.0-caefdbe3e3d42
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/API.md +161 -116
- package/README.md +6 -4
- package/dist/blocks.d.ts.map +1 -1
- package/dist/blocks.js +29 -7
- package/dist/condition.d.ts +43 -13
- package/dist/condition.d.ts.map +1 -1
- package/dist/condition.js +225 -127
- package/dist/definition.d.ts +3 -1
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +105 -21
- package/dist/divide.js +9 -9
- package/dist/document.d.ts +4 -4
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +41 -41
- package/dist/index.d.ts +20 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -6
- package/dist/kinds.d.ts +18 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/kinds.js +141 -0
- package/dist/links.d.ts +1 -0
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +85 -39
- package/dist/paths.d.ts +9 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +28 -2
- package/dist/pattern.d.ts +10 -0
- package/dist/pattern.d.ts.map +1 -0
- package/dist/pattern.js +355 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +7 -7
- package/dist/query/language.d.ts +218 -0
- package/dist/query/language.d.ts.map +1 -0
- package/dist/query/language.js +526 -0
- package/dist/query/match.d.ts +12 -0
- package/dist/query/match.d.ts.map +1 -0
- package/dist/query/match.js +118 -0
- package/dist/query/rows.d.ts +32 -0
- package/dist/query/rows.d.ts.map +1 -0
- package/dist/query/rows.js +161 -0
- package/dist/query/sql.d.ts +39 -0
- package/dist/query/sql.d.ts.map +1 -0
- package/dist/query/sql.js +279 -0
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +6 -1
- package/dist/reserved.d.ts +5 -0
- package/dist/reserved.d.ts.map +1 -0
- package/dist/reserved.js +20 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +55 -4
- package/dist/types.d.ts +34 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +28 -4
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +302 -75
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +36 -3
- package/fixtures/README.md +26 -6
- package/fixtures/cases/conditional-section/context.json +1 -0
- package/fixtures/cases/conditional-section/expected.json +6 -0
- package/fixtures/cases/conditional-section/library/questions/hosting.md +9 -0
- package/fixtures/cases/conditional-section/library/questions/payments.md +12 -0
- package/fixtures/cases/conditional-section/schema.yaml +14 -0
- package/fixtures/cases/cross-room-link/context.json +1 -0
- package/fixtures/cases/cross-room-link/expected.json +1 -0
- package/fixtures/cases/cross-room-link/library/clients/acme.md +6 -0
- package/fixtures/cases/cross-room-link/schema.yaml +3 -0
- package/fixtures/cases/cross-room-reference/context.json +1 -0
- package/fixtures/cases/cross-room-reference/expected.json +1 -0
- package/fixtures/cases/cross-room-reference/library/clients/acme.md +9 -0
- package/fixtures/cases/cross-room-reference/schema.yaml +9 -0
- package/fixtures/cases/link-into-a-reserved-name/context.json +1 -0
- package/fixtures/cases/link-into-a-reserved-name/expected.json +5 -0
- package/fixtures/cases/link-into-a-reserved-name/library/notes/a.md +6 -0
- package/fixtures/cases/link-into-a-reserved-name/schema.yaml +3 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/context.json +1 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/expected.json +5 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/library/notes/b.md +5 -0
- package/fixtures/cases/member-on-an-untyped-document/context.json +1 -0
- package/fixtures/cases/member-on-an-untyped-document/expected.json +6 -0
- package/fixtures/cases/member-on-an-untyped-document/library/note.md +4 -0
- package/fixtures/cases/member-on-another-type/context.json +1 -0
- package/fixtures/cases/member-on-another-type/expected.json +6 -0
- package/fixtures/cases/member-on-another-type/library/note.md +4 -0
- package/fixtures/cases/member-on-another-type/schema.yaml +7 -0
- package/fixtures/cases/reference-into-a-reserved-name/context.json +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/expected.json +6 -0
- package/fixtures/cases/reference-into-a-reserved-name/library/notes/a.md +4 -0
- package/fixtures/cases/reference-into-a-reserved-name/library/settings/brief.md +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/schema.yaml +3 -0
- package/fixtures/cases/room-md-declares-a-type/context.json +1 -0
- package/fixtures/cases/room-md-declares-a-type/expected.json +6 -0
- package/fixtures/cases/room-md-declares-a-type/library/ROOM.md +5 -0
- package/fixtures/cases/typed-path-names-another-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-another-type/expected.json +6 -0
- package/fixtures/cases/typed-path-names-another-type/library/settings/prefs/one.md +3 -0
- package/fixtures/cases/typed-path-names-another-type/schema.yaml +6 -0
- package/fixtures/cases/typed-path-names-its-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-its-type/expected.json +3 -0
- package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/deeper/two.md +1 -0
- package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/one.md +4 -0
- package/fixtures/cases/typed-path-names-its-type/schema.yaml +6 -0
- package/fixtures/cases/typed-path-names-no-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-no-type/expected.json +6 -0
- package/fixtures/cases/typed-path-names-no-type/library/settings/prefs/one.md +1 -0
- package/fixtures/cases/typed-path-names-no-type/schema.yaml +6 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/expected.json +6 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/library/rooms/team/tasks/plan.md +4 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/expected.json +6 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/library/rooms/team/tasks/plan.md +6 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/expected.json +3 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/plan.md +1 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/tasks/plan.md +5 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/expected.json +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/library/rooms/team/tasks/plan.md +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/schema.yaml +5 -0
- package/fixtures/division.json +26 -26
- package/fixtures/queries.json +913 -0
- package/package.json +7 -2
package/dist/pattern.js
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
const NativeRegExp = RegExp;
|
|
2
|
+
export const PATTERN_STATES = 1_000;
|
|
3
|
+
const VISIT_BUDGET = 100_000_000;
|
|
4
|
+
const HELD_PATTERNS = 512;
|
|
5
|
+
export class PatternTooCostly extends Error {
|
|
6
|
+
}
|
|
7
|
+
let scope = null;
|
|
8
|
+
const ASCII = 128;
|
|
9
|
+
class Unsupported extends Error {
|
|
10
|
+
}
|
|
11
|
+
const ATOM = 0;
|
|
12
|
+
const SPLIT = 1;
|
|
13
|
+
const ASSERT = 2;
|
|
14
|
+
const MATCH = 3;
|
|
15
|
+
class Atom {
|
|
16
|
+
literal;
|
|
17
|
+
ascii = new Int8Array(ASCII);
|
|
18
|
+
matcher;
|
|
19
|
+
constructor(source, literal) {
|
|
20
|
+
this.literal = literal;
|
|
21
|
+
this.matcher = new NativeRegExp(`^(?:${source})$`, 'u');
|
|
22
|
+
}
|
|
23
|
+
holds(point) {
|
|
24
|
+
if (this.literal !== null)
|
|
25
|
+
return point === this.literal;
|
|
26
|
+
if (point >= ASCII)
|
|
27
|
+
return this.matcher.test(String.fromCodePoint(point));
|
|
28
|
+
const known = this.ascii[point];
|
|
29
|
+
if (known !== 0)
|
|
30
|
+
return known > 0;
|
|
31
|
+
const held = this.matcher.test(String.fromCharCode(point));
|
|
32
|
+
this.ascii[point] = held ? 1 : -1;
|
|
33
|
+
return held;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class Reader {
|
|
37
|
+
source;
|
|
38
|
+
at = 0;
|
|
39
|
+
constructor(source) {
|
|
40
|
+
this.source = source;
|
|
41
|
+
}
|
|
42
|
+
peek(offset = 0) {
|
|
43
|
+
return this.source[this.at + offset];
|
|
44
|
+
}
|
|
45
|
+
starts(text) {
|
|
46
|
+
return this.source.startsWith(text, this.at);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function digits(reader) {
|
|
50
|
+
const from = reader.at;
|
|
51
|
+
while (/[0-9]/.test(reader.peek() ?? ''))
|
|
52
|
+
reader.at += 1;
|
|
53
|
+
return reader.at === from ? null : Number(reader.source.slice(from, reader.at));
|
|
54
|
+
}
|
|
55
|
+
function escapeEnd(source, at) {
|
|
56
|
+
const next = source[at + 1];
|
|
57
|
+
if (next === 'c')
|
|
58
|
+
return at + 3;
|
|
59
|
+
if (next === 'x')
|
|
60
|
+
return at + 4;
|
|
61
|
+
if ((next === 'u' && source[at + 2] === '{') || next === 'p' || next === 'P')
|
|
62
|
+
return source.indexOf('}', at + 2) + 1;
|
|
63
|
+
if (next !== 'u')
|
|
64
|
+
return at + 2;
|
|
65
|
+
const end = at + 6;
|
|
66
|
+
const lead = Number.parseInt(source.slice(at + 2, end), 16);
|
|
67
|
+
const trail = /^\\u([0-9a-fA-F]{4})$/.exec(source.slice(end, end + 6))?.[1];
|
|
68
|
+
const paired = lead >= 0xd800 &&
|
|
69
|
+
lead <= 0xdbff &&
|
|
70
|
+
trail !== undefined &&
|
|
71
|
+
Number.parseInt(trail, 16) >= 0xdc00 &&
|
|
72
|
+
Number.parseInt(trail, 16) <= 0xdfff;
|
|
73
|
+
return paired ? end + 6 : end;
|
|
74
|
+
}
|
|
75
|
+
function classEnd(source, at) {
|
|
76
|
+
let i = at + 1;
|
|
77
|
+
while (source[i] !== ']')
|
|
78
|
+
i += source[i] === '\\' ? 2 : 1;
|
|
79
|
+
return i + 1;
|
|
80
|
+
}
|
|
81
|
+
function escaped(reader) {
|
|
82
|
+
const next = reader.peek(1);
|
|
83
|
+
if (next === 'b' || next === 'B') {
|
|
84
|
+
reader.at += 2;
|
|
85
|
+
return { kind: 'assert', assertion: next === 'b' ? 'boundary' : 'inside' };
|
|
86
|
+
}
|
|
87
|
+
if (/[1-9k]/.test(next))
|
|
88
|
+
throw new Unsupported();
|
|
89
|
+
const end = escapeEnd(reader.source, reader.at);
|
|
90
|
+
const source = reader.source.slice(reader.at, end);
|
|
91
|
+
reader.at = end;
|
|
92
|
+
return { kind: 'atom', source, literal: false };
|
|
93
|
+
}
|
|
94
|
+
function group(reader) {
|
|
95
|
+
reader.at += 1;
|
|
96
|
+
if (reader.starts('?:'))
|
|
97
|
+
reader.at += 2;
|
|
98
|
+
else if (reader.starts('?<') && !reader.starts('?<=') && !reader.starts('?<!'))
|
|
99
|
+
reader.at = reader.source.indexOf('>', reader.at) + 1;
|
|
100
|
+
else if (reader.peek() === '?')
|
|
101
|
+
throw new Unsupported();
|
|
102
|
+
const alternatives = disjunction(reader);
|
|
103
|
+
reader.at += 1;
|
|
104
|
+
return { kind: 'group', alternatives };
|
|
105
|
+
}
|
|
106
|
+
function atom(reader) {
|
|
107
|
+
const character = reader.peek();
|
|
108
|
+
if (character === '^' || character === '$') {
|
|
109
|
+
reader.at += 1;
|
|
110
|
+
return { kind: 'assert', assertion: character === '^' ? 'start' : 'end' };
|
|
111
|
+
}
|
|
112
|
+
if (character === '\\')
|
|
113
|
+
return escaped(reader);
|
|
114
|
+
if (character === '(')
|
|
115
|
+
return group(reader);
|
|
116
|
+
if (character === '[' || character === '.') {
|
|
117
|
+
const end = character === '[' ? classEnd(reader.source, reader.at) : reader.at + 1;
|
|
118
|
+
const source = reader.source.slice(reader.at, end);
|
|
119
|
+
reader.at = end;
|
|
120
|
+
return { kind: 'atom', source, literal: false };
|
|
121
|
+
}
|
|
122
|
+
const source = String.fromCodePoint(reader.source.codePointAt(reader.at));
|
|
123
|
+
reader.at += source.length;
|
|
124
|
+
return { kind: 'atom', source, literal: true };
|
|
125
|
+
}
|
|
126
|
+
function quantified(reader, node) {
|
|
127
|
+
const sign = reader.peek();
|
|
128
|
+
let least = 1;
|
|
129
|
+
let most = 1;
|
|
130
|
+
if (sign === '*' || sign === '+' || sign === '?') {
|
|
131
|
+
reader.at += 1;
|
|
132
|
+
least = sign === '+' ? 1 : 0;
|
|
133
|
+
most = sign === '?' ? 1 : Infinity;
|
|
134
|
+
}
|
|
135
|
+
else if (sign === '{') {
|
|
136
|
+
reader.at += 1;
|
|
137
|
+
least = digits(reader);
|
|
138
|
+
most = least;
|
|
139
|
+
if (reader.peek() === ',') {
|
|
140
|
+
reader.at += 1;
|
|
141
|
+
most = digits(reader) ?? Infinity;
|
|
142
|
+
}
|
|
143
|
+
reader.at += 1;
|
|
144
|
+
}
|
|
145
|
+
else
|
|
146
|
+
return { node, least, most };
|
|
147
|
+
if (reader.peek() === '?')
|
|
148
|
+
reader.at += 1;
|
|
149
|
+
if (least > PATTERN_STATES || (Number.isFinite(most) && most > PATTERN_STATES))
|
|
150
|
+
throw new Unsupported();
|
|
151
|
+
return { node, least, most };
|
|
152
|
+
}
|
|
153
|
+
function disjunction(reader) {
|
|
154
|
+
const alternatives = [[]];
|
|
155
|
+
while (reader.at < reader.source.length && reader.peek() !== ')') {
|
|
156
|
+
if (reader.peek() === '|') {
|
|
157
|
+
reader.at += 1;
|
|
158
|
+
alternatives.push([]);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
alternatives.at(-1).push(quantified(reader, atom(reader)));
|
|
162
|
+
}
|
|
163
|
+
return alternatives;
|
|
164
|
+
}
|
|
165
|
+
class Machine {
|
|
166
|
+
kinds = [];
|
|
167
|
+
outs = [];
|
|
168
|
+
alternates = [];
|
|
169
|
+
atoms = [];
|
|
170
|
+
assertions = [];
|
|
171
|
+
atomed = new Map();
|
|
172
|
+
state(kind, out, alternate = -1) {
|
|
173
|
+
if (this.kinds.length >= PATTERN_STATES)
|
|
174
|
+
throw new Unsupported();
|
|
175
|
+
this.kinds.push(kind);
|
|
176
|
+
this.outs.push(out);
|
|
177
|
+
this.alternates.push(alternate);
|
|
178
|
+
return this.kinds.length - 1;
|
|
179
|
+
}
|
|
180
|
+
atom(source, literal) {
|
|
181
|
+
const known = this.atomed.get(source);
|
|
182
|
+
if (known !== undefined)
|
|
183
|
+
return known;
|
|
184
|
+
this.atoms.push(new Atom(source, literal ? source.codePointAt(0) : null));
|
|
185
|
+
this.atomed.set(source, this.atoms.length - 1);
|
|
186
|
+
return this.atoms.length - 1;
|
|
187
|
+
}
|
|
188
|
+
node(node, next) {
|
|
189
|
+
if (node.kind === 'atom')
|
|
190
|
+
return this.state(ATOM, next, this.atom(node.source, node.literal));
|
|
191
|
+
if (node.kind === 'assert') {
|
|
192
|
+
this.assertions.push(node.assertion);
|
|
193
|
+
return this.state(ASSERT, next, this.assertions.length - 1);
|
|
194
|
+
}
|
|
195
|
+
return this.alternatives(node.alternatives, next);
|
|
196
|
+
}
|
|
197
|
+
alternatives(alternatives, next) {
|
|
198
|
+
let entry = this.sequence(alternatives.at(-1), next);
|
|
199
|
+
for (let index = alternatives.length - 2; index >= 0; index -= 1)
|
|
200
|
+
entry = this.state(SPLIT, this.sequence(alternatives[index], next), entry);
|
|
201
|
+
return entry;
|
|
202
|
+
}
|
|
203
|
+
sequence(terms, next) {
|
|
204
|
+
let entry = next;
|
|
205
|
+
for (let index = terms.length - 1; index >= 0; index -= 1)
|
|
206
|
+
entry = this.term(terms[index], entry);
|
|
207
|
+
return entry;
|
|
208
|
+
}
|
|
209
|
+
term({ node, least, most }, next) {
|
|
210
|
+
if (least === 1 && most === 1)
|
|
211
|
+
return this.node(node, next);
|
|
212
|
+
let entry = next;
|
|
213
|
+
if (most === Infinity) {
|
|
214
|
+
const loop = this.state(SPLIT, -1, next);
|
|
215
|
+
const body = this.node(node, loop);
|
|
216
|
+
if (body === loop)
|
|
217
|
+
return next;
|
|
218
|
+
this.outs[loop] = body;
|
|
219
|
+
entry = loop;
|
|
220
|
+
}
|
|
221
|
+
else
|
|
222
|
+
for (let copy = least; copy < most; copy += 1) {
|
|
223
|
+
const body = this.node(node, entry);
|
|
224
|
+
if (body === entry)
|
|
225
|
+
return next;
|
|
226
|
+
entry = this.state(SPLIT, body, entry);
|
|
227
|
+
}
|
|
228
|
+
for (let copy = 0; copy < least; copy += 1) {
|
|
229
|
+
const body = this.node(node, entry);
|
|
230
|
+
if (body === entry)
|
|
231
|
+
return next;
|
|
232
|
+
entry = body;
|
|
233
|
+
}
|
|
234
|
+
return entry;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function word(point) {
|
|
238
|
+
return ((point >= 0x30 && point <= 0x39) ||
|
|
239
|
+
(point >= 0x41 && point <= 0x5a) ||
|
|
240
|
+
(point >= 0x61 && point <= 0x7a) ||
|
|
241
|
+
point === 0x5f);
|
|
242
|
+
}
|
|
243
|
+
function holds(assertion, at, point, across) {
|
|
244
|
+
if (assertion === 'start')
|
|
245
|
+
return at === 0;
|
|
246
|
+
if (assertion === 'end')
|
|
247
|
+
return point === -1;
|
|
248
|
+
return assertion === 'boundary' ? across : !across;
|
|
249
|
+
}
|
|
250
|
+
class Linear {
|
|
251
|
+
machine;
|
|
252
|
+
start;
|
|
253
|
+
marks;
|
|
254
|
+
generation = 0;
|
|
255
|
+
constructor(machine, start) {
|
|
256
|
+
this.machine = machine;
|
|
257
|
+
this.start = start;
|
|
258
|
+
this.marks = new Float64Array(machine.kinds.length);
|
|
259
|
+
}
|
|
260
|
+
test(text) {
|
|
261
|
+
const { kinds, outs, alternates, atoms, assertions } = this.machine;
|
|
262
|
+
const marks = this.marks;
|
|
263
|
+
const budget = scope ?? { left: VISIT_BUDGET };
|
|
264
|
+
let seeds = [];
|
|
265
|
+
let previous = -1;
|
|
266
|
+
for (let at = 0;;) {
|
|
267
|
+
const point = at < text.length ? text.codePointAt(at) : -1;
|
|
268
|
+
const across = word(previous) !== word(point);
|
|
269
|
+
const generation = (this.generation += 1);
|
|
270
|
+
const active = [];
|
|
271
|
+
seeds.push(this.start);
|
|
272
|
+
while (seeds.length > 0) {
|
|
273
|
+
const state = seeds.pop();
|
|
274
|
+
if (marks[state] === generation)
|
|
275
|
+
continue;
|
|
276
|
+
marks[state] = generation;
|
|
277
|
+
if ((budget.left -= 1) < 0)
|
|
278
|
+
throw new PatternTooCostly();
|
|
279
|
+
const kind = kinds[state];
|
|
280
|
+
if (kind === MATCH)
|
|
281
|
+
return true;
|
|
282
|
+
if (kind === ATOM)
|
|
283
|
+
active.push(state);
|
|
284
|
+
else if (kind === SPLIT)
|
|
285
|
+
seeds.push(alternates[state], outs[state]);
|
|
286
|
+
else if (holds(assertions[alternates[state]], at, point, across))
|
|
287
|
+
seeds.push(outs[state]);
|
|
288
|
+
}
|
|
289
|
+
if (point === -1)
|
|
290
|
+
return false;
|
|
291
|
+
for (const state of active)
|
|
292
|
+
if (atoms[alternates[state]].holds(point))
|
|
293
|
+
seeds.push(outs[state]);
|
|
294
|
+
previous = point;
|
|
295
|
+
at += point > 0xffff ? 2 : 1;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function compiled(source) {
|
|
300
|
+
try {
|
|
301
|
+
new NativeRegExp(source, 'u');
|
|
302
|
+
}
|
|
303
|
+
catch {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
const alternatives = disjunction(new Reader(source));
|
|
308
|
+
const machine = new Machine();
|
|
309
|
+
const start = machine.alternatives(alternatives, machine.state(MATCH, -1));
|
|
310
|
+
return new Linear(machine, start);
|
|
311
|
+
}
|
|
312
|
+
catch (error) {
|
|
313
|
+
if (error instanceof Unsupported)
|
|
314
|
+
return null;
|
|
315
|
+
throw error;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
const held = new Map();
|
|
319
|
+
export function linearPattern(source) {
|
|
320
|
+
if (held.has(source))
|
|
321
|
+
return held.get(source);
|
|
322
|
+
const made = compiled(source);
|
|
323
|
+
if (held.size >= HELD_PATTERNS)
|
|
324
|
+
held.delete(held.keys().next().value);
|
|
325
|
+
held.set(source, made);
|
|
326
|
+
return made;
|
|
327
|
+
}
|
|
328
|
+
export function withLinearRegExp(run) {
|
|
329
|
+
const native = globalThis.RegExp;
|
|
330
|
+
function LinearRegExp(source) {
|
|
331
|
+
new NativeRegExp(source, 'u');
|
|
332
|
+
return {
|
|
333
|
+
test(text) {
|
|
334
|
+
const pattern = linearPattern(source);
|
|
335
|
+
if (pattern === null)
|
|
336
|
+
throw new SyntaxError(`the pattern ${source} is not linear`);
|
|
337
|
+
return pattern.test(text);
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
globalThis.RegExp = LinearRegExp;
|
|
342
|
+
try {
|
|
343
|
+
return run();
|
|
344
|
+
}
|
|
345
|
+
finally {
|
|
346
|
+
globalThis.RegExp = native;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
export function openPatternBudget() {
|
|
350
|
+
const outer = scope;
|
|
351
|
+
scope = outer ?? { left: VISIT_BUDGET };
|
|
352
|
+
return () => {
|
|
353
|
+
scope = outer;
|
|
354
|
+
};
|
|
355
|
+
}
|
package/dist/project.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAA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AE,KAAK,CAAA;CAAE,GAC5C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AA0CtD,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAS3E;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,MAAM,CAWxF;AA4BD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,GACzB,WAAW,CA+Bb;AAED,wBAAgB,OAAO,CACrB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,iBAA2C,GACnD,UAAU,CAMZ"}
|
package/dist/project.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { memberFacts } from './definition.js';
|
|
2
|
-
import { frontmatter } from './document.js';
|
|
3
|
-
import {
|
|
4
|
-
import { target } from './paths.js';
|
|
2
|
+
import { frontmatter, inventoryOf } from './document.js';
|
|
3
|
+
import { roomTarget, target } from './paths.js';
|
|
5
4
|
import { refusal } from './refuse.js';
|
|
6
5
|
import { headingSpans } from './sections.js';
|
|
7
6
|
import { bodyStartOf } from './yaml.js';
|
|
8
|
-
function internalEdits(content, bodyStart, file, documentTargets) {
|
|
9
|
-
const inventory = linkInventory(content.slice(bodyStart));
|
|
7
|
+
function internalEdits(content, inventory, bodyStart, file, documentTargets) {
|
|
10
8
|
const internal = new Set();
|
|
11
9
|
const uses = inventory.uses
|
|
12
10
|
.filter((use) => {
|
|
13
11
|
const resolved = target(file, use.destination.href);
|
|
14
|
-
return resolved
|
|
12
|
+
return resolved === null
|
|
13
|
+
? roomTarget(use.destination.href) !== null
|
|
14
|
+
: documentTargets.has(resolved);
|
|
15
15
|
})
|
|
16
16
|
.sort((left, right) => left.start - right.start);
|
|
17
17
|
const edits = [];
|
|
@@ -96,7 +96,7 @@ function freeTextValues(definition, document) {
|
|
|
96
96
|
export function projectionInput(document, file, context) {
|
|
97
97
|
const content = document.content;
|
|
98
98
|
const bodyStart = bodyStartOf(content);
|
|
99
|
-
const edits = internalEdits(content, bodyStart, file, new Set(context.documentTargets));
|
|
99
|
+
const edits = internalEdits(content, inventoryOf(document), bodyStart, file, new Set(context.documentTargets));
|
|
100
100
|
const declared = document.type;
|
|
101
101
|
if (declared === undefined || declared === 'any') {
|
|
102
102
|
return {
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { type Definition } from '../definition.js';
|
|
2
|
+
export type Value = string | number | boolean | null;
|
|
3
|
+
export type Predicate = Value | {
|
|
4
|
+
$eq: Value;
|
|
5
|
+
} | {
|
|
6
|
+
$ne: Value;
|
|
7
|
+
} | {
|
|
8
|
+
$in: readonly Value[];
|
|
9
|
+
} | {
|
|
10
|
+
$nin: readonly Value[];
|
|
11
|
+
} | {
|
|
12
|
+
$gt?: Value;
|
|
13
|
+
$gte?: Value;
|
|
14
|
+
$lt?: Value;
|
|
15
|
+
$lte?: Value;
|
|
16
|
+
} | {
|
|
17
|
+
$all: readonly Value[];
|
|
18
|
+
} | {
|
|
19
|
+
$size: number;
|
|
20
|
+
} | {
|
|
21
|
+
$exists: boolean;
|
|
22
|
+
} | {
|
|
23
|
+
$prefix: string;
|
|
24
|
+
};
|
|
25
|
+
export type Where = {
|
|
26
|
+
$and?: readonly Where[];
|
|
27
|
+
$or?: readonly Where[];
|
|
28
|
+
[field: string]: Predicate | readonly Where[] | undefined;
|
|
29
|
+
};
|
|
30
|
+
export type Related = {
|
|
31
|
+
types?: readonly string[];
|
|
32
|
+
where?: Where;
|
|
33
|
+
pathPrefix?: string;
|
|
34
|
+
};
|
|
35
|
+
export type Filter = {
|
|
36
|
+
rooms?: readonly string[];
|
|
37
|
+
types?: readonly string[];
|
|
38
|
+
where?: Where;
|
|
39
|
+
pathPrefix?: string;
|
|
40
|
+
folder?: string;
|
|
41
|
+
paths?: readonly string[];
|
|
42
|
+
fileIds?: readonly string[];
|
|
43
|
+
hop?: Related & {
|
|
44
|
+
field: string;
|
|
45
|
+
};
|
|
46
|
+
backlinks?: Related & {
|
|
47
|
+
field?: string;
|
|
48
|
+
};
|
|
49
|
+
text?: string;
|
|
50
|
+
};
|
|
51
|
+
export type Key = 'room' | 'path' | 'type' | 'folder' | {
|
|
52
|
+
field: string;
|
|
53
|
+
};
|
|
54
|
+
export type Select = 'all' | {
|
|
55
|
+
fields?: 'all' | readonly string[];
|
|
56
|
+
sections?: 'all' | readonly string[];
|
|
57
|
+
preamble?: true;
|
|
58
|
+
markdown?: true;
|
|
59
|
+
backlinks?: true;
|
|
60
|
+
change?: true;
|
|
61
|
+
fileId?: true;
|
|
62
|
+
revision?: true;
|
|
63
|
+
};
|
|
64
|
+
export type OrderOptions = {
|
|
65
|
+
nulls?: 'first' | 'last';
|
|
66
|
+
stringSort?: 'lexical' | 'locale';
|
|
67
|
+
locale?: string;
|
|
68
|
+
localeOptions?: Readonly<Record<string, unknown>>;
|
|
69
|
+
};
|
|
70
|
+
export type Direction = 'asc' | 'desc';
|
|
71
|
+
export type DocumentQuery = Filter & {
|
|
72
|
+
select: Select;
|
|
73
|
+
orderBy?: readonly ({
|
|
74
|
+
by: Key;
|
|
75
|
+
direction?: Direction;
|
|
76
|
+
} & OrderOptions)[];
|
|
77
|
+
limit?: number;
|
|
78
|
+
after?: string;
|
|
79
|
+
total?: true;
|
|
80
|
+
};
|
|
81
|
+
export type GroupQuery = Filter & {
|
|
82
|
+
groupBy: readonly Exclude<Key, 'path'>[];
|
|
83
|
+
orderBy?: readonly {
|
|
84
|
+
by: 'count' | Exclude<Key, 'path'>;
|
|
85
|
+
direction?: Direction;
|
|
86
|
+
}[];
|
|
87
|
+
limit?: number;
|
|
88
|
+
after?: string;
|
|
89
|
+
total?: true;
|
|
90
|
+
};
|
|
91
|
+
export type LocalQuery = DocumentQuery | GroupQuery;
|
|
92
|
+
export type QueryErrorCode = 'invalid-query' | 'unknown-type' | 'unknown-field' | 'wrong-kind';
|
|
93
|
+
export type RoomFacts = {
|
|
94
|
+
locator: string;
|
|
95
|
+
available: boolean;
|
|
96
|
+
types: readonly Definition[];
|
|
97
|
+
};
|
|
98
|
+
export type HeldRooms = {
|
|
99
|
+
listed: boolean;
|
|
100
|
+
rooms: readonly RoomFacts[];
|
|
101
|
+
};
|
|
102
|
+
export type Test = {
|
|
103
|
+
op: 'eq';
|
|
104
|
+
value: Value;
|
|
105
|
+
} | {
|
|
106
|
+
op: 'ne';
|
|
107
|
+
value: Value;
|
|
108
|
+
} | {
|
|
109
|
+
op: 'in';
|
|
110
|
+
values: readonly Value[];
|
|
111
|
+
} | {
|
|
112
|
+
op: 'nin';
|
|
113
|
+
values: readonly Value[];
|
|
114
|
+
} | {
|
|
115
|
+
op: 'range';
|
|
116
|
+
bounds: readonly (readonly ['gt' | 'gte' | 'lt' | 'lte', Value])[];
|
|
117
|
+
} | {
|
|
118
|
+
op: 'all';
|
|
119
|
+
values: readonly Value[];
|
|
120
|
+
} | {
|
|
121
|
+
op: 'size';
|
|
122
|
+
size: number;
|
|
123
|
+
} | {
|
|
124
|
+
op: 'exists';
|
|
125
|
+
exists: boolean;
|
|
126
|
+
} | {
|
|
127
|
+
op: 'prefix';
|
|
128
|
+
prefix: string;
|
|
129
|
+
};
|
|
130
|
+
export type Clause = {
|
|
131
|
+
every: readonly Clause[];
|
|
132
|
+
} | {
|
|
133
|
+
some: readonly Clause[];
|
|
134
|
+
} | {
|
|
135
|
+
field: string;
|
|
136
|
+
test: Test;
|
|
137
|
+
};
|
|
138
|
+
export type Scope = {
|
|
139
|
+
types: readonly string[] | null;
|
|
140
|
+
where: Clause | null;
|
|
141
|
+
pathPrefix: string | null;
|
|
142
|
+
};
|
|
143
|
+
export type KeyPlan = {
|
|
144
|
+
of: 'room';
|
|
145
|
+
} | {
|
|
146
|
+
of: 'path';
|
|
147
|
+
} | {
|
|
148
|
+
of: 'type';
|
|
149
|
+
} | {
|
|
150
|
+
of: 'folder';
|
|
151
|
+
} | {
|
|
152
|
+
of: 'field';
|
|
153
|
+
field: string;
|
|
154
|
+
};
|
|
155
|
+
export type DocumentShape = {
|
|
156
|
+
kind: 'documents';
|
|
157
|
+
fields: 'all' | readonly string[] | null;
|
|
158
|
+
sections: 'all' | readonly string[] | null;
|
|
159
|
+
preamble: boolean;
|
|
160
|
+
markdown: boolean;
|
|
161
|
+
backlinks: boolean;
|
|
162
|
+
change: boolean;
|
|
163
|
+
fileId: boolean;
|
|
164
|
+
revision: boolean;
|
|
165
|
+
orderBy: readonly {
|
|
166
|
+
key: KeyPlan;
|
|
167
|
+
options: OrderOptions & {
|
|
168
|
+
direction: Direction;
|
|
169
|
+
};
|
|
170
|
+
}[];
|
|
171
|
+
};
|
|
172
|
+
export type GroupShape = {
|
|
173
|
+
kind: 'groups';
|
|
174
|
+
groupBy: readonly KeyPlan[];
|
|
175
|
+
orderBy: readonly {
|
|
176
|
+
by: 'count' | number;
|
|
177
|
+
direction: Direction;
|
|
178
|
+
}[];
|
|
179
|
+
};
|
|
180
|
+
export type Continuation = {
|
|
181
|
+
text: string;
|
|
182
|
+
values: readonly unknown[] | null;
|
|
183
|
+
};
|
|
184
|
+
export type QueryPlan = {
|
|
185
|
+
key: string;
|
|
186
|
+
rooms: readonly string[] | null;
|
|
187
|
+
root: Scope;
|
|
188
|
+
folder: string | null;
|
|
189
|
+
paths: readonly string[] | null;
|
|
190
|
+
fileIds: readonly string[] | null;
|
|
191
|
+
hop: (Scope & {
|
|
192
|
+
field: string;
|
|
193
|
+
}) | null;
|
|
194
|
+
backlinks: (Scope & {
|
|
195
|
+
field: string | null;
|
|
196
|
+
}) | null;
|
|
197
|
+
text: string | null;
|
|
198
|
+
shape: DocumentShape | GroupShape;
|
|
199
|
+
limit: number | null;
|
|
200
|
+
after: Continuation | null;
|
|
201
|
+
total: boolean;
|
|
202
|
+
};
|
|
203
|
+
export declare class QueryError extends Error {
|
|
204
|
+
readonly code: QueryErrorCode;
|
|
205
|
+
readonly retryable = false;
|
|
206
|
+
constructor(code: QueryErrorCode, at: string, problem: string);
|
|
207
|
+
}
|
|
208
|
+
type Entries = Readonly<Record<string, unknown>>;
|
|
209
|
+
export declare function bodied(shape: DocumentShape): boolean;
|
|
210
|
+
export declare function invalid(at: string, problem: string): never;
|
|
211
|
+
export declare function known(value: Entries, allowed: readonly string[], at: string): void;
|
|
212
|
+
export declare function planOf(input: unknown, facts: HeldRooms): QueryPlan;
|
|
213
|
+
export declare function cursorOf(values: readonly unknown[]): string;
|
|
214
|
+
export declare function decodedCursor(text: string): readonly unknown[] | null;
|
|
215
|
+
export declare function queryKey(query: unknown): string;
|
|
216
|
+
export declare function identityOf(plan: QueryPlan): string;
|
|
217
|
+
export {};
|
|
218
|
+
//# sourceMappingURL=language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/query/language.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,kBAAkB,CAAC;AAK1B,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;I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