@agentshouse/mdmodel 0.1.0-alpha.16 → 0.1.0-alpha.18
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 +52 -41
- package/README.md +2 -4
- package/dist/definition.d.ts +7 -3
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +83 -38
- package/dist/definition.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +529 -148
- package/dist/links.js.map +1 -1
- package/dist/paths.d.ts +0 -2
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +0 -7
- package/dist/paths.js.map +1 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +13 -17
- package/dist/project.js.map +1 -1
- package/dist/types.d.ts +6 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validate.d.ts +2 -3
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +42 -86
- package/dist/validate.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/yaml.js +1 -1
- package/dist/yaml.js.map +1 -1
- package/fixtures/README.md +53 -46
- package/fixtures/cases/binary-any-reference/schema.yaml +4 -0
- package/fixtures/cases/binary-document-collision/schema.yaml +2 -0
- package/fixtures/cases/binary-link-outside-collection/schema.yaml +2 -0
- package/fixtures/cases/binary-prototype-reference/schema.yaml +4 -0
- package/fixtures/cases/binary-typed-reference/schema.yaml +5 -0
- package/fixtures/cases/bracketed-link-definition/schema.yaml +6 -0
- package/fixtures/cases/declared-binary-links/schema.yaml +2 -0
- package/fixtures/cases/duplicate-link-definition/schema.yaml +6 -0
- package/fixtures/cases/fenced-link-definition/schema.yaml +6 -0
- package/fixtures/cases/field-enum/schema.yaml +7 -0
- package/fixtures/cases/frontmatter-schema/expected.json +6 -0
- package/fixtures/cases/frontmatter-schema/schema.yaml +6 -0
- package/fixtures/cases/interrupted-link-definition/schema.yaml +2 -0
- package/fixtures/cases/long-fence-link-definition/schema.yaml +2 -0
- package/fixtures/cases/malformed-definition/expected.json +1 -2
- package/fixtures/cases/malformed-definition/schema.yaml +4 -0
- package/fixtures/cases/member-document/context.json +1 -0
- package/fixtures/cases/member-document/library/people/ana.md +5 -0
- package/fixtures/cases/member-document/schema.yaml +5 -0
- package/fixtures/cases/missing-binary-image/schema.yaml +2 -0
- package/fixtures/cases/missing-binary-link/schema.yaml +2 -0
- package/fixtures/cases/missing-required-field/schema.yaml +7 -0
- package/fixtures/cases/missing-section-item-kind/expected.json +1 -2
- package/fixtures/cases/missing-section-item-kind/schema.yaml +6 -0
- package/fixtures/cases/paragraph-link-definition/schema.yaml +2 -0
- package/fixtures/cases/prototype-field/schema.yaml +6 -0
- package/fixtures/cases/quoted-link-definition/schema.yaml +2 -0
- package/fixtures/cases/referenced-missing-file/schema.yaml +10 -0
- package/fixtures/cases/second-member-document/context.json +1 -0
- package/fixtures/cases/second-member-document/expected.json +6 -0
- package/fixtures/cases/second-member-document/schema.yaml +5 -0
- package/fixtures/cases/shortcut-reference-link/context.json +1 -0
- package/fixtures/cases/shortcut-reference-link/expected.json +6 -0
- package/fixtures/cases/shortcut-reference-link/library/item.md +10 -0
- package/fixtures/cases/shortcut-reference-link/schema.yaml +6 -0
- package/fixtures/cases/structured-section/schema.yaml +7 -0
- package/fixtures/cases/submission-keys/schema.yaml +4 -0
- package/fixtures/cases/text-field-kind/context.json +1 -0
- package/fixtures/cases/text-field-kind/expected.json +7 -0
- package/fixtures/cases/text-field-kind/library/page.md +4 -0
- package/fixtures/cases/text-field-kind/schema.yaml +4 -0
- package/fixtures/cases/truncated-link-definition/schema.yaml +2 -0
- package/fixtures/cases/types-folder-content/schema.yaml +4 -0
- package/fixtures/cases/undeclared-field/schema.yaml +6 -0
- package/fixtures/cases/unknown-type/expected.json +7 -0
- package/fixtures/cases/unknown-type/schema.yaml +4 -0
- package/fixtures/cases/unlisted-reference-type/context.json +1 -0
- package/fixtures/cases/unlisted-reference-type/expected.json +6 -0
- package/fixtures/cases/unlisted-reference-type/schema.yaml +4 -0
- package/fixtures/cases/unresolved-link/schema.yaml +6 -0
- package/fixtures/cases/valid-typed-document/schema.yaml +15 -0
- package/fixtures/cases/wide-item-fence-link/schema.yaml +2 -0
- package/fixtures/division.json +1 -21
- package/fixtures/projection.json +58 -20
- package/package.json +1 -1
- package/fixtures/cases/binary-any-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-document-collision/library/types/note.md +0 -3
- package/fixtures/cases/binary-link-outside-collection/library/types/note.md +0 -3
- package/fixtures/cases/binary-prototype-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-typed-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-typed-reference/library/types/person.md +0 -3
- package/fixtures/cases/bracketed-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/declared-binary-links/library/types/note.md +0 -3
- package/fixtures/cases/duplicate-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/external-invalid-model/definitions/schema/task.md +0 -5
- package/fixtures/cases/external-invalid-model/expected.json +0 -1
- package/fixtures/cases/external-invalid-model/library/note.md +0 -1
- package/fixtures/cases/external-unknown-type/definitions/schema/task.md +0 -5
- package/fixtures/cases/external-unknown-type/expected.json +0 -1
- package/fixtures/cases/external-valid/context.json +0 -1
- package/fixtures/cases/external-valid/definitions/types/task.md +0 -5
- package/fixtures/cases/fenced-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/field-enum/library/types/task.md +0 -8
- package/fixtures/cases/interrupted-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/long-fence-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/malformed-definition/library/types/task.md +0 -5
- package/fixtures/cases/missing-binary-image/library/types/note.md +0 -3
- package/fixtures/cases/missing-binary-link/library/types/note.md +0 -3
- package/fixtures/cases/missing-required-field/library/types/task.md +0 -8
- package/fixtures/cases/missing-section-item-kind/library/types/task.md +0 -7
- package/fixtures/cases/paragraph-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/prd-definition/library/types/task.md +0 -16
- package/fixtures/cases/prototype-field/library/types/task.md +0 -7
- package/fixtures/cases/quoted-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/referenced-missing-file/library/types/person.md +0 -5
- package/fixtures/cases/referenced-missing-file/library/types/task.md +0 -8
- package/fixtures/cases/structured-section/library/types/task.md +0 -8
- package/fixtures/cases/submission-keys/library/types/note.md +0 -5
- package/fixtures/cases/truncated-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/undeclared-field/library/types/task.md +0 -7
- package/fixtures/cases/unresolved-link/library/types/task.md +0 -7
- package/fixtures/cases/valid-typed-document/library/types/person.md +0 -5
- package/fixtures/cases/valid-typed-document/library/types/task.md +0 -13
- package/fixtures/cases/wide-item-fence-link/library/types/note.md +0 -3
- /package/fixtures/cases/{prd-definition → frontmatter-schema}/context.json +0 -0
- /package/fixtures/cases/{prd-definition → member-document}/expected.json +0 -0
- /package/fixtures/cases/{external-invalid-model → types-folder-content}/context.json +0 -0
- /package/fixtures/cases/{external-valid → types-folder-content}/expected.json +0 -0
- /package/fixtures/cases/{external-valid → types-folder-content}/library/types/task.md +0 -0
- /package/fixtures/cases/{external-unknown-type → unknown-type}/context.json +0 -0
- /package/fixtures/cases/{external-unknown-type → unknown-type}/library/item.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
types:
|
|
2
|
+
person:
|
|
3
|
+
fields:
|
|
4
|
+
name: { kind: string, required: true }
|
|
5
|
+
task:
|
|
6
|
+
fields:
|
|
7
|
+
name: { kind: text }
|
|
8
|
+
title: { kind: string, required: true }
|
|
9
|
+
status: { kind: enum, values: [open, in-progress, done], required: true }
|
|
10
|
+
due: { kind: date }
|
|
11
|
+
owner: { kind: reference, to: person }
|
|
12
|
+
labels: { kind: list, of: string }
|
|
13
|
+
sections:
|
|
14
|
+
Description: { kind: text, required: true }
|
|
15
|
+
Acceptance: { kind: list, of: string }
|
package/fixtures/division.json
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"task": "---\ntype: definition\nfields:\n name: { kind: text }\n status: { kind: enum, values: [open, done], required: true }\nsections:\n Description: { kind: text, required: true }\n Acceptance: { kind: list, of: reference, to: person }\n---\n",
|
|
4
|
-
"unreadable-task": "---\ntype: definition\nsections:\n Description: { kind: prose }\n---\n"
|
|
5
|
-
},
|
|
2
|
+
"schema": "types:\n task:\n fields:\n name: { kind: text }\n status: { kind: enum, values: [open, done], required: true }\n sections:\n Description: { kind: text, required: true }\n Acceptance: { kind: list, of: reference, to: person }\n person: {}\n",
|
|
6
3
|
"cases": [
|
|
7
4
|
{
|
|
8
5
|
"name": "a Document whose whole input fits the budget is one Span carrying its projection",
|
|
@@ -302,23 +299,6 @@
|
|
|
302
299
|
}
|
|
303
300
|
}
|
|
304
301
|
},
|
|
305
|
-
{
|
|
306
|
-
"name": "a definition the model cannot read is refused at that definition",
|
|
307
|
-
"file": "tasks/one.md",
|
|
308
|
-
"source": "---\ntype: task\nname: Ship the release\nstatus: open\n---\n\nPreamble prose.\n\n## Description\n\nBody of the description.\n\n## Acceptance\n\n- people/ana.md\n",
|
|
309
|
-
"documentTargets": [],
|
|
310
|
-
"definition": "unreadable-task",
|
|
311
|
-
"budget": 4096,
|
|
312
|
-
"expected": {
|
|
313
|
-
"ok": false,
|
|
314
|
-
"refusal": {
|
|
315
|
-
"file": "types/task.md",
|
|
316
|
-
"rule": "definition-section-kind",
|
|
317
|
-
"version": "<package-version>",
|
|
318
|
-
"location": "Description"
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
302
|
{
|
|
323
303
|
"name": "a budget that cannot hold one whole character is refused before any division",
|
|
324
304
|
"file": "notes/one.md",
|
package/fixtures/projection.json
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"task": "---\ntype: definition\nfields:\n name: { kind: text, required: true }\n aliases: { kind: list, of: text }\n title: { kind: string, required: true }\n status: { kind: enum, values: [open, done], required: true }\n owner: { kind: reference, to: person }\n due: { kind: date }\n estimate: { kind: number }\n labels: { kind: list, of: string }\nsections:\n Description: { kind: text, required: true }\n Acceptance: { kind: list, of: reference, to: person }\n Checklist: { kind: list, of: text }\n---\n",
|
|
4
|
-
"unreadable-task": "---\ntype: definition\nsections:\n Description: { kind: prose }\n---\n"
|
|
5
|
-
},
|
|
2
|
+
"schema": "types:\n task:\n fields:\n name: { kind: text, required: true }\n aliases: { kind: list, of: text }\n title: { kind: string, required: true }\n status: { kind: enum, values: [open, done], required: true }\n owner: { kind: reference, to: person }\n due: { kind: date }\n estimate: { kind: number }\n labels: { kind: list, of: string }\n sections:\n Description: { kind: text, required: true }\n Acceptance: { kind: list, of: reference, to: person }\n Checklist: { kind: list, of: text }\n person: {}\n",
|
|
6
3
|
"cases": [
|
|
7
4
|
{
|
|
8
5
|
"name": "any body keeps labels and leaves every unsupplied destination authored",
|
|
@@ -83,6 +80,14 @@
|
|
|
83
80
|
"href": "../plans/q3.md",
|
|
84
81
|
"to": "../plans/2026-q3.md"
|
|
85
82
|
},
|
|
83
|
+
"relabel": {
|
|
84
|
+
"from": "[the plan][plan] and",
|
|
85
|
+
"to": "[the roadmap][plan] and",
|
|
86
|
+
"expected": {
|
|
87
|
+
"ok": true,
|
|
88
|
+
"text": "Shipping the release\n\n\nPreamble prose that mentions the plan.\n\n## Description\n\nFollow the roadmap and the plan again, then read it.\n\n\n## Checklist\n\n- the plan is read\n\n## Notes\n\nUndeclared prose about the plan.\n"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
86
91
|
"expected": {
|
|
87
92
|
"ok": true,
|
|
88
93
|
"text": "Shipping the release\n\n\nPreamble prose that mentions the plan.\n\n## Description\n\nFollow the plan and the plan again, then read it.\n\n\n## Checklist\n\n- the plan is read\n\n## Notes\n\nUndeclared prose about the plan.\n"
|
|
@@ -145,29 +150,27 @@
|
|
|
145
150
|
}
|
|
146
151
|
},
|
|
147
152
|
{
|
|
148
|
-
"name": "a
|
|
149
|
-
"file": "
|
|
150
|
-
"source": "
|
|
153
|
+
"name": "an image at a supplied Markdown document target is projected like its link",
|
|
154
|
+
"file": "notes/four.md",
|
|
155
|
+
"source": "Read [the plan](../plans/q3.md) and .\nAlso [the plan][plan] and ![the chart][plan].\n\n[plan]: ../plans/q3.md\n",
|
|
151
156
|
"documentTargets": [
|
|
152
157
|
"plans/q3.md",
|
|
153
158
|
"plans/2026-q3.md"
|
|
154
159
|
],
|
|
155
|
-
"definition":
|
|
156
|
-
"move":
|
|
160
|
+
"definition": null,
|
|
161
|
+
"move": {
|
|
162
|
+
"href": "../plans/q3.md",
|
|
163
|
+
"to": "../plans/2026-q3.md"
|
|
164
|
+
},
|
|
157
165
|
"expected": {
|
|
158
|
-
"ok":
|
|
159
|
-
"
|
|
160
|
-
"file": "types/task.md",
|
|
161
|
-
"rule": "definition-section-kind",
|
|
162
|
-
"version": "<package-version>",
|
|
163
|
-
"location": "Description"
|
|
164
|
-
}
|
|
166
|
+
"ok": true,
|
|
167
|
+
"text": "Read the plan and the chart.\nAlso the plan and the chart.\n\n"
|
|
165
168
|
}
|
|
166
169
|
},
|
|
167
170
|
{
|
|
168
|
-
"name": "
|
|
169
|
-
"file": "notes/
|
|
170
|
-
"source": "Read [
|
|
171
|
+
"name": "a shortcut reference link projects its label and its definition leaves the projection",
|
|
172
|
+
"file": "notes/five.md",
|
|
173
|
+
"source": "Read [Plan] and [the draft], then [plan](not a link).\nAlso [[Plan]], [ plan ], \\[Plan] and [Release plan].\n\n[plan]: ../plans/q3.md\n[release plan]: ../plans/q3.md\n",
|
|
171
174
|
"documentTargets": [
|
|
172
175
|
"plans/q3.md",
|
|
173
176
|
"plans/2026-q3.md"
|
|
@@ -177,9 +180,44 @@
|
|
|
177
180
|
"href": "../plans/q3.md",
|
|
178
181
|
"to": "../plans/2026-q3.md"
|
|
179
182
|
},
|
|
183
|
+
"links": [
|
|
184
|
+
{
|
|
185
|
+
"href": "../plans/q3.md",
|
|
186
|
+
"target": "plans/q3.md"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
180
189
|
"expected": {
|
|
181
190
|
"ok": true,
|
|
182
|
-
"text": "Read the plan
|
|
191
|
+
"text": "Read Plan and [the draft], then plan(not a link).\nAlso [Plan], plan , \\[Plan] and Release plan.\n\n"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "an image whose description holds a link projects both labels",
|
|
196
|
+
"file": "notes/six.md",
|
|
197
|
+
"source": "Read ](../plans/q4.md).\n",
|
|
198
|
+
"documentTargets": [
|
|
199
|
+
"plans/q3.md",
|
|
200
|
+
"plans/2026-q3.md",
|
|
201
|
+
"plans/q4.md"
|
|
202
|
+
],
|
|
203
|
+
"definition": null,
|
|
204
|
+
"move": {
|
|
205
|
+
"href": "../plans/q3.md",
|
|
206
|
+
"to": "../plans/2026-q3.md"
|
|
207
|
+
},
|
|
208
|
+
"links": [
|
|
209
|
+
{
|
|
210
|
+
"href": "../plans/q3.md",
|
|
211
|
+
"target": "plans/q3.md"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"href": "../plans/q4.md",
|
|
215
|
+
"target": "plans/q4.md"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"expected": {
|
|
219
|
+
"ok": true,
|
|
220
|
+
"text": "Read outer Plan.\n"
|
|
183
221
|
}
|
|
184
222
|
}
|
|
185
223
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/mdmodel",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.18",
|
|
4
4
|
"description": "MD Type language, parser, validator, structured change application, Markdown syntax profile, and conformance fixtures",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"verdict":"refuse","source":"model","file":"schema/task.md","location":"title","rule":"definition-field-kind","version":"<package-version>"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Loose
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"verdict":"refuse","source":"content","file":"item.md","location":"type","rule":"unknown-type","version":"<package-version>"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"binaryTargets":[]}
|