@agentshouse/mdmodel 0.1.0-cb304fd2c27f9 → 0.1.0-cbe9e36156a2a

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.
Files changed (366) hide show
  1. package/API.md +182 -165
  2. package/README.md +25 -25
  3. package/dist/body.d.ts +85 -0
  4. package/dist/body.d.ts.map +1 -0
  5. package/dist/body.js +1083 -0
  6. package/dist/built-in.d.ts +4 -0
  7. package/dist/built-in.d.ts.map +1 -0
  8. package/dist/built-in.js +19 -0
  9. package/dist/definition.d.ts +20 -11
  10. package/dist/definition.d.ts.map +1 -1
  11. package/dist/definition.js +178 -127
  12. package/dist/divide.d.ts.map +1 -1
  13. package/dist/divide.js +5 -4
  14. package/dist/document.d.ts +14 -9
  15. package/dist/document.d.ts.map +1 -1
  16. package/dist/document.js +726 -141
  17. package/dist/event.d.ts +77 -0
  18. package/dist/event.d.ts.map +1 -0
  19. package/dist/event.js +200 -0
  20. package/dist/facts.d.ts +15 -0
  21. package/dist/facts.d.ts.map +1 -0
  22. package/dist/facts.js +41 -0
  23. package/dist/fields.d.ts +1 -1
  24. package/dist/fields.d.ts.map +1 -1
  25. package/dist/fields.js +2 -2
  26. package/dist/form.d.ts +4 -0
  27. package/dist/form.d.ts.map +1 -0
  28. package/dist/form.js +153 -0
  29. package/dist/house-model.d.ts +831 -0
  30. package/dist/house-model.d.ts.map +1 -0
  31. package/dist/house-model.js +462 -0
  32. package/dist/house-references/crockford.d.ts +4 -0
  33. package/dist/house-references/crockford.d.ts.map +1 -0
  34. package/dist/house-references/crockford.js +3 -0
  35. package/dist/house-references/patterns.d.ts +9 -0
  36. package/dist/house-references/patterns.d.ts.map +1 -0
  37. package/dist/house-references/patterns.js +13 -0
  38. package/dist/index.d.ts +32 -20
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +21 -13
  41. package/dist/kinds.d.ts +2 -2
  42. package/dist/kinds.d.ts.map +1 -1
  43. package/dist/kinds.js +20 -11
  44. package/dist/markdown.d.ts +75 -0
  45. package/dist/markdown.d.ts.map +1 -0
  46. package/dist/markdown.js +265 -0
  47. package/dist/media-type.d.ts +72 -0
  48. package/dist/media-type.d.ts.map +1 -0
  49. package/dist/media-type.js +157 -0
  50. package/dist/paths.d.ts +10 -1
  51. package/dist/paths.d.ts.map +1 -1
  52. package/dist/paths.js +74 -19
  53. package/dist/pattern.d.ts.map +1 -1
  54. package/dist/pattern.js +4 -3
  55. package/dist/project.d.ts.map +1 -1
  56. package/dist/project.js +33 -60
  57. package/dist/query/language.d.ts +43 -7
  58. package/dist/query/language.d.ts.map +1 -1
  59. package/dist/query/language.js +151 -57
  60. package/dist/query/match.d.ts +3 -1
  61. package/dist/query/match.d.ts.map +1 -1
  62. package/dist/query/match.js +40 -8
  63. package/dist/query/rows.d.ts +1 -1
  64. package/dist/query/rows.d.ts.map +1 -1
  65. package/dist/query/rows.js +1 -1
  66. package/dist/query/sql.d.ts.map +1 -1
  67. package/dist/query/sql.js +7 -1
  68. package/dist/references.d.ts +2 -2
  69. package/dist/references.d.ts.map +1 -1
  70. package/dist/references.js +1 -1
  71. package/dist/refuse.d.ts +1 -0
  72. package/dist/refuse.d.ts.map +1 -1
  73. package/dist/refuse.js +1 -0
  74. package/dist/reserved.d.ts +1 -0
  75. package/dist/reserved.d.ts.map +1 -1
  76. package/dist/reserved.js +2 -1
  77. package/dist/room-types.d.ts +7 -0
  78. package/dist/room-types.d.ts.map +1 -0
  79. package/dist/room-types.js +136 -0
  80. package/dist/schema.d.ts +1 -3
  81. package/dist/schema.d.ts.map +1 -1
  82. package/dist/schema.js +9 -73
  83. package/dist/types.d.ts +15 -22
  84. package/dist/types.d.ts.map +1 -1
  85. package/dist/validate.d.ts +8 -5
  86. package/dist/validate.d.ts.map +1 -1
  87. package/dist/validate.js +142 -180
  88. package/dist/yaml.d.ts +4 -4
  89. package/dist/yaml.d.ts.map +1 -1
  90. package/dist/yaml.js +5 -12
  91. package/fixtures/README.md +40 -23
  92. package/fixtures/cases/absent-link-dangles/library/item.md +1 -1
  93. package/fixtures/cases/absent-link-dangles/schema.yaml +2 -3
  94. package/fixtures/cases/absent-optional-field/library/companies/acme.md +1 -1
  95. package/fixtures/cases/absent-optional-field/library/deals/lead.md +3 -3
  96. package/fixtures/cases/absent-optional-field/schema.yaml +10 -11
  97. package/fixtures/cases/absolute-link/library/item.md +1 -1
  98. package/fixtures/cases/absolute-link/schema.yaml +2 -3
  99. package/fixtures/cases/attachment-reference-any-file/library/companies/acme.md +1 -1
  100. package/fixtures/cases/attachment-reference-any-file/library/deals/renewal.md +13 -10
  101. package/fixtures/cases/attachment-reference-any-file/library/places/depot.md +1 -1
  102. package/fixtures/cases/attachment-reference-any-file/library/products/seats.md +1 -1
  103. package/fixtures/cases/attachment-reference-any-file/library/products/support.md +1 -1
  104. package/fixtures/cases/attachment-reference-dangles/library/companies/acme.md +1 -1
  105. package/fixtures/cases/attachment-reference-dangles/library/deals/renewal.md +13 -10
  106. package/fixtures/cases/attachment-reference-dangles/library/places/depot.md +1 -1
  107. package/fixtures/cases/attachment-reference-dangles/library/products/seats.md +1 -1
  108. package/fixtures/cases/attachment-reference-dangles/library/products/support.md +1 -1
  109. package/fixtures/cases/attachment-reference-outside/expected.json +2 -1
  110. package/fixtures/cases/attachment-reference-outside/library/companies/acme.md +1 -1
  111. package/fixtures/cases/attachment-reference-outside/library/deals/renewal.md +13 -10
  112. package/fixtures/cases/attachment-reference-outside/library/places/depot.md +1 -1
  113. package/fixtures/cases/attachment-reference-outside/library/products/seats.md +1 -1
  114. package/fixtures/cases/attachment-reference-outside/library/products/support.md +1 -1
  115. package/fixtures/cases/binary-any-reference/expected.json +2 -1
  116. package/fixtures/cases/binary-any-reference/library/notes/draft.md +1 -1
  117. package/fixtures/cases/binary-prototype-reference/expected.json +2 -1
  118. package/fixtures/cases/binary-prototype-reference/library/notes/draft.md +1 -1
  119. package/fixtures/cases/binary-typed-reference/expected.json +2 -1
  120. package/fixtures/cases/binary-typed-reference/library/notes/draft.md +1 -1
  121. package/fixtures/cases/boolean-field/expected.json +2 -1
  122. package/fixtures/cases/boolean-field/library/companies/acme.md +1 -1
  123. package/fixtures/cases/boolean-field/library/deals/renewal.md +49 -24
  124. package/fixtures/cases/boolean-field/schema.yaml +10 -11
  125. package/fixtures/cases/bracketed-link-definition/library/item.md +1 -1
  126. package/fixtures/cases/bracketed-link-definition/schema.yaml +2 -3
  127. package/fixtures/cases/closed-nested-object/expected.json +2 -1
  128. package/fixtures/cases/closed-nested-object/library/companies/acme.md +1 -1
  129. package/fixtures/cases/closed-nested-object/library/deals/renewal.md +50 -25
  130. package/fixtures/cases/closed-nested-object/schema.yaml +10 -11
  131. package/fixtures/cases/composed-root-reference/library/a.md +2 -2
  132. package/fixtures/cases/{conditional-section → conditional-long-text}/expected.json +3 -2
  133. package/fixtures/cases/{conditional-section → conditional-long-text}/library/questions/hosting.md +2 -2
  134. package/fixtures/cases/{conditional-section → conditional-long-text}/library/questions/payments.md +2 -2
  135. package/fixtures/cases/conditional-long-text/schema.yaml +13 -0
  136. package/fixtures/cases/cross-room-link/library/clients/acme.md +1 -1
  137. package/fixtures/cases/cross-room-reference/library/clients/acme.md +4 -4
  138. package/fixtures/cases/cross-room-reference/schema.yaml +1 -2
  139. package/fixtures/cases/date-time-format/expected.json +2 -1
  140. package/fixtures/cases/date-time-format/library/companies/acme.md +1 -1
  141. package/fixtures/cases/date-time-format/library/deals/renewal.md +49 -24
  142. package/fixtures/cases/date-time-format/schema.yaml +10 -11
  143. package/fixtures/cases/default-unfilled/library/companies/acme.md +1 -1
  144. package/fixtures/cases/default-unfilled/library/deals/renewal.md +47 -22
  145. package/fixtures/cases/default-unfilled/schema.yaml +10 -11
  146. package/fixtures/cases/defs-pattern/expected.json +2 -1
  147. package/fixtures/cases/defs-pattern/library/companies/acme.md +1 -1
  148. package/fixtures/cases/defs-pattern/library/deals/renewal.md +49 -24
  149. package/fixtures/cases/defs-pattern/schema.yaml +10 -11
  150. package/fixtures/cases/dependent-rule/library/companies/acme.md +1 -1
  151. package/fixtures/cases/dependent-rule/library/deals/renewal.md +48 -23
  152. package/fixtures/cases/dependent-rule/schema.yaml +10 -11
  153. package/fixtures/cases/duplicate-link-definition/library/item.md +1 -1
  154. package/fixtures/cases/duplicate-link-definition/schema.yaml +2 -3
  155. package/fixtures/cases/email-format/expected.json +2 -1
  156. package/fixtures/cases/email-format/library/companies/acme.md +1 -1
  157. package/fixtures/cases/email-format/library/deals/renewal.md +49 -24
  158. package/fixtures/cases/email-format/schema.yaml +10 -11
  159. package/fixtures/cases/equal-labels/expected.json +5 -0
  160. package/fixtures/cases/equal-labels/schema.yaml +4 -0
  161. package/fixtures/cases/fenced-link-definition/library/item.md +1 -1
  162. package/fixtures/cases/fenced-link-definition/schema.yaml +2 -3
  163. package/fixtures/cases/field-enum/expected.json +2 -1
  164. package/fixtures/cases/field-enum/library/item.md +2 -2
  165. package/fixtures/cases/field-enum/schema.yaml +3 -4
  166. package/fixtures/cases/integer-field/expected.json +2 -1
  167. package/fixtures/cases/integer-field/library/companies/acme.md +1 -1
  168. package/fixtures/cases/integer-field/library/deals/renewal.md +49 -24
  169. package/fixtures/cases/integer-field/schema.yaml +10 -11
  170. package/fixtures/cases/json-schema-constructs/library/companies/acme.md +1 -1
  171. package/fixtures/cases/json-schema-constructs/library/deals/renewal.md +49 -24
  172. package/fixtures/cases/json-schema-constructs/schema.yaml +10 -11
  173. package/fixtures/cases/labels-in-the-rooms-language/library/deals/atlas.md +7 -0
  174. package/fixtures/cases/labels-in-the-rooms-language/schema.yaml +9 -0
  175. package/fixtures/cases/lazy-list-item/expected.json +3 -0
  176. package/fixtures/cases/lazy-list-item/library/item.md +10 -0
  177. package/fixtures/cases/lazy-list-item/schema.yaml +3 -0
  178. package/fixtures/cases/link-into-a-reserved-name/library/notes/a.md +1 -1
  179. package/fixtures/cases/list-item-enum/expected.json +7 -0
  180. package/fixtures/cases/list-item-enum/library/task.md +7 -0
  181. package/fixtures/cases/list-item-enum/schema.yaml +3 -0
  182. package/fixtures/cases/list-item-kind/expected.json +7 -0
  183. package/fixtures/cases/list-item-kind/library/task.md +6 -0
  184. package/fixtures/cases/list-item-kind/schema.yaml +3 -0
  185. package/fixtures/cases/list-items/expected.json +1 -0
  186. package/fixtures/cases/list-items/library/page.md +26 -0
  187. package/fixtures/cases/list-items/schema.yaml +10 -0
  188. package/fixtures/cases/list-of-objects-closed/expected.json +2 -1
  189. package/fixtures/cases/list-of-objects-closed/library/companies/acme.md +1 -1
  190. package/fixtures/cases/list-of-objects-closed/library/deals/renewal.md +49 -25
  191. package/fixtures/cases/list-of-objects-closed/schema.yaml +10 -11
  192. package/fixtures/cases/list-of-objects-item/expected.json +2 -1
  193. package/fixtures/cases/list-of-objects-item/library/companies/acme.md +1 -1
  194. package/fixtures/cases/list-of-objects-item/library/deals/renewal.md +49 -24
  195. package/fixtures/cases/list-of-objects-item/schema.yaml +10 -11
  196. package/fixtures/cases/list-of-objects-reference/expected.json +2 -1
  197. package/fixtures/cases/list-of-objects-reference/library/companies/acme.md +1 -1
  198. package/fixtures/cases/list-of-objects-reference/library/deals/renewal.md +12 -9
  199. package/fixtures/cases/list-of-objects-reference/library/places/depot.md +1 -1
  200. package/fixtures/cases/list-of-objects-reference/library/products/seats.md +1 -1
  201. package/fixtures/cases/list-of-objects-reference/library/products/support.md +1 -1
  202. package/fixtures/cases/list-reference-path/expected.json +7 -0
  203. package/fixtures/cases/list-reference-path/library/page.md +5 -0
  204. package/fixtures/cases/list-reference-path/schema.yaml +3 -0
  205. package/fixtures/cases/list-reference-type/expected.json +7 -0
  206. package/fixtures/cases/list-reference-type/library/page.md +6 -0
  207. package/fixtures/cases/list-reference-type/schema.yaml +3 -0
  208. package/fixtures/cases/list-size/expected.json +2 -1
  209. package/fixtures/cases/list-size/library/companies/acme.md +1 -1
  210. package/fixtures/cases/list-size/library/deals/renewal.md +51 -24
  211. package/fixtures/cases/list-size/schema.yaml +10 -11
  212. package/fixtures/cases/long-value-past-six-levels/expected.json +5 -0
  213. package/fixtures/cases/long-value-past-six-levels/schema.yaml +15 -0
  214. package/fixtures/cases/malformed-list/context.json +1 -0
  215. package/fixtures/cases/malformed-list/expected.json +7 -0
  216. package/fixtures/cases/{structured-section → malformed-list}/library/item.md +1 -1
  217. package/fixtures/cases/malformed-list/schema.yaml +6 -0
  218. package/fixtures/cases/member-document/library/people/ana.md +2 -2
  219. package/fixtures/cases/member-on-another-type/library/note.md +1 -1
  220. package/fixtures/cases/missing-required-field/library/item.md +1 -1
  221. package/fixtures/cases/missing-required-field/schema.yaml +3 -4
  222. package/fixtures/cases/misspelled-key/expected.json +2 -1
  223. package/fixtures/cases/misspelled-key/library/companies/acme.md +1 -1
  224. package/fixtures/cases/misspelled-key/library/deals/renewal.md +50 -25
  225. package/fixtures/cases/misspelled-key/schema.yaml +10 -11
  226. package/fixtures/cases/name-not-a-string/context.json +1 -0
  227. package/fixtures/cases/name-not-a-string/expected.json +5 -0
  228. package/fixtures/cases/name-not-a-string/schema.yaml +5 -0
  229. package/fixtures/cases/nested-defs/expected.json +2 -1
  230. package/fixtures/cases/nested-defs/library/deal.md +3 -3
  231. package/fixtures/cases/nested-object-reference/expected.json +2 -1
  232. package/fixtures/cases/nested-object-reference/library/companies/acme.md +1 -1
  233. package/fixtures/cases/nested-object-reference/library/deals/renewal.md +12 -9
  234. package/fixtures/cases/nested-object-reference/library/places/depot.md +1 -1
  235. package/fixtures/cases/nested-object-reference/library/products/seats.md +1 -1
  236. package/fixtures/cases/nested-object-reference/library/products/support.md +1 -1
  237. package/fixtures/cases/nested-reference/library/companies/acme.md +1 -1
  238. package/fixtures/cases/nested-reference/library/deals/renewal.md +13 -10
  239. package/fixtures/cases/nested-reference/library/places/depot.md +1 -1
  240. package/fixtures/cases/nested-reference/library/products/seats.md +1 -1
  241. package/fixtures/cases/nested-reference/library/products/support.md +1 -1
  242. package/fixtures/cases/nested-required-field/expected.json +2 -1
  243. package/fixtures/cases/nested-required-field/library/companies/acme.md +1 -1
  244. package/fixtures/cases/nested-required-field/library/deals/renewal.md +48 -23
  245. package/fixtures/cases/nested-required-field/schema.yaml +10 -11
  246. package/fixtures/cases/numeric-range/expected.json +2 -1
  247. package/fixtures/cases/numeric-range/library/companies/acme.md +1 -1
  248. package/fixtures/cases/numeric-range/library/deals/renewal.md +49 -24
  249. package/fixtures/cases/numeric-range/schema.yaml +10 -11
  250. package/fixtures/cases/one-key-two-labels/context.json +1 -0
  251. package/fixtures/cases/one-key-two-labels/expected.json +5 -0
  252. package/fixtures/cases/one-key-two-labels/schema.yaml +5 -0
  253. package/fixtures/cases/one-key-two-types/context.json +1 -0
  254. package/fixtures/cases/one-key-two-types/expected.json +5 -0
  255. package/fixtures/cases/one-key-two-types/schema.yaml +4 -0
  256. package/fixtures/cases/one-of-variant/expected.json +2 -1
  257. package/fixtures/cases/one-of-variant/library/companies/acme.md +1 -1
  258. package/fixtures/cases/one-of-variant/library/deals/renewal.md +49 -24
  259. package/fixtures/cases/one-of-variant/schema.yaml +10 -11
  260. package/fixtures/cases/other-room-reference/expected.json +2 -1
  261. package/fixtures/cases/other-room-reference/library/companies/acme.md +1 -1
  262. package/fixtures/cases/other-room-reference/library/deals/renewal.md +12 -9
  263. package/fixtures/cases/other-room-reference/library/places/depot.md +1 -1
  264. package/fixtures/cases/other-room-reference/library/products/seats.md +1 -1
  265. package/fixtures/cases/other-room-reference/library/products/support.md +1 -1
  266. package/fixtures/cases/prototype-field/expected.json +2 -1
  267. package/fixtures/cases/prototype-field/library/item.md +2 -2
  268. package/fixtures/cases/prototype-field/schema.yaml +2 -3
  269. package/fixtures/cases/reference-into-a-reserved-name/expected.json +2 -1
  270. package/fixtures/cases/reference-into-a-reserved-name/library/notes/a.md +1 -1
  271. package/fixtures/cases/referenced-missing-file/library/a.md +2 -2
  272. package/fixtures/cases/referenced-missing-file/library/b.md +2 -2
  273. package/fixtures/cases/referenced-missing-file/schema.yaml +3 -4
  274. package/fixtures/cases/sections-keyword-refused/context.json +1 -0
  275. package/fixtures/cases/sections-keyword-refused/expected.json +5 -0
  276. package/fixtures/cases/{structured-section → sections-keyword-refused}/schema.yaml +1 -2
  277. package/fixtures/cases/shortcut-reference-link/library/item.md +1 -1
  278. package/fixtures/cases/shortcut-reference-link/schema.yaml +2 -3
  279. package/fixtures/cases/string-length/expected.json +2 -1
  280. package/fixtures/cases/string-length/library/companies/acme.md +1 -1
  281. package/fixtures/cases/string-length/library/deals/renewal.md +49 -24
  282. package/fixtures/cases/string-length/schema.yaml +10 -11
  283. package/fixtures/cases/submission-keys/library/notes/visitor.md +2 -2
  284. package/fixtures/cases/text-field-kind/expected.json +1 -4
  285. package/fixtures/cases/text-field-kind/library/page.md +1 -1
  286. package/fixtures/cases/thematic-break-ends-the-values/context.json +1 -0
  287. package/fixtures/cases/thematic-break-ends-the-values/expected.json +1 -0
  288. package/fixtures/cases/thematic-break-ends-the-values/library/item.md +10 -0
  289. package/fixtures/cases/thematic-break-ends-the-values/schema.yaml +3 -0
  290. package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/one.md +1 -1
  291. package/fixtures/cases/types-folder-content/library/types/task.md +1 -1
  292. package/fixtures/cases/undeclared-field/expected.json +2 -1
  293. package/fixtures/cases/undeclared-field/library/item.md +2 -2
  294. package/fixtures/cases/undeclared-field/schema.yaml +2 -3
  295. package/fixtures/cases/unevaluated-items-closed/expected.json +2 -1
  296. package/fixtures/cases/unevaluated-items-closed/library/trip.md +13 -3
  297. package/fixtures/cases/unnamed-typed-path-checks-its-fields/library/rooms/team/tasks/plan.md +2 -1
  298. package/fixtures/cases/unnamed-typed-path-names-a-type/library/rooms/team/tasks/plan.md +3 -2
  299. package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/tasks/plan.md +3 -2
  300. package/fixtures/cases/unnamed-typed-path-without-a-body/library/rooms/team/tasks/plan.md +2 -2
  301. package/fixtures/cases/unresolved-link/library/item.md +1 -1
  302. package/fixtures/cases/unresolved-link/schema.yaml +2 -3
  303. package/fixtures/cases/valid-typed-document/library/people/ada.md +1 -1
  304. package/fixtures/cases/valid-typed-document/library/tasks/one.md +11 -11
  305. package/fixtures/cases/valid-typed-document/schema.yaml +5 -6
  306. package/fixtures/division.json +86 -41
  307. package/fixtures/forms.json +347 -0
  308. package/fixtures/preamble.json +26 -5
  309. package/fixtures/projection.json +121 -18
  310. package/fixtures/queries.json +52 -1
  311. package/package.json +10 -1
  312. package/dist/blocks.d.ts +0 -11
  313. package/dist/blocks.d.ts.map +0 -1
  314. package/dist/blocks.js +0 -91
  315. package/dist/condition.d.ts +0 -179
  316. package/dist/condition.d.ts.map +0 -1
  317. package/dist/condition.js +0 -598
  318. package/dist/links.d.ts +0 -29
  319. package/dist/links.d.ts.map +0 -1
  320. package/dist/links.js +0 -831
  321. package/dist/profile.d.ts +0 -6
  322. package/dist/profile.d.ts.map +0 -1
  323. package/dist/profile.js +0 -5
  324. package/dist/sections.d.ts +0 -11
  325. package/dist/sections.d.ts.map +0 -1
  326. package/dist/sections.js +0 -57
  327. package/fixtures/cases/conditional-section/schema.yaml +0 -14
  328. package/fixtures/cases/missing-section-item-kind/expected.json +0 -5
  329. package/fixtures/cases/missing-section-item-kind/schema.yaml +0 -6
  330. package/fixtures/cases/null-refused/expected.json +0 -6
  331. package/fixtures/cases/null-refused/library/companies/acme.md +0 -4
  332. package/fixtures/cases/null-refused/library/deals/renewal.md +0 -31
  333. package/fixtures/cases/null-refused/schema.yaml +0 -56
  334. package/fixtures/cases/open-map-value/expected.json +0 -6
  335. package/fixtures/cases/open-map-value/library/companies/acme.md +0 -4
  336. package/fixtures/cases/open-map-value/library/deals/renewal.md +0 -31
  337. package/fixtures/cases/open-map-value/schema.yaml +0 -56
  338. package/fixtures/cases/section-item-enum/expected.json +0 -6
  339. package/fixtures/cases/section-item-enum/library/task.md +0 -8
  340. package/fixtures/cases/section-item-enum/schema.yaml +0 -3
  341. package/fixtures/cases/section-item-kind/expected.json +0 -6
  342. package/fixtures/cases/section-item-kind/library/task.md +0 -8
  343. package/fixtures/cases/section-item-kind/schema.yaml +0 -3
  344. package/fixtures/cases/section-items/library/page.md +0 -42
  345. package/fixtures/cases/section-items/schema.yaml +0 -10
  346. package/fixtures/cases/section-reference-path/expected.json +0 -6
  347. package/fixtures/cases/section-reference-path/library/page.md +0 -7
  348. package/fixtures/cases/section-reference-path/schema.yaml +0 -3
  349. package/fixtures/cases/section-reference-type/expected.json +0 -6
  350. package/fixtures/cases/section-reference-type/library/page.md +0 -7
  351. package/fixtures/cases/section-reference-type/schema.yaml +0 -3
  352. package/fixtures/cases/structured-section/expected.json +0 -6
  353. /package/fixtures/cases/{conditional-section → conditional-long-text}/context.json +0 -0
  354. /package/fixtures/cases/{missing-section-item-kind → equal-labels}/context.json +0 -0
  355. /package/fixtures/cases/{null-refused → labels-in-the-rooms-language}/context.json +0 -0
  356. /package/fixtures/cases/{section-items → labels-in-the-rooms-language}/expected.json +0 -0
  357. /package/fixtures/cases/{open-map-value → lazy-list-item}/context.json +0 -0
  358. /package/fixtures/cases/{section-item-enum → list-item-enum}/context.json +0 -0
  359. /package/fixtures/cases/{section-item-kind → list-item-kind}/context.json +0 -0
  360. /package/fixtures/cases/{section-items → list-items}/context.json +0 -0
  361. /package/fixtures/cases/{section-items → list-items}/library/other.md +0 -0
  362. /package/fixtures/cases/{section-reference-path → list-reference-path}/context.json +0 -0
  363. /package/fixtures/cases/{section-reference-path → list-reference-path}/library/other.md +0 -0
  364. /package/fixtures/cases/{section-reference-type → list-reference-type}/context.json +0 -0
  365. /package/fixtures/cases/{section-reference-type → list-reference-type}/library/note.md +0 -0
  366. /package/fixtures/cases/{structured-section → long-value-past-six-levels}/context.json +0 -0
