@superbee/core 0.2.0-pre.4 → 0.2.0-pre.40

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