@superbee/core 0.2.0-pre.9 → 0.4.10-pre.12

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 (793) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +1339 -6
  3. package/dist/backend.d.ts +50 -2
  4. package/dist/backend.d.ts.map +1 -1
  5. package/dist/backend.js +311 -33
  6. package/dist/backend.js.map +1 -1
  7. package/dist/blob-contract.d.ts +82 -0
  8. package/dist/blob-contract.d.ts.map +1 -0
  9. package/dist/blob-contract.js +134 -0
  10. package/dist/blob-contract.js.map +1 -0
  11. package/dist/blob-journal.d.ts +303 -0
  12. package/dist/blob-journal.d.ts.map +1 -0
  13. package/dist/blob-journal.js +541 -0
  14. package/dist/blob-journal.js.map +1 -0
  15. package/dist/body-pages.d.ts +20 -0
  16. package/dist/body-pages.d.ts.map +1 -0
  17. package/dist/body-pages.js +56 -0
  18. package/dist/body-pages.js.map +1 -0
  19. package/dist/body-replace-guards.d.ts +81 -0
  20. package/dist/body-replace-guards.d.ts.map +1 -0
  21. package/dist/body-replace-guards.js +271 -0
  22. package/dist/body-replace-guards.js.map +1 -0
  23. package/dist/bounded-yaml.d.ts +28 -0
  24. package/dist/bounded-yaml.d.ts.map +1 -0
  25. package/dist/bounded-yaml.js +182 -0
  26. package/dist/bounded-yaml.js.map +1 -0
  27. package/dist/builtin-recipes/content.d.ts +93 -0
  28. package/dist/builtin-recipes/content.d.ts.map +1 -0
  29. package/dist/builtin-recipes/content.js +288 -0
  30. package/dist/builtin-recipes/content.js.map +1 -0
  31. package/dist/builtin-recipes/site.d.ts +5 -0
  32. package/dist/builtin-recipes/site.d.ts.map +1 -0
  33. package/dist/builtin-recipes/site.js +83 -0
  34. package/dist/builtin-recipes/site.js.map +1 -0
  35. package/dist/builtin-recipes.d.ts +13 -0
  36. package/dist/builtin-recipes.d.ts.map +1 -0
  37. package/dist/builtin-recipes.js +123 -0
  38. package/dist/builtin-recipes.js.map +1 -0
  39. package/dist/bundle-health/index.d.ts +14 -0
  40. package/dist/bundle-health/index.d.ts.map +1 -0
  41. package/dist/bundle-health/index.js +12 -0
  42. package/dist/bundle-health/index.js.map +1 -0
  43. package/dist/bundle-health/kind-findings.d.ts +45 -0
  44. package/dist/bundle-health/kind-findings.d.ts.map +1 -0
  45. package/dist/bundle-health/kind-findings.js +67 -0
  46. package/dist/bundle-health/kind-findings.js.map +1 -0
  47. package/dist/bundle-health/legacy-page.d.ts +21 -0
  48. package/dist/bundle-health/legacy-page.d.ts.map +1 -0
  49. package/dist/bundle-health/legacy-page.js +25 -0
  50. package/dist/bundle-health/legacy-page.js.map +1 -0
  51. package/dist/bundle-health/report.d.ts +191 -0
  52. package/dist/bundle-health/report.d.ts.map +1 -0
  53. package/dist/bundle-health/report.js +419 -0
  54. package/dist/bundle-health/report.js.map +1 -0
  55. package/dist/bundle-ops.d.ts +10 -4
  56. package/dist/bundle-ops.d.ts.map +1 -1
  57. package/dist/bundle-ops.js +15 -8
  58. package/dist/bundle-ops.js.map +1 -1
  59. package/dist/bundle.d.ts +2 -4
  60. package/dist/bundle.d.ts.map +1 -1
  61. package/dist/bundle.js +3 -12
  62. package/dist/bundle.js.map +1 -1
  63. package/dist/code-point-order.d.ts +8 -0
  64. package/dist/code-point-order.d.ts.map +1 -0
  65. package/dist/code-point-order.js +20 -0
  66. package/dist/code-point-order.js.map +1 -0
  67. package/dist/code-unit-order.d.ts +15 -0
  68. package/dist/code-unit-order.d.ts.map +1 -0
  69. package/dist/code-unit-order.js +17 -0
  70. package/dist/code-unit-order.js.map +1 -0
  71. package/dist/connector-request.d.ts +112 -0
  72. package/dist/connector-request.d.ts.map +1 -0
  73. package/dist/connector-request.js +495 -0
  74. package/dist/connector-request.js.map +1 -0
  75. package/dist/connectors.d.ts +297 -0
  76. package/dist/connectors.d.ts.map +1 -0
  77. package/dist/connectors.js +1233 -0
  78. package/dist/connectors.js.map +1 -0
  79. package/dist/convention-record.d.ts +9 -0
  80. package/dist/convention-record.d.ts.map +1 -0
  81. package/dist/convention-record.js +13 -0
  82. package/dist/convention-record.js.map +1 -0
  83. package/dist/cross-bundle.d.ts +135 -0
  84. package/dist/cross-bundle.d.ts.map +1 -0
  85. package/dist/cross-bundle.js +191 -0
  86. package/dist/cross-bundle.js.map +1 -0
  87. package/dist/dependencies.d.ts +208 -0
  88. package/dist/dependencies.d.ts.map +1 -0
  89. package/dist/dependencies.js +367 -0
  90. package/dist/dependencies.js.map +1 -0
  91. package/dist/document-codec.d.ts +4 -1
  92. package/dist/document-codec.d.ts.map +1 -1
  93. package/dist/document-codec.js +3 -1
  94. package/dist/document-codec.js.map +1 -1
  95. package/dist/document-field-actions.d.ts +21 -3
  96. package/dist/document-field-actions.d.ts.map +1 -1
  97. package/dist/document-field-actions.js +105 -40
  98. package/dist/document-field-actions.js.map +1 -1
  99. package/dist/document-mutation.d.ts +44 -18
  100. package/dist/document-mutation.d.ts.map +1 -1
  101. package/dist/document-mutation.js +192 -86
  102. package/dist/document-mutation.js.map +1 -1
  103. package/dist/document-persistence.d.ts +12 -0
  104. package/dist/document-persistence.d.ts.map +1 -0
  105. package/dist/document-persistence.js +44 -0
  106. package/dist/document-persistence.js.map +1 -0
  107. package/dist/document-replace-rules.d.ts +44 -0
  108. package/dist/document-replace-rules.d.ts.map +1 -0
  109. package/dist/document-replace-rules.js +41 -0
  110. package/dist/document-replace-rules.js.map +1 -0
  111. package/dist/document-scan.d.ts +26 -0
  112. package/dist/document-scan.d.ts.map +1 -0
  113. package/dist/document-scan.js +70 -0
  114. package/dist/document-scan.js.map +1 -0
  115. package/dist/document-transfer.d.ts +314 -0
  116. package/dist/document-transfer.d.ts.map +1 -0
  117. package/dist/document-transfer.js +1404 -0
  118. package/dist/document-transfer.js.map +1 -0
  119. package/dist/document-write-policy.d.ts +15 -4
  120. package/dist/document-write-policy.d.ts.map +1 -1
  121. package/dist/document-write-policy.js +41 -27
  122. package/dist/document-write-policy.js.map +1 -1
  123. package/dist/domain-model.d.ts +73 -0
  124. package/dist/domain-model.d.ts.map +1 -0
  125. package/dist/domain-model.js +169 -0
  126. package/dist/domain-model.js.map +1 -0
  127. package/dist/edge-harness/corpus.d.ts +9 -0
  128. package/dist/edge-harness/corpus.d.ts.map +1 -0
  129. package/dist/edge-harness/corpus.js +57 -0
  130. package/dist/edge-harness/corpus.js.map +1 -0
  131. package/dist/edge-harness/index.d.ts +21 -0
  132. package/dist/edge-harness/index.d.ts.map +1 -0
  133. package/dist/edge-harness/index.js +537 -0
  134. package/dist/edge-harness/index.js.map +1 -0
  135. package/dist/edges/find.d.ts +14 -0
  136. package/dist/edges/find.d.ts.map +1 -0
  137. package/dist/edges/find.js +46 -0
  138. package/dist/edges/find.js.map +1 -0
  139. package/dist/edges/index.d.ts +13 -0
  140. package/dist/edges/index.d.ts.map +1 -0
  141. package/dist/edges/index.js +5 -0
  142. package/dist/edges/index.js.map +1 -0
  143. package/dist/edges/memory-source.d.ts +8 -0
  144. package/dist/edges/memory-source.d.ts.map +1 -0
  145. package/dist/edges/memory-source.js +164 -0
  146. package/dist/edges/memory-source.js.map +1 -0
  147. package/dist/edges/read-bounds.d.ts +6 -0
  148. package/dist/edges/read-bounds.d.ts.map +1 -0
  149. package/dist/edges/read-bounds.js +13 -0
  150. package/dist/edges/read-bounds.js.map +1 -0
  151. package/dist/edges/source.d.ts +123 -0
  152. package/dist/edges/source.d.ts.map +1 -0
  153. package/dist/edges/source.js +2 -0
  154. package/dist/edges/source.js.map +1 -0
  155. package/dist/edges/walk.d.ts +7 -0
  156. package/dist/edges/walk.d.ts.map +1 -0
  157. package/dist/edges/walk.js +14 -0
  158. package/dist/edges/walk.js.map +1 -0
  159. package/dist/engine.d.ts +54 -18
  160. package/dist/engine.d.ts.map +1 -1
  161. package/dist/engine.js +137 -108
  162. package/dist/engine.js.map +1 -1
  163. package/dist/errors.d.ts +40 -2
  164. package/dist/errors.d.ts.map +1 -1
  165. package/dist/errors.js +80 -4
  166. package/dist/errors.js.map +1 -1
  167. package/dist/file-journaled-backend-internal.d.ts +2 -0
  168. package/dist/file-journaled-backend-internal.d.ts.map +1 -1
  169. package/dist/file-journaled-backend-internal.js +2 -0
  170. package/dist/file-journaled-backend-internal.js.map +1 -1
  171. package/dist/file-journaled-backend.d.ts +38 -40
  172. package/dist/file-journaled-backend.d.ts.map +1 -1
  173. package/dist/file-journaled-backend.js +284 -52
  174. package/dist/file-journaled-backend.js.map +1 -1
  175. package/dist/filesystem-identity.d.ts +116 -17
  176. package/dist/filesystem-identity.d.ts.map +1 -1
  177. package/dist/filesystem-identity.js +532 -51
  178. package/dist/filesystem-identity.js.map +1 -1
  179. package/dist/filesystem-lock.d.ts +9 -2
  180. package/dist/filesystem-lock.d.ts.map +1 -1
  181. package/dist/filesystem-lock.js +134 -17
  182. package/dist/filesystem-lock.js.map +1 -1
  183. package/dist/filesystem-temp-name.d.ts +9 -0
  184. package/dist/filesystem-temp-name.d.ts.map +1 -0
  185. package/dist/filesystem-temp-name.js +20 -0
  186. package/dist/filesystem-temp-name.js.map +1 -0
  187. package/dist/filesystem.d.ts +6 -0
  188. package/dist/filesystem.d.ts.map +1 -1
  189. package/dist/filesystem.js +2 -1
  190. package/dist/filesystem.js.map +1 -1
  191. package/dist/freshness.d.ts +16 -1
  192. package/dist/freshness.d.ts.map +1 -1
  193. package/dist/freshness.js +47 -17
  194. package/dist/freshness.js.map +1 -1
  195. package/dist/frontmatter-contract.d.ts +14 -0
  196. package/dist/frontmatter-contract.d.ts.map +1 -1
  197. package/dist/frontmatter-contract.js +22 -0
  198. package/dist/frontmatter-contract.js.map +1 -1
  199. package/dist/frontmatter-splitter.d.ts +6 -0
  200. package/dist/frontmatter-splitter.d.ts.map +1 -1
  201. package/dist/frontmatter-splitter.js +8 -0
  202. package/dist/frontmatter-splitter.js.map +1 -1
  203. package/dist/frontmatter.d.ts +17 -7
  204. package/dist/frontmatter.d.ts.map +1 -1
  205. package/dist/frontmatter.js +52 -11
  206. package/dist/frontmatter.js.map +1 -1
  207. package/dist/governed-body-write.d.ts.map +1 -1
  208. package/dist/governed-body-write.js +13 -6
  209. package/dist/governed-body-write.js.map +1 -1
  210. package/dist/heads-digest.d.ts.map +1 -1
  211. package/dist/heads-digest.js +2 -1
  212. package/dist/heads-digest.js.map +1 -1
  213. package/dist/hosted-client/binding.d.ts +7 -0
  214. package/dist/hosted-client/binding.d.ts.map +1 -0
  215. package/dist/hosted-client/binding.js +10 -0
  216. package/dist/hosted-client/binding.js.map +1 -0
  217. package/dist/hosted-client/blob-delivery.d.ts +68 -0
  218. package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
  219. package/dist/hosted-client/blob-delivery.js +170 -0
  220. package/dist/hosted-client/blob-delivery.js.map +1 -0
  221. package/dist/hosted-client/blob-write.d.ts +387 -0
  222. package/dist/hosted-client/blob-write.d.ts.map +1 -0
  223. package/dist/hosted-client/blob-write.js +770 -0
  224. package/dist/hosted-client/blob-write.js.map +1 -0
  225. package/dist/hosted-client/bundle-listing.d.ts +46 -0
  226. package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
  227. package/dist/hosted-client/bundle-listing.js +36 -0
  228. package/dist/hosted-client/bundle-listing.js.map +1 -0
  229. package/dist/hosted-client/client.d.ts +249 -0
  230. package/dist/hosted-client/client.d.ts.map +1 -0
  231. package/dist/hosted-client/client.js +381 -0
  232. package/dist/hosted-client/client.js.map +1 -0
  233. package/dist/hosted-client/directory.d.ts +46 -0
  234. package/dist/hosted-client/directory.d.ts.map +1 -0
  235. package/dist/hosted-client/directory.js +74 -0
  236. package/dist/hosted-client/directory.js.map +1 -0
  237. package/dist/hosted-client/errors.d.ts +26 -0
  238. package/dist/hosted-client/errors.d.ts.map +1 -0
  239. package/dist/hosted-client/errors.js +35 -0
  240. package/dist/hosted-client/errors.js.map +1 -0
  241. package/dist/hosted-client/inbox.d.ts +320 -0
  242. package/dist/hosted-client/inbox.d.ts.map +1 -0
  243. package/dist/hosted-client/inbox.js +379 -0
  244. package/dist/hosted-client/inbox.js.map +1 -0
  245. package/dist/hosted-client/index.d.ts +31 -0
  246. package/dist/hosted-client/index.d.ts.map +1 -0
  247. package/dist/hosted-client/index.js +33 -0
  248. package/dist/hosted-client/index.js.map +1 -0
  249. package/dist/hosted-client/journal.d.ts +103 -0
  250. package/dist/hosted-client/journal.d.ts.map +1 -0
  251. package/dist/hosted-client/journal.js +464 -0
  252. package/dist/hosted-client/journal.js.map +1 -0
  253. package/dist/hosted-client/node.d.ts +74 -0
  254. package/dist/hosted-client/node.d.ts.map +1 -0
  255. package/dist/hosted-client/node.js +219 -0
  256. package/dist/hosted-client/node.js.map +1 -0
  257. package/dist/hosted-client/reference.d.ts +12 -0
  258. package/dist/hosted-client/reference.d.ts.map +1 -0
  259. package/dist/hosted-client/reference.js +29 -0
  260. package/dist/hosted-client/reference.js.map +1 -0
  261. package/dist/hosted-client/view-content.d.ts +184 -0
  262. package/dist/hosted-client/view-content.d.ts.map +1 -0
  263. package/dist/hosted-client/view-content.js +268 -0
  264. package/dist/hosted-client/view-content.js.map +1 -0
  265. package/dist/hosted-client/write.d.ts +219 -0
  266. package/dist/hosted-client/write.d.ts.map +1 -0
  267. package/dist/hosted-client/write.js +419 -0
  268. package/dist/hosted-client/write.js.map +1 -0
  269. package/dist/hosted-transport/answer-rows.d.ts +132 -4
  270. package/dist/hosted-transport/answer-rows.d.ts.map +1 -1
  271. package/dist/hosted-transport/answer-rows.js +211 -11
  272. package/dist/hosted-transport/answer-rows.js.map +1 -1
  273. package/dist/hosted-transport/attribution.d.ts +32 -0
  274. package/dist/hosted-transport/attribution.d.ts.map +1 -0
  275. package/dist/hosted-transport/attribution.js +38 -0
  276. package/dist/hosted-transport/attribution.js.map +1 -0
  277. package/dist/hosted-transport/blob-reads.d.ts +35 -0
  278. package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
  279. package/dist/hosted-transport/blob-reads.js +179 -0
  280. package/dist/hosted-transport/blob-reads.js.map +1 -0
  281. package/dist/hosted-transport/blob-write.d.ts +34 -0
  282. package/dist/hosted-transport/blob-write.d.ts.map +1 -0
  283. package/dist/hosted-transport/blob-write.js +115 -0
  284. package/dist/hosted-transport/blob-write.js.map +1 -0
  285. package/dist/hosted-transport/carrier.d.ts +35 -11
  286. package/dist/hosted-transport/carrier.d.ts.map +1 -1
  287. package/dist/hosted-transport/carrier.js +101 -57
  288. package/dist/hosted-transport/carrier.js.map +1 -1
  289. package/dist/hosted-transport/document-backend.d.ts +74 -0
  290. package/dist/hosted-transport/document-backend.d.ts.map +1 -0
  291. package/dist/hosted-transport/document-backend.js +160 -0
  292. package/dist/hosted-transport/document-backend.js.map +1 -0
  293. package/dist/hosted-transport/index.d.ts +7 -4
  294. package/dist/hosted-transport/index.d.ts.map +1 -1
  295. package/dist/hosted-transport/index.js +7 -4
  296. package/dist/hosted-transport/index.js.map +1 -1
  297. package/dist/hosted-transport/operations.d.ts +6 -0
  298. package/dist/hosted-transport/operations.d.ts.map +1 -1
  299. package/dist/hosted-transport/operations.js +2 -1
  300. package/dist/hosted-transport/operations.js.map +1 -1
  301. package/dist/hosted-transport/port-run.d.ts +41 -0
  302. package/dist/hosted-transport/port-run.d.ts.map +1 -0
  303. package/dist/hosted-transport/port-run.js +92 -0
  304. package/dist/hosted-transport/port-run.js.map +1 -0
  305. package/dist/hosted-transport/read-adapter.d.ts +19 -3
  306. package/dist/hosted-transport/read-adapter.d.ts.map +1 -1
  307. package/dist/hosted-transport/read-adapter.js +18 -5
  308. package/dist/hosted-transport/read-adapter.js.map +1 -1
  309. package/dist/hosted-transport/root-write.d.ts.map +1 -1
  310. package/dist/hosted-transport/root-write.js +5 -2
  311. package/dist/hosted-transport/root-write.js.map +1 -1
  312. package/dist/hosted-transport/whole-document-transport.d.ts +56 -7
  313. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -1
  314. package/dist/hosted-transport/whole-document-transport.js +120 -31
  315. package/dist/hosted-transport/whole-document-transport.js.map +1 -1
  316. package/dist/identity-fold.d.ts +16 -0
  317. package/dist/identity-fold.d.ts.map +1 -0
  318. package/dist/identity-fold.js +24 -0
  319. package/dist/identity-fold.js.map +1 -0
  320. package/dist/index-projection.d.ts +2 -1
  321. package/dist/index-projection.d.ts.map +1 -1
  322. package/dist/index-projection.js +38 -28
  323. package/dist/index-projection.js.map +1 -1
  324. package/dist/index.d.ts +59 -16
  325. package/dist/index.d.ts.map +1 -1
  326. package/dist/index.js +49 -20
  327. package/dist/index.js.map +1 -1
  328. package/dist/indexeddb-backend.d.ts +0 -31
  329. package/dist/indexeddb-backend.d.ts.map +1 -1
  330. package/dist/indexeddb-backend.js +5 -2
  331. package/dist/indexeddb-backend.js.map +1 -1
  332. package/dist/inventory-guard.d.ts +58 -0
  333. package/dist/inventory-guard.d.ts.map +1 -0
  334. package/dist/inventory-guard.js +169 -0
  335. package/dist/inventory-guard.js.map +1 -0
  336. package/dist/journaled-backend.d.ts +14 -4
  337. package/dist/journaled-backend.d.ts.map +1 -1
  338. package/dist/journaled-backend.js +19 -78
  339. package/dist/journaled-backend.js.map +1 -1
  340. package/dist/json-data.d.ts +3 -0
  341. package/dist/json-data.d.ts.map +1 -0
  342. package/dist/json-data.js +19 -0
  343. package/dist/json-data.js.map +1 -0
  344. package/dist/kind-authoring.d.ts +188 -0
  345. package/dist/kind-authoring.d.ts.map +1 -0
  346. package/dist/kind-authoring.js +520 -0
  347. package/dist/kind-authoring.js.map +1 -0
  348. package/dist/kind-changes.d.ts +45 -0
  349. package/dist/kind-changes.d.ts.map +1 -0
  350. package/dist/kind-changes.js +96 -0
  351. package/dist/kind-changes.js.map +1 -0
  352. package/dist/kind-conformance-error.d.ts +16 -0
  353. package/dist/kind-conformance-error.d.ts.map +1 -0
  354. package/dist/kind-conformance-error.js +20 -0
  355. package/dist/kind-conformance-error.js.map +1 -0
  356. package/dist/kind-coverage.d.ts +100 -0
  357. package/dist/kind-coverage.d.ts.map +1 -0
  358. package/dist/kind-coverage.js +185 -0
  359. package/dist/kind-coverage.js.map +1 -0
  360. package/dist/kind-deprecation.d.ts +32 -0
  361. package/dist/kind-deprecation.d.ts.map +1 -0
  362. package/dist/kind-deprecation.js +141 -0
  363. package/dist/kind-deprecation.js.map +1 -0
  364. package/dist/kind-field-mutation.d.ts +7 -2
  365. package/dist/kind-field-mutation.d.ts.map +1 -1
  366. package/dist/kind-field-mutation.js +28 -3
  367. package/dist/kind-field-mutation.js.map +1 -1
  368. package/dist/kind-undeclared-fields.d.ts +72 -0
  369. package/dist/kind-undeclared-fields.d.ts.map +1 -0
  370. package/dist/kind-undeclared-fields.js +124 -0
  371. package/dist/kind-undeclared-fields.js.map +1 -0
  372. package/dist/kinds-load.d.ts.map +1 -1
  373. package/dist/kinds-load.js +8 -5
  374. package/dist/kinds-load.js.map +1 -1
  375. package/dist/kinds.d.ts +105 -13
  376. package/dist/kinds.d.ts.map +1 -1
  377. package/dist/kinds.js +369 -30
  378. package/dist/kinds.js.map +1 -1
  379. package/dist/link-add.d.ts +81 -0
  380. package/dist/link-add.d.ts.map +1 -0
  381. package/dist/link-add.js +94 -0
  382. package/dist/link-add.js.map +1 -0
  383. package/dist/link-emit.d.ts +29 -0
  384. package/dist/link-emit.d.ts.map +1 -0
  385. package/dist/link-emit.js +39 -0
  386. package/dist/link-emit.js.map +1 -0
  387. package/dist/link-findings.d.ts +132 -0
  388. package/dist/link-findings.d.ts.map +1 -0
  389. package/dist/link-findings.js +263 -0
  390. package/dist/link-findings.js.map +1 -0
  391. package/dist/link-types.d.ts +34 -0
  392. package/dist/link-types.d.ts.map +1 -0
  393. package/dist/link-types.js +79 -0
  394. package/dist/link-types.js.map +1 -0
  395. package/dist/links.d.ts +68 -9
  396. package/dist/links.d.ts.map +1 -1
  397. package/dist/links.js +370 -57
  398. package/dist/links.js.map +1 -1
  399. package/dist/local-search-index.d.ts +86 -0
  400. package/dist/local-search-index.d.ts.map +1 -0
  401. package/dist/local-search-index.js +1055 -0
  402. package/dist/local-search-index.js.map +1 -0
  403. package/dist/managed-document-metadata.d.ts +5 -0
  404. package/dist/managed-document-metadata.d.ts.map +1 -0
  405. package/dist/managed-document-metadata.js +10 -0
  406. package/dist/managed-document-metadata.js.map +1 -0
  407. package/dist/markdown-syntax.d.ts +39 -0
  408. package/dist/markdown-syntax.d.ts.map +1 -0
  409. package/dist/markdown-syntax.js +10170 -0
  410. package/dist/markdown-syntax.js.map +1 -0
  411. package/dist/memory-backend.d.ts +3 -0
  412. package/dist/memory-backend.d.ts.map +1 -1
  413. package/dist/memory-backend.js +40 -2
  414. package/dist/memory-backend.js.map +1 -1
  415. package/dist/mutation-attribution.d.ts +2 -1
  416. package/dist/mutation-attribution.d.ts.map +1 -1
  417. package/dist/mutation-attribution.js.map +1 -1
  418. package/dist/okf-actor.d.ts +14 -3
  419. package/dist/okf-actor.d.ts.map +1 -1
  420. package/dist/okf-actor.js +25 -4
  421. package/dist/okf-actor.js.map +1 -1
  422. package/dist/okf-authored-values.d.ts +2 -0
  423. package/dist/okf-authored-values.d.ts.map +1 -1
  424. package/dist/okf-authored-values.js +4 -0
  425. package/dist/okf-authored-values.js.map +1 -1
  426. package/dist/okf-authoring.d.ts +7 -0
  427. package/dist/okf-authoring.d.ts.map +1 -0
  428. package/dist/okf-authoring.js +30 -0
  429. package/dist/okf-authoring.js.map +1 -0
  430. package/dist/okf-standard-fields.d.ts +4 -0
  431. package/dist/okf-standard-fields.d.ts.map +1 -1
  432. package/dist/okf-standard-fields.js +24 -14
  433. package/dist/okf-standard-fields.js.map +1 -1
  434. package/dist/okf-timestamps.d.ts +2 -2
  435. package/dist/okf-timestamps.d.ts.map +1 -1
  436. package/dist/okf-timestamps.js +25 -15
  437. package/dist/okf-timestamps.js.map +1 -1
  438. package/dist/page.d.ts +3 -7
  439. package/dist/page.d.ts.map +1 -1
  440. package/dist/page.js +3 -7
  441. package/dist/page.js.map +1 -1
  442. package/dist/path-fold.d.ts +67 -0
  443. package/dist/path-fold.d.ts.map +1 -0
  444. package/dist/path-fold.js +107 -0
  445. package/dist/path-fold.js.map +1 -0
  446. package/dist/paths.d.ts +46 -0
  447. package/dist/paths.d.ts.map +1 -1
  448. package/dist/paths.js +114 -1
  449. package/dist/paths.js.map +1 -1
  450. package/dist/platform.d.ts +13 -0
  451. package/dist/platform.d.ts.map +1 -1
  452. package/dist/platform.js +16 -0
  453. package/dist/platform.js.map +1 -1
  454. package/dist/portable-export-contract.d.ts +17 -0
  455. package/dist/portable-export-contract.d.ts.map +1 -0
  456. package/dist/portable-export-contract.js +59 -0
  457. package/dist/portable-export-contract.js.map +1 -0
  458. package/dist/portable-export.d.ts +115 -0
  459. package/dist/portable-export.d.ts.map +1 -0
  460. package/dist/portable-export.js +452 -0
  461. package/dist/portable-export.js.map +1 -0
  462. package/dist/portable-frontmatter.d.ts +17 -0
  463. package/dist/portable-frontmatter.d.ts.map +1 -1
  464. package/dist/portable-frontmatter.js +42 -5
  465. package/dist/portable-frontmatter.js.map +1 -1
  466. package/dist/publication-filesystem.d.ts +1 -1
  467. package/dist/publication-filesystem.d.ts.map +1 -1
  468. package/dist/publication-filesystem.js +1 -1
  469. package/dist/publication-filesystem.js.map +1 -1
  470. package/dist/qualified-links.d.ts +67 -0
  471. package/dist/qualified-links.d.ts.map +1 -0
  472. package/dist/qualified-links.js +121 -0
  473. package/dist/qualified-links.js.map +1 -0
  474. package/dist/query-filter.d.ts +11 -4
  475. package/dist/query-filter.d.ts.map +1 -1
  476. package/dist/query-filter.js +25 -6
  477. package/dist/query-filter.js.map +1 -1
  478. package/dist/query-order.d.ts.map +1 -1
  479. package/dist/query-order.js +2 -1
  480. package/dist/query-order.js.map +1 -1
  481. package/dist/recipe-lifecycle/errors.d.ts +96 -0
  482. package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
  483. package/dist/recipe-lifecycle/errors.js +122 -0
  484. package/dist/recipe-lifecycle/errors.js.map +1 -0
  485. package/dist/recipe-lifecycle/evolution.d.ts +134 -0
  486. package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
  487. package/dist/recipe-lifecycle/evolution.js +1047 -0
  488. package/dist/recipe-lifecycle/evolution.js.map +1 -0
  489. package/dist/recipe-lifecycle/index.d.ts +38 -0
  490. package/dist/recipe-lifecycle/index.d.ts.map +1 -0
  491. package/dist/recipe-lifecycle/index.js +31 -0
  492. package/dist/recipe-lifecycle/index.js.map +1 -0
  493. package/dist/recipe-lifecycle/install.d.ts +172 -0
  494. package/dist/recipe-lifecycle/install.d.ts.map +1 -0
  495. package/dist/recipe-lifecycle/install.js +652 -0
  496. package/dist/recipe-lifecycle/install.js.map +1 -0
  497. package/dist/recipe-lifecycle/legacy-aliases.d.ts +4 -0
  498. package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
  499. package/dist/recipe-lifecycle/legacy-aliases.js +22 -0
  500. package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
  501. package/dist/recipe-lifecycle/retirement-apply.d.ts +59 -0
  502. package/dist/recipe-lifecycle/retirement-apply.d.ts.map +1 -0
  503. package/dist/recipe-lifecycle/retirement-apply.js +165 -0
  504. package/dist/recipe-lifecycle/retirement-apply.js.map +1 -0
  505. package/dist/recipe-lifecycle/retirement.d.ts +89 -0
  506. package/dist/recipe-lifecycle/retirement.d.ts.map +1 -0
  507. package/dist/recipe-lifecycle/retirement.js +347 -0
  508. package/dist/recipe-lifecycle/retirement.js.map +1 -0
  509. package/dist/recipe-lifecycle/set-commit.d.ts +31 -0
  510. package/dist/recipe-lifecycle/set-commit.d.ts.map +1 -0
  511. package/dist/recipe-lifecycle/set-commit.js +37 -0
  512. package/dist/recipe-lifecycle/set-commit.js.map +1 -0
  513. package/dist/recipe-lifecycle/stamp.d.ts +146 -0
  514. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
  515. package/dist/recipe-lifecycle/stamp.js +361 -0
  516. package/dist/recipe-lifecycle/stamp.js.map +1 -0
  517. package/dist/recipe-qualify.d.ts +80 -0
  518. package/dist/recipe-qualify.d.ts.map +1 -0
  519. package/dist/recipe-qualify.js +352 -0
  520. package/dist/recipe-qualify.js.map +1 -0
  521. package/dist/recipe-set-preflight.d.ts +139 -0
  522. package/dist/recipe-set-preflight.d.ts.map +1 -0
  523. package/dist/recipe-set-preflight.js +536 -0
  524. package/dist/recipe-set-preflight.js.map +1 -0
  525. package/dist/recipe-sources.d.ts +209 -0
  526. package/dist/recipe-sources.d.ts.map +1 -0
  527. package/dist/recipe-sources.js +607 -0
  528. package/dist/recipe-sources.js.map +1 -0
  529. package/dist/recipes.d.ts +45 -1
  530. package/dist/recipes.d.ts.map +1 -1
  531. package/dist/recipes.js +138 -1
  532. package/dist/recipes.js.map +1 -1
  533. package/dist/record-overlay/apply.d.ts +45 -0
  534. package/dist/record-overlay/apply.d.ts.map +1 -0
  535. package/dist/record-overlay/apply.js +535 -0
  536. package/dist/record-overlay/apply.js.map +1 -0
  537. package/dist/record-overlay/canonical.d.ts +22 -0
  538. package/dist/record-overlay/canonical.d.ts.map +1 -0
  539. package/dist/record-overlay/canonical.js +47 -0
  540. package/dist/record-overlay/canonical.js.map +1 -0
  541. package/dist/record-overlay/digest.d.ts +4 -0
  542. package/dist/record-overlay/digest.d.ts.map +1 -0
  543. package/dist/record-overlay/digest.js +11 -0
  544. package/dist/record-overlay/digest.js.map +1 -0
  545. package/dist/record-overlay/errors.d.ts +44 -0
  546. package/dist/record-overlay/errors.d.ts.map +1 -0
  547. package/dist/record-overlay/errors.js +55 -0
  548. package/dist/record-overlay/errors.js.map +1 -0
  549. package/dist/record-overlay/findings.d.ts +5 -0
  550. package/dist/record-overlay/findings.d.ts.map +1 -0
  551. package/dist/record-overlay/findings.js +86 -0
  552. package/dist/record-overlay/findings.js.map +1 -0
  553. package/dist/record-overlay/index.d.ts +23 -0
  554. package/dist/record-overlay/index.d.ts.map +1 -0
  555. package/dist/record-overlay/index.js +21 -0
  556. package/dist/record-overlay/index.js.map +1 -0
  557. package/dist/record-overlay/plan.d.ts +12 -0
  558. package/dist/record-overlay/plan.d.ts.map +1 -0
  559. package/dist/record-overlay/plan.js +285 -0
  560. package/dist/record-overlay/plan.js.map +1 -0
  561. package/dist/record-overlay/policy.d.ts +77 -0
  562. package/dist/record-overlay/policy.d.ts.map +1 -0
  563. package/dist/record-overlay/policy.js +238 -0
  564. package/dist/record-overlay/policy.js.map +1 -0
  565. package/dist/record-overlay/redact.d.ts +3 -0
  566. package/dist/record-overlay/redact.d.ts.map +1 -0
  567. package/dist/record-overlay/redact.js +27 -0
  568. package/dist/record-overlay/redact.js.map +1 -0
  569. package/dist/record-overlay/signal-kind.d.ts +30 -0
  570. package/dist/record-overlay/signal-kind.d.ts.map +1 -0
  571. package/dist/record-overlay/signal-kind.js +38 -0
  572. package/dist/record-overlay/signal-kind.js.map +1 -0
  573. package/dist/record-overlay/signal-text.d.ts +52 -0
  574. package/dist/record-overlay/signal-text.d.ts.map +1 -0
  575. package/dist/record-overlay/signal-text.js +126 -0
  576. package/dist/record-overlay/signal-text.js.map +1 -0
  577. package/dist/record-overlay/source-index.d.ts +21 -0
  578. package/dist/record-overlay/source-index.d.ts.map +1 -0
  579. package/dist/record-overlay/source-index.js +109 -0
  580. package/dist/record-overlay/source-index.js.map +1 -0
  581. package/dist/record-overlay/types.d.ts +293 -0
  582. package/dist/record-overlay/types.d.ts.map +1 -0
  583. package/dist/record-overlay/types.js +2 -0
  584. package/dist/record-overlay/types.js.map +1 -0
  585. package/dist/relationships.d.ts +71 -0
  586. package/dist/relationships.d.ts.map +1 -0
  587. package/dist/relationships.js +87 -0
  588. package/dist/relationships.js.map +1 -0
  589. package/dist/remote-backend.d.ts +11 -21
  590. package/dist/remote-backend.d.ts.map +1 -1
  591. package/dist/remote-backend.js +20 -15
  592. package/dist/remote-backend.js.map +1 -1
  593. package/dist/remote-document-codec.d.ts +2 -1
  594. package/dist/remote-document-codec.d.ts.map +1 -1
  595. package/dist/remote-document-codec.js +3 -2
  596. package/dist/remote-document-codec.js.map +1 -1
  597. package/dist/remote-operations.d.ts +0 -41
  598. package/dist/remote-operations.d.ts.map +1 -1
  599. package/dist/remote-operations.js +14 -2
  600. package/dist/remote-operations.js.map +1 -1
  601. package/dist/remote-parsers.d.ts +19 -0
  602. package/dist/remote-parsers.d.ts.map +1 -1
  603. package/dist/remote-parsers.js.map +1 -1
  604. package/dist/remote.d.ts +2 -4
  605. package/dist/remote.d.ts.map +1 -1
  606. package/dist/remote.js +2 -3
  607. package/dist/remote.js.map +1 -1
  608. package/dist/reserved-write.d.ts +9 -0
  609. package/dist/reserved-write.d.ts.map +1 -0
  610. package/dist/reserved-write.js +15 -0
  611. package/dist/reserved-write.js.map +1 -0
  612. package/dist/search/backend-source.d.ts +6 -0
  613. package/dist/search/backend-source.d.ts.map +1 -0
  614. package/dist/search/backend-source.js +57 -0
  615. package/dist/search/backend-source.js.map +1 -0
  616. package/dist/search/contract.d.ts +162 -0
  617. package/dist/search/contract.d.ts.map +1 -0
  618. package/dist/search/contract.js +82 -0
  619. package/dist/search/contract.js.map +1 -0
  620. package/dist/search/errors.d.ts +30 -0
  621. package/dist/search/errors.d.ts.map +1 -0
  622. package/dist/search/errors.js +50 -0
  623. package/dist/search/errors.js.map +1 -0
  624. package/dist/search/identity.d.ts +12 -0
  625. package/dist/search/identity.d.ts.map +1 -0
  626. package/dist/search/identity.js +90 -0
  627. package/dist/search/identity.js.map +1 -0
  628. package/dist/search/index.d.ts +16 -0
  629. package/dist/search/index.d.ts.map +1 -0
  630. package/dist/search/index.js +15 -0
  631. package/dist/search/index.js.map +1 -0
  632. package/dist/search/memory-source.d.ts +36 -0
  633. package/dist/search/memory-source.d.ts.map +1 -0
  634. package/dist/search/memory-source.js +238 -0
  635. package/dist/search/memory-source.js.map +1 -0
  636. package/dist/search/rank.d.ts +29 -0
  637. package/dist/search/rank.d.ts.map +1 -0
  638. package/dist/search/rank.js +132 -0
  639. package/dist/search/rank.js.map +1 -0
  640. package/dist/search/row-text.d.ts +38 -0
  641. package/dist/search/row-text.d.ts.map +1 -0
  642. package/dist/search/row-text.js +88 -0
  643. package/dist/search/row-text.js.map +1 -0
  644. package/dist/search/search.d.ts +28 -0
  645. package/dist/search/search.d.ts.map +1 -0
  646. package/dist/search/search.js +265 -0
  647. package/dist/search/search.js.map +1 -0
  648. package/dist/search/source.d.ts +70 -0
  649. package/dist/search/source.d.ts.map +1 -0
  650. package/dist/search/source.js +2 -0
  651. package/dist/search/source.js.map +1 -0
  652. package/dist/search/text.d.ts +49 -0
  653. package/dist/search/text.d.ts.map +1 -0
  654. package/dist/search/text.js +165 -0
  655. package/dist/search/text.js.map +1 -0
  656. package/dist/search-index.d.ts +9 -0
  657. package/dist/search-index.d.ts.map +1 -0
  658. package/dist/search-index.js +9 -0
  659. package/dist/search-index.js.map +1 -0
  660. package/dist/sha256.d.ts.map +1 -1
  661. package/dist/sha256.js +3 -2
  662. package/dist/sha256.js.map +1 -1
  663. package/dist/site-capabilities.d.ts +345 -0
  664. package/dist/site-capabilities.d.ts.map +1 -0
  665. package/dist/site-capabilities.js +724 -0
  666. package/dist/site-capabilities.js.map +1 -0
  667. package/dist/site-manifest.d.ts +51 -0
  668. package/dist/site-manifest.d.ts.map +1 -0
  669. package/dist/site-manifest.js +115 -0
  670. package/dist/site-manifest.js.map +1 -0
  671. package/dist/skip-reasons.d.ts +12 -0
  672. package/dist/skip-reasons.d.ts.map +1 -0
  673. package/dist/skip-reasons.js +15 -0
  674. package/dist/skip-reasons.js.map +1 -0
  675. package/dist/source-engine/driver.d.ts +40 -0
  676. package/dist/source-engine/driver.d.ts.map +1 -0
  677. package/dist/source-engine/driver.js +513 -0
  678. package/dist/source-engine/driver.js.map +1 -0
  679. package/dist/source-engine/evidence.d.ts +39 -0
  680. package/dist/source-engine/evidence.d.ts.map +1 -0
  681. package/dist/source-engine/evidence.js +54 -0
  682. package/dist/source-engine/evidence.js.map +1 -0
  683. package/dist/source-engine/guard.d.ts +87 -0
  684. package/dist/source-engine/guard.d.ts.map +1 -0
  685. package/dist/source-engine/guard.js +427 -0
  686. package/dist/source-engine/guard.js.map +1 -0
  687. package/dist/source-engine/index.d.ts +35 -0
  688. package/dist/source-engine/index.d.ts.map +1 -0
  689. package/dist/source-engine/index.js +27 -0
  690. package/dist/source-engine/index.js.map +1 -0
  691. package/dist/source-engine/machine-state.d.ts +87 -0
  692. package/dist/source-engine/machine-state.d.ts.map +1 -0
  693. package/dist/source-engine/machine-state.js +94 -0
  694. package/dist/source-engine/machine-state.js.map +1 -0
  695. package/dist/source-engine/observe.d.ts +10 -0
  696. package/dist/source-engine/observe.d.ts.map +1 -0
  697. package/dist/source-engine/observe.js +276 -0
  698. package/dist/source-engine/observe.js.map +1 -0
  699. package/dist/source-engine/overlay.d.ts +50 -0
  700. package/dist/source-engine/overlay.d.ts.map +1 -0
  701. package/dist/source-engine/overlay.js +114 -0
  702. package/dist/source-engine/overlay.js.map +1 -0
  703. package/dist/source-engine/robots.d.ts +53 -0
  704. package/dist/source-engine/robots.d.ts.map +1 -0
  705. package/dist/source-engine/robots.js +158 -0
  706. package/dist/source-engine/robots.js.map +1 -0
  707. package/dist/source-engine/snapshot.d.ts +105 -0
  708. package/dist/source-engine/snapshot.d.ts.map +1 -0
  709. package/dist/source-engine/snapshot.js +240 -0
  710. package/dist/source-engine/snapshot.js.map +1 -0
  711. package/dist/source-engine/target-consumer.d.ts +12 -0
  712. package/dist/source-engine/target-consumer.d.ts.map +1 -0
  713. package/dist/source-engine/target-consumer.js +15 -0
  714. package/dist/source-engine/target-consumer.js.map +1 -0
  715. package/dist/source-engine/target-descriptor.d.ts +3 -0
  716. package/dist/source-engine/target-descriptor.d.ts.map +1 -0
  717. package/dist/source-engine/target-descriptor.js +26 -0
  718. package/dist/source-engine/target-descriptor.js.map +1 -0
  719. package/dist/source-engine/target.d.ts +82 -0
  720. package/dist/source-engine/target.d.ts.map +1 -0
  721. package/dist/source-engine/target.js +213 -0
  722. package/dist/source-engine/target.js.map +1 -0
  723. package/dist/source-engine/types.d.ts +296 -0
  724. package/dist/source-engine/types.d.ts.map +1 -0
  725. package/dist/source-engine/types.js +2 -0
  726. package/dist/source-engine/types.js.map +1 -0
  727. package/dist/source-harness/conformance.d.ts +16 -0
  728. package/dist/source-harness/conformance.d.ts.map +1 -0
  729. package/dist/source-harness/conformance.js +266 -0
  730. package/dist/source-harness/conformance.js.map +1 -0
  731. package/dist/source-harness/fixture.d.ts +97 -0
  732. package/dist/source-harness/fixture.d.ts.map +1 -0
  733. package/dist/source-harness/fixture.js +276 -0
  734. package/dist/source-harness/fixture.js.map +1 -0
  735. package/dist/source-harness/index.d.ts +22 -0
  736. package/dist/source-harness/index.d.ts.map +1 -0
  737. package/dist/source-harness/index.js +19 -0
  738. package/dist/source-harness/index.js.map +1 -0
  739. package/dist/source-harness/peer.d.ts +74 -0
  740. package/dist/source-harness/peer.d.ts.map +1 -0
  741. package/dist/source-harness/peer.js +106 -0
  742. package/dist/source-harness/peer.js.map +1 -0
  743. package/dist/source-profiles/index.d.ts +31 -0
  744. package/dist/source-profiles/index.d.ts.map +1 -0
  745. package/dist/source-profiles/index.js +206 -0
  746. package/dist/source-profiles/index.js.map +1 -0
  747. package/dist/source-profiles/link-header.d.ts +6 -0
  748. package/dist/source-profiles/link-header.d.ts.map +1 -0
  749. package/dist/source-profiles/link-header.js +131 -0
  750. package/dist/source-profiles/link-header.js.map +1 -0
  751. package/dist/storage-harness/contract.d.ts +109 -0
  752. package/dist/storage-harness/contract.d.ts.map +1 -0
  753. package/dist/storage-harness/contract.js +853 -0
  754. package/dist/storage-harness/contract.js.map +1 -0
  755. package/dist/storage-harness/index.d.ts +39 -0
  756. package/dist/storage-harness/index.d.ts.map +1 -0
  757. package/dist/storage-harness/index.js +55 -0
  758. package/dist/storage-harness/index.js.map +1 -0
  759. package/dist/storage.d.ts +10 -2
  760. package/dist/storage.d.ts.map +1 -1
  761. package/dist/storage.js +10 -2
  762. package/dist/storage.js.map +1 -1
  763. package/dist/string-identity-agreement.d.ts +35 -0
  764. package/dist/string-identity-agreement.d.ts.map +1 -0
  765. package/dist/string-identity-agreement.js +78 -0
  766. package/dist/string-identity-agreement.js.map +1 -0
  767. package/dist/system-documents.d.ts +82 -0
  768. package/dist/system-documents.d.ts.map +1 -0
  769. package/dist/system-documents.js +127 -0
  770. package/dist/system-documents.js.map +1 -0
  771. package/dist/types.d.ts +28 -4
  772. package/dist/types.d.ts.map +1 -1
  773. package/dist/types.js +0 -10
  774. package/dist/types.js.map +1 -1
  775. package/dist/uncertain-write.d.ts +119 -6
  776. package/dist/uncertain-write.d.ts.map +1 -1
  777. package/dist/uncertain-write.js +67 -32
  778. package/dist/uncertain-write.js.map +1 -1
  779. package/dist/validation.d.ts +5 -0
  780. package/dist/validation.d.ts.map +1 -1
  781. package/dist/verification.d.ts +22 -10
  782. package/dist/verification.d.ts.map +1 -1
  783. package/dist/verification.js +87 -39
  784. package/dist/verification.js.map +1 -1
  785. package/dist/view-launch-contract.d.ts +14 -0
  786. package/dist/view-launch-contract.d.ts.map +1 -0
  787. package/dist/view-launch-contract.js +23 -0
  788. package/dist/view-launch-contract.js.map +1 -0
  789. package/dist/write-identity.d.ts +5 -0
  790. package/dist/write-identity.d.ts.map +1 -0
  791. package/dist/write-identity.js +9 -0
  792. package/dist/write-identity.js.map +1 -0
  793. package/package.json +184 -10