@@ -77,12 +77,33 @@
77
77
  "expected": "---\ntype: note\n---\nPlain replacement.\n"
78
78
  },
79
79
  {
80
- "name": "existing section parser ignores other heading forms",
81
- "source": "# Title\n### Subheading\n> ## Quoted\n ## Indented\nSetext\n------\n\n## Actual ##\nKept.\n",
82
- "preamble": "# Title\n### Subheading\n> ## Quoted\n ## Indented\nSetext\n------\n\n",
80
+ "name": "quoted, indented-code and deeper headings stay in the preamble",
81
+ "source": "# Title\n### Subheading\n> ## Quoted\n ## Indented\n\n## Actual ##\nKept.\n",
82
+ "preamble": "# Title\n### Subheading\n> ## Quoted\n ## Indented\n\n",
83
83
  "value": "Intro.\n",
84
84
  "expected": "Intro.\n## Actual ##\nKept.\n"
85
85
  },
86
+ {
87
+ "name": "a setext heading opens a section",
88
+ "source": "Intro.\n\nBody\n------\nKept.\n",
89
+ "preamble": "Intro.\n\n",
90
+ "value": "New intro.\n\n",
91
+ "expected": "New intro.\n\nBody\n------\nKept.\n"
92
+ },
93
+ {
94
+ "name": "an indented or empty H2 opens a section",
95
+ "source": "Intro.\n ## Body\nKept.\n##\nMore.\n",
96
+ "preamble": "Intro.\n",
97
+ "value": "New intro.\n",
98
+ "expected": "New intro.\n ## Body\nKept.\n##\nMore.\n"
99
+ },
100
+ {
101
+ "name": "an HTML block hides a heading",
102
+ "source": "<!--\n## Hidden\n-->\n\n## Body\nKept.\n",
103
+ "preamble": "<!--\n## Hidden\n-->\n\n",
104
+ "value": "Intro.\n",
105
+ "expected": "Intro.\n## Body\nKept.\n"
106
+ },
86
107
  {
87
108
  "name": "Unicode and mixed newlines",
88
109
  "source": "---\r\ntype: note\r\n---\r\n🙂 Вступ\r\n\n## Body\nKept.\r\n",
@@ -99,9 +120,9 @@
99
120
  },
