@agentshouse/mdmodel 0.1.0-c18c3790f7f73 → 0.1.0-c1a3307824d0c

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 (299) hide show
  1. package/API.md +83 -107
  2. package/README.md +2 -1
  3. package/dist/built-in.d.ts.map +1 -1
  4. package/dist/built-in.js +10 -1
  5. package/dist/definition.d.ts +9 -1
  6. package/dist/definition.d.ts.map +1 -1
  7. package/dist/definition.js +92 -14
  8. package/dist/document.d.ts +3 -1
  9. package/dist/document.d.ts.map +1 -1
  10. package/dist/document.js +73 -21
  11. package/dist/event.d.ts.map +1 -1
  12. package/dist/event.js +2 -1
  13. package/dist/facts.d.ts.map +1 -1
  14. package/dist/facts.js +7 -4
  15. package/dist/folders.d.ts +5 -0
  16. package/dist/folders.d.ts.map +1 -0
  17. package/dist/folders.js +19 -0
  18. package/dist/house-model.d.ts +96 -20
  19. package/dist/house-model.d.ts.map +1 -1
  20. package/dist/house-model.js +59 -10
  21. package/dist/house-references/patterns.d.ts +5 -1
  22. package/dist/house-references/patterns.d.ts.map +1 -1
  23. package/dist/house-references/patterns.js +8 -1
  24. package/dist/index.d.ts +15 -10
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +11 -9
  27. package/dist/indexed.d.ts +10 -0
  28. package/dist/indexed.d.ts.map +1 -0
  29. package/dist/indexed.js +63 -0
  30. package/dist/kinds.d.ts +9 -1
  31. package/dist/kinds.d.ts.map +1 -1
  32. package/dist/kinds.js +68 -0
  33. package/dist/markdown.d.ts +0 -4
  34. package/dist/markdown.d.ts.map +1 -1
  35. package/dist/markdown.js +1 -34
  36. package/dist/moment.d.ts +9 -0
  37. package/dist/moment.d.ts.map +1 -0
  38. package/dist/moment.js +40 -0
  39. package/dist/paths.d.ts +6 -0
  40. package/dist/paths.d.ts.map +1 -1
  41. package/dist/paths.js +33 -3
  42. package/dist/query/language.d.ts +4 -1
  43. package/dist/query/language.d.ts.map +1 -1
  44. package/dist/query/language.js +4 -3
  45. package/dist/query/match.d.ts.map +1 -1
  46. package/dist/query/match.js +3 -24
  47. package/dist/query/rows.d.ts +5 -0
  48. package/dist/query/rows.d.ts.map +1 -1
  49. package/dist/query/rows.js +36 -7
  50. package/dist/query/sql.d.ts +10 -1
  51. package/dist/query/sql.d.ts.map +1 -1
  52. package/dist/query/sql.js +22 -3
  53. package/dist/query/walk.d.ts +73 -0
  54. package/dist/query/walk.d.ts.map +1 -0
  55. package/dist/query/walk.js +277 -0
  56. package/dist/reserved.d.ts +1 -0
  57. package/dist/reserved.d.ts.map +1 -1
  58. package/dist/reserved.js +15 -4
  59. package/dist/room-types.d.ts +2 -1
  60. package/dist/room-types.d.ts.map +1 -1
  61. package/dist/room-types.js +8 -0
  62. package/dist/types.d.ts +10 -21
  63. package/dist/types.d.ts.map +1 -1
  64. package/dist/validate.d.ts +4 -0
  65. package/dist/validate.d.ts.map +1 -1
  66. package/dist/validate.js +90 -31
  67. package/dist/view.d.ts +5 -0
  68. package/dist/view.d.ts.map +1 -0
  69. package/dist/view.js +27 -0
  70. package/dist/yaml.d.ts +3 -1
  71. package/dist/yaml.d.ts.map +1 -1
  72. package/dist/yaml.js +153 -32
  73. package/fixtures/README.md +64 -57
  74. package/fixtures/cases/absent-link-dangles/{schema.yaml → schema.md} +2 -0
  75. package/fixtures/cases/absent-optional-field/{schema.yaml → schema.md} +2 -0
  76. package/fixtures/cases/absolute-link/{schema.yaml → schema.md} +2 -0
  77. package/fixtures/cases/attachment-reference-any-file/{schema.yaml → schema.md} +2 -0
  78. package/fixtures/cases/attachment-reference-dangles/{schema.yaml → schema.md} +2 -0
  79. package/fixtures/cases/attachment-reference-outside/{schema.yaml → schema.md} +2 -0
  80. package/fixtures/cases/binary-any-reference/{schema.yaml → schema.md} +2 -0
  81. package/fixtures/cases/binary-document-collision/{schema.yaml → schema.md} +2 -0
  82. package/fixtures/cases/binary-image-dangles/{schema.yaml → schema.md} +2 -0
  83. package/fixtures/cases/binary-link-dangles/{schema.yaml → schema.md} +2 -0
  84. package/fixtures/cases/binary-link-outside-collection/{schema.yaml → schema.md} +2 -0
  85. package/fixtures/cases/binary-prototype-reference/{schema.yaml → schema.md} +2 -0
  86. package/fixtures/cases/binary-typed-reference/{schema.yaml → schema.md} +2 -0
  87. package/fixtures/cases/block-scalar-frontmatter/expected.json +1 -0
  88. package/fixtures/cases/block-scalar-frontmatter/library/notes/literal.md +17 -0
  89. package/fixtures/cases/block-scalar-frontmatter/library/skills/notes/SKILL.md +10 -0
  90. package/fixtures/cases/boolean-field/{schema.yaml → schema.md} +2 -0
  91. package/fixtures/cases/{duplicate-link-definition/schema.yaml → bracketed-link-definition/schema.md} +2 -0
  92. package/fixtures/cases/closed-nested-object/{schema.yaml → schema.md} +2 -0
  93. package/fixtures/cases/composed-root-reference/{schema.yaml → schema.md} +2 -0
  94. package/fixtures/cases/conditional-long-text/{schema.yaml → schema.md} +2 -0
  95. package/fixtures/cases/cross-room-link/{schema.yaml → schema.md} +2 -0
  96. package/fixtures/cases/cross-room-reference/{schema.yaml → schema.md} +2 -0
  97. package/fixtures/cases/date-time-format/{schema.yaml → schema.md} +2 -0
  98. package/fixtures/cases/declared-binary-links/schema.md +3 -0
  99. package/fixtures/cases/default-unfilled/schema.md +57 -0
  100. package/fixtures/cases/defs-pattern/schema.md +57 -0
  101. package/fixtures/cases/dependent-rule/schema.md +57 -0
  102. package/fixtures/cases/{bracketed-link-definition/schema.yaml → duplicate-link-definition/schema.md} +2 -0
  103. package/fixtures/cases/email-format/schema.md +57 -0
  104. package/fixtures/cases/equal-labels/{schema.yaml → schema.md} +2 -0
  105. package/fixtures/cases/fenced-link-definition/schema.md +7 -0
  106. package/fixtures/cases/field-enum/{schema.yaml → schema.md} +2 -0
  107. package/fixtures/cases/folder-keeps-a-built-in-type/context.json +1 -0
  108. package/fixtures/cases/folder-keeps-a-built-in-type/expected.json +1 -0
  109. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/door.md +3 -0
  110. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/host.md +13 -0
  111. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/map.md +24 -0
  112. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/open.md +13 -0
  113. package/fixtures/cases/folder-keeps-a-built-in-type/schema.md +9 -0
  114. package/fixtures/cases/folder-names-no-type-of-the-schema/context.json +1 -0
  115. package/fixtures/cases/folder-names-no-type-of-the-schema/expected.json +5 -0
  116. package/fixtures/cases/folder-names-no-type-of-the-schema/schema.md +7 -0
  117. package/fixtures/cases/folder-nearer-entry-types-a-document/context.json +1 -0
  118. package/fixtures/cases/folder-nearer-entry-types-a-document/expected.json +6 -0
  119. package/fixtures/cases/folder-nearer-entry-types-a-document/library/tickets/archive/2025/old.md +1 -0
  120. package/fixtures/cases/folder-nearer-entry-types-a-document/schema.md +15 -0
  121. package/fixtures/cases/folder-refuses-a-declared-any/context.json +1 -0
  122. package/fixtures/cases/folder-refuses-a-declared-any/expected.json +6 -0
  123. package/fixtures/cases/folder-refuses-a-declared-any/library/tickets/door.md +5 -0
  124. package/fixtures/cases/folder-refuses-a-declared-any/schema.md +9 -0
  125. package/fixtures/cases/folder-refuses-another-declared-type/context.json +1 -0
  126. package/fixtures/cases/folder-refuses-another-declared-type/expected.json +6 -0
  127. package/fixtures/cases/folder-refuses-another-declared-type/library/tickets/door.md +5 -0
  128. package/fixtures/cases/folder-refuses-another-declared-type/schema.md +12 -0
  129. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/context.json +1 -0
  130. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/expected.json +1 -0
  131. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/notes/plan.md +7 -0
  132. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/door.md +3 -0
  133. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/gate.md +7 -0
  134. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/schema.md +13 -0
  135. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/context.json +1 -0
  136. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/expected.json +6 -0
  137. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/library/tickets/2026/gate.md +1 -0
  138. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/schema.md +9 -0
  139. package/fixtures/cases/folder-types-a-document-that-names-no-type/context.json +1 -0
  140. package/fixtures/cases/folder-types-a-document-that-names-no-type/expected.json +7 -0
  141. package/fixtures/cases/folder-types-a-document-that-names-no-type/library/tickets/door.md +3 -0
  142. package/fixtures/cases/folder-types-a-document-that-names-no-type/schema.md +9 -0
  143. package/fixtures/cases/folder-under-a-reserved-name/context.json +1 -0
  144. package/fixtures/cases/folder-under-a-reserved-name/expected.json +5 -0
  145. package/fixtures/cases/folder-under-a-reserved-name/schema.md +7 -0
  146. package/fixtures/cases/folder-without-a-trailing-slash/context.json +1 -0
  147. package/fixtures/cases/folder-without-a-trailing-slash/expected.json +5 -0
  148. package/fixtures/cases/folder-without-a-trailing-slash/schema.md +7 -0
  149. package/fixtures/cases/frontmatter-construct/context.json +1 -0
  150. package/fixtures/cases/frontmatter-construct/expected.json +7 -0
  151. package/fixtures/cases/frontmatter-construct/library/note.md +6 -0
  152. package/fixtures/cases/integer-field/schema.md +57 -0
  153. package/fixtures/cases/interrupted-link-definition/schema.md +3 -0
  154. package/fixtures/cases/json-schema-constructs/schema.md +57 -0
  155. package/fixtures/cases/labels-in-the-rooms-language/{schema.yaml → schema.md} +2 -0
  156. package/fixtures/cases/lazy-list-item/{schema.yaml → schema.md} +2 -0
  157. package/fixtures/cases/link-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
  158. package/fixtures/cases/list-item-enum/{schema.yaml → schema.md} +2 -0
  159. package/fixtures/cases/list-item-kind/{schema.yaml → schema.md} +2 -0
  160. package/fixtures/cases/list-items/{schema.yaml → schema.md} +2 -0
  161. package/fixtures/cases/list-of-objects-closed/schema.md +57 -0
  162. package/fixtures/cases/list-of-objects-item/schema.md +57 -0
  163. package/fixtures/cases/list-of-objects-reference/{schema.yaml → schema.md} +2 -0
  164. package/fixtures/cases/list-reference-path/{schema.yaml → schema.md} +2 -0
  165. package/fixtures/cases/list-reference-type/{schema.yaml → schema.md} +2 -0
  166. package/fixtures/cases/list-size/schema.md +57 -0
  167. package/fixtures/cases/long-fence-link-definition/schema.md +3 -0
  168. package/fixtures/cases/long-value-past-six-levels/{schema.yaml → schema.md} +2 -0
  169. package/fixtures/cases/malformed-definition/{schema.yaml → schema.md} +2 -0
  170. package/fixtures/cases/malformed-list/{schema.yaml → schema.md} +2 -0
  171. package/fixtures/cases/member-document/{schema.yaml → schema.md} +2 -0
  172. package/fixtures/cases/member-on-another-type/{schema.yaml → schema.md} +2 -0
  173. package/fixtures/cases/missing-required-field/{schema.yaml → schema.md} +2 -0
  174. package/fixtures/cases/misspelled-key/schema.md +57 -0
  175. package/fixtures/cases/name-not-a-string/{schema.yaml → schema.md} +2 -0
  176. package/fixtures/cases/nested-defs/{schema.yaml → schema.md} +2 -0
  177. package/fixtures/cases/nested-object-reference/schema.md +34 -0
  178. package/fixtures/cases/nested-reference/schema.md +34 -0
  179. package/fixtures/cases/nested-required-field/schema.md +57 -0
  180. package/fixtures/cases/numeric-range/schema.md +57 -0
  181. package/fixtures/cases/one-key-two-labels/{schema.yaml → schema.md} +2 -0
  182. package/fixtures/cases/one-key-two-types/{schema.yaml → schema.md} +2 -0
  183. package/fixtures/cases/one-of-variant/schema.md +57 -0
  184. package/fixtures/cases/other-room-reference/schema.md +34 -0
  185. package/fixtures/cases/paragraph-link-definition/schema.md +3 -0
  186. package/fixtures/cases/prototype-field/schema.md +7 -0
  187. package/fixtures/cases/quoted-link-definition/schema.md +3 -0
  188. package/fixtures/cases/reference-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
  189. package/fixtures/cases/reference-to-any-file-name/context.json +1 -0
  190. package/fixtures/cases/reference-to-any-file-name/expected.json +1 -0
  191. package/fixtures/cases/reference-to-any-file-name/library/people/100%.md +4 -0
  192. package/fixtures/cases/reference-to-any-file-name/library/people/C#.md +4 -0
  193. package/fixtures/cases/reference-to-any-file-name/library/people/My notes.md +4 -0
  194. package/fixtures/cases/reference-to-any-file-name/library/people/[draft].md +4 -0
  195. package/fixtures/cases/reference-to-any-file-name/library/people/c (d).md +4 -0
  196. package/fixtures/cases/reference-to-any-file-name/library/people/caf/303/251.md +4 -0
  197. package/fixtures/cases/reference-to-any-file-name/library/people//320/236/321/202/321/207/321/221/321/202.md +4 -0
  198. package/fixtures/cases/reference-to-any-file-name/library/tasks/bracket.md +9 -0
  199. package/fixtures/cases/reference-to-any-file-name/library/tasks/cyrillic.md +9 -0
  200. package/fixtures/cases/reference-to-any-file-name/library/tasks/decomposed.md +9 -0
  201. package/fixtures/cases/reference-to-any-file-name/library/tasks/hash.md +9 -0
  202. package/fixtures/cases/reference-to-any-file-name/library/tasks/parenthesis.md +9 -0
  203. package/fixtures/cases/reference-to-any-file-name/library/tasks/percent.md +9 -0
  204. package/fixtures/cases/reference-to-any-file-name/library/tasks/spaced.md +9 -0
  205. package/fixtures/cases/{referenced-missing-file/schema.yaml → reference-to-any-file-name/schema.md} +2 -0
  206. package/fixtures/cases/referenced-missing-file/schema.md +12 -0
  207. package/fixtures/cases/referenced-missing-non-latin-file/context.json +1 -0
  208. package/fixtures/cases/referenced-missing-non-latin-file/expected.json +6 -0
  209. package/fixtures/cases/referenced-missing-non-latin-file/library/tasks/a.md +9 -0
  210. package/fixtures/cases/referenced-missing-non-latin-file/library/tasks/b.md +9 -0
  211. package/fixtures/cases/referenced-missing-non-latin-file/schema.md +12 -0
  212. package/fixtures/cases/remote-ref/{schema.yaml → schema.md} +2 -0
  213. package/fixtures/cases/schema-body-ignored/context.json +1 -0
  214. package/fixtures/cases/schema-body-ignored/expected.json +1 -0
  215. package/fixtures/cases/schema-body-ignored/schema.md +9 -0
  216. package/fixtures/cases/schema-type-named-folders/context.json +1 -0
  217. package/fixtures/cases/schema-type-named-folders/expected.json +5 -0
  218. package/fixtures/cases/schema-type-named-folders/schema.md +5 -0
  219. package/fixtures/cases/schema-type-named-type/context.json +1 -0
  220. package/fixtures/cases/schema-type-named-type/expected.json +5 -0
  221. package/fixtures/cases/{unknown-type/schema.yaml → schema-type-named-type/schema.md} +3 -1
  222. package/fixtures/cases/second-member-document/{schema.yaml → schema.md} +2 -0
  223. package/fixtures/cases/sections-keyword-refused/{schema.yaml → schema.md} +2 -0
  224. package/fixtures/cases/shortcut-reference-link/schema.md +7 -0
  225. package/fixtures/cases/string-length/schema.md +57 -0
  226. package/fixtures/cases/submission-keys/{schema.yaml → schema.md} +2 -0
  227. package/fixtures/cases/text-field-kind/{schema.yaml → schema.md} +2 -0
  228. package/fixtures/cases/thematic-break-ends-the-values/{schema.yaml → schema.md} +2 -0
  229. package/fixtures/cases/truncated-link-definition/schema.md +3 -0
  230. package/fixtures/cases/typed-path-names-another-type/{schema.yaml → schema.md} +2 -0
  231. package/fixtures/cases/typed-path-names-its-type/{schema.yaml → schema.md} +2 -0
  232. package/fixtures/cases/typed-path-names-no-type/{schema.yaml → schema.md} +2 -0
  233. package/fixtures/cases/types-folder-content/{schema.yaml → schema.md} +2 -0
  234. package/fixtures/cases/undeclared-field/schema.md +7 -0
  235. package/fixtures/cases/unevaluated-items-closed/{schema.yaml → schema.md} +2 -0
  236. package/fixtures/cases/unique-in-app-schema/context.json +1 -0
  237. package/fixtures/cases/unique-in-app-schema/expected.json +5 -0
  238. package/fixtures/cases/unique-in-app-schema/schema.yaml +7 -0
  239. package/fixtures/cases/unique-indexed-field/context.json +1 -0
  240. package/fixtures/cases/unique-indexed-field/expected.json +1 -0
  241. package/fixtures/cases/unique-indexed-field/library/tickets/first.md +8 -0
  242. package/fixtures/cases/unique-indexed-field/library/tickets/second.md +8 -0
  243. package/fixtures/cases/unique-indexed-field/schema.md +9 -0
  244. package/fixtures/cases/unique-off-indexed-field/context.json +1 -0
  245. package/fixtures/cases/unique-off-indexed-field/expected.json +5 -0
  246. package/fixtures/cases/unique-off-indexed-field/schema.md +9 -0
  247. package/fixtures/cases/unlisted-reference-type/{schema.yaml → schema.md} +2 -0
  248. package/fixtures/cases/unnamed-typed-path-checks-its-fields/{schema.yaml → schema.md} +2 -0
  249. package/fixtures/cases/unnamed-typed-path-names-a-type/{schema.yaml → schema.md} +2 -0
  250. package/fixtures/cases/unnamed-typed-path-reads-its-type/{schema.yaml → schema.md} +2 -0
  251. package/fixtures/cases/unnamed-typed-path-without-a-body/{schema.yaml → schema.md} +2 -0
  252. package/fixtures/cases/unresolved-link/schema.md +7 -0
  253. package/fixtures/cases/valid-typed-document/{schema.yaml → schema.md} +2 -0
  254. package/fixtures/cases/wide-item-fence-link/schema.md +3 -0
  255. package/fixtures/forms.json +24 -0
  256. package/fixtures/preamble.json +4 -4
  257. package/fixtures/queries.json +827 -2
  258. package/fixtures/references.json +15 -0
  259. package/package.json +2 -2
  260. package/dist/divide.d.ts +0 -3
  261. package/dist/divide.d.ts.map +0 -1
  262. package/dist/divide.js +0 -321
  263. package/dist/project.d.ts +0 -22
  264. package/dist/project.d.ts.map +0 -1
  265. package/dist/project.js +0 -101
  266. package/fixtures/cases/declared-binary-links/schema.yaml +0 -1
  267. package/fixtures/cases/default-unfilled/schema.yaml +0 -55
  268. package/fixtures/cases/defs-pattern/schema.yaml +0 -55
  269. package/fixtures/cases/dependent-rule/schema.yaml +0 -55
  270. package/fixtures/cases/email-format/schema.yaml +0 -55
  271. package/fixtures/cases/fenced-link-definition/schema.yaml +0 -5
  272. package/fixtures/cases/frontmatter-schema/expected.json +0 -5
  273. package/fixtures/cases/integer-field/schema.yaml +0 -55
  274. package/fixtures/cases/interrupted-link-definition/schema.yaml +0 -1
  275. package/fixtures/cases/json-schema-constructs/schema.yaml +0 -55
  276. package/fixtures/cases/list-of-objects-closed/schema.yaml +0 -55
  277. package/fixtures/cases/list-of-objects-item/schema.yaml +0 -55
  278. package/fixtures/cases/list-size/schema.yaml +0 -55
  279. package/fixtures/cases/long-fence-link-definition/schema.yaml +0 -1
  280. package/fixtures/cases/misspelled-key/schema.yaml +0 -55
  281. package/fixtures/cases/nested-object-reference/schema.yaml +0 -32
  282. package/fixtures/cases/nested-reference/schema.yaml +0 -32
  283. package/fixtures/cases/nested-required-field/schema.yaml +0 -55
  284. package/fixtures/cases/numeric-range/schema.yaml +0 -55
  285. package/fixtures/cases/one-of-variant/schema.yaml +0 -55
  286. package/fixtures/cases/other-room-reference/schema.yaml +0 -32
  287. package/fixtures/cases/paragraph-link-definition/schema.yaml +0 -1
  288. package/fixtures/cases/prototype-field/schema.yaml +0 -5
  289. package/fixtures/cases/quoted-link-definition/schema.yaml +0 -1
  290. package/fixtures/cases/shortcut-reference-link/schema.yaml +0 -5
  291. package/fixtures/cases/string-length/schema.yaml +0 -55
  292. package/fixtures/cases/truncated-link-definition/schema.yaml +0 -1
  293. package/fixtures/cases/undeclared-field/schema.yaml +0 -5
  294. package/fixtures/cases/unresolved-link/schema.yaml +0 -5
  295. package/fixtures/cases/wide-item-fence-link/schema.yaml +0 -1
  296. package/fixtures/division.json +0 -454
  297. package/fixtures/projection.json +0 -358
  298. /package/fixtures/cases/{frontmatter-schema → block-scalar-frontmatter}/context.json +0 -0
  299. /package/fixtures/cases/{frontmatter-schema/schema.yaml → unknown-type/schema.md} +0 -0
