@superbee/core 0.2.0-pre.3 → 0.2.0-pre.31

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 (538) hide show
  1. package/README.md +1084 -0
  2. package/dist/artifact-contract.d.ts +90 -0
  3. package/dist/artifact-contract.d.ts.map +1 -0
  4. package/dist/artifact-contract.js +205 -0
  5. package/dist/artifact-contract.js.map +1 -0
  6. package/dist/backend.d.ts +19 -1
  7. package/dist/backend.d.ts.map +1 -1
  8. package/dist/backend.js +83 -36
  9. package/dist/backend.js.map +1 -1
  10. package/dist/blob-contract.d.ts +80 -0
  11. package/dist/blob-contract.d.ts.map +1 -0
  12. package/dist/blob-contract.js +131 -0
  13. package/dist/blob-contract.js.map +1 -0
  14. package/dist/blob-journal.d.ts +302 -0
  15. package/dist/blob-journal.d.ts.map +1 -0
  16. package/dist/blob-journal.js +540 -0
  17. package/dist/blob-journal.js.map +1 -0
  18. package/dist/body-replace-guards.d.ts +52 -0
  19. package/dist/body-replace-guards.d.ts.map +1 -0
  20. package/dist/body-replace-guards.js +176 -0
  21. package/dist/body-replace-guards.js.map +1 -0
  22. package/dist/builtin-recipes/content.d.ts +93 -0
  23. package/dist/builtin-recipes/content.d.ts.map +1 -0
  24. package/dist/builtin-recipes/content.js +288 -0
  25. package/dist/builtin-recipes/content.js.map +1 -0
  26. package/dist/builtin-recipes.d.ts +10 -0
  27. package/dist/builtin-recipes.d.ts.map +1 -0
  28. package/dist/builtin-recipes.js +97 -0
  29. package/dist/builtin-recipes.js.map +1 -0
  30. package/dist/bundle-health/index.d.ts +14 -0
  31. package/dist/bundle-health/index.d.ts.map +1 -0
  32. package/dist/bundle-health/index.js +12 -0
  33. package/dist/bundle-health/index.js.map +1 -0
  34. package/dist/bundle-health/kind-findings.d.ts +44 -0
  35. package/dist/bundle-health/kind-findings.d.ts.map +1 -0
  36. package/dist/bundle-health/kind-findings.js +68 -0
  37. package/dist/bundle-health/kind-findings.js.map +1 -0
  38. package/dist/bundle-health/legacy-page.d.ts +39 -0
  39. package/dist/bundle-health/legacy-page.d.ts.map +1 -0
  40. package/dist/bundle-health/legacy-page.js +50 -0
  41. package/dist/bundle-health/legacy-page.js.map +1 -0
  42. package/dist/bundle-health/report.d.ts +202 -0
  43. package/dist/bundle-health/report.d.ts.map +1 -0
  44. package/dist/bundle-health/report.js +438 -0
  45. package/dist/bundle-health/report.js.map +1 -0
  46. package/dist/bundle-ops.d.ts +1 -1
  47. package/dist/bundle-ops.d.ts.map +1 -1
  48. package/dist/bundle-ops.js +2 -2
  49. package/dist/bundle-ops.js.map +1 -1
  50. package/dist/bundle.d.ts +2 -1
  51. package/dist/bundle.d.ts.map +1 -1
  52. package/dist/bundle.js +3 -3
  53. package/dist/bundle.js.map +1 -1
  54. package/dist/code-point-order.d.ts +8 -0
  55. package/dist/code-point-order.d.ts.map +1 -0
  56. package/dist/code-point-order.js +20 -0
  57. package/dist/code-point-order.js.map +1 -0
  58. package/dist/connector-request.d.ts +87 -0
  59. package/dist/connector-request.d.ts.map +1 -0
  60. package/dist/connector-request.js +370 -0
  61. package/dist/connector-request.js.map +1 -0
  62. package/dist/connectors.d.ts +262 -0
  63. package/dist/connectors.d.ts.map +1 -0
  64. package/dist/connectors.js +1179 -0
  65. package/dist/connectors.js.map +1 -0
  66. package/dist/cross-bundle.d.ts +135 -0
  67. package/dist/cross-bundle.d.ts.map +1 -0
  68. package/dist/cross-bundle.js +186 -0
  69. package/dist/cross-bundle.js.map +1 -0
  70. package/dist/dependencies.d.ts +94 -0
  71. package/dist/dependencies.d.ts.map +1 -0
  72. package/dist/dependencies.js +180 -0
  73. package/dist/dependencies.js.map +1 -0
  74. package/dist/document-codec.d.ts +5 -1
  75. package/dist/document-codec.d.ts.map +1 -1
  76. package/dist/document-codec.js +7 -4
  77. package/dist/document-codec.js.map +1 -1
  78. package/dist/document-field-actions.d.ts +31 -1
  79. package/dist/document-field-actions.d.ts.map +1 -1
  80. package/dist/document-field-actions.js +137 -34
  81. package/dist/document-field-actions.js.map +1 -1
  82. package/dist/document-mutation.d.ts +22 -10
  83. package/dist/document-mutation.d.ts.map +1 -1
  84. package/dist/document-mutation.js +61 -27
  85. package/dist/document-mutation.js.map +1 -1
  86. package/dist/document-write-policy.d.ts.map +1 -1
  87. package/dist/document-write-policy.js +4 -2
  88. package/dist/document-write-policy.js.map +1 -1
  89. package/dist/domain-model.d.ts +73 -0
  90. package/dist/domain-model.d.ts.map +1 -0
  91. package/dist/domain-model.js +169 -0
  92. package/dist/domain-model.js.map +1 -0
  93. package/dist/engine.d.ts +16 -8
  94. package/dist/engine.d.ts.map +1 -1
  95. package/dist/engine.js +42 -4
  96. package/dist/engine.js.map +1 -1
  97. package/dist/file-journaled-backend-internal.d.ts +21 -0
  98. package/dist/file-journaled-backend-internal.d.ts.map +1 -0
  99. package/dist/file-journaled-backend-internal.js +12 -0
  100. package/dist/file-journaled-backend-internal.js.map +1 -0
  101. package/dist/file-journaled-backend.d.ts +160 -0
  102. package/dist/file-journaled-backend.d.ts.map +1 -0
  103. package/dist/file-journaled-backend.js +1345 -0
  104. package/dist/file-journaled-backend.js.map +1 -0
  105. package/dist/filesystem-host.d.ts +15 -0
  106. package/dist/filesystem-host.d.ts.map +1 -0
  107. package/dist/filesystem-host.js +20 -0
  108. package/dist/filesystem-host.js.map +1 -0
  109. package/dist/filesystem-identity.d.ts +86 -4
  110. package/dist/filesystem-identity.d.ts.map +1 -1
  111. package/dist/filesystem-identity.js +338 -102
  112. package/dist/filesystem-identity.js.map +1 -1
  113. package/dist/filesystem-lock.d.ts +16 -3
  114. package/dist/filesystem-lock.d.ts.map +1 -1
  115. package/dist/filesystem-lock.js +323 -77
  116. package/dist/filesystem-lock.js.map +1 -1
  117. package/dist/filesystem-push-role.d.ts +77 -0
  118. package/dist/filesystem-push-role.d.ts.map +1 -0
  119. package/dist/filesystem-push-role.js +165 -0
  120. package/dist/filesystem-push-role.js.map +1 -0
  121. package/dist/filesystem.d.ts +17 -0
  122. package/dist/filesystem.d.ts.map +1 -0
  123. package/dist/filesystem.js +18 -0
  124. package/dist/filesystem.js.map +1 -0
  125. package/dist/governed-body-write.d.ts +106 -0
  126. package/dist/governed-body-write.d.ts.map +1 -0
  127. package/dist/governed-body-write.js +251 -0
  128. package/dist/governed-body-write.js.map +1 -0
  129. package/dist/host-policy-snapshot.d.ts +9 -0
  130. package/dist/host-policy-snapshot.d.ts.map +1 -0
  131. package/dist/host-policy-snapshot.js +33 -0
  132. package/dist/host-policy-snapshot.js.map +1 -0
  133. package/dist/host-text.d.ts +31 -0
  134. package/dist/host-text.d.ts.map +1 -0
  135. package/dist/host-text.js +77 -0
  136. package/dist/host-text.js.map +1 -0
  137. package/dist/hosted-client/binding.d.ts +7 -0
  138. package/dist/hosted-client/binding.d.ts.map +1 -0
  139. package/dist/hosted-client/binding.js +10 -0
  140. package/dist/hosted-client/binding.js.map +1 -0
  141. package/dist/hosted-client/blob-delivery.d.ts +67 -0
  142. package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
  143. package/dist/hosted-client/blob-delivery.js +169 -0
  144. package/dist/hosted-client/blob-delivery.js.map +1 -0
  145. package/dist/hosted-client/blob-write.d.ts +386 -0
  146. package/dist/hosted-client/blob-write.d.ts.map +1 -0
  147. package/dist/hosted-client/blob-write.js +770 -0
  148. package/dist/hosted-client/blob-write.js.map +1 -0
  149. package/dist/hosted-client/bundle-listing.d.ts +46 -0
  150. package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
  151. package/dist/hosted-client/bundle-listing.js +36 -0
  152. package/dist/hosted-client/bundle-listing.js.map +1 -0
  153. package/dist/hosted-client/client.d.ts +219 -0
  154. package/dist/hosted-client/client.d.ts.map +1 -0
  155. package/dist/hosted-client/client.js +309 -0
  156. package/dist/hosted-client/client.js.map +1 -0
  157. package/dist/hosted-client/directory.d.ts +46 -0
  158. package/dist/hosted-client/directory.d.ts.map +1 -0
  159. package/dist/hosted-client/directory.js +74 -0
  160. package/dist/hosted-client/directory.js.map +1 -0
  161. package/dist/hosted-client/errors.d.ts +26 -0
  162. package/dist/hosted-client/errors.d.ts.map +1 -0
  163. package/dist/hosted-client/errors.js +35 -0
  164. package/dist/hosted-client/errors.js.map +1 -0
  165. package/dist/hosted-client/inbox.d.ts +320 -0
  166. package/dist/hosted-client/inbox.d.ts.map +1 -0
  167. package/dist/hosted-client/inbox.js +379 -0
  168. package/dist/hosted-client/inbox.js.map +1 -0
  169. package/dist/hosted-client/index.d.ts +30 -0
  170. package/dist/hosted-client/index.d.ts.map +1 -0
  171. package/dist/hosted-client/index.js +32 -0
  172. package/dist/hosted-client/index.js.map +1 -0
  173. package/dist/hosted-client/journal.d.ts +103 -0
  174. package/dist/hosted-client/journal.d.ts.map +1 -0
  175. package/dist/hosted-client/journal.js +464 -0
  176. package/dist/hosted-client/journal.js.map +1 -0
  177. package/dist/hosted-client/node.d.ts +74 -0
  178. package/dist/hosted-client/node.d.ts.map +1 -0
  179. package/dist/hosted-client/node.js +219 -0
  180. package/dist/hosted-client/node.js.map +1 -0
  181. package/dist/hosted-client/reference.d.ts +12 -0
  182. package/dist/hosted-client/reference.d.ts.map +1 -0
  183. package/dist/hosted-client/reference.js +29 -0
  184. package/dist/hosted-client/reference.js.map +1 -0
  185. package/dist/hosted-client/write.d.ts +217 -0
  186. package/dist/hosted-client/write.d.ts.map +1 -0
  187. package/dist/hosted-client/write.js +418 -0
  188. package/dist/hosted-client/write.js.map +1 -0
  189. package/dist/hosted-transport/answer-rows.d.ts +243 -0
  190. package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
  191. package/dist/hosted-transport/answer-rows.js +454 -0
  192. package/dist/hosted-transport/answer-rows.js.map +1 -0
  193. package/dist/hosted-transport/blob-reads.d.ts +35 -0
  194. package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
  195. package/dist/hosted-transport/blob-reads.js +179 -0
  196. package/dist/hosted-transport/blob-reads.js.map +1 -0
  197. package/dist/hosted-transport/blob-write.d.ts +34 -0
  198. package/dist/hosted-transport/blob-write.d.ts.map +1 -0
  199. package/dist/hosted-transport/blob-write.js +115 -0
  200. package/dist/hosted-transport/blob-write.js.map +1 -0
  201. package/dist/hosted-transport/carrier.d.ts +151 -0
  202. package/dist/hosted-transport/carrier.d.ts.map +1 -0
  203. package/dist/hosted-transport/carrier.js +260 -0
  204. package/dist/hosted-transport/carrier.js.map +1 -0
  205. package/dist/hosted-transport/history-pages.d.ts +55 -0
  206. package/dist/hosted-transport/history-pages.d.ts.map +1 -0
  207. package/dist/hosted-transport/history-pages.js +69 -0
  208. package/dist/hosted-transport/history-pages.js.map +1 -0
  209. package/dist/hosted-transport/index.d.ts +18 -0
  210. package/dist/hosted-transport/index.d.ts.map +1 -0
  211. package/dist/hosted-transport/index.js +18 -0
  212. package/dist/hosted-transport/index.js.map +1 -0
  213. package/dist/hosted-transport/operations.d.ts +85 -0
  214. package/dist/hosted-transport/operations.d.ts.map +1 -0
  215. package/dist/hosted-transport/operations.js +128 -0
  216. package/dist/hosted-transport/operations.js.map +1 -0
  217. package/dist/hosted-transport/paged-reads.d.ts +87 -0
  218. package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
  219. package/dist/hosted-transport/paged-reads.js +238 -0
  220. package/dist/hosted-transport/paged-reads.js.map +1 -0
  221. package/dist/hosted-transport/read-adapter.d.ts +256 -0
  222. package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
  223. package/dist/hosted-transport/read-adapter.js +568 -0
  224. package/dist/hosted-transport/read-adapter.js.map +1 -0
  225. package/dist/hosted-transport/root-write.d.ts +114 -0
  226. package/dist/hosted-transport/root-write.d.ts.map +1 -0
  227. package/dist/hosted-transport/root-write.js +171 -0
  228. package/dist/hosted-transport/root-write.js.map +1 -0
  229. package/dist/hosted-transport/whole-document-transport.d.ts +204 -0
  230. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
  231. package/dist/hosted-transport/whole-document-transport.js +447 -0
  232. package/dist/hosted-transport/whole-document-transport.js.map +1 -0
  233. package/dist/index.d.ts +34 -10
  234. package/dist/index.d.ts.map +1 -1
  235. package/dist/index.js +26 -8
  236. package/dist/index.js.map +1 -1
  237. package/dist/indexeddb-backend.d.ts +28 -37
  238. package/dist/indexeddb-backend.d.ts.map +1 -1
  239. package/dist/indexeddb-backend.js +467 -113
  240. package/dist/indexeddb-backend.js.map +1 -1
  241. package/dist/journaled-backend.d.ts +232 -15
  242. package/dist/journaled-backend.d.ts.map +1 -1
  243. package/dist/journaled-backend.js +254 -55
  244. package/dist/journaled-backend.js.map +1 -1
  245. package/dist/kind-authoring.d.ts +170 -0
  246. package/dist/kind-authoring.d.ts.map +1 -0
  247. package/dist/kind-authoring.js +451 -0
  248. package/dist/kind-authoring.js.map +1 -0
  249. package/dist/kind-conformance-error.d.ts +15 -0
  250. package/dist/kind-conformance-error.d.ts.map +1 -0
  251. package/dist/kind-conformance-error.js +20 -0
  252. package/dist/kind-conformance-error.js.map +1 -0
  253. package/dist/kind-coverage.d.ts +99 -0
  254. package/dist/kind-coverage.d.ts.map +1 -0
  255. package/dist/kind-coverage.js +186 -0
  256. package/dist/kind-coverage.js.map +1 -0
  257. package/dist/kind-field-mutation.d.ts +4 -0
  258. package/dist/kind-field-mutation.d.ts.map +1 -1
  259. package/dist/kind-field-mutation.js +28 -3
  260. package/dist/kind-field-mutation.js.map +1 -1
  261. package/dist/kinds-load.js +4 -4
  262. package/dist/kinds-load.js.map +1 -1
  263. package/dist/kinds.d.ts +65 -2
  264. package/dist/kinds.d.ts.map +1 -1
  265. package/dist/kinds.js +341 -21
  266. package/dist/kinds.js.map +1 -1
  267. package/dist/link-types.d.ts +26 -0
  268. package/dist/link-types.d.ts.map +1 -0
  269. package/dist/link-types.js +57 -0
  270. package/dist/link-types.js.map +1 -0
  271. package/dist/links.d.ts +21 -3
  272. package/dist/links.d.ts.map +1 -1
  273. package/dist/links.js +213 -14
  274. package/dist/links.js.map +1 -1
  275. package/dist/managed-document-metadata.d.ts +2 -0
  276. package/dist/managed-document-metadata.d.ts.map +1 -0
  277. package/dist/managed-document-metadata.js +9 -0
  278. package/dist/managed-document-metadata.js.map +1 -0
  279. package/dist/memory-backend.d.ts.map +1 -1
  280. package/dist/memory-backend.js +6 -2
  281. package/dist/memory-backend.js.map +1 -1
  282. package/dist/paths.d.ts +16 -0
  283. package/dist/paths.d.ts.map +1 -1
  284. package/dist/paths.js +25 -0
  285. package/dist/paths.js.map +1 -1
  286. package/dist/platform.d.ts +13 -2
  287. package/dist/platform.d.ts.map +1 -1
  288. package/dist/platform.js +16 -0
  289. package/dist/platform.js.map +1 -1
  290. package/dist/portable-export.d.ts +119 -0
  291. package/dist/portable-export.d.ts.map +1 -0
  292. package/dist/portable-export.js +501 -0
  293. package/dist/portable-export.js.map +1 -0
  294. package/dist/publication-filesystem.d.ts +1 -1
  295. package/dist/publication-filesystem.d.ts.map +1 -1
  296. package/dist/publication-filesystem.js +1 -1
  297. package/dist/publication-filesystem.js.map +1 -1
  298. package/dist/qualified-links.d.ts +67 -0
  299. package/dist/qualified-links.d.ts.map +1 -0
  300. package/dist/qualified-links.js +117 -0
  301. package/dist/qualified-links.js.map +1 -0
  302. package/dist/query-filter.d.ts +16 -2
  303. package/dist/query-filter.d.ts.map +1 -1
  304. package/dist/query-filter.js +40 -1
  305. package/dist/query-filter.js.map +1 -1
  306. package/dist/query-order.d.ts +22 -0
  307. package/dist/query-order.d.ts.map +1 -0
  308. package/dist/query-order.js +42 -0
  309. package/dist/query-order.js.map +1 -0
  310. package/dist/recipe-lifecycle/errors.d.ts +96 -0
  311. package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
  312. package/dist/recipe-lifecycle/errors.js +122 -0
  313. package/dist/recipe-lifecycle/errors.js.map +1 -0
  314. package/dist/recipe-lifecycle/evolution.d.ts +112 -0
  315. package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
  316. package/dist/recipe-lifecycle/evolution.js +941 -0
  317. package/dist/recipe-lifecycle/evolution.js.map +1 -0
  318. package/dist/recipe-lifecycle/index.d.ts +30 -0
  319. package/dist/recipe-lifecycle/index.d.ts.map +1 -0
  320. package/dist/recipe-lifecycle/index.js +26 -0
  321. package/dist/recipe-lifecycle/index.js.map +1 -0
  322. package/dist/recipe-lifecycle/install.d.ts +155 -0
  323. package/dist/recipe-lifecycle/install.d.ts.map +1 -0
  324. package/dist/recipe-lifecycle/install.js +594 -0
  325. package/dist/recipe-lifecycle/install.js.map +1 -0
  326. package/dist/recipe-lifecycle/legacy-aliases.d.ts +16 -0
  327. package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
  328. package/dist/recipe-lifecycle/legacy-aliases.js +51 -0
  329. package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
  330. package/dist/recipe-lifecycle/stamp.d.ts +151 -0
  331. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
  332. package/dist/recipe-lifecycle/stamp.js +364 -0
  333. package/dist/recipe-lifecycle/stamp.js.map +1 -0
  334. package/dist/recipe-set-preflight.d.ts +139 -0
  335. package/dist/recipe-set-preflight.d.ts.map +1 -0
  336. package/dist/recipe-set-preflight.js +536 -0
  337. package/dist/recipe-set-preflight.js.map +1 -0
  338. package/dist/recipes.d.ts +29 -1
  339. package/dist/recipes.d.ts.map +1 -1
  340. package/dist/recipes.js +137 -1
  341. package/dist/recipes.js.map +1 -1
  342. package/dist/record-overlay/apply.d.ts +43 -0
  343. package/dist/record-overlay/apply.d.ts.map +1 -0
  344. package/dist/record-overlay/apply.js +527 -0
  345. package/dist/record-overlay/apply.js.map +1 -0
  346. package/dist/record-overlay/canonical.d.ts +22 -0
  347. package/dist/record-overlay/canonical.d.ts.map +1 -0
  348. package/dist/record-overlay/canonical.js +47 -0
  349. package/dist/record-overlay/canonical.js.map +1 -0
  350. package/dist/record-overlay/digest.d.ts +4 -0
  351. package/dist/record-overlay/digest.d.ts.map +1 -0
  352. package/dist/record-overlay/digest.js +11 -0
  353. package/dist/record-overlay/digest.js.map +1 -0
  354. package/dist/record-overlay/errors.d.ts +44 -0
  355. package/dist/record-overlay/errors.d.ts.map +1 -0
  356. package/dist/record-overlay/errors.js +55 -0
  357. package/dist/record-overlay/errors.js.map +1 -0
  358. package/dist/record-overlay/findings.d.ts +5 -0
  359. package/dist/record-overlay/findings.d.ts.map +1 -0
  360. package/dist/record-overlay/findings.js +83 -0
  361. package/dist/record-overlay/findings.js.map +1 -0
  362. package/dist/record-overlay/index.d.ts +23 -0
  363. package/dist/record-overlay/index.d.ts.map +1 -0
  364. package/dist/record-overlay/index.js +21 -0
  365. package/dist/record-overlay/index.js.map +1 -0
  366. package/dist/record-overlay/plan.d.ts +12 -0
  367. package/dist/record-overlay/plan.d.ts.map +1 -0
  368. package/dist/record-overlay/plan.js +285 -0
  369. package/dist/record-overlay/plan.js.map +1 -0
  370. package/dist/record-overlay/policy.d.ts +69 -0
  371. package/dist/record-overlay/policy.d.ts.map +1 -0
  372. package/dist/record-overlay/policy.js +228 -0
  373. package/dist/record-overlay/policy.js.map +1 -0
  374. package/dist/record-overlay/redact.d.ts +3 -0
  375. package/dist/record-overlay/redact.d.ts.map +1 -0
  376. package/dist/record-overlay/redact.js +27 -0
  377. package/dist/record-overlay/redact.js.map +1 -0
  378. package/dist/record-overlay/signal-kind.d.ts +30 -0
  379. package/dist/record-overlay/signal-kind.d.ts.map +1 -0
  380. package/dist/record-overlay/signal-kind.js +38 -0
  381. package/dist/record-overlay/signal-kind.js.map +1 -0
  382. package/dist/record-overlay/signal-text.d.ts +45 -0
  383. package/dist/record-overlay/signal-text.d.ts.map +1 -0
  384. package/dist/record-overlay/signal-text.js +116 -0
  385. package/dist/record-overlay/signal-text.js.map +1 -0
  386. package/dist/record-overlay/source-index.d.ts +19 -0
  387. package/dist/record-overlay/source-index.d.ts.map +1 -0
  388. package/dist/record-overlay/source-index.js +102 -0
  389. package/dist/record-overlay/source-index.js.map +1 -0
  390. package/dist/record-overlay/types.d.ts +291 -0
  391. package/dist/record-overlay/types.d.ts.map +1 -0
  392. package/dist/record-overlay/types.js +2 -0
  393. package/dist/record-overlay/types.js.map +1 -0
  394. package/dist/remote-backend.d.ts +67 -67
  395. package/dist/remote-backend.d.ts.map +1 -1
  396. package/dist/remote-backend.js +168 -201
  397. package/dist/remote-backend.js.map +1 -1
  398. package/dist/remote-document-codec.d.ts +2 -1
  399. package/dist/remote-document-codec.d.ts.map +1 -1
  400. package/dist/remote-document-codec.js +3 -2
  401. package/dist/remote-document-codec.js.map +1 -1
  402. package/dist/remote-error.d.ts +38 -0
  403. package/dist/remote-error.d.ts.map +1 -0
  404. package/dist/remote-error.js +59 -0
  405. package/dist/remote-error.js.map +1 -0
  406. package/dist/remote-operations.d.ts +0 -40
  407. package/dist/remote-operations.d.ts.map +1 -1
  408. package/dist/remote-operations.js +26 -6
  409. package/dist/remote-operations.js.map +1 -1
  410. package/dist/remote-parsers.d.ts +86 -0
  411. package/dist/remote-parsers.d.ts.map +1 -0
  412. package/dist/remote-parsers.js +181 -0
  413. package/dist/remote-parsers.js.map +1 -0
  414. package/dist/remote.d.ts +5 -2
  415. package/dist/remote.d.ts.map +1 -1
  416. package/dist/remote.js +5 -1
  417. package/dist/remote.js.map +1 -1
  418. package/dist/search/backend-source.d.ts +6 -0
  419. package/dist/search/backend-source.d.ts.map +1 -0
  420. package/dist/search/backend-source.js +33 -0
  421. package/dist/search/backend-source.js.map +1 -0
  422. package/dist/search/contract.d.ts +151 -0
  423. package/dist/search/contract.d.ts.map +1 -0
  424. package/dist/search/contract.js +78 -0
  425. package/dist/search/contract.js.map +1 -0
  426. package/dist/search/errors.d.ts +30 -0
  427. package/dist/search/errors.d.ts.map +1 -0
  428. package/dist/search/errors.js +50 -0
  429. package/dist/search/errors.js.map +1 -0
  430. package/dist/search/identity.d.ts +12 -0
  431. package/dist/search/identity.d.ts.map +1 -0
  432. package/dist/search/identity.js +90 -0
  433. package/dist/search/identity.js.map +1 -0
  434. package/dist/search/index.d.ts +16 -0
  435. package/dist/search/index.d.ts.map +1 -0
  436. package/dist/search/index.js +15 -0
  437. package/dist/search/index.js.map +1 -0
  438. package/dist/search/memory-source.d.ts +36 -0
  439. package/dist/search/memory-source.d.ts.map +1 -0
  440. package/dist/search/memory-source.js +235 -0
  441. package/dist/search/memory-source.js.map +1 -0
  442. package/dist/search/rank.d.ts +34 -0
  443. package/dist/search/rank.d.ts.map +1 -0
  444. package/dist/search/rank.js +129 -0
  445. package/dist/search/rank.js.map +1 -0
  446. package/dist/search/row-text.d.ts +38 -0
  447. package/dist/search/row-text.d.ts.map +1 -0
  448. package/dist/search/row-text.js +88 -0
  449. package/dist/search/row-text.js.map +1 -0
  450. package/dist/search/search.d.ts +28 -0
  451. package/dist/search/search.d.ts.map +1 -0
  452. package/dist/search/search.js +257 -0
  453. package/dist/search/search.js.map +1 -0
  454. package/dist/search/source.d.ts +67 -0
  455. package/dist/search/source.d.ts.map +1 -0
  456. package/dist/search/source.js +2 -0
  457. package/dist/search/source.js.map +1 -0
  458. package/dist/search/text.d.ts +47 -0
  459. package/dist/search/text.d.ts.map +1 -0
  460. package/dist/search/text.js +150 -0
  461. package/dist/search/text.js.map +1 -0
  462. package/dist/site-capabilities.d.ts +345 -0
  463. package/dist/site-capabilities.d.ts.map +1 -0
  464. package/dist/site-capabilities.js +724 -0
  465. package/dist/site-capabilities.js.map +1 -0
  466. package/dist/source-engine/guard.d.ts +78 -0
  467. package/dist/source-engine/guard.d.ts.map +1 -0
  468. package/dist/source-engine/guard.js +423 -0
  469. package/dist/source-engine/guard.js.map +1 -0
  470. package/dist/source-engine/index.d.ts +26 -0
  471. package/dist/source-engine/index.d.ts.map +1 -0
  472. package/dist/source-engine/index.js +21 -0
  473. package/dist/source-engine/index.js.map +1 -0
  474. package/dist/source-engine/machine-state.d.ts +74 -0
  475. package/dist/source-engine/machine-state.d.ts.map +1 -0
  476. package/dist/source-engine/machine-state.js +48 -0
  477. package/dist/source-engine/machine-state.js.map +1 -0
  478. package/dist/source-engine/observe.d.ts +18 -0
  479. package/dist/source-engine/observe.d.ts.map +1 -0
  480. package/dist/source-engine/observe.js +620 -0
  481. package/dist/source-engine/observe.js.map +1 -0
  482. package/dist/source-engine/overlay.d.ts +49 -0
  483. package/dist/source-engine/overlay.d.ts.map +1 -0
  484. package/dist/source-engine/overlay.js +114 -0
  485. package/dist/source-engine/overlay.js.map +1 -0
  486. package/dist/source-engine/robots.d.ts +53 -0
  487. package/dist/source-engine/robots.d.ts.map +1 -0
  488. package/dist/source-engine/robots.js +158 -0
  489. package/dist/source-engine/robots.js.map +1 -0
  490. package/dist/source-engine/types.d.ts +287 -0
  491. package/dist/source-engine/types.d.ts.map +1 -0
  492. package/dist/source-engine/types.js +2 -0
  493. package/dist/source-engine/types.js.map +1 -0
  494. package/dist/source-harness/conformance.d.ts +16 -0
  495. package/dist/source-harness/conformance.d.ts.map +1 -0
  496. package/dist/source-harness/conformance.js +266 -0
  497. package/dist/source-harness/conformance.js.map +1 -0
  498. package/dist/source-harness/fixture.d.ts +95 -0
  499. package/dist/source-harness/fixture.d.ts.map +1 -0
  500. package/dist/source-harness/fixture.js +273 -0
  501. package/dist/source-harness/fixture.js.map +1 -0
  502. package/dist/source-harness/index.d.ts +22 -0
  503. package/dist/source-harness/index.d.ts.map +1 -0
  504. package/dist/source-harness/index.js +19 -0
  505. package/dist/source-harness/index.js.map +1 -0
  506. package/dist/source-harness/peer.d.ts +74 -0
  507. package/dist/source-harness/peer.d.ts.map +1 -0
  508. package/dist/source-harness/peer.js +106 -0
  509. package/dist/source-harness/peer.js.map +1 -0
  510. package/dist/source-profiles/index.d.ts +31 -0
  511. package/dist/source-profiles/index.d.ts.map +1 -0
  512. package/dist/source-profiles/index.js +206 -0
  513. package/dist/source-profiles/index.js.map +1 -0
  514. package/dist/source-profiles/link-header.d.ts +6 -0
  515. package/dist/source-profiles/link-header.d.ts.map +1 -0
  516. package/dist/source-profiles/link-header.js +131 -0
  517. package/dist/source-profiles/link-header.js.map +1 -0
  518. package/dist/storage.d.ts +6 -2
  519. package/dist/storage.d.ts.map +1 -1
  520. package/dist/storage.js +4 -1
  521. package/dist/storage.js.map +1 -1
  522. package/dist/types.d.ts +38 -5
  523. package/dist/types.d.ts.map +1 -1
  524. package/dist/types.js +0 -10
  525. package/dist/types.js.map +1 -1
  526. package/dist/uncertain-write.d.ts +161 -19
  527. package/dist/uncertain-write.d.ts.map +1 -1
  528. package/dist/uncertain-write.js +90 -31
  529. package/dist/uncertain-write.js.map +1 -1
  530. package/dist/versioning.d.ts +9 -4
  531. package/dist/versioning.d.ts.map +1 -1
  532. package/dist/versioning.js +9 -4
  533. package/dist/versioning.js.map +1 -1
  534. package/dist/write-identity.d.ts +5 -0
  535. package/dist/write-identity.d.ts.map +1 -0
  536. package/dist/write-identity.js +9 -0
  537. package/dist/write-identity.js.map +1 -0
  538. package/package.json +107 -2
