@superbee/core 0.2.0-pre.6 → 0.2.0-pre.60

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 (820) hide show
  1. package/README.md +1425 -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 +50 -2
  7. package/dist/backend.d.ts.map +1 -1
  8. package/dist/backend.js +311 -33
  9. package/dist/backend.js.map +1 -1
  10. package/dist/blob-contract.d.ts +82 -0
  11. package/dist/blob-contract.d.ts.map +1 -0
  12. package/dist/blob-contract.js +134 -0
  13. package/dist/blob-contract.js.map +1 -0
  14. package/dist/blob-journal.d.ts +303 -0
  15. package/dist/blob-journal.d.ts.map +1 -0
  16. package/dist/blob-journal.js +541 -0
  17. package/dist/blob-journal.js.map +1 -0
  18. package/dist/body-pages.d.ts +20 -0
  19. package/dist/body-pages.d.ts.map +1 -0
  20. package/dist/body-pages.js +56 -0
  21. package/dist/body-pages.js.map +1 -0
  22. package/dist/body-replace-guards.d.ts +81 -0
  23. package/dist/body-replace-guards.d.ts.map +1 -0
  24. package/dist/body-replace-guards.js +271 -0
  25. package/dist/body-replace-guards.js.map +1 -0
  26. package/dist/bounded-yaml.d.ts +28 -0
  27. package/dist/bounded-yaml.d.ts.map +1 -0
  28. package/dist/bounded-yaml.js +182 -0
  29. package/dist/bounded-yaml.js.map +1 -0
  30. package/dist/builtin-recipes/content.d.ts +93 -0
  31. package/dist/builtin-recipes/content.d.ts.map +1 -0
  32. package/dist/builtin-recipes/content.js +288 -0
  33. package/dist/builtin-recipes/content.js.map +1 -0
  34. package/dist/builtin-recipes/site.d.ts +5 -0
  35. package/dist/builtin-recipes/site.d.ts.map +1 -0
  36. package/dist/builtin-recipes/site.js +83 -0
  37. package/dist/builtin-recipes/site.js.map +1 -0
  38. package/dist/builtin-recipes.d.ts +13 -0
  39. package/dist/builtin-recipes.d.ts.map +1 -0
  40. package/dist/builtin-recipes.js +123 -0
  41. package/dist/builtin-recipes.js.map +1 -0
  42. package/dist/bundle-health/index.d.ts +14 -0
  43. package/dist/bundle-health/index.d.ts.map +1 -0
  44. package/dist/bundle-health/index.js +12 -0
  45. package/dist/bundle-health/index.js.map +1 -0
  46. package/dist/bundle-health/kind-findings.d.ts +45 -0
  47. package/dist/bundle-health/kind-findings.d.ts.map +1 -0
  48. package/dist/bundle-health/kind-findings.js +67 -0
  49. package/dist/bundle-health/kind-findings.js.map +1 -0
  50. package/dist/bundle-health/legacy-page.d.ts +21 -0
  51. package/dist/bundle-health/legacy-page.d.ts.map +1 -0
  52. package/dist/bundle-health/legacy-page.js +25 -0
  53. package/dist/bundle-health/legacy-page.js.map +1 -0
  54. package/dist/bundle-health/report.d.ts +191 -0
  55. package/dist/bundle-health/report.d.ts.map +1 -0
  56. package/dist/bundle-health/report.js +419 -0
  57. package/dist/bundle-health/report.js.map +1 -0
  58. package/dist/bundle-ops.d.ts +11 -5
  59. package/dist/bundle-ops.d.ts.map +1 -1
  60. package/dist/bundle-ops.js +17 -10
  61. package/dist/bundle-ops.js.map +1 -1
  62. package/dist/bundle.d.ts +2 -4
  63. package/dist/bundle.d.ts.map +1 -1
  64. package/dist/bundle.js +3 -12
  65. package/dist/bundle.js.map +1 -1
  66. package/dist/code-point-order.d.ts +8 -0
  67. package/dist/code-point-order.d.ts.map +1 -0
  68. package/dist/code-point-order.js +20 -0
  69. package/dist/code-point-order.js.map +1 -0
  70. package/dist/code-unit-order.d.ts +15 -0
  71. package/dist/code-unit-order.d.ts.map +1 -0
  72. package/dist/code-unit-order.js +17 -0
  73. package/dist/code-unit-order.js.map +1 -0
  74. package/dist/connector-request.d.ts +112 -0
  75. package/dist/connector-request.d.ts.map +1 -0
  76. package/dist/connector-request.js +495 -0
  77. package/dist/connector-request.js.map +1 -0
  78. package/dist/connectors.d.ts +297 -0
  79. package/dist/connectors.d.ts.map +1 -0
  80. package/dist/connectors.js +1233 -0
  81. package/dist/connectors.js.map +1 -0
  82. package/dist/convention-record.d.ts +9 -0
  83. package/dist/convention-record.d.ts.map +1 -0
  84. package/dist/convention-record.js +13 -0
  85. package/dist/convention-record.js.map +1 -0
  86. package/dist/cross-bundle.d.ts +135 -0
  87. package/dist/cross-bundle.d.ts.map +1 -0
  88. package/dist/cross-bundle.js +191 -0
  89. package/dist/cross-bundle.js.map +1 -0
  90. package/dist/dependencies.d.ts +208 -0
  91. package/dist/dependencies.d.ts.map +1 -0
  92. package/dist/dependencies.js +367 -0
  93. package/dist/dependencies.js.map +1 -0
  94. package/dist/document-codec.d.ts +4 -1
  95. package/dist/document-codec.d.ts.map +1 -1
  96. package/dist/document-codec.js +3 -1
  97. package/dist/document-codec.js.map +1 -1
  98. package/dist/document-field-actions.d.ts +34 -3
  99. package/dist/document-field-actions.d.ts.map +1 -1
  100. package/dist/document-field-actions.js +149 -43
  101. package/dist/document-field-actions.js.map +1 -1
  102. package/dist/document-mutation.d.ts +55 -18
  103. package/dist/document-mutation.d.ts.map +1 -1
  104. package/dist/document-mutation.js +210 -86
  105. package/dist/document-mutation.js.map +1 -1
  106. package/dist/document-persistence.d.ts +12 -0
  107. package/dist/document-persistence.d.ts.map +1 -0
  108. package/dist/document-persistence.js +44 -0
  109. package/dist/document-persistence.js.map +1 -0
  110. package/dist/document-replace-rules.d.ts +44 -0
  111. package/dist/document-replace-rules.d.ts.map +1 -0
  112. package/dist/document-replace-rules.js +41 -0
  113. package/dist/document-replace-rules.js.map +1 -0
  114. package/dist/document-scan.d.ts +26 -0
  115. package/dist/document-scan.d.ts.map +1 -0
  116. package/dist/document-scan.js +70 -0
  117. package/dist/document-scan.js.map +1 -0
  118. package/dist/document-transfer.d.ts +312 -0
  119. package/dist/document-transfer.d.ts.map +1 -0
  120. package/dist/document-transfer.js +1400 -0
  121. package/dist/document-transfer.js.map +1 -0
  122. package/dist/document-write-policy.d.ts +15 -4
  123. package/dist/document-write-policy.d.ts.map +1 -1
  124. package/dist/document-write-policy.js +41 -27
  125. package/dist/document-write-policy.js.map +1 -1
  126. package/dist/domain-model.d.ts +73 -0
  127. package/dist/domain-model.d.ts.map +1 -0
  128. package/dist/domain-model.js +169 -0
  129. package/dist/domain-model.js.map +1 -0
  130. package/dist/edge-harness/corpus.d.ts +9 -0
  131. package/dist/edge-harness/corpus.d.ts.map +1 -0
  132. package/dist/edge-harness/corpus.js +57 -0
  133. package/dist/edge-harness/corpus.js.map +1 -0
  134. package/dist/edge-harness/index.d.ts +21 -0
  135. package/dist/edge-harness/index.d.ts.map +1 -0
  136. package/dist/edge-harness/index.js +537 -0
  137. package/dist/edge-harness/index.js.map +1 -0
  138. package/dist/edges/find.d.ts +14 -0
  139. package/dist/edges/find.d.ts.map +1 -0
  140. package/dist/edges/find.js +46 -0
  141. package/dist/edges/find.js.map +1 -0
  142. package/dist/edges/index.d.ts +13 -0
  143. package/dist/edges/index.d.ts.map +1 -0
  144. package/dist/edges/index.js +5 -0
  145. package/dist/edges/index.js.map +1 -0
  146. package/dist/edges/memory-source.d.ts +8 -0
  147. package/dist/edges/memory-source.d.ts.map +1 -0
  148. package/dist/edges/memory-source.js +164 -0
  149. package/dist/edges/memory-source.js.map +1 -0
  150. package/dist/edges/read-bounds.d.ts +6 -0
  151. package/dist/edges/read-bounds.d.ts.map +1 -0
  152. package/dist/edges/read-bounds.js +13 -0
  153. package/dist/edges/read-bounds.js.map +1 -0
  154. package/dist/edges/source.d.ts +123 -0
  155. package/dist/edges/source.d.ts.map +1 -0
  156. package/dist/edges/source.js +2 -0
  157. package/dist/edges/source.js.map +1 -0
  158. package/dist/edges/walk.d.ts +7 -0
  159. package/dist/edges/walk.d.ts.map +1 -0
  160. package/dist/edges/walk.js +14 -0
  161. package/dist/edges/walk.js.map +1 -0
  162. package/dist/engine.d.ts +55 -19
  163. package/dist/engine.d.ts.map +1 -1
  164. package/dist/engine.js +141 -111
  165. package/dist/engine.js.map +1 -1
  166. package/dist/errors.d.ts +37 -1
  167. package/dist/errors.d.ts.map +1 -1
  168. package/dist/errors.js +75 -3
  169. package/dist/errors.js.map +1 -1
  170. package/dist/file-journaled-backend-internal.d.ts +21 -0
  171. package/dist/file-journaled-backend-internal.d.ts.map +1 -0
  172. package/dist/file-journaled-backend-internal.js +12 -0
  173. package/dist/file-journaled-backend-internal.js.map +1 -0
  174. package/dist/file-journaled-backend.d.ts +160 -0
  175. package/dist/file-journaled-backend.d.ts.map +1 -0
  176. package/dist/file-journaled-backend.js +1345 -0
  177. package/dist/file-journaled-backend.js.map +1 -0
  178. package/dist/filesystem-identity.d.ts +116 -17
  179. package/dist/filesystem-identity.d.ts.map +1 -1
  180. package/dist/filesystem-identity.js +532 -51
  181. package/dist/filesystem-identity.js.map +1 -1
  182. package/dist/filesystem-lock.d.ts +19 -2
  183. package/dist/filesystem-lock.d.ts.map +1 -1
  184. package/dist/filesystem-lock.js +259 -17
  185. package/dist/filesystem-lock.js.map +1 -1
  186. package/dist/filesystem-push-role.d.ts +77 -0
  187. package/dist/filesystem-push-role.d.ts.map +1 -0
  188. package/dist/filesystem-push-role.js +165 -0
  189. package/dist/filesystem-push-role.js.map +1 -0
  190. package/dist/filesystem-temp-name.d.ts +9 -0
  191. package/dist/filesystem-temp-name.d.ts.map +1 -0
  192. package/dist/filesystem-temp-name.js +20 -0
  193. package/dist/filesystem-temp-name.js.map +1 -0
  194. package/dist/filesystem.d.ts +6 -0
  195. package/dist/filesystem.d.ts.map +1 -1
  196. package/dist/filesystem.js +2 -1
  197. package/dist/filesystem.js.map +1 -1
  198. package/dist/freshness.d.ts +16 -1
  199. package/dist/freshness.d.ts.map +1 -1
  200. package/dist/freshness.js +47 -17
  201. package/dist/freshness.js.map +1 -1
  202. package/dist/frontmatter-contract.d.ts +14 -0
  203. package/dist/frontmatter-contract.d.ts.map +1 -1
  204. package/dist/frontmatter-contract.js +22 -0
  205. package/dist/frontmatter-contract.js.map +1 -1
  206. package/dist/frontmatter-splitter.d.ts +6 -0
  207. package/dist/frontmatter-splitter.d.ts.map +1 -1
  208. package/dist/frontmatter-splitter.js +8 -0
  209. package/dist/frontmatter-splitter.js.map +1 -1
  210. package/dist/frontmatter.d.ts +17 -7
  211. package/dist/frontmatter.d.ts.map +1 -1
  212. package/dist/frontmatter.js +52 -11
  213. package/dist/frontmatter.js.map +1 -1
  214. package/dist/governed-body-write.d.ts +8 -1
  215. package/dist/governed-body-write.d.ts.map +1 -1
  216. package/dist/governed-body-write.js +22 -8
  217. package/dist/governed-body-write.js.map +1 -1
  218. package/dist/heads-digest.d.ts.map +1 -1
  219. package/dist/heads-digest.js +2 -1
  220. package/dist/heads-digest.js.map +1 -1
  221. package/dist/host-text.d.ts +31 -0
  222. package/dist/host-text.d.ts.map +1 -0
  223. package/dist/host-text.js +77 -0
  224. package/dist/host-text.js.map +1 -0
  225. package/dist/hosted-client/binding.d.ts +7 -0
  226. package/dist/hosted-client/binding.d.ts.map +1 -0
  227. package/dist/hosted-client/binding.js +10 -0
  228. package/dist/hosted-client/binding.js.map +1 -0
  229. package/dist/hosted-client/blob-delivery.d.ts +68 -0
  230. package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
  231. package/dist/hosted-client/blob-delivery.js +170 -0
  232. package/dist/hosted-client/blob-delivery.js.map +1 -0
  233. package/dist/hosted-client/blob-write.d.ts +387 -0
  234. package/dist/hosted-client/blob-write.d.ts.map +1 -0
  235. package/dist/hosted-client/blob-write.js +770 -0
  236. package/dist/hosted-client/blob-write.js.map +1 -0
  237. package/dist/hosted-client/bundle-listing.d.ts +46 -0
  238. package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
  239. package/dist/hosted-client/bundle-listing.js +36 -0
  240. package/dist/hosted-client/bundle-listing.js.map +1 -0
  241. package/dist/hosted-client/client.d.ts +249 -0
  242. package/dist/hosted-client/client.d.ts.map +1 -0
  243. package/dist/hosted-client/client.js +381 -0
  244. package/dist/hosted-client/client.js.map +1 -0
  245. package/dist/hosted-client/directory.d.ts +46 -0
  246. package/dist/hosted-client/directory.d.ts.map +1 -0
  247. package/dist/hosted-client/directory.js +74 -0
  248. package/dist/hosted-client/directory.js.map +1 -0
  249. package/dist/hosted-client/errors.d.ts +26 -0
  250. package/dist/hosted-client/errors.d.ts.map +1 -0
  251. package/dist/hosted-client/errors.js +35 -0
  252. package/dist/hosted-client/errors.js.map +1 -0
  253. package/dist/hosted-client/inbox.d.ts +320 -0
  254. package/dist/hosted-client/inbox.d.ts.map +1 -0
  255. package/dist/hosted-client/inbox.js +379 -0
  256. package/dist/hosted-client/inbox.js.map +1 -0
  257. package/dist/hosted-client/index.d.ts +31 -0
  258. package/dist/hosted-client/index.d.ts.map +1 -0
  259. package/dist/hosted-client/index.js +33 -0
  260. package/dist/hosted-client/index.js.map +1 -0
  261. package/dist/hosted-client/journal.d.ts +103 -0
  262. package/dist/hosted-client/journal.d.ts.map +1 -0
  263. package/dist/hosted-client/journal.js +464 -0
  264. package/dist/hosted-client/journal.js.map +1 -0
  265. package/dist/hosted-client/node.d.ts +74 -0
  266. package/dist/hosted-client/node.d.ts.map +1 -0
  267. package/dist/hosted-client/node.js +219 -0
  268. package/dist/hosted-client/node.js.map +1 -0
  269. package/dist/hosted-client/reference.d.ts +12 -0
  270. package/dist/hosted-client/reference.d.ts.map +1 -0
  271. package/dist/hosted-client/reference.js +29 -0
  272. package/dist/hosted-client/reference.js.map +1 -0
  273. package/dist/hosted-client/view-content.d.ts +184 -0
  274. package/dist/hosted-client/view-content.d.ts.map +1 -0
  275. package/dist/hosted-client/view-content.js +268 -0
  276. package/dist/hosted-client/view-content.js.map +1 -0
  277. package/dist/hosted-client/write.d.ts +219 -0
  278. package/dist/hosted-client/write.d.ts.map +1 -0
  279. package/dist/hosted-client/write.js +419 -0
  280. package/dist/hosted-client/write.js.map +1 -0
  281. package/dist/hosted-transport/answer-rows.d.ts +344 -0
  282. package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
  283. package/dist/hosted-transport/answer-rows.js +596 -0
  284. package/dist/hosted-transport/answer-rows.js.map +1 -0
  285. package/dist/hosted-transport/attribution.d.ts +32 -0
  286. package/dist/hosted-transport/attribution.d.ts.map +1 -0
  287. package/dist/hosted-transport/attribution.js +38 -0
  288. package/dist/hosted-transport/attribution.js.map +1 -0
  289. package/dist/hosted-transport/blob-reads.d.ts +35 -0
  290. package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
  291. package/dist/hosted-transport/blob-reads.js +179 -0
  292. package/dist/hosted-transport/blob-reads.js.map +1 -0
  293. package/dist/hosted-transport/blob-write.d.ts +34 -0
  294. package/dist/hosted-transport/blob-write.d.ts.map +1 -0
  295. package/dist/hosted-transport/blob-write.js +115 -0
  296. package/dist/hosted-transport/blob-write.js.map +1 -0
  297. package/dist/hosted-transport/carrier.d.ts +166 -0
  298. package/dist/hosted-transport/carrier.d.ts.map +1 -0
  299. package/dist/hosted-transport/carrier.js +285 -0
  300. package/dist/hosted-transport/carrier.js.map +1 -0
  301. package/dist/hosted-transport/document-backend.d.ts +74 -0
  302. package/dist/hosted-transport/document-backend.d.ts.map +1 -0
  303. package/dist/hosted-transport/document-backend.js +160 -0
  304. package/dist/hosted-transport/document-backend.js.map +1 -0
  305. package/dist/hosted-transport/history-pages.d.ts +55 -0
  306. package/dist/hosted-transport/history-pages.d.ts.map +1 -0
  307. package/dist/hosted-transport/history-pages.js +69 -0
  308. package/dist/hosted-transport/history-pages.js.map +1 -0
  309. package/dist/hosted-transport/index.d.ts +21 -0
  310. package/dist/hosted-transport/index.d.ts.map +1 -0
  311. package/dist/hosted-transport/index.js +21 -0
  312. package/dist/hosted-transport/index.js.map +1 -0
  313. package/dist/hosted-transport/operations.d.ts +91 -0
  314. package/dist/hosted-transport/operations.d.ts.map +1 -0
  315. package/dist/hosted-transport/operations.js +129 -0
  316. package/dist/hosted-transport/operations.js.map +1 -0
  317. package/dist/hosted-transport/paged-reads.d.ts +87 -0
  318. package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
  319. package/dist/hosted-transport/paged-reads.js +238 -0
  320. package/dist/hosted-transport/paged-reads.js.map +1 -0
  321. package/dist/hosted-transport/port-run.d.ts +41 -0
  322. package/dist/hosted-transport/port-run.d.ts.map +1 -0
  323. package/dist/hosted-transport/port-run.js +92 -0
  324. package/dist/hosted-transport/port-run.js.map +1 -0
  325. package/dist/hosted-transport/read-adapter.d.ts +266 -0
  326. package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
  327. package/dist/hosted-transport/read-adapter.js +570 -0
  328. package/dist/hosted-transport/read-adapter.js.map +1 -0
  329. package/dist/hosted-transport/root-write.d.ts +114 -0
  330. package/dist/hosted-transport/root-write.d.ts.map +1 -0
  331. package/dist/hosted-transport/root-write.js +174 -0
  332. package/dist/hosted-transport/root-write.js.map +1 -0
  333. package/dist/hosted-transport/whole-document-transport.d.ts +223 -0
  334. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
  335. package/dist/hosted-transport/whole-document-transport.js +500 -0
  336. package/dist/hosted-transport/whole-document-transport.js.map +1 -0
  337. package/dist/identity-fold.d.ts +16 -0
  338. package/dist/identity-fold.d.ts.map +1 -0
  339. package/dist/identity-fold.js +24 -0
  340. package/dist/identity-fold.js.map +1 -0
  341. package/dist/index-projection.d.ts +2 -1
  342. package/dist/index-projection.d.ts.map +1 -1
  343. package/dist/index-projection.js +38 -28
  344. package/dist/index-projection.js.map +1 -1
  345. package/dist/index.d.ts +65 -20
  346. package/dist/index.d.ts.map +1 -1
  347. package/dist/index.js +54 -22
  348. package/dist/index.js.map +1 -1
  349. package/dist/indexeddb-backend.d.ts +6 -32
  350. package/dist/indexeddb-backend.d.ts.map +1 -1
  351. package/dist/indexeddb-backend.js +82 -8
  352. package/dist/indexeddb-backend.js.map +1 -1
  353. package/dist/inventory-guard.d.ts +58 -0
  354. package/dist/inventory-guard.d.ts.map +1 -0
  355. package/dist/inventory-guard.js +169 -0
  356. package/dist/inventory-guard.js.map +1 -0
  357. package/dist/journaled-backend.d.ts +86 -8
  358. package/dist/journaled-backend.d.ts.map +1 -1
  359. package/dist/journaled-backend.js +64 -69
  360. package/dist/journaled-backend.js.map +1 -1
  361. package/dist/json-data.d.ts +3 -0
  362. package/dist/json-data.d.ts.map +1 -0
  363. package/dist/json-data.js +19 -0
  364. package/dist/json-data.js.map +1 -0
  365. package/dist/kind-authoring.d.ts +200 -0
  366. package/dist/kind-authoring.d.ts.map +1 -0
  367. package/dist/kind-authoring.js +539 -0
  368. package/dist/kind-authoring.js.map +1 -0
  369. package/dist/kind-changes.d.ts +45 -0
  370. package/dist/kind-changes.d.ts.map +1 -0
  371. package/dist/kind-changes.js +96 -0
  372. package/dist/kind-changes.js.map +1 -0
  373. package/dist/kind-conformance-error.d.ts +16 -0
  374. package/dist/kind-conformance-error.d.ts.map +1 -0
  375. package/dist/kind-conformance-error.js +20 -0
  376. package/dist/kind-conformance-error.js.map +1 -0
  377. package/dist/kind-coverage.d.ts +100 -0
  378. package/dist/kind-coverage.d.ts.map +1 -0
  379. package/dist/kind-coverage.js +185 -0
  380. package/dist/kind-coverage.js.map +1 -0
  381. package/dist/kind-deprecation.d.ts +32 -0
  382. package/dist/kind-deprecation.d.ts.map +1 -0
  383. package/dist/kind-deprecation.js +141 -0
  384. package/dist/kind-deprecation.js.map +1 -0
  385. package/dist/kind-field-mutation.d.ts +7 -2
  386. package/dist/kind-field-mutation.d.ts.map +1 -1
  387. package/dist/kind-field-mutation.js +28 -3
  388. package/dist/kind-field-mutation.js.map +1 -1
  389. package/dist/kind-undeclared-fields.d.ts +72 -0
  390. package/dist/kind-undeclared-fields.d.ts.map +1 -0
  391. package/dist/kind-undeclared-fields.js +124 -0
  392. package/dist/kind-undeclared-fields.js.map +1 -0
  393. package/dist/kinds-load.d.ts.map +1 -1
  394. package/dist/kinds-load.js +8 -5
  395. package/dist/kinds-load.js.map +1 -1
  396. package/dist/kinds.d.ts +117 -6
  397. package/dist/kinds.d.ts.map +1 -1
  398. package/dist/kinds.js +416 -29
  399. package/dist/kinds.js.map +1 -1
  400. package/dist/link-add.d.ts +81 -0
  401. package/dist/link-add.d.ts.map +1 -0
  402. package/dist/link-add.js +94 -0
  403. package/dist/link-add.js.map +1 -0
  404. package/dist/link-emit.d.ts +29 -0
  405. package/dist/link-emit.d.ts.map +1 -0
  406. package/dist/link-emit.js +39 -0
  407. package/dist/link-emit.js.map +1 -0
  408. package/dist/link-findings.d.ts +132 -0
  409. package/dist/link-findings.d.ts.map +1 -0
  410. package/dist/link-findings.js +263 -0
  411. package/dist/link-findings.js.map +1 -0
  412. package/dist/link-types.d.ts +34 -0
  413. package/dist/link-types.d.ts.map +1 -0
  414. package/dist/link-types.js +79 -0
  415. package/dist/link-types.js.map +1 -0
  416. package/dist/links.d.ts +68 -9
  417. package/dist/links.d.ts.map +1 -1
  418. package/dist/links.js +373 -65
  419. package/dist/links.js.map +1 -1
  420. package/dist/local-search-index.d.ts +86 -0
  421. package/dist/local-search-index.d.ts.map +1 -0
  422. package/dist/local-search-index.js +1055 -0
  423. package/dist/local-search-index.js.map +1 -0
  424. package/dist/managed-document-metadata.d.ts +5 -0
  425. package/dist/managed-document-metadata.d.ts.map +1 -0
  426. package/dist/managed-document-metadata.js +10 -0
  427. package/dist/managed-document-metadata.js.map +1 -0
  428. package/dist/markdown-syntax.d.ts +39 -0
  429. package/dist/markdown-syntax.d.ts.map +1 -0
  430. package/dist/markdown-syntax.js +10170 -0
  431. package/dist/markdown-syntax.js.map +1 -0
  432. package/dist/memory-backend.d.ts +3 -0
  433. package/dist/memory-backend.d.ts.map +1 -1
  434. package/dist/memory-backend.js +40 -2
  435. package/dist/memory-backend.js.map +1 -1
  436. package/dist/mutation-attribution.d.ts +2 -1
  437. package/dist/mutation-attribution.d.ts.map +1 -1
  438. package/dist/mutation-attribution.js.map +1 -1
  439. package/dist/okf-actor.d.ts +14 -3
  440. package/dist/okf-actor.d.ts.map +1 -1
  441. package/dist/okf-actor.js +25 -4
  442. package/dist/okf-actor.js.map +1 -1
  443. package/dist/okf-authored-values.d.ts +2 -0
  444. package/dist/okf-authored-values.d.ts.map +1 -1
  445. package/dist/okf-authored-values.js +4 -0
  446. package/dist/okf-authored-values.js.map +1 -1
  447. package/dist/okf-authoring.d.ts +7 -0
  448. package/dist/okf-authoring.d.ts.map +1 -0
  449. package/dist/okf-authoring.js +30 -0
  450. package/dist/okf-authoring.js.map +1 -0
  451. package/dist/okf-standard-fields.d.ts +4 -0
  452. package/dist/okf-standard-fields.d.ts.map +1 -1
  453. package/dist/okf-standard-fields.js +24 -14
  454. package/dist/okf-standard-fields.js.map +1 -1
  455. package/dist/okf-timestamps.d.ts +2 -2
  456. package/dist/okf-timestamps.d.ts.map +1 -1
  457. package/dist/okf-timestamps.js +25 -15
  458. package/dist/okf-timestamps.js.map +1 -1
  459. package/dist/page.d.ts +3 -7
  460. package/dist/page.d.ts.map +1 -1
  461. package/dist/page.js +3 -7
  462. package/dist/page.js.map +1 -1
  463. package/dist/path-fold.d.ts +67 -0
  464. package/dist/path-fold.d.ts.map +1 -0
  465. package/dist/path-fold.js +107 -0
  466. package/dist/path-fold.js.map +1 -0
  467. package/dist/paths.d.ts +46 -0
  468. package/dist/paths.d.ts.map +1 -1
  469. package/dist/paths.js +114 -1
  470. package/dist/paths.js.map +1 -1
  471. package/dist/platform.d.ts +22 -2
  472. package/dist/platform.d.ts.map +1 -1
  473. package/dist/platform.js +16 -0
  474. package/dist/platform.js.map +1 -1
  475. package/dist/portable-export-contract.d.ts +17 -0
  476. package/dist/portable-export-contract.d.ts.map +1 -0
  477. package/dist/portable-export-contract.js +59 -0
  478. package/dist/portable-export-contract.js.map +1 -0
  479. package/dist/portable-export.d.ts +111 -0
  480. package/dist/portable-export.d.ts.map +1 -0
  481. package/dist/portable-export.js +448 -0
  482. package/dist/portable-export.js.map +1 -0
  483. package/dist/portable-frontmatter.d.ts +17 -0
  484. package/dist/portable-frontmatter.d.ts.map +1 -1
  485. package/dist/portable-frontmatter.js +42 -5
  486. package/dist/portable-frontmatter.js.map +1 -1
  487. package/dist/publication-filesystem.d.ts +1 -1
  488. package/dist/publication-filesystem.d.ts.map +1 -1
  489. package/dist/publication-filesystem.js +1 -1
  490. package/dist/publication-filesystem.js.map +1 -1
  491. package/dist/qualified-links.d.ts +67 -0
  492. package/dist/qualified-links.d.ts.map +1 -0
  493. package/dist/qualified-links.js +121 -0
  494. package/dist/qualified-links.js.map +1 -0
  495. package/dist/query-filter.d.ts +16 -4
  496. package/dist/query-filter.d.ts.map +1 -1
  497. package/dist/query-filter.js +44 -2
  498. package/dist/query-filter.js.map +1 -1
  499. package/dist/query-order.d.ts +22 -0
  500. package/dist/query-order.d.ts.map +1 -0
  501. package/dist/query-order.js +43 -0
  502. package/dist/query-order.js.map +1 -0
  503. package/dist/recipe-lifecycle/errors.d.ts +96 -0
  504. package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
  505. package/dist/recipe-lifecycle/errors.js +122 -0
  506. package/dist/recipe-lifecycle/errors.js.map +1 -0
  507. package/dist/recipe-lifecycle/evolution.d.ts +134 -0
  508. package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
  509. package/dist/recipe-lifecycle/evolution.js +1047 -0
  510. package/dist/recipe-lifecycle/evolution.js.map +1 -0
  511. package/dist/recipe-lifecycle/index.d.ts +38 -0
  512. package/dist/recipe-lifecycle/index.d.ts.map +1 -0
  513. package/dist/recipe-lifecycle/index.js +31 -0
  514. package/dist/recipe-lifecycle/index.js.map +1 -0
  515. package/dist/recipe-lifecycle/install.d.ts +172 -0
  516. package/dist/recipe-lifecycle/install.d.ts.map +1 -0
  517. package/dist/recipe-lifecycle/install.js +652 -0
  518. package/dist/recipe-lifecycle/install.js.map +1 -0
  519. package/dist/recipe-lifecycle/legacy-aliases.d.ts +4 -0
  520. package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
  521. package/dist/recipe-lifecycle/legacy-aliases.js +22 -0
  522. package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
  523. package/dist/recipe-lifecycle/retirement-apply.d.ts +59 -0
  524. package/dist/recipe-lifecycle/retirement-apply.d.ts.map +1 -0
  525. package/dist/recipe-lifecycle/retirement-apply.js +165 -0
  526. package/dist/recipe-lifecycle/retirement-apply.js.map +1 -0
  527. package/dist/recipe-lifecycle/retirement.d.ts +89 -0
  528. package/dist/recipe-lifecycle/retirement.d.ts.map +1 -0
  529. package/dist/recipe-lifecycle/retirement.js +347 -0
  530. package/dist/recipe-lifecycle/retirement.js.map +1 -0
  531. package/dist/recipe-lifecycle/set-commit.d.ts +31 -0
  532. package/dist/recipe-lifecycle/set-commit.d.ts.map +1 -0
  533. package/dist/recipe-lifecycle/set-commit.js +37 -0
  534. package/dist/recipe-lifecycle/set-commit.js.map +1 -0
  535. package/dist/recipe-lifecycle/stamp.d.ts +146 -0
  536. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
  537. package/dist/recipe-lifecycle/stamp.js +361 -0
  538. package/dist/recipe-lifecycle/stamp.js.map +1 -0
  539. package/dist/recipe-qualify.d.ts +80 -0
  540. package/dist/recipe-qualify.d.ts.map +1 -0
  541. package/dist/recipe-qualify.js +352 -0
  542. package/dist/recipe-qualify.js.map +1 -0
  543. package/dist/recipe-set-preflight.d.ts +139 -0
  544. package/dist/recipe-set-preflight.d.ts.map +1 -0
  545. package/dist/recipe-set-preflight.js +536 -0
  546. package/dist/recipe-set-preflight.js.map +1 -0
  547. package/dist/recipe-sources.d.ts +209 -0
  548. package/dist/recipe-sources.d.ts.map +1 -0
  549. package/dist/recipe-sources.js +607 -0
  550. package/dist/recipe-sources.js.map +1 -0
  551. package/dist/recipes.d.ts +45 -1
  552. package/dist/recipes.d.ts.map +1 -1
  553. package/dist/recipes.js +138 -1
  554. package/dist/recipes.js.map +1 -1
  555. package/dist/record-overlay/apply.d.ts +43 -0
  556. package/dist/record-overlay/apply.d.ts.map +1 -0
  557. package/dist/record-overlay/apply.js +523 -0
  558. package/dist/record-overlay/apply.js.map +1 -0
  559. package/dist/record-overlay/canonical.d.ts +22 -0
  560. package/dist/record-overlay/canonical.d.ts.map +1 -0
  561. package/dist/record-overlay/canonical.js +47 -0
  562. package/dist/record-overlay/canonical.js.map +1 -0
  563. package/dist/record-overlay/digest.d.ts +4 -0
  564. package/dist/record-overlay/digest.d.ts.map +1 -0
  565. package/dist/record-overlay/digest.js +11 -0
  566. package/dist/record-overlay/digest.js.map +1 -0
  567. package/dist/record-overlay/errors.d.ts +44 -0
  568. package/dist/record-overlay/errors.d.ts.map +1 -0
  569. package/dist/record-overlay/errors.js +55 -0
  570. package/dist/record-overlay/errors.js.map +1 -0
  571. package/dist/record-overlay/findings.d.ts +5 -0
  572. package/dist/record-overlay/findings.d.ts.map +1 -0
  573. package/dist/record-overlay/findings.js +86 -0
  574. package/dist/record-overlay/findings.js.map +1 -0
  575. package/dist/record-overlay/index.d.ts +23 -0
  576. package/dist/record-overlay/index.d.ts.map +1 -0
  577. package/dist/record-overlay/index.js +21 -0
  578. package/dist/record-overlay/index.js.map +1 -0
  579. package/dist/record-overlay/plan.d.ts +12 -0
  580. package/dist/record-overlay/plan.d.ts.map +1 -0
  581. package/dist/record-overlay/plan.js +285 -0
  582. package/dist/record-overlay/plan.js.map +1 -0
  583. package/dist/record-overlay/policy.d.ts +74 -0
  584. package/dist/record-overlay/policy.d.ts.map +1 -0
  585. package/dist/record-overlay/policy.js +235 -0
  586. package/dist/record-overlay/policy.js.map +1 -0
  587. package/dist/record-overlay/redact.d.ts +3 -0
  588. package/dist/record-overlay/redact.d.ts.map +1 -0
  589. package/dist/record-overlay/redact.js +27 -0
  590. package/dist/record-overlay/redact.js.map +1 -0
  591. package/dist/record-overlay/signal-kind.d.ts +30 -0
  592. package/dist/record-overlay/signal-kind.d.ts.map +1 -0
  593. package/dist/record-overlay/signal-kind.js +38 -0
  594. package/dist/record-overlay/signal-kind.js.map +1 -0
  595. package/dist/record-overlay/signal-text.d.ts +52 -0
  596. package/dist/record-overlay/signal-text.d.ts.map +1 -0
  597. package/dist/record-overlay/signal-text.js +126 -0
  598. package/dist/record-overlay/signal-text.js.map +1 -0
  599. package/dist/record-overlay/source-index.d.ts +19 -0
  600. package/dist/record-overlay/source-index.d.ts.map +1 -0
  601. package/dist/record-overlay/source-index.js +102 -0
  602. package/dist/record-overlay/source-index.js.map +1 -0
  603. package/dist/record-overlay/types.d.ts +291 -0
  604. package/dist/record-overlay/types.d.ts.map +1 -0
  605. package/dist/record-overlay/types.js +2 -0
  606. package/dist/record-overlay/types.js.map +1 -0
  607. package/dist/relationships.d.ts +71 -0
  608. package/dist/relationships.d.ts.map +1 -0
  609. package/dist/relationships.js +87 -0
  610. package/dist/relationships.js.map +1 -0
  611. package/dist/remote-backend.d.ts +67 -32
  612. package/dist/remote-backend.d.ts.map +1 -1
  613. package/dist/remote-backend.js +171 -39
  614. package/dist/remote-backend.js.map +1 -1
  615. package/dist/remote-document-codec.d.ts +2 -1
  616. package/dist/remote-document-codec.d.ts.map +1 -1
  617. package/dist/remote-document-codec.js +3 -2
  618. package/dist/remote-document-codec.js.map +1 -1
  619. package/dist/remote-error.d.ts +17 -1
  620. package/dist/remote-error.d.ts.map +1 -1
  621. package/dist/remote-error.js +32 -2
  622. package/dist/remote-error.js.map +1 -1
  623. package/dist/remote-operations.d.ts +0 -40
  624. package/dist/remote-operations.d.ts.map +1 -1
  625. package/dist/remote-operations.js +28 -6
  626. package/dist/remote-operations.js.map +1 -1
  627. package/dist/remote-parsers.d.ts +20 -1
  628. package/dist/remote-parsers.d.ts.map +1 -1
  629. package/dist/remote-parsers.js +1 -1
  630. package/dist/remote-parsers.js.map +1 -1
  631. package/dist/remote.d.ts +2 -4
  632. package/dist/remote.d.ts.map +1 -1
  633. package/dist/remote.js +2 -3
  634. package/dist/remote.js.map +1 -1
  635. package/dist/reserved-write.d.ts +9 -0
  636. package/dist/reserved-write.d.ts.map +1 -0
  637. package/dist/reserved-write.js +15 -0
  638. package/dist/reserved-write.js.map +1 -0
  639. package/dist/search/backend-source.d.ts +6 -0
  640. package/dist/search/backend-source.d.ts.map +1 -0
  641. package/dist/search/backend-source.js +57 -0
  642. package/dist/search/backend-source.js.map +1 -0
  643. package/dist/search/contract.d.ts +162 -0
  644. package/dist/search/contract.d.ts.map +1 -0
  645. package/dist/search/contract.js +82 -0
  646. package/dist/search/contract.js.map +1 -0
  647. package/dist/search/errors.d.ts +30 -0
  648. package/dist/search/errors.d.ts.map +1 -0
  649. package/dist/search/errors.js +50 -0
  650. package/dist/search/errors.js.map +1 -0
  651. package/dist/search/identity.d.ts +12 -0
  652. package/dist/search/identity.d.ts.map +1 -0
  653. package/dist/search/identity.js +90 -0
  654. package/dist/search/identity.js.map +1 -0
  655. package/dist/search/index.d.ts +16 -0
  656. package/dist/search/index.d.ts.map +1 -0
  657. package/dist/search/index.js +15 -0
  658. package/dist/search/index.js.map +1 -0
  659. package/dist/search/memory-source.d.ts +36 -0
  660. package/dist/search/memory-source.d.ts.map +1 -0
  661. package/dist/search/memory-source.js +238 -0
  662. package/dist/search/memory-source.js.map +1 -0
  663. package/dist/search/rank.d.ts +29 -0
  664. package/dist/search/rank.d.ts.map +1 -0
  665. package/dist/search/rank.js +132 -0
  666. package/dist/search/rank.js.map +1 -0
  667. package/dist/search/row-text.d.ts +38 -0
  668. package/dist/search/row-text.d.ts.map +1 -0
  669. package/dist/search/row-text.js +88 -0
  670. package/dist/search/row-text.js.map +1 -0
  671. package/dist/search/search.d.ts +28 -0
  672. package/dist/search/search.d.ts.map +1 -0
  673. package/dist/search/search.js +265 -0
  674. package/dist/search/search.js.map +1 -0
  675. package/dist/search/source.d.ts +70 -0
  676. package/dist/search/source.d.ts.map +1 -0
  677. package/dist/search/source.js +2 -0
  678. package/dist/search/source.js.map +1 -0
  679. package/dist/search/text.d.ts +49 -0
  680. package/dist/search/text.d.ts.map +1 -0
  681. package/dist/search/text.js +165 -0
  682. package/dist/search/text.js.map +1 -0
  683. package/dist/search-index.d.ts +9 -0
  684. package/dist/search-index.d.ts.map +1 -0
  685. package/dist/search-index.js +9 -0
  686. package/dist/search-index.js.map +1 -0
  687. package/dist/sha256.d.ts.map +1 -1
  688. package/dist/sha256.js +3 -2
  689. package/dist/sha256.js.map +1 -1
  690. package/dist/site-capabilities.d.ts +345 -0
  691. package/dist/site-capabilities.d.ts.map +1 -0
  692. package/dist/site-capabilities.js +724 -0
  693. package/dist/site-capabilities.js.map +1 -0
  694. package/dist/site-manifest.d.ts +51 -0
  695. package/dist/site-manifest.d.ts.map +1 -0
  696. package/dist/site-manifest.js +115 -0
  697. package/dist/site-manifest.js.map +1 -0
  698. package/dist/skip-reasons.d.ts +12 -0
  699. package/dist/skip-reasons.d.ts.map +1 -0
  700. package/dist/skip-reasons.js +15 -0
  701. package/dist/skip-reasons.js.map +1 -0
  702. package/dist/source-engine/driver.d.ts +40 -0
  703. package/dist/source-engine/driver.d.ts.map +1 -0
  704. package/dist/source-engine/driver.js +513 -0
  705. package/dist/source-engine/driver.js.map +1 -0
  706. package/dist/source-engine/evidence.d.ts +39 -0
  707. package/dist/source-engine/evidence.d.ts.map +1 -0
  708. package/dist/source-engine/evidence.js +54 -0
  709. package/dist/source-engine/evidence.js.map +1 -0
  710. package/dist/source-engine/guard.d.ts +87 -0
  711. package/dist/source-engine/guard.d.ts.map +1 -0
  712. package/dist/source-engine/guard.js +427 -0
  713. package/dist/source-engine/guard.js.map +1 -0
  714. package/dist/source-engine/index.d.ts +35 -0
  715. package/dist/source-engine/index.d.ts.map +1 -0
  716. package/dist/source-engine/index.js +27 -0
  717. package/dist/source-engine/index.js.map +1 -0
  718. package/dist/source-engine/machine-state.d.ts +87 -0
  719. package/dist/source-engine/machine-state.d.ts.map +1 -0
  720. package/dist/source-engine/machine-state.js +94 -0
  721. package/dist/source-engine/machine-state.js.map +1 -0
  722. package/dist/source-engine/observe.d.ts +10 -0
  723. package/dist/source-engine/observe.d.ts.map +1 -0
  724. package/dist/source-engine/observe.js +276 -0
  725. package/dist/source-engine/observe.js.map +1 -0
  726. package/dist/source-engine/overlay.d.ts +50 -0
  727. package/dist/source-engine/overlay.d.ts.map +1 -0
  728. package/dist/source-engine/overlay.js +114 -0
  729. package/dist/source-engine/overlay.js.map +1 -0
  730. package/dist/source-engine/robots.d.ts +53 -0
  731. package/dist/source-engine/robots.d.ts.map +1 -0
  732. package/dist/source-engine/robots.js +158 -0
  733. package/dist/source-engine/robots.js.map +1 -0
  734. package/dist/source-engine/snapshot.d.ts +104 -0
  735. package/dist/source-engine/snapshot.d.ts.map +1 -0
  736. package/dist/source-engine/snapshot.js +240 -0
  737. package/dist/source-engine/snapshot.js.map +1 -0
  738. package/dist/source-engine/target-consumer.d.ts +12 -0
  739. package/dist/source-engine/target-consumer.d.ts.map +1 -0
  740. package/dist/source-engine/target-consumer.js +15 -0
  741. package/dist/source-engine/target-consumer.js.map +1 -0
  742. package/dist/source-engine/target-descriptor.d.ts +3 -0
  743. package/dist/source-engine/target-descriptor.d.ts.map +1 -0
  744. package/dist/source-engine/target-descriptor.js +26 -0
  745. package/dist/source-engine/target-descriptor.js.map +1 -0
  746. package/dist/source-engine/target.d.ts +82 -0
  747. package/dist/source-engine/target.d.ts.map +1 -0
  748. package/dist/source-engine/target.js +213 -0
  749. package/dist/source-engine/target.js.map +1 -0
  750. package/dist/source-engine/types.d.ts +296 -0
  751. package/dist/source-engine/types.d.ts.map +1 -0
  752. package/dist/source-engine/types.js +2 -0
  753. package/dist/source-engine/types.js.map +1 -0
  754. package/dist/source-harness/conformance.d.ts +16 -0
  755. package/dist/source-harness/conformance.d.ts.map +1 -0
  756. package/dist/source-harness/conformance.js +266 -0
  757. package/dist/source-harness/conformance.js.map +1 -0
  758. package/dist/source-harness/fixture.d.ts +97 -0
  759. package/dist/source-harness/fixture.d.ts.map +1 -0
  760. package/dist/source-harness/fixture.js +276 -0
  761. package/dist/source-harness/fixture.js.map +1 -0
  762. package/dist/source-harness/index.d.ts +22 -0
  763. package/dist/source-harness/index.d.ts.map +1 -0
  764. package/dist/source-harness/index.js +19 -0
  765. package/dist/source-harness/index.js.map +1 -0
  766. package/dist/source-harness/peer.d.ts +74 -0
  767. package/dist/source-harness/peer.d.ts.map +1 -0
  768. package/dist/source-harness/peer.js +106 -0
  769. package/dist/source-harness/peer.js.map +1 -0
  770. package/dist/source-profiles/index.d.ts +31 -0
  771. package/dist/source-profiles/index.d.ts.map +1 -0
  772. package/dist/source-profiles/index.js +206 -0
  773. package/dist/source-profiles/index.js.map +1 -0
  774. package/dist/source-profiles/link-header.d.ts +6 -0
  775. package/dist/source-profiles/link-header.d.ts.map +1 -0
  776. package/dist/source-profiles/link-header.js +131 -0
  777. package/dist/source-profiles/link-header.js.map +1 -0
  778. package/dist/storage-harness/contract.d.ts +109 -0
  779. package/dist/storage-harness/contract.d.ts.map +1 -0
  780. package/dist/storage-harness/contract.js +853 -0
  781. package/dist/storage-harness/contract.js.map +1 -0
  782. package/dist/storage-harness/index.d.ts +39 -0
  783. package/dist/storage-harness/index.d.ts.map +1 -0
  784. package/dist/storage-harness/index.js +55 -0
  785. package/dist/storage-harness/index.js.map +1 -0
  786. package/dist/storage.d.ts +10 -2
  787. package/dist/storage.d.ts.map +1 -1
  788. package/dist/storage.js +10 -2
  789. package/dist/storage.js.map +1 -1
  790. package/dist/string-identity-agreement.d.ts +35 -0
  791. package/dist/string-identity-agreement.d.ts.map +1 -0
  792. package/dist/string-identity-agreement.js +78 -0
  793. package/dist/string-identity-agreement.js.map +1 -0
  794. package/dist/system-documents.d.ts +82 -0
  795. package/dist/system-documents.d.ts.map +1 -0
  796. package/dist/system-documents.js +127 -0
  797. package/dist/system-documents.js.map +1 -0
  798. package/dist/types.d.ts +54 -8
  799. package/dist/types.d.ts.map +1 -1
  800. package/dist/types.js +0 -10
  801. package/dist/types.js.map +1 -1
  802. package/dist/uncertain-write.d.ts +164 -17
  803. package/dist/uncertain-write.d.ts.map +1 -1
  804. package/dist/uncertain-write.js +86 -30
  805. package/dist/uncertain-write.js.map +1 -1
  806. package/dist/validation.d.ts +5 -0
  807. package/dist/validation.d.ts.map +1 -1
  808. package/dist/verification.d.ts +22 -10
  809. package/dist/verification.d.ts.map +1 -1
  810. package/dist/verification.js +87 -39
  811. package/dist/verification.js.map +1 -1
  812. package/dist/view-launch-contract.d.ts +14 -0
  813. package/dist/view-launch-contract.d.ts.map +1 -0
  814. package/dist/view-launch-contract.js +23 -0
  815. package/dist/view-launch-contract.js.map +1 -0
  816. package/dist/write-identity.d.ts +5 -0
  817. package/dist/write-identity.d.ts.map +1 -0
  818. package/dist/write-identity.js +9 -0
  819. package/dist/write-identity.js.map +1 -0
  820. package/package.json +202 -8