package/API.md CHANGED
@@ -3,10 +3,8 @@
3
3
  ```ts
4
4
  import {
5
5
  apply,
6
- divide,
7
6
  links,
8
7
  parse,
9
- project,
10
8
  retarget,
11
9
  serialize,
12
10
  target,
@@ -39,14 +37,25 @@ Every reader here reads a Document's body once, on first need, as one GitHub Fla
39
37
  without literal autolinks, which no reader counts as links, and `VERSION` is the MD model version.
40
38
 
41
39
  `verify(schema)` reads one schema text, the MD Types of one Room or App: one JSON Schema document
42
- (draft 2020-12) in the YAML subset. Every top-level key but `$defs` names an MD Type holding the
40
+ (draft 2020-12) in the YAML subset. Every top-level key but `$defs`, `roles` and `folders` names an MD Type holding the
43
41
  JSON Schema of its Documents' values; `$defs` holds shapes the types reuse, reached by a `$ref` under
44
- `#/$defs/` alone. `type` and the built-in `any` are never declared. The model adds its keywords:
42
+ `#/$defs/` alone, and `roles` maps a role name to its `RoleNeed`, `read` or `write`, which the model
43
+ answers as `roles` beside its `types` and which changes no type; a `roles` that is no mapping, an empty
44
+ role name or any other value is refused under the rule `roles`. `folders` maps a folder, written from the
45
+ root with a trailing `/`, its first name no `isReservedName`, to a type the text itself declares, which
46
+ lists it in its `folders`; any other entry, or a `folders` that is no mapping, is refused under the rule
47
+ `folders`. `type`, `attachment` and the built-in `any` are never declared. The model adds its keywords:
45
48
  `reference` on a string names one MD Type, several, `any` or `attachment`, and `cross_room: true`