package/dist/kinds.js CHANGED
@@ -20,22 +20,58 @@
20
20
  * convention-doc (de)serialization) is dependency-free — this module carries ONLY that, and is
21
21
  * exported as the browser-safe `@superbee/core/kinds` subpath (the ui shell's bridge
22
22
  * `open` filter consumes `isTerminal` there; a browser bundler must never be dragged through the
23
- * engine's node built-ins for a pure predicate). The one backend-touching entry point,
24
- * `loadKinds`, lives in `kinds-load.ts` — same ONE registry, split only by dependency weight.
23
+ * engine's node built-ins for a pure predicate). The bundle read, `loadKinds`, lives in
24
+ * `kinds-load.ts`, which reads through `bundle-ops.ts` and is browser-safe too: the split is
25
+ * between pure parsing and the bundle read, over the same ONE registry.
25
26
  */
26
27
  import { isOkfLifecycleStatus, OKF_LIFECYCLE_STATUSES } from "./okf-lifecycle.js";
27
28
  import { isUsableTimestamp } from "./frontmatter.js";
29
+ import { parseIsoInstant } from "./verification.js";
28
30
  /** The bundle-relative prefix a kind convention doc MUST live under to be discovered. */
29
31
  export const CONVENTIONS_PREFIX = "conventions/";
32
+ /**
33
+ * True for an id `loadKinds` reads a convention from: under {@link CONVENTIONS_PREFIX} exactly as
34
+ * spelled (case-sensitive). A case variant is not a convention id; a host that fences folded ids
35
+ * refuses it rather than let it govern after a case-insensitive checkout.
36
+ */
37
+ export function isConventionId(id) {
38
+ return id.startsWith(CONVENTIONS_PREFIX);
39
+ }
30
40
  /** The OKF `type` value a kind convention doc itself carries. */
31
41
  export const CONVENTION_TYPE = "Convention";
42
+ /**
43
+ * The closed, domain-neutral value-type vocabulary a convention may declare in `fields.types`.
44
+ * Each type constrains a value's shape only; presence stays governed by `fields.required`.
45
+ * Domain composites (opening hours, money, addresses) belong to recipe tooling, not core.
46
+ */
47
+ export const KIND_FIELD_TYPES = [
48
+ "date",
49
+ "datetime",
50
+ "https-url",
51
+ "https-url-list",
52
+ "integer",
53
+ "number",
54
+ "boolean",
55
+ "slug",
56
+ "string-list",
57
+ "latitude",
58
+ "longitude",
59
+ ];
60
+ const KIND_FIELD_TYPE_SET = new Set(KIND_FIELD_TYPES);
61
+ /** True when `value` names a {@link KIND_FIELD_TYPES} member. */
62
+ export function isKindFieldType(value) {
63
+ return typeof value === "string" && KIND_FIELD_TYPE_SET.has(value);
64
+ }
32
65
  /**
33
66
  * Build the one authoritative Kind registry from already-selected convention documents.
34
67
  * Callers own discovery; this pure half owns parsing, warnings, and first-by-id duplicate
35
68
  * resolution so prospective registries cannot drift from {@link loadKinds} semantics.
36
69
  */
37
70
  export function buildKindRegistry(docs, initialWarnings = [], options = {}) {
38
- const kinds = new Map();
71
+ // Duplicate resolution walks conventions by id so a declared `order` can never steal a
72
+ // `governs` from the first-by-id declaration; the accepted set is then laid into the Map in
73
+ // reading order.
74
+ const accepted = new Map();
39
75
  const warnings = [...initialWarnings];
40
76
  for (const doc of [...docs].sort((a, b) => a.id.localeCompare(b.id))) {
41
77
  const parsed = parseConventionDoc(doc, options);
@@ -58,10 +94,10 @@ export function buildKindRegistry(docs, initialWarnings = [], options = {}) {
58
94
  severity: "warning",
59
95
  });
60
96
  }
61
- if (kinds.has(kind.governs)) {
97
+ if (accepted.has(kind.governs)) {
62
98
  warnings.push({
63
99
  code: "KIND_DUPLICATE_GOVERNS",
64
- message: `duplicate kind convention for '${kind.governs}': '${doc.id}' ignored, keeping the first-declared '${kinds.get(kind.governs).id}'.`,
100
+ message: `duplicate kind convention for '${kind.governs}': '${doc.id}' ignored, keeping the first-declared '${accepted.get(kind.governs).id}'.`,
65
101
  field: kind.governs,
66
102
  severity: "warning",
67
103
  });
@@ -75,10 +111,27 @@ export function buildKindRegistry(docs, initialWarnings = [], options = {}) {
75
111
  severity: "warning",
76
112
  });
77
113
  }
78
- kinds.set(kind.governs, kind);
114
+ accepted.set(kind.governs, kind);
79
115
  }
