@agentshouse/mdmodel 0.1.0-c807a6b98e2b4 → 0.1.0-c839e4b34c8dc

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 (318) hide show
  1. package/API.md +94 -115
  2. package/README.md +15 -14
  3. package/dist/built-in.d.ts.map +1 -1
  4. package/dist/built-in.js +10 -1
  5. package/dist/definition.d.ts +10 -2
  6. package/dist/definition.d.ts.map +1 -1
  7. package/dist/definition.js +97 -19
  8. package/dist/document.d.ts +3 -2
  9. package/dist/document.d.ts.map +1 -1
  10. package/dist/document.js +113 -71
  11. package/dist/event.d.ts +5 -8
  12. package/dist/event.d.ts.map +1 -1
  13. package/dist/event.js +4 -3
  14. package/dist/facts.d.ts.map +1 -1
  15. package/dist/facts.js +8 -4
  16. package/dist/fields.d.ts +1 -1
  17. package/dist/fields.d.ts.map +1 -1
  18. package/dist/fields.js +2 -2
  19. package/dist/folders.d.ts +5 -0
  20. package/dist/folders.d.ts.map +1 -0
  21. package/dist/folders.js +19 -0
  22. package/dist/house-model.d.ts +283 -20
  23. package/dist/house-model.d.ts.map +1 -1
  24. package/dist/house-model.js +147 -14
  25. package/dist/house-references/patterns.d.ts +5 -1
  26. package/dist/house-references/patterns.d.ts.map +1 -1
  27. package/dist/house-references/patterns.js +8 -1
  28. package/dist/index.d.ts +21 -15
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +15 -12
  31. package/dist/indexed.d.ts +10 -0
  32. package/dist/indexed.d.ts.map +1 -0
  33. package/dist/indexed.js +63 -0
  34. package/dist/kinds.d.ts +9 -1
  35. package/dist/kinds.d.ts.map +1 -1
  36. package/dist/kinds.js +68 -0
  37. package/dist/markdown.d.ts +0 -4
  38. package/dist/markdown.d.ts.map +1 -1
  39. package/dist/markdown.js +1 -34
  40. package/dist/moment.d.ts +9 -0
  41. package/dist/moment.d.ts.map +1 -0
  42. package/dist/moment.js +40 -0
  43. package/dist/not-ready.d.ts +2 -0
  44. package/dist/not-ready.d.ts.map +1 -0
  45. package/dist/not-ready.js +5 -0
  46. package/dist/paths.d.ts +6 -0
  47. package/dist/paths.d.ts.map +1 -1
  48. package/dist/paths.js +33 -3
  49. package/dist/query/language.d.ts +4 -1
  50. package/dist/query/language.d.ts.map +1 -1
  51. package/dist/query/language.js +8 -7
  52. package/dist/query/match.d.ts +1 -1
  53. package/dist/query/match.d.ts.map +1 -1
  54. package/dist/query/match.js +3 -24
  55. package/dist/query/rows.d.ts +6 -1
  56. package/dist/query/rows.d.ts.map +1 -1
  57. package/dist/query/rows.js +37 -8
  58. package/dist/query/sql.d.ts +10 -1
  59. package/dist/query/sql.d.ts.map +1 -1
  60. package/dist/query/sql.js +22 -3
  61. package/dist/query/walk.d.ts +73 -0
  62. package/dist/query/walk.d.ts.map +1 -0
  63. package/dist/query/walk.js +277 -0
  64. package/dist/references.d.ts +2 -2
  65. package/dist/references.d.ts.map +1 -1
  66. package/dist/references.js +1 -1
  67. package/dist/reserved.d.ts +1 -1
  68. package/dist/reserved.d.ts.map +1 -1
  69. package/dist/reserved.js +15 -6
  70. package/dist/room-types.d.ts +2 -1
  71. package/dist/room-types.d.ts.map +1 -1
  72. package/dist/room-types.js +16 -11
  73. package/dist/schema.d.ts +1 -1
  74. package/dist/schema.d.ts.map +1 -1
  75. package/dist/schema.js +6 -7
  76. package/dist/types.d.ts +11 -31
  77. package/dist/types.d.ts.map +1 -1
  78. package/dist/validate.d.ts +7 -3
  79. package/dist/validate.d.ts.map +1 -1
  80. package/dist/validate.js +108 -46
  81. package/dist/view.d.ts +5 -0
  82. package/dist/view.d.ts.map +1 -0
  83. package/dist/view.js +27 -0
  84. package/dist/yaml.d.ts +7 -5
  85. package/dist/yaml.d.ts.map +1 -1
  86. package/dist/yaml.js +154 -33
  87. package/fixtures/README.md +65 -57
  88. package/fixtures/cases/absent-link-dangles/{schema.yaml → schema.md} +2 -0
  89. package/fixtures/cases/absent-optional-field/{schema.yaml → schema.md} +2 -0
  90. package/fixtures/cases/absolute-link/{schema.yaml → schema.md} +2 -0
  91. package/fixtures/cases/attachment-reference-any-file/{schema.yaml → schema.md} +2 -0
  92. package/fixtures/cases/attachment-reference-dangles/{schema.yaml → schema.md} +2 -0
  93. package/fixtures/cases/attachment-reference-outside/{schema.yaml → schema.md} +2 -0
  94. package/fixtures/cases/binary-any-reference/{schema.yaml → schema.md} +2 -0
  95. package/fixtures/cases/binary-document-collision/{schema.yaml → schema.md} +2 -0
  96. package/fixtures/cases/binary-image-dangles/{schema.yaml → schema.md} +2 -0
  97. package/fixtures/cases/binary-link-dangles/{schema.yaml → schema.md} +2 -0
  98. package/fixtures/cases/binary-link-outside-collection/{schema.yaml → schema.md} +2 -0
  99. package/fixtures/cases/binary-prototype-reference/{schema.yaml → schema.md} +2 -0
  100. package/fixtures/cases/binary-typed-reference/{schema.yaml → schema.md} +2 -0
  101. package/fixtures/cases/block-scalar-frontmatter/expected.json +1 -0
  102. package/fixtures/cases/block-scalar-frontmatter/library/notes/literal.md +17 -0
  103. package/fixtures/cases/block-scalar-frontmatter/library/skills/notes/SKILL.md +10 -0
  104. package/fixtures/cases/boolean-field/{schema.yaml → schema.md} +2 -0
  105. package/fixtures/cases/{duplicate-link-definition/schema.yaml → bracketed-link-definition/schema.md} +2 -0
  106. package/fixtures/cases/closed-nested-object/{schema.yaml → schema.md} +2 -0
  107. package/fixtures/cases/composed-root-reference/{schema.yaml → schema.md} +2 -0
  108. package/fixtures/cases/conditional-long-text/{schema.yaml → schema.md} +2 -0
  109. package/fixtures/cases/cross-room-link/{schema.yaml → schema.md} +2 -0
  110. package/fixtures/cases/cross-room-reference/{schema.yaml → schema.md} +2 -0
  111. package/fixtures/cases/date-time-format/{schema.yaml → schema.md} +2 -0
  112. package/fixtures/cases/declared-binary-links/schema.md +3 -0
  113. package/fixtures/cases/default-unfilled/schema.md +57 -0
  114. package/fixtures/cases/defs-pattern/schema.md +57 -0
  115. package/fixtures/cases/dependent-rule/schema.md +57 -0
  116. package/fixtures/cases/{bracketed-link-definition/schema.yaml → duplicate-link-definition/schema.md} +2 -0
  117. package/fixtures/cases/email-format/schema.md +57 -0
  118. package/fixtures/cases/equal-labels/{schema.yaml → schema.md} +2 -0
  119. package/fixtures/cases/fenced-link-definition/schema.md +7 -0
  120. package/fixtures/cases/field-enum/{schema.yaml → schema.md} +2 -0
  121. package/fixtures/cases/folder-keeps-a-built-in-type/context.json +1 -0
  122. package/fixtures/cases/folder-keeps-a-built-in-type/expected.json +1 -0
  123. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/door.md +3 -0
  124. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/host.md +13 -0
  125. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/map.md +24 -0
  126. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/open.md +13 -0
  127. package/fixtures/cases/folder-keeps-a-built-in-type/schema.md +9 -0
  128. package/fixtures/cases/folder-keeps-a-record/context.json +1 -0
  129. package/fixtures/cases/folder-keeps-a-record/expected.json +1 -0
  130. package/fixtures/cases/folder-keeps-a-record/library/tickets/2026-11-16-d_1.r.md +13 -0
  131. package/fixtures/cases/folder-keeps-a-record/library/tickets/door.md +3 -0
  132. package/fixtures/cases/folder-keeps-a-record/schema.md +9 -0
  133. package/fixtures/cases/folder-names-no-type-of-the-schema/context.json +1 -0
  134. package/fixtures/cases/folder-names-no-type-of-the-schema/expected.json +5 -0
  135. package/fixtures/cases/folder-names-no-type-of-the-schema/schema.md +7 -0
  136. package/fixtures/cases/folder-nearer-entry-types-a-document/context.json +1 -0
  137. package/fixtures/cases/folder-nearer-entry-types-a-document/expected.json +6 -0
  138. package/fixtures/cases/folder-nearer-entry-types-a-document/library/tickets/archive/2025/old.md +1 -0
  139. package/fixtures/cases/folder-nearer-entry-types-a-document/schema.md +15 -0
  140. package/fixtures/cases/folder-refuses-a-declared-any/context.json +1 -0
  141. package/fixtures/cases/folder-refuses-a-declared-any/expected.json +6 -0
  142. package/fixtures/cases/folder-refuses-a-declared-any/library/tickets/door.md +5 -0
  143. package/fixtures/cases/folder-refuses-a-declared-any/schema.md +9 -0
  144. package/fixtures/cases/folder-refuses-another-declared-type/context.json +1 -0
  145. package/fixtures/cases/folder-refuses-another-declared-type/expected.json +6 -0
  146. package/fixtures/cases/folder-refuses-another-declared-type/library/tickets/door.md +5 -0
  147. package/fixtures/cases/folder-refuses-another-declared-type/schema.md +12 -0
  148. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/context.json +1 -0
  149. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/expected.json +1 -0
  150. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/notes/plan.md +7 -0
  151. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/door.md +3 -0
  152. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/gate.md +7 -0
  153. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/schema.md +13 -0
  154. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/context.json +1 -0
  155. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/expected.json +6 -0
  156. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/library/tickets/2026/gate.md +1 -0
  157. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/schema.md +9 -0
  158. package/fixtures/cases/folder-types-a-document-that-names-no-type/context.json +1 -0
  159. package/fixtures/cases/folder-types-a-document-that-names-no-type/expected.json +7 -0
  160. package/fixtures/cases/folder-types-a-document-that-names-no-type/library/tickets/door.md +3 -0
  161. package/fixtures/cases/folder-types-a-document-that-names-no-type/schema.md +9 -0
  162. package/fixtures/cases/folder-under-a-reserved-name/context.json +1 -0
  163. package/fixtures/cases/folder-under-a-reserved-name/expected.json +5 -0
  164. package/fixtures/cases/folder-under-a-reserved-name/schema.md +7 -0
  165. package/fixtures/cases/folder-without-a-trailing-slash/context.json +1 -0
  166. package/fixtures/cases/folder-without-a-trailing-slash/expected.json +5 -0
  167. package/fixtures/cases/folder-without-a-trailing-slash/schema.md +7 -0
  168. package/fixtures/cases/frontmatter-construct/context.json +1 -0
  169. package/fixtures/cases/frontmatter-construct/expected.json +7 -0
  170. package/fixtures/cases/frontmatter-construct/library/note.md +6 -0
  171. package/fixtures/cases/integer-field/schema.md +57 -0
  172. package/fixtures/cases/interrupted-link-definition/schema.md +3 -0
  173. package/fixtures/cases/json-schema-constructs/schema.md +57 -0
  174. package/fixtures/cases/labels-in-the-rooms-language/{schema.yaml → schema.md} +2 -0
  175. package/fixtures/cases/lazy-list-item/{schema.yaml → schema.md} +2 -0
  176. package/fixtures/cases/link-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
  177. package/fixtures/cases/list-item-enum/{schema.yaml → schema.md} +2 -0
  178. package/fixtures/cases/list-item-kind/{schema.yaml → schema.md} +2 -0
  179. package/fixtures/cases/list-items/{schema.yaml → schema.md} +2 -0
  180. package/fixtures/cases/list-of-objects-closed/schema.md +57 -0
  181. package/fixtures/cases/list-of-objects-item/schema.md +57 -0
  182. package/fixtures/cases/list-of-objects-reference/{schema.yaml → schema.md} +2 -0
  183. package/fixtures/cases/list-reference-path/{schema.yaml → schema.md} +2 -0
  184. package/fixtures/cases/list-reference-type/{schema.yaml → schema.md} +2 -0
  185. package/fixtures/cases/list-size/schema.md +57 -0
  186. package/fixtures/cases/long-fence-link-definition/schema.md +3 -0
  187. package/fixtures/cases/long-value-past-six-levels/{schema.yaml → schema.md} +2 -0
  188. package/fixtures/cases/malformed-definition/{schema.yaml → schema.md} +2 -0
  189. package/fixtures/cases/malformed-list/{schema.yaml → schema.md} +2 -0
  190. package/fixtures/cases/member-document/{schema.yaml → schema.md} +2 -0
  191. package/fixtures/cases/member-on-another-type/{schema.yaml → schema.md} +2 -0
  192. package/fixtures/cases/missing-required-field/{schema.yaml → schema.md} +2 -0
  193. package/fixtures/cases/misspelled-key/schema.md +57 -0
  194. package/fixtures/cases/name-not-a-string/{schema.yaml → schema.md} +2 -0
  195. package/fixtures/cases/nested-defs/{schema.yaml → schema.md} +2 -0
  196. package/fixtures/cases/nested-object-reference/schema.md +34 -0
  197. package/fixtures/cases/nested-reference/schema.md +34 -0
  198. package/fixtures/cases/nested-required-field/schema.md +57 -0
  199. package/fixtures/cases/numeric-range/schema.md +57 -0
  200. package/fixtures/cases/one-key-two-labels/{schema.yaml → schema.md} +2 -0
  201. package/fixtures/cases/one-key-two-types/{schema.yaml → schema.md} +2 -0
  202. package/fixtures/cases/one-of-variant/schema.md +57 -0
  203. package/fixtures/cases/other-room-reference/schema.md +34 -0
  204. package/fixtures/cases/paragraph-link-definition/schema.md +3 -0
  205. package/fixtures/cases/prototype-field/schema.md +7 -0
  206. package/fixtures/cases/quoted-link-definition/schema.md +3 -0
  207. package/fixtures/cases/reference-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
  208. package/fixtures/cases/reference-to-any-file-name/context.json +1 -0
  209. package/fixtures/cases/reference-to-any-file-name/expected.json +1 -0
  210. package/fixtures/cases/reference-to-any-file-name/library/people/100%.md +4 -0
  211. package/fixtures/cases/reference-to-any-file-name/library/people/C#.md +4 -0
  212. package/fixtures/cases/reference-to-any-file-name/library/people/My notes.md +4 -0
  213. package/fixtures/cases/reference-to-any-file-name/library/people/[draft].md +4 -0
  214. package/fixtures/cases/reference-to-any-file-name/library/people/c (d).md +4 -0
  215. package/fixtures/cases/reference-to-any-file-name/library/people/caf/303/251.md +4 -0
  216. package/fixtures/cases/reference-to-any-file-name/library/people//320/236/321/202/321/207/321/221/321/202.md +4 -0
  217. package/fixtures/cases/reference-to-any-file-name/library/tasks/bracket.md +9 -0
  218. package/fixtures/cases/reference-to-any-file-name/library/tasks/cyrillic.md +9 -0
  219. package/fixtures/cases/reference-to-any-file-name/library/tasks/decomposed.md +9 -0
  220. package/fixtures/cases/reference-to-any-file-name/library/tasks/hash.md +9 -0
  221. package/fixtures/cases/reference-to-any-file-name/library/tasks/parenthesis.md +9 -0
  222. package/fixtures/cases/reference-to-any-file-name/library/tasks/percent.md +9 -0
  223. package/fixtures/cases/reference-to-any-file-name/library/tasks/spaced.md +9 -0
  224. package/fixtures/cases/{referenced-missing-file/schema.yaml → reference-to-any-file-name/schema.md} +2 -0
  225. package/fixtures/cases/referenced-missing-file/schema.md +12 -0
  226. package/fixtures/cases/referenced-missing-non-latin-file/context.json +1 -0
  227. package/fixtures/cases/referenced-missing-non-latin-file/expected.json +6 -0
  228. package/fixtures/cases/referenced-missing-non-latin-file/library/tasks/a.md +9 -0
  229. package/fixtures/cases/referenced-missing-non-latin-file/library/tasks/b.md +9 -0
  230. package/fixtures/cases/referenced-missing-non-latin-file/schema.md +12 -0
  231. package/fixtures/cases/remote-ref/{schema.yaml → schema.md} +2 -0
  232. package/fixtures/cases/schema-body-ignored/context.json +1 -0
  233. package/fixtures/cases/schema-body-ignored/expected.json +1 -0
  234. package/fixtures/cases/schema-body-ignored/schema.md +9 -0
  235. package/fixtures/cases/schema-type-named-folders/context.json +1 -0
  236. package/fixtures/cases/schema-type-named-folders/expected.json +5 -0
  237. package/fixtures/cases/schema-type-named-folders/schema.md +5 -0
  238. package/fixtures/cases/schema-type-named-type/context.json +1 -0
  239. package/fixtures/cases/schema-type-named-type/expected.json +5 -0
  240. package/fixtures/cases/{unknown-type/schema.yaml → schema-type-named-type/schema.md} +3 -1
  241. package/fixtures/cases/second-member-document/{schema.yaml → schema.md} +2 -0
  242. package/fixtures/cases/sections-keyword-refused/{schema.yaml → schema.md} +2 -0
  243. package/fixtures/cases/shortcut-reference-link/schema.md +7 -0
  244. package/fixtures/cases/string-length/schema.md +57 -0
  245. package/fixtures/cases/submission-keys/{schema.yaml → schema.md} +2 -0
  246. package/fixtures/cases/text-field-kind/{schema.yaml → schema.md} +2 -0
  247. package/fixtures/cases/thematic-break-ends-the-values/{schema.yaml → schema.md} +2 -0
  248. package/fixtures/cases/truncated-link-definition/schema.md +3 -0
  249. package/fixtures/cases/typed-path-names-another-type/{schema.yaml → schema.md} +2 -0
  250. package/fixtures/cases/typed-path-names-its-type/{schema.yaml → schema.md} +2 -0
  251. package/fixtures/cases/typed-path-names-no-type/{schema.yaml → schema.md} +2 -0
  252. package/fixtures/cases/types-folder-content/{schema.yaml → schema.md} +2 -0
  253. package/fixtures/cases/undeclared-field/schema.md +7 -0
  254. package/fixtures/cases/unevaluated-items-closed/{schema.yaml → schema.md} +2 -0
  255. package/fixtures/cases/unique-in-app-schema/context.json +1 -0
  256. package/fixtures/cases/unique-in-app-schema/expected.json +5 -0
  257. package/fixtures/cases/unique-in-app-schema/schema.yaml +7 -0
  258. package/fixtures/cases/unique-indexed-field/context.json +1 -0
  259. package/fixtures/cases/unique-indexed-field/expected.json +1 -0
  260. package/fixtures/cases/unique-indexed-field/library/tickets/first.md +8 -0
  261. package/fixtures/cases/unique-indexed-field/library/tickets/second.md +8 -0
  262. package/fixtures/cases/unique-indexed-field/schema.md +9 -0
  263. package/fixtures/cases/unique-off-indexed-field/context.json +1 -0
  264. package/fixtures/cases/unique-off-indexed-field/expected.json +5 -0
  265. package/fixtures/cases/unique-off-indexed-field/schema.md +9 -0
  266. package/fixtures/cases/unlisted-reference-type/{schema.yaml → schema.md} +2 -0
  267. package/fixtures/cases/unnamed-typed-path-checks-its-fields/{schema.yaml → schema.md} +2 -0
  268. package/fixtures/cases/unnamed-typed-path-names-a-type/{schema.yaml → schema.md} +2 -0
  269. package/fixtures/cases/unnamed-typed-path-reads-its-type/{schema.yaml → schema.md} +2 -0
  270. package/fixtures/cases/unnamed-typed-path-without-a-body/{schema.yaml → schema.md} +2 -0
  271. package/fixtures/cases/unresolved-link/schema.md +7 -0
  272. package/fixtures/cases/valid-typed-document/{schema.yaml → schema.md} +2 -0
  273. package/fixtures/cases/wide-item-fence-link/schema.md +3 -0
  274. package/fixtures/forms.json +24 -0
  275. package/fixtures/preamble.json +4 -4
  276. package/fixtures/queries.json +1172 -2
  277. package/fixtures/references.json +15 -0
  278. package/package.json +2 -2
  279. package/dist/divide.d.ts +0 -3
  280. package/dist/divide.d.ts.map +0 -1
  281. package/dist/divide.js +0 -321
  282. package/dist/project.d.ts +0 -22
  283. package/dist/project.d.ts.map +0 -1
  284. package/dist/project.js +0 -101
  285. package/fixtures/cases/declared-binary-links/schema.yaml +0 -1
  286. package/fixtures/cases/default-unfilled/schema.yaml +0 -55
  287. package/fixtures/cases/defs-pattern/schema.yaml +0 -55
  288. package/fixtures/cases/dependent-rule/schema.yaml +0 -55
  289. package/fixtures/cases/email-format/schema.yaml +0 -55
  290. package/fixtures/cases/fenced-link-definition/schema.yaml +0 -5
  291. package/fixtures/cases/frontmatter-schema/expected.json +0 -5
  292. package/fixtures/cases/integer-field/schema.yaml +0 -55
  293. package/fixtures/cases/interrupted-link-definition/schema.yaml +0 -1
  294. package/fixtures/cases/json-schema-constructs/schema.yaml +0 -55
  295. package/fixtures/cases/list-of-objects-closed/schema.yaml +0 -55
  296. package/fixtures/cases/list-of-objects-item/schema.yaml +0 -55
  297. package/fixtures/cases/list-size/schema.yaml +0 -55
  298. package/fixtures/cases/long-fence-link-definition/schema.yaml +0 -1
  299. package/fixtures/cases/misspelled-key/schema.yaml +0 -55
  300. package/fixtures/cases/nested-object-reference/schema.yaml +0 -32
  301. package/fixtures/cases/nested-reference/schema.yaml +0 -32
  302. package/fixtures/cases/nested-required-field/schema.yaml +0 -55
  303. package/fixtures/cases/numeric-range/schema.yaml +0 -55
  304. package/fixtures/cases/one-of-variant/schema.yaml +0 -55
  305. package/fixtures/cases/other-room-reference/schema.yaml +0 -32
  306. package/fixtures/cases/paragraph-link-definition/schema.yaml +0 -1
  307. package/fixtures/cases/prototype-field/schema.yaml +0 -5
  308. package/fixtures/cases/quoted-link-definition/schema.yaml +0 -1
  309. package/fixtures/cases/shortcut-reference-link/schema.yaml +0 -5
  310. package/fixtures/cases/string-length/schema.yaml +0 -55
  311. package/fixtures/cases/truncated-link-definition/schema.yaml +0 -1
  312. package/fixtures/cases/undeclared-field/schema.yaml +0 -5
  313. package/fixtures/cases/unresolved-link/schema.yaml +0 -5
  314. package/fixtures/cases/wide-item-fence-link/schema.yaml +0 -1
  315. package/fixtures/division.json +0 -454
  316. package/fixtures/projection.json +0 -358
  317. /package/fixtures/cases/{frontmatter-schema → block-scalar-frontmatter}/context.json +0 -0
  318. /package/fixtures/cases/{frontmatter-schema/schema.yaml → unknown-type/schema.md} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { APP_REFERENCE_PATTERN, ROOM_REFERENCE_PATTERN, SPACE_REFERENCE_PATTERN, } from './house-references/patterns.js';