46
49
  beside it admits a Document in another Room, of a type that Room declares; `title` is the label a
47
50
  Document shows for a field and `contentMediaType: text/markdown` marks a string of Markdown text
48
51
  written under its own heading; `member_document: true` marks at most one type. A type alone takes `create_roles` and
49
- `delete_roles`, each a list of role names. `verify(schema, provided)` holds every type of a model
52
+ `delete_roles`, each a list of role names, and `indexed`, which validates nothing: a list of its own top-level
53
+ fields, each admitting one plain value or `null`, a number, an integer, a boolean, or a choice, `date`,
54
+ `date-time`, `time` or `maxLength`-bounded string. `verifyIndexBounds(model, { perType, longestText })`
55
+ refuses a type past those bounds under the rule `indexed`. `unique: true` on a field of a type's own
56
+ `properties` that the type names in `indexed` marks its value as one no two of the type's Documents
57
+ in a collection share; it validates nothing, the type's `unique` lists those fields, and `unique`
58
+ anywhere else, or with any other value, is refused under the rule `unique`. `verify(schema, provided)` holds every type of a model
50
59
  `provided` as its own, named only for those two and only if `provided.nameable` lists it. On a field
51
60
  of a type's own `properties` alone, `change_roles` and `initial_roles` each list role names, and
