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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (517) hide show
  1. package/README.md +1000 -0
  2. package/dist/artifact-contract.d.ts +90 -0
  3. package/dist/artifact-contract.d.ts.map +1 -0
  4. package/dist/artifact-contract.js +205 -0
  5. package/dist/artifact-contract.js.map +1 -0
  6. package/dist/backend.d.ts +19 -1
  7. package/dist/backend.d.ts.map +1 -1
  8. package/dist/backend.js +83 -36
  9. package/dist/backend.js.map +1 -1
  10. package/dist/blob-contract.d.ts +80 -0
  11. package/dist/blob-contract.d.ts.map +1 -0
  12. package/dist/blob-contract.js +131 -0
  13. package/dist/blob-contract.js.map +1 -0
  14. package/dist/blob-journal.d.ts +302 -0
  15. package/dist/blob-journal.d.ts.map +1 -0
  16. package/dist/blob-journal.js +540 -0
  17. package/dist/blob-journal.js.map +1 -0
  18. package/dist/body-replace-guards.d.ts +50 -0
  19. package/dist/body-replace-guards.d.ts.map +1 -0
  20. package/dist/body-replace-guards.js +158 -0
  21. package/dist/body-replace-guards.js.map +1 -0
  22. package/dist/builtin-recipes/content.d.ts +93 -0
  23. package/dist/builtin-recipes/content.d.ts.map +1 -0
  24. package/dist/builtin-recipes/content.js +288 -0
  25. package/dist/builtin-recipes/content.js.map +1 -0
  26. package/dist/builtin-recipes.d.ts +10 -0
  27. package/dist/builtin-recipes.d.ts.map +1 -0
  28. package/dist/builtin-recipes.js +97 -0
  29. package/dist/builtin-recipes.js.map +1 -0
  30. package/dist/bundle-health/index.d.ts +14 -0
  31. package/dist/bundle-health/index.d.ts.map +1 -0
  32. package/dist/bundle-health/index.js +12 -0
  33. package/dist/bundle-health/index.js.map +1 -0
  34. package/dist/bundle-health/kind-findings.d.ts +44 -0
  35. package/dist/bundle-health/kind-findings.d.ts.map +1 -0
  36. package/dist/bundle-health/kind-findings.js +68 -0
  37. package/dist/bundle-health/kind-findings.js.map +1 -0
  38. package/dist/bundle-health/legacy-page.d.ts +39 -0
  39. package/dist/bundle-health/legacy-page.d.ts.map +1 -0
  40. package/dist/bundle-health/legacy-page.js +50 -0
  41. package/dist/bundle-health/legacy-page.js.map +1 -0
  42. package/dist/bundle-health/report.d.ts +202 -0
  43. package/dist/bundle-health/report.d.ts.map +1 -0
  44. package/dist/bundle-health/report.js +438 -0
  45. package/dist/bundle-health/report.js.map +1 -0
  46. package/dist/bundle-ops.d.ts +1 -1
  47. package/dist/bundle-ops.d.ts.map +1 -1
  48. package/dist/bundle-ops.js +2 -2
  49. package/dist/bundle-ops.js.map +1 -1
  50. package/dist/bundle.d.ts +2 -1
  51. package/dist/bundle.d.ts.map +1 -1
  52. package/dist/bundle.js +3 -3
  53. package/dist/bundle.js.map +1 -1
  54. package/dist/code-point-order.d.ts +8 -0
  55. package/dist/code-point-order.d.ts.map +1 -0
  56. package/dist/code-point-order.js +20 -0
  57. package/dist/code-point-order.js.map +1 -0
  58. package/dist/connectors.d.ts +230 -0
  59. package/dist/connectors.d.ts.map +1 -0
  60. package/dist/connectors.js +1150 -0
  61. package/dist/connectors.js.map +1 -0
  62. package/dist/cross-bundle.d.ts +135 -0
  63. package/dist/cross-bundle.d.ts.map +1 -0
  64. package/dist/cross-bundle.js +186 -0
  65. package/dist/cross-bundle.js.map +1 -0
  66. package/dist/dependencies.d.ts +94 -0
  67. package/dist/dependencies.d.ts.map +1 -0
  68. package/dist/dependencies.js +180 -0
  69. package/dist/dependencies.js.map +1 -0
  70. package/dist/document-codec.d.ts +6 -1
  71. package/dist/document-codec.d.ts.map +1 -1
  72. package/dist/document-codec.js +8 -4
  73. package/dist/document-codec.js.map +1 -1
  74. package/dist/document-field-actions.d.ts +31 -1
  75. package/dist/document-field-actions.d.ts.map +1 -1
  76. package/dist/document-field-actions.js +137 -34
  77. package/dist/document-field-actions.js.map +1 -1
  78. package/dist/document-mutation.d.ts +22 -10
  79. package/dist/document-mutation.d.ts.map +1 -1
  80. package/dist/document-mutation.js +58 -27
  81. package/dist/document-mutation.js.map +1 -1
  82. package/dist/document-write-policy.d.ts.map +1 -1
  83. package/dist/document-write-policy.js +4 -2
  84. package/dist/document-write-policy.js.map +1 -1
  85. package/dist/engine.d.ts +9 -2
  86. package/dist/engine.d.ts.map +1 -1
  87. package/dist/engine.js +11 -4
  88. package/dist/engine.js.map +1 -1
  89. package/dist/file-journaled-backend-internal.d.ts +21 -0
  90. package/dist/file-journaled-backend-internal.d.ts.map +1 -0
  91. package/dist/file-journaled-backend-internal.js +12 -0
  92. package/dist/file-journaled-backend-internal.js.map +1 -0
  93. package/dist/file-journaled-backend.d.ts +200 -0
  94. package/dist/file-journaled-backend.d.ts.map +1 -0
  95. package/dist/file-journaled-backend.js +1334 -0
  96. package/dist/file-journaled-backend.js.map +1 -0
  97. package/dist/filesystem-host.d.ts +15 -0
  98. package/dist/filesystem-host.d.ts.map +1 -0
  99. package/dist/filesystem-host.js +20 -0
  100. package/dist/filesystem-host.js.map +1 -0
  101. package/dist/filesystem-identity.d.ts +86 -4
  102. package/dist/filesystem-identity.d.ts.map +1 -1
  103. package/dist/filesystem-identity.js +338 -102
  104. package/dist/filesystem-identity.js.map +1 -1
  105. package/dist/filesystem-lock.d.ts +16 -3
  106. package/dist/filesystem-lock.d.ts.map +1 -1
  107. package/dist/filesystem-lock.js +323 -77
  108. package/dist/filesystem-lock.js.map +1 -1
  109. package/dist/filesystem-push-role.d.ts +77 -0
  110. package/dist/filesystem-push-role.d.ts.map +1 -0
  111. package/dist/filesystem-push-role.js +165 -0
  112. package/dist/filesystem-push-role.js.map +1 -0
  113. package/dist/filesystem.d.ts +17 -0
  114. package/dist/filesystem.d.ts.map +1 -0
  115. package/dist/filesystem.js +18 -0
  116. package/dist/filesystem.js.map +1 -0
  117. package/dist/frontmatter.d.ts +8 -0
  118. package/dist/frontmatter.d.ts.map +1 -1
  119. package/dist/frontmatter.js +14 -4
  120. package/dist/frontmatter.js.map +1 -1
  121. package/dist/governed-body-write.d.ts +106 -0
  122. package/dist/governed-body-write.d.ts.map +1 -0
  123. package/dist/governed-body-write.js +251 -0
  124. package/dist/governed-body-write.js.map +1 -0
  125. package/dist/host-policy-snapshot.d.ts +9 -0
  126. package/dist/host-policy-snapshot.d.ts.map +1 -0
  127. package/dist/host-policy-snapshot.js +33 -0
  128. package/dist/host-policy-snapshot.js.map +1 -0
  129. package/dist/host-text.d.ts +31 -0
  130. package/dist/host-text.d.ts.map +1 -0
  131. package/dist/host-text.js +77 -0
  132. package/dist/host-text.js.map +1 -0
  133. package/dist/hosted-client/binding.d.ts +7 -0
  134. package/dist/hosted-client/binding.d.ts.map +1 -0
  135. package/dist/hosted-client/binding.js +10 -0
  136. package/dist/hosted-client/binding.js.map +1 -0
  137. package/dist/hosted-client/blob-delivery.d.ts +67 -0
  138. package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
  139. package/dist/hosted-client/blob-delivery.js +169 -0
  140. package/dist/hosted-client/blob-delivery.js.map +1 -0
  141. package/dist/hosted-client/blob-write.d.ts +386 -0
  142. package/dist/hosted-client/blob-write.d.ts.map +1 -0
  143. package/dist/hosted-client/blob-write.js +770 -0
  144. package/dist/hosted-client/blob-write.js.map +1 -0
  145. package/dist/hosted-client/bundle-listing.d.ts +46 -0
  146. package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
  147. package/dist/hosted-client/bundle-listing.js +36 -0
  148. package/dist/hosted-client/bundle-listing.js.map +1 -0
  149. package/dist/hosted-client/client.d.ts +219 -0
  150. package/dist/hosted-client/client.d.ts.map +1 -0
  151. package/dist/hosted-client/client.js +309 -0
  152. package/dist/hosted-client/client.js.map +1 -0
  153. package/dist/hosted-client/directory.d.ts +46 -0
  154. package/dist/hosted-client/directory.d.ts.map +1 -0
  155. package/dist/hosted-client/directory.js +74 -0
  156. package/dist/hosted-client/directory.js.map +1 -0
  157. package/dist/hosted-client/errors.d.ts +26 -0
  158. package/dist/hosted-client/errors.d.ts.map +1 -0
  159. package/dist/hosted-client/errors.js +35 -0
  160. package/dist/hosted-client/errors.js.map +1 -0
  161. package/dist/hosted-client/inbox.d.ts +320 -0
  162. package/dist/hosted-client/inbox.d.ts.map +1 -0
  163. package/dist/hosted-client/inbox.js +379 -0
  164. package/dist/hosted-client/inbox.js.map +1 -0
  165. package/dist/hosted-client/index.d.ts +30 -0
  166. package/dist/hosted-client/index.d.ts.map +1 -0
  167. package/dist/hosted-client/index.js +32 -0
  168. package/dist/hosted-client/index.js.map +1 -0
  169. package/dist/hosted-client/journal.d.ts +103 -0
  170. package/dist/hosted-client/journal.d.ts.map +1 -0
  171. package/dist/hosted-client/journal.js +464 -0
  172. package/dist/hosted-client/journal.js.map +1 -0
  173. package/dist/hosted-client/node.d.ts +74 -0
  174. package/dist/hosted-client/node.d.ts.map +1 -0
  175. package/dist/hosted-client/node.js +219 -0
  176. package/dist/hosted-client/node.js.map +1 -0
  177. package/dist/hosted-client/reference.d.ts +12 -0
  178. package/dist/hosted-client/reference.d.ts.map +1 -0
  179. package/dist/hosted-client/reference.js +29 -0
  180. package/dist/hosted-client/reference.js.map +1 -0
  181. package/dist/hosted-client/write.d.ts +217 -0
  182. package/dist/hosted-client/write.d.ts.map +1 -0
  183. package/dist/hosted-client/write.js +418 -0
  184. package/dist/hosted-client/write.js.map +1 -0
  185. package/dist/hosted-transport/answer-rows.d.ts +243 -0
  186. package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
  187. package/dist/hosted-transport/answer-rows.js +454 -0
  188. package/dist/hosted-transport/answer-rows.js.map +1 -0
  189. package/dist/hosted-transport/blob-reads.d.ts +35 -0
  190. package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
  191. package/dist/hosted-transport/blob-reads.js +179 -0
  192. package/dist/hosted-transport/blob-reads.js.map +1 -0
  193. package/dist/hosted-transport/blob-write.d.ts +34 -0
  194. package/dist/hosted-transport/blob-write.d.ts.map +1 -0
  195. package/dist/hosted-transport/blob-write.js +115 -0
  196. package/dist/hosted-transport/blob-write.js.map +1 -0
  197. package/dist/hosted-transport/carrier.d.ts +151 -0
  198. package/dist/hosted-transport/carrier.d.ts.map +1 -0
  199. package/dist/hosted-transport/carrier.js +260 -0
  200. package/dist/hosted-transport/carrier.js.map +1 -0
  201. package/dist/hosted-transport/history-pages.d.ts +55 -0
  202. package/dist/hosted-transport/history-pages.d.ts.map +1 -0
  203. package/dist/hosted-transport/history-pages.js +69 -0
  204. package/dist/hosted-transport/history-pages.js.map +1 -0
  205. package/dist/hosted-transport/index.d.ts +18 -0
  206. package/dist/hosted-transport/index.d.ts.map +1 -0
  207. package/dist/hosted-transport/index.js +18 -0
  208. package/dist/hosted-transport/index.js.map +1 -0
  209. package/dist/hosted-transport/operations.d.ts +85 -0
  210. package/dist/hosted-transport/operations.d.ts.map +1 -0
  211. package/dist/hosted-transport/operations.js +128 -0
  212. package/dist/hosted-transport/operations.js.map +1 -0
  213. package/dist/hosted-transport/paged-reads.d.ts +87 -0
  214. package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
  215. package/dist/hosted-transport/paged-reads.js +238 -0
  216. package/dist/hosted-transport/paged-reads.js.map +1 -0
  217. package/dist/hosted-transport/read-adapter.d.ts +256 -0
  218. package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
  219. package/dist/hosted-transport/read-adapter.js +568 -0
  220. package/dist/hosted-transport/read-adapter.js.map +1 -0
  221. package/dist/hosted-transport/root-write.d.ts +114 -0
  222. package/dist/hosted-transport/root-write.d.ts.map +1 -0
  223. package/dist/hosted-transport/root-write.js +171 -0
  224. package/dist/hosted-transport/root-write.js.map +1 -0
  225. package/dist/hosted-transport/whole-document-transport.d.ts +204 -0
  226. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
  227. package/dist/hosted-transport/whole-document-transport.js +447 -0
  228. package/dist/hosted-transport/whole-document-transport.js.map +1 -0
  229. package/dist/index.d.ts +34 -10
  230. package/dist/index.d.ts.map +1 -1
  231. package/dist/index.js +26 -8
  232. package/dist/index.js.map +1 -1
  233. package/dist/indexeddb-backend.d.ts +28 -6
  234. package/dist/indexeddb-backend.d.ts.map +1 -1
  235. package/dist/indexeddb-backend.js +471 -92
  236. package/dist/indexeddb-backend.js.map +1 -1
  237. package/dist/journaled-backend.d.ts +247 -10
  238. package/dist/journaled-backend.d.ts.map +1 -1
  239. package/dist/journaled-backend.js +302 -1
  240. package/dist/journaled-backend.js.map +1 -1
  241. package/dist/kind-authoring.d.ts +170 -0
  242. package/dist/kind-authoring.d.ts.map +1 -0
  243. package/dist/kind-authoring.js +451 -0
  244. package/dist/kind-authoring.js.map +1 -0
  245. package/dist/kind-conformance-error.d.ts +15 -0
  246. package/dist/kind-conformance-error.d.ts.map +1 -0
  247. package/dist/kind-conformance-error.js +20 -0
  248. package/dist/kind-conformance-error.js.map +1 -0
  249. package/dist/kind-coverage.d.ts +99 -0
  250. package/dist/kind-coverage.d.ts.map +1 -0
  251. package/dist/kind-coverage.js +186 -0
  252. package/dist/kind-coverage.js.map +1 -0
  253. package/dist/kind-field-mutation.d.ts +4 -0
  254. package/dist/kind-field-mutation.d.ts.map +1 -1
  255. package/dist/kind-field-mutation.js +28 -3
  256. package/dist/kind-field-mutation.js.map +1 -1
  257. package/dist/kinds-load.js +4 -4
  258. package/dist/kinds-load.js.map +1 -1
  259. package/dist/kinds.d.ts +65 -2
  260. package/dist/kinds.d.ts.map +1 -1
  261. package/dist/kinds.js +341 -21
  262. package/dist/kinds.js.map +1 -1
  263. package/dist/link-types.d.ts +26 -0
  264. package/dist/link-types.d.ts.map +1 -0
  265. package/dist/link-types.js +57 -0
  266. package/dist/link-types.js.map +1 -0
  267. package/dist/links.d.ts +21 -3
  268. package/dist/links.d.ts.map +1 -1
  269. package/dist/links.js +213 -14
  270. package/dist/links.js.map +1 -1
  271. package/dist/managed-document-metadata.d.ts +2 -0
  272. package/dist/managed-document-metadata.d.ts.map +1 -0
  273. package/dist/managed-document-metadata.js +9 -0
  274. package/dist/managed-document-metadata.js.map +1 -0
  275. package/dist/memory-backend.d.ts +2 -2
  276. package/dist/memory-backend.d.ts.map +1 -1
  277. package/dist/memory-backend.js +26 -11
  278. package/dist/memory-backend.js.map +1 -1
  279. package/dist/paths.d.ts +16 -0
  280. package/dist/paths.d.ts.map +1 -1
  281. package/dist/paths.js +25 -0
  282. package/dist/paths.js.map +1 -1
  283. package/dist/platform.d.ts +13 -2
  284. package/dist/platform.d.ts.map +1 -1
  285. package/dist/platform.js +16 -0
  286. package/dist/platform.js.map +1 -1
  287. package/dist/portable-export.d.ts +119 -0
  288. package/dist/portable-export.d.ts.map +1 -0
  289. package/dist/portable-export.js +501 -0
  290. package/dist/portable-export.js.map +1 -0
  291. package/dist/publication-filesystem.d.ts +1 -1
  292. package/dist/publication-filesystem.d.ts.map +1 -1
  293. package/dist/publication-filesystem.js +1 -1
  294. package/dist/publication-filesystem.js.map +1 -1
  295. package/dist/qualified-links.d.ts +67 -0
  296. package/dist/qualified-links.d.ts.map +1 -0
  297. package/dist/qualified-links.js +117 -0
  298. package/dist/qualified-links.js.map +1 -0
  299. package/dist/query-filter.d.ts +16 -2
  300. package/dist/query-filter.d.ts.map +1 -1
  301. package/dist/query-filter.js +40 -1
  302. package/dist/query-filter.js.map +1 -1
  303. package/dist/query-order.d.ts +22 -0
  304. package/dist/query-order.d.ts.map +1 -0
  305. package/dist/query-order.js +42 -0
  306. package/dist/query-order.js.map +1 -0
  307. package/dist/recipe-lifecycle/errors.d.ts +94 -0
  308. package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
  309. package/dist/recipe-lifecycle/errors.js +122 -0
  310. package/dist/recipe-lifecycle/errors.js.map +1 -0
  311. package/dist/recipe-lifecycle/evolution.d.ts +75 -0
  312. package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
  313. package/dist/recipe-lifecycle/evolution.js +789 -0
  314. package/dist/recipe-lifecycle/evolution.js.map +1 -0
  315. package/dist/recipe-lifecycle/index.d.ts +24 -0
  316. package/dist/recipe-lifecycle/index.d.ts.map +1 -0
  317. package/dist/recipe-lifecycle/index.js +20 -0
  318. package/dist/recipe-lifecycle/index.js.map +1 -0
  319. package/dist/recipe-lifecycle/install.d.ts +126 -0
  320. package/dist/recipe-lifecycle/install.d.ts.map +1 -0
  321. package/dist/recipe-lifecycle/install.js +511 -0
  322. package/dist/recipe-lifecycle/install.js.map +1 -0
  323. package/dist/recipe-lifecycle/legacy-aliases.d.ts +16 -0
  324. package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
  325. package/dist/recipe-lifecycle/legacy-aliases.js +51 -0
  326. package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
  327. package/dist/recipe-lifecycle/stamp.d.ts +136 -0
  328. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
  329. package/dist/recipe-lifecycle/stamp.js +326 -0
  330. package/dist/recipe-lifecycle/stamp.js.map +1 -0
  331. package/dist/recipes.d.ts +29 -1
  332. package/dist/recipes.d.ts.map +1 -1
  333. package/dist/recipes.js +137 -1
  334. package/dist/recipes.js.map +1 -1
  335. package/dist/record-overlay/apply.d.ts +43 -0
  336. package/dist/record-overlay/apply.d.ts.map +1 -0
  337. package/dist/record-overlay/apply.js +527 -0
  338. package/dist/record-overlay/apply.js.map +1 -0
  339. package/dist/record-overlay/canonical.d.ts +22 -0
  340. package/dist/record-overlay/canonical.d.ts.map +1 -0
  341. package/dist/record-overlay/canonical.js +47 -0
  342. package/dist/record-overlay/canonical.js.map +1 -0
  343. package/dist/record-overlay/digest.d.ts +4 -0
  344. package/dist/record-overlay/digest.d.ts.map +1 -0
  345. package/dist/record-overlay/digest.js +11 -0
  346. package/dist/record-overlay/digest.js.map +1 -0
  347. package/dist/record-overlay/errors.d.ts +44 -0
  348. package/dist/record-overlay/errors.d.ts.map +1 -0
  349. package/dist/record-overlay/errors.js +55 -0
  350. package/dist/record-overlay/errors.js.map +1 -0
  351. package/dist/record-overlay/findings.d.ts +5 -0
  352. package/dist/record-overlay/findings.d.ts.map +1 -0
  353. package/dist/record-overlay/findings.js +83 -0
  354. package/dist/record-overlay/findings.js.map +1 -0
  355. package/dist/record-overlay/index.d.ts +23 -0
  356. package/dist/record-overlay/index.d.ts.map +1 -0
  357. package/dist/record-overlay/index.js +21 -0
  358. package/dist/record-overlay/index.js.map +1 -0
  359. package/dist/record-overlay/plan.d.ts +12 -0
  360. package/dist/record-overlay/plan.d.ts.map +1 -0
  361. package/dist/record-overlay/plan.js +285 -0
  362. package/dist/record-overlay/plan.js.map +1 -0
  363. package/dist/record-overlay/policy.d.ts +69 -0
  364. package/dist/record-overlay/policy.d.ts.map +1 -0
  365. package/dist/record-overlay/policy.js +228 -0
  366. package/dist/record-overlay/policy.js.map +1 -0
  367. package/dist/record-overlay/redact.d.ts +3 -0
  368. package/dist/record-overlay/redact.d.ts.map +1 -0
  369. package/dist/record-overlay/redact.js +27 -0
  370. package/dist/record-overlay/redact.js.map +1 -0
  371. package/dist/record-overlay/signal-kind.d.ts +30 -0
  372. package/dist/record-overlay/signal-kind.d.ts.map +1 -0
  373. package/dist/record-overlay/signal-kind.js +38 -0
  374. package/dist/record-overlay/signal-kind.js.map +1 -0
  375. package/dist/record-overlay/signal-text.d.ts +45 -0
  376. package/dist/record-overlay/signal-text.d.ts.map +1 -0
  377. package/dist/record-overlay/signal-text.js +116 -0
  378. package/dist/record-overlay/signal-text.js.map +1 -0
  379. package/dist/record-overlay/source-index.d.ts +19 -0
  380. package/dist/record-overlay/source-index.d.ts.map +1 -0
  381. package/dist/record-overlay/source-index.js +102 -0
  382. package/dist/record-overlay/source-index.js.map +1 -0
  383. package/dist/record-overlay/types.d.ts +291 -0
  384. package/dist/record-overlay/types.d.ts.map +1 -0
  385. package/dist/record-overlay/types.js +2 -0
  386. package/dist/record-overlay/types.js.map +1 -0
  387. package/dist/remote-backend.d.ts +67 -67
  388. package/dist/remote-backend.d.ts.map +1 -1
  389. package/dist/remote-backend.js +169 -201
  390. package/dist/remote-backend.js.map +1 -1
  391. package/dist/remote-document-codec.d.ts +15 -0
  392. package/dist/remote-document-codec.d.ts.map +1 -0
  393. package/dist/remote-document-codec.js +103 -0
  394. package/dist/remote-document-codec.js.map +1 -0
  395. package/dist/remote-error.d.ts +38 -0
  396. package/dist/remote-error.d.ts.map +1 -0
  397. package/dist/remote-error.js +59 -0
  398. package/dist/remote-error.js.map +1 -0
  399. package/dist/remote-operations.d.ts +6 -3
  400. package/dist/remote-operations.d.ts.map +1 -1
  401. package/dist/remote-operations.js +23 -5
  402. package/dist/remote-operations.js.map +1 -1
  403. package/dist/remote-parsers.d.ts +86 -0
  404. package/dist/remote-parsers.d.ts.map +1 -0
  405. package/dist/remote-parsers.js +181 -0
  406. package/dist/remote-parsers.js.map +1 -0
  407. package/dist/remote.d.ts +5 -2
  408. package/dist/remote.d.ts.map +1 -1
  409. package/dist/remote.js +5 -1
  410. package/dist/remote.js.map +1 -1
  411. package/dist/search/backend-source.d.ts +6 -0
  412. package/dist/search/backend-source.d.ts.map +1 -0
  413. package/dist/search/backend-source.js +33 -0
  414. package/dist/search/backend-source.js.map +1 -0
  415. package/dist/search/contract.d.ts +151 -0
  416. package/dist/search/contract.d.ts.map +1 -0
  417. package/dist/search/contract.js +78 -0
  418. package/dist/search/contract.js.map +1 -0
  419. package/dist/search/errors.d.ts +30 -0
  420. package/dist/search/errors.d.ts.map +1 -0
  421. package/dist/search/errors.js +50 -0
  422. package/dist/search/errors.js.map +1 -0
  423. package/dist/search/identity.d.ts +12 -0
  424. package/dist/search/identity.d.ts.map +1 -0
  425. package/dist/search/identity.js +90 -0
  426. package/dist/search/identity.js.map +1 -0
  427. package/dist/search/index.d.ts +16 -0
  428. package/dist/search/index.d.ts.map +1 -0
  429. package/dist/search/index.js +15 -0
  430. package/dist/search/index.js.map +1 -0
  431. package/dist/search/memory-source.d.ts +36 -0
  432. package/dist/search/memory-source.d.ts.map +1 -0
  433. package/dist/search/memory-source.js +235 -0
  434. package/dist/search/memory-source.js.map +1 -0
  435. package/dist/search/rank.d.ts +34 -0
  436. package/dist/search/rank.d.ts.map +1 -0
  437. package/dist/search/rank.js +129 -0
  438. package/dist/search/rank.js.map +1 -0
  439. package/dist/search/row-text.d.ts +38 -0
  440. package/dist/search/row-text.d.ts.map +1 -0
  441. package/dist/search/row-text.js +88 -0
  442. package/dist/search/row-text.js.map +1 -0
  443. package/dist/search/search.d.ts +28 -0
  444. package/dist/search/search.d.ts.map +1 -0
  445. package/dist/search/search.js +257 -0
  446. package/dist/search/search.js.map +1 -0
  447. package/dist/search/source.d.ts +67 -0
  448. package/dist/search/source.d.ts.map +1 -0
  449. package/dist/search/source.js +2 -0
  450. package/dist/search/source.js.map +1 -0
  451. package/dist/search/text.d.ts +47 -0
  452. package/dist/search/text.d.ts.map +1 -0
  453. package/dist/search/text.js +148 -0
  454. package/dist/search/text.js.map +1 -0
  455. package/dist/site-capabilities.d.ts +339 -0
  456. package/dist/site-capabilities.d.ts.map +1 -0
  457. package/dist/site-capabilities.js +717 -0
  458. package/dist/site-capabilities.js.map +1 -0
  459. package/dist/source-engine/guard.d.ts +82 -0
  460. package/dist/source-engine/guard.d.ts.map +1 -0
  461. package/dist/source-engine/guard.js +396 -0
  462. package/dist/source-engine/guard.js.map +1 -0
  463. package/dist/source-engine/index.d.ts +24 -0
  464. package/dist/source-engine/index.d.ts.map +1 -0
  465. package/dist/source-engine/index.js +20 -0
  466. package/dist/source-engine/index.js.map +1 -0
  467. package/dist/source-engine/machine-state.d.ts +74 -0
  468. package/dist/source-engine/machine-state.d.ts.map +1 -0
  469. package/dist/source-engine/machine-state.js +48 -0
  470. package/dist/source-engine/machine-state.js.map +1 -0
  471. package/dist/source-engine/observe.d.ts +18 -0
  472. package/dist/source-engine/observe.d.ts.map +1 -0
  473. package/dist/source-engine/observe.js +598 -0
  474. package/dist/source-engine/observe.js.map +1 -0
  475. package/dist/source-engine/robots.d.ts +53 -0
  476. package/dist/source-engine/robots.d.ts.map +1 -0
  477. package/dist/source-engine/robots.js +158 -0
  478. package/dist/source-engine/robots.js.map +1 -0
  479. package/dist/source-engine/types.d.ts +285 -0
  480. package/dist/source-engine/types.d.ts.map +1 -0
  481. package/dist/source-engine/types.js +2 -0
  482. package/dist/source-engine/types.js.map +1 -0
  483. package/dist/source-harness/conformance.d.ts +16 -0
  484. package/dist/source-harness/conformance.d.ts.map +1 -0
  485. package/dist/source-harness/conformance.js +265 -0
  486. package/dist/source-harness/conformance.js.map +1 -0
  487. package/dist/source-harness/fixture.d.ts +95 -0
  488. package/dist/source-harness/fixture.d.ts.map +1 -0
  489. package/dist/source-harness/fixture.js +261 -0
  490. package/dist/source-harness/fixture.js.map +1 -0
  491. package/dist/source-harness/index.d.ts +22 -0
  492. package/dist/source-harness/index.d.ts.map +1 -0
  493. package/dist/source-harness/index.js +19 -0
  494. package/dist/source-harness/index.js.map +1 -0
  495. package/dist/source-harness/peer.d.ts +74 -0
  496. package/dist/source-harness/peer.d.ts.map +1 -0
  497. package/dist/source-harness/peer.js +106 -0
  498. package/dist/source-harness/peer.js.map +1 -0
  499. package/dist/storage.d.ts +6 -2
  500. package/dist/storage.d.ts.map +1 -1
  501. package/dist/storage.js +4 -1
  502. package/dist/storage.js.map +1 -1
  503. package/dist/types.d.ts +33 -5
  504. package/dist/types.d.ts.map +1 -1
  505. package/dist/uncertain-write.d.ts +156 -19
  506. package/dist/uncertain-write.d.ts.map +1 -1
  507. package/dist/uncertain-write.js +90 -31
  508. package/dist/uncertain-write.js.map +1 -1
  509. package/dist/versioning.d.ts +9 -4
  510. package/dist/versioning.d.ts.map +1 -1
  511. package/dist/versioning.js +9 -4
  512. package/dist/versioning.js.map +1 -1
  513. package/dist/write-identity.d.ts +5 -0
  514. package/dist/write-identity.d.ts.map +1 -0
  515. package/dist/write-identity.js +9 -0
  516. package/dist/write-identity.js.map +1 -0
  517. package/package.json +94 -2