2
2
  export const APP_PREFERENCES_HOME = 'settings/apps';
3
+ export const RECORD_TYPE = 'house-record';
3
4
  export const HOUSE_MODEL_DECLARATION = {
4
5
  $defs: {
5
6
  room: {
@@ -40,16 +41,23 @@ export const HOUSE_MODEL_DECLARATION = {
40
41
  'join-request',
41
42
  'join-request-approved',
42
43
  'room-ownership-offer',
44
+ 'new-instructions',
45
+ 'started-on-outdated-instructions',
46
+ 'instructions-proposal',
43
47
  'managed-environment-retention-opened',
44
48
  'storage-full',
45
49
  'sandbox-budget-spent',
46
50
  'trigger-failed',
51
+ 'app-origins-added',
47
52
  'room-telegram-chat-paused',
53
+ 'viber-number-unlinked',
54
+ 'conversation-work-kept',
48
55
  'break-glass-owner-disclosure',
49
56
  'export-ready',
50
57
  'export-failed',
51
58
  'custom',
52
59
  'agent-function-request-finished',
60
+ 'storage-past-included',
53
61
  ],
54
62
  },
55
63
  created: { title: 'Created', type: 'string', format: 'date-time' },
@@ -76,7 +84,7 @@ export const HOUSE_MODEL_DECLARATION = {
76
84
  name: { title: 'Name', type: 'string' },
77
85
  email: { title: 'Email', type: 'string', format: 'email' },
78
86
  },
79
- required: ['name', 'email'],
87
+ required: ['name'],
80
88
  },
81
89
  rooms: {
82
90
  title: 'Rooms',
@@ -141,9 +149,40 @@ export const HOUSE_MODEL_DECLARATION = {
141
149
  title: 'App',
142
150
  type: 'object',
143
151
  additionalProperties: false,
144
- properties: { app: { title: 'App', $ref: '#/$defs/app' } },
152
+ properties: {
153
+ app: { title: 'App', $ref: '#/$defs/app' },
154
+ name: { title: 'Name', type: 'string' },
155
+ },
145
156
  required: ['app'],
146
157
  },
158
+ origins: {
159
+ title: 'Origins',
160
+ type: 'array',
161
+ items: { type: 'string', minLength: 1, maxLength: 512 },
162
+ },
163
+ triggers: {
164
+ title: 'Triggers',
165
+ type: 'array',
166
+ items: {
167
+ type: 'object',
168
+ additionalProperties: false,
169
+ properties: {
170
+ trigger: { title: 'Trigger', $ref: '#/$defs/id' },
171
+ description: { title: 'Description', type: 'string' },
172
+ room: {
173
+ title: 'Room',
174
+ type: 'object',
175
+ additionalProperties: false,
176
+ properties: {
177
+ room: { title: 'Room', $ref: '#/$defs/room' },
178
+ name: { title: 'Name', type: 'string' },
179
+ },
180
+ required: ['room', 'name'],
181
+ },
182
+ },
183
+ required: ['trigger', 'description', 'room'],
184
+ },
185
+ },
147
186
  space: {
148
187
  title: 'Space',
149
188
  type: 'object',
@@ -152,6 +191,16 @@ export const HOUSE_MODEL_DECLARATION = {
152
191
  required: ['space'],
153
192
  },
154
193
  ownership_offer: { title: 'Ownership offer', $ref: '#/$defs/id' },
194
+ version: { title: 'Version', type: 'integer', minimum: 1 },
195
+ approved_version: { title: 'Approved version', type: 'integer', minimum: 1 },
196
+ instructions_proposal: { title: 'Instructions proposal', $ref: '#/$defs/id' },
197
+ proposer: {
198
+ title: 'Proposer',
199
+ type: 'object',
200
+ additionalProperties: false,
201
+ properties: { name: { title: 'Name', type: 'string' } },
202
+ required: ['name'],
203
+ },
155
204
  offerer: {
156
205
  title: 'Offerer',
157
206
  type: 'object',
@@ -160,7 +209,7 @@ export const HOUSE_MODEL_DECLARATION = {
160
209
  name: { title: 'Name', type: 'string' },
161
210
  email: { title: 'Email', type: 'string', format: 'email' },
162
211
  },
163
- required: ['name', 'email'],
212
+ required: ['name'],
164
213
  },
165
214
  environment: {
166
215
  title: 'Environment',
@@ -187,6 +236,7 @@ export const HOUSE_MODEL_DECLARATION = {
187
236
  required: ['held', 'limit', 'measure'],
188
237
  },
189
238
  chat: { title: 'Chat', type: 'string' },
239
+ folder: { title: 'Folder', type: 'string', minLength: 1, maxLength: 4096 },
190
240
  missing: {
191
241
  title: 'Missing',
192
242
  type: 'array',
@@ -205,6 +255,7 @@ export const HOUSE_MODEL_DECLARATION = {
205
255
  ],
206
256
  },
207
257
  },
258
+ number: { title: 'Number', type: 'string' },
208
259
  budget: { title: 'Budget', type: 'string', pattern: '^\\d+(?:\\.\\d+)?$' },
209
260
  resets_at: { title: 'Resets at', type: 'string', format: 'date-time' },
210
261
  grant: { title: 'Grant', $ref: '#/$defs/id' },
@@ -244,14 +295,17 @@ export const HOUSE_MODEL_DECLARATION = {
244
295
  enum: [
245
296
  'failed',
246
297
  'internal_error',
298
+ 'agent_function_unreadable',
247
299
  'function_failed',
248
300
  'function_not_started',
249
301
  'agent_function_request_not_started',
302
+ 'post_not_confirmed',
250
303
  ],
251
304
  },
252
305
  action: { title: 'Action', type: 'integer', minimum: 0 },
253
306
  moment: { title: 'Moment', type: 'string', format: 'date-time' },
254
307
  error: { title: 'Error', type: 'string' },
308
+ document_path: { title: 'Document path', type: 'string' },
255
309
  agent_function: {
256
310
  title: 'Agent function',
257
311
  type: 'object',
@@ -267,7 +321,25 @@ export const HOUSE_MODEL_DECLARATION = {
267
321
  required: ['name'],
268
322
  },
269
323
  ended: { title: 'Ended', type: 'string', enum: ['finished', 'failed'] },
324
+ failure_category: {
325
+ title: 'Failure category',
326
+ type: 'string',
327
+ enum: [
328
+ 'cli_signed_out',
329
+ 'cli_limit_reached',
330
+ 'model_refused',
331
+ 'owner_stopped',
332
+ 'agent_retired',
333
+ 'cli_stopped',
334
+ ],
335
+ },
270
336
  duration: { title: 'Duration', type: 'integer', minimum: 1 },
337
+ meter: { title: 'Meter', type: 'string', enum: ['indexed_text', 'blob'] },
338
+ average_bytes: { title: 'Average in bytes', type: 'integer', minimum: 0 },
339
+ included_bytes: { title: 'Included in bytes', type: 'integer', minimum: 1 },
340
+ block_bytes: { title: 'Block in bytes', type: 'integer', minimum: 1 },
341
+ block_usd: { title: 'Block price in USD', type: 'number', exclusiveMinimum: 0 },
342
+ amount_usd: { title: 'Amount in USD', type: 'number', exclusiveMinimum: 0 },
271
343
  },
272
344
  required: ['notification', 'kind', 'created', 'way_in', 'subject'],
273
345
  },
@@ -276,7 +348,7 @@ export const HOUSE_MODEL_DECLARATION = {
276
348
  properties: {},
277
349
  },
278
350
  'house-agent-function': {
279
- description: "One Agent function that serves this Room, which House alone writes from its owner's document in their Private Room: the `agent_function` by identifier, its `description`, the `input` a caller sends, empty when it takes nothing, and the `agent` it starts, by `agent` and the `name` that Agent had when this card was last written. The Agent function's instruction is never written here.",
351
+ description: "One Agent function that serves this Room, which House alone writes from its owner's document in their Private Room and their Standing answer for it: the `agent_function` by identifier, its `description`, the `input` a caller sends, empty when it takes nothing, the `agent` it starts, by `agent` and the `name` that Agent had when this card was last written, and its `answer`, how a request from anyone but its owner starts: `at_once`, `ask_me`, which waits for its owner's approval, or `off`, which refuses it. The Agent function's instruction is never written here.",
280
352
  properties: {
281
353
  reflected: { title: 'Reflected', type: 'string', format: 'date-time' },
282
354
  agent_function: { title: 'Agent function', $ref: '#/$defs/id' },
@@ -292,8 +364,9 @@ export const HOUSE_MODEL_DECLARATION = {
292
364
  },
293
365
  required: ['agent', 'name'],
294
366
  },
367
+ answer: { title: 'Answer', type: 'string', enum: ['at_once', 'ask_me', 'off'] },
295
368
  },
296
- required: ['reflected', 'agent_function', 'description', 'input', 'agent'],
369
+ required: ['reflected', 'agent_function', 'description', 'input', 'agent', 'answer'],
297
370
  },
298
371
  'house-agent-function-document': {
299
372
  description: 'One Agent function as its owner writes it in their Private Room at rooms/<room-handle>/agent-functions/<name>.md, a path that binds this type and a document that names no type: what it does as `description`, what a caller sends as `input`, empty when it takes nothing, the `agent` it starts, by identifier, and `afk`, true for a run nobody watches, off when absent. Its body is the instruction that Agent follows.',
@@ -306,7 +379,7 @@ export const HOUSE_MODEL_DECLARATION = {
306
379
  required: ['description', 'input', 'agent'],
307
380
  },
308
381
  'house-trigger': {
309
- description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles`; an `agent_function` action sends its `payload` to the Agent function whose card under this Room's `house/agent-functions/` its `card` names, absent while this Room holds no card of that Agent function; a `message` action puts its `text` into the active conversation that Agent function started for what the Event is about, or starts that Agent function when none is active; a `done` action marks Done every active conversation an Agent function request of this Room started for the Event's document; a `function` action runs the `function` its `app`'s latest release declares, on House's servers, or, naming no `app`, the Room owner's Environment function of that name on its Environment, which only a Trigger of their Private Room holds. Whether an action's target holds is not written: it follows from the Room's members, the Agent function's card, the App's latest release and the owner's functions.",
382
+ description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles`, or, `in_group`, posts once in this Room's Telegram group in their place, mentioning each; an `agent_function` action starts the Agent function whose card under this Room's `house/agent-functions/` its `card` names with the Event, `card` absent while this Room holds no card of that Agent function; a `message` action puts the Event into the active conversation that Agent function started for what the Event is about, or starts that Agent function with it when none is active; the request either starts runs on the `model` and `effort` the action names, the Agent's where it names none; a `function` action runs the `function` its `app`'s latest release declares, on House's servers, while the `user` it was `attached_by` owns this Room, or, naming no `app`, the Environment function of that name the `user` its `owner` names keeps, on its Environment, from any Room that Environment reaches, at once while its owner has it on there, never while it is off, and at once in the owner's Private Room, its target holding while that Environment reaches this Room. Whether an action's target holds is not written: it follows from the Room's members, the Agent function's card, the App's latest release, who owns this Room, and each owner's functions and the Rooms their Environments reach.",
310
383
  properties: {
311
384
  reflected: { title: 'Reflected', type: 'string', format: 'date-time' },
312
385
  trigger: { title: 'Trigger', $ref: '#/$defs/id' },
@@ -350,6 +423,7 @@ export const HOUSE_MODEL_DECLARATION = {
350
423
  },
351
424
  required: ['users', 'fields', 'roles'],
352
425
  },
426
+ in_group: { title: 'In group', const: true },
353
427
  },
354
428
  required: ['kind', 'enabled', 'title', 'text', 'to'],
355
429
  },
@@ -360,9 +434,10 @@ export const HOUSE_MODEL_DECLARATION = {
360
434
  kind: { title: 'Kind', const: 'agent_function' },
361
435
  enabled: { title: 'Enabled', type: 'boolean' },
362
436
  card: { title: 'Card', type: 'string', minLength: 1 },
363
- payload: { title: 'Payload', type: 'string' },
437
+ model: { title: 'Model', type: 'string', minLength: 1 },
438
+ effort: { title: 'Effort', type: 'string', minLength: 1 },
364
439
  },
365
- required: ['kind', 'enabled', 'payload'],
440
+ required: ['kind', 'enabled'],
366
441
  },