52
61
  `transitions` lists `{ from, to, roles? }`, each end a scalar or `null`, on a field whose `type`,
@@ -54,7 +63,14 @@ of a type's own `properties` alone, `change_roles` and `initial_roles` each list
54
63
  A field's label is its `title`, else its key; the fixtures' rule ids name `verify`'s label, `name` and nesting rules,
55
64
  a value under a heading counting a level for each property or list item above it and none inside a `json` block.
56
65
  `readTypes(schema, provided?)` returns the model of a schema `verify` already accepted, checking
57
- none of these rules, and throws on a text it cannot read as types.
66
+ none of these rules, and throws on a text it cannot read as types. A Room schema and a Space schema
67
+ are each one Markdown Document whose YAML frontmatter is that schema, whole, and whose body is text
68
+ for people the model never reads: `verifySchemaDocument(document, provided?)` and
69
+ `readSchemaDocument(document, provided?)` answer as `verify` and `readTypes` do over its
70
+ frontmatter alone, a Document with no frontmatter holding no types, and refuse an unclosed one as
71
+ `schema-yaml` at `line 1`; a refusal's line is the Document's own. An App's schema stays a YAML
72
+ text, which `verify` reads and which takes no `unique` and no `folders`: `verify` refuses either under
73
+ its rule, `folders` at `/folders`.
58
74
 