116
+ const kinds = new Map();
117
+ for (const kind of [...accepted.values()].sort(compareReadingOrder))
118
+ kinds.set(kind.governs, kind);
80
119
  return { kinds, warnings };
81
120
  }
121
+ /**
122
+ * The bundle's reading order over kinds: conventions with a declared `order` first, ascending,
123
+ * ties by id; then conventions without one, by id. A bundle that declares no `order` anywhere
124
+ * therefore iterates by id exactly as it did before the field existed.
125
+ */
126
+ export function compareReadingOrder(a, b) {
127
+ if (a.order !== undefined && b.order !== undefined && a.order !== b.order)
128
+ return a.order - b.order;
129
+ if (a.order !== undefined && b.order === undefined)
130
+ return -1;
131
+ if (a.order === undefined && b.order !== undefined)
132
+ return 1;
133
+ return a.id.localeCompare(b.id);
134
+ }
82
135
  /** Stable product-level name for a Kind's workflow progress field. */
83
136
  export const PROGRESS_STATUS_FIELD = "progress_status";
84
137
  /** Producer-qualified v0.2 storage coordinate for Superbee workflow progress. */
@@ -202,25 +255,48 @@ export function projectKindForAuthoring(okfVersion, kind) {
202
255
  : undefined,
203
256
  terminal: projectRecord(kind.fields.terminal),
204
257
  descriptions: projectRecord(kind.fields.descriptions),
258
+ ...(kind.fields.types ? { types: projectRecord(kind.fields.types) } : {}),
205
259
  },