367
442
  {
368
443
  type: 'object',
@@ -371,18 +446,28 @@ export const HOUSE_MODEL_DECLARATION = {
371
446
  kind: { title: 'Kind', const: 'message' },
372
447
  enabled: { title: 'Enabled', type: 'boolean' },
373
448
  card: { title: 'Card', type: 'string', minLength: 1 },
374
- text: { title: 'Text', type: 'string' },
449
+ model: { title: 'Model', type: 'string', minLength: 1 },
450
+ effort: { title: 'Effort', type: 'string', minLength: 1 },
375
451
  },
376
- required: ['kind', 'enabled', 'text'],
452
+ required: ['kind', 'enabled'],
377
453
  },
378
454
  {
379
455
  type: 'object',
380
456
  additionalProperties: false,
381
457
  properties: {
382
- kind: { title: 'Kind', const: 'done' },
458
+ kind: { title: 'Kind', const: 'function' },
383
459
  enabled: { title: 'Enabled', type: 'boolean' },
460
+ app: { title: 'App', $ref: '#/$defs/app' },
461
+ function: { title: 'Function', type: 'string' },
462
+ attached_by: {
463
+ title: 'Attached by',
464
+ type: 'object',
465
+ additionalProperties: false,
466
+ properties: { user: { title: 'User', $ref: '#/$defs/id' } },
467
+ required: ['user'],
468
+ },
384
469
  },
385
- required: ['kind', 'enabled'],
470
+ required: ['kind', 'enabled', 'app', 'function'],
386
471
  },