59
75
  ```yaml
60
76
  $defs:
@@ -88,15 +104,19 @@ JSON Pointer grammar, `''` included, `pointerSegments` and `escapePointer` split
88
104
  `validate(library, context?, model?)` takes the resulting text Library and one `ValidationContext` of
89
105
  `binaryTargets: readonly string[]`, none when omitted. Library keys and binary targets share one
90
106
  canonical collection-relative path namespace; a path declared text and binary is refused. House declares
91
- every binary file of the Room as a binary target, and the model reads no bytes. Ordinary links and
107
+ every attachment of the Room as a binary target, and the model reads no bytes. Ordinary links and
92
108
  images in typed Documents may resolve to either membership, relative to the source Document, and one to
93
109
  a path neither holds is not refused: it dangles. One written `/rooms/<handle>/<path>` names a file in
94
110
  another Room, which the caller checks; any other absolute path, or one that leaves the collection, is
95
111
  `unresolved-link`. A binary target supplies no Document or MD Type. `model` types the Library. A typed
96
112
  Document, `any` included, at an `isDocumentPath` (no `isReservedName` of `RESERVED_NAMES` first) linking
97
- into a reserved name is `unresolved-link`; a typed `ROOM_DESCRIPTION` is `room-md-type`. `CAPTURE_HOME`, one of `RESERVED_NAMES`, names the Capture home at a Room's root. The context's `typedPaths` bind each `path`, a name's one `*` standing for any nonempty part, to a `type` of `model`: a Document there naming another, or naming any unless `named`, is `unknown-type` at `/type`, one not `named` is checked as it and stays `any`, and one whose free text holds nothing but whitespace is `required-body` if `body`.
113
+ into a reserved name is `unresolved-link`; a typed `ROOM_DESCRIPTION` is `room-md-type`. `CAPTURE_HOME`, one of `RESERVED_NAMES`, names the Capture home at a Room's root. `isReservedName` compares a name with `RESERVED_NAMES` after `foldedName(name)`, the name in Unicode NFC under Unicode default case folding, which is how two names of one folder compare. The context's `typedPaths` bind each `path`, a name's one `*` standing for any nonempty part, to a `type` of `model`: a Document there naming another, or naming any unless `named`, is `unknown-type` at `/type`, one not `named` is checked as it and stays `any`, and one whose free text holds nothing but whitespace is `required-body` if `body`. `folderType(model, file)`
114
+ is the type of the `folders` entry naming a Path's nearest enclosing folder, or `undefined`: a Document
115
+ there that declares no `type` is of it, read, assessed and stored as it, its `facts` among them, and one
116
+ that declares another, `any` included, is `folder-type` at `/type`, unless that type's definition is
117
+ `builtIn`, as every type of `HOUSE_ROOM_TYPES` is. A View whose `query` `planOf` refuses over `model`'s types, a type or field it does not declare included, or which names `rooms`, is `invalid-query` at that part under `/query`.
98
118
 
99
- `HOUSE_ROOM_TYPES` is the `provided` model of every Room, verified: the Inbox's `CHAT_TYPE` card, whose `channel` is one of `INBOX_CHANNEL_KINDS`, and its `CHAT_MESSAGE_TYPE` messages, the two `INBOX_TYPES` and its `nameable` ones, a Wayfinding map and its tickets, and every type of `HOUSE_MODEL`, the House model `HOUSE_MODEL_DECLARATION` declares, from which the `HouseModelType` names and the `HouseDocumentFields<type>` of each type's Document follow. `HOUSE_TYPED_PATHS` binds House's paths to their types: `settings/panel.md`, an App's preferences under `APP_PREFERENCES_HOME` and an Agent function document under `rooms/<handle>/agent-functions/`. Its `room`, `app` and `space` definitions are `ROOM_REFERENCE_PATTERN`, `APP_REFERENCE_PATTERN` and `SPACE_REFERENCE_PATTERN`: a prefix, `ROOM_REFERENCE_PREFIX`, `APP_REFERENCE_PREFIX` or `SPACE_REFERENCE_PREFIX`, then an ordinal, a dot and a check character; `REVISION_REFERENCE_PATTERN` reads a revision, `REVISION_REFERENCE_PREFIX`, its document's ordinal, a dot, the revision's and a check character, each character one `CROCKFORD_CHARACTER` of the lowercase Crockford alphabet `CROCKFORD_ALPHABET`, and `CROCKFORD_LEADING_CHARACTER` any of it but `0`.
119
+ `HOUSE_ROOM_TYPES` is the `provided` model of every Room, verified: the Inbox's `CHAT_TYPE` card, whose `channel` is one of `INBOX_CHANNEL_KINDS`, and its `CHAT_MESSAGE_TYPE` messages, the two `INBOX_TYPES` and its `nameable` ones, a Wayfinding map and its tickets, a View, `VIEW_TYPE`, whose `name`, `description` and `query` it requires, and every type of `HOUSE_MODEL`, the House model `HOUSE_MODEL_DECLARATION` declares, from which the `HouseModelType` names and the `HouseDocumentFields<type>` of each type's Document follow. `HOUSE_TYPED_PATHS` binds House's paths to their types: `settings/panel.md`, an App's preferences under `APP_PREFERENCES_HOME` and an Agent function document under `rooms/<handle>/agent-functions/`. Its `room`, `app` and `space` definitions are `ROOM_REFERENCE_PATTERN`, `APP_REFERENCE_PATTERN` and `SPACE_REFERENCE_PATTERN`: a prefix, `ROOM_REFERENCE_PREFIX`, `APP_REFERENCE_PREFIX` or `SPACE_REFERENCE_PREFIX`, then an ordinal, a dot and a check character; `DOCUMENT_REFERENCE_PATTERN` reads a document, `DOCUMENT_REFERENCE_PREFIX`, `d_`, and `ATTACHMENT_REFERENCE_PATTERN` an attachment, `ATTACHMENT_REFERENCE_PREFIX`, `at_`, each then an ordinal, a dot and a check character; `REVISION_REFERENCE_PATTERN` reads a revision, `REVISION_REFERENCE_PREFIX`, `v_`, its entry's ordinal, a dot, the revision's and a check character, each character one `CROCKFORD_CHARACTER` of the lowercase Crockford alphabet `CROCKFORD_ALPHABET`, and `CROCKFORD_LEADING_CHARACTER` any of it but `0`.
100
120
 
101
121
  A typed Document writes its values in its body, as Markdown, and its frontmatter holds only
102
122
  `TYPE_FIELD`, `MEMBER_FIELD`, `SITE_FIELD` and `SUBMITTED_FIELD` (`submitted`), which `parse` reads
@@ -136,7 +156,9 @@ refused as `pattern`; `openPatternBudget()` opens one such bound over the assess
136
156
  function it returns is called, and an inner one shares the outer.
137
157
 
138
158
  Validation returns acceptance or one refusal naming the file, the field, its line and the violated
139
- rule. `parse`, `apply`, and `serialize` operate on a single text Document; they do not validate
159
+ rule. A frontmatter outside the YAML subset the fixtures README states is refused as
160
+ `frontmatter-fence`, its `location` naming the construct the subset does not take and its `line`
161
+ where that construct is written. `parse`, `apply`, and `serialize` operate on a single text Document; they do not validate
140
162
  collection membership or consume binary bytes. `parse(content, file?, definition?)` and
141
163
  `apply(document, changes, definition?, nameOf?)` take the Document's MD Type definition: `parse` takes the
142
164
  `Definition` itself or a `DefinitionOf`, a function from the type the frontmatter declares to its
@@ -154,10 +176,10 @@ With a definition a field change rewrites that value's lines alone and writes a
154
176
  schema position, after the nearest field before it the Document holds; a value whose form changes
155
177
  moves, and `undefined` removes it. A reference is written as a link whose text is `nameOf(value)`,
156
178
  else the file name, and never changed after; a value no form carries is `malformed-value`, and a
157
- section change naming a field's label `required-section`. Without one a field is written in the
179
+ section change naming a field's label `field-section`, at that field's key. Without one a field is written in the
158
180
  frontmatter. A `{ kind: 'section', name, value, prior: undefined }` change opens a
159
181
  section after the Document's last line, in the order the changes give, and is stale where the
160
- Document holds that section. The Document a typed write of values returns carries the values it wrote, and reads its body only when a caller asks for what only the text holds; a write that carries text from outside, a Markdown value, a text value that does not fit its line, free text, a section or the preamble, or rewrites a link, reads the text it made. All apply or none: one refused refuses
182
+ Document holds that section; one with a prior text is stale where the Document lacks the section, a name no `## ` heading reads back as itself being `unwritable-section`, and a section's or the preamble's prior is compared as `partText(part)` reads it, its text without the blank lines around it, which a writer sends back. The Document a typed write of values returns carries the values it wrote, and reads its body only when a caller asks for what only the text holds; a write that carries text from outside, a Markdown value, a text value that does not fit its line, free text, a section or the preamble, or rewrites a link, reads the text it made. All apply or none: one refused refuses
161
183
  all, and `{ outcome: 'stale', document, stale }` keeps the Document and lists the positions of each
162
184
  change it does not hold and of each later change of a part an earlier one changes, such as a link
163
185
  inside a replaced section. A section, preamble or free text replacement that would hide a section the
@@ -209,7 +231,9 @@ Frontmatter values and the links that write reference values are never in it.
209
231
  by the rule `links` and `validate` read: surrounding spaces and the `?query` or `#fragment` it
210
232
  carries are not part of that Path. It reads backslash escapes and character references, strips as a
211
233
  URL does, then percent-encodings, so `plan\.md`, `pl&#97;n.md` and `pl%61n.md` all name `plan.md`;
212
- an escaped or referenced `?` or `#` starts the suffix. A destination that is empty, a bare fragment,
234
+ an escaped or referenced `?` or `#` starts the suffix. The Path is in Unicode NFC, so a destination
235
+ written decomposed names the composed Path, and every target `links`, `validate` and `documentFacts`
236
+ read is NFC. A destination that is empty, a bare fragment,
213
237
  carries a URL scheme, starts at `/` once read, encodes no UTF-8 text, or leaves the collection
214
238
  resolves to `null`. It reads a destination written anywhere, such as a typed reference field value,
215
239
  which `links` never enumerates. `roomTarget(href)` reads `/rooms/<handle>/<path>` as its `handle`
@@ -218,10 +242,14 @@ any reference written so. `linkedPath(from, href)` reads a link so, with the `ha
218
242
  `/rooms/<handle>` one names, `''` for the Room's root and the heading its `#fragment` names, `from`
219
243
  if it names no Path. `retarget(href, to)` is that destination rewritten to `to`, keeping the
220
244
  `?query` or `#fragment` it carried, which is the destination the `link` change below writes. It
221
- percent-encodes in `to` what `target` would decode, so it resolves to `to` again.
245
+ percent-encodes in `to` what `target` would decode or strip, a space at either end among them, so it
246
+ resolves to `to` again. `urlDestination(url)` is the destination that reads as `url`, the address a
247
+ Markdown renderer gives a link with its escapes and character references already read, so
248
+ `linkedPath(from, urlDestination(url))` reads them once. `destinationText(to, bracketed)` is `to` as
249
+ a link writes it, `<…>` when `bracketed` asks for it or the bare form cannot hold it, and `null`
250
+ when neither form can.
222
251
 