@@ -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,M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CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACtB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,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":""}
@@ -0,0 +1,71 @@
1
+ import type { EdgeSource } from "./edges/source.js";
2
+ import type { ConceptId, Link, Version } from "./types.js";
3
+ /** Derived index generation. Advance when parsing or grouping changes the stored occurrences. */
4
+ export declare const RELATIONSHIP_PARSER_VERSION = "links/v3";
5
+ export declare const CONCEPT_RELATIONSHIP_PARSER_VERSION: "links/v3/okf-0.3";
6
+ declare const legacyProjection: {
7
+ readonly parserVersion: "links/v3";
8
+ readonly conceptsOnly: false;
9
+ };
10
+ declare const conceptProjection: {
11
+ readonly parserVersion: "links/v3/okf-0.3";
12
+ readonly conceptsOnly: true;
13
+ };
14
+ export type RelationshipProjection = typeof legacyProjection | typeof conceptProjection;
15
+ export declare const RELATIONSHIP_PROJECTION_VERSIONS: readonly ["links/v3", "links/v3/okf-0.3"];
16
+ /** Reuse an identity only when both the occurrences and the endpoint decisions agree. */
17
+ export declare function relationshipProjectionForEdition(edition?: string): RelationshipProjection | null;
18
+ export declare const MAX_RELATIONSHIP_PAGE_ROWS = 30;
19
+ export interface RelationshipPosition {
20
+ direction: "incoming" | "outgoing";
21
+ documentId: ConceptId;
22
+ labelKey: Version;
23
+ }
24
+ /** A label may be bounded for presentation. Use labelKey from the full authored label to seek. */
25
+ export type IndexedRelationshipPage = {
26
+ status: "uninstalled" | "pending" | "not_found";
27
+ } | {
28
+ status: "ready";
29
+ rows: (RelationshipPosition & {
30
+ label: string;
31
+ title: string | null;
32
+ })[];
33
+ more: boolean;
34
+ };
35
+ /**
36
+ * Page the relationships of a document in an already selected bundle. Exclude self-links and
37
+ * absent endpoints. Return one row per direction, neighbor and full label, ordered by
38
+ * compareRelationshipPositions, starting strictly after the supplied position. The adapter
39
+ * reports missing or incomplete index state before returning any partial rows.
40
+ */
41
+ export type RelationshipPageReader = (documentId: ConceptId, limit: number, after?: RelationshipPosition) => Promise<IndexedRelationshipPage>;
42
+ /** Match UTF-8 binary ordering for canonical document IDs, including supplementary characters. */
43
+ export declare function compareRelationshipPositions(a: RelationshipPosition, b: RelationshipPosition): number;
44
+ interface RelationshipOccurrenceGroup {
45
+ target: ConceptId;
46
+ label: string;
47
+ labelKey: Version;
48
+ occurrences: [ordinal: number, href: string][];
49
+ }
50
+ /** Group one document's local parser output while keeping each authored occurrence for a graph read. */
51
+ export declare function groupRelationshipOccurrences(links: readonly Pick<Link, "to" | "text" | "href">[]): RelationshipOccurrenceGroup[];
52
+ /** One document's raw link occurrences: the source of both queryEdges and the relationship page. */
53
+ export interface RelationshipSource {
54
+ id: ConceptId;
55
+ title: string | null;
56
+ /** The trimmed `type`, or null; absent only from a producer that does not classify. */
57
+ type?: string | null;
58
+ links: Link[];
59
+ /** Required when the producer classified an OKF 0.3 source. */
60
+ concept?: boolean;
61
+ }
62
+ /** Keep v0.3 graph edges between concepts while leaving authored link diagnostics intact. */
63
+ export declare function resolveRelationshipSources(sources: RelationshipSource[], okfVersion?: string): RelationshipSource[];
64
+ /**
65
+ * One page of a document's direct links over an edge source: one row per direction, neighbor and
66
+ * full label, ordered by compareRelationshipPositions, starting strictly after `after`. Self links
67
+ * and links to documents that are no nodes are left out; a document that is no node is `not_found`.
68
+ */
69
+ export declare function relationshipPage(source: EdgeSource, documentId: ConceptId, limit: number, after?: RelationshipPosition): Promise<IndexedRelationshipPage>;
70
+ export {};
71
+ //# sourceMappingURL=relationships.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../src/relationships.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG3D,iGAAiG;AACjG,eAAO,MAAM,2BAA2B,aAAa,CAAC;AACtD,eAAO,MAAM,mCAAmC,oBAAoD,CAAC;AACrG,QAAA,MAAM,gBAAgB;;;CAA+E,CAAC;AACtG,QAAA,MAAM,iBAAiB;;;CAAsF,CAAC;AAE9G,MAAM,MAAM,sBAAsB,GAAG,OAAO,gBAAgB,GAAG,OAAO,iBAAiB,CAAC;AACxF,eAAO,MAAM,gCAAgC,2CAA6E,CAAC;AAE3H,yFAAyF;AACzF,wBAAgB,gCAAgC,CAAC,OAAO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EAAE,SAAS,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,6FAA6F;AAC7F,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAKnH;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,SAAS,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,oBAAoB,GAC3B,OAAO,CAAC,uBAAuB,CAAC,CA0BlC"}
@@ -0,0 +1,87 @@
1
+ import { compareCodePoints } from "./code-point-order.js";
2
+ import { compareCodeUnits } from "./code-unit-order.js";
3
+ import { versionOfBytes } from "./versioning.js";
4
+ /** Derived index generation. Advance when parsing or grouping changes the stored occurrences. */
5
+ export const RELATIONSHIP_PARSER_VERSION = "links/v3";
6
+ export const CONCEPT_RELATIONSHIP_PARSER_VERSION = `${RELATIONSHIP_PARSER_VERSION}/okf-0.3`;
7
+ const legacyProjection = { parserVersion: RELATIONSHIP_PARSER_VERSION, conceptsOnly: false };
8
+ const conceptProjection = { parserVersion: CONCEPT_RELATIONSHIP_PARSER_VERSION, conceptsOnly: true };
9
+ export const RELATIONSHIP_PROJECTION_VERSIONS = [legacyProjection.parserVersion, conceptProjection.parserVersion];
10
+ /** Reuse an identity only when both the occurrences and the endpoint decisions agree. */
11
+ export function relationshipProjectionForEdition(edition) {
12
+ switch (edition) {
13
+ case undefined:
14
+ case "0.1":
15
+ case "0.2":
16
+ return legacyProjection;
17
+ case "0.3":
18
+ return conceptProjection;
19
+ default:
20
+ return null;
21
+ }
22
+ }
23
+ export const MAX_RELATIONSHIP_PAGE_ROWS = 30;
24
+ /** Match UTF-8 binary ordering for canonical document IDs, including supplementary characters. */
25
+ export function compareRelationshipPositions(a, b) {
26
+ return compareCodeUnits(a.direction, b.direction) ||
27
+ compareCodePoints(a.documentId, b.documentId) ||
28
+ compareCodeUnits(a.labelKey, b.labelKey);
29
+ }
30
+ /** Group one document's local parser output while keeping each authored occurrence for a graph read. */
31
+ export function groupRelationshipOccurrences(links) {
32
+ const groups = new Map();
33
+ for (const [ordinal, { to, text, href }] of links.entries()) {
34
+ const key = JSON.stringify([to, text]);
35
+ const group = groups.get(key) ?? { target: to, label: text, labelKey: versionOfBytes(text), occurrences: [] };
36
+ groups.set(key, group);
37
+ group.occurrences.push([ordinal, href]);
38
+ }
39
+ return [...groups.values()];
40
+ }
41
+ /** Keep v0.3 graph edges between concepts while leaving authored link diagnostics intact. */
42
+ export function resolveRelationshipSources(sources, okfVersion) {
43
+ if (!relationshipProjectionForEdition(okfVersion)?.conceptsOnly)
44
+ return sources;
45
+ const concepts = sources.filter((source) => source.concept);
46
+ const ids = new Set(concepts.map(({ id }) => id));
47
+ return concepts.map((source) => ({ ...source, links: source.links.filter(({ to }) => ids.has(to)) }));
48
+ }
49
+ /**
50
+ * One page of a document's direct links over an edge source: one row per direction, neighbor and
51
+ * full label, ordered by compareRelationshipPositions, starting strictly after `after`. Self links
52
+ * and links to documents that are no nodes are left out; a document that is no node is `not_found`.
53
+ */
54
+ export async function relationshipPage(source, documentId, limit, after) {
55
+ const self = await source.heads([documentId]);
56
+ if (self.status !== "ready")
57
+ return { status: self.status };
58
+ if (!self.heads.has(documentId))
59
+ return { status: "not_found" };
60
+ const only = { ids: [documentId], prefixes: [] };
61
+ const [outgoing, incoming] = await Promise.all([source.edges({ from: only }), source.edges({ to: only })]);
62
+ if (outgoing.status !== "ready")
63
+ return { status: outgoing.status };
64
+ if (incoming.status !== "ready")
65
+ return { status: incoming.status };
66
+ const links = [
67
+ ...outgoing.edges.map((link) => ["outgoing", link.to, link.text]),
68
+ ...incoming.edges.map((link) => ["incoming", link.from, link.text]),
69
+ ].filter(([, neighbor]) => neighbor !== documentId);
70
+ const neighbors = await source.heads([...new Set(links.map(([, neighbor]) => neighbor))]);
71
+ if (neighbors.status !== "ready")
72
+ return { status: neighbors.status };
73
+ const rows = new Map();
74
+ for (const [direction, neighbor, label] of links) {
75
+ const head = neighbors.heads.get(neighbor);
76
+ const key = JSON.stringify([direction, neighbor, label]);
77
+ if (head === undefined || rows.has(key))
78
+ continue;
79
+ rows.set(key, { direction, documentId: neighbor, label, labelKey: versionOfBytes(label), title: head.title });
80
+ }
81
+ const sorted = [...rows.values()].sort(compareRelationshipPositions);
82
+ const start = after ? sorted.findIndex((row) => compareRelationshipPositions(row, after) > 0) : 0;
83
+ if (start < 0)
84
+ return { status: "ready", rows: [], more: false };
85
+ return { status: "ready", rows: sorted.slice(start, start + limit), more: sorted.length > start + limit };
86
+ }
87
+ //# sourceMappingURL=relationships.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationships.js","sourceRoot":"","sources":["../src/relationships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,iGAAiG;AACjG,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC;AACtD,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,2BAA2B,UAAmB,CAAC;AACrG,MAAM,gBAAgB,GAAG,EAAE,aAAa,EAAE,2BAA2B,EAAE,YAAY,EAAE,KAAK,EAAW,CAAC;AACtG,MAAM,iBAAiB,GAAG,EAAE,aAAa,EAAE,mCAAmC,EAAE,YAAY,EAAE,IAAI,EAAW,CAAC;AAG9G,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,gBAAgB,CAAC,aAAa,EAAE,iBAAiB,CAAC,aAAa,CAAU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CAAC;AAC5G,CAAC"}
@@ -1,13 +1,19 @@
1
1
  /**
2
+ * Internal: not exported from any package entry point. It is the client the repository's router
3
+ * and sync tests drive the wire protocol with; packages outside core import it from core's built
4
+ * output by relative path.
5
+ *
2
6
  * `RemoteBackend` — a {@link StorageBackend} implemented over the wire-protocol v0
3
7
  * reference contract (`docs/WIRE-PROTOCOL.md`, `@superbee/server`).
4
8
  *
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.
9
+ * This is the client half of the seam over HTTP: every method maps directly to a wire endpoint
10
+ * (a guarded document write may first ask `GET /v0/capabilities` whether the host records
11
+ * outcomes; see {@link RemoteBackendOptions.maxRetries}), and response versions remain the same
12
+ * content-addressed {@link Version} tokens local backends produce. Tri-backend contract tests pin
13
+ * that invariant.
8
14
  *
9
15
  * Zero new dependencies: it calls an injectable {@link FetchLike} transport
10
- * (defaulting to the global `fetch`, available on Node >= 20) with a constructed
16
+ * (defaulting to the global `fetch`, available in every supported Node runtime) with a constructed
11
17
  * `Request`. That means the SAME adapter runs against a real HTTP server, or — in
12
18
  * tests — directly against an in-process `createRouter(bundle)` function with no
13
19
  * sockets: `createRouter` returns exactly the `(req: Request) => Promise<Response>`
@@ -55,7 +61,7 @@ export interface RemoteBackendOptions {
55
61
  baseUrl: string;
56
62
  /** Bundle name segment in the `/v0/bundles/{bundle}/…` path. */
