@agentshouse/mdmodel 0.1.0-c04c0d681d2d4 → 0.1.0-c08b2adadd2fe
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 +150 -110
- package/README.md +8 -6
- package/dist/definition.d.ts +3 -1
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +138 -26
- package/dist/divide.d.ts.map +1 -1
- package/dist/divide.js +5 -4
- package/dist/document.d.ts +9 -5
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +169 -67
- package/dist/event.d.ts +78 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +201 -0
- package/dist/facts.d.ts +15 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/facts.js +41 -0
- package/dist/index.d.ts +23 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -7
- package/dist/kinds.d.ts +18 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/kinds.js +150 -0
- package/dist/markdown.d.ts +51 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +271 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +9 -2
- package/dist/pattern.d.ts +10 -0
- package/dist/pattern.d.ts.map +1 -0
- package/dist/pattern.js +356 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +16 -21
- package/dist/query/language.d.ts +254 -0
- package/dist/query/language.d.ts.map +1 -0
- package/dist/query/language.js +620 -0
- package/dist/query/match.d.ts +14 -0
- package/dist/query/match.d.ts.map +1 -0
- package/dist/query/match.js +150 -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 +285 -0
- package/dist/reserved.d.ts +6 -0
- package/dist/reserved.d.ts.map +1 -0
- package/dist/reserved.js +21 -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 +19 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +29 -5
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +327 -161
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +40 -14
- package/fixtures/README.md +25 -3
- 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/lazy-list-item/context.json +1 -0
- package/fixtures/cases/lazy-list-item/expected.json +3 -0
- package/fixtures/cases/lazy-list-item/library/item.md +8 -0
- package/fixtures/cases/lazy-list-item/schema.yaml +3 -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/thematic-break-in-a-list-section/context.json +1 -0
- package/fixtures/cases/thematic-break-in-a-list-section/expected.json +6 -0
- package/fixtures/cases/thematic-break-in-a-list-section/library/item.md +7 -0
- package/fixtures/cases/thematic-break-in-a-list-section/schema.yaml +3 -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 +47 -2
- package/fixtures/preamble.json +24 -3
- package/fixtures/projection.json +105 -2
- package/fixtures/queries.json +964 -0
- package/package.json +16 -2
- package/dist/blocks.d.ts +0 -11
- package/dist/blocks.d.ts.map +0 -1
- package/dist/blocks.js +0 -69
- package/dist/condition.d.ts +0 -162
- package/dist/condition.d.ts.map +0 -1
- package/dist/condition.js +0 -616
- package/dist/links.d.ts +0 -29
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js +0 -788
- package/dist/profile.d.ts +0 -6
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -5
- package/dist/sections.d.ts +0 -11
- package/dist/sections.d.ts.map +0 -1
- package/dist/sections.js +0 -57
package/dist/profile.d.ts
DELETED
package/dist/profile.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB;aAClC,IAAI,EAAE,0BAA0B;aAChC,IAAI,EAAE,MAAM;aACZ,GAAG,EAAE,gCAAgC;CAC7B,CAAC"}
|
package/dist/profile.js
DELETED
package/dist/sections.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Extent } from './types.js';
|
|
2
|
-
export type SectionSpan = {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly headingStart: number;
|
|
5
|
-
readonly bodyStart: number;
|
|
6
|
-
readonly bodyEnd: number;
|
|
7
|
-
};
|
|
8
|
-
export declare function headingSpans(content: string, bodyStart: number): SectionSpan[];
|
|
9
|
-
export declare function sectionsRecord(spans: readonly SectionSpan[], content: string): Record<string, string>;
|
|
10
|
-
export declare function listItems(content: string, from: number, to: number): Extent[] | null;
|
|
11
|
-
//# sourceMappingURL=sections.d.ts.map
|
package/dist/sections.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../src/sections.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAIF,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE,CAc9E;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AASD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAoBpF"}
|
package/dist/sections.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { headingLines } from './blocks.js';
|
|
2
|
-
const ITEM = /^([ \t]*)([-*+]|\d+[.)])[ \t]+/;
|
|
3
|
-
export function headingSpans(content, bodyStart) {
|
|
4
|
-
const found = [];
|
|
5
|
-
for (const heading of headingLines(content, bodyStart, content.length)) {
|
|
6
|
-
if (heading.level !== 2)
|
|
7
|
-
continue;
|
|
8
|
-
if (found.length > 0)
|
|
9
|
-
found[found.length - 1] = { ...found[found.length - 1], bodyEnd: heading.start };
|
|
10
|
-
found.push({
|
|
11
|
-
name: heading.name,
|
|
12
|
-
headingStart: heading.start,
|
|
13
|
-
bodyStart: heading.next,
|
|
14
|
-
bodyEnd: content.length,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return found;
|
|
18
|
-
}
|
|
19
|
-
export function sectionsRecord(spans, content) {
|
|
20
|
-
const record = Object.create(null);
|
|
21
|
-
for (const span of spans) {
|
|
22
|
-
if (record[span.name] === undefined)
|
|
23
|
-
record[span.name] = content.slice(span.bodyStart, span.bodyEnd);
|
|
24
|
-
}
|
|
25
|
-
return record;
|
|
26
|
-
}
|
|
27
|
-
function trimmed(content, extent) {
|
|
28
|
-
let { start, end } = extent;
|
|
29
|
-
while (start < end && /\s/.test(content[start]))
|
|
30
|
-
start += 1;
|
|
31
|
-
while (end > start && /\s/.test(content[end - 1]))
|
|
32
|
-
end -= 1;
|
|
33
|
-
return { start, end };
|
|
34
|
-
}
|
|
35
|
-
export function listItems(content, from, to) {
|
|
36
|
-
const items = [];
|
|
37
|
-
let indent;
|
|
38
|
-
let start = from;
|
|
39
|
-
while (start < to) {
|
|
40
|
-
const newline = content.indexOf('\n', start);
|
|
41
|
-
const end = newline === -1 || newline >= to ? to : newline;
|
|
42
|
-
const line = content.slice(start, end);
|
|
43
|
-
start = end + 1;
|
|
44
|
-
if (line.trim() === '')
|
|
45
|
-
continue;
|
|
46
|
-
const item = ITEM.exec(line);
|
|
47
|
-
if (item !== null && (indent === undefined || item[1].length === indent)) {
|
|
48
|
-
indent = item[1].length;
|
|
49
|
-
items.push({ start: end - line.length + item[0].length, end });
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
if (indent === undefined || /^\s*/.exec(line)[0].length <= indent)
|
|
53
|
-
return null;
|
|
54
|
-
items[items.length - 1] = { start: items.at(-1).start, end };
|
|
55
|
-
}
|
|
56
|
-
return items.map((item) => trimmed(content, item));
|
|
57
|
-
}
|