@@ -0,0 +1,291 @@
1
+ /** Types of `@superbee/core/record-overlay`. Step and result rows keep the record-bridge keys. */
2
+ import type { DocumentMutationCandidate } from "../document-mutation.js";
3
+ import type { KindConvention, KindRegistry } from "../kinds.js";
4
+ import type { Bundle, ConceptId, Frontmatter, OkfDocument, Version } from "../types.js";
5
+ import type { RefusalCode } from "./errors.js";
6
+ import type { SourceIndex } from "./source-index.js";
7
+ /** One bundle as the overlay reads and writes it. */
8
+ export interface OverlayBundle {
9
+ bundle: Bundle;
10
+ registry: KindRegistry;
11
+ okfVersion: "0.1" | "0.2";
12
+ }
13
+ /** The generic Source Feed policy: which fields a feed owns and what each change kind may do. */
14
+ export interface OverlayPolicy {
15
+ feed: ConceptId;
16
+ /** The provider identity (`url`), as `sources[].resource` names it. */
17
+ provider: string;
18
+ /** The Kind of the overlay documents. Absent for a record-only or presentation-only feed. */
19
+ target_kind?: string;
20
+ owned_fields: string[];
21
+ auto_apply: string[];
22
+ needs_review: string[];
23
+ missing_threshold?: number;
24
+ completeness?: "complete" | "partial";
25
+ /** The feed's wall-time zone, validated by whoever owns the interval hook. */
26
+ time_zone?: string;
27
+ exclude?: RegExp | null;
28
+ exclude_ids?: ReadonlySet<string> | null;
29
+ /**
30
+ * The target Kind's `string-list` and `https-url-list` fields, which change detection compares as
31
+ * sets. Present only when the reader was given a target Kind that declares one.
32
+ */
33
+ list_fields?: string[];
34
+ }
35
+ /** Field checks for the reader: the target Kind's declared fields, or a presentation kind's fields. */
36
+ export type PolicyContext = {
37
+ targetKind?: KindConvention;
38
+ presentationFields?: never;
39
+ } | {
40
+ presentationFields: readonly string[];
41
+ targetKind?: never;
42
+ };
43
+ /** One change the caller's diff observed for one external record. */
44
+ export interface RecordChange {
45
+ external_id: string;
46
+ change_kind: string;
47
+ changed_fields: string[];
48
+ before: Record<string, unknown> | null;
49
+ after: Record<string, unknown> | null;
50
+ content_digest: string;
51
+ occurs_at?: string;
52
+ missing_count?: number;
53
+ first_missing_at?: string;
54
+ collapse_with?: string[];
55
+ signal_priority?: string;
56
+ }
57
+ export interface Tell {
58
+ code: string;
59
+ match: string;
60
+ [property: string]: unknown;
61
+ }
62
+ /** A publication text gate: the text as it may be written, and whether it may be written at all. */
63
+ export type TextGate = (text: string, context: {
64
+ field: string;
65
+ kind: string | undefined;
66
+ }) => {
67
+ text: string;
68
+ ok: boolean;
69
+ tells: Tell[];
70
+ changed?: boolean;
71
+ };
72
+ /** `[startMs, endMs)` of a record's last known occurrence, or null when its dates are unknown. */
73
+ export type IntervalHook = (fields: Record<string, unknown>, timeZone: string | undefined) => readonly [number, number] | null;
74
+ export type DisappearedPhase = "ended" | "before-start" | "ongoing" | null;
75
+ export interface CorrelateHook {
76
+ kind: string;
77
+ match: (fields: Record<string, unknown>, frontmatter: Frontmatter, externalId: string) => null | undefined | {
78
+ reason: string;
79
+ priority?: string;
80
+ };
81
+ }
82
+ /** Runs on every fresh candidate through `mutateDocument`, after the core-owned guards. */
83
+ export type AssertCandidate = (existing: OkfDocument | undefined, candidate: DocumentMutationCandidate) => void | Promise<void>;
84
+ export interface OverlayHooks {
85
+ textGate?: TextGate;
86
+ interval?: IntervalHook;
87
+ correlate?: CorrelateHook;
88
+ /** Scalar properties for the `sources` entry of an applied record; none means no upsert. */
89
+ sourceProperties?: (change: RecordChange) => Record<string, string | number | boolean> | undefined;
90
+ /** Site rules, run after the core-owned guards on the same fresh read. */
91
+ assertCandidate?: (existing: OkfDocument | undefined, candidate: DocumentMutationCandidate, context: {
92
+ step: OverlayStep["op"];
93
+ bundle: "content" | "ops";
94
+ }) => void | Promise<void>;
95
+ /** Fields derived in the same write as the owned fields (for example `updated_at`). */
96
+ deriveFields?: {
97
+ fields: readonly string[];
98
+ derive: (existing: OkfDocument, next: DocumentMutationCandidate) => Record<string, unknown>;
99
+ };
100
+ }
101
+ export interface ChangeDecision {
102
+ apply: Record<string, {
103
+ from: unknown;
104
+ to: unknown;
105
+ }>;
106
+ conflicts: Array<{
107
+ field: string;
108
+ doc_value: unknown;
109
+ feed_before: unknown;
110
+ feed_after: unknown;
111
+ }>;
112
+ editorFields: string[];
113
+ wording: Array<{
114
+ field: string;
115
+ text: string;
116
+ tells: Tell[];
117
+ }>;
118
+ signal: null | {
119
+ priority: string;
120
+ reasons: string[];
121
+ };
122
+ }
123
+ export interface PlanInput {
124
+ content: OverlayBundle;
125
+ ops: OverlayBundle;
126
+ policy: OverlayPolicy;
127
+ changes: readonly RecordChange[];
128
+ observedAt: string;
129
+ /** Next store records, for titles. */
130
+ records?: Record<string, {
131
+ fields?: Record<string, unknown>;
132
+ }>;
133
+ observation?: {
134
+ baseline?: boolean;
135
+ replay?: boolean;
136
+ stats?: Record<string, unknown>;
137
+ };
138
+ /** A per-run identity index; without one the plan builds its own for this provider and Kind. */
139
+ overlays?: SourceIndex;
140
+ timeZone?: string;
141
+ /** Ops and content are one bundle, so typed `about` links are possible. */
142
+ sameBundle?: boolean;
143
+ /** Attention and feed Kind names; default `Signal` and `Source Feed`. */
144
+ signals?: {
145
+ kind?: string;
146
+ feedKind?: string;
147
+ };
148
+ hooks?: OverlayHooks;
149
+ }
150
+ export interface Finding {
151
+ key: string;
152
+ title: string;
153
+ summary?: string;
154
+ priority?: string;
155
+ about_doc?: string;
156
+ related?: string[];
157
+ facts?: unknown;
158
+ sources?: Array<{
159
+ resource: string;
160
+ id?: string;
161
+ title?: string;
162
+ [property: string]: unknown;
163
+ }>;
164
+ external_id?: string;
165
+ expires_at?: string;
166
+ change_kind?: string;
167
+ }
168
+ export interface FindingsInput {
169
+ ops: OverlayBundle;
170
+ /** Signal `provider`: a feed URL or a tool name. */
171
+ provider: string;
172
+ /** Source Feed id for the `from feed` link; absent for tool-raised findings. */
173
+ feed?: ConceptId;
174
+ /** Signal id prefix after the attention Kind's path. */
175
+ slug: string;
176
+ findings: readonly Finding[] | null | undefined;
177
+ observedAt: string;
178
+ signals?: {
179
+ kind?: string;
180
+ feedKind?: string;
181
+ };
182
+ }
183
+ export interface ApplyContext {
184
+ content: OverlayBundle;
185
+ ops: OverlayBundle;
186
+ policy: Pick<OverlayPolicy, "owned_fields" | "provider" | "target_kind">;
187
+ actor: string;
188
+ overlays?: SourceIndex;
189
+ /** Attention and feed Kind names, as the plan was made with; default `Signal` and `Source Feed`. */
190
+ signals?: {
191
+ kind?: string;
192
+ feedKind?: string;
193
+ };
194
+ hooks?: Pick<OverlayHooks, "assertCandidate" | "deriveFields">;
195
+ }
196
+ export interface ApplyOwnedFieldsStep {
197
+ op: "apply-owned-fields";
198
+ target: ConceptId;
199
+ expected_version: Version;
200
+ external_id: string;
201
+ change_kind: string;
202
+ fields: Record<string, {
203
+ from: unknown;
204
+ to: unknown;
205
+ }>;
206
+ /** Grouped shape: properties upserted on the record's `sources` entry in the same write. */
207
+ sources?: Record<string, string | number | boolean>;
208
+ }
209
+ export interface CreateSignalStep {
210
+ op: "create-signal";
211
+ target: ConceptId;
212
+ external_id: string;
213
+ content_digest: string;
214
+ finding?: string;
215
+ reasons: string[];
216
+ candidate: {
217
+ frontmatter: Frontmatter;
218
+ body: string;
219
+ };
220
+ }
221
+ export interface CollapseSignalStep {
222
+ op: "collapse-signal";
223
+ target: ConceptId;
224
+ expected_version: Version;
225
+ external_id: string;
226
+ content_digest: string;
227
+ finding?: string;
228
+ progress_field: string;
229
+ observation_line: string;
230
+ set: Record<string, unknown>;
231
+ }
232
+ export interface SignalDuplicateStep {
233
+ op: "signal-duplicate";
234
+ target: ConceptId;
235
+ external_id: string;
236
+ content_digest: string;
237
+ finding?: string;
238
+ }
239
+ export interface RecordOnlyStep {
240
+ op: "record-only";
241
+ target?: undefined;
242
+ external_id: string;
243
+ change_kind?: string;
244
+ superseded?: true;
245
+ ended?: true;
246
+ reason?: string;
247
+ last_known_end?: string;
248
+ excluded?: true;
249
+ collapsed_into?: ConceptId;
250
+ }
251
+ export type OverlayStep = ApplyOwnedFieldsStep | CreateSignalStep | CollapseSignalStep | SignalDuplicateStep | RecordOnlyStep;
252
+ export interface RefusalRow {
253
+ code: RefusalCode;
254
+ external_id: string;
255
+ target?: ConceptId;
256
+ targets?: ConceptId[];
257
+ field?: string;
258
+ message: string;
259
+ }
260
+ export interface OverlayPlan {
261
+ feed: ConceptId | null;
262
+ provider: string;
263
+ observed_at: string;
264
+ baseline?: boolean;
265
+ replay?: boolean;
266
+ stats?: Record<string, unknown>;
267
+ steps: OverlayStep[];
268
+ refusals: RefusalRow[];
269
+ diagnostics?: unknown[];
270
+ }
271
+ export interface StepResult {
272
+ op: OverlayStep["op"];
273
+ target: ConceptId | null;
274
+ external_id: string;
275
+ outcome: "applied" | "unchanged" | "skipped" | "refused";
276
+ version?: Version;
277
+ code?: RefusalCode;
278
+ message?: string;
279
+ details?: Record<string, unknown>;
280
+ reason?: string;
281
+ last_known_end?: string;
282
+ }
283
+ export interface OverlayReceipt {
284
+ feed: ConceptId | null;
285
+ provider: string;
286
+ observed_at: string;
287
+ results: StepResult[];
288
+ refusals: RefusalRow[];
289
+ diagnostics: unknown[];
290
+ }
291
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/record-overlay/types.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,UAAU,EAAE,KAAK,GAAG,KAAK,CAAC;CAC3B;AAED,iGAAiG;AACjG,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,6FAA6F;IAC7F,WAAW,CAAC,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,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,WAAW,EAAE,OAAO,EAAE,CAAC;CACxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/record-overlay/types.ts"],"names":[],"mappings":""}
@@ -2,12 +2,14 @@
2
2
  * `RemoteBackend` — a {@link StorageBackend} implemented over the wire-protocol v0