387
472
  {
388
473
  type: 'object',
@@ -390,10 +475,16 @@ export const HOUSE_MODEL_DECLARATION = {
390
475
  properties: {
391
476
  kind: { title: 'Kind', const: 'function' },
392
477
  enabled: { title: 'Enabled', type: 'boolean' },
393
- app: { title: 'App', $ref: '#/$defs/app' },
394
478
  function: { title: 'Function', type: 'string' },
479
+ owner: {
480
+ title: 'Owner',
481
+ type: 'object',
482
+ additionalProperties: false,
483
+ properties: { user: { title: 'User', $ref: '#/$defs/id' } },
484
+ required: ['user'],
485
+ },
395
486
  },
396
- required: ['kind', 'enabled', 'function'],
487
+ required: ['kind', 'enabled', 'function', 'owner'],
397
488
  },
398
489
  ],
399
490
  },
@@ -423,6 +514,26 @@ export const HOUSE_MODEL_DECLARATION = {
423
514
  'created',
424
515
  ],
425
516
  },
517
+ 'house-record': {
518
+ description: "One Record: a Markdown document House received from outside, written by the `record` op of `update` or by a push address, and edited by nobody afterwards. `received` is what House attests: `at`, when House accepted it; `through`, the push address that delivered it, or `by`, the User whose act delivered it; `key`, its delivery key, where it has one; and `original`, the path of its original beside it, where it has one. `claimed` is what its sender says, kept as delivered, conventionally `from`, `date`, `subject` and a push delivery's request `headers`; House vouches for none of it. Its body is kept as delivered, and no Room or Space schema validates it.",
519
+ properties: {
520
+ received: {
521
+ title: 'Received',
522
+ type: 'object',
523
+ additionalProperties: false,
524
+ properties: {
525
+ at: { title: 'At', type: 'string', format: 'date-time' },
526
+ through: { title: 'Through', type: 'string' },
527
+ by: { title: 'By', type: 'string' },
528
+ key: { title: 'Key', type: 'string' },
529
+ original: { title: 'Original', type: 'string' },
530
+ },
531
+ required: ['at'],
532
+ },
533
+ claimed: { title: 'Claimed', type: 'object', additionalProperties: true },
534
+ },
535
+ required: ['received', 'claimed'],
536
+ },
426
537
  'house-web-wizard': {
427
538
  description: "One Web Wizard an agent made for this User: the `environment` it runs on, with the `name` that Environment had when the Web Wizard was made, and its `state`, `waiting` until its owner presses Run or Keep, `running`, `finished` with the script's `exit_code`, `failed`, `cancelled` when its page closed before the script ended, `lapsed` when nobody ran it in its time, or `kept` when its owner kept the script, without running it, as their Environment function named `function`. Its body is the script, whole, in one fenced code block. The terminal's output is never kept.",
428
539
  properties: {
@@ -447,6 +558,28 @@ export const HOUSE_MODEL_DECLARATION = {
447
558
  },
448
559
  required: ['reflected', 'web_wizard', 'environment', 'state'],
449
560
  },
561
+ 'house-instructions-proposal': {
562
+ description: "One change of this Room's instructions an Agent proposed and its person sent to the Room, which House alone writes: the `instructions_proposal` by identifier, its `proposer` by `user` and the `name` they had when it was last written, the `base_version` of the instructions it was written against, absent when the Room had none, its `state`, `sent` while it waits for a holder of Can change instructions, `accepted` once one made it the Room's `version`, or `not_taken` once a later version closed it, and when it was `created`. Its body is the proposed text, whole.",
563
+ properties: {
564
+ reflected: { title: 'Reflected', type: 'string', format: 'date-time' },
565
+ instructions_proposal: { title: 'Instructions proposal', $ref: '#/$defs/id' },
566
+ proposer: {
567
+ title: 'Proposer',
568
+ type: 'object',
569
+ additionalProperties: false,
570
+ properties: {
571
+ user: { title: 'User', $ref: '#/$defs/id' },
572
+ name: { title: 'Name', type: 'string' },
573
+ },
574
+ required: ['user', 'name'],
575
+ },
576
+ base_version: { title: 'Base version', type: 'integer', minimum: 1 },
577
+ state: { title: 'State', enum: ['sent', 'accepted', 'not_taken'] },
578
+ version: { title: 'Version', type: 'integer', minimum: 1 },
579
+ created: { title: 'Created', type: 'string', format: 'date-time' },
580
+ },
581
+ required: ['reflected', 'instructions_proposal', 'proposer', 'state', 'created'],
582
+ },
450
583
  };