57
63
  bundle: string;
58
- /** Transport override; defaults to the global `fetch` (Node >= 20). Tests inject a router directly. */
64
+ /** Transport override; defaults to the global `fetch` in supported Node runtimes. Tests inject a router directly. */
59
65
  fetchImpl?: FetchLike;
60
66
  /**
61
67
  * Optional bearer token sent as `Authorization: Bearer <token>` on EVERY request. The
@@ -69,36 +75,37 @@ export interface RemoteBackendOptions {
69
75
  * e.g. a Cloudflare D1 cold-start's 500 "storage caused object to be reset" when a hibernated
70
76
  * database is first hit) or a network/transport error. Each retry backs off exponentially with
71
77
  * 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.
78
+ * Default 3; set 0 to disable. A retried read is idempotent.
79
+ *
80
+ * A guarded document write (`write` with `expectedVersion`, or `delete` with a content-version
81
+ * `expectedVersion`) travels with an `Idempotency-Key`: the caller's `requestId`, or else, when
82
+ * the host's capabilities report `operations`, one minted for that call. Every retry of the
83
+ * request carries the same key, so while the host keeps the record a retry is answered from the
84
+ * recorded outcome and cannot apply the write a second time.
85
+ *
86
+ * Other guarded writes retry as a plain resubmission: a guarded document write sent without a key
87
+ * (to a host without `operations`, after a capability question that ended in a transient status,
88
+ * or resent after the host refused a key minted under a stale answer), a `delete` whose
89
+ * `expectedVersion` is not a content version, and every guarded reserved-file and blob write,
90
+ * none of which the wire identifies. Such a retry lands the same version or a conflict, possibly
91
+ * SPURIOUS if a prior attempt committed before its response was lost. It is not free of lost
92
+ * updates: versions are content hashes, so if another writer returns the document to the exact
93
+ * state the premise names before a retry arrives, the retry applies the write again over that
94
+ * change and reports success. An unconditional write carries no minted key and can simply be
95
+ * repeated.
75
96
  */