206
260
  };
207
261
  }
262
+ /** Whether a Kind finding names a frontmatter coordinate rather than a body heading. */
263
+ export function isKindFieldValidationWarning(warning) {
264
+ return warning.code === "KIND_FIELD_MISSING"
265
+ || warning.code === "KIND_FIELD_VALUE"
266
+ || warning.code === "KIND_FIELD_ARITY"
267
+ || warning.code === "KIND_FIELD_TYPE";
268
+ }
269
+ /** The owning message grammar separates the field coordinate from Kind labels and value suffixes. */
270
+ function kindFieldWarningPrefix(code, kind, field) {
271
+ switch (code) {
272
+ case "KIND_FIELD_MISSING":
273
+ return `'${kind.governs}' requires a non-empty '${field}' field `;
274
+ case "KIND_FIELD_VALUE":
275
+ return `'${field}' value `;
276
+ case "KIND_FIELD_ARITY":
277
+ return `'${field}' is enum-restricted and takes exactly ONE value for '${kind.governs}'; `;
278
+ case "KIND_FIELD_TYPE":
279
+ return `'${field}' must be `;
280
+ }
281
+ }
208
282
  /** Project Kind-validation findings into the same authoring vocabulary as the Kind schema. */
209
283
  export function projectKindValidationWarnings(okfVersion, kind, warnings) {
210
284
  const progress = progressStatusCoordinate(okfVersion, kind);
211
285
  if (!progress)
212
286
  return warnings;
213
- const stored = `'${progress.storageField}'`;
214
- const logical = `'${progress.logicalField}'`;
215
- return warnings.map((warning) => warning.field === progress.storageField
216
- ? {
287
+ return warnings.map((warning) => {
288
+ if (!isKindFieldValidationWarning(warning) || warning.field !== progress.storageField)
289
+ return warning;
290
+ const storedPrefix = kindFieldWarningPrefix(warning.code, kind, progress.storageField);
291
+ const logicalPrefix = kindFieldWarningPrefix(warning.code, kind, progress.logicalField);
292
+ return {
217
293
  ...warning,
218
294
  field: progress.logicalField,
219
- // Core's Kind warnings name the field first. Replace that one coordinate only; a later
220
- // occurrence may be the user's literal value and must remain byte-truthful.
221
- message: warning.message.replace(stored, logical),
222
- }
223
- : warning);
295
+ message: warning.message.startsWith(storedPrefix)
296
+ ? logicalPrefix + warning.message.slice(storedPrefix.length)
297
+ : warning.message,
298
+ };
299
+ });
224
300
  }