223
- `untitled(definition)` is a definition without its `title`s at any depth, a property named `title`
224
- kept, so two types that differ only in their labels compare equal.
252
+ `untitled(definition)` is a definition without its `title`s at any depth, a property named `title` kept, so two types that differ only in their labels compare equal.
225
253
 
226
254
  `checkDocument(file, content, model, context?)` reads one Document as `validate` does in that
227
255
  context: `ok: false` where it refuses, else its `type`, whether it is `typed`, and each reference's
@@ -233,15 +261,19 @@ accepts. It names no other Room's, which `roomReferences(document, definition?)`
233
261
  of the link that writes one, keeping its text, or is stale. `referenceTarget(file, value)` is the Path a value names
234
262
  read as a link destination, else `null`; `referenceTargets(document, file, model)` lists each
235
263
  reference's `location`, `to` and `target`. `documentFacts(file, parsed, model)`, `null` where the
236
- text does not parse, is the `type` (`any` if none), `fields` and sorted distinct link and reference
237
- `links` a save stores, no links under `settings/`. `relativize(document, file, handle, definition?, kept?)`
264
+ text does not parse, is the `type` (its `folderType`, else `any`, if it declares none), `fields` and sorted distinct link and reference
265
+ `links` a save stores, no links under `settings/` and no fields for a document there that declares no `type`, such as the Room schema. `relativize(document, file, handle, definition?, kept?)`
238
266
  rewrites, in one `apply`, each link destination and reference written `/rooms/<handle>/<path>` and
239
267
  not in `kept` to `relative(file, path)`, keeping its `?query` or `#fragment`. A text without
240
268
  frontmatter, such as a captured body, is read from its first character: `relativizeBody(body, file, handle)` converts it
241
269
  so, refusing a `/rooms/` one naming no Room's file as `unresolved-link`; `bodyLinks(body, file)`
242
- is its `links` and `bodyRoomLinks(body)` its other Rooms'. `relinkBody(body, file, moves)` writes,
270
+ is its `links` and `bodyRoomLinks(body)` its other Rooms'. A keyed link, `/rooms/<handle>/<path>?key=<key>` as a body link or a reference value, stays as written, which no relativizing or relinking rewrites, out of `roomReferences` and `bodyRoomLinks` and naming no target validation checks; `keyedLink(href)` reads one as its `handle`, `path` and `key`, or `null` for any other href, `bodyKeyedLinks(body)` lists each in a body, and `keyedDestination(path, key)` writes one, each name percent-encoding every ASCII character but letters, digits, `.`, `_`, `~` and `-` and keeping every other character as written, which `keyedLink` decodes and takes in NFC. `relinkBody(body, file, moves)` writes,
243
271
  in the `link` change's form, each destination whose Path keys `moves` as that value relative to
244
272
  `file`, or as that value when it is a `/rooms/` path, and one whose `roomPath` does as that value.
273
+ `linkSpans(body)` lists, in source order, every link, image and reference definition the body
274
+ holds, each with its `start` and `end`, the `label` text's extent (`null` for a definition), its
275
+ `href` as written and the `destination` extent that writes it, `bracketed` when it is written
276
+ `<…>`; a reference link carries its definition's destination.
245
277
  `unlinkBody(body, hrefs)` cuts every link and reference definition whose written destination is
246
278
  in `hrefs`, and answers the rest as `body` with `links`, each such destination written as one link.
247
279
 
@@ -260,83 +292,6 @@ profile reads back: bare when it carries no whitespace, does not open with `<`,
260
292
  parentheses, otherwise inside angle brackets, which the original form is kept in when it still
261
293
  fits. A destination that neither form can carry is refused as `unwritable-link`.
262
294
 
263
- `project(document, file, context?)` is the Embedding projection input of one Document: the prose a
264
- consumer embeds, with every internal Markdown-document link reduced to the label a reader sees. A
265
- Document that declares no MD type contributes its body after the frontmatter fence. A typed one
266
- contributes its prose values, each bare without its label, first the ones written on a line, in a
267
- cell or in a `json` block, each followed by a blank line, then its Markdown long values and its free
268
- text, its preamble, each section whose heading names no field and what follows a thematic break,
269
- in Document order. A prose value is a string at any depth whose schema is prose. The Path, every
270
- label and every other value stay outside, so changing them alone leaves the projection unchanged.
271
-
272
- ```ts
273
- const parsed = parse(content);
274
- if (parsed.ok) {
275
- const projected = project(parsed.document, 'tasks/two.md', {
276
- documentTargets: ['plans/q3.md', 'people/ana.md'],
277
- definition: model.types.task,
278
- });
279
- if (projected.ok) embed(projected.text);
280
- }
281
- ```
282
-
283
- `ProjectionContext` carries `documentTargets`, the collection-relative Paths the caller holds as
284
- Markdown documents, and `definition`, the verified MD Type the Document's `type` names, taken from
285
- the model `verify` returned. A Document that declares a type the caller supplies no definition for
286
- is refused as `unknown-type`. `documentTargets` is what makes a destination internal: a destination
287
- resolving to a supplied Path is internal, as is one into another Room, and every other stays text, a
288
- binary target and a Path nobody supplied alike. The caller supplies that membership, as it does for
289
- `validate`; the model reads no bytes, resolves no authority, and classifies nothing unsupplied.
290
-
291
- An internal link contributes its visible label and no destination, fragment, or title, in the inline
292
- `[label](path)`, full `[label][id]`, collapsed `[label][]`, and shortcut `[label]` forms, and the
293
- link reference definition an enumerated use resolves through leaves the projection with it. An image
294
- at a supplied document target contributes its alt text the same way, because a move rewrites that
295
- destination too. External URLs, binary targets, unsupplied destinations, bare fragments, code spans,
296
- fenced code, and escaped syntax stay exactly as authored, read through the same syntax profile
297
- `links` and `validate` read. `project` returns text and never rewrites the Document.
298
-
299
- A `link` change leaves the projection of every Document it rewrites
300
- byte-identical, while a changed visible label changes it.
301
-
302
- `divide(document, file, context)` divides that same Embedding projection input into ordered Spans
303
- under the bound the caller supplies. Each Span carries the `text` to embed and the `start` and `end`
304
- of the extent it addresses in the Document's own source, as UTF-8 byte offsets and never string
305
- positions, so a caller stores the extent and hydrates the text it shows from the Document itself.
306
-
307
- `DivisionContext` is a `ProjectionContext` and one `bound`, the greatest number of characters a
308
- Span's embedded text may carry, counted the way JavaScript counts a string's length and not in the
309
- bytes the extent is measured in. No Span's text is ever longer than the bound. A bound cut never
310
- divides a character: where the bound ends between the two halves of a surrogate pair, the cut falls
311
- before the pair. A cut never falls inside link syntax either: it falls before an internal link, and
312
- a label longer than a whole piece's room is divided at the bound like any other text. The smallest
313
- bound is `2`, the length of one astral character; a bound that is not a whole number of at least
314
- `2` is refused with `division-bound` before any division. The bound is the caller's number alone:
315
- the model holds no tokenizer, counts nothing else, and refuses no input for being too long. A
316
- Document the caller supplies no definition for carries the `unknown-type` refusal of `project`.
317
-
318
- The division descends one level at a time, and only into the piece that does not fit: the whole
319
- input, a heading node, adjacent sibling nodes packed under one parent, adjacent blocks inside a
320
- node, sentences inside a block, and a bound cut inside a single sentence. A Span covers whole
321
- heading nodes or one contiguous piece inside a single node, never a partial node beside another. A
322
- Span that continues a node repeats that node's own heading line, projected like any other text and
323
- so carrying an internal link's label rather than its destination, and never an ancestor's heading,
324
- so renaming a heading costs what editing that heading's own body costs. A heading the bound cannot
325
- hold beside any text is not repeated, a continuation piece that begins with an astral character the
326
- room beside its heading cannot hold is carried without the heading, and a heading with no body of
327
- its own leads its first child node rather than standing as a Span of nothing but itself. Overlap
328
- exists at the sentence level alone, where each Span after the first repeats its predecessor's last
329
- sentence whenever the bound holds both; when it cannot hold both, the Span carries its own sentence
330
- alone. An untyped input arrives without a definition and descends the same ladder.
331
-
332
- Division is total: every authored character of the input belongs to at least one Span, and an input
333
- carrying no authored text divides into no Span at all. A Span's extent is the smallest range of the
334
- source that contains everything the Span covers, so it spans what the input excludes between two
335
- eligible pieces, and the extent addresses the authored source where the embedded text carries a
336
- repeated heading, an internal link's visible label, or a value the author escaped. A Span divided
337
- out of one value written on a line addresses that whole value, and a Span carrying part of one
338
- internal link's label addresses that whole link, because a cut never falls inside link syntax.
339
-
340
295
  `notReadyWaitMs(asked)` is how long a client told a Room's chunk list is not ready waits before it