76
97
  maxRetries?: number;
77
98
  }
78
99
  export { RemoteError } from "./remote-error.js";
79
- /** The deployment-scoped capability booleans a wire authority reports (`docs/WIRE-PROTOCOL.md`). */
80
- export interface WireCapabilities {
81
- history: boolean;
82
- enforced_cas: boolean;
83
- projections: boolean;
84
- backlinks: boolean;
85
- blobs: boolean;
86
- /** Whether document writes carrying `Idempotency-Key` are recorded and readable by lookup. */
87
- operations: boolean;
88
- /** Whether `GET /heads` answers every document id and version under one digest, with `304`. */
89
- heads: boolean;
90
- /** Whether `GET /snapshot` streams every document as terminated NDJSON. */
91
- snapshot: boolean;
92
- }
93
- /** Options for {@link RemoteBackend.heads}. */
94
- export interface HeadsOptions {
95
- /** A digest from an earlier `heads` or `snapshot` answer; the authority answers `304` when it still holds it. */
96
- ifNoneMatch?: string;
97
- }
100
+ export type { HeadsOptions, WireCapabilities } from "./remote-parsers.js";
101
+ import type { HeadsOptions, WireCapabilities } from "./remote-parsers.js";
98
102
  /**
99
103
  * The client half of the wire-protocol v0 contract: implements {@link StorageBackend}
100
104
  * over HTTP against a `@superbee/server` instance (or any conformant
101
105
  * implementation of `docs/WIRE-PROTOCOL.md`).
106
+ *
107
+ * @deprecated The v0 remote client will be removed in a future release. Open a local bundle
108
+ * through the filesystem backend, or use a hosted checkout through the CLI.
102
109
  */