100
121
  {
101
122
  "name": "Runtime moved export link",
102
- "source": "---\ntype: note\ntitle: Filed note\n---\n\nFiled beside [the export](../data/export.csv).\n\n## Body\n\nThe destination above sits outside every section.\n",
123
+ "source": "---\ntype: note\n---\n\nFiled beside [the export](../data/export.csv).\n\n## Body\n\nThe destination above sits outside every section.\n",
103
124
  "preamble": "\nFiled beside [the export](../data/export.csv).\n\n",
104
125
  "value": "\nFiled beside [the export](../files/export.csv).\n\n",
105
- "expected": "---\ntype: note\ntitle: Filed note\n---\n\nFiled beside [the export](../files/export.csv).\n\n## Body\n\nThe destination above sits outside every section.\n"
126
+ "expected": "---\ntype: note\n---\n\nFiled beside [the export](../files/export.csv).\n\n## Body\n\nThe destination above sits outside every section.\n"
106
127
  }
107
128
  ]
@@ -1,5 +1,5 @@
1
1
  {
2
- "schema": "$defs:\n line: { type: string }\ntask:\n type: object\n properties:\n name: { type: string }\n aliases: { type: array, items: { type: string } }\n title: { type: string, pattern: '\\S' }\n status: { enum: [open, done] }\n owner: { type: string, reference: person }\n reviewers: { type: array, items: { type: string, reference: person } }\n due: { type: string, format: date }\n estimate: { type: number }\n labels: { type: array, items: { type: string, pattern: '^[a-z]+$' } }\n contact:\n type: object\n properties:\n note: { type: string }\n email: { type: string, format: email }\n notes: { type: object, additionalProperties: { type: string } }\n backup: { $ref: '#/$defs/line', format: email }\n memo: { type: [string, 'null'] }\n steps:\n type: array\n items:\n type: object\n properties:\n title: { type: string }\n done: { type: boolean }\n required: [name, title, status]\n sections:\n Description: { kind: text, required: true }\n Acceptance: { kind: list, items: { type: string, reference: person } }\n Checklist: { kind: list, items: { type: string } }\nperson: {}\n",
2
+ "schema": "$defs:\n line: { type: string }\ntask:\n type: object\n properties:\n name: { type: string }\n aliases: { type: array, items: { type: string } }\n title: { type: string, pattern: '\\S' }\n status: { enum: [open, done] }\n owner: { type: string, reference: person }\n reviewers: { type: array, items: { type: string, reference: person } }\n due: { type: string, format: date }\n estimate: { type: number }\n labels: { type: array, items: { type: string, pattern: '^[a-z]+$' } }\n contact:\n type: object\n properties:\n note: { type: string }\n email: { type: string, format: email }\n notes: { type: object, additionalProperties: { type: string } }\n backup: { $ref: '#/$defs/line', format: email }\n memo: { type: [string, 'null'] }\n steps:\n type: array\n items:\n type: object\n properties:\n title: { type: string }\n done: { type: boolean }\n description: { type: string, contentMediaType: text/markdown, minLength: 1, title: Description }\n acceptance: { type: array, items: { type: string, reference: person }, title: Acceptance }\n checklist: { type: array, items: { type: string }, title: Checklist }\n required: [name, title, status, description]\nperson: {}\n",
3
3
  "cases": [
4
4
  {
5
5
  "name": "any body keeps labels and leaves every unsupplied destination authored",
@@ -58,7 +58,7 @@
58
58
  {
59
59
  "name": "a typed Document projects its free-text field values as bare values and no other kind",
60
60
  "file": "tasks/four.md",
61
- "source": "---\ntype: task\nname: Ship the release\naliases: [\"Launch day\", Cutover]\ntitle: Ship it\nstatus: open\nowner: ../people/ana.md\ndue: 2026-09-30\nestimate: 3\nlabels: [core, urgent]\n---\n",
61
+ "source": "---\ntype: task\n---\n# Ship the release\n\n- **aliases**:\n - Launch day\n - Cutover\n- **title**: Ship it\n- **status**: open\n- **owner**: [Ana](../people/ana.md)\n- **due**: 2026-09-30\n- **estimate**: 3\n- **labels**:\n - core\n - urgent\n",
62
62
  "documentTargets": [],
63
63
  "definition": "task",
64
64
  "move": null,
@@ -70,7 +70,7 @@
70
70
  {
71
71
  "name": "a typed Document projects its prose at any depth in document order and leaves every filtered value out",
72
72
  "file": "tasks/twelve.md",
73
- "source": "---\ntype: task\nname: Ship the release\ntitle: Ship it\nstatus: open\nowner: ../people/ana.md\nreviewers: [../people/bo.md]\ndue: 2026-09-30\ncontact:\n note: Call before noon\n email: ana@example.com\nsteps:\n - title: Tag the build\n done: true\n - title: Announce it\n done: false\n---\n\n## Description\n\nCut the release.\n\n## Acceptance\n\n- [Ana](../people/ana.md)\n\n## Checklist\n\n- Notes written\n",
73
+ "source": "---\ntype: task\n---\n# Ship the release\n\n- **title**: Ship it\n- **status**: open\n- **owner**: [Ana](../people/ana.md)\n- **reviewers**:\n - [Bo](../people/bo.md)\n- **due**: 2026-09-30\n- **contact**:\n - **note**: Call before noon\n - **email**: ana@example.com\n- **Acceptance**:\n - [Ana](../people/ana.md)\n- **Checklist**:\n - Notes written\n\n## steps\n\n| title | done |\n| --- | --- |\n| Tag the build | [x] |\n| Announce it | [ ] |\n\n## Description\n\nCut the release.\n",
74
74
  "documentTargets": [],
75
75
  "definition": "task",
76
76
  "move": null,
@@ -80,13 +80,13 @@
80
80
  },
81
81
  "expected": {
82
82
  "ok": true,
83
- "text": "Ship the release\n\nCall before noon\n\nTag the build\n\nAnnounce it\n\n\n## Description\n\nCut the release.\n\n## Checklist\n\n- Notes written\n"
83
+ "text": "Ship the release\n\nCall before noon\n\nNotes written\n\nTag the build\n\nAnnounce it\n\nCut the release.\n"
84
84
  }
85
85
  },
86
86
  {
87
87
  "name": "a typed Document projects the prose of an open map and a nullable string and leaves a formatted $ref out",
88
88
  "file": "tasks/launch.md",
89
- "source": "---\ntype: task\nname: Plan the launch\ntitle: Plan\nstatus: open\nnotes:\n monday: Book the room\n friday: Send the invite\nbackup: ana@example.com\nmemo: Bring slides\n---\n\n## Description\n\nLaunch.\n",
89
+ "source": "---\ntype: task\n---\n# Plan the launch\n\n- **title**: Plan\n- **status**: open\n- **notes**:\n - **monday**: Book the room\n - **friday**: Send the invite\n- **backup**: ana@example.com\n\n## memo\n\n```json\n\"Bring slides\"\n```\n\n## Description\n\nLaunch.\n",
90
90
  "documentTargets": [],
91
91
  "definition": "task",
92
92
  "move": null,
@@ -96,13 +96,13 @@
96
96
  },
97
97
  "expected": {
98
98
  "ok": true,
99
- "text": "Plan the launch\n\nBook the room\n\nSend the invite\n\nBring slides\n\n\n## Description\n\nLaunch.\n"
99
+ "text": "Plan the launch\n\nBook the room\n\nSend the invite\n\nBring slides\n\nLaunch.\n"
100
100
  }
101
101
  },
102
102
  {
103
- "name": "a typed Document projects its preamble and every section its type does not declare as structure",
103
+ "name": "a typed Document projects its preamble, its long values without their labels and every free section, and leaves its references out",
104
104
  "file": "tasks/one.md",
105
- "source": "---\ntype: task\nname: Shipping the release\ntitle: Ship it\nstatus: open\nowner: ../people/ana.md\n---\n\nPreamble prose that mentions [the plan](../plans/q3.md).\n\n## Description\n\nFollow [the plan][plan] and [the plan][plan] again, then [read it][].\n\n[plan]: ../plans/q3.md \"Plan\"\n[read it]: ../plans/q3.md\n\n## Acceptance\n\n- [the plan](../plans/q3.md) is linked\n\n## Checklist\n\n- [the plan](../plans/q3.md) is read\n\n## Notes\n\nUndeclared prose about [the plan](../plans/q3.md).\n",
105
+ "source": "---\ntype: task\n---\n# Shipping the release\n\n- **title**: Ship it\n- **status**: open\n- **owner**: [Ana](../people/ana.md)\n- **Acceptance**:\n - [Ana](../people/ana.md)\n- **Checklist**:\n - [the plan](../plans/q3.md) is read\n\nPreamble prose that mentions [the plan](../plans/q3.md).\n\n## Description\n\nFollow [the plan][plan] and [the plan][plan] again, then [read it][].\n\n[plan]: ../plans/q3.md \"Plan\"\n[read it]: ../plans/q3.md\n\n## Notes\n\nUndeclared prose about [the plan](../plans/q3.md).\n",
106
106
  "documentTargets": [
107
107
  "plans/q3.md",
108
108
  "plans/2026-q3.md"
@@ -117,18 +117,18 @@
117
117
  "to": "[the roadmap][plan] and",
118
118
  "expected": {
119
119
  "ok": true,
120
- "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"
120
+ "text": "Shipping the release\n\nthe plan is read\n\nPreamble prose that mentions the plan.\n\nFollow the roadmap and the plan again, then read it.\n\n\n## Notes\n\nUndeclared prose about the plan.\n"
121
121
  }
122
122
  },
123
123
  "expected": {
124
124
  "ok": true,
125
- "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"
125
+ "text": "Shipping the release\n\nthe plan is read\n\nPreamble prose that mentions the plan.\n\nFollow the plan and the plan again, then read it.\n\n\n## Notes\n\nUndeclared prose about the plan.\n"
126
126
  }
127
127
  },
128
128
  {
129
129
  "name": "a link definition in another section resolves its use and leaves the projection",
130
130
  "file": "tasks/two.md",
131
- "source": "---\ntype: task\ntitle: Ship it\nstatus: open\n---\n\n## Description\n\nFollow [the plan][plan].\n\n## Notes\n\n[plan]: ../plans/q3.md\n",
131
+ "source": "---\ntype: task\n---\n- **title**: Ship it\n- **status**: open\n\n## Description\n\nFollow [the plan][plan].\n\n## Notes\n\n[plan]: ../plans/q3.md\n",
132
132
  "documentTargets": [
133
133
  "plans/q3.md",
134
134
  "plans/2026-q3.md"
@@ -140,13 +140,13 @@
140
140
  },
141
141
  "expected": {
142
142
  "ok": true,
143
- "text": "\n## Description\n\nFollow the plan.\n\n## Notes\n\n"
143
+ "text": "Follow the plan.\n\n## Notes\n\n"
144
144
  }
145
145
  },
146
146
  {
147
- "name": "every occurrence of a declared free-text section is projected",
147
+ "name": "a heading that names a field after a thematic break is free text and projected with it",
148
148
  "file": "tasks/three.md",
149
- "source": "---\ntype: task\ntitle: Ship it\nstatus: open\n---\n\n## Description\n\nFirst [plan](../plans/q3.md).\n\n## Description\n\nSecond note.\n",
149
+ "source": "---\ntype: task\n---\n- **title**: Ship it\n- **status**: open\n\n## Description\n\nFirst [plan](../plans/q3.md).\n\n---\n\n## Description\n\nSecond note.\n",
150
150
  "documentTargets": [
151
151
  "plans/q3.md",
152
152
  "plans/2026-q3.md"
@@ -158,13 +158,13 @@
158
158
  },
159
159
  "expected": {
160
160
  "ok": true,
161
- "text": "\n## Description\n\nFirst plan.\n\n## Description\n\nSecond note.\n"
161
+ "text": "First plan.\n\n\n## Description\n\nSecond note.\n"
162
162
  }
163
163
  },
164
164
  {
165
165
  "name": "a declared type the caller does not supply is refused",
166
166
  "file": "tasks/one.md",
167
- "source": "---\ntype: task\nname: Shipping the release\ntitle: Ship it\nstatus: open\nowner: ../people/ana.md\n---\n\nPreamble prose that mentions [the plan](../plans/q3.md).\n\n## Description\n\nFollow [the plan][plan] and [the plan][plan] again, then [read it][].\n\n[plan]: ../plans/q3.md \"Plan\"\n[read it]: ../plans/q3.md\n\n## Acceptance\n\n- [the plan](../plans/q3.md) is linked\n\n## Checklist\n\n- [the plan](../plans/q3.md) is read\n\n## Notes\n\nUndeclared prose about [the plan](../plans/q3.md).\n",
167
+ "source": "---\ntype: task\n---\n# Shipping the release\n\n- **title**: Ship it\n- **status**: open\n- **owner**: [Ana](../people/ana.md)\n- **Acceptance**:\n - [Ana](../people/ana.md)\n- **Checklist**:\n - [the plan](../plans/q3.md) is read\n\nPreamble prose that mentions [the plan](../plans/q3.md).\n\n## Description\n\nFollow [the plan][plan] and [the plan][plan] again, then [read it][].\n\n[plan]: ../plans/q3.md \"Plan\"\n[read it]: ../plans/q3.md\n\n## Notes\n\nUndeclared prose about [the plan](../plans/q3.md).\n",
168
168
  "documentTargets": [
169
169
  "plans/q3.md",
170
170
  "plans/2026-q3.md"
@@ -175,8 +175,7 @@
175
175
  "ok": false,
176
176
  "refusal": {
177
177
  "file": "tasks/one.md",
178
- "rule": "unknown-type",
179
- "location": "type"
178
+ "rule": "unknown-type"
180
179
  }
181
180
  }
182
181
  },
@@ -250,6 +249,110 @@
250
249
  "ok": true,
251
250
  "text": "Read outer Plan.\n"
252
251
  }
252
+ },
253
+ {
254
+ "name": "a link inside a fenced block is no link",
255
+ "file": "notes/seven.md",
256
+ "source": "```md\n[Plan](../plans/q3.md)\n```\n",
257
+ "documentTargets": [
258
+ "plans/q3.md"
259
+ ],
260
+ "definition": null,
261
+ "move": null,
262
+ "links": [],
263
+ "expected": {
264
+ "ok": true,
265
+ "text": "```md\n[Plan](../plans/q3.md)\n```\n"
266
+ }
267
+ },
268
+ {
269
+ "name": "a footnote is no link and its definition no link definition",
270
+ "file": "notes/seven.md",
271
+ "source": "Read [^plan].\n\n[^plan]: ../plans/q3.md\n",
272
+ "documentTargets": [
273
+ "plans/q3.md"
274
+ ],
275
+ "definition": null,
276
+ "move": null,
277
+ "links": [],
278
+ "expected": {
279
+ "ok": true,
280
+ "text": "Read [^plan].\n\n[^plan]: ../plans/q3.md\n"
281
+ }
282
+ },
283
+ {
284
+ "name": "a label folds case so a dotless i reads as an i",
285
+ "file": "notes/seven.md",
286
+ "source": "Read [ı].\n\n[i]: ../plans/q3.md\n",
287
+ "documentTargets": [
288
+ "plans/q3.md",
289
+ "plans/2026-q3.md"
290
+ ],
291
+ "definition": null,
292
+ "move": {
293
+ "href": "../plans/q3.md",
294
+ "to": "../plans/2026-q3.md"
295
+ },
296
+ "links": [
297
+ {
298
+ "href": "../plans/q3.md",
299
+ "target": "plans/q3.md"
300
+ }
301
+ ],
302
+ "expected": {
303
+ "ok": true,
304
+ "text": "Read ı.\n\n"
305
+ }
306
+ },
307
+ {
308
+ "name": "a shortcut followed by a bracket group that is no label is no link",
309
+ "file": "notes/seven.md",
310
+ "source": "Read [Plan][[x]] and [Plan][ ].\n\n[plan]: ../plans/q3.md\n",
311
+ "documentTargets": [
312
+ "plans/q3.md"
313
+ ],
314
+ "definition": null,
315
+ "move": null,
316
+ "links": [],
317
+ "expected": {
318
+ "ok": true,
319
+ "text": "Read [Plan][[x]] and [Plan][ ].\n\n[plan]: ../plans/q3.md\n"
320
+ }
321
+ },
322
+ {
323
+ "name": "a label longer than 999 UTF-16 code units is no label",
324
+ "file": "notes/seven.md",
325
+ "source": "Read [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx😀]: ../plans/q3.md\n"
335
+ }
336
+ },
337
+ {
338
+ "name": "a bare URL is no link, and a link written inside one still is",
339
+ "file": "notes/seven.md",
340
+ "source": "Read www.example.com/[the plan](../plans/q3.md) and https://example.com/a.md now.\n",
341
+ "documentTargets": [
342
+ "plans/q3.md"
343
+ ],
344
+ "definition": null,
345
+ "move": null,
346
+ "links": [
347
+ {
348
+ "href": "../plans/q3.md",
349
+ "target": "plans/q3.md"
350
+ }
351
+ ],
352
+ "expected": {
353
+ "ok": true,
354
+ "text": "Read www.example.com/the plan and https://example.com/a.md now.\n"
355
+ }
253
356
  }