package/README.md CHANGED
@@ -4,8 +4,116 @@ The Superbee knowledge engine reads and writes Open Knowledge Format bundles, wi
4
4
  writes, cross-links and storage backends. It is a library; installing it does not install the
5
5
  `superbee` executable.
6
6
 
7
- Core and `@superbee/server` are released together, independently of the `superbee` CLI. A CLI
8
- release bundles the engine source selected at build time; it does not load `@superbee/core@latest`.
7
+ **Do I need this?** Install it only to read or write bundles from your own Node, browser or
8
+ Worker code. To use Superbee itself, install the CLI instead: `npm install -g superbee`. The CLI
9
+ bundles the engine it was built with; it does not load an installed `@superbee/core`. Every
10
+ Superbee package shares one version number.
11
+
12
+ Browser and Worker consumers can compose existing operation helpers through
13
+ `@superbee/core/bundle-ops` (including the `Bundle` type), `@superbee/core/kinds`
14
+ (including `ValidationWarning`), `@superbee/core/kinds-load`,
15
+ `@superbee/core/document-field-actions`, and `@superbee/core/okf-actor` (including the shared
16
+ `OkfActorError`). `@superbee/core/okf-authoring` owns the supported authoring versions, default
17
+ version, and resolver; the Node root retains the same exports. Supply an explicit backend to
18
+ bundle-shaped operations in browser hosts.
19
+
20
+ ## Identity ordering
21
+
22
+ Engine list/query/head and edge results, View identity lists, and new publication captures use
23
+ Core's UTF-16 code-unit comparator. This corrects the earlier local locale-dependent order and
24
+ can change capped query results and fresh publication snapshot digests. Existing publication
25
+ snapshots retain their serialized bytes and identities. See the [ordering compatibility note](../publication/ORDERING.md)
26
+ for cursor, envelope and snapshot-version compatibility.
27
+
28
+ ## Outbound relationship compatibility
29
+
30
+ `localEdgeViolation` and `qualifiedEdgeViolation` apply only the declaration whose
31
+ `governs` exactly matches the source document's type. They return `null` when that
32
+ source Kind does not declare the label, even if another Kind does. This replaces
33
+ the previous fallback to another Kind's declaration. Matching-source target and
34
+ cross-bundle alias checks remain in effect; inbound expectations are unchanged.
35
+
36
+ Consumers upgrading to a Core release containing this change, including hosted
37
+ consumers, should expect unrelated-source relationship warnings to disappear.
38
+ Write findings, bundle health and recipe evolution use the same source-scoped
39
+ rule. No record migration is required, and a lower warning count does not indicate
40
+ that stored relationships were edited.
41
+
42
+ ## Kind declaration changes
43
+
44
+ `@superbee/core/kind-changes` exports `classifyKindChanges(current, desired)` over parsed
45
+ `KindConvention` values. It reports required/enum/section, relationship, field-type and terminal
46
+ changes without deciding whether to approve them. Arrays preserve declaration occurrence order;
47
+ terminal flags distinguish ordered values from occurrence counts. The helper never mutates inputs.
48
+ Recipe ownership, additive merge, instance/edge proofs and host representation bounds remain the
49
+ caller's policy. These facts do not establish general document equality or authorize a write.
50
+
51
+ ## Stored document decoding
52
+
53
+ `@superbee/core/document-codec` exports `parseMarkdown(raw, context, options)` and
54
+ `parseFrontmatter(yaml, context, options)` with the shared `ParseDocumentOptions` type.
55
+ Use `{ preserveTimestamp: true }` when reading stored values: the legacy top-level `timestamp`
56
+ keeps its parsed number or original string, independently of the bundle edition. The default
57
+ and explicit v0.1 behavior still normalize that field; v0.2 preserves it as before. Neither
58
+ option changes body splitting or attributed `MalformedDocumentError` identity.
59
+
60
+ This preserves parsed values, not YAML formatting or original document bytes after serialization.
61
+ Backends remain responsible for retaining raw bytes and deriving their revision tokens.
62
+
63
+ ## Frontmatter limits
64
+
65
+ Every YAML load in Core goes through one bounded loader, `loadBoundedYaml`, and every frontmatter
66
+ write is checked against the same limits. `FRONTMATTER_LIMITS` is the source of the values:
67
+ `sourceChars` (262,144 characters), `depth` (32), `aliases` (1,000), `expandedNodes` (100,000) and
68
+ `expandedChars` (1,048,576 characters).
69
+
70
+ - Reading stored frontmatter that cannot be accepted throws `MalformedDocumentError`. Its `code` is
71
+ `FRONTMATTER_MALFORMED` for invalid YAML, or `FRONTMATTER_TOO_LARGE`, `FRONTMATTER_TOO_DEEP`,
72
+ `FRONTMATTER_ALIAS_LIMIT` or `FRONTMATTER_CYCLE` for a limit.
73
+ - Serializing or writing frontmatter the reader would refuse throws `FrontmatterRefusedError` with
74
+ the same `code`, and nothing is stored. `assertStorableFrontmatter` from
75
+ `@superbee/core/document-codec` runs that check on raw document text.
76
+ - Lenient scans skip the document and report it; see Bundle health. Direct calls throw.
77
+
78
+ ## Document transfer
79
+
80
+ `planDocumentTransfer`, `applyDocumentTransfer` and `resumeDocumentTransfer` copy selected documents
81
+ from a bound bundle into a local bundle or Git board, with new ids, rewritten links, a `sources`
82
+ entry on each and one Promotion record. `planDocumentRefresh` and `applyDocumentRefresh` update those
83
+ copies from their sources. A plan only reads. Applying takes the plan's token, recomputes the plan
84
+ from fresh reads, and throws `TransferPlanChanged` if it differs. `TransferConflictError`,
85
+ `TransferInterrupted` and `TransferResumeConflict` are the other typed refusals. A transfer's writes
86
+ are create-only; a refresh replaces a copy only at the version its plan saw. Only people's documents
87
+ transfer (`sectionOf` answers `documents`): a selected record of Superbee's own stays behind and is
88
+ counted in `left_behind`. A target is refused under `conventions/` or a folder that holds only
89
+ Superbee's own files (`recipes/`, `_superbee/`), and when the copy's type would make it Superbee's
90
+ own record at its new id; a person's document in, say, `references/` still copies.
91
+
92
+ ## Bundle sections
93
+
94
+ A bundle holds people's documents and Superbee's own records side by side. `sectionOf({ id,
95
+ frontmatter })` puts every document in exactly one section: `documents`, `conventions` (Kind
96
+ declarations and the authoring references recipes install), `views` (View registrations) or
97
+ `superbee` (Superbee's other records). `OWNED_LOCATIONS`, exported from `@superbee/core` and
98
+ `@superbee/core/system-documents`, is the one list behind it, as plain data: each entry names an
99
+ exact id or a folder prefix, the marker type the record must carry there and its section. A record
100
+ is Superbee's only at its location and under its marker (`docs/bundle` of another type, or a
101
+ non-Convention under `conventions/`, is a person's document); a View type claims the `views` section
102
+ anywhere. Anything no entry claims is a document. Another runtime can render the entries, for
103
+ example as a database filter, and test that it agrees with `sectionOf`. Two comparison rules must
104
+ be reproduced exactly:
105
+
106
+ - `sectionOf` compares ids and types exactly and case-sensitively: an id equals an entry's `id` or
107
+ starts with its `prefix`, and `type` equals the marker with no trimming.
108
+ - Document transfer targets and blob roots (`OWNED_BLOB_ROOTS`, `isOrdinaryBlobKey`) compare under
109
+ `foldPath`, as a case-insensitive or normalizing file system would, so `Sites/logo.png` is
110
+ refused like `sites/logo.png`.
111
+
112
+ **Reserved root.** The locations listed today are grandfathered and stay where they are. Any new kind
113
+ of Superbee-owned data lives under `_superbee/` (`SUPERBEE_RESERVED_ROOT_PREFIX`), which one entry
114
+ already covers; nothing lives there yet. People should not keep their own documents there. A core
115
+ test fails when an exported location or marker constant is not covered by an entry, and when an
116
+ entry outside `_superbee/` is not one of the grandfathered locations.
9
117
 
10
118
  ## Document presentation values
11
119
 
@@ -13,6 +121,48 @@ The additive `@superbee/core/artifact-contract` subpath provides pure v1 documen
13
121
  observation, request, receipt and capability decoders. See the [contract reference](https://github.com/Holaxis-ai/superbee/blob/main/packages/core/ARTIFACT-CONTRACT.md)
14
122
  for identity, provenance, lifecycle and host responsibilities.
15
123
 
124
+ ## Site capabilities
125
+
126
+ The additive `@superbee/core/site-capabilities` subpath is the contract for read-only tools a
127
+ site or a recipe pack provides (`SiteCapability`), and the one owner of their composition rules:
128
+ `composeSiteCapabilities` refuses duplicate names, `superbee_` names outside the generic tier and
129
+ names outside a pack's or site's namespace, orders generic, pack and site tools deterministically,
130
+ applies a surface's exclusions after those checks, enforces size limits and, with
131
+ `requireReadOnly`, refuses any capability not declared read-only. It returns frozen snapshots and
132
+ an identity digest for the surface's list. `toProviderTool`, `toPortalAdditionalTool`,
133
+ `toToolDescriptor` and `siteCapabilityFromPortalTool` are the explicit mappings to the existing
134
+ tool shapes. `checkSiteCapability` and `siteCapabilityConformanceCases` test a capability against
135
+ recorded fixtures (read-only declaration, dated results, closed error codes that never echo input,
136
+ bounded and deterministic output, same-origin URLs, citations of records the result contains, and
137
+ refusal of unknown arguments). `siteRecordSource` mints a `site-record` citation only for a path
138
+ the host admits, bound to the publication's digests.
139
+
140
+ Annotations such as `readOnlyHint` and `untrustedContentHint` are self-declared and enforce
141
+ nothing at runtime; the checks above test recorded fixtures, not the code. Treat them as a control
142
+ only for in-process code from the same reviewed deploy. The module has no Node built-in import, so
143
+ it runs unchanged in a Worker or a browser.
144
+
145
+ ## Mutation attribution and local history
146
+
147
+ `mutateDocument` takes `expectedVersion` only in `patch` and `replace-document` modes. Create-only
148
+ and overwrite modes reject a supplied value instead of ignoring it.
149
+
150
+ `mutateDocument` and `prepareDocumentMutationCandidate` persist a supplied `actor` by default:
151
+ `actor` in OKF v0.1, `superbee_updated_by` in v0.2 (plus `actor` when the Kind requires it).
152
+ Use `persistActor: false` to keep candidate attribution unchanged, or `persistActor: true` to apply
153
+ the attribution policy even without a supplied actor. Supplying the actor option alone leaves an
154
+ otherwise unchanged candidate a no-op, preserving its original attribution and bytes. In v0.1,
155
+ deliberate edits to the candidate's legacy `actor` field still count as authored changes in `patch`
156
+ and `replace-document` modes; overwrite retains its automatic attribution comparison. The pure preview
157
+ prepares patches. This default changes library writes that previously
158
+ required `persistActor: true`; callers needing the old opt-in behavior can explicitly pass false.
159
+
160
+ `producer` controls `generated.by` independently of the version mutator. Local filesystem history
161
+ returns only the current revision, including for Git-tracked bundles. It reads mutation attribution
162
+ from `superbee_updated_by`, legacy `updated_by`, or `actor`; when absent it returns the stable string
163
+ `unattributed`. It does not infer an identity from the reader's environment or the content producer.
164
+ History-keeping backends retain their existing per-write attribution.
165
+
16
166
  ## Filesystem platform migration
17
167
 
18
168
  The Windows extraction changes the default Node.js filesystem backend. Its built-in host policy
@@ -33,10 +183,9 @@ The package has no npm `os` restriction: storage contracts and non-filesystem ba
33
183
  available independently of the default filesystem policy. Choose a backend and imports appropriate
34
184
  to your runtime; installing the library alone does not establish native filesystem support.
35
185
 
36
- There is no Windows adapter on npm to install. The experimental first-party adapters are built
37
- from source in a separate repository, https://github.com/Holaxis-ai/superbee-windows-cli.
38
- Supplying a policy is an integration contract for an adapter owner, not a promise that arbitrary
39
- policies make Windows supported.
186
+ The standard `superbee` executable supplies its own experimental Windows filesystem policy for
187
+ local projects and standalone Git boards. Library consumers on Windows supply an explicit policy.
188
+ [Native Windows instructions](../superbee/README.md#native-windows-local-projects)
40
189
 
41
190
  ## Keep the backend returned by initBundle
42
191
 
@@ -85,6 +234,943 @@ cleanup. Policies are structural snapshots: public data and methods are captured
85
234
  may continue to observe live operating-system facts. Do not use opaque private fields or methods
86
235
  pre-bound to a mutable receiver.
87
236
 
237
+ ## Recipe lifecycle
238
+
239
+ `@superbee/core/recipe-lifecycle` installs and evolves a parsed recipe on any bundle. The caller
240
+ acquires the recipe (`parseRecipeFiles` from `@superbee/core/recipes` turns files into a
241
+ `LoadedRecipe`) and presents the results; the `superbee` CLI is one such caller. It uses no Node
242
+ globals or builtins, so it runs in Node, a browser or a Worker over any storage backend.
243
+
244
+ ```ts
245
+ import { MemoryBackend } from "@superbee/core/memory-backend";
246
+ import { parseRecipeFiles } from "@superbee/core/recipes";
247
+ import { applyRecipeEvolution, installRecipe, planRecipeEvolution } from "@superbee/core/recipe-lifecycle";
248
+
249
+ const bundle = { root: "memory://glossary", backend: new MemoryBackend() };
250
+ const v1 = parseRecipeFiles(glossaryV1Files, "memory:glossary@1");
251
+ if (!v1.ok) throw new Error(v1.error.message);
252
+ await installRecipe(bundle, v1.recipe);
253
+
254
+ const v2 = parseRecipeFiles(glossaryV2Files, "memory:glossary@2");
255
+ if (!v2.ok) throw new Error(v2.error.message);
256
+ const plan = await planRecipeEvolution(bundle, v2.recipe);
257
+ if (plan.ready && plan.writes > 0) {
258
+ await applyRecipeEvolution(bundle, v2.recipe, plan.plan_token, { actor: "process:glossary-sync" });
259
+ }
260
+ ```
261
+
262
+ `prepareRecipeInstall(recipe, { okfVersion, now })` prepares those same edition-specific candidates
263
+ without a backend or target reads. Retain the explicit `now` across preview and replay; v0.1 uses
264
+ it for the existing install timestamp, while v0.2 adds no legacy clock. The returned `identity`
265
+ contains the source digest taken before materialization; Convention, Connector and Reference
266
+ candidates already carry their recipe stamps. Preparation does not mutate the parsed source.
267
+
268
+ `inspectRecipeInstallTarget(existingOrNull, candidate, prepared)` separately reports existence,
269
+ source-content equality, recipe stamp identity and stamp integrity. For a matching installed
270
+ artifact, require `sameContent`, `stamp: "current"` and `stampIntegrity: "current"`; an identity match
271
+ alone does not establish readable digest rules or an intact definition stamp. Neither function
272
+ installs, adopts stamps, validates the target registry or grants write authority. An admitted host
273
+ can use the candidates with its existing canonical writer after its own coherent target and
274
+ compatibility checks; preparation is not an approved-preview transaction or a new apply API.
275
+
276
+ `installRecipe` is create-only: each convention, Connector, View pair and Reference is written with
277
+ an expect-absent compare-and-swap, an existing convention or Connector is left untouched (its row
278
+ reports `source_differs` when it differs from the recipe), and a differing View or Reference target
279
+ is refused before anything is written. Before any write it checks each Connector against the
280
+ authoring rules of the bundle's edition (`RecipeInputError` when OKF v0.2 would refuse it) and its
281
+ sources against the Kinds the bundle will hold (its conventions plus the recipe's own), throwing
282
+ `ConnectorTargetUnsatisfied` when one does not fit. `planRecipeEvolution` is read-only: it merges each recipe
283
+ convention into the installed one additively, rechecks existing instances, and returns blockers
284
+ and a `plan_token` bound to everything it read. `applyRecipeEvolution` recomputes the plan,
285
+ refuses a different token, and writes each changed convention at exactly the version the plan
286
+ saw. The bundle has no cross-document transaction, so a failure part way reports the definitions
287
+ written and those still pending. A Connector has no additive merge: the plan replaces it whole,
288
+ after the conventions, and only when this recipe's stamp holds and its definition digest shows
289
+ nobody changed it; an edited, unstamped-and-different or foreign Connector is a blocker and is
290
+ never written, stamp included.
291
+
292
+ Every convention and Connector either path writes carries an `x_recipe` stamp in the same write:
293
+ the recipe's id, version, declared convention count (`of`), `recipeSourceDigest` of the recipe,
294
+ the `definitionDigest` of the document as written, and the `digest_rules` version. A recipe that
295
+ carries connectors adds `connectors`, its declared Connector count, which readers that predate it
296
+ ignore; a recipe without connectors writes and digests exactly as before. A plan's `changed` is
297
+ about content only; its `writes` also counts definitions whose stamp is stale or missing, so a
298
+ ready plan with `writes > 0` has work to apply. `installedRecipes(docs, known?)` reads each
299
+ recipe's state (`installed`, `partial`, `diverged`, `unknown`) from the stamps alone, without the
300
+ recipe source; give it the conventions and the Connectors (`installedConventionDocs` and
301
+ `installedConnectorDocs`).
302
+
303
+ Failures are typed subclasses of `RecipeLifecycleError`: `RecipeInputError` (the recipe cannot
304
+ target this bundle's edition), `ConnectorTargetUnsatisfied` (`recipe`, `connector`, `source`,
305
+ `kind`, `code`, `fields`), `RecipeAssetConflict` (`recipe`, `key`), `RecipeEditionChanged`,
306
+ `RecipeEvolutionPlanChanged` (`expected`, `current`), `RecipeEvolutionBlocked` (`blockers`),
307
+ `RecipeEvolutionInterrupted` (`reason`, `completed`, `pending`, `cause`) and
308
+ `RecipeEvolutionPostcondition` (`reason`, `completed`).
309
+
310
+ Declaration deprecation uses the same Kind/mutation owners, with explicit-registry transition
311
+ refusal and separate informational read usage. See [the grammar and admission limits](RECIPES.md#deprecating-declarations).
312
+ Adding lifecycle policy requires unchanged same-recipe ownership. Declaration removal is still
313
+ unsupported; existing scan, per-definition CAS and postcondition do not establish atomic non-use.
314
+
315
+ ## Record overlay
316
+
317
+ `@superbee/core/record-overlay` is the write half of binding documents to external records. A
318
+ Source Feed policy names the fields a feed owns; the caller fetches and diffs its records and hands
319
+ the changes to the planner. It uses no Node globals or builtins, so it runs in Node, a browser or a
320
+ Worker over any storage backend.
321
+
322
+ ```ts
323
+ import { MemoryBackend } from "@superbee/core/memory-backend";
324
+ import { buildKindRegistry } from "@superbee/core/kinds";
325
+ import { applyRecordOverlay, buildSourceIndex, planRecordOverlay, readOverlayPolicy } from "@superbee/core/record-overlay";
326
+
327
+ const bundle = { root: "memory://guide", backend: new MemoryBackend() };
328
+ const registry = buildKindRegistry(conventionDocs);
329
+ const guide = { bundle, registry, okfVersion: "0.2" as const };
330
+ const policy = readOverlayPolicy(sourceFeedDoc, { targetKind: registry.kinds.get("Event") });
331
+ const overlays = await buildSourceIndex(bundle, { type: policy.target_kind });
332
+ const plan = await planRecordOverlay({ content: guide, ops: guide, policy, changes, observedAt, overlays });
333
+ const receipt = await applyRecordOverlay(plan, { content: guide, ops: guide, policy, actor: "process:calendar-sync", overlays });
334
+ ```
335
+
336
+ For each owned field the plan compares the last accepted feed value, the new feed value and the
337
+ document's value: a document that already says the new value is left alone, one that still says
338
+ the old value is written, and anything else is an `OVERLAY_DOC_CONFLICT` with a Signal, so an
339
+ editor's override is never overwritten. Each step carries the version it was planned against.
340
+ `applyRecordOverlay` writes every step through `mutateDocument` with a guard core builds itself and
341
+ runs on the fresh read: an owned-field write reaches documents of the policy's target Kind only,
342
+ may change only owned and derived fields, never the body, and needs the record's `sources`
343
+ identity; a Signal may be created only as a new, unclaimed document of the attention Kind under its
344
+ path, and updated only in a fixed set of fields plus one appended observation line. Signal writes
345
+ are bound to the provider of the policy the caller passes, never to a field of the plan, and an id
346
+ held by another provider's Signal is refused. A Signal's text must be the planner's rendering of
347
+ its own fields and the run (its observation line, links to the plan's feed and to documents, the
348
+ adoption hint): every plan the planner makes passes, and other text is a held `INVALID_INPUT` row,
349
+ so a mismatch is visible and planned again rather than dropped. Nothing of the
350
+ target Kind is created and nothing is deleted. A feed never owns its target's work state: the
351
+ progress storage fields and the target Kind's claim fields are refused like `status`. The
352
+ attention Kind (default `Signal`) must declare a claim owner and state field and the fields
353
+ `change_kind`, `observed_at`, `provider`, `external_id` and `diff_summary`.
354
+
355
+ Site rules are hooks with safe defaults: `textGate` (identity), `interval` (none, so a disappeared
356
+ record is always raised), `correlate`, `sourceProperties` (an upsert of the record's `sources`
357
+ entry in the same write, OKF v0.2 only), `assertCandidate` (site candidate checks after the core
358
+ guards) and `deriveFields` (fields such as `updated_at` written in the same version). Refusals are
359
+ receipt rows with a `REFUSAL_CODES` code; `RETRYABLE` and `HOLD_STORE` say which leave a record to be
360
+ planned again. A value core's write policy refuses (an OKF v0.2 field type, for example) is a held
361
+ `INVALID_INPUT` row, so one bad record never stops the rest of a run. A malformed plan (an unknown
362
+ step, a non-canonical target, written values that are not JSON data with finite numbers, prototype
363
+ keys, non-scalar or identity `sources` properties), actor or bundle edition throws `OverlayRefusal`
364
+ before any write, and so does a plan with owned-field steps whose policy names no declared target
365
+ Kind or whose owned or derived list names a field a feed can never own.
366
+
367
+ `SourceIndex` holds one head read for a whole run. It is bounded to that run: an edited or deleted
368
+ overlay is still caught at write time, but a second document given an identity during the run is
369
+ only refused as ambiguous on the next run.
370
+
371
+ ## Connectors
372
+
373
+ `@superbee/core/connectors` parses Connector declarations: `type: Connector` documents under
374
+ `connectors/` that say what an integration is, independent of any one target Kind. A declaration
375
+ holds no authority and nothing in the subpath fetches, executes or receives. It uses no Node globals
376
+ or builtins.
377
+
378
+ ```ts
379
+ import { bindSourceFeed, changeBetween, connectorPinDigest, findingsFor, mapRecord, parseConnectorDoc } from "@superbee/core/connectors";
380
+
381
+ const parsed = parseConnectorDoc(connectorDoc, { kinds: registry });
382
+ if (!parsed.ok) throw new Error(parsed.errors.map((e) => `${e.code} ${e.path}`).join("; "));
383
+ const pin = connectorPinDigest(parsed.connector);
384
+ const bound = bindSourceFeed(parsed.connector, sourceFeedDoc, registry, { okfVersion: "0.2" });
385
+ const mapped = mapRecord(bound.source, normalizedRecord, bound.kind);
386
+ if (mapped.kind === "mapped") {
387
+ const change = changeBetween(lastAcceptedAfter, mapped, { external_id: mapped.external_id, change_kind: "changed" });
388
+ }
389
+ const findings = findingsFor(mapped.diagnostics, { source: bound.source.name });
390
+ ```
391
+
392
+ `auth.kind` is `none`, `token`, `github-app`, `oauth2` or `signed-webhook`. A credential's hosts
393
+ come only from core: `token` and `oauth2` name a row of `AUTH_PROVIDERS`, `github-app` is fixed,
394
+ and `credentialHosts` is the one reader. `domains` lists hosts for keyless fetches and may not
395
+ repeat a credential host. The sources live under `record_sources` (OKF v0.2 reserves `sources` for
396
+ provenance, and `CONNECTOR_DOCUMENT_KEYS` lists every top-level key a Connector adds, none of them
397
+ an OKF field); the parsed `Connector.sources` holds them. Each source names a catalog `profile`, a
398
+ `target_kind`, mode `overlay`, an identity template (`identity.resource`, an https URL whose
399
+ placeholders are feed parameters, and `identity.id` over record paths), `completeness`, and
400
+ `fields`: target field to a dotted record
401
+ path, or to `{ from, values, unmapped }`. Mapping keys are the most a Source Feed may own; never-owned
402
+ fields, managed metadata, work state, the body and list-typed fields are refused. Actions and events
403
+ are declared shapes only. Every nested block is closed by `CONNECTOR_KEYS`; `parseConnectorDoc`
404
+ returns every refusal with a typed `code` and a JSON pointer `path`. A token shape or URL userinfo
405
+ anywhere in a frontmatter string, key or the body, or a credential key name outside the data-name
406
+ maps, refuses the document alone, naming a path and never the value; so does a YAML alias, which
407
+ keeps every reader bounded by the document's size. The secret rule is a tripwire; the pin, the
408
+ credential store and the fetcher are the boundaries.
409
+
410
+ `connectorPinDigest` covers every key `CONNECTOR_KEYS` accepts, with defaults filled and order-free
411
+ lists sorted, plus the credential hosts core resolves the auth kind to, so a host joining an
412
+ `AUTH_PROVIDERS` row changes the pin. It is blind to the title, description, version, body and
413
+ unknown top-level keys. `CONNECTOR_PIN_RULES` changes whenever a default or sort rule does.
414
+
415
+ `bindSourceFeed` binds a Source Feed (`connector`, `source`, `url`, `owned_fields`) to one source:
416
+ the `url` must equal the identity template rendered from parameters of `[A-Za-z0-9._~-]+` byte for
417
+ byte, `owned_fields` must be mapping keys, and the source's `target_kind`, `completeness` and
418
+ `profile` win. `okfVersion` is the content bundle's edition (absent means v0.1); a feed owning a
419
+ Kind-declared list field binds only on v0.2. Each refusal is an `OverlayRefusal` with
420
+ `POLICY_INVALID`, the feed and the key.
421
+ `mapRecord` never lets a mapping gap erase a stored value: an absent path is unobserved, an
422
+ unmapped native is kept (`unmapped: keep`, the default) or refuses the record while it still counts
423
+ as present (`refuse`), and only an empty value (`null` or blank text) clears an optional field; on a
424
+ required field or `title` it is kept with a finding. An id template separates its placeholders with
425
+ literal text, and a record whose value holds that text, is blank or makes an id past 2048
426
+ characters is refused as `IDENTITY_MISSING` or `IDENTITY_INVALID`, so two records never share one id. `changeBetween` takes the last accepted `after`, carries
427
+ unobserved fields and leaves them out of `changed_fields`. `findingsFor` groups diagnostics per
428
+ source, field, code and value (a list, mapping or empty value by its shape) for `planFindings`, so
429
+ one problem across many records raises one Signal.
430
+
431
+ A recipe carries Connectors through its manifest's `connectors:` list (`parseRecipeFiles` reads
432
+ each with `parseConnectorDoc`, checking the sources that target the recipe's own Kinds, and refuses
433
+ a malformed one as `RECIPE_CONNECTOR_INVALID`); `@superbee/core/recipe-lifecycle` installs, stamps
434
+ and evolves them as definitions.
435
+
436
+ The public [superbee-plugins recipes](https://github.com/Holaxis-ai/superbee-plugins/tree/main/recipes)
437
+ own the `Source Feed`, `Signal` and Work Item definitions used by the GitHub integration. The generic
438
+ engine and synthetic conformance fixtures remain in this package.
439
+
440
+ ## Source engine
441
+
442
+ `@superbee/core/source-engine` is the portable half of the integration source engine: the one
443
+ loop that observes a bound Source Feed for an author's test, a local run or a managed runner. It
444
+ uses no Node globals or builtins and never calls `fetch`; the caller supplies the network as a
445
+ `Transport`.
446
+
447
+ ```ts
448
+ import { MemoryMachineState, fetchIdentity, observeSource } from "@superbee/core/source-engine";
449
+
450
+ const receipt = await observeSource({
451
+ connector, bound, profile, spec, transport, state: new MemoryMachineState(),
452
+ identity: fetchIdentity("Product/1.0 (+https://example.org/about)")!,
453
+ mode: "incremental", signal: AbortSignal.timeout(60_000),
454
+ commit: async (page) => {
455
+ const plan = await planRecordOverlay({ content, ops, policy: bound.policy, changes: page.changes, observedAt: page.observed_at, records: page.records });
456
+ await applyRecordOverlay(plan, { content, ops, policy: bound.policy, actor: "process:calendar-sync" });
457
+ },
458
+ });
459
+ ```
460
+
461
+ A `SourceProfile` (`id`, `version`, `kind`, `validateSpec`, `hostsFor`, `observe`) turns a bound
462
+ feed, a cursor and a transport into pages of normalized records: `{ records, nextCursor, more,
463
+ complete }`, all JSON data. It never opens a socket, never sees a credential and never writes. A
464
+ `Transport` answers `{ url, method, headers, body, maxBytes, credentialHost, signal }`; it never
465
+ follows a redirect and returns `{ ok: false, refused: "too_large" }` rather than a truncated body.
466
+ A credential-injecting transport adds its credential only when the engine's `credentialHost` is
467
+ true and its own exact match agrees: https, the default port, a host exactly one of the auth
468
+ kind's credential hosts.
469
+
470
+ The profile sees the engine's guarded transport, which checks every URL and every redirect hop:
471
+ https only, the lexical address rule (`refusedAddress`: no IP literal, local name, port or
472
+ userinfo), and a host within the profile's `hostsFor` and the connector's credential hosts plus
473
+ keyless `domains`. A `hostsFor` naming any other host refuses the run before a request. A redirect
474
+ never changes host when either side is a credential host. Keyless hosts are read through robots.txt
475
+ (RFC 9309, the declared identity's product token, the first 512 KiB) first, and a bot-mitigation
476
+ page from one is refused and never retried. Only `GET` is sent unless `rules.post` admits a POST
477
+ toward a credential host; a keyless host is GET only. A GET with a body, a POST redirect, and the
478
+ headers `authorization`, `cookie`, `proxy-authorization`, `host`, `user-agent` and the method
479
+ overrides are always refused; beyond `accept` a header needs `rules.header`, and the validators
480
+ `if-none-match` and `if-modified-since` go out in incremental mode only. The budget counts every
481
+ request, robots.txt and hops included. Each request ends after `requestTimeoutMs` (default 20
482
+ seconds). The deadline is the caller's `signal`; without one the run ends after `deadlineMs`
483
+ (default 5 minutes). The deadline bounds the profile's page too: a page still pending is discarded
484
+ and the run ends `deferred`. A commit or state write in progress is never abandoned, so a hung one
485
+ holds the run. Statuses map to outcomes: 401 and 403 `credential_refused` (no retry), 404 and
486
+ 410 `not_found`, 429 `deferred` with `retry_after`, others `provider_unavailable` (503 included,
487
+ with a retry); `statuses` moves a status between the sets. Any refusal or error status stops the
488
+ run, even when the profile catches the error, and the guarded transport is closed when the run
489
+ ends.
490
+
491
+ A profile runs in the engine's realm. The guard bounds what a declaration and a provider's data can
492
+ reach; profile code itself is bounded by the repository's static egress check
493
+ (`scripts/source-egress-check.mjs`) and by review, until profiles run in an isolate. The check
494
+ refuses globals outside a short list, imports outside an allowlist or the scanned roots, writes to
495
+ anything reached from a global, the prototype, property-definition and descriptor names however
496
+ they are read, `this` outside a class body and CommonJS; a key computed at run time is beyond any
497
+ static check.
498
+
499
+ Each page is mapped with `mapRecord`, diffed against the stored records into `RecordChange` rows
500
+ and handed to `commit`; the cursor and the records are stored only after `commit` resolves. A page
501
+ that promises more with no cursor, or with a cursor the run already asked for, fails the run as
502
+ `cursor_stuck`. `commit` may decline to write changes: a `retry` change (a lost compare-and-swap, a
503
+ claimed Signal) stays pending in the machine state and is planned again at the start of every run,
504
+ before anything is fetched, until it is written, refused for good, or superseded by a newer
505
+ observation of the record (its listing, or its absence from a complete pass); a replay keeps the
506
+ record's missing count, and a record that disappeared is not replayed. A replay whose commit throws
507
+ stays pending with a finding while the run reads on, and is dropped with a finding after
508
+ `MAX_REPLAY_FAILURES` (5). A page that supersedes pending changes stores their removal before its
509
+ commit, so a crash after the commit never replays an older change. A `hold` change is not pending,
510
+ and its record is planned again when it is next observed. Either way the cursor moves on, so one
511
+ record never stops a feed. An incremental
512
+ run continues the stored cursor (`resumed` when the last run left its pass open); a complete run
513
+ lists from the start, sends no validator, and stops on a not-modified answer. A pass is a complete
514
+ observation only when it ran in complete mode to its last page within the run, the profile claimed
515
+ it complete and the source is declared `complete`; only then is a listed record's absence counted,
516
+ and a record is `disappeared` after the feed's `missing_threshold` (default 2) of them. A cursor
517
+ from another profile id or version is never handed back. The receipt names the outcome, every
518
+ request, the pass, the stored cursor, the held and pending counts, the mapping diagnostics and the
519
+ findings for `planFindings`. `MachineState` is the port for the stored state, written with a
520
+ compare-and-swap; `MemoryMachineState` keeps it in memory.
521
+
522
+ ## Source harness
523
+
524
+ `@superbee/core/source-harness` is how a profile and a transport prove the engine's rules offline.
525
+ It returns rows and problem lists rather than asserting, so any test runner can use it, and it uses
526
+ no Node globals or builtins.
527
+
528
+ ```ts
529
+ import { peerTransport, runSourceFixture, runTransportConformance } from "@superbee/core/source-harness";
530
+
531
+ const { problems, missing } = await runSourceFixture(fixture, scenarios);
532
+ const rows = await runTransportConformance({ name: "mine", create: (peer, credential) => myTransport(peer, credential) });
533
+ ```
534
+
535
+ `runSourceScenario` replays a scenario's scripted provider answers (`exchanges`, each used once,
536
+ matched on method and URL; a `hang` answer aborts the run's deadline) through `observeSource`,
537
+ writing each committed page through record-overlay over a MemoryBackend bundle built from the
538
+ fixture's documents, with editor edits between runs. `checkScenario` holds the result to the rule
539
+ of its required scenario (`REQUIRED_SCENARIOS`: provider errors, an incomplete page, cursor resume,
540
+ a hostile cursor refused by the guard, disappearance only from complete observations, owned-field conflicts, unmapped
541
+ and empty values, a missing identity, a cross-host redirect and an undeclared host), and fails any
542
+ request to an undeclared host or one the fixture did not script; a name may add a variant
543
+ (`cursor.resume.page-number`). `missingScenarios` lists what a fixture lacks.
544
+
545
+ `runTransportConformance` is the suite every transport passes against a `ScriptedPeer`, the
546
+ network that records exactly what arrived: the credential reaches its host under its own header
547
+ name (a custom `accessToken` included) and no other host, lookalikes included (a longer or
548
+ shorter name, a trailing dot, userinfo, another port), nor its own host when the engine's
549
+ `credentialHost` is false; a redirect is returned unfollowed, a body
550
+ over the bound is refused while one at the bound is returned whole, and behind the engine a
551
+ redirect to another host or a private address reaches nothing. `peerTransport` is a memory
552
+ transport that passes it.
553
+
554
+ ## Storage harness
555
+
556
+ `@superbee/core/storage-harness` is the contract every storage adapter passes: versions,
557
+ create-if-absent, conflicts, deletes, blobs, reserved files, history, identity and input refusals.
558
+ Core's own adapters run these same rows. It is Node-only: rows register through `node:test` and
559
+ assert with `node:assert`.
560
+
561
+ ```ts
562
+ import { EXACT_HOST, registerStorageContract } from "@superbee/core/storage-harness";
563
+
564
+ registerStorageContract({
565
+ name: "MyBackend",
566
+ create: async () => ({ backend: new MyBackend(), cleanup: async () => {} }),
567
+ localYamlValues: false, // frontmatter admits JSON values only
568
+ history: { retention: "retained" }, // or "current-only": versions() reports the current revision
569
+ host: EXACT_HOST, // the store does not key by filename
570
+ atomicCas: { createPeers }, // or { out: "why" }
571
+ queryHeads: { out: "not implemented" },
572
+ });
573
+ ```
574
+
575
+ Each capability is declared, never inferred. `atomicCas` and `queryHeads` take `{ out: reason }`
576
+ when the adapter lacks them; their rows still register, as skipped with `declared out: <reason>`,
577
+ so the gap shows in every run. History is declared by `retention`: an adapter with no history
578
+ declares `"current-only"` and its row checks that only the current revision is reported. An
579
+ adapter that attributes every write to the signed-in principal rather than the caller's
580
+ `WriteOptions.actor` declares `history.actor: { principal }`, and the retained-history row then
581
+ expects that principal on every revision. Blobs
582
+ and reserved files cannot be declared out, since `StorageBackend` requires them and the base rows
583
+ use them. Pass `test` to register rows another way: a wrapper over `node:test` can mark a known
584
+ failing row `todo` with a pointer to its tracking issue. The `register*Contract` functions behind
585
+ `registerStorageContract` stay exported for a suite that needs one group.
586
+
587
+ ## Bundle health
588
+
589
+ `@superbee/core/bundle-health` computes the health report behind `superbee status` from a core
590
+ `Bundle` on any backend: malformed or unreadable documents, Kind lint and conformance debt,
591
+ registry warnings, unresolved links, orphans, freshness and invalid timestamps, trust tiers, the two
592
+ graph lints, the View surface, cross-bundle links and the OKF v0.1 upgrade finding. A link to a
593
+ skipped document is not reported as unresolved. It uses no Node globals or builtins, so it runs in
594
+ Node, a browser or a Worker. The caller presents the report; the CLI adds row caps, help text and
595
+ its home and sync blocks. `@superbee/core/skip-reasons` exports `isPermissionDeniedSkip`, which
596
+ tells a document the host refused to read (`permission denied (EACCES)` or `(EPERM)`) from a
597
+ malformed one.
598
+
599
+ ```ts
600
+ import { MemoryBackend } from "@superbee/core/memory-backend";
601
+ import { bundleHealth } from "@superbee/core/bundle-health";
602
+
603
+ const bundle = { root: "memory://guide", backend: new MemoryBackend() };
604
+ const report = await bundleHealth(bundle, { now: new Date() });
605
+ const gate = { malformed: report.malformed.length, kind_warnings: report.kindLint.length, unresolved_links: report.unresolvedLinks.length };
606
+ ```
607
+
608
+ The report reads only: one Kind registry load, one lenient query, two prefix-scoped blob listings
609
+ and one root-index read, with every finding derived in memory. A document whose frontmatter does
610
+ not parse is a `malformed` row (the root index first), never a thrown error. Top-level keys are
611
+ camelCase; rows keep snake_case keys (`age_ms`, `bundle_id`, `incompatible_values`) and arrive
612
+ whole, in report order, for the caller to cap. Sections whose presence depends on the bundle are
613
+ null when absent: `conformanceDebt` without any declared Kind, `trust` outside a non-empty v0.2
614
+ bundle, `crossBundle` without `docs/dependencies` or any `okf:` link, `okfUpgrade` outside a v0.1
615
+ bundle with a workflow-status collision. `crossLinkTypeViolations` is always an array, because a
616
+ local edge under a qualified declaration needs no dependencies. The stored values in
617
+ `invalidStaleAfter`, `invalidTimestamps` and `invalidLegacyTimestamps` are made JSON-safe;
618
+ `missingExpectedLinks[].status` is the raw stored value.
619
+
620
+ Nothing outside the bundle is read unless the caller binds it. `bindings` is a map of bound copies
621
+ by alias, or a hook core calls exactly once, after every read and with its own parse of
622
+ `docs/dependencies` (a self alias already dropped as `DEP_SELF`, using `selfBundleId` when
623
+ `docs/bundle` declares no id). Whatever the hook throws propagates unchanged. Each binding's
624
+ verdict comes from core's resolver, and `dependencies[].bound` is the binding's `label`.
625
+
626
+ `bundleKindFindings(documents, okfVersion, { actor, producer })` answers a different question:
627
+ which Kind problems a strict host write would refuse, preparing each document as its first edit,
628
+ so a timestamp or actor the write supplies is no finding. The CLI's publish preview runs it; the
629
+ report's `kindLint` stays advisory. Both use core's one validator, `validateAgainstKind`.
630
+
631
+ A write that adds or changes a frontmatter key its Kind does not declare gets one
632
+ `KIND_FIELD_UNDECLARED` warning per key from `undeclaredFieldWarnings`. OKF standard keys,
633
+ Superbee-managed metadata and `superbee_*` keys never count, and keys the write leaves as stored
634
+ are never checked. A convention may set `undeclared_fields: error` so a strict write refuses those
635
+ keys with `KindConformanceError`; the default, `warn`, only warns. These findings are not
636
+ conformance debt and never feed the overwrite ratchet. `kindCoverage` reports the same keys after
637
+ the fact, through the same `kindDeclaredStorageFields` and `isKindEnvelopeField`.
638
+
639
+ ## Search
640
+
641
+ `@superbee/core/search` is the one `documents.search.v1` engine: the request and result contract,
642
+ query normalization, ranking (`portal-webmcp-search/v1`), the any-term fallback, facets, cursors
643
+ and page budgets. A backend supplies what it searches through `SearchSource`: one `evidence()`
644
+ call per request and `text()` for the page's excerpts. `memorySearchSource` indexes a complete
645
+ corpus in memory. `searchSourceFromBackend(backend, options?)` reads a complete local
646
+ backend in bounded batches, applies the same memory-source bounds, and derives the corpus key
647
+ from the versions actually read. Validate the request before calling it and pass an opaque
648
+ bundle identity as the search scope. Failed reads refuse the whole corpus. The subpath uses
649
+ no Node globals or builtins.
650
+
651
+ ```ts
652
+ import { memorySearchSource, searchDocuments } from "@superbee/core/search";
653
+
654
+ const source = memorySearchSource(documents, { key: headsDigest });
655
+ const result = await searchDocuments(source, { query: "lock keeper", limit: 10 }, { scope: bundleId });
656
+ ```
657
+
658
+ `key` identifies the corpus; a cursor is refused for another key, scope, query, match or filters
659
+ (`type`, `tag`, `prefix`). A request outside the contract throws `SearchInputError`; a corpus over a
660
+ bound throws `SearchLimitError`; a request whose terms hold more than `maxEvidenceInstances` capped
661
+ instances (a `searchDocuments` option, at most `SEARCH_LIMITS.maxEvidenceInstances`) throws
662
+ `SearchBroadQueryError`, a `SearchLimitError` whose message asks for fewer or more specific terms.
663
+ A source must hold one document per id.
664
+ A document over 65,536 body terms is left out and counted: the result's `corpus` reports
665
+ `documents`, `indexed`, `skipped` and `reindexPending`. A token over 32,768 UTF-8 bytes
666
+ (`SEARCH_LIMITS.maxTermBytes`, the longest term SQLite FTS5 keeps whole) is no term anywhere: the
667
+ tokenizer drops it from fields, body and query alike, so every source agrees. `searchRowText` is what one document
668
+ contributes to any index, and `textVersion()` names the algorithm, `SEARCH_TEXT_REVISION` and the
669
+ runtime's normalizer fingerprint, so a stored index can tell when its rows need re-deriving.
670
+
671
+ ### Local index kept on disk (Node only)
672
+
673
+ `@superbee/core/search-index` is a second `SearchSource` for a filesystem bundle, with no corpus-size
674
+ limit. `openLocalSearchIndex({ backend, root, indexPath })` keeps the index in one SQLite file
675
+ through Node's built-in `node:sqlite` (FTS5), at a path outside the bundle folder that the host
676
+ chooses; nothing is written inside the bundle. Each `evidence()` call first compares every file's
677
+ content stamp with the one recorded and reads again only the files that changed (or whose stamp
678
+ cannot vouch for them), so outside edits are seen without a watcher. On the same corpus it answers
679
+ byte for byte as `searchSourceFromBackend`, cursors included.
680
+
681
+ ```ts
682
+ import { openLocalSearchIndex, LocalSearchIndexUnavailableError } from "@superbee/core/search-index";
683
+
684
+ const source = await openLocalSearchIndex({ backend, root: bundleRoot, indexPath });
685
+ try {
686
+ const result = await searchDocuments(source, request, { scope: bundleId });
687
+ } finally {
688
+ source.close();
689
+ }
690
+ ```
691
+
692
+ `localSearchIndexFileKey()` names what an index file was built by (its schema and `textVersion()`,
693
+ which includes the runtime's normalizer fingerprint): put it in the file name, so two tool or Node
694
+ versions sharing a state folder keep separate files instead of rebuilding each other's. Core owns
695
+ that identity; the host owns the location. The file is derived state and may be deleted at any time; a corrupt, foreign, older-schema or
696
+ other-`textVersion()` file is rebuilt. Several processes may search one index at once. When this
697
+ Node has no `node:sqlite` or FTS5, or the index cannot be written, opening throws
698
+ `LocalSearchIndexUnavailableError` with a `reason`; so does a search when the index cannot be
699
+ written (another process held it past the busy timeout, a full or read-only disk). Fall back to
700
+ `searchSourceFromBackend`. The
701
+ loader drops only `node:sqlite`'s own ExperimentalWarning.
702
+
703
+ ## Hosted document backend
704
+
705
+ `createHostedDocumentBackend` from `@superbee/core/hosted-transport` composes the existing
706
+ hosted read adapter and whole-document transport into a finite document `StorageBackend`. Supply
707
+ `reader`, `carrier`, `scope`, `intents` and a positive `maximumDocuments`. The reader and carrier
708
+ must address the same trusted scope: tenant, bundle, registration, checkout binding, workspace
709
+ (`null` when unnamed), and OKF edition. Scope also pins `mode: "write"`,
710
+ `bodyPolicy: "protected"` and `tombstonePolicy: "refuse"`. Credentials, authorization and effect
711
+ fences belong to the host carrier and shared write entry.
712
+
713
+ Reads and root metadata use the read adapter. `list(prefix)` admits the entire validated paged
714
+ heads inventory before filtering, and refuses overflow. `exists` converts only ENOENT to false.
715
+ Every write requires an explicit `expectedVersion` (`null` for create, a content version for
716
+ replace) and a stable lowercase UUIDv4 `requestId`. The returned version is the host's version.
717
+ A valid OKF `actor` is advisory input only; host-owned attribution and normal body protection
718
+ remain in effect. Defined `agent`, `bodyReplace` and other unsupported options refuse. History,
719
+ deletion, recreation, blobs and reserved-file writes refuse. This adapter exposes neither general
720
+ wire capabilities nor an inventory guard.
721
+
722
+ The injected `HostedDocumentIntentPort` must atomically prepare-or-read and exclusively claim a
723
+ **new** descriptor, durably recording `in_flight` and attempt 1 before returning `fresh: true`
724
+ to exactly one caller. Every existing descriptor returns `fresh: false`, including an unattempted
725
+ pending record. Core validates the immutable scope/input digest and uses the original content and
726
+ creation instant on lookup. A lost claim acknowledgement prevents submission. Every reopened
727
+ record is lookup-only: absent, pending, expired or unavailable receipts never authorize another
728
+ send or a replacement identity. The port is a trusted persistence contract; Core supplies no
729
+ journal or storage implementation for it.
730
+
731
+ `settle` must durably compare the original digest and retain its descriptor and exact outcome;
732
+ a definitive outcome is immutable, and contradictory settlement must refuse.
733
+ A refusal marked `executed: "unknown"` is unresolved attempt evidence, including in older stored
734
+ records. It remains eligible for original-identity lookup and replacement by the recorded truth;
735
+ it must never be cached as a definitive refusal. Keep both until the importing consumer acknowledges
736
+ acceptance. Success is returned only after settlement completes. A settlement failure throws
737
+ `HostedDocumentBackendError` with `code: "outcome_unknown"`, the original `requestId`, and the
738
+ retained descriptor (including a known remote outcome). Unknown receipt results use the same error
739
+ classification. A `HostedDocumentVersionConflict` extends `VersionConflict` and retains the original
740
+ descriptor and any tombstone receipt. Deterministic refusals retain their existing transport code.
741
+ No matching-content read is used to manufacture success.
742
+
743
+ Callers above `StorageBackend` must forward the stable identity and immutable mutation input.
744
+ `mutateDocument` forwards `requestId` in `create-only` mode. Its other mutation modes reject that
745
+ option; identified replacements remain explicit conditional backend writes.
746
+ This backend is browser/Worker safe and uses the same carrier and response grammar as hosted's
747
+ other Core consumers.
748
+
749
+ ## Hosted client
750
+
751
+ `@superbee/core/hosted-client` is the headless client of a hosted Superbee's sync routes
752
+ (`/sync/v1`). It is a supported public API under core's normal versioning; the `superbee` CLI uses
753
+ it. It runs wherever `fetch` does (Node, a browser or a Worker) and reads identity (`whoami`),
754
+ the bundle list (`bundles`, with `readBundleListing`), documents (`reader`), document history
755
+ (`history`) and operations run by id (`listOperations`, `runOperation`). `within(slug)` returns
756
+ the same client naming every bundle-scoped request's bundle as `<slug>/<bundle-id>`.
757
+ Document reads and history run `documents.read.v1` and `documents.history.v1` by id on `run`; a
758
+ host from before that is read on its own `read` and `history` routes instead, decided once per
759
+ operation for each client.
760
+
761
+ ```ts
762
+ import { bearerCredentials, createHostedClient } from "@superbee/core/hosted-client";
763
+
764
+ const client = createHostedClient({
765
+ target: { origin: "https://mcp.getsuperbee.com", syncPrefix: "/sync/v1" },
766
+ credentials: bearerCredentials(() => getToken()),
767
+ });
768
+ const identity = await client.whoami();
769
+ ```
770
+
771
+ The target is the origin and the sync prefix, `/sync/v1`. `syncRoutePrefix({ origin, audience })` derives the prefix from a protected-resource
772
+ audience and returns null when the audience has none. `credentials` is the transport carrier's
773
+ own credential provider: an async function returning the headers for one request. It is called
774
+ before every request, so it may renew a short-lived token. `bearerCredentials` builds one from a
775
+ token getter. The client never logs credentials, and its errors carry the route and code, never a
776
+ token.
777
+
778
+ Failures are typed and carry no wording for any particular surface:
779
+
780
+ - `HostedCarrierError`: transport. `denied` means no credential (nothing was sent) or the request
781
+ was refused before sending; `unavailable` means the answer is unknown. `isAnswerTooLarge`
782
+ distinguishes an answer larger than its bound.
783
+ - `MalformedAnswer` (`code` `MALFORMED_ANSWER`, `route`): the host answered something the
784
+ contract does not admit. Retrying gets the same answer.
785
+ - `RemoteError` (`code`, `status`): the host refused the request, with its own code.
786
+ - `HostedRouteNotServed` (`code` `ROUTE_NOT_SERVED`, status 404, `route`): a `RemoteError` for a
787
+ host from before the route.
788
+
789
+ Operation and history refusals the host states in a `200` (and `bundle_not_found`,
790
+ `unknown_operation` and `invalid_input`) come back as `{ ok: false, refusal }`, not as errors.
791
+
792
+ ### Writing a document
793
+
794
+ `write` sends one whole serialized document (frontmatter and body, as a file holds it) to a hosted
795
+ bundle: a create of an absent id, or a replace at exactly the version the caller read.
796
+
797
+ ```ts
798
+ const created = await client.write("notes", { id: "notes/today", document: text, expectAbsent: true });
799
+ const replaced = await client.write("notes", { id: "notes/today", document: edited, expectedVersion: version });
800
+ ```
801
+
802
+ It returns one of:
803
+
804
+ - `{ status: "committed", version }`: the host stored it; `version` is the new head.
805
+ - `{ status: "conflict", reason: "version_conflict", currentVersion }`: the document is not at the
806
+ expected version (for a create: it exists). `currentVersion` is the version the host serves, or
807
+ null when it serves none. Nothing was written.
808
+ - `{ status: "conflict", reason: "concurrent_change" }`: another write to the bundle overlapped
809
+ this one past the host's own retries. Nothing was written.
810
+ - `{ status: "refused", code, message }`: the host refused this write (`validation_failed`,
811
+ `invalid_input`, `AUTH_REQUIRED`, `PERMISSION_DENIED`, a sync quota's `REQUEST_CAPACITY_*`, or
812
+ `read_only` when the bundle serves no writes). Nothing was written.
813
+ - `{ status: "unknown", requestId }`: the host may or may not hold the write.
814
+
815
+ Every result names its `requestId`. A conflict is final for that identity: the client never
816
+ resends it, under that identity or a new one. Read the document and decide; another attempt is a
817
+ new `write`.
818
+
819
+ A write needs the bundle's capabilities (whether it serves writes, its OKF edition, the write
820
+ bound and the retention window). The client reads them once per bundle and workspace and holds the
821
+ answer for `capabilitiesTtlMs` (default 60,000 ms), shared by the client and its `within` clients
822
+ and never by `reader()`. So a write costs one round trip while its bundle's capabilities are fresh,
823
+ and two when they are read first; concurrent writes to one bundle share one read. A write refused
824
+ `read_only`, `invalid_input`, `validation_failed` or `PERMISSION_DENIED` (which is how a
825
+ `bundle_not_found` write answer arrives), or whose result is `unknown`, drops the held answer, and
826
+ a capabilities read that fails is never held, so the next write reads them again. Set
827
+ `capabilitiesTtlMs: 0` to read them before every write. The retention window that decides a
828
+ resend after an `absent` lookup (below) is never taken from a held answer: it is read again then.
829
+
830
+ Each write has one request identity and carries the client's binding, a digest of a random id the
831
+ client mints once (its `within` clients share it). When an answer is lost (a transport failure or
832
+ a deadline after sending), the client looks the identity up on the host and reports what the host
833
+ recorded. The host's outcome route tells a request it never received ("absent") from one still in
834
+ progress ("pending"), and the shared transport keeps the two apart. On either answer `write`
835
+ sends the same identity once more, which the host applies at most once; after "pending", an
836
+ earlier delivery is known to be held. Absence counts as
837
+ evidence only within the retention window the host serves in its capabilities
838
+ (`operationsRetentionMs`, less an hour's margin); past it, the result stays `unknown` and nothing
839
+ is resent. The client measures an intent's age by its own clock against the host's window, so that
840
+ margin holds only while the client's clock is within an hour of the host's. A resend refused before
841
+ it reaches the host's execution (no credential, access withdrawn, a spent quota) leaves the result
842
+ `unknown` too, since the first delivery may still commit; after a "pending" lookup, so does any
843
+ refusal before execution, a gateway's `400` included. The result's `refusal` (`{ code, message }`)
844
+ names that refusal, so an app can say why the write is waiting (for example, access withdrawn)
845
+ while it stays held; only the call that met the refusal reports it. Absence alone never settles
846
+ such a write: a delayed first delivery is authorized when it arrives, so it can still commit once
847
+ access returns. When the lookups themselves fail, or the caller's `signal` aborts after sending, the
848
+ result is `unknown`.
849
+
850
+ An `unknown` write can be resolved later in two ways:
851
+
852
+ - `lookupWrite(requestId)` makes one outcome lookup and never sends the write. When the host holds
853
+ no outcome yet (absent or pending), the answer stays `unknown`.
854
+ - `settleWrite(requestId)` looks the identity up and, when the host never recorded it within its
855
+ retention window or holds it pending, sends the same identity once more, as `write` would have.
856
+
857
+ Both answer `{ status: "unrecorded", requestId }` when the intent store holds no write under that
858
+ identity: it was never recorded there, or it already settled and left the store. Both return
859
+ `unknown` when the bundle's capabilities cannot be read, because the write may already have left.
860
+ `settleWrite` only looks up, sending nothing, when the host serves the bundle no writes. A
861
+ `signal` already aborted when `write`, `lookupWrite` or `settleWrite` is called is thrown as its
862
+ reason before any request; an abort during delivery leaves the write `unknown` and held.
863
+ `write` instead throws that failure, because it has sent nothing yet.
864
+
865
+ Until it settles, a write is held in an intent store: its operation, bundle (and workspace),
866
+ document id, document and digest, expected version, request identity and binding, which is
867
+ everything needed to rebuild the lookup exactly. The default store is in memory and lives as long
868
+ as the client. Pass `intentStore` (`put`, `get`, `delete`, and optionally `list`) to keep intents
869
+ durable across restarts (`openHostedClientJournal`, below, is one for Node); lookups use the
870
+ binding recorded with each intent. A service that
871
+ restarts with a durable store calls `heldWrites()` to find the writes that never settled
872
+ (including any recorded but never sent), then settles each with `settleWrite`. `heldWrites()`
873
+ throws `HostedIntentsNotListable` when the store has no `list`. A settled write leaves the store.
874
+
875
+ `write(..., { requestId })` with the identity of a held write resumes that write and applies
876
+ nothing new. A different write under a held identity, including the same write named in another
877
+ workspace, is refused before sending. The host refuses an identity it recorded for another
878
+ document (`invalid_input`). Calls on one client that name the same identity run one after another.
879
+
880
+ `write` throws only before anything is sent: a malformed input (`TypeError`), the typed error of
881
+ its capabilities read, or a failure of the intent store to record the write. Document deletion is
882
+ not part of `write`.
883
+
884
+ ### Writing a blob
885
+
886
+ `writeBlob` and `deleteBlob` write one ordinary file (a blob: an image, a diagram, any bytes) to a
887
+ hosted bundle. A create names an absent key; a replace and a delete name the head they expect,
888
+ its version **and** content type (a `BlobPin`), so a type-only change is a replace too.
889
+
890
+ ```ts
891
+ const svg = new TextEncoder().encode("<svg xmlns='http://www.w3.org/2000/svg'/>");
892
+ const created = await client.writeBlob("notes", { key: "diagrams/flow.svg", bytes: svg, contentType: "image/svg+xml", expectAbsent: true });
893
+ if (created.status !== "committed") throw new Error(created.status);
894
+ let pin = created.head!; // { key, version, contentType }
895
+
896
+ const replaced = await client.writeBlob("notes", { key: pin.key, bytes: edited, contentType: "image/svg+xml", expected: pin });
897
+ if (replaced.status === "committed") pin = replaced.head!;
898
+
899
+ const read = await client.readBlob("notes", pin.key, { pin }); // bytes verified, or null if no longer at the pin
900
+ const deleted = await client.deleteBlob("notes", { key: pin.key, expected: pin });
901
+ ```
902
+
903
+ Each call returns one of:
904
+
905
+ - `{ status: "committed", head, changed? }`: applied. `head` is the new head (null after a
906
+ delete); `changed` is false for a replace the head already matched.
907
+ - `{ status: "conflict", reason: "version_conflict", actual }`: the head is not at the expected pin
908
+ (for a create: the key exists). `actual` is the head now, or null when there is none (a delete of
909
+ an absent key). Final for that identity.
910
+ - `{ status: "conflict", reason: "concurrent_change", message }`: another write overlapped this one
911
+ past the host's own retries. Nothing was applied.
912
+ - `{ status: "refused", code, message }`: the host's own refusal, or one the client names. The
913
+ host's codes are those it records under the identity (`backend_unavailable`, ...) and those it
914
+ answers without writing and never records (`insufficient_scope` for a grant without blob writes,
915
+ `bundle_not_found`, `request_capacity` in a `200` or a `429`, and `path_collision` for a create
916
+ whose key, or one of its folders, differs from an existing document or blob path only by letter
917
+ case or Unicode form under `foldPath`, the per-folder rule portable export applies; a create
918
+ only, and it never resends: rename the key). A refusal of the second kind
919
+ proves only that this attempt did not run, so it is final only when every earlier attempt of the
920
+ write is proven not applied, which is always so for a write the client sends; a write whose
921
+ earlier attempt was unclear is never sent again, only looked up, and stays `unknown`.
922
+ `insufficient_scope`, `bundle_not_found` and `invalid_input` also drop the held capabilities
923
+ answer, so the next write reads them again. The client's own codes are `invalid_input` (an
924
+ unsafe key, a key under one of Superbee's own record folders or a reserved file, an invalid content type, a body over the host's `blobWriteBytes` or 16 MiB, or a held
925
+ identity reused for another write), `scope_mismatch` (a held write, or a reused `requestId`, recorded
926
+ for another origin or sync prefix) or `unsettled_write` (an earlier write of the same key in the bundle is still
927
+ unsettled: settle or forget it first). Nothing was sent for a client-named refusal.
928
+ - `{ status: "held", deletions, baseline }`: the host holds this mass delete (`428
929
+ deletions_held`). Nothing was applied. A person confirms the count, and
930
+ `settleBlobWrite(requestId, { acceptDeletes })` with at least `deletions` sends it again; without
931
+ `acceptDeletes` it stays held and nothing is sent, and with fewer it throws
932
+ `HostedBlobDeletionsNotAccepted`, sending nothing. `deleteBlob(..., { acceptDeletes })` sends the
933
+ confirmation with the first attempt.
934
+ - `{ status: "unknown" }`: the host may or may not hold the write.
935
+
936
+ Every result names its `requestId`, `key` and `operation`.
937
+
938
+ **The capability gate.** A blob write needs the bundle's `blobWrites: "allowed"` and its
939
+ `blobWriteBytes` bound, from the same held capabilities answer `write` uses. When the host serves
940
+ the bundle no blob writes (an older host's answer reads as refused), `writeBlob` and `deleteBlob`
941
+ throw `HostedBlobWritesNotServed`, a `HostedRouteNotServed` (`isRouteNotServed` is true), before
942
+ anything is journaled or sent. This differs from `write()`, which answers a bundle without writes
943
+ with the result `refused: read_only`: the blob routes are a newer capability a caller probes for, as
944
+ it probes for any route a host may lack. The checks a send would otherwise fail (the capability, the
945
+ byte bound, the key and the content type) all run against that one answer before the write is
946
+ journaled, and the delivery is handed the same answer, so the two cannot disagree.
947
+
948
+ **Exactly once, never resent after it may have left.** Each blob write is journaled under one
949
+ request identity (with the client's binding, the bundle and workspace and the bytes), durably
950
+ claimed, then sent once. After an unclear answer the client looks the identity up on the host
951
+ (`/outcome`, under the binding recorded with the write) and reports what the host recorded. Unlike a
952
+ document write, an `absent` lookup is never permission to send again: once an attempt may have left,
953
+ a blob write is only ever looked up. A send proven never to have left (the credential provider
954
+ failed or was denied, the signal was already aborted, the identity was malformed, a local check
955
+ failed) is rolled back instead: `writeBlob` throws `HostedBlobWriteNotSent` with its `requestId` and
956
+ `reason`, and the write stays held and resendable (`held: true`), so `settleBlobWrite` or the same
957
+ `writeBlob` call (same `requestId`, same input) sends it. A transport failure after the request was
958
+ handed to the carrier is `unknown`.
959
+
960
+ **Recovery.** `heldBlobWrites()` lists every unsettled blob write (`requestId`, `bundleId`,
961
+ `workspace`, `key`, `operation`, `state`, `attempts`, `resendable`, `hold`, `createdAt`) and sweeps any
962
+ settled one a crash left behind.
963
+
964
+ - `lookupBlobWrite(requestId)` makes one outcome lookup and never sends. A write never sent (or
965
+ proven not applied) answers `{ status: "pending" }` without a request, and a held delete `held`.
966
+ - `settleBlobWrite(requestId, { acceptDeletes? })` submits the write when its state is pending or
967
+ unknown and every attempt is proven not applied (`attempts === notAppliedThrough`); otherwise it
968
+ only looks it up, and an absent lookup is `unknown`.
969
+ - `forgetBlobWrite(requestId)` drops an `unknown` write once one fresh lookup answers `absent`,
970
+ returning `{ status: "forgotten" }`. **The earlier delivery may still commit**; the host's
971
+ compare-and-swap is what keeps a later write from losing that update. Any other record is
972
+ `{ status: "kept", reason: "not_unknown" }` (settle an `in_flight` one first), a lookup that fails,
973
+ is refused or is malformed is `kept` with `lookup_unavailable`, and a lookup that finds the outcome
974
+ settles the write instead. A forgotten identity is no longer held, so `writeBlob` with that same
975
+ `requestId` journals and uploads it again under that identity. That is safe: the host answers a
976
+ delivery it recorded under the identity with the recorded result, and one it did not record is
977
+ checked against the expected pin like any write.
978
+
979
+ All three answer `{ status: "unrecorded", requestId }` when the journal holds no blob write under the
980
+ identity. A reused `requestId` with the same input resumes (settles) the held write; with different
981
+ input it is `refused: invalid_input` and nothing is admitted. Calls are serialized per request
982
+ identity and per key (the journal's guard covers a key across bundles), so concurrent calls of one
983
+ client never trip each other.
984
+
985
+ ```ts
986
+ // A service restarting after a crash: settle what it held, forgetting only proven-absent unknowns.
987
+ for (const held of await client.heldBlobWrites()) {
988
+ const settled = await client.settleBlobWrite(held.requestId);
989
+ if (settled.status === "unknown") console.warn(`blob write ${held.requestId} is still unknown`); // forgetBlobWrite once you choose to move on
990
+ }
991
+ ```
992
+
993
+ **Reads.** `readBlob(bundleId, key, { pin })` requires the pin: it reads exactly that version and
994
+ content type, verifies length, digest and type, and answers null when the key is no longer at the pin
995
+ (the host's `409`). `blobHead(bundleId, key)` is the explicit lookup of one head (or null), and
996
+ `blobHeads(bundleId)` the whole listing; both read the full verified listing (up to 10,000 heads in
997
+ 4 MiB pages), since the host has no single-key head route yet.
998
+
999
+ **Keys.** `isOrdinaryBlobKey` is the one key policy every blob writer uses, this client and the
1000
+ CLI's checkout sync alike: a safe key that is not a reserved file (`index.md`, `log.md`) and does not
1001
+ sit under one of Superbee's own folders (`OWNED_BLOB_ROOTS`, derived from the bundle sections below:
1002
+ `views/`, `pages/`, their registries, `conventions/`, `recipes/`, `references/`, `connectors/`,
1003
+ `sites/`, `promotions/` and `_superbee/`, compared case-insensitively). Any other key is refused
1004
+ `invalid_input` before any request.
1005
+
1006
+ **Aborts.** A `signal` aborted before the write is admitted throws its reason and journals nothing;
1007
+ that includes an abort while the capabilities are still being read, so a hung credential provider
1008
+ never holds the call (or its key) past the caller's abort. Once admitted, a write is held until it
1009
+ settles, and an abort before its send leaves it resendable (`HostedBlobWriteNotSent`).
1010
+
1011
+ **Journal.** The default blob journal is in memory (`createMemoryBlobJournal`), owned by the client.
1012
+ Give a blob journal to one client (its `within` clients share it). Two clients over one journal
1013
+ coordinate only through its per-key guard: concurrent writes of different identities still settle,
1014
+ but two calls on the same request identity from both clients can fail with a raw journal conflict.
1015
+ Pass `blobJournal` to keep blob writes across restarts: in Node, `openHostedClientJournal(...).blobs`
1016
+ (below). `driveJournaledBlob(journal, context, requestId, mode)` is the owner of the journaled
1017
+ sequence (admit, claim, deliver, persist, retire) for a caller with its own journal and premises; its
1018
+ `premises.snapshot(key, step)` returns each transaction's guard plus the caller's own metadata
1019
+ changes, checked atomically with it.
1020
+
1021
+ **Limitations.**
1022
+
1023
+ - Lookups currently need `blobWrites`: a grant downgraded to read-only cannot settle its earlier
1024
+ blob writes until the host authorizes the outcome route on its own (a hosted follow-up).
1025
+ - A lookup across principals is unverified: a new token of the same principal finds its outcomes
1026
+ (the binding travels in the journal), but what another principal's lookup gets is not yet proven.
1027
+ - Every journal record of a write carries its bytes, and each transaction validates the record.
1028
+ Validation is cached per payload, so a write costs about 0.17 s per MiB in Node (3 MiB about
1029
+ 0.5 s, 16 MiB about 2.6 s, measured with the in-memory journal); without the cache it was about
1030
+ 1.7 s per MiB (16 MiB about 28 s). The first validation of a payload still runs on the caller's
1031
+ thread in one slice, about 1.2 s for 16 MiB.
1032
+
1033
+ ### Inbox
1034
+
1035
+ `createHostedInbox(client, { tenantId })` is a person's hosted inbox in one workspace, over the
1036
+ same client (its credential, deadline and abort; a `within` client serves too). It reaches the
1037
+ attention routes, `POST <prefix>/attention/<operationId>`, and names the workspace in the
1038
+ `Superbee-Workspace` header on every request, since a sync sign-in spans all of the person's
1039
+ workspaces. Notifications are a hosted capability: a host without these routes answers
1040
+ `HostedRouteNotServed`, and nothing here emulates a local inbox.
1041
+
1042
+ ```ts
1043
+ import { createHostedInbox } from "@superbee/core/hosted-client";
1044
+
1045
+ const identity = await client.whoami();
1046
+ const inbox = createHostedInbox(client, { tenantId: identity.tenantIds[0]!, via: "my-agent" });
1047
+ const receipt = await inbox.request({ recipient: { kind: "principal", principalId: identity.principalId }, kind: "needs_input", note: "Ready for you" });
1048
+ const page = await inbox.list({ threadId: receipt.threadId, afterSeq: 0 });
1049
+ ```
1050
+
1051
+ The methods are `list`, `threads`, `summary`, `get` (does not mark read), `open` (marks read),
1052
+ `ack` (at the revision read), `request` (send) and `cancel` (withdraw your own send), with the
1053
+ open contract's shapes (`InboxEntry`, `InboxThread`, `AttentionReceipt` and the inputs). A
1054
+ recipient is a principal id; to notify yourself, use `whoami().principalId`. A document target
1055
+ names `whoami().targetAuthorityKey` as its `authorityKey` and the document's current version; a
1056
+ host that reports no key (the field is absent, as on every `/sync/v1` host today) cannot take one yet.
1057
+
1058
+ `request` mints one UUIDv7 ticket per send (or takes the one you pass). When an answer is lost or
1059
+ the host marks its refusal retryable, it sends the same body under the same ticket again
1060
+ (`sendAttempts`, default 3), which the host answers as a replay of the first send, never as a second
1061
+ item. A send still unclear after that throws `HostedAttentionOutcomeUnknown` with its `ticket`:
1062
+ `request({ ...input, ticket })` within 24 hours settles it. Refusals are
1063
+ `HostedAttentionRefusal` (a `RemoteError`) with the catalog's `code` (`attention_disabled`,
1064
+ `not_found`, `target_unavailable`, `target_unsupported`, `quota_exceeded`, `request_conflict`,
1065
+ `version_conflict`, `ticket_expired` with `serverTime`, `workspace_not_available` and the rest),
1066
+ `retryable`, and a message in this client's words: the host's message and hint are never repeated.
1067
+
1068
+ ### Durable intent store (Node only)
1069
+
1070
+ `openHostedClientJournal` from `@superbee/core/hosted-client/node` is a durable `intentStore`, and its
1071
+ `blobs` a durable `blobJournal`, so a short-lived process that exits with a write `unknown` can recover
1072
+ it after a restart.
1073
+
1074
+ ```ts
1075
+ import { createHostedClient } from "@superbee/core/hosted-client";
1076
+ import { openHostedClientJournal } from "@superbee/core/hosted-client/node";
1077
+
1078
+ const journal = await openHostedClientJournal({ directory: path.join(stateDir, "superbee-writes") });
1079
+ const client = createHostedClient({ target, credentials, intentStore: journal, blobJournal: journal.blobs });
1080
+ for (const held of await client.heldWrites()) await client.settleWrite(held.requestId);
1081
+ for (const held of await client.heldBlobWrites()) await client.settleBlobWrite(held.requestId);
1082
+ // ... writes ...
1083
+ await journal.close();
1084
+ ```
1085
+
1086
+ The journal is a `FileJournaledBackend` directory: an fsynced, checksummed log with snapshot
1087
+ compaction. Its on-disk format is a supported compatibility promise: a format bump ships a reader
1088
+ for every earlier layout, and an older reader refuses a newer store with `FileJournalFormatError`
1089
+ rather than misreading it. The current format is 3 (see `JOURNALED-BACKENDS.md`). Each unsettled write is one metadata row, `hosted-client.write.<requestId>`,
1090
+ holding the whole document and the binding it was sent under, so a new process with a new token
1091
+ looks it up exactly as the first would have. A settled write is removed. Each unsettled blob write is
1092
+ one row of the backend's own blob intent family, with its bytes, under the same transition rules as
1093
+ the in-memory journal; a settled one is retired, and since every record of a blob write carries its
1094
+ bytes, retiring or forgetting one compacts the store once its log or snapshot is past 1 MiB. Metadata
1095
+ a blob write carries may not name the journal's own rows (`hosted-client.*`) or a checkout's
1096
+ blob-sync state.
1097
+
1098
+ - **Ownership.** Open takes an exclusive same-user lock on the directory until `close()`. Another
1099
+ process waits `lock.waitMs` (default 5,000 ms) and then gets `FilesystemMutationLockError`. A
1100
+ lock left by a process that died on this host is reclaimed.
1101
+ - **Local file system only.** The lock lives in a per-user runtime directory on this host, so it
1102
+ cannot exclude a process on another host. Keep the journal on a local disk, never on NFS, SMB
1103
+ or another shared mount. Open does not detect a network mount; this is the operator's rule.
1104
+ - **Privacy.** The journal holds whole documents. A directory open creates is mode 0700, and its
1105
+ files 0600. On POSIX, an existing directory that is a symbolic link, is owned by another user,
1106
+ or grants its group or others any permission, is refused as `HostedClientJournalError`
1107
+ `JOURNAL_DIRECTORY_NOT_PRIVATE`. The check runs again once the lock is held, and a directory
1108
+ replaced in between is refused too. The directory is the journal's alone: an existing one may
1109
+ hold only `store.log`, `store.snapshot` and `store.snapshot.tmp`, and any other entry (an
1110
+ operating system's `.DS_Store` included) is refused as `JOURNAL_NOT_HOSTED_CLIENT`, as is a
1111
+ `store.log` that is not a journal's log, and a store file that is a symbolic link, a
1112
+ directory, has more than one link, or (on POSIX) belongs to another user. The listing and the
1113
+ files are checked again under the lock. Another process of the same user changing the
1114
+ directory while it opens is out of scope: in that window the open can truncate a torn or
1115
+ foreign log tail.
1116
+ - **Marker.** A new journal records `hosted-client.journal = { schemaVersion: 1 }` in its first
1117
+ transaction. Open refuses, as `JOURNAL_NOT_HOSTED_CLIENT`, a store with rows but no marker or one
1118
+ holding documents, blob files or a checkout's blob-sync state, so it is never pointed at a CLI
1119
+ checkout store. A marked journal holding blob write intents is its own and reopens. A marker of another schema is `JOURNAL_SCHEMA_UNSUPPORTED`. Open decides on a read-only
1120
+ pass first, so a refused directory's files are left byte for byte. A crash before the marker
1121
+ lands leaves an empty store, which the next open marks.
1122
+ - **Size.** Once the store is adopted, the log is compacted into the snapshot whenever it grows past the greater of 1 MiB
1123
+ (`HOSTED_CLIENT_JOURNAL_COMPACT_FLOOR_BYTES`) and twice the last snapshot, so steady writing keeps
1124
+ it near 1 MiB. The snapshot, which holds every write still unsettled, and any one transaction are
1125
+ bounded at 256 MiB. A write that would pass that bound is refused before anything is recorded,
1126
+ and its `write` throws. Unsettled writes count toward the bound until `settleWrite` resolves them.
1127
+ - **Ordering.** Unlike the in-memory store, each call takes effect when its asynchronous steps
1128
+ complete, so unawaited overlapping calls on one request identity can land out of call order.
1129
+ Await each call before the next, as the client does.
1130
+ - **Damage.** `FileJournalCorruptError` (a damaged record before the log's end or a damaged
1131
+ snapshot) and `FileJournalFormatError` (a newer format) refuse the open and change no file. A torn
1132
+ final record, which was never acknowledged, is truncated. Nothing is repaired automatically:
1133
+ moving the directory aside starts an empty journal and loses the writes it held, which can then
1134
+ be settled only by reading the documents on the host.
1135
+
1136
+ ### Export download (Node only)
1137
+
1138
+ `@superbee/core/hosted-client/node` downloads and verifies a hosted bundle's portable export. It
1139
+ is a supported public API under the same versioning. It is Node-only because verification
1140
+ (`@superbee/core/portable-export`) needs Node; `@superbee/core/hosted-client` never imports it,
1141
+ so the client itself stays browser-safe.
1142
+
1143
+ ```ts
1144
+ import { bearerCredentials, createHostedClient } from "@superbee/core/hosted-client";
1145
+ import { downloadExport, EXPORT_WINDOW_MS } from "@superbee/core/hosted-client/node";
1146
+ import { materializeExport } from "@superbee/core/portable-export";
1147
+
1148
+ const client = createHostedClient({ target, credentials: bearerCredentials(getToken), deadlineMs: EXPORT_WINDOW_MS });
1149
+ const verified = await downloadExport(client, "team.notes", { signal });
1150
+ const folder = await materializeExport(verified, parentDirectory);
1151
+ ```
1152
+
1153
+ `downloadExport(client, bundleId, { signal })` returns a `VerifiedExport`: every document,
1154
+ reserved file and blob at the bundle's latest confirmed revision, read whole and checked against
1155
+ the host's digest manifests. It writes nothing. A stopped, tampered or oversized export never
1156
+ becomes a result; placing the files is the caller's (`materializeExport`, or its own staging). It
1157
+ reads a paged export one page at a time and joins the pages. On a host from before paging it reads
1158
+ the whole archive. A bundle that changes between pages is read again from its first page, up to
1159
+ three attempts, and a busy or stopped page is asked for once more. Create the client with
1160
+ `deadlineMs: EXPORT_WINDOW_MS` (60 s), the host's export window; the default 15 s can cut a large
1161
+ bundle. A `within(slug)` client names the bundle in that workspace.
1162
+
1163
+ Failures are typed:
1164
+
1165
+ - `HostedCarrierError`, `HostedRouteNotServed` (a host without the export route) and
1166
+ `RemoteError` (the host's refusal: `bundle_not_found`, `result_too_large`, `validation_failed`,
1167
+ an unauthenticated bearer and so on), as for the rest of the client.
1168
+ - `ExportArchiveError` (`problem`): the verifier refused the archive. `incomplete` means the host
1169
+ stopped it, and the same request may succeed.
1170
+ - `HostedExportError` (`problem`): `stopped` (the answer's body failed part way), `too_large`
1171
+ (past `MAX_EXPORT_BYTES`) or `source_changed` (the bundle kept changing between pages).
1172
+ - The signal's reason, once `signal` or the client's own signal aborts.
1173
+
88
1174
  ## Release compatibility
89
1175
 
90
1176
  This migration describes the source after the Windows extraction. Previously published versions
@@ -93,3 +1179,250 @@ consumer. CLI and engine version numbers are independent; do not infer matching
93
1179
  package names or version labels.
94
1180
 
95
1181
  [Source and contribution guide](https://github.com/Holaxis-ai/superbee)
1182
+
1183
+ ### Node portable export boundary
1184
+
1185
+ `@superbee/core/portable-export` (also bundled as `superbee/portable-export`) exposes the same
1186
+ store-only archive verifier used by the CLI: `verifyExport`, `ExportPageChain` and
1187
+ `joinExportPages`. The page chain charges the sum of complete ZIP sizes, including manifests
1188
+ and headers, against `MAX_EXPORT_BYTES` before retaining a page; returned `bytes` counts only
1189
+ stored bundle content. It performs no acquisition, sign-in or network access. A complete accepted
1190
+ handle can be passed to `materializeExport(handle, existingPrivateParent)` to create a fresh
1191
+ private directory; callers own its cleanup and isolation while publishing. No target is replaced.
1192
+ `exportProvenance(handle)` returns exact ordered raw-manifest SHA-256/size evidence plus a combined
1193
+ inventory SHA-256. Keep that evidence outside the directory and private when it identifies a
1194
+ private source. Handles cannot be reconstructed from JSON or moved between independently bundled
1195
+ module instances; modified handles are refused. This surface requires Node, not a browser or Worker.
1196
+
1197
+ `@superbee/core/portable-export-contract` holds the rules an archive writer needs without Node
1198
+ built-ins: `EXPORT_MANIFEST`, `EXPORT_FORMAT`, `crc32`, `unsafeEntrySegment` (why one path
1199
+ segment cannot be kept, or null) and `findEntryCollision`. They are the functions the verifier
1200
+ applies, and `@superbee/core/portable-export` re-exports them.
1201
+
1202
+ ## Built-in recipes and Kind authoring
1203
+
1204
+ `@superbee/core/builtin-recipes` is an opt-in catalog: `builtinNames()` lists names,
1205
+ `builtinRecipeFiles(name)` returns detached source files, and `loadBuiltinRecipe(name)` returns
1206
+ the existing parser's result or `null` for an unknown name. `builtinRecipeSource()` offers the
1207
+ same catalog as a `RecipeSource` (see [recipe sources](RECIPES.md#recipe-sources-and-published-indexes)).
1208
+ The generic parser, package root, and `initBundle` do not import the catalog or install recipes.
1209
+
1210
+ `@superbee/core/kind-authoring` provides inference, forecasts, dismissal classification, templates,
1211
+ and the guarded mutation specifications for applying a draft and recording a decline, on a
1212
+ caller-selected `Bundle` backend. Doors apply a draft through the `kinds.apply-draft.v1` operation
1213
+ (`@superbee/operations`), which composes these. An outside app can use them directly with the
1214
+ existing backend and mutation seams:
1215
+
1216
+ ```ts
1217
+ import { MemoryBackend } from "@superbee/core/memory-backend";
1218
+ import { query } from "@superbee/core/engine";
1219
+ import { mutateDocument } from "@superbee/core/document-mutation";
1220
+ import { buildKindRegistry } from "@superbee/core/kinds";
1221
+ import { loadBuiltinRecipe } from "@superbee/core/builtin-recipes";
1222
+ import { installRecipe } from "@superbee/core/recipe-lifecycle";
1223
+ import { kindInstanceCandidate, prepareKindDraft, prepareKindDraftMutation } from "@superbee/core/kind-authoring";
1224
+
1225
+ const backend = new MemoryBackend(), bundle = { root: "memory://project", backend };
1226
+ await backend.writeReserved("", "index.md", "---\nokf_version: '0.2'\n---\n# Project\n");
1227
+ const loaded = loadBuiltinRecipe("work-tracking");
1228
+ if (!loaded?.ok) throw new Error("Recipe unavailable");
1229
+ await installRecipe(bundle, loaded.recipe);
1230
+ const registry = buildKindRegistry(await query(backend, { prefix: "conventions/" }));
1231
+ const task = registry.kinds.get("Task")!;
1232
+ const candidate = kindInstanceCandidate(task, { title: "First task", superbee_progress_status: "todo" });
1233
+ await mutateDocument({ bundle, id: "tasks/first", mode: "create-only", registry, strict: true,
1234
+ buildCandidate: () => candidate });
1235
+
1236
+ // Once an ungoverned type has existing instances, inspect its draft before applying.
1237
+ const text = { inferredBody: () => "The accepted shape of existing research records.\n" };
1238
+ const plan = await prepareKindDraft(bundle, "Research", text); // requires existing Research docs
1239
+ // Present candidateDoc, warnings and promotions; after acceptance, plan again and apply against the token:
1240
+ const accepted = await prepareKindDraft(bundle, "Research", text);
1241
+ await mutateDocument(prepareKindDraftMutation(bundle, accepted, plan.token).options);
1242
+ ```
1243
+
1244
+ `kindInstanceCandidate` accepts already-typed field values. Existing validators own their meaning;
1245
+ there is no CLI flag coercion or path-alias resolution. Supply a canonical id and use strict
1246
+ create-only mutation. The template keeps `type` equal to `governs`, preserves own prototype-shaped
1247
+ fields, scaffolds sections only when body is omitted, and retains an explicit empty body.
1248
+
1249
+ Without supplied prose, Core writes its own default description and body for a drafted Kind and
1250
+ for a declined one (`prepareKindDismissal`'s optional `reason` goes into the decline's body). The defaults
1251
+ describe the action and name no command, so callers that leave the text to Core store the same
1252
+ bytes and get the same plan token. Supplied `inferredBody`/`inferredDescription` and dismissal
1253
+ `description`/`body` still replace them.
1254
+
1255
+ Draft and dismissal preparation trim type names and refuse blank or non-string names before
1256
+ any backend access, matching convention parsing. `prepareKindDraft` selects a catalog definition
1257
+ or infers from instances. Its token binds candidate
1258
+ bytes (including supplied `inferredBody`/`inferredDescription`), edition, presence statistics and
1259
+ warning forecast. To apply, prepare the plan again with the same prose options and pass it with the
1260
+ accepted token to `prepareKindDraftMutation`, whose mutation checks the bundle edition and applies the replacement against the exact declaration-free source
1261
+ version checked during preparation. A competing edit requires a fresh plan. New conventions are
1262
+ expect-absent creates. A redraft keeps the existing record's id, authored title, and metadata outside
1263
+ the draft's declarations, including unrecognized keys inside `fields`. `plan.replacesProse` names each existing
1264
+ description or body it overwrites and `plan.replacesFields` each other existing value it changes
1265
+ (current and proposed). The token binds the merged candidate and those current values, and apply
1266
+ reports dropped links. `prepareKindDismissal` prepares a record with no schema
1267
+ obligations, refuses a real schema, and prepares nothing for an existing decline. A drafted definition records
1268
+ `generated.by` (OKF v0.2+) as every other write does: the `producer` passed to `prepareKindDraftMutation`, or
1269
+ the actor without one. An adopted catalog definition is written as recipe installation writes it. `KindAuthoringError.reason` identifies domain refusals;
1270
+ normal mutation/storage errors retain their types.
1271
+
1272
+ Pass the options from `prepareKindDraftMutation` or `prepareKindDismissal` to `mutateDocument` or an
1273
+ established mutation adapter, and keep preparation adjacent to mutation. No cross-document
1274
+ transaction or authorization boundary is added.
1275
+
1276
+ The packed proof runs the public workflow over `MemoryBackend` in Node and a browser bundle without
1277
+ Node globals. This proves source/package availability. Hosted provisioning routes, MCP modeling
1278
+ tools, and publication of a core version remain separate adoption and release decisions.
1279
+
1280
+
1281
+ ## Declarative JSON sources
1282
+
1283
+ `@superbee/core/source-profiles` exports `getSourceProfile(id)`, frozen `SOURCE_PROFILES` metadata,
1284
+ and `restJsonProfile` (version 1). The catalog contains only `rest-json`; GitHub
1285
+ normalization ships separately in [`@superbee/integration-github`](https://github.com/Holaxis-ai/superbee-plugins/tree/main/integrations/github). Core also exports the existing
1286
+ `nextLinkTarget` parser, `SourcePluginHelpers` type and exact `SOURCE_PLUGIN_CORE_VERSION` for
1287
+ explicit host composition. The profile accepts a parsed `ConnectorSource` as its spec;
1288
+ `source.request` describes provider data, while `source.fields` maps normalized paths to Kind fields.
1289
+ It runs only through `observeSource` and the caller's recorded or credential-injecting transport.
1290
+ Installing a Connector does not run it.
1291
+
1292
+ The optional, pinned request block requires `host`, `method`, `path` and `items` (empty string for
1293
+ a root array). `query`, `body` and `headers` contain scalar literals or whole `{binding}`, `{cursor}`,
1294
+ `{page}` and `{watermark}` values. Path placeholders occupy whole segments. `request.fields` maps
1295
+ normalized dotted paths to `{from, type?}` or `{const}`; types are `text`, `integer`, `date`
1296
+ (ISO timestamp), `epoch-date` (seconds to ISO timestamp), and `url` (HTTP(S)). Presence-only `skip`
1297
+ rules count skipped records. No executable expressions or synthesis are supported.
1298
+
1299
+ Paging kinds are `none`, `cursor`, `link-header`, `offset` and `page-number`. Cursor paging uses
1300
+ `cursor_path` (opaque token, placed through `query`) or `next_path` (URL). Numeric paging requires
1301
+ `size` and `page_param` or `offset_param`, and restarts from the beginning after interruption.
1302
+ `watermark: {field, param, overlap_seconds}` applies overlap between passes and keeps the pass's
1303
+ starting watermark fixed across pages. `complete` is `always`, `never`, or `{when_path, equals}`;
1304
+ the engine additionally requires an uninterrupted complete-mode pass before counting absences.
1305
+ Optional `errors` sets (`deferred`, `credential_refused`, `not_found`) and `rate.requests` narrow
1306
+ the run's status interpretation and request budget.
1307
+
1308
+ Existing declaration pins without a request block remain unchanged. Credentialed engine consumers
1309
+ must now supply a request declaration: `declaration_required` refuses a missing one before any
1310
+ transport call. Parsing and installation remain inert. Provider read paths, read-shaped POST paths,
1311
+ headers and paging forms default to the legacy Core-owned, deeply frozen table and are revalidated at every run; caller rules
1312
+ can only narrow them. Callback URL/response views are isolated from execution; changing a view
1313
+ cannot rewrite the request. Core rechecks its private run authority after narrowing callbacks.
1314
+ Keyless legacy profiles retain the declared-domain and robots rules.
1315
+
1316
+ GitHub's repository issues GET, version header and alternate numeric pagination form follow
1317
+ [issues documentation](https://docs.github.com/en/rest/issues/issues) and
1318
+ [pagination documentation](https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api).
1319
+ Numeric `/repositories/{id}/issues` paging additionally requires first-page repository metadata
1320
+ that proves the id belongs to the bound owner/repository and stays fixed for that pass. The issues
1321
+ listing does not guarantee that metadata; a Link alone cannot establish it. Without proof the
1322
+ engine refuses that alternate form. Its metadata proof is scoped to the current run, so resuming
1323
+ an interrupted alternate numeric URL in a later run also refuses; restart from the bound path.
1324
+ The conditional metadata test is not live-provider
1325
+ qualification. Same bound `/repos/{owner}/{repo}/issues` pagination remains usable.
1326
+
1327
+ GraphQL declarations use the real `graphql` syntax parser: one query operation, no variable defaults,
1328
+ and bound String/ID inputs. GraphQL execution is deferred to the later GraphQL profile slice:
1329
+ `graphql_scope_unsupported` refuses even a well-formed read body before transport. Syntax alone
1330
+ does not establish resource-scoped traversal. Mutations and malformed extension bodies are refused
1331
+ by the engine wrapper; caller hooks cannot enable them.
1332
+
1333
+ ## Explicit local bound GET policies
1334
+
1335
+ An optional `request.read_policy` requests a new narrowly bound GET scope without adding a provider
1336
+ adapter or changing the legacy endpoint table. The local operator must review the exact endpoint,
1337
+ query and provider read semantics before accepting its feed binding. GET alone is not proof of
1338
+ absence of side effects. A package or policy declaration does not approve itself.
1339
+
1340
+ For a repository pull list, the existing request is still the only endpoint/query/header declaration:
1341
+
1342
+ ```yaml
1343
+ host: api.github.com
1344
+ method: GET
1345
+ path: '/repos/{owner}/{repo}/pulls'
1346
+ items: ''
1347
+ query: {state: all}
1348
+ headers: {accept: application/vnd.github+json, x-github-api-version: '2026-03-10'}
1349
+ paging: {kind: page-number, page_param: page, size_param: per_page, size: 30}
1350
+ read_policy:
1351
+ contract: 1
1352
+ kind: bound-get
1353
+ bindings: {owner: segment, repo: segment}
1354
+ required_permissions: {pull_requests: read}
1355
+ header_provider: github
1356
+ ```
1357
+
1358
+ Use identity resource `https://github.com/{owner}/{repo}/pulls`. For a separately bound detail
1359
+ source, use resource `https://github.com/{owner}/{repo}/pull/{number}`, request path
1360
+ `/repos/{owner}/{repo}/pulls/{number}`, `number: positive-integer`, no list query and
1361
+ `paging: {kind: none}`. Detail object normalization belongs in the integration; no Core PR adapter
1362
+ is added. GitHub documents both [GET endpoints and permission minima](https://docs.github.com/en/rest/pulls/pulls).
1363
+ `pull_requests: read` is a common minimum. GitHub App declarations must include the requested
1364
+ permissions at read or write; write grants are disclosed and do not authorize source writes.
1365
+ Opaque token grants cannot be inspected by Core: minima are declarations and the provider enforces
1366
+ actual credential access.
1367
+
1368
+ Contract 1 permits one exact host/path, GET only, no body, GraphQL or watermark. Every identity
1369
+ parameter appears once as an entire request path segment. Binding keys equal the identity
1370
+ placeholder set; `segment` uses the existing safe resource grammar, while `positive-integer` is
1371
+ canonical decimal 1 through `Number.MAX_SAFE_INTEGER`. The public resolver validates the identity
1372
+ with the existing parser and requires parameters to render `bound.resource` byte for byte, even
1373
+ when a library caller constructs `BoundFeed` directly.
1374
+
1375
+ Queries require every exact literal or whole bound-value placeholder once. Cursor, watermark and
1376
+ free page placeholders are refused. Paging supports only absent/none or page-number. Page/size
1377
+ names must be distinct and outside query; none permits no inactive fields, and page-number permits
1378
+ only kind/page_param/size_param/size. Every request requires one positive page and, when named,
1379
+ one exact pinned size. New policies inherit no provider numeric aliases or cursor forms.
1380
+
1381
+ Declared headers are required once with exact values at every hop; omission, case duplicates and
1382
+ undeclared headers refuse. An absent header map selects the existing `accept: application/json`
1383
+ default; an explicit map is complete. Incremental engine validators are the only profile-header
1384
+ exception, and complete mode refuses them. Generated user-agent/accept-encoding remain engine/transport
1385
+ owned. Existing forbidden credential/override headers and transport stripping still apply.
1386
+ `PROVIDER_HEADER_RULES` is separate from `AUTH_PROVIDERS`: GitHub permits only an exact calendar-date
1387
+ `x-github-api-version` literal toward `api.github.com`. For anonymous sources use `auth: {kind: none}`,
1388
+ `domains: [api.github.com]`, and omit permission minima. Header-provider selection never creates a
1389
+ credential destination or bypasses keyless robots rules.
1390
+
1391
+ `inspectSourceReadPolicy(connectorAuthAndDomains, bound)` from `@superbee/core/connectors` is inert
1392
+ and throws on an invalid declaration/binding. It returns normalized scope and a digest binding
1393
+ request, source, resource, parameters, auth, domains and resolved policy/header semantics. The trusted
1394
+ embedding host supplies `readPolicyApproval: {contract: 1, digest}` to `observeSource` only after its
1395
+ own exact admission. Missing/stale approval refuses before profile callbacks, state replay or transport.
1396
+ The digest is publicly computable: it is a host assertion, not an unforgeable capability or proof of a
1397
+ human click. Caller rules can only narrow Core authority.
1398
+
1399
+ `SourceFixture.readPolicyApproval` forwards the same explicit assertion to the public recorded
1400
+ harness. It is fixture-only and grants no production consent. The CLI `source test` JSON schema does
1401
+ not carry that field and does not auto-approve new policies; use supported public Core/harness APIs
1402
+ for those recorded tests. Existing legacy fixtures require no new argument.
1403
+
1404
+ The local CLI previews new-policy bindings without importing code or reading credentials and uses
1405
+ existing `source bind --accept` to record exact consent. Any change requires explicit rebind and
1406
+ resets acquired state. Unchanged legacy issue declarations retain their historical pin and consent
1407
+ projections. Managed consumers remain denied without separately deployed operator admission; this
1408
+ public API does not establish deployed managed-host adoption. Trusted plugin code still runs with
1409
+ ambient process authority; the guarded transport is not a sandbox.
1410
+
1411
+ ## Declared Kind model
1412
+
1413
+ `@superbee/core/domain-model` exports `projectDomainModelV0(registry)` and its
1414
+ readonly input/output types. Pass a canonical registry from `buildKindRegistry`
1415
+ (`@superbee/core/kinds`) or `loadKinds`; the projection performs no parsing or I/O.
1416
+ It returns deeply frozen JSON with deterministically ordered Kind definitions,
1417
+ declared relationships, registry warnings and informational outside-scope endpoints.
1418
+ Structurally malformed inputs throw `TypeError`.
1419
+
1420
+ The v0 shape preserves authored array order and warning metadata. It does not
1421
+ include `fields.types`, derived `freshnessHorizonMs`, `order`, `undeclaredFields` or
1422
+ `deprecated`; adapters that already add these fields (`bundles.model.v1` does) keep
1423
+ that enrichment. Projection does not establish snapshot coherence,
1424
+ authorization or permission to disclose a bundle's declarations.
1425
+
1426
+ See [explicit recipe-set structural preflight](recipe-set-preflight.md) for the opt-in read-only composition checker and its evidence limits.
1427
+
1428
+ Finite data-only local observations use [Snapshot Sources](SNAPSHOT-SOURCES.md) through the existing source-engine and record-overlay owners.