3
3
  * reference contract (`docs/WIRE-PROTOCOL.md`, `@superbee/server`).
4
4
  *
5
- * This is the client half of the seam over HTTP: every method maps directly to a wire endpoint,
6
- * and response versions remain the same content-addressed {@link Version} tokens local backends
7
- * produce. Tri-backend contract tests pin that invariant.
5
+ * This is the client half of the seam over HTTP: every method maps directly to a wire endpoint
6
+ * (a guarded document write may first ask `GET /v0/capabilities` whether the host records
7
+ * outcomes; see {@link RemoteBackendOptions.maxRetries}), and response versions remain the same
8
+ * content-addressed {@link Version} tokens local backends produce. Tri-backend contract tests pin
9
+ * that invariant.
8
10
  *
9
11
  * Zero new dependencies: it calls an injectable {@link FetchLike} transport
10
- * (defaulting to the global `fetch`, available on Node >= 20) with a constructed
12
+ * (defaulting to the global `fetch`, available in every supported Node runtime) with a constructed
11
13
  * `Request`. That means the SAME adapter runs against a real HTTP server, or — in
12
14
  * tests — directly against an in-process `createRouter(bundle)` function with no
13
15
  * sockets: `createRouter` returns exactly the `(req: Request) => Promise<Response>`