254
357
  ]
255
358
  }
@@ -841,6 +841,57 @@
841
841
  "document": "task",
842
842
  "matches": false
843
843
  },
844
+ {
845
+ "name": "a Document outside a named directory is read",
846
+ "query": {
847
+ "outside": [
848
+ "notes"
849
+ ]
850
+ },
851
+ "document": "task",
852
+ "matches": true
853
+ },
854
+ {
855
+ "name": "a Document under a named directory is left out",
856
+ "query": {
857
+ "outside": [
858
+ "tasks"
859
+ ]
860
+ },
861
+ "document": "task",
862
+ "matches": false
863
+ },
864
+ {
865
+ "name": "a Document that is not Markdown is left out under a named directory",
866
+ "query": {
867
+ "outside": [
868
+ "data"
869
+ ]
870
+ },
871
+ "document": "export",
872
+ "matches": false
873
+ },
874
+ {
875
+ "name": "a directory left out is a whole directory",
876
+ "query": {
877
+ "outside": [
878
+ "task"
879
+ ]
880
+ },
881
+ "document": "task",
882
+ "matches": true
883
+ },
884
+ {
885
+ "name": "a Document under any of the directories named is left out",
886
+ "query": {
887
+ "outside": [
888
+ "data",
889
+ "tasks"
890
+ ]
891
+ },
892
+ "document": "task",
893
+ "matches": false
894
+ },
844
895
  {
845
896
  "name": "a phrase is found ignoring case",
846
897
  "query": {
@@ -850,7 +901,7 @@
850
901
  "matches": true
851
902
  },
852
903
  {
853
- "name": "a phrase is never found in text the device does not hold",
904
+ "name": "a phrase is never found in a document holding no text",
854
905
  "query": {
855
906
  "text": "friday"
856
907
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/mdmodel",
3
- "version": "0.1.0-cb304fd2c27f9",
3
+ "version": "0.1.0-cbe9e36156a2a",
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",
@@ -28,6 +28,15 @@
28
28
  "dependencies": {
29
29
  "@cfworker/json-schema": "4.1.1",
30
30
  "decode-named-character-reference": "1.3.0",
31
+ "mdast-util-from-markdown": "2.1.0",
32
+ "mdast-util-gfm-footnote": "2.1.0",
33
+ "mdast-util-gfm-strikethrough": "2.0.1",
34
+ "mdast-util-gfm-table": "2.0.0",
35
+ "mdast-util-gfm-task-list-item": "2.0.0",
36
+ "micromark-extension-gfm-footnote": "2.1.0",
37
+ "micromark-extension-gfm-strikethrough": "2.1.0",
38
+ "micromark-extension-gfm-table": "2.1.2",
39
+ "micromark-extension-gfm-task-list-item": "2.1.0",
31
40
  "micromark-util-decode-numeric-character-reference": "2.0.2"
32
41
  },
33
42
  "repository": {
package/dist/blocks.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import type { Extent } from './types.js';
2
- export type HeadingLine = {
3
- readonly level: number;
4
- readonly name: string;
5
- readonly start: number;
6
- readonly textEnd: number;
7
- readonly next: number;
8
- };
9
- export declare function headingLines(content: string, from: number, to: number): HeadingLine[];
10
- export declare function blockRanges(content: string, from: number, to: number): Extent[];
11
- //# sourceMappingURL=blocks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../src/blocks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAoDF,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,EAAE,CA4BrF;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAe/E"}
package/dist/blocks.js DELETED
@@ -1,91 +0,0 @@
1
- import { fenceSpans, spanCursor } from './links.js';
2
- const HEADING_OPEN = /^(#{1,6})(?!#)([ \t]+)/;
3
- const LINE_BREAK = /[\n\r\u2028\u2029]/;
4
- function blank(character) {
5
- return character === ' ' || character === '\t';
6
- }
7
- function heading(text) {
8
- const open = HEADING_OPEN.exec(text);
9
- if (open === null || LINE_BREAK.test(text))
10
- return null;
11
- const level = open[1].length;
12
- const rest = text.slice(open[0].length);
13
- if (rest === '')
14
- return open[2].length > 1 ? { level, name: '' } : null;
15
- let end = rest.length;
16
- while (blank(rest[end - 1]))
17
- end -= 1;
18
- let hashes = end;
19
- while (rest[hashes - 1] === '#')
20
- hashes -= 1;
21
- let spaced = hashes;
22
- while (blank(rest[spaced - 1]))
23
- spaced -= 1;
24
- const closed = hashes < end && spaced < hashes && spaced > 0;
25
- return { level, name: rest.slice(0, closed ? spaced : end).trim() };
26
- }
27
- function lineAt(content, from, to) {
28
- const nl = content.indexOf('\n', from);
29
- const end = nl === -1 || nl >= to ? to : nl;
30
- const raw = content.slice(from, end);
31
- return { text: raw.endsWith('\r') ? raw.slice(0, -1) : raw, next: end === to ? to : end + 1 };
32
- }
33
- function scan(content, from, to, visit) {
34
- const fenced = spanCursor(fenceSpans(content.slice(from, to)));
35
- let i = from;
36
- while (i < to) {
37
- const { text, next } = lineAt(content, i, to);
38
- visit({ text, start: i, next, fenced: fenced(i - from) !== undefined });
39
- if (next === i)
40
- break;
41
- i = next;
42
- }
43
- }
44
- const HASH = 0x23;
45
- export function headingLines(content, from, to) {
46
- const found = [];
47
- let fenced = null;
48
- let i = from;
49
- while (i < to) {
50
- const nl = content.indexOf('\n', i);
51
- const end = nl === -1 || nl >= to ? to : nl;
52
- const next = end === to ? to : end + 1;
53
- if (content.charCodeAt(i) === HASH) {
54
- fenced ??= spanCursor(fenceSpans(content.slice(from, to)));
55
- if (fenced(i - from) === undefined) {
56
- const { text } = lineAt(content, i, to);
57
- const read = heading(text);
58
- if (read !== null) {
59
- found.push({
60
- level: read.level,
61
- name: read.name,
62
- start: i,
63
- textEnd: i + text.length,
64
- next,
65
- });
66
- }
67
- }
68
- }
69
- if (next === i)
70
- break;
71
- i = next;
72
- }
73
- return found;
74
- }
75
- export function blockRanges(content, from, to) {
76
- const starts = [];
77
- let open = false;
78
- scan(content, from, to, (line) => {
79
- if (!line.fenced && line.text.trim() === '') {
80
- open = false;
81
- return;
82
- }
83
- if (!open)
84
- starts.push(line.start);
85
- open = true;
86
- });
87
- return starts.map((start, index) => ({
88
- start: index === 0 ? from : start,
89
- end: starts[index + 1] ?? to,
90
- }));
91
- }