451
584
  export const HOUSE_TYPED_PATHS = [
452
585
  { path: 'settings/panel.md', type: 'house-panel-preferences', named: true, body: false },
@@ -1,9 +1,13 @@
1
1
  export declare const ROOM_REFERENCE_PREFIX = "r_";
2
2
  export declare const APP_REFERENCE_PREFIX = "a_";
3
3
  export declare const SPACE_REFERENCE_PREFIX = "sp_";
4
- export declare const REVISION_REFERENCE_PREFIX = "fr_";
4
+ export declare const DOCUMENT_REFERENCE_PREFIX = "d_";
5
+ export declare const ATTACHMENT_REFERENCE_PREFIX = "at_";
6
+ export declare const REVISION_REFERENCE_PREFIX = "v_";
5
7
  export declare const ROOM_REFERENCE_PATTERN: RegExp;
6
8
  export declare const APP_REFERENCE_PATTERN: RegExp;
7
9
  export declare const SPACE_REFERENCE_PATTERN: RegExp;
10
+ export declare const DOCUMENT_REFERENCE_PATTERN: RegExp;
11
+ export declare const ATTACHMENT_REFERENCE_PATTERN: RegExp;
8
12
  export declare const REVISION_REFERENCE_PATTERN: RegExp;
9
13
  //# sourceMappingURL=patterns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/house-references/patterns.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C,eAAO,MAAM,yBAAyB,QAAQ,CAAC;AAM/C,eAAO,MAAM,sBAAsB,QAA0C,CAAC;AAE9E,eAAO,MAAM,qBAAqB,QAAyC,CAAC;AAE5E,eAAO,MAAM,uBAAuB,QAA2C,CAAC;AAIhF,eAAO,MAAM,0BAA0B,QAEtC,CAAC"}
1
+ {"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/house-references/patterns.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AAEjD,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAM9C,eAAO,MAAM,sBAAsB,QAA0C,CAAC;AAE9E,eAAO,MAAM,qBAAqB,QAAyC,CAAC;AAE5E,eAAO,MAAM,uBAAuB,QAA2C,CAAC;AAQhF,eAAO,MAAM,0BAA0B,QAA0C,CAAC;AAElF,eAAO,MAAM,4BAA4B,QAA4C,CAAC;AAEtF,eAAO,MAAM,0BAA0B,QAEtC,CAAC"}
@@ -2,7 +2,9 @@ import { CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER } from './crockford.js
2
2
  export const ROOM_REFERENCE_PREFIX = 'r_';
3
3
  export const APP_REFERENCE_PREFIX = 'a_';
4
4
  export const SPACE_REFERENCE_PREFIX = 'sp_';
5
- export const REVISION_REFERENCE_PREFIX = 'fr_';
5
+ export const DOCUMENT_REFERENCE_PREFIX = 'd_';
6
+ export const ATTACHMENT_REFERENCE_PREFIX = 'at_';
7
+ export const REVISION_REFERENCE_PREFIX = 'v_';
6
8
  function referencePattern(prefix) {
7
9
  return new RegExp(`^${prefix}(${CROCKFORD_CHARACTER}+)\\.(${CROCKFORD_CHARACTER})$`);
8
10
  }
@@ -10,4 +12,9 @@ export const ROOM_REFERENCE_PATTERN = referencePattern(ROOM_REFERENCE_PREFIX);
10
12
  export const APP_REFERENCE_PATTERN = referencePattern(APP_REFERENCE_PREFIX);
11
13
  export const SPACE_REFERENCE_PATTERN = referencePattern(SPACE_REFERENCE_PREFIX);
12
14
  const ORDINAL = `${CROCKFORD_LEADING_CHARACTER}${CROCKFORD_CHARACTER}*`;
15
+ function entryPattern(prefix) {
16
+ return new RegExp(`^${prefix}(${ORDINAL})\\.(${CROCKFORD_CHARACTER})$`);
17
+ }
18
+ export const DOCUMENT_REFERENCE_PATTERN = entryPattern(DOCUMENT_REFERENCE_PREFIX);
19
+ export const ATTACHMENT_REFERENCE_PATTERN = entryPattern(ATTACHMENT_REFERENCE_PREFIX);
13
20
  export const REVISION_REFERENCE_PATTERN = new RegExp(`^${REVISION_REFERENCE_PREFIX}(${ORDINAL})\\.(${ORDINAL})\\.(${CROCKFORD_CHARACTER})$`);
package/dist/index.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
2
- export type { Actor, DocumentEvent, DocumentFacts, Fact, ItemFacts, MessageFacts, Resolved, WriteDoor, } from './event.js';
3
- export { byCodePoint, compared, dated, fitsKind, instant, instantKey, kindOf, kindWords, } from './kinds.js';
2
+ export type { Actor, DocumentEvent, DocumentFacts, Fact, MessageFacts, RecordFacts, Resolved, WriteDoor, } from './event.js';
3
+ export { byCodePoint, compared, dated, fieldKey, fitsKind, indexKey, instant, instantKey, kindOf, kindWords, } from './kinds.js';
4
4
  export type { Kind, Ordering } from './kinds.js';
5
+ export { folderType } from './folders.js';
5
6
  export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
6
7
  export type { Clause, Continuation, Direction, DocumentQuery, DocumentShape, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, GroupShape, HeldRooms, Key, KeyPlan, LocalQuery, OrderOptions, Place, Predicate, QueryErrorCode, QueryPlan, Related, RoomFacts, Scope, Select, Test, Value, Where, } from './query/language.js';
8
+ export { countOf, countShape, hopTargets, pageOrder, walkedValue, walkOf } from './query/walk.js';
9
+ export type { Count, HopTarget, KeyBound, KeyRange, PageOrder, Walk, WalkedFacts, WalkRun, } from './query/walk.js';
10
+ export { verifyIndexBounds } from './indexed.js';
11
+ export type { IndexBounds } from './indexed.js';
7
12
  export { heldAt, matches } from './query/match.js';
8
13
  export type { Candidate } from './query/match.js';
9
14
  export { heldKind, indexed } from './query/rows.js';
@@ -12,32 +17,33 @@ export * as sql from './query/sql.js';
12
17
  export { headingLines } from './markdown.js';
13
18
  export type { HeadingLine } from './markdown.js';
14
19
  export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
20
+ export { agoWords, recentWords, shownDay, shownMoment } from './moment.js';
21
+ export type { MomentReader } from './moment.js';
15
22
  export { labelAt, NAME_FIELD } from './body.js';
16
23
  export type { Naming } from './body.js';
17
- export { divide } from './divide.js';
18
- export { apply, bodyLinks, create, links, parse, parseFrontmatter, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
24
+ export { apply, bodyLinks, create, links, linkSpans, parse, partText, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
19
25
  export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
26
+ export { notReadyWaitMs } from './not-ready.js';
20
27
  export type { ReferenceTarget, SavedFacts } from './facts.js';
21
28
  export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './house-references/crockford.js';
22
- export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
29
+ export { HOUSE_FIELDS, MEMBER_FIELD, SITE_FIELD, SUBMITTED_FIELD, TYPE_FIELD } from './fields.js';
23
30
  export { HOUSE_MODEL, HOUSE_ROOM_TYPES } from './built-in.js';
24
- export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS } from './house-model.js';
25
- export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
31
+ export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS, RECORD_TYPE, } from './house-model.js';
32
+ export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ATTACHMENT_REFERENCE_PATTERN, ATTACHMENT_REFERENCE_PREFIX, DOCUMENT_REFERENCE_PATTERN, DOCUMENT_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
26
33
  export type { HouseDocumentFields, HouseModelType } from './house-model.js';
27
- export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES } from './room-types.js';
34
+ export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES, VIEW_TYPE, } from './room-types.js';
28
35
  export type { InboxChannelKind } from './room-types.js';