@@ -40,9 +42,9 @@
40
42
  * This module touches NO filesystem and parses NO markdown — like {@link MemoryBackend},
41
43
  * it proves the engine leaks no assumptions beyond the {@link StorageBackend} contract.
42
44
  */
43
- import { type DocumentHead } from "./heads-digest.js";
45
+ import { type HeadsResult, type RemoteSnapshot } from "./remote-parsers.js";
44
46
  import { type Outcome } from "./uncertain-write.js";
45
- import type { BlobKey, ConceptId, DeleteOptions, Frontmatter, HeadResult, OkfDocument, QueryFilter, ReadBlobResult, ReadResult, ReservedFilename, ReservedReadResult, StorageBackend, Version, VersionInfo, WriteOptions } from "./types.js";
47
+ import type { BlobKey, ConceptId, DeleteOptions, HeadResult, OkfDocument, QueryFilter, ReadBlobResult, ReadResult, ReservedFilename, ReservedReadResult, StorageBackend, Version, VersionInfo, WriteOptions } from "./types.js";
46
48
  /**
47
49
  * An injectable fetch-like transport: given a `Request`, resolve a `Response`. This
48
50
  * is exactly the shape {@link createRouter} (in `@superbee/server`) returns,
@@ -55,7 +57,7 @@ export interface RemoteBackendOptions {
55
57
  baseUrl: string;
56
58
  /** Bundle name segment in the `/v0/bundles/{bundle}/…` path. */
