@superbee/core 0.2.0-pre.2 → 0.2.0-pre.21

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 (517) hide show
  1. package/README.md +1000 -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 +50 -0
  19. package/dist/body-replace-guards.d.ts.map +1 -0
  20. package/dist/body-replace-guards.js +158 -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/connectors.d.ts +230 -0
  59. package/dist/connectors.d.ts.map +1 -0
  60. package/dist/connectors.js +1150 -0
  61. package/dist/connectors.js.map +1 -0
  62. package/dist/cross-bundle.d.ts +135 -0
  63. package/dist/cross-bundle.d.ts.map +1 -0
  64. package/dist/cross-bundle.js +186 -0
  65. package/dist/cross-bundle.js.map +1 -0
  66. package/dist/dependencies.d.ts +94 -0
  67. package/dist/dependencies.d.ts.map +1 -0
  68. package/dist/dependencies.js +180 -0
  69. package/dist/dependencies.js.map +1 -0
  70. package/dist/document-codec.d.ts +6 -1
  71. package/dist/document-codec.d.ts.map +1 -1
  72. package/dist/document-codec.js +8 -4
  73. package/dist/document-codec.js.map +1 -1
  74. package/dist/document-field-actions.d.ts +31 -1
  75. package/dist/document-field-actions.d.ts.map +1 -1
  76. package/dist/document-field-actions.js +137 -34
  77. package/dist/document-field-actions.js.map +1 -1
  78. package/dist/document-mutation.d.ts +22 -10
  79. package/dist/document-mutation.d.ts.map +1 -1
  80. package/dist/document-mutation.js +58 -27
  81. package/dist/document-mutation.js.map +1 -1
  82. package/dist/document-write-policy.d.ts.map +1 -1
  83. package/dist/document-write-policy.js +4 -2
  84. package/dist/document-write-policy.js.map +1 -1
  85. package/dist/engine.d.ts +9 -2
  86. package/dist/engine.d.ts.map +1 -1
  87. package/dist/engine.js +11 -4
  88. package/dist/engine.js.map +1 -1
  89. package/dist/file-journaled-backend-internal.d.ts +21 -0
  90. package/dist/file-journaled-backend-internal.d.ts.map +1 -0
  91. package/dist/file-journaled-backend-internal.js +12 -0
  92. package/dist/file-journaled-backend-internal.js.map +1 -0
  93. package/dist/file-journaled-backend.d.ts +200 -0
  94. package/dist/file-journaled-backend.d.ts.map +1 -0
  95. package/dist/file-journaled-backend.js +1334 -0
  96. package/dist/file-journaled-backend.js.map +1 -0
  97. package/dist/filesystem-host.d.ts +15 -0
  98. package/dist/filesystem-host.d.ts.map +1 -0
  99. package/dist/filesystem-host.js +20 -0
  100. package/dist/filesystem-host.js.map +1 -0
  101. package/dist/filesystem-identity.d.ts +86 -4
  102. package/dist/filesystem-identity.d.ts.map +1 -1
  103. package/dist/filesystem-identity.js +338 -102
  104. package/dist/filesystem-identity.js.map +1 -1
  105. package/dist/filesystem-lock.d.ts +16 -3
  106. package/dist/filesystem-lock.d.ts.map +1 -1
  107. package/dist/filesystem-lock.js +323 -77
  108. package/dist/filesystem-lock.js.map +1 -1
  109. package/dist/filesystem-push-role.d.ts +77 -0
  110. package/dist/filesystem-push-role.d.ts.map +1 -0
  111. package/dist/filesystem-push-role.js +165 -0
  112. package/dist/filesystem-push-role.js.map +1 -0
  113. package/dist/filesystem.d.ts +17 -0
  114. package/dist/filesystem.d.ts.map +1 -0
  115. package/dist/filesystem.js +18 -0
  116. package/dist/filesystem.js.map +1 -0
  117. package/dist/frontmatter.d.ts +8 -0
  118. package/dist/frontmatter.d.ts.map +1 -1
  119. package/dist/frontmatter.js +14 -4
  120. package/dist/frontmatter.js.map +1 -1
  121. package/dist/governed-body-write.d.ts +106 -0
  122. package/dist/governed-body-write.d.ts.map +1 -0
  123. package/dist/governed-body-write.js +251 -0
  124. package/dist/governed-body-write.js.map +1 -0
  125. package/dist/host-policy-snapshot.d.ts +9 -0
  126. package/dist/host-policy-snapshot.d.ts.map +1 -0
  127. package/dist/host-policy-snapshot.js +33 -0
  128. package/dist/host-policy-snapshot.js.map +1 -0
  129. package/dist/host-text.d.ts +31 -0
  130. package/dist/host-text.d.ts.map +1 -0
  131. package/dist/host-text.js +77 -0
  132. package/dist/host-text.js.map +1 -0
  133. package/dist/hosted-client/binding.d.ts +7 -0
  134. package/dist/hosted-client/binding.d.ts.map +1 -0
  135. package/dist/hosted-client/binding.js +10 -0
  136. package/dist/hosted-client/binding.js.map +1 -0
  137. package/dist/hosted-client/blob-delivery.d.ts +67 -0
  138. package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
  139. package/dist/hosted-client/blob-delivery.js +169 -0
  140. package/dist/hosted-client/blob-delivery.js.map +1 -0
  141. package/dist/hosted-client/blob-write.d.ts +386 -0
  142. package/dist/hosted-client/blob-write.d.ts.map +1 -0
  143. package/dist/hosted-client/blob-write.js +770 -0
  144. package/dist/hosted-client/blob-write.js.map +1 -0
  145. package/dist/hosted-client/bundle-listing.d.ts +46 -0
  146. package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
  147. package/dist/hosted-client/bundle-listing.js +36 -0
  148. package/dist/hosted-client/bundle-listing.js.map +1 -0
  149. package/dist/hosted-client/client.d.ts +219 -0
  150. package/dist/hosted-client/client.d.ts.map +1 -0
  151. package/dist/hosted-client/client.js +309 -0
  152. package/dist/hosted-client/client.js.map +1 -0
  153. package/dist/hosted-client/directory.d.ts +46 -0
  154. package/dist/hosted-client/directory.d.ts.map +1 -0
  155. package/dist/hosted-client/directory.js +74 -0
  156. package/dist/hosted-client/directory.js.map +1 -0
  157. package/dist/hosted-client/errors.d.ts +26 -0
  158. package/dist/hosted-client/errors.d.ts.map +1 -0
  159. package/dist/hosted-client/errors.js +35 -0
  160. package/dist/hosted-client/errors.js.map +1 -0
  161. package/dist/hosted-client/inbox.d.ts +320 -0
  162. package/dist/hosted-client/inbox.d.ts.map +1 -0
  163. package/dist/hosted-client/inbox.js +379 -0
  164. package/dist/hosted-client/inbox.js.map +1 -0
  165. package/dist/hosted-client/index.d.ts +30 -0
  166. package/dist/hosted-client/index.d.ts.map +1 -0
  167. package/dist/hosted-client/index.js +32 -0
  168. package/dist/hosted-client/index.js.map +1 -0
  169. package/dist/hosted-client/journal.d.ts +103 -0
  170. package/dist/hosted-client/journal.d.ts.map +1 -0
  171. package/dist/hosted-client/journal.js +464 -0
  172. package/dist/hosted-client/journal.js.map +1 -0
  173. package/dist/hosted-client/node.d.ts +74 -0
  174. package/dist/hosted-client/node.d.ts.map +1 -0
  175. package/dist/hosted-client/node.js +219 -0
  176. package/dist/hosted-client/node.js.map +1 -0
  177. package/dist/hosted-client/reference.d.ts +12 -0
  178. package/dist/hosted-client/reference.d.ts.map +1 -0
  179. package/dist/hosted-client/reference.js +29 -0
  180. package/dist/hosted-client/reference.js.map +1 -0
  181. package/dist/hosted-client/write.d.ts +217 -0
  182. package/dist/hosted-client/write.d.ts.map +1 -0
  183. package/dist/hosted-client/write.js +418 -0
  184. package/dist/hosted-client/write.js.map +1 -0
  185. package/dist/hosted-transport/answer-rows.d.ts +243 -0
  186. package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
  187. package/dist/hosted-transport/answer-rows.js +454 -0
  188. package/dist/hosted-transport/answer-rows.js.map +1 -0
  189. package/dist/hosted-transport/blob-reads.d.ts +35 -0
  190. package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
  191. package/dist/hosted-transport/blob-reads.js +179 -0
  192. package/dist/hosted-transport/blob-reads.js.map +1 -0
  193. package/dist/hosted-transport/blob-write.d.ts +34 -0
  194. package/dist/hosted-transport/blob-write.d.ts.map +1 -0
  195. package/dist/hosted-transport/blob-write.js +115 -0
  196. package/dist/hosted-transport/blob-write.js.map +1 -0
  197. package/dist/hosted-transport/carrier.d.ts +151 -0
  198. package/dist/hosted-transport/carrier.d.ts.map +1 -0
  199. package/dist/hosted-transport/carrier.js +260 -0
  200. package/dist/hosted-transport/carrier.js.map +1 -0
  201. package/dist/hosted-transport/history-pages.d.ts +55 -0
  202. package/dist/hosted-transport/history-pages.d.ts.map +1 -0
  203. package/dist/hosted-transport/history-pages.js +69 -0
  204. package/dist/hosted-transport/history-pages.js.map +1 -0
  205. package/dist/hosted-transport/index.d.ts +18 -0
  206. package/dist/hosted-transport/index.d.ts.map +1 -0
  207. package/dist/hosted-transport/index.js +18 -0
  208. package/dist/hosted-transport/index.js.map +1 -0
  209. package/dist/hosted-transport/operations.d.ts +85 -0
  210. package/dist/hosted-transport/operations.d.ts.map +1 -0
  211. package/dist/hosted-transport/operations.js +128 -0
  212. package/dist/hosted-transport/operations.js.map +1 -0
  213. package/dist/hosted-transport/paged-reads.d.ts +87 -0
  214. package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
  215. package/dist/hosted-transport/paged-reads.js +238 -0
  216. package/dist/hosted-transport/paged-reads.js.map +1 -0
  217. package/dist/hosted-transport/read-adapter.d.ts +256 -0
  218. package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
  219. package/dist/hosted-transport/read-adapter.js +568 -0
  220. package/dist/hosted-transport/read-adapter.js.map +1 -0
  221. package/dist/hosted-transport/root-write.d.ts +114 -0
  222. package/dist/hosted-transport/root-write.d.ts.map +1 -0
  223. package/dist/hosted-transport/root-write.js +171 -0
  224. package/dist/hosted-transport/root-write.js.map +1 -0
  225. package/dist/hosted-transport/whole-document-transport.d.ts +204 -0
  226. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
  227. package/dist/hosted-transport/whole-document-transport.js +447 -0
  228. package/dist/hosted-transport/whole-document-transport.js.map +1 -0
  229. package/dist/index.d.ts +34 -10
  230. package/dist/index.d.ts.map +1 -1
  231. package/dist/index.js +26 -8
  232. package/dist/index.js.map +1 -1
  233. package/dist/indexeddb-backend.d.ts +28 -6
  234. package/dist/indexeddb-backend.d.ts.map +1 -1
  235. package/dist/indexeddb-backend.js +471 -92
  236. package/dist/indexeddb-backend.js.map +1 -1
  237. package/dist/journaled-backend.d.ts +247 -10
  238. package/dist/journaled-backend.d.ts.map +1 -1
  239. package/dist/journaled-backend.js +302 -1
  240. package/dist/journaled-backend.js.map +1 -1
  241. package/dist/kind-authoring.d.ts +170 -0
  242. package/dist/kind-authoring.d.ts.map +1 -0
  243. package/dist/kind-authoring.js +451 -0
  244. package/dist/kind-authoring.js.map +1 -0
  245. package/dist/kind-conformance-error.d.ts +15 -0
  246. package/dist/kind-conformance-error.d.ts.map +1 -0
  247. package/dist/kind-conformance-error.js +20 -0
  248. package/dist/kind-conformance-error.js.map +1 -0
  249. package/dist/kind-coverage.d.ts +99 -0
  250. package/dist/kind-coverage.d.ts.map +1 -0
  251. package/dist/kind-coverage.js +186 -0
  252. package/dist/kind-coverage.js.map +1 -0
  253. package/dist/kind-field-mutation.d.ts +4 -0
  254. package/dist/kind-field-mutation.d.ts.map +1 -1
  255. package/dist/kind-field-mutation.js +28 -3
  256. package/dist/kind-field-mutation.js.map +1 -1
  257. package/dist/kinds-load.js +4 -4
  258. package/dist/kinds-load.js.map +1 -1
  259. package/dist/kinds.d.ts +65 -2
  260. package/dist/kinds.d.ts.map +1 -1
  261. package/dist/kinds.js +341 -21
  262. package/dist/kinds.js.map +1 -1
  263. package/dist/link-types.d.ts +26 -0
  264. package/dist/link-types.d.ts.map +1 -0
  265. package/dist/link-types.js +57 -0
  266. package/dist/link-types.js.map +1 -0
  267. package/dist/links.d.ts +21 -3
  268. package/dist/links.d.ts.map +1 -1
  269. package/dist/links.js +213 -14
  270. package/dist/links.js.map +1 -1
  271. package/dist/managed-document-metadata.d.ts +2 -0
  272. package/dist/managed-document-metadata.d.ts.map +1 -0
  273. package/dist/managed-document-metadata.js +9 -0
  274. package/dist/managed-document-metadata.js.map +1 -0
  275. package/dist/memory-backend.d.ts +2 -2
  276. package/dist/memory-backend.d.ts.map +1 -1
  277. package/dist/memory-backend.js +26 -11
  278. package/dist/memory-backend.js.map +1 -1
  279. package/dist/paths.d.ts +16 -0
  280. package/dist/paths.d.ts.map +1 -1
  281. package/dist/paths.js +25 -0
  282. package/dist/paths.js.map +1 -1
  283. package/dist/platform.d.ts +13 -2
  284. package/dist/platform.d.ts.map +1 -1
  285. package/dist/platform.js +16 -0
  286. package/dist/platform.js.map +1 -1
  287. package/dist/portable-export.d.ts +119 -0
  288. package/dist/portable-export.d.ts.map +1 -0
  289. package/dist/portable-export.js +501 -0
  290. package/dist/portable-export.js.map +1 -0
  291. package/dist/publication-filesystem.d.ts +1 -1
  292. package/dist/publication-filesystem.d.ts.map +1 -1
  293. package/dist/publication-filesystem.js +1 -1
  294. package/dist/publication-filesystem.js.map +1 -1
  295. package/dist/qualified-links.d.ts +67 -0
  296. package/dist/qualified-links.d.ts.map +1 -0
  297. package/dist/qualified-links.js +117 -0
  298. package/dist/qualified-links.js.map +1 -0
  299. package/dist/query-filter.d.ts +16 -2
  300. package/dist/query-filter.d.ts.map +1 -1
  301. package/dist/query-filter.js +40 -1
  302. package/dist/query-filter.js.map +1 -1
  303. package/dist/query-order.d.ts +22 -0
  304. package/dist/query-order.d.ts.map +1 -0
  305. package/dist/query-order.js +42 -0
  306. package/dist/query-order.js.map +1 -0
  307. package/dist/recipe-lifecycle/errors.d.ts +96 -0
  308. package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
  309. package/dist/recipe-lifecycle/errors.js +122 -0
  310. package/dist/recipe-lifecycle/errors.js.map +1 -0
  311. package/dist/recipe-lifecycle/evolution.d.ts +108 -0
  312. package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
  313. package/dist/recipe-lifecycle/evolution.js +884 -0
  314. package/dist/recipe-lifecycle/evolution.js.map +1 -0
  315. package/dist/recipe-lifecycle/index.d.ts +26 -0
  316. package/dist/recipe-lifecycle/index.d.ts.map +1 -0
  317. package/dist/recipe-lifecycle/index.js +22 -0
  318. package/dist/recipe-lifecycle/index.js.map +1 -0
  319. package/dist/recipe-lifecycle/install.d.ts +127 -0
  320. package/dist/recipe-lifecycle/install.d.ts.map +1 -0
  321. package/dist/recipe-lifecycle/install.js +526 -0
  322. package/dist/recipe-lifecycle/install.js.map +1 -0
  323. package/dist/recipe-lifecycle/legacy-aliases.d.ts +16 -0
  324. package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
  325. package/dist/recipe-lifecycle/legacy-aliases.js +51 -0
  326. package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
  327. package/dist/recipe-lifecycle/stamp.d.ts +136 -0
  328. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
  329. package/dist/recipe-lifecycle/stamp.js +326 -0
  330. package/dist/recipe-lifecycle/stamp.js.map +1 -0
  331. package/dist/recipes.d.ts +29 -1
  332. package/dist/recipes.d.ts.map +1 -1
  333. package/dist/recipes.js +137 -1
  334. package/dist/recipes.js.map +1 -1
  335. package/dist/record-overlay/apply.d.ts +43 -0
  336. package/dist/record-overlay/apply.d.ts.map +1 -0
  337. package/dist/record-overlay/apply.js +527 -0
  338. package/dist/record-overlay/apply.js.map +1 -0
  339. package/dist/record-overlay/canonical.d.ts +22 -0
  340. package/dist/record-overlay/canonical.d.ts.map +1 -0
  341. package/dist/record-overlay/canonical.js +47 -0
  342. package/dist/record-overlay/canonical.js.map +1 -0
  343. package/dist/record-overlay/digest.d.ts +4 -0
  344. package/dist/record-overlay/digest.d.ts.map +1 -0
  345. package/dist/record-overlay/digest.js +11 -0
  346. package/dist/record-overlay/digest.js.map +1 -0
  347. package/dist/record-overlay/errors.d.ts +44 -0
  348. package/dist/record-overlay/errors.d.ts.map +1 -0
  349. package/dist/record-overlay/errors.js +55 -0
  350. package/dist/record-overlay/errors.js.map +1 -0
  351. package/dist/record-overlay/findings.d.ts +5 -0
  352. package/dist/record-overlay/findings.d.ts.map +1 -0
  353. package/dist/record-overlay/findings.js +83 -0
  354. package/dist/record-overlay/findings.js.map +1 -0
  355. package/dist/record-overlay/index.d.ts +23 -0
  356. package/dist/record-overlay/index.d.ts.map +1 -0
  357. package/dist/record-overlay/index.js +21 -0
  358. package/dist/record-overlay/index.js.map +1 -0
  359. package/dist/record-overlay/plan.d.ts +12 -0
  360. package/dist/record-overlay/plan.d.ts.map +1 -0
  361. package/dist/record-overlay/plan.js +285 -0
  362. package/dist/record-overlay/plan.js.map +1 -0
  363. package/dist/record-overlay/policy.d.ts +69 -0
  364. package/dist/record-overlay/policy.d.ts.map +1 -0
  365. package/dist/record-overlay/policy.js +228 -0
  366. package/dist/record-overlay/policy.js.map +1 -0
  367. package/dist/record-overlay/redact.d.ts +3 -0
  368. package/dist/record-overlay/redact.d.ts.map +1 -0
  369. package/dist/record-overlay/redact.js +27 -0
  370. package/dist/record-overlay/redact.js.map +1 -0
  371. package/dist/record-overlay/signal-kind.d.ts +30 -0
  372. package/dist/record-overlay/signal-kind.d.ts.map +1 -0
  373. package/dist/record-overlay/signal-kind.js +38 -0
  374. package/dist/record-overlay/signal-kind.js.map +1 -0
  375. package/dist/record-overlay/signal-text.d.ts +45 -0
  376. package/dist/record-overlay/signal-text.d.ts.map +1 -0
  377. package/dist/record-overlay/signal-text.js +116 -0
  378. package/dist/record-overlay/signal-text.js.map +1 -0
  379. package/dist/record-overlay/source-index.d.ts +19 -0
  380. package/dist/record-overlay/source-index.d.ts.map +1 -0
  381. package/dist/record-overlay/source-index.js +102 -0
  382. package/dist/record-overlay/source-index.js.map +1 -0
  383. package/dist/record-overlay/types.d.ts +291 -0
  384. package/dist/record-overlay/types.d.ts.map +1 -0
  385. package/dist/record-overlay/types.js +2 -0
  386. package/dist/record-overlay/types.js.map +1 -0
  387. package/dist/remote-backend.d.ts +67 -67
  388. package/dist/remote-backend.d.ts.map +1 -1
  389. package/dist/remote-backend.js +169 -201
  390. package/dist/remote-backend.js.map +1 -1
  391. package/dist/remote-document-codec.d.ts +15 -0
  392. package/dist/remote-document-codec.d.ts.map +1 -0
  393. package/dist/remote-document-codec.js +103 -0
  394. package/dist/remote-document-codec.js.map +1 -0
  395. package/dist/remote-error.d.ts +38 -0
  396. package/dist/remote-error.d.ts.map +1 -0
  397. package/dist/remote-error.js +59 -0
  398. package/dist/remote-error.js.map +1 -0
  399. package/dist/remote-operations.d.ts +6 -3
  400. package/dist/remote-operations.d.ts.map +1 -1
  401. package/dist/remote-operations.js +23 -5
  402. package/dist/remote-operations.js.map +1 -1
  403. package/dist/remote-parsers.d.ts +86 -0
  404. package/dist/remote-parsers.d.ts.map +1 -0
  405. package/dist/remote-parsers.js +181 -0
  406. package/dist/remote-parsers.js.map +1 -0
  407. package/dist/remote.d.ts +5 -2
  408. package/dist/remote.d.ts.map +1 -1
  409. package/dist/remote.js +5 -1
  410. package/dist/remote.js.map +1 -1
  411. package/dist/search/backend-source.d.ts +6 -0
  412. package/dist/search/backend-source.d.ts.map +1 -0
  413. package/dist/search/backend-source.js +33 -0
  414. package/dist/search/backend-source.js.map +1 -0
  415. package/dist/search/contract.d.ts +151 -0
  416. package/dist/search/contract.d.ts.map +1 -0
  417. package/dist/search/contract.js +78 -0
  418. package/dist/search/contract.js.map +1 -0
  419. package/dist/search/errors.d.ts +30 -0
  420. package/dist/search/errors.d.ts.map +1 -0
  421. package/dist/search/errors.js +50 -0
  422. package/dist/search/errors.js.map +1 -0
  423. package/dist/search/identity.d.ts +12 -0
  424. package/dist/search/identity.d.ts.map +1 -0
  425. package/dist/search/identity.js +90 -0
  426. package/dist/search/identity.js.map +1 -0
  427. package/dist/search/index.d.ts +16 -0
  428. package/dist/search/index.d.ts.map +1 -0
  429. package/dist/search/index.js +15 -0
  430. package/dist/search/index.js.map +1 -0
  431. package/dist/search/memory-source.d.ts +36 -0
  432. package/dist/search/memory-source.d.ts.map +1 -0
  433. package/dist/search/memory-source.js +235 -0
  434. package/dist/search/memory-source.js.map +1 -0
  435. package/dist/search/rank.d.ts +34 -0
  436. package/dist/search/rank.d.ts.map +1 -0
  437. package/dist/search/rank.js +129 -0
  438. package/dist/search/rank.js.map +1 -0
  439. package/dist/search/row-text.d.ts +38 -0
  440. package/dist/search/row-text.d.ts.map +1 -0
  441. package/dist/search/row-text.js +88 -0
  442. package/dist/search/row-text.js.map +1 -0
  443. package/dist/search/search.d.ts +28 -0
  444. package/dist/search/search.d.ts.map +1 -0
  445. package/dist/search/search.js +257 -0
  446. package/dist/search/search.js.map +1 -0
  447. package/dist/search/source.d.ts +67 -0
  448. package/dist/search/source.d.ts.map +1 -0
  449. package/dist/search/source.js +2 -0
  450. package/dist/search/source.js.map +1 -0
  451. package/dist/search/text.d.ts +47 -0
  452. package/dist/search/text.d.ts.map +1 -0
  453. package/dist/search/text.js +148 -0
  454. package/dist/search/text.js.map +1 -0
  455. package/dist/site-capabilities.d.ts +339 -0
  456. package/dist/site-capabilities.d.ts.map +1 -0
  457. package/dist/site-capabilities.js +717 -0
  458. package/dist/site-capabilities.js.map +1 -0
  459. package/dist/source-engine/guard.d.ts +82 -0
  460. package/dist/source-engine/guard.d.ts.map +1 -0
  461. package/dist/source-engine/guard.js +396 -0
  462. package/dist/source-engine/guard.js.map +1 -0
  463. package/dist/source-engine/index.d.ts +24 -0
  464. package/dist/source-engine/index.d.ts.map +1 -0
  465. package/dist/source-engine/index.js +20 -0
  466. package/dist/source-engine/index.js.map +1 -0
  467. package/dist/source-engine/machine-state.d.ts +74 -0
  468. package/dist/source-engine/machine-state.d.ts.map +1 -0
  469. package/dist/source-engine/machine-state.js +48 -0
  470. package/dist/source-engine/machine-state.js.map +1 -0
  471. package/dist/source-engine/observe.d.ts +18 -0
  472. package/dist/source-engine/observe.d.ts.map +1 -0
  473. package/dist/source-engine/observe.js +598 -0
  474. package/dist/source-engine/observe.js.map +1 -0
  475. package/dist/source-engine/robots.d.ts +53 -0
  476. package/dist/source-engine/robots.d.ts.map +1 -0
  477. package/dist/source-engine/robots.js +158 -0
  478. package/dist/source-engine/robots.js.map +1 -0
  479. package/dist/source-engine/types.d.ts +285 -0
  480. package/dist/source-engine/types.d.ts.map +1 -0
  481. package/dist/source-engine/types.js +2 -0
  482. package/dist/source-engine/types.js.map +1 -0
  483. package/dist/source-harness/conformance.d.ts +16 -0
  484. package/dist/source-harness/conformance.d.ts.map +1 -0
  485. package/dist/source-harness/conformance.js +265 -0
  486. package/dist/source-harness/conformance.js.map +1 -0
  487. package/dist/source-harness/fixture.d.ts +95 -0
  488. package/dist/source-harness/fixture.d.ts.map +1 -0
  489. package/dist/source-harness/fixture.js +261 -0
  490. package/dist/source-harness/fixture.js.map +1 -0
  491. package/dist/source-harness/index.d.ts +22 -0
  492. package/dist/source-harness/index.d.ts.map +1 -0
  493. package/dist/source-harness/index.js +19 -0
  494. package/dist/source-harness/index.js.map +1 -0
  495. package/dist/source-harness/peer.d.ts +74 -0
  496. package/dist/source-harness/peer.d.ts.map +1 -0
  497. package/dist/source-harness/peer.js +106 -0
  498. package/dist/source-harness/peer.js.map +1 -0
  499. package/dist/storage.d.ts +6 -2
  500. package/dist/storage.d.ts.map +1 -1
  501. package/dist/storage.js +4 -1
  502. package/dist/storage.js.map +1 -1
  503. package/dist/types.d.ts +33 -5
  504. package/dist/types.d.ts.map +1 -1
  505. package/dist/uncertain-write.d.ts +156 -19
  506. package/dist/uncertain-write.d.ts.map +1 -1
  507. package/dist/uncertain-write.js +90 -31
  508. package/dist/uncertain-write.js.map +1 -1
  509. package/dist/versioning.d.ts +9 -4
  510. package/dist/versioning.d.ts.map +1 -1
  511. package/dist/versioning.js +9 -4
  512. package/dist/versioning.js.map +1 -1
  513. package/dist/write-identity.d.ts +5 -0
  514. package/dist/write-identity.d.ts.map +1 -0
  515. package/dist/write-identity.js +9 -0
  516. package/dist/write-identity.js.map +1 -0
  517. package/package.json +94 -2