103
110
  export declare class RemoteBackend implements StorageBackend {
104
111
  private readonly baseUrl;
@@ -106,6 +113,8 @@ export declare class RemoteBackend implements StorageBackend {
106
113
  private readonly fetchImpl;
107
114
  private readonly authToken?;
108
115
  private readonly maxRetries;
116
+ /** The pending or settled answer to whether this host records outcomes; see {@link recordsOutcomes}. */
117
+ private operationsSupport?;
109
118
  constructor(options: RemoteBackendOptions);
110
119
  /** The authority's base URL as configured, without a trailing slash. */
111
120
  get origin(): string;
@@ -119,12 +128,33 @@ export declare class RemoteBackend implements StorageBackend {
119
128
  write(id: ConceptId, doc: OkfDocument, options?: WriteOptions): Promise<Version>;
120
129
  /**
121
130
  * `GET /v0/capabilities`, deployment-scoped: what this authority implements. `operations` says
122
- * whether it records outcomes by request identity. A host without it ignores `Idempotency-Key`
123
- * and answers the lookup route with a route-miss `404`, which {@link lookupOperation} cannot
124
- * tell from "never recorded"; a consumer that relies on identity checks this once before it
125
- * sends any intent. Missing booleans read as `false`.
131
+ * whether it records outcomes by request identity. The reference router without it refuses any
132
+ * request carrying `Idempotency-Key`, and the lookup route, with `400 USAGE`; a host that lacks
133
+ * the lookup route altogether answers it with a route-miss `404`, which {@link lookupOperation}
134
+ * cannot tell from "never recorded". A consumer that relies on identity checks this once before
135
+ * it sends any intent. Missing booleans read as `false`.
126
136
  */
127
137
  wireCapabilities(): Promise<WireCapabilities>;
138
+ /**
139
+ * Whether this host records outcomes by request identity, asked through `GET /v0/capabilities`
140
+ * and shared by concurrent callers. A host that answers anything but a `2xx` with
141
+ * `operations: true` is treated as not recording them, since a host that does not record them
142
+ * refuses a key with `400`. That answer is kept for the backend's lifetime, except that a
143
+ * transient status still returned after `send`'s retries, or a transport failure, is not kept:
144
+ * the former sends this write unidentified, and the latter rejects the write before it is sent.
145
+ * A kept yes is also dropped when a minted key meets the host's identity refusal; see
146
+ * {@link sendDocWrite}.
147
+ */
148
+ private recordsOutcomes;
149
+ private probeOperations;
150
+ /**
151
+ * Send a document `PUT` or `DELETE`. When its `Idempotency-Key` was minted here, a kept
152
+ * `operations` answer may be stale: a host that has since lost its outcome store refuses every
153
+ * key with the wire's `400` {@link IDENTITY_UNSUPPORTED} before applying anything. That answer
154
+ * is dropped and the write is sent once more without a key, as to any host without
155
+ * `operations`. A caller's own `requestId` is never dropped, so its refusal is the answer.
156
+ */
157
+ private sendDocWrite;
128
158
  /**
129
159
  * `GET /heads`: every document id and version the authority holds, under one digest, or
130
160
  * `null` when `ifNoneMatch` named the digest it still holds (a `304`: nothing changed). A
@@ -174,7 +204,12 @@ export declare class RemoteBackend implements StorageBackend {
174
204
  * `docs/WIRE-PROTOCOL.md`); the engine's `queryHeads` re-filter covers it, per the
175
205
  * seam contract (over-returning is fine; semantics live in core).
176
206
  */
177
- queryHeads(filter?: QueryFilter): Promise<HeadResult[]>;
207
+ queryHeads(filter?: QueryFilter, options?: {
208
+ onSkip?: (skip: {
209
+ id: ConceptId;
210
+ reason: string;
211
+ }) => void;
212
+ }): Promise<HeadResult[]>;
178
213
  versions(id: ConceptId): Promise<VersionInfo[]>;
179
214
  readReserved(dir: string, name: ReservedFilename): Promise<ReservedReadResult | null>;
180
215
  writeReserved(dir: string, name: ReservedFilename, content: string, options?: WriteOptions): Promise<Version>;