57
59
  bundle: string;
58
- /** Transport override; defaults to the global `fetch` (Node >= 20). Tests inject a router directly. */
60
+ /** Transport override; defaults to the global `fetch` in supported Node runtimes. Tests inject a router directly. */
59
61
  fetchImpl?: FetchLike;
60
62
  /**
61
63
  * Optional bearer token sent as `Authorization: Bearer <token>` on EVERY request. The
@@ -69,26 +71,28 @@ export interface RemoteBackendOptions {
69
71
  * e.g. a Cloudflare D1 cold-start's 500 "storage caused object to be reset" when a hibernated
70
72
  * database is first hit) or a network/transport error. Each retry backs off exponentially with
71
73
  * jitter. A 4xx (incl. 412 VersionConflict), 401, or any 2xx is a REAL result, never retried.
72
- * Default 3; set 0 to disable. Safe because every op is content-addressed + CAS: a retried write
73
- * lands the same version or a conflict — possibly SPURIOUS, if a prior attempt actually committed
74
- * before its response was lost — but never silent data loss; and a retried read is idempotent.
74
+ * Default 3; set 0 to disable. A retried read is idempotent.
75
+ *
76
+ * A guarded document write (`write` with `expectedVersion`, or `delete` with a content-version
77
+ * `expectedVersion`) travels with an `Idempotency-Key`: the caller's `requestId`, or else, when
78
+ * the host's capabilities report `operations`, one minted for that call. Every retry of the
79
+ * request carries the same key, so while the host keeps the record a retry is answered from the
80
+ * recorded outcome and cannot apply the write a second time.
81
+ *
82
+ * Other guarded writes retry as a plain resubmission: a guarded document write sent without a key
83
+ * (to a host without `operations`, after a capability question that ended in a transient status,
84
+ * or resent after the host refused a key minted under a stale answer), a `delete` whose
85
+ * `expectedVersion` is not a content version, and every guarded reserved-file and blob write,
86
+ * none of which the wire identifies. Such a retry lands the same version or a conflict, possibly
87
+ * SPURIOUS if a prior attempt committed before its response was lost. It is not free of lost
88
+ * updates: versions are content hashes, so if another writer returns the document to the exact
89
+ * state the premise names before a retry arrives, the retry applies the write again over that
90
+ * change and reports success. An unconditional write carries no minted key and can simply be
91
+ * repeated.
75
92
  */