29
- export { linkedPath, relative, retarget, roomPath, roomTarget, target } from './paths.js';
36
+ export { destinationText, keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, urlDestination, } from './paths.js';
30
37
  export { openPatternBudget } from './pattern.js';
31
38
  export type { LinkedPath, RoomTarget } from './paths.js';
32
- export { project } from './project.js';
33
39
  export { references } from './references.js';
34
- export { CAPTURE_HOME, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
40
+ export { foldedName, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
35
41
  export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
36
42
  export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, Shape, Transition, ValueFacts, } from './definition.js';
37
- export type { ApplyResult, BodyResult, Change, DefinitionOf, Division, DivisionContext, Document, DocumentCheck, Extent, Frontmatter, FrontmatterResult, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
38
- export { assess, assessReferences, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
43
+ export type { ApplyResult, BodyResult, Change, DefinitionOf, Document, DocumentCheck, Extent, Library, ModelVerification, Link, ParseResult, Reached, Reference, Refusal, RoleNeed, RoomReference, Span, TypedPath, LinkSpan, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
44
+ export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readSchemaDocument, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, verifySchemaDocument, } from './validate.js';
39
45
  export type { Assessment, Verdicts } from './validate.js';
40
46
  export { VERSION } from './version.js';
41
- export { bodyAfterFrontmatter, equalValue, frontmatterValue, plain } from './yaml.js';
42
- export type { FrontmatterValue } from './yaml.js';
47
+ export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
48
+ export type { DocumentValue } from './yaml.js';
43
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,KAAK,EACL,aAAa,EACb,aAAa,EACb,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,MAAM,EACN,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,MAAM,EACN,QAAQ,E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E,KAAK,EAAE,MAAM,WAAW,CAAC;AACtF,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,KAAK,EACL,aAAa,EACb,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,UAAU,EACV,MAAM,EACN,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,KAAK,EACL,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,MAAM,EACN,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,GAAG,EACH,OAAO,EACP,UAAU,EACV,YAAY,EACZ,KAAK,EACL,SAAS,EACT,cAAc,EACd,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,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AE,aAAa,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACnF,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -1,27 +1,30 @@
1
1
  export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
2
- export { byCodePoint, compared, dated, fitsKind, instant, instantKey, kindOf, kindWords, } from './kinds.js';
2
+ export { byCodePoint, compared, dated, fieldKey, fitsKind, indexKey, instant, instantKey, kindOf, kindWords, } from './kinds.js';
3
+ export { folderType } from './folders.js';
3
4
  export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
5
+ export { countOf, countShape, hopTargets, pageOrder, walkedValue, walkOf } from './query/walk.js';
6
+ export { verifyIndexBounds } from './indexed.js';
4
7
  export { heldAt, matches } from './query/match.js';
5
8
  export { heldKind, indexed } from './query/rows.js';
6
9
  export * as sql from './query/sql.js';
7
10
  export { headingLines } from './markdown.js';
8
11
  export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
12
+ export { agoWords, recentWords, shownDay, shownMoment } from './moment.js';
9
13
  export { labelAt, NAME_FIELD } from './body.js';
10
- export { divide } from './divide.js';
11
- export { apply, bodyLinks, create, links, parse, parseFrontmatter, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
14
+ export { apply, bodyLinks, create, links, linkSpans, parse, partText, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
12
15
  export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
16
+ export { notReadyWaitMs } from './not-ready.js';
13
17
  export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './house-references/crockford.js';
14
- export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
18
+ export { HOUSE_FIELDS, MEMBER_FIELD, SITE_FIELD, SUBMITTED_FIELD, TYPE_FIELD } from './fields.js';
15
19
  export { HOUSE_MODEL, HOUSE_ROOM_TYPES } from './built-in.js';
16
- export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS } from './house-model.js';
17
- export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
18
- export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES } from './room-types.js';
19
- export { linkedPath, relative, retarget, roomPath, roomTarget, target } from './paths.js';
20
+ export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS, RECORD_TYPE, } from './house-model.js';
21
+ export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ATTACHMENT_REFERENCE_PATTERN, ATTACHMENT_REFERENCE_PREFIX, DOCUMENT_REFERENCE_PATTERN, DOCUMENT_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
22
+ export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES, VIEW_TYPE, } from './room-types.js';
23
+ export { destinationText, keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, urlDestination, } from './paths.js';
20
24
  export { openPatternBudget } from './pattern.js';
21
- export { project } from './project.js';
22
25
  export { references } from './references.js';
23
- export { CAPTURE_HOME, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
26
+ export { foldedName, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
24
27
  export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
25
- export { assess, assessReferences, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
28
+ export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readSchemaDocument, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, verifySchemaDocument, } from './validate.js';
26
29
  export { VERSION } from './version.js';
27
- export { bodyAfterFrontmatter, equalValue, frontmatterValue, plain } from './yaml.js';
30
+ export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
@@ -0,0 +1,10 @@
1
+ import { type Failure } from './definition.js';
2
+ import type { ModelVerification, VerifiedModel } from './types.js';
3
+ export type IndexBounds = {
4
+ readonly perType: number;
5
+ readonly longestText: number;
6
+ };
7
+ export declare function indexedFailure(model: VerifiedModel): Failure | undefined;
8
+ export declare function uniqueFailure(model: VerifiedModel): Failure | undefined;
9
+ export declare function verifyIndexBounds(model: VerifiedModel, bounds: IndexBounds): ModelVerification;
10
+ //# sourceMappingURL=indexed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexed.d.ts","sourceRoot":"","sources":["../src/indexed.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGnE,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AA+CrF,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,SAAS,CAQxE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,SAAS,CAOvE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,iBAAiB,CAW9F"}
@@ -0,0 +1,63 @@
1
+ import { admitted, conjoined, escapePointer, refuse, UNIONS, } from './definition.js';
2
+ import { HOUSE_FIELDS } from './fields.js';
3
+ import { kindOf } from './kinds.js';
4
+ import { isRecord } from './yaml.js';
5
+ const PLAIN = ['string', 'number', 'boolean'];
6
+ const UNBOUNDED_KINDS = ['enum', 'date', 'date-time', 'time'];
7
+ function declarations(definition, field) {
8
+ const { schema, defs } = definition.shape;
9
+ return conjoined([{ node: schema, at: '' }], defs, new Set()).held.flatMap(({ node }) => isRecord(node.properties) && Object.hasOwn(node.properties, field)
10
+ ? [node.properties[field]]
11
+ : []);
12
+ }
13
+ function indexable(definition, field) {
14
+ if (HOUSE_FIELDS.includes(field) || !Object.hasOwn(definition.fields, field))
15
+ return null;
16
+ const facts = definition.fields[field];
17
+ if (facts.markdown === true || facts.reference !== undefined)
18
+ return null;
19
+ const declared = declarations(definition, field);
20
+ const { defs } = definition.shape;
21
+ const held = conjoined(declared.map((node) => ({ node, at: '' })), defs, new Set()).held.map(({ node }) => node);
22
+ if (held.length === 0 ||
23
+ held.some((node) => UNIONS.some((keyword) => node[keyword] !== undefined)))
24
+ return null;
25
+ const types = admitted(declared, defs, new Set());
26
+ const plain = types === null ? [] : [...types].filter((type) => type !== 'null');
27
+ if (plain.length !== 1 || !PLAIN.includes(plain[0]))
28
+ return null;
29
+ if (plain[0] !== 'string' || UNBOUNDED_KINDS.includes(kindOf(facts) ?? ''))
30
+ return { text: null };
31
+ const lengths = held.flatMap((node) => typeof node.maxLength === 'number' ? [node.maxLength] : []);
32
+ return lengths.length === 0 ? null : { text: Math.min(...lengths) };
33
+ }
34
+ function at(name, index) {
35
+ return `/${escapePointer(name)}/indexed/${index}`;
36
+ }
37
+ export function indexedFailure(model) {
38
+ for (const [name, definition] of Object.entries(model.types)) {
39
+ const index = (definition.indexed ?? []).findIndex((field) => indexable(definition, field) === null);
40
+ if (index !== -1)
41
+ return refuse('indexed', at(name, index));
42
+ }
43
+ return undefined;
44
+ }
45
+ export function uniqueFailure(model) {
46
+ for (const [name, definition] of Object.entries(model.types)) {
47
+ const [field] = definition.unique ?? [];
48
+ if (field !== undefined)
49
+ return refuse('unique', `/${escapePointer(name)}/properties/${escapePointer(field)}/unique`);
50
+ }
51
+ return undefined;
52
+ }
53
+ export function verifyIndexBounds(model, bounds) {
54
+ for (const [name, definition] of Object.entries(model.types)) {
55
+ const indexed = definition.indexed ?? [];
56
+ if (indexed.length > bounds.perType)
57
+ return { verdict: 'refuse', rule: 'indexed', location: at(name, bounds.perType) };
58
+ const index = indexed.findIndex((field) => (indexable(definition, field)?.text ?? 0) > bounds.longestText);
59
+ if (index !== -1)
60
+ return { verdict: 'refuse', rule: 'indexed', location: at(name, index) };
61
+ }
62
+ return { verdict: 'accept', model };
63
+ }
package/dist/kinds.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ValueFacts } from './definition.js';
1
+ import type { Definition, ValueFacts } from './definition.js';
2
2
  export type Kind = 'string' | 'number' | 'integer' | 'boolean' | 'date' | 'date-time' | 'time' | 'enum' | 'reference';
3
3
  export type Ordering = {
4
4
  readonly direction: 'asc' | 'desc';
@@ -13,6 +13,14 @@ export declare function kindWords(facts: ValueFacts | undefined): readonly strin
13
13
  export declare function dated(value: unknown): value is string;
14
14
  export declare function instant(value: unknown): bigint | undefined;
15
15
  export declare function instantKey(value: unknown): string | null;
16
+ export declare function instantOf(facts: ValueFacts | undefined, value: unknown): string | null;
17
+ export declare function indexKey(facts: ValueFacts, value: unknown): Uint8Array;
18
+ export declare function fieldKey(definition: Pick<Definition, 'fields' | 'unique'>, fields: Readonly<Record<string, unknown>>, field: string): {
19
+ readonly value: unknown;
20
+ readonly key: string;
21
+ readonly unique: boolean;
22
+ };
23
+ export declare function sortedKey(value: unknown): Uint8Array | null;
16
24
  export declare function byCodePoint(left: string, right: string): number;
17
25
  export declare function compared(left: unknown, right: unknown, ordering: Ordering): number;
18
26
  //# sourceMappingURL=kinds.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,MAAM,IAAI,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,MAAM,GACN,WAAW,GACX,MAAM,GACN,MAAM,GACN,WAAW,CAAC;AAEhB,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;CAC1D,CAAC;AASF,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAWrD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAW/E;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,MAAM,EAAE,CAe1E;AAED,wBAAgB,KAAK,C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