341
296
  asks again: 1, 2, 3, 5, 8, 11 and 15 seconds by `asked`, counted from zero, then 15 seconds.
342
297
 
@@ -350,12 +305,12 @@ the query, which `placeText` writes as its message does, and whose `accepts` lis
350
305
  take there: the types or fields the Rooms declare, a field's `kindWords`, or the parts and operators
351
306
  a query knows. A query is data: `types`, `where` field predicates by JSON Pointer (`$eq`, `$ne`,
352
307
  `$in`, `$nin`, `$gt`, `$gte`, `$lt`, `$lte`, `$all`, `$size`, `$exists`, `$prefix`, `$and`, `$or`),
353
- `pathPrefix`, `outside` (directories left out), `folder`, `paths`, `fileIds`, `hop`, `backlinks`,
354
- `text`, then `select` or `groupBy`, `orderBy`, `limit`, `after` and `total`. A Document query
308
+ `pathPrefix`, `outside` (directories left out), `folder`, `paths`, `fileIds`, `hop` (with
309
+ `none: true`, the Documents whose reference names no matching Document), `backlinks`, `text`, then `select` or `groupBy`, `orderBy`, `limit`, `after` and `total`. A Document query
355
310
  selects and orders by a row's `size`, `created` and its change's time `updated` beside `room`,
356
311
  `path`, `type`, `folder` and a field. A group query groups by `room`, `type`, `folder`, `subfolder`
357
312
  (the child folder of `pathPrefix` holding a row) or a field, selects each group's `size`, its
358
- documents and files apart, its latest `updated` and the `greatest` value of a field, and orders by
313
+ documents and attachments apart, its latest `updated` and the `greatest` value of a field, and orders by
359
314
  `count`, those or its keys. `queryKey` and `identityOf` are a query's and a plan's canonical text,
360
315
  `bodied` says a shape reads text, `cursorOf` and `decodedCursor` write and read the `after` a window
361
316
  continues from, and `invalid`, `known` and `plain` are the check's refusal and tests.
@@ -366,22 +321,33 @@ the values it takes in words, and `fitsKind(kind, facts, value)` whether a value
366
321
  `dated`, a `date-time` compares as the instant `instant` reads, which `instantKey` writes as text
367
322
  that sorts as the instant does, and a `reference` as the Room Path it resolves to. `compared(left,
368
323
  right, ordering)` orders plain values: numbers and booleans, then text by locale or `byCodePoint`,
369
- then lists item by item.
324
+ then lists item by item. `indexKey(facts, value)` is the key whose bytes order an indexed value so,
325
+ a date-time by its instant, text by code point, and a missing value with `null` first. `fieldKey(definition,
326
+ fields, field)` reads one field a type indexes from a Document's `fields`: its `value`, `undefined` when missing, its
327
+ `indexKey` as hex `key`, and whether it holds a `unique` value, one of a field the type lists in `unique` that is
328
+ neither missing nor `null`. `pageOrder(plan)` is the one order a page of
329
+ House's query walks, by Path or a field its types index, both by code point, and `walkOf(plan, model)` what drives that walk: an indexed
330
+ order as runs of keys, its continuation's, a missing value's and a range on that field, else the keys of the first top-level equality
331
+ or list on a field every named type indexes, else Path. Each refuses what no walk serves; `walkedValue` names a walked value as a continuation does. `countShape(plan)` says whether a plan asks a total or groups and refuses what no count serves, a `hop` among it, and `countOf(plan, model, where)` names a count's walk, in no order and from no continuation: those keys, else the range of the first top-level range on such a field, else Path, with every field it tests or groups by. `hopTargets(plan, model, row)` names each Document a walked row's stored `path`, `type` and `fields` (`WalkedFacts`) name in the plan's `hop` field as a `HopTarget`, its `path` with a `handle` of `null` in its own Room or the handle of the other Room a Cross-Room reference names, which a page reads to answer that row.
370
332
 
371
333
  Two evaluators answer a plan's tests on one Document alike, a test on a missing value false and
372
334
  its negation (`$ne`, `$nin`, `$exists: false`) true. `matches(plan, candidate)` answers in
373
335
  memory over one `Candidate`: its `path`, `type`, `fileId`, `fields`, `definition` and the
374
- `text` held, and refuses a plan that orders by `size`, `created`, `updated` or `greatest`, or
375
- selects a group's totals, which one Document cannot answer. The `sql` namespace compiles them to SQL over a collection: `indexed(path, fields,
376
- definition)` derives a Document's values and field links, its date-times with their instants,
377
- `sql.VALUE_TABLE` holds those values and `sql.insertedValues` writes them, and `sql.tests(alias,
336
+ `text` held, and refuses a plan that names `rooms`, `hop` or `backlinks`, orders by `size`,
337
+ `created`, `updated` or `greatest`, or selects a group's totals, which one Document cannot answer. The `sql` namespace compiles them to SQL over a collection: `indexed(path, fields,
338
+ definition)` derives a Document's values and field links, a Cross-Room reference's link with the `handle` of the Room it names, its date-times with their instants,
339
+ `sql.VALUE_TABLE` holds those values and `sql.insertedValues` writes those of many documents, and `sql.tests(alias,
378
340
  plan)` tests a document row of `id`, `path`, `folder`, `type`, `file_id` and `content`, its
379
341
  phrase through the function a connection registers as `sql.HOLDS_PHRASE` with `sql.holdsPhrase`.
342
+ `sql.hopped(alias, hop, followed)` tests a plan's `hop` through a `replica_links` table of those
343
+ field links by `doc`, `kind`, `keys`, `places`, `handle` and `target`, where `followed.targets(link,
344
+ document)` joins the Document row a link names that the reader follows and `followed.unfollowed(link)`
345
+ holds for a link it cannot follow: `EXISTS`, or with `none` `NOT EXISTS` of either.
380
346
  `sql.scoped`, `sql.placed`, `sql.sorted`, `sql.beyond`, `sql.following` and `sql.sortValue`
381
347
  render a scope, a pointer, an order and a window's continuation, a date-time ordering as its
382
348
  instant between numbers and text; `sql.fragment`, `sql.joined`, `sql.all`, `sql.any`,
383
349
  `sql.grouped`, `sql.listed` and `sql.exists` build statements, and `heldKind` is the index's value
384
- kind. `fixtures/queries.json` holds both evaluators to one table.
350
+ kind. `fixtures/queries.json` holds both evaluators to one table, and `indexKey` to their order.
385
351
 
386
352
  ## Events
387
353
 
@@ -390,8 +356,7 @@ change: its `id`, its `path` with a leading `/`, its `type` or `null`, and a `Fa
390
356
  for each field it writes that its MD Type declares, held as its kind in the one table
391
357
  of kinds: `reference`, `enum`, `number`, `integer`, `boolean`, `date`, `date-time`, `time` or