76
93
  maxRetries?: number;
77
94
  }
78
- /**
79
- * A non-2xx wire response that is neither a `404` (ENOENT-shaped) nor a `412`
80
- * ({@link VersionConflict}) — the generic case, carrying the error envelope's `code` alongside
81
- * the raw HTTP `status`, so a caller can distinguish e.g.
82
- * `AUTH_REQUIRED` (401, an unauthenticated/misconfigured `--remote`) from `RUNTIME` (5xx, a
83
- * genuine server-side bug) instead of both collapsing into a generically-classified `Error`.
84
- */
85
- export declare class RemoteError extends Error {
86
- /** The envelope's `code` field, or a status-derived guess when the envelope is missing/unparseable. */
87
- readonly code: string;
88
- /** The raw HTTP status that produced this error. */
89
- readonly status: number;
90
- constructor(message: string, code: string, status: number, cause?: unknown);
91
- }
95
+ export { RemoteError } from "./remote-error.js";
92
96
  /** The deployment-scoped capability booleans a wire authority reports (`docs/WIRE-PROTOCOL.md`). */
93
97
  export interface WireCapabilities {
94
98
  history: boolean;
@@ -108,38 +112,6 @@ export interface HeadsOptions {
108
112
  /** A digest from an earlier `heads` or `snapshot` answer; the authority answers `304` when it still holds it. */
109
113
  ifNoneMatch?: string;
110
114
  }
111
- /** A `200` from `GET /heads`: every document id and version, and the digest over them. */
112
- export interface HeadsResult {
113
- digest: string;
114
- heads: DocumentHead[];
115
- }
116
- /** The snapshot's first line: how many documents follow and the digest `heads` would return for this state. */
117
- export interface SnapshotHeader {
118
- count: number;
119
- digest: string;
120
- }
121
- /** One `doc` line of a snapshot. */
122
- export interface SnapshotDocument {
123
- id: ConceptId;
124
- version: Version;
125
- frontmatter: Frontmatter;
126
- body: string;
127
- }
128
- /**
129
- * A snapshot as {@link RemoteBackend.snapshot} hands it over: the header, already parsed, and
130
- * the documents as they stream. Iterating `docs` to completion is the completeness signal: the
131
- * loop ends only after the `end` line arrived with the announced count and the digest recomputed
132
- * over the received `{ id, version }` rows equals the header's, and it throws
133
- * `SNAPSHOT_TRUNCATED` (the body ended or failed first) or `SNAPSHOT_DIGEST_MISMATCH` (the body
134
- * was whole but describes a state the header did not announce) otherwise, so a consumer that
135
- * writes batches as they arrive has one control path and never needs to inspect a terminator
136
- * or a digest itself. A consumer records the header digest as matched only after the loop
137
- * ended normally.
138
- */
139
- export interface RemoteSnapshot {
140
- header: SnapshotHeader;
141
- docs: AsyncIterable<SnapshotDocument>;
142
- }
143
115
  /**
144
116
  * The client half of the wire-protocol v0 contract: implements {@link StorageBackend}
145
117
  * over HTTP against a `@superbee/server` instance (or any conformant
@@ -151,6 +123,8 @@ export declare class RemoteBackend implements StorageBackend {
151
123
  private readonly fetchImpl;
152
124
  private readonly authToken?;
153
125
  private readonly maxRetries;
126
+ /** The pending or settled answer to whether this host records outcomes; see {@link recordsOutcomes}. */
127
+ private operationsSupport?;
154
128
  constructor(options: RemoteBackendOptions);
155
129
  /** The authority's base URL as configured, without a trailing slash. */
156
130
  get origin(): string;
@@ -164,22 +138,42 @@ export declare class RemoteBackend implements StorageBackend {
164
138
  write(id: ConceptId, doc: OkfDocument, options?: WriteOptions): Promise<Version>;
165
139
  /**
166
140
  * `GET /v0/capabilities`, deployment-scoped: what this authority implements. `operations` says
167
- * whether it records outcomes by request identity. A host without it ignores `Idempotency-Key`
168
- * and answers the lookup route with a route-miss `404`, which {@link lookupOperation} cannot
169
- * tell from "never recorded"; a consumer that relies on identity checks this once before it
170
- * sends any intent. Missing booleans read as `false`.
141
+ * whether it records outcomes by request identity. The reference router without it refuses any
142
+ * request carrying `Idempotency-Key`, and the lookup route, with `400 USAGE`; a host that lacks
143
+ * the lookup route altogether answers it with a route-miss `404`, which {@link lookupOperation}
144
+ * cannot tell from "never recorded". A consumer that relies on identity checks this once before
145
+ * it sends any intent. Missing booleans read as `false`.
171
146
  */
172
147
  wireCapabilities(): Promise<WireCapabilities>;
148
+ /**
149
+ * Whether this host records outcomes by request identity, asked through `GET /v0/capabilities`
150
+ * and shared by concurrent callers. A host that answers anything but a `2xx` with
151
+ * `operations: true` is treated as not recording them, since a host that does not record them
152
+ * refuses a key with `400`. That answer is kept for the backend's lifetime, except that a
153
+ * transient status still returned after `send`'s retries, or a transport failure, is not kept:
154
+ * the former sends this write unidentified, and the latter rejects the write before it is sent.
155
+ * A kept yes is also dropped when a minted key meets the host's identity refusal; see
156
+ * {@link sendDocWrite}.
157
+ */
158
+ private recordsOutcomes;
159
+ private probeOperations;
160
+ /**
161
+ * Send a document `PUT` or `DELETE`. When its `Idempotency-Key` was minted here, a kept
162
+ * `operations` answer may be stale: a host that has since lost its outcome store refuses every
163
+ * key with the wire's `400` {@link IDENTITY_UNSUPPORTED} before applying anything. That answer
164
+ * is dropped and the write is sent once more without a key, as to any host without
165
+ * `operations`. A caller's own `requestId` is never dropped, so its refusal is the answer.
166
+ */
167
+ private sendDocWrite;
173
168
  /**
174
169
  * `GET /heads`: every document id and version the authority holds, under one digest, or
175
170
  * `null` when `ifNoneMatch` named the digest it still holds (a `304`: nothing changed). A
176
171
  * `200` is diffed against the caller's own copy: an id missing from `heads` was deleted, a
177
172
  * differing version changed. A `200` without a well-formed digest, whose `count` and rows
178
173
  * disagree, or whose rows digest by the documented recipe to something other than the served
179
- * digest, is rejected rather than trusted, as is a `304` to a request that sent no
180
- * `ifNoneMatch`. The recomputation is what stops a listing that is whole by its own count
181
- * but not the state its digest names (a shortened listing under the real digest) from being
182
- * diffed as a mass deletion. Not part of the {@link StorageBackend} seam.
174
+ * digest, is rejected rather than trusted ({@link parseHeadsAnswer} owns that admission), as
175
+ * is a `304` to a request that sent no `ifNoneMatch`. Not part of the {@link StorageBackend}
176
+ * seam.
183
177
  */
184
178
  heads(options?: HeadsOptions): Promise<HeadsResult | null>;
185
179
  /**
@@ -188,8 +182,9 @@ export declare class RemoteBackend implements StorageBackend {
188
182
  * the documents then stream through {@link RemoteSnapshot.docs}. Transient retry applies only
189
183
  * to obtaining the response: a body cut mid-stream is reported to the consumer as
190
184
  * `SNAPSHOT_TRUNCATED`, a whole body whose heads do not digest to the header's announcement as
191
- * `SNAPSHOT_DIGEST_MISMATCH`, and re-requesting is the consumer's decision. Reserved files are
192
- * not part of a snapshot. Not part of the {@link StorageBackend} seam.
185
+ * `SNAPSHOT_DIGEST_MISMATCH` ({@link readSnapshotStream} owns the grammar), and re-requesting
186
+ * is the consumer's decision. Reserved files are not part of a snapshot. Not part of the
187
+ * {@link StorageBackend} seam.
193
188
  */
194
189
  snapshot(): Promise<RemoteSnapshot>;
195
190
  /**
@@ -219,7 +214,12 @@ export declare class RemoteBackend implements StorageBackend {
219
214
  * `docs/WIRE-PROTOCOL.md`); the engine's `queryHeads` re-filter covers it, per the
220
215
  * seam contract (over-returning is fine; semantics live in core).
221
216
  */
222
- queryHeads(filter?: QueryFilter): Promise<HeadResult[]>;
217
+ queryHeads(filter?: QueryFilter, options?: {
218
+ onSkip?: (skip: {
219
+ id: ConceptId;
220
+ reason: string;
221
+ }) => void;
222
+ }): Promise<HeadResult[]>;
223
223
  versions(id: ConceptId): Promise<VersionInfo[]>;
224
224
  readReserved(dir: string, name: ReservedFilename): Promise<ReservedReadResult | null>;
225
225
  writeReserved(dir: string, name: ReservedFilename, content: string, options?: WriteOptions): Promise<Version>;
@@ -1 +1 @@
1
- {"version":3,"file":"remote-backend.d.ts","sourceRoot":"","sources":["../src/remote-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAIH,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,WAAW,EACX,YAAY,EACb,MAAM,YAAY,CAAC;AAWpB;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEhE,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,yGAAyG;IACzG,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,uGAAuG;IACvG,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,uGAAuG;IACvG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAM3E;AAED,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