225
301
  /** True for a plain YAML/JSON map (excludes arrays, `null`, dates, and other object instances). */
226
302
  function isPlainObject(value) {
@@ -307,6 +383,7 @@ const VALID_FIELDS_KEYS = new Set([
307
383
  "value_descriptions",
308
384
  "terminal",
309
385
  "descriptions",
386
+ "types",
310
387
  ]);
311
388
  /**
312
389
  * Top-level convention-doc keys that are near-misses for the ONE correct enum-constraint shape
@@ -381,7 +458,7 @@ export function parseConventionDoc(doc, options = {}) {
381
458
  if (!VALID_FIELDS_KEYS.has(key)) {
382
459
  warnings.push({
383
460
  code: "KIND_CONVENTION_UNKNOWN_FIELDS_KEY",
384
- message: `kind convention '${doc.id}' declares an unrecognized key 'fields.${key}' (valid keys: fields.required, fields.optional, fields.values, fields.value_descriptions, fields.terminal, fields.descriptions); ignoring it.`,
461
+ message: `kind convention '${doc.id}' declares an unrecognized key 'fields.${key}' (valid keys: fields.required, fields.optional, fields.values, fields.value_descriptions, fields.terminal, fields.descriptions, fields.types); ignoring it.`,
385
462
  field: `fields.${key}`,
386
463
  severity: "warning",
387
464
  });
@@ -441,6 +518,60 @@ export function parseConventionDoc(doc, options = {}) {
441
518
  });
442
519
  }
443
520
  }
521
+ // `fields.types` — declared value types from the closed KIND_FIELD_TYPES vocabulary. Same lenient
522
+ // posture as `fields.values`: a non-map shape warns and is ignored, an unknown type or a typed
523
+ // field the kind does not declare warns and is skipped. A definitions-only recipe therefore
524
+ // refuses a misspelled type instead of installing a constraint that can never fire.
525
+ const typesSource = fieldsRaw.types;
526
+ const types = {};
527
+ if (typesSource !== undefined) {
528
+ if (!isPlainObject(typesSource)) {
529
+ warnings.push({
530
+ code: "KIND_CONVENTION_BAD_SHAPE",
531
+ message: `kind convention '${doc.id}' has a non-map 'fields.types' (${describeShape(typesSource)}; expected a map of field name -> type); ignoring it.`,
532
+ field: "fields.types",
533
+ severity: "warning",
534
+ });
535
+ }
536
+ else {
537
+ for (const [field, declared] of Object.entries(typesSource)) {
538
+ if (dropReserved(field, `fields.types.${field}`))
539
+ continue;
540
+ if (!isKindFieldType(declared)) {
541
+ warnings.push({
542
+ code: "KIND_CONVENTION_UNKNOWN_FIELD_TYPE",
543
+ message: `kind convention '${doc.id}' declares 'fields.types.${field}' as ${isScalar(declared) ? `'${String(declared)}'` : describeShape(declared)}, which is not a field type (valid types: ${KIND_FIELD_TYPES.join(", ")}); ignoring it.`,
544
+ field: `fields.types.${field}`,
545
+ severity: "warning",
546
+ });
547
+ continue;
548
+ }
549
+ if (!declaredFieldNames.has(field)) {
550
+ warnings.push({
551
+ code: "KIND_CONVENTION_UNDECLARED_TYPES_FIELD",
552
+ message: `kind convention '${doc.id}' declares 'fields.types.${field}' but '${field}' is not in fields.required or fields.optional; ignoring it.`,
553
+ field: `fields.types.${field}`,
554
+ severity: "warning",
555
+ });
556
+ continue;
557
+ }
558
+ setOwn(types, field, declared);
559
+ }
560
+ }
561
+ }
562
+ // An enum over URLs is never meaningful, so values on an `https-url-list` field are skipped. Every
563
+ // other typed field may carry `fields.values`: a scalar picks one, a `string-list` checks each item.
564
+ for (const field of Object.keys(values)) {
565
+ if (types[field] !== "https-url-list")
566
+ continue;
567
+ warnings.push({
568
+ code: "KIND_CONVENTION_VALUES_TYPE_MISMATCH",
569
+ message: `kind convention '${doc.id}' declares 'fields.values.${field}' on a field of type 'https-url-list', which cannot carry an enum; ignoring the values.`,
570
+ field: `fields.values.${field}`,
571
+ severity: "warning",
572
+ });
573
+ delete values[field];
574
+ }
444
575
  const valueDescriptionsSource = fieldsRaw.value_descriptions;
445
576
  const valueDescriptions = {};
446
577
  if (valueDescriptionsSource !== undefined) {
@@ -758,12 +889,30 @@ export function parseConventionDoc(doc, options = {}) {
758
889
  : undefined;
759
890
  // Strict boolean `true` only — an absent, false, or non-boolean value means "expanded" (the default).
760
891
  const browseCollapsed = fm.browse_collapsed === true ? true : undefined;
892
+ // `order:` is a finite number or nothing. Anything else warns and the kind registers without an
893
+ // order (it sorts with the undeclared), never a skipped convention.
894
+ let order;
895
+ if (fm.order !== undefined) {
896
+ if (typeof fm.order === "number" && Number.isFinite(fm.order)) {
897
+ order = fm.order;
898
+ }
899
+ else {
900
+ warnings.push({
901
+ code: "KIND_CONVENTION_BAD_SHAPE",
902
+ message: `kind convention '${doc.id}' has an invalid 'order' (${describeShape(fm.order)}; expected a finite number such as 10); ignoring it.`,
903
+ field: "order",
904
+ severity: "warning",
905
+ });
906
+ }
907
+ }
761
908
  const kind = {
762
909
  id: doc.id,
763
910
  title,
764
911
  governs,
765
912
  fields: { required, optional, values, valueDescriptions, terminal, descriptions },
766
913
  };
914
+ if (Object.keys(types).length > 0)
915
+ kind.fields.types = types;
767
916
  if (description !== undefined)
768
917
  kind.description = description;
769
918
  if (path !== undefined)
@@ -780,6 +929,8 @@ export function parseConventionDoc(doc, options = {}) {
780
929
  kind.freshnessHorizon = freshnessHorizon;
781
930
  if (browseCollapsed !== undefined)
782
931
  kind.browseCollapsed = browseCollapsed;
932
+ if (order !== undefined)
933
+ kind.order = order;
783
934
  if (claim !== undefined)
784
935
  kind.claim = claim;
785
936
  return {
@@ -826,9 +977,155 @@ export function isPresent(value) {
826
977
  return value.length > 0;
827
978
  return true;
828
979
  }
980
+ /** Human phrase for each field type, used in warnings and authoring help. */
981
+ export const KIND_FIELD_TYPE_DESCRIPTIONS = {
982
+ date: "a YYYY-MM-DD calendar date",
983
+ datetime: "an ISO-8601 date and time with an explicit UTC offset (Z or +/-HH:MM)",
984
+ "https-url": "an absolute https URL of at most 2048 characters, without credentials",
985
+ "https-url-list": "a list of distinct https URLs",
986
+ integer: "a safe integer",
987
+ number: "a finite number",
988
+ boolean: "true or false",
989
+ slug: "a lowercase slug (a-z, 0-9 and single hyphens) of at most 200 characters",
990
+ "string-list": "a list of distinct non-empty strings",
991
+ latitude: "a number from -90 to 90",
992
+ longitude: "a number from -180 to 180",
993
+ };
994
+ const DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
995
+ const SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
996
+ const SLUG_MAX_LENGTH = 200;
997
+ const HTTPS_URL_MAX_LENGTH = 2048;
998
+ const HTTPS_PREFIX_RE = /^https:\/\//i;
999
+ const CONTROL_CHARACTER_RE = /[\u0000-\u001F\u007F]/;
1000
+ function describeValue(value) {
1001
+ if (typeof value === "string")
1002
+ return `got the string ${JSON.stringify(value.length > 60 ? `${value.slice(0, 57)}...` : value)}`;
1003
+ if (typeof value === "number")
1004
+ return `got the number ${Object.is(value, -0) ? "-0" : String(value)}`;
1005
+ if (typeof value === "boolean")
1006
+ return `got boolean ${String(value)}`;
1007
+ return `got ${describeShape(value)}`;
1008
+ }
1009
+ function httpsUrlProblem(value) {
1010
+ if (typeof value !== "string" || value.length > HTTPS_URL_MAX_LENGTH || /\s/.test(value))
1011
+ return describeValue(value);
1012
+ // WHATWG strips control characters and repairs `https:x`, `https:/x` and `https:\\x` into a host,
1013
+ // so the authored text must already be an absolute `https://` URL with no control characters.
1014
+ if (!HTTPS_PREFIX_RE.test(value) || CONTROL_CHARACTER_RE.test(value))
1015
+ return describeValue(value);
1016
+ // The WHATWG parser is the authority for the rest, so scheme case is irrelevant (`HTTPS://` is https).
1017
+ let parsed;
1018
+ try {
1019
+ parsed = new URL(value);
1020
+ }
1021
+ catch {
1022
+ return describeValue(value);
1023
+ }
1024
+ if (parsed.protocol !== "https:" || parsed.hostname === "")
1025
+ return describeValue(value);
1026
+ if (parsed.username !== "" || parsed.password !== "")
1027
+ return `${describeValue(value)} (credentials are not allowed)`;
1028
+ return undefined;
1029
+ }
1030
+ function listProblem(value, itemProblem) {
1031
+ if (!Array.isArray(value))
1032
+ return describeValue(value);
1033
+ const seen = new Set();
1034
+ for (const [index, item] of value.entries()) {
1035
+ const problem = itemProblem(item);
1036
+ if (problem !== undefined)
1037
+ return `item ${index} ${problem}`;
1038
+ if (seen.has(item))
1039
+ return `item ${index} repeats ${JSON.stringify(item)}`;
1040
+ seen.add(item);
1041
+ }
1042
+ return undefined;
1043
+ }
1044
+ /**
1045
+ * Why `value` does not satisfy `type`, or `undefined` when it does. Values are judged as decoded:
1046
+ * YAML numbers and booleans, and strings exactly as authored (core's decoder keeps dates and
1047
+ * instants as their source strings). `null` never satisfies a type. The ONE type predicate;
1048
+ * callers never re-implement it.
1049
+ */
1050
+ export function kindFieldTypeProblem(type, value) {
1051
+ switch (type) {
1052
+ case "date": {
1053
+ const match = typeof value === "string" ? DATE_RE.exec(value) : null;
1054
+ if (!match)
1055
+ return describeValue(value);
1056
+ const probe = new Date(0);
1057
+ probe.setUTCFullYear(Number(match[1]), Number(match[2]), 0); // day 0 of the next month
1058
+ const month = Number(match[2]);
1059
+ const day = Number(match[3]);
1060
+ return month >= 1 && month <= 12 && day >= 1 && day <= probe.getUTCDate() ? undefined : describeValue(value);
1061
+ }
1062
+ case "datetime":
1063
+ // Exactly the OKF standard-timestamp instant grammar.
1064
+ return typeof value === "string" && parseIsoInstant(value) !== null ? undefined : describeValue(value);
1065
+ case "https-url":
1066
+ return httpsUrlProblem(value);
1067
+ case "https-url-list":
1068
+ return listProblem(value, httpsUrlProblem);
1069
+ case "integer":
1070
+ return Number.isSafeInteger(value) && !Object.is(value, -0) ? undefined : describeValue(value);
1071
+ case "number":
1072
+ return typeof value === "number" && Number.isFinite(value) ? undefined : describeValue(value);
1073
+ case "boolean":
1074
+ return typeof value === "boolean" ? undefined : describeValue(value);
1075
+ case "slug":
1076
+ return typeof value === "string" && value.length <= SLUG_MAX_LENGTH && SLUG_RE.test(value)
1077
+ ? undefined
1078
+ : describeValue(value);
1079
+ case "string-list":
1080
+ return listProblem(value, (item) => (typeof item === "string" && item !== "" ? undefined : describeValue(item)));
1081
+ case "latitude":
1082
+ case "longitude": {
1083
+ const limit = type === "latitude" ? 90 : 180;
1084
+ return typeof value === "number" && Number.isFinite(value) && value >= -limit && value <= limit
1085
+ ? undefined
1086
+ : describeValue(value);
1087
+ }
1088
+ }
1089
+ }
1090
+ /** Whether a Kind declares `field` (a storage name) as one of the two list types, `string-list` or `https-url-list`. */
1091
+ export function isKindListField(kind, field) {
1092
+ const types = kind?.fields.types;
1093
+ if (!types || !hasOwn(types, field))
1094
+ return false;
1095
+ return types[field] === "string-list" || types[field] === "https-url-list";
1096
+ }
1097
+ const NUMBER_INPUT_RE = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
1098
+ const INTEGER_INPUT_RE = /^[+-]?\d+$/;
1099
+ /**
1100
+ * Convert command-line flag text for a declared field into its typed value: numeric types become
1101
+ * numbers, `boolean` accepts exactly `true`/`false`, and both list types are always a list. Text that
1102
+ * does not parse is returned unchanged so {@link validateAgainstKind} reports it, never guessed.
1103
+ * Undeclared or untyped fields keep the historical one-value-scalar, repeated-flag-list shape.
1104
+ */
1105
+ export function kindFieldInputValue(kind, field, inputs) {
1106
+ const type = kind.fields.types && hasOwn(kind.fields.types, field) ? kind.fields.types[field] : undefined;
1107
+ if (type === "string-list" || type === "https-url-list")
1108
+ return [...inputs];
1109
+ if (inputs.length !== 1)
1110
+ return [...inputs];
1111
+ const text = inputs[0];
1112
+ switch (type) {
1113
+ case "number":
1114
+ case "latitude":
1115
+ case "longitude":
1116
+ return NUMBER_INPUT_RE.test(text.trim()) ? Number(text.trim()) : text;
1117
+ case "integer":
1118
+ return INTEGER_INPUT_RE.test(text.trim()) ? Number(text.trim()) : text;
1119
+ case "boolean":
1120
+ return text === "true" ? true : text === "false" ? false : text;
1121
+ default:
1122
+ return text;
1123
+ }
1124
+ }
829
1125
  /**
830
1126
  * Validate `doc` against `kind`: required fields present + non-empty, enum-restricted
831
- * field values within the declared allowed set, and declared body `sections` present
1127
+ * field values within the declared allowed set, typed field values of their declared
1128
+ * `fields.types` type, and declared body `sections` present
832
1129
  * (reusing the ONE heading splitter, {@link splitSections} — no second heading parser).
833
1130
  * Returns core's EXISTING {@link ValidationWarning} shape; never throws. Purely
834
1131
  * additive derivation — callers (the CLI) decide whether a warning blocks a write.
@@ -840,7 +1137,7 @@ export function validateAgainstKind(doc, kind) {
840
1137
  if (!hasOwn(fm, field) || !isPresent(fm[field])) {
841
1138
  warnings.push({
842
1139
  code: "KIND_FIELD_MISSING",
843
- message: `'${kind.governs}' requires a non-empty '${field}' field (declared by ${kind.id}).`,
1140
+ message: kindFieldWarningPrefix("KIND_FIELD_MISSING", kind, field) + `(declared by ${kind.id}).`,
844
1141
  field,
845
1142
  severity: "warning",
846
1143
  });
@@ -861,10 +1158,11 @@ export function validateAgainstKind(doc, kind) {
861
1158
  // validation locus, every consumer inherits: `new`, `doc update`, `doc write
862
1159
  // --strict`, `status`'s bundle lint). A future kind wanting a multi-select enum
863
1160
  // needs declared arity in the convention schema — not silently via arrays.
864
- if (Array.isArray(raw)) {
1161
+ // A `string-list` field declares its arity, so its enum checks each item instead.
1162
+ if (Array.isArray(raw) && kind.fields.types?.[field] !== "string-list") {
865
1163
  warnings.push({
866
1164
  code: "KIND_FIELD_ARITY",
867
- message: `'${field}' is enum-restricted and takes exactly ONE value for '${kind.governs}'; ` +
1165
+ message: kindFieldWarningPrefix("KIND_FIELD_ARITY", kind, field) +
868
1166
  `got ${raw.length} (${raw.map((v) => String(v)).join(", ")}).`,
869
1167
  field,
870
1168
  severity: "warning",
@@ -876,13 +1174,30 @@ export function validateAgainstKind(doc, kind) {
876
1174
  if (!allowedStrs.includes(v)) {
877
1175
  warnings.push({
878
1176
  code: "KIND_FIELD_VALUE",
879
- message: `'${field}' value '${v}' is not one of the allowed values for '${kind.governs}': ${allowedStrs.join(", ")}.`,
1177
+ message: kindFieldWarningPrefix("KIND_FIELD_VALUE", kind, field) + `'${v}' is not one of the allowed values for '${kind.governs}': ${allowedStrs.join(", ")}.`,
880
1178
  field,
881
1179
  severity: "warning",
882
1180
  });
883
1181
  }
884
1182
  }
885
1183
  }
1184
+ for (const [field, type] of Object.entries(kind.fields.types ?? {})) {
1185
+ if (!hasOwn(fm, field))
1186
+ continue;
1187
+ const raw = fm[field];
1188
+ // An absent field is presence, owned by `fields.required`; an explicit `null` is a wrong type.
1189
+ if (raw === undefined)
1190
+ continue;
1191
+ const problem = kindFieldTypeProblem(type, raw);
1192
+ if (problem !== undefined) {
1193
+ warnings.push({
1194
+ code: "KIND_FIELD_TYPE",
1195
+ message: kindFieldWarningPrefix("KIND_FIELD_TYPE", kind, field) + `${KIND_FIELD_TYPE_DESCRIPTIONS[type]} for '${kind.governs}'; ${problem}.`,
1196
+ field,
1197
+ severity: "warning",
1198
+ });
1199
+ }
1200
+ }
886
1201
  if (kind.sections && kind.sections.length > 0) {
887
1202
  const sections = splitSections(doc.body ?? "");
888
1203
  for (const heading of kind.sections) {
@@ -974,6 +1289,9 @@ export function kindConventionDoc(kind, prose, timestamp) {
974
1289
  .map(([field, description]) => [field, description.trim()]));
975
1290
  if (Object.keys(descriptions).length > 0)
976
1291
  fields.descriptions = descriptions;
1292
+ const types = Object.fromEntries(Object.entries(kind.fields.types ?? {}).filter(([, type]) => isKindFieldType(type)));
1293
+ if (Object.keys(types).length > 0)
1294
+ fields.types = types;
977
1295
  const frontmatter = { type: CONVENTION_TYPE, title: kind.title, governs: kind.governs, timestamp };
978
1296
  if (typeof kind.description === "string" && kind.description.trim() !== "") {
979
1297
  frontmatter.description = kind.description.trim();
@@ -1009,6 +1327,8 @@ export function kindConventionDoc(kind, prose, timestamp) {
1009
1327
  frontmatter.freshness_horizon = kind.freshnessHorizon;
1010
1328
  if (kind.browseCollapsed)
1011
1329
  frontmatter.browse_collapsed = true;
1330
+ if (typeof kind.order === "number" && Number.isFinite(kind.order))
1331
+ frontmatter.order = kind.order;
1012
1332
  return { id: kind.id, frontmatter, body: prose };
1013
1333
  }
1014
1334
  //# sourceMappingURL=kinds.js.map