392
358
  `string`. A prose value, or one of no kind, is `prose`, a list or an object holds the facts of its members, and a value written
393
- `null` is `null`. A
394
- value that does not fit its kind, such as a string in a number field, a fraction in an integer
359
+ `null` is `null`. A value that does not fit its kind, such as a string in a number field, a fraction in an integer
395
360
  field, a value outside its `enum` or a reference `resolve` maps to no `{ id, member? }`, is `unreadable`; a readable reference holds that
396
361
  `id` and the `member` it binds, which `members(facts, path)` lists at a `/members/<pointer>`.
397
362
 
@@ -422,3 +387,14 @@ unknown extension `application/octet-stream`, and `fileExtension(type)` is the e
422
387
  named by. `SCRIPT_MEDIA_TYPES` lists the types a script is declared under, `dataUrl(type, base64)`
423
388
  and `dataUrlPattern(types)` write and match a base64 data URL, `formDataType(boundary)` is a
424
389
  multipart form's type and `gitMediaType(service, part)` a Git transport's.
390
+
391
+ ## Moments
392
+
393
+ `shownMoment(at, reader)` shows a `Date` to a person as a calendar does: its day and minute in the
394
+ `MomentReader`'s `language` and IANA time `zone`, naming no zone, or in UTC, named, where `zone` is
395
+ `null`. `shownDay(at, reader)` shows its day alone, in UTC where `zone` is `null`.
396
+
397
+ `recentWords(at, now)` reads an ISO moment `at` against the epoch milliseconds `now` in English:
398
+ the word `now` under a minute, then `<n> min ago`, `<n> h ago`, `yesterday` and `<n> days ago`, an
399
+ unreadable `at` `''`, and `null` from a week on. `agoWords(at, now, zone)` answers the same and,
400
+ from a week on, `shownDay` of `at` in English in `zone`.
package/README.md CHANGED
@@ -43,12 +43,13 @@ if (checked.verdict === 'accept') {
43
43
  | `apply` | Apply field, section, preamble, link and reference changes at once |
44
44
  | `links`, `target`, `retarget` | Inventory and rewrite link destinations |
45
45
  | `escapePointer` | Write one key as a JSON Pointer token |
46
- | `project`, `divide` | Embedding projection input and its division into Spans |
47
46
  | `facts`, `candidateOf` | A Document as one change saw it, matched as one query candidate |
48
47
  | `planOf`, `matches`, `sql` | Check a query, answer it over one Document or compile it to SQL |
49
48
  | `VERSION` | The MD model version |
50
49
  | `MEMBER_FIELD`, `SITE_FIELD`, `SUBMITTED_FIELD` | The frontmatter keys validation counts as declared beyond a type's |
51
50
  | `MEDIA_TYPES`, `servedMediaType` | The media types House writes and the one table of file extensions |
51
+ | `shownMoment`, `shownDay` | A moment shown to a person in their language and time zone |
52
+ | `agoWords`, `recentWords` | How long ago a moment was, in words |
52
53
 
53
54
  The full reference is in [`API.md`](API.md). The conformance corpus and its
54
55
  verdict format and rule ids are described in [`fixtures/README.md`](fixtures/README.md).
@@ -1 +1 @@
1
- {"version":3,"file":"built-in.d.ts","sourceRoot":"","sources":["../src/built-in.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAiBhD,eAAO,MAAM,WAAW,eAA8C,CAAC;AAEvE,eAAO,MAAM,gBAAgB,EAAE,aAG7B,CAAC"}
1
+ {"version":3,"file":"built-in.d.ts","sourceRoot":"","sources":["../src/built-in.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAmChD,eAAO,MAAM,WAAW,eAA8C,CAAC;AAEvE,eAAO,MAAM,gBAAgB,EAAE,aAG7B,CAAC"}
package/dist/built-in.js CHANGED
@@ -6,10 +6,19 @@ function modelText(model) {
6
6
  .map(([name, declared]) => `${name}: ${JSON.stringify(declared)}`)
7
7
  .join('\n')}\n`;
8
8
  }
9
+ function marked(definition) {
10
+ return definition.builtIn === true ? definition : Object.freeze({ ...definition, builtIn: true });
11
+ }
9
12
  function builtIn(text, provided) {
10
13
  const checked = verify(text, provided);
11
14
  if (checked.verdict === 'accept')
12
- return checked.model;
15
+ return Object.freeze({
16
+ ...checked.model,
17
+ types: Object.freeze(Object.assign(Object.create(null), Object.fromEntries(Object.entries(checked.model.types).map(([name, definition]) => [
18
+ name,
19
+ marked(definition),
20
+ ])))),
21
+ });
13
22
  throw new Error(`House's built-in types refuse: ${checked.rule} ${checked.location ?? ''}`.trim());
14
23
  }
15
24
  export const HOUSE_MODEL = builtIn(modelText(HOUSE_MODEL_DECLARATION));
@@ -14,6 +14,7 @@ export type ValueFacts = {
14
14
  readonly prefix?: readonly ValueFacts[];
15
15
  readonly items?: ValueFacts;
16
16
  readonly properties?: Readonly<Record<string, ValueFacts>>;
17
+ readonly required?: readonly string[];
17
18
  readonly patterns?: readonly PatternFacts[];
18
19
  readonly additional?: ValueFacts;
19
20
  };
@@ -44,6 +45,10 @@ export type Definition = {
44
45
  readonly rules: Readonly<Record<string, FieldRules>>;
45
46
  readonly createRoles?: readonly string[];
46
47
  readonly deleteRoles?: readonly string[];
48
+ readonly indexed?: readonly string[];
49
+ readonly unique?: readonly string[];
50
+ readonly folders?: readonly string[];
51
+ readonly builtIn?: true;
47
52
  readonly shape: Shape;
48
53
  };
49
54
  export type Failure = {
@@ -58,6 +63,8 @@ export declare const JSON_TYPES: readonly JsonType[];
58
63
  export declare const BUILT_IN_TYPE = "any";
59
64
  export declare const ATTACHMENT = "attachment";
60
65
  export declare const OPENING: readonly string[];
66
+ export declare const FOLDERS_SECTION = "folders";
67
+ export declare const UNIONS: readonly string[];
61
68
  export declare const ARRAY_INDEX: RegExp;
62
69
  export declare const JSON_POINTER: RegExp;
63
70
  export declare function refuse(rule: string, location: string): Failure;
@@ -75,6 +82,7 @@ export declare function conjoined(declared: readonly {
75
82
  readonly ancestry: ReadonlySet<unknown>;
76
83
  };
77
84
  export declare function variantsOf({ node, at }: Placed): Placed[];
85
+ export declare function admitted(nodes: readonly unknown[], defs: Readonly<Record<string, unknown>>, ancestry: ReadonlySet<unknown>): Set<string> | null;
78
86
  export declare function valueFacts(node: unknown, defs: Readonly<Record<string, unknown>>): ValueFacts;
79
87
  export declare function itemFacts(facts: ValueFacts, index: number): ValueFacts | undefined;
80
88
  export declare function memberFacts(facts: ValueFacts, key: string): ValueFacts | undefined;
@@ -87,5 +95,5 @@ export declare function crossedFacts(facts: ValueFacts): ValueFacts[];
87
95
  export declare function fieldFacts(definition: Definition, key: string): ValueFacts | undefined;
88
96
  export declare function pointerFacts(definition: Definition, pointer: string): PointerFacts | undefined;
89
97
  export declare function untitled(definition: Definition): Definition;
90
- export declare function readSchema(text: string, provided?: VerifiedModel, checked?: boolean): VerifiedModel | Failure;
98
+ export declare function readSchema(text: string, provided?: VerifiedModel, checked?: boolean, start?: number, end?: number): VerifiedModel | Failure;
91
99
  //# sourceMappingURL=definition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../src/definition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjG,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;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