@@ -0,0 +1,136 @@
1
+ import type { LoadedRecipe } from "../recipes.js";
2
+ import type { ConceptId, OkfDocument } from "../types.js";
3
+ /** The frontmatter key that carries a convention's recipe stamp. */
4
+ export declare const RECIPE_STAMP_KEY = "x_recipe";
5
+ /** The version of the digest rules this release writes and reads. */
6
+ export declare const DEFINITION_DIGEST_RULES = 1;
7
+ /** One convention's (or Connector's) record of the recipe that last wrote it. */
8
+ export interface RecipeStamp {
9
+ id: string;
10
+ version: string;
11
+ /** How many conventions the recipe declares. */
12
+ of: number;
13
+ /**
14
+ * How many Connectors the recipe declares; written only by a recipe that carries connectors, so
15
+ * a reader that predates the key ignores it and every other stamp keeps its bytes.
16
+ */
17
+ connectors?: number;
18
+ /** {@link recipeSourceDigest} of the recipe that wrote the convention. */
19
+ source_digest: string;
20
+ /** {@link definitionDigest} of the convention as that recipe wrote it. */
21
+ definition: string;
22
+ /** The rules version that produced `definition`. */
23
+ digest_rules: number;
24
+ }
25
+ /**
26
+ * How an existing convention's stamp relates to a recipe: `current` (this recipe's id, version,
27
+ * declared count and source digest), `stale` (this recipe's id, anything else different),
28
+ * `foreign` (another recipe's id) or `missing` (no well-formed stamp, or no convention).
29
+ */
30
+ export type RecipeStampState = "current" | "stale" | "foreign" | "missing";
31
+ /** One stamped convention: unchanged since its recipe wrote it, changed, or unreadable rules. */
32
+ export type ConventionStampState = "current" | "diverged" | "unknown";
33
+ /** One recipe's state across the conventions that carry its stamp. */
34
+ export type RecipeInstallState = "installed" | "partial" | "diverged" | "unknown";
35
+ export interface InstalledRecipeRow {
36
+ id: string;
37
+ state: RecipeInstallState;
38
+ version: string | null;
39
+ source_digest: string | null;
40
+ /** How many conventions carry this recipe's stamp. */
41
+ conventions: number;
42
+ of: number | null;
43
+ convention_ids: ConceptId[];
44
+ /** Present for a recipe that carries connectors: how many Connectors carry its stamp. */
45
+ connectors?: number;
46
+ /** The declared Connector count the stamps record (the stamp's `connectors`). */
47
+ connectors_of?: number | null;
48
+ connector_ids?: ConceptId[];
49
+ records?: Array<{
50
+ version: string;
51
+ source_digest: string;
52
+ conventions: number;
53
+ connectors?: number;
54
+ }>;
55
+ missing?: number;
56
+ missing_ids?: ConceptId[];
57
+ diverged?: ConceptId[];
58
+ unknown_rules?: ConceptId[];
59
+ }
60
+ /** The recipe-level facts every stamp a recipe writes shares; `definition` is per document. */
61
+ export interface RecipeStampIdentity {
62
+ id: string;
63
+ version: string;
64
+ of: number;
65
+ /** Present exactly when the recipe carries connectors. */
66
+ connectors?: number;
67
+ source_digest: string;
68
+ }
69
+ /**
70
+ * JSON with object keys sorted at every depth, `Date` values as ISO strings and `undefined`
71
+ * members omitted, so equal values hash equally whatever their key order or YAML spelling.
72
+ */
73
+ declare function canonicalJson(value: unknown): string;
74
+ /**
75
+ * The definitions-digest canon, for core's other definitions digest (the Connector pin). Named apart
76
+ * from `site-capabilities`' canonical JSON, whose semantics differ; the subpath entry does not
77
+ * re-export it.
78
+ */
79
+ export { canonicalJson as definitionCanonicalJson };
80
+ /**
81
+ * Digest of a recipe's parsed content, taken before edition materialization: its id, version,
82
+ * conventions, View pairs, References and (only when it carries any) Connectors, each sorted by id,
83
+ * bodies with CRLF read as LF. Equal across editions, independent of how the recipe was acquired,
84
+ * and blind to README files. A recipe without connectors digests exactly as it did before
85
+ * connectors existed, so every stamp written earlier stays current.
86
+ */
87
+ export declare function recipeSourceDigest(recipe: LoadedRecipe): string;
88
+ /**
89
+ * Digest of a convention as written, rules version 1: its frontmatter without the stripped keys
90
+ * and its body with CRLF read as LF and the storage newline applied. The digest of a candidate
91
+ * before the write equals the digest of the document read back from any backend.
92
+ */
93
+ export declare function definitionDigest(doc: Pick<OkfDocument, "frontmatter" | "body">): string;
94
+ /**
95
+ * The document's stamp, or null unless it is a mapping whose every required field has its type.
96
+ * The optional `connectors` count is kept when it is a non-negative integer and otherwise read as
97
+ * absent.
98
+ */
99
+ export declare function readRecipeStamp(doc: Pick<OkfDocument, "frontmatter">): RecipeStamp | null;
100
+ /** The recipe-level stamp facts for `recipe`; `materialized` supplies the declared count. */
101
+ export declare function recipeStampIdentity(recipe: LoadedRecipe, materialized: LoadedRecipe): RecipeStampIdentity;
102
+ /** `doc` with its stamp replaced by this recipe's, whose `definition` is the digest of `doc`. */
103
+ export declare function withRecipeStamp<T extends Pick<OkfDocument, "frontmatter" | "body">>(doc: T, identity: RecipeStampIdentity): T;
104
+ /**
105
+ * How the stamp on `doc` (null: no document) relates to the recipe `identity` describes. The
106
+ * Connector count must match too: for a recipe that carries connectors a stamp without it is
107
+ * `stale`, and since no release writes the key for a recipe without connectors, every stamp such a
108
+ * recipe wrote reads as it did before the key existed.
109
+ */
110
+ export declare function recipeStampState(doc: Pick<OkfDocument, "frontmatter"> | null, identity: RecipeStampIdentity): RecipeStampState;
111
+ /** The worst of `states` in the order current, stale, foreign, missing; `current` when empty. */
112
+ export declare function worstRecipeStampState(states: Iterable<RecipeStampState>): RecipeStampState;
113
+ /** One stamped document's state: rules this release reads, and whether its digest still matches. */
114
+ export declare function conventionStampState(doc: Pick<OkfDocument, "frontmatter" | "body">): ConventionStampState;
115
+ /**
116
+ * Each recipe's install state, derived from the stamps on `docs` (conventions, and Connector
117
+ * documents under `connectors/`; documents of any other type are ignored), and the documents no
118
+ * recipe stamped. `known` recipes (their declared ids are visible to the caller) also report a
119
+ * declared id that does not carry their stamp, and get a row when an unstamped convention that
120
+ * declares something, or an unstamped Connector, sits at one of their ids: a bundle written before
121
+ * stamps. A declined Kind (a declaration-free record) or another recipe's stamp at their ids alone
122
+ * is no evidence they were installed.
123
+ *
124
+ * States, the first match winning: `unknown` when no document carries the recipe's stamp;
125
+ * `partial` when the stamps record more than one version or source digest, disagree on a declared
126
+ * count, fall short of the convention or Connector count, or (known recipes) a declared id is
127
+ * present without this recipe's stamp; `diverged` when a stamped document changed since the recipe
128
+ * wrote it; `unknown` when a stamp uses digest rules this release does not read; otherwise
129
+ * `installed`. A row carries the Connector keys only for a recipe whose stamps record connectors,
130
+ * so every other row reads as it did before connectors existed.
131
+ */
132
+ export declare function installedRecipes(docs: Iterable<OkfDocument>, known?: readonly LoadedRecipe[]): {
133
+ rows: InstalledRecipeRow[];
134
+ unstamped: ConceptId[];
135
+ };
136
+ //# sourceMappingURL=stamp.d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gB,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,GAAG,mBAAmB,CASzG;AAED,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE,aAAa,GAAG,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,mBAAmB,GAAG,CAAC,CAY7H;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,mBAAmB,GAAG,gBAAgB,CAU9H;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAI1F;AAED,oGAAoG;AACpG,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,GAAG,MAAM,CAAC,GAAG,oBAAoB,CAIzG;AAkBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC3B,KAAK,GAAE,SAAS,YAAY,EAAO,GAClC;IAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAAC,SAAS,EAAE,SAAS,EAAE,CAAA;CAAE,CAyGxD"}
@@ -0,0 +1,326 @@
1
+ // Recipe install stamps. Every convention, Connector and Reference a recipe installs or evolves carries one
2
+ // `x_recipe` record, written in the same compare-and-swap write as the document, so the stamp
3
+ // exists exactly when the document does. A stamp holds only deterministic facts: two clones that apply
4
+ // the same evolve write identical stamps. The install-state read side derives convention/Connector state from their
5
+ // stamps alone, without the recipe source; References have separate evolution rows. Storage-neutral: no Node globals or builtins.
6
+ import { CONNECTOR_TYPE, CONNECTORS_PREFIX } from "../connectors.js";
7
+ import { normalizeDocumentBodyForStorage } from "../frontmatter.js";
8
+ import { CONVENTION_TYPE } from "../kinds.js";
9
+ import { sha256Hex } from "../versioning.js";
10
+ /** The frontmatter key that carries a convention's recipe stamp. */
11
+ export const RECIPE_STAMP_KEY = "x_recipe";
12
+ /** The version of the digest rules this release writes and reads. */
13
+ export const DEFINITION_DIGEST_RULES = 1;
14
+ /**
15
+ * Keys rules version 1 leaves out of a definition digest: the stamp itself, the clocks and
16
+ * attribution the write policy maintains, the hosted managed fields, and bundle-local `order`.
17
+ */
18
+ const DIGEST_STRIPPED_KEYS = [
19
+ RECIPE_STAMP_KEY,
20
+ "timestamp",
21
+ "actor",
22
+ "generated",
23
+ "verified",
24
+ "superbee_updated_by",
25
+ "okf_version",
26
+ "order",
27
+ ];
28
+ const STAMP_STATE_SEVERITY = ["current", "stale", "foreign", "missing"];
29
+ function lf(text) {
30
+ return text.replaceAll("\r\n", "\n");
31
+ }
32
+ /** Code-unit order: the same on every platform and locale. */
33
+ function byCodeUnit(a, b) {
34
+ return a < b ? -1 : a > b ? 1 : 0;
35
+ }
36
+ /**
37
+ * JSON with object keys sorted at every depth, `Date` values as ISO strings and `undefined`
38
+ * members omitted, so equal values hash equally whatever their key order or YAML spelling.
39
+ */
40
+ function canonicalJson(value) {
41
+ if (value instanceof Date)
42
+ return JSON.stringify(value.toISOString());
43
+ if (value === null || typeof value !== "object")
44
+ return JSON.stringify(value) ?? "null";
45
+ if (Array.isArray(value))
46
+ return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
47
+ const record = value;
48
+ return `{${Object.keys(record)
49
+ .filter((key) => record[key] !== undefined)
50
+ .sort(byCodeUnit)
51
+ .map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`)
52
+ .join(",")}}`;
53
+ }
54
+ /**
55
+ * The definitions-digest canon, for core's other definitions digest (the Connector pin). Named apart
56
+ * from `site-capabilities`' canonical JSON, whose semantics differ; the subpath entry does not
57
+ * re-export it.
58
+ */
59
+ export { canonicalJson as definitionCanonicalJson };
60
+ function digest(value) {
61
+ return `sha256:${sha256Hex(canonicalJson(value))}`;
62
+ }
63
+ /**
64
+ * Digest of a recipe's parsed content, taken before edition materialization: its id, version,
65
+ * conventions, View pairs, References and (only when it carries any) Connectors, each sorted by id,
66
+ * bodies with CRLF read as LF. Equal across editions, independent of how the recipe was acquired,
67
+ * and blind to README files. A recipe without connectors digests exactly as it did before
68
+ * connectors existed, so every stamp written earlier stays current.
69
+ */
70
+ export function recipeSourceDigest(recipe) {
71
+ const docs = [...recipe.docs]
72
+ .sort((a, b) => byCodeUnit(a.id, b.id))
73
+ .map((doc) => [doc.id, doc.frontmatter, lf(doc.body)]);
74
+ const pages = [...recipe.pages]
75
+ .sort((a, b) => byCodeUnit(a.registry.id, b.registry.id))
76
+ .map((page) => [page.registry.id, page.registry.frontmatter, lf(page.registry.body), page.entry, lf(page.html)]);
77
+ const references = [...recipe.references]
78
+ .sort((a, b) => byCodeUnit(a.doc.id, b.doc.id))
79
+ .map((reference) => [reference.doc.id, reference.doc.frontmatter, lf(reference.doc.body)]);
80
+ const connectors = [...(recipe.connectors ?? [])]
81
+ .sort((a, b) => byCodeUnit(a.doc.id, b.doc.id))
82
+ .map((connector) => [connector.doc.id, connector.doc.frontmatter, lf(connector.doc.body)]);
83
+ return digest({
84
+ id: recipe.id,
85
+ version: recipe.version,
86
+ docs,
87
+ pages,
88
+ references,
89
+ ...(connectors.length > 0 ? { connectors } : {}),
90
+ });
91
+ }
92
+ /**
93
+ * Digest of a convention as written, rules version 1: its frontmatter without the stripped keys
94
+ * and its body with CRLF read as LF and the storage newline applied. The digest of a candidate
95
+ * before the write equals the digest of the document read back from any backend.
96
+ */
97
+ export function definitionDigest(doc) {
98
+ const frontmatter = { ...doc.frontmatter };
99
+ for (const key of DIGEST_STRIPPED_KEYS)
100
+ delete frontmatter[key];
101
+ return digest({ frontmatter, body: normalizeDocumentBodyForStorage(lf(doc.body ?? "")) });
102
+ }
103
+ function nonNegativeInteger(value) {
104
+ return typeof value === "number" && Number.isInteger(value) && value >= 0;
105
+ }
106
+ /**
107
+ * The document's stamp, or null unless it is a mapping whose every required field has its type.
108
+ * The optional `connectors` count is kept when it is a non-negative integer and otherwise read as
109
+ * absent.
110
+ */
111
+ export function readRecipeStamp(doc) {
112
+ const value = doc.frontmatter[RECIPE_STAMP_KEY];
113
+ if (value === null || typeof value !== "object" || Array.isArray(value))
114
+ return null;
115
+ const stamp = value;
116
+ if (typeof stamp.id !== "string" || stamp.id === ""
117
+ || typeof stamp.version !== "string"
118
+ || !nonNegativeInteger(stamp.of)
119
+ || typeof stamp.source_digest !== "string"
120
+ || typeof stamp.definition !== "string"
121
+ || !nonNegativeInteger(stamp.digest_rules) || stamp.digest_rules === 0)
122
+ return null;
123
+ return {
124
+ id: stamp.id,
125
+ version: stamp.version,
126
+ of: stamp.of,
127
+ ...(nonNegativeInteger(stamp.connectors) ? { connectors: stamp.connectors } : {}),
128
+ source_digest: stamp.source_digest,
129
+ definition: stamp.definition,
130
+ digest_rules: stamp.digest_rules,
131
+ };
132
+ }
133
+ /** The recipe-level stamp facts for `recipe`; `materialized` supplies the declared count. */
134
+ export function recipeStampIdentity(recipe, materialized) {
135
+ const connectors = (recipe.connectors ?? []).length;
136
+ return {
137
+ id: recipe.id,
138
+ version: recipe.version,
139
+ of: materialized.docs.length,
140
+ ...(connectors > 0 ? { connectors } : {}),
141
+ source_digest: recipeSourceDigest(recipe),
142
+ };
143
+ }
144
+ /** `doc` with its stamp replaced by this recipe's, whose `definition` is the digest of `doc`. */
145
+ export function withRecipeStamp(doc, identity) {
146
+ const { [RECIPE_STAMP_KEY]: _previous, ...frontmatter } = doc.frontmatter;
147
+ const stamp = {
148
+ id: identity.id,
149
+ version: identity.version,
150
+ of: identity.of,
151
+ ...(identity.connectors !== undefined ? { connectors: identity.connectors } : {}),
152
+ source_digest: identity.source_digest,
153
+ definition: definitionDigest({ frontmatter: frontmatter, body: doc.body }),
154
+ digest_rules: DEFINITION_DIGEST_RULES,
155
+ };
156
+ return { ...doc, frontmatter: { ...frontmatter, [RECIPE_STAMP_KEY]: stamp } };
157
+ }
158
+ /**
159
+ * How the stamp on `doc` (null: no document) relates to the recipe `identity` describes. The
160
+ * Connector count must match too: for a recipe that carries connectors a stamp without it is
161
+ * `stale`, and since no release writes the key for a recipe without connectors, every stamp such a
162
+ * recipe wrote reads as it did before the key existed.
163
+ */
164
+ export function recipeStampState(doc, identity) {
165
+ const stamp = doc === null ? null : readRecipeStamp(doc);
166
+ if (stamp === null)
167
+ return "missing";
168
+ if (stamp.id !== identity.id)
169
+ return "foreign";
170
+ return stamp.version === identity.version
171
+ && stamp.of === identity.of
172
+ && stamp.source_digest === identity.source_digest
173
+ && stamp.connectors === identity.connectors
174
+ ? "current"
175
+ : "stale";
176
+ }
177
+ /** The worst of `states` in the order current, stale, foreign, missing; `current` when empty. */
178
+ export function worstRecipeStampState(states) {
179
+ let worst = 0;
180
+ for (const state of states)
181
+ worst = Math.max(worst, STAMP_STATE_SEVERITY.indexOf(state));
182
+ return STAMP_STATE_SEVERITY[worst];
183
+ }
184
+ /** One stamped document's state: rules this release reads, and whether its digest still matches. */
185
+ export function conventionStampState(doc) {
186
+ const stamp = readRecipeStamp(doc);
187
+ if (stamp === null || stamp.digest_rules !== DEFINITION_DIGEST_RULES)
188
+ return "unknown";
189
+ return definitionDigest(doc) === stamp.definition ? "current" : "diverged";
190
+ }
191
+ /** A convention that declares nothing a recipe would own: what `kind dismiss` writes. */
192
+ function declarationFree(doc) {
193
+ return !["fields", "sections", "links", "expects_inbound"].some((key) => Object.hasOwn(doc.frontmatter, key));
194
+ }
195
+ /** A Connector declaration: the type core's connector parser owns, at the one place it reads it. */
196
+ function isConnectorDoc(doc) {
197
+ return doc.frontmatter.type === CONNECTOR_TYPE && doc.id.startsWith(CONNECTORS_PREFIX);
198
+ }
199
+ /**
200
+ * Each recipe's install state, derived from the stamps on `docs` (conventions, and Connector
201
+ * documents under `connectors/`; documents of any other type are ignored), and the documents no
202
+ * recipe stamped. `known` recipes (their declared ids are visible to the caller) also report a
203
+ * declared id that does not carry their stamp, and get a row when an unstamped convention that
204
+ * declares something, or an unstamped Connector, sits at one of their ids: a bundle written before
205
+ * stamps. A declined Kind (a declaration-free record) or another recipe's stamp at their ids alone
206
+ * is no evidence they were installed.
207
+ *
208
+ * States, the first match winning: `unknown` when no document carries the recipe's stamp;
209
+ * `partial` when the stamps record more than one version or source digest, disagree on a declared
210
+ * count, fall short of the convention or Connector count, or (known recipes) a declared id is
211
+ * present without this recipe's stamp; `diverged` when a stamped document changed since the recipe
212
+ * wrote it; `unknown` when a stamp uses digest rules this release does not read; otherwise
213
+ * `installed`. A row carries the Connector keys only for a recipe whose stamps record connectors,
214
+ * so every other row reads as it did before connectors existed.
215
+ */
216
+ export function installedRecipes(docs, known = []) {
217
+ const present = new Map();
218
+ const stampedByRecipe = new Map();
219
+ const unstamped = [];
220
+ for (const doc of docs) {
221
+ const connector = isConnectorDoc(doc);
222
+ if (doc.frontmatter.type !== CONVENTION_TYPE && !connector)
223
+ continue;
224
+ present.set(doc.id, doc);
225
+ const stamp = readRecipeStamp(doc);
226
+ if (stamp === null) {
227
+ if (connector || !declarationFree(doc))
228
+ unstamped.push(doc.id);
229
+ continue;
230
+ }
231
+ const group = stampedByRecipe.get(stamp.id) ?? [];
232
+ group.push({ doc, stamp, connector });
233
+ stampedByRecipe.set(stamp.id, group);
234
+ }
235
+ const knownById = new Map(known.map((recipe) => [recipe.id, recipe]));
236
+ const declaredDocs = (recipe) => [...recipe.docs, ...(recipe.connectors ?? []).map((connector) => connector.doc)];
237
+ const ids = new Set(stampedByRecipe.keys());
238
+ const unstampedIds = new Set(unstamped);
239
+ for (const recipe of known) {
240
+ if (declaredDocs(recipe).some((declared) => unstampedIds.has(declared.id)))
241
+ ids.add(recipe.id);
242
+ }
243
+ const rows = [...ids].sort(byCodeUnit).map((id) => {
244
+ const all = (stampedByRecipe.get(id) ?? []).sort((a, b) => byCodeUnit(a.doc.id, b.doc.id));
245
+ const stamped = all.filter((entry) => !entry.connector);
246
+ const stampedConnectors = all.filter((entry) => entry.connector);
247
+ const recipe = knownById.get(id);
248
+ const conventionIds = stamped.map(({ doc }) => doc.id);
249
+ const stampedIds = new Set(all.map(({ doc }) => doc.id));
250
+ const records = new Map();
251
+ for (const { stamp, connector } of all) {
252
+ const key = `${stamp.version}\u0000${stamp.source_digest}`;
253
+ const record = records.get(key) ?? { version: stamp.version, source_digest: stamp.source_digest, conventions: 0 };
254
+ if (connector)
255
+ record.connectors = (record.connectors ?? 0) + 1;
256
+ else
257
+ record.conventions += 1;
258
+ records.set(key, record);
259
+ }
260
+ const recordRows = [...records.values()].sort((a, b) => byCodeUnit(a.version, b.version) || byCodeUnit(a.source_digest, b.source_digest));
261
+ const declaredCounts = new Set(all.map(({ stamp }) => stamp.of));
262
+ const of = declaredCounts.size === 1 ? [...declaredCounts][0] : recipe ? recipe.docs.length : null;
263
+ // A stamp without the key records no connectors; a disagreement among stamps is partial.
264
+ const connectorCounts = new Set(all.map(({ stamp }) => stamp.connectors));
265
+ const declaredConnectors = recipe && (recipe.connectors ?? []).length > 0 ? recipe.connectors.length : undefined;
266
+ const connectorsOf = connectorCounts.size === 1
267
+ ? [...connectorCounts][0]
268
+ : connectorCounts.size === 0 ? declaredConnectors : declaredConnectors ?? null;
269
+ const carriesConnectors = stampedConnectors.length > 0 || connectorsOf !== undefined;
270
+ const diverged = all.filter(({ doc }) => conventionStampState(doc) === "diverged").map(({ doc }) => doc.id);
271
+ const unknownRules = all.filter(({ stamp }) => stamp.digest_rules !== DEFINITION_DIGEST_RULES).map(({ doc }) => doc.id);
272
+ const declaredIds = recipe ? declaredDocs(recipe).map((doc) => doc.id).sort(byCodeUnit) : [];
273
+ const missingIds = declaredIds.filter((declared) => !stampedIds.has(declared));
274
+ const presentWithoutStamp = missingIds.filter((declared) => present.has(declared));
275
+ let state;
276
+ if (all.length === 0)
277
+ state = "unknown";
278
+ else if (recordRows.length > 1
279
+ || declaredCounts.size > 1
280
+ || connectorCounts.size > 1
281
+ || stamped.length !== of
282
+ || stampedConnectors.length !== (connectorsOf ?? 0)
283
+ || presentWithoutStamp.length > 0
284
+ || (recipe !== undefined && missingIds.length > 0))
285
+ state = "partial";
286
+ else if (diverged.length > 0)
287
+ state = "diverged";
288
+ else if (unknownRules.length > 0)
289
+ state = "unknown";
290
+ else
291
+ state = "installed";
292
+ const single = state === "installed" || state === "diverged" ? recordRows[0] : null;
293
+ const row = {
294
+ id,
295
+ state,
296
+ version: single?.version ?? null,
297
+ source_digest: single?.source_digest ?? null,
298
+ conventions: stamped.length,
299
+ of,
300
+ convention_ids: conventionIds,
301
+ };
302
+ if (carriesConnectors) {
303
+ row.connectors = stampedConnectors.length;
304
+ row.connectors_of = connectorsOf ?? null;
305
+ row.connector_ids = stampedConnectors.map(({ doc }) => doc.id);
306
+ }
307
+ if (state === "partial") {
308
+ row.records = recordRows;
309
+ const missing = recipe
310
+ ? missingIds.length
311
+ : (of === null ? 0 : Math.max(0, of - stamped.length))
312
+ + (typeof connectorsOf === "number" ? Math.max(0, connectorsOf - stampedConnectors.length) : 0);
313
+ if (missing > 0)
314
+ row.missing = missing;
315
+ if (recipe && missingIds.length > 0)
316
+ row.missing_ids = missingIds;
317
+ }
318
+ if (diverged.length > 0)
319
+ row.diverged = diverged;
320
+ if (unknownRules.length > 0)
321
+ row.unknown_rules = unknownRules;
322
+ return row;
323
+ });
324
+ return { rows, unstamped: unstamped.sort(byCodeUnit) };
325
+ }
326
+ //# sourceMappingURL=stamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stamp.js","sourceRoot":"","sources":["../../src/recipe-lifecycle/stamp.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,8FAA8F;AAC9F,uGAAuG;AACvG,oHAAoH;AACpH,kIAAkI;AAClI,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa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ANGED
@@ -1,3 +1,4 @@
1
+ import { type Connector, type ConnectorErrorCode } from "./connectors.js";
1
2
  import type { OkfDocument } from "./types.js";
2
3
  import type { ValidationWarning } from "./validation.js";
3
4
  /** One recipe file: a path relative to the recipe root (posix), with its UTF-8 text. */
@@ -19,6 +20,13 @@ export interface RecipeReference {
19
20
  /** A `type: Reference` document installed under `references/`. */
20
21
  doc: OkfDocument;
21
22
  }
23
+ /** One Connector declaration carried by a recipe package: a definition, never an instance. */
24
+ export interface RecipeConnector {
25
+ /** The `type: Connector` document installed under `connectors/`. */
26
+ doc: OkfDocument;
27
+ /** The declaration as `parseConnectorDoc` read it. */
28
+ connector: Connector;
29
+ }
22
30
  /** Parsed recipe definitions. Parsing does not install, authorize or execute these assets. */
23
31
  export interface LoadedRecipe {
24
32
  id: string;
@@ -35,6 +43,12 @@ export interface LoadedRecipe {
35
43
  pages: RecipePage[];
36
44
  /** Optional operating references installed with the definitions; never project instances. */
37
45
  references: RecipeReference[];
46
+ /**
47
+ * Connector declarations the manifest's `connectors:` list carries, installed and evolved as
48
+ * definitions. Absent when the manifest declares none, so a recipe without connectors parses to
49
+ * the same value it always did.
50
+ */
51
+ connectors?: RecipeConnector[];
38
52
  /** Present only for packages opting into the strict portable definitions-only contract. */
39
53
  contentPolicy?: "definitions-only";
40
54
  /** The `type` values this recipe's conventions govern (derived at parse, for the receipt). */
@@ -42,11 +56,25 @@ export interface LoadedRecipe {
42
56
  /** Non-fatal (skipped-malformed doc / reserved manifest key / etc). Never silently dropped. */
43
57
  warnings: ValidationWarning[];
44
58
  }
45
- export type RecipeErrorCode = "RECIPE_NOT_FOUND" | "RECIPE_MALFORMED" | "RECIPE_EMPTY" | "RECIPE_UNSAFE_PATH";
59
+ /**
60
+ * The logical workflow-field token recipe convention bodies may carry; materialization replaces it
61
+ * with the target edition's storage field. Part of the recipe format, so every client reads it here.
62
+ */
63
+ export declare const RECIPE_PROGRESS_STATUS_TOKEN = "{{superbee:progress_status}}";
64
+ export type RecipeErrorCode = "RECIPE_NOT_FOUND" | "RECIPE_MALFORMED" | "RECIPE_EMPTY" | "RECIPE_UNSAFE_PATH" | "RECIPE_CONNECTOR_INVALID";
46
65
  export interface RecipeError {
47
66
  code: RecipeErrorCode;
48
67
  message: string;
68
+ /** `RECIPE_CONNECTOR_INVALID`: the first refusal of the connector named, and how many it had. */
69
+ connector?: {
70
+ id: string;
71
+ code: ConnectorErrorCode;
72
+ path: string;
73
+ count: number;
74
+ };
49
75
  }
76
+ /** The connectors a recipe carries; empty when its manifest declares none. */
77
+ export declare function recipeConnectors(recipe: Pick<LoadedRecipe, "connectors">): readonly RecipeConnector[];
50
78
  export type LoadResult = {
51
79
  ok: true;
52
80
  recipe: LoadedRecipe;
@@ -1 +1 @@
1
- {"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../src/recipes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAYzD,wFAAwF;AACxF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,mEAAmE;AACnE,MAAM,WAAW,UAAU;IACzB,uHAAuH;IACvH,QAAQ,EAAE,WAAW,CAAC;IACtB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,GAAG,EAAE,WAAW,CAAC;CAClB;AAED,8FAA8F;AAC9F,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,iGAAiG;IACjG,KAAK,EAAE,MAAM,CAAC;IACd,iF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