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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (793) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +1339 -6
  3. package/dist/backend.d.ts +50 -2
  4. package/dist/backend.d.ts.map +1 -1
  5. package/dist/backend.js +311 -33
  6. package/dist/backend.js.map +1 -1
  7. package/dist/blob-contract.d.ts +82 -0
  8. package/dist/blob-contract.d.ts.map +1 -0
  9. package/dist/blob-contract.js +134 -0
  10. package/dist/blob-contract.js.map +1 -0
  11. package/dist/blob-journal.d.ts +303 -0
  12. package/dist/blob-journal.d.ts.map +1 -0
  13. package/dist/blob-journal.js +541 -0
  14. package/dist/blob-journal.js.map +1 -0
  15. package/dist/body-pages.d.ts +20 -0
  16. package/dist/body-pages.d.ts.map +1 -0
  17. package/dist/body-pages.js +56 -0
  18. package/dist/body-pages.js.map +1 -0
  19. package/dist/body-replace-guards.d.ts +81 -0
  20. package/dist/body-replace-guards.d.ts.map +1 -0
  21. package/dist/body-replace-guards.js +271 -0
  22. package/dist/body-replace-guards.js.map +1 -0
  23. package/dist/bounded-yaml.d.ts +28 -0
  24. package/dist/bounded-yaml.d.ts.map +1 -0
  25. package/dist/bounded-yaml.js +182 -0
  26. package/dist/bounded-yaml.js.map +1 -0
  27. package/dist/builtin-recipes/content.d.ts +93 -0
  28. package/dist/builtin-recipes/content.d.ts.map +1 -0
  29. package/dist/builtin-recipes/content.js +288 -0
  30. package/dist/builtin-recipes/content.js.map +1 -0
  31. package/dist/builtin-recipes/site.d.ts +5 -0
  32. package/dist/builtin-recipes/site.d.ts.map +1 -0
  33. package/dist/builtin-recipes/site.js +83 -0
  34. package/dist/builtin-recipes/site.js.map +1 -0
  35. package/dist/builtin-recipes.d.ts +13 -0
  36. package/dist/builtin-recipes.d.ts.map +1 -0
  37. package/dist/builtin-recipes.js +123 -0
  38. package/dist/builtin-recipes.js.map +1 -0
  39. package/dist/bundle-health/index.d.ts +14 -0
  40. package/dist/bundle-health/index.d.ts.map +1 -0
  41. package/dist/bundle-health/index.js +12 -0
  42. package/dist/bundle-health/index.js.map +1 -0
  43. package/dist/bundle-health/kind-findings.d.ts +45 -0
  44. package/dist/bundle-health/kind-findings.d.ts.map +1 -0
  45. package/dist/bundle-health/kind-findings.js +67 -0
  46. package/dist/bundle-health/kind-findings.js.map +1 -0
  47. package/dist/bundle-health/legacy-page.d.ts +21 -0
  48. package/dist/bundle-health/legacy-page.d.ts.map +1 -0
  49. package/dist/bundle-health/legacy-page.js +25 -0
  50. package/dist/bundle-health/legacy-page.js.map +1 -0
  51. package/dist/bundle-health/report.d.ts +191 -0
  52. package/dist/bundle-health/report.d.ts.map +1 -0
  53. package/dist/bundle-health/report.js +419 -0
  54. package/dist/bundle-health/report.js.map +1 -0
  55. package/dist/bundle-ops.d.ts +10 -4
  56. package/dist/bundle-ops.d.ts.map +1 -1
  57. package/dist/bundle-ops.js +15 -8
  58. package/dist/bundle-ops.js.map +1 -1
  59. package/dist/bundle.d.ts +2 -4
  60. package/dist/bundle.d.ts.map +1 -1
  61. package/dist/bundle.js +3 -12
  62. package/dist/bundle.js.map +1 -1
  63. package/dist/code-point-order.d.ts +8 -0
  64. package/dist/code-point-order.d.ts.map +1 -0
  65. package/dist/code-point-order.js +20 -0
  66. package/dist/code-point-order.js.map +1 -0
  67. package/dist/code-unit-order.d.ts +15 -0
  68. package/dist/code-unit-order.d.ts.map +1 -0
  69. package/dist/code-unit-order.js +17 -0
  70. package/dist/code-unit-order.js.map +1 -0
  71. package/dist/connector-request.d.ts +112 -0
  72. package/dist/connector-request.d.ts.map +1 -0
  73. package/dist/connector-request.js +495 -0
  74. package/dist/connector-request.js.map +1 -0
  75. package/dist/connectors.d.ts +297 -0
  76. package/dist/connectors.d.ts.map +1 -0
  77. package/dist/connectors.js +1233 -0
  78. package/dist/connectors.js.map +1 -0
  79. package/dist/convention-record.d.ts +9 -0
  80. package/dist/convention-record.d.ts.map +1 -0
  81. package/dist/convention-record.js +13 -0
  82. package/dist/convention-record.js.map +1 -0
  83. package/dist/cross-bundle.d.ts +135 -0
  84. package/dist/cross-bundle.d.ts.map +1 -0
  85. package/dist/cross-bundle.js +191 -0
  86. package/dist/cross-bundle.js.map +1 -0
  87. package/dist/dependencies.d.ts +208 -0
  88. package/dist/dependencies.d.ts.map +1 -0
  89. package/dist/dependencies.js +367 -0
  90. package/dist/dependencies.js.map +1 -0
  91. package/dist/document-codec.d.ts +4 -1
  92. package/dist/document-codec.d.ts.map +1 -1
  93. package/dist/document-codec.js +3 -1
  94. package/dist/document-codec.js.map +1 -1
  95. package/dist/document-field-actions.d.ts +21 -3
  96. package/dist/document-field-actions.d.ts.map +1 -1
  97. package/dist/document-field-actions.js +105 -40
  98. package/dist/document-field-actions.js.map +1 -1
  99. package/dist/document-mutation.d.ts +44 -18
  100. package/dist/document-mutation.d.ts.map +1 -1
  101. package/dist/document-mutation.js +192 -86
  102. package/dist/document-mutation.js.map +1 -1
  103. package/dist/document-persistence.d.ts +12 -0
  104. package/dist/document-persistence.d.ts.map +1 -0
  105. package/dist/document-persistence.js +44 -0
  106. package/dist/document-persistence.js.map +1 -0
  107. package/dist/document-replace-rules.d.ts +44 -0
  108. package/dist/document-replace-rules.d.ts.map +1 -0
  109. package/dist/document-replace-rules.js +41 -0
  110. package/dist/document-replace-rules.js.map +1 -0
  111. package/dist/document-scan.d.ts +26 -0
  112. package/dist/document-scan.d.ts.map +1 -0
  113. package/dist/document-scan.js +70 -0
  114. package/dist/document-scan.js.map +1 -0
  115. package/dist/document-transfer.d.ts +314 -0
  116. package/dist/document-transfer.d.ts.map +1 -0
  117. package/dist/document-transfer.js +1404 -0
  118. package/dist/document-transfer.js.map +1 -0
  119. package/dist/document-write-policy.d.ts +15 -4
  120. package/dist/document-write-policy.d.ts.map +1 -1
  121. package/dist/document-write-policy.js +41 -27
  122. package/dist/document-write-policy.js.map +1 -1
  123. package/dist/domain-model.d.ts +73 -0
  124. package/dist/domain-model.d.ts.map +1 -0
  125. package/dist/domain-model.js +169 -0
  126. package/dist/domain-model.js.map +1 -0
  127. package/dist/edge-harness/corpus.d.ts +9 -0
  128. package/dist/edge-harness/corpus.d.ts.map +1 -0
  129. package/dist/edge-harness/corpus.js +57 -0
  130. package/dist/edge-harness/corpus.js.map +1 -0
  131. package/dist/edge-harness/index.d.ts +21 -0
  132. package/dist/edge-harness/index.d.ts.map +1 -0
  133. package/dist/edge-harness/index.js +537 -0
  134. package/dist/edge-harness/index.js.map +1 -0
  135. package/dist/edges/find.d.ts +14 -0
  136. package/dist/edges/find.d.ts.map +1 -0
  137. package/dist/edges/find.js +46 -0
  138. package/dist/edges/find.js.map +1 -0
  139. package/dist/edges/index.d.ts +13 -0
  140. package/dist/edges/index.d.ts.map +1 -0
  141. package/dist/edges/index.js +5 -0
  142. package/dist/edges/index.js.map +1 -0
  143. package/dist/edges/memory-source.d.ts +8 -0
  144. package/dist/edges/memory-source.d.ts.map +1 -0
  145. package/dist/edges/memory-source.js +164 -0
  146. package/dist/edges/memory-source.js.map +1 -0
  147. package/dist/edges/read-bounds.d.ts +6 -0
  148. package/dist/edges/read-bounds.d.ts.map +1 -0
  149. package/dist/edges/read-bounds.js +13 -0
  150. package/dist/edges/read-bounds.js.map +1 -0
  151. package/dist/edges/source.d.ts +123 -0
  152. package/dist/edges/source.d.ts.map +1 -0
  153. package/dist/edges/source.js +2 -0
  154. package/dist/edges/source.js.map +1 -0
  155. package/dist/edges/walk.d.ts +7 -0
  156. package/dist/edges/walk.d.ts.map +1 -0
  157. package/dist/edges/walk.js +14 -0
  158. package/dist/edges/walk.js.map +1 -0
  159. package/dist/engine.d.ts +54 -18
  160. package/dist/engine.d.ts.map +1 -1
  161. package/dist/engine.js +137 -108
  162. package/dist/engine.js.map +1 -1
  163. package/dist/errors.d.ts +40 -2
  164. package/dist/errors.d.ts.map +1 -1
  165. package/dist/errors.js +80 -4
  166. package/dist/errors.js.map +1 -1
  167. package/dist/file-journaled-backend-internal.d.ts +2 -0
  168. package/dist/file-journaled-backend-internal.d.ts.map +1 -1
  169. package/dist/file-journaled-backend-internal.js +2 -0
  170. package/dist/file-journaled-backend-internal.js.map +1 -1
  171. package/dist/file-journaled-backend.d.ts +38 -40
  172. package/dist/file-journaled-backend.d.ts.map +1 -1
  173. package/dist/file-journaled-backend.js +284 -52
  174. package/dist/file-journaled-backend.js.map +1 -1
  175. package/dist/filesystem-identity.d.ts +116 -17
  176. package/dist/filesystem-identity.d.ts.map +1 -1
  177. package/dist/filesystem-identity.js +532 -51
  178. package/dist/filesystem-identity.js.map +1 -1
  179. package/dist/filesystem-lock.d.ts +9 -2
  180. package/dist/filesystem-lock.d.ts.map +1 -1
  181. package/dist/filesystem-lock.js +134 -17
  182. package/dist/filesystem-lock.js.map +1 -1
  183. package/dist/filesystem-temp-name.d.ts +9 -0
  184. package/dist/filesystem-temp-name.d.ts.map +1 -0
  185. package/dist/filesystem-temp-name.js +20 -0
  186. package/dist/filesystem-temp-name.js.map +1 -0
  187. package/dist/filesystem.d.ts +6 -0
  188. package/dist/filesystem.d.ts.map +1 -1
  189. package/dist/filesystem.js +2 -1
  190. package/dist/filesystem.js.map +1 -1
  191. package/dist/freshness.d.ts +16 -1
  192. package/dist/freshness.d.ts.map +1 -1
  193. package/dist/freshness.js +47 -17
  194. package/dist/freshness.js.map +1 -1
  195. package/dist/frontmatter-contract.d.ts +14 -0
  196. package/dist/frontmatter-contract.d.ts.map +1 -1
  197. package/dist/frontmatter-contract.js +22 -0
  198. package/dist/frontmatter-contract.js.map +1 -1
  199. package/dist/frontmatter-splitter.d.ts +6 -0
  200. package/dist/frontmatter-splitter.d.ts.map +1 -1
  201. package/dist/frontmatter-splitter.js +8 -0
  202. package/dist/frontmatter-splitter.js.map +1 -1
  203. package/dist/frontmatter.d.ts +17 -7
  204. package/dist/frontmatter.d.ts.map +1 -1
  205. package/dist/frontmatter.js +52 -11
  206. package/dist/frontmatter.js.map +1 -1
  207. package/dist/governed-body-write.d.ts.map +1 -1
  208. package/dist/governed-body-write.js +13 -6
  209. package/dist/governed-body-write.js.map +1 -1
  210. package/dist/heads-digest.d.ts.map +1 -1
  211. package/dist/heads-digest.js +2 -1
  212. package/dist/heads-digest.js.map +1 -1
  213. package/dist/hosted-client/binding.d.ts +7 -0
  214. package/dist/hosted-client/binding.d.ts.map +1 -0
  215. package/dist/hosted-client/binding.js +10 -0
  216. package/dist/hosted-client/binding.js.map +1 -0
  217. package/dist/hosted-client/blob-delivery.d.ts +68 -0
  218. package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
  219. package/dist/hosted-client/blob-delivery.js +170 -0
  220. package/dist/hosted-client/blob-delivery.js.map +1 -0
  221. package/dist/hosted-client/blob-write.d.ts +387 -0
  222. package/dist/hosted-client/blob-write.d.ts.map +1 -0
  223. package/dist/hosted-client/blob-write.js +770 -0
  224. package/dist/hosted-client/blob-write.js.map +1 -0
  225. package/dist/hosted-client/bundle-listing.d.ts +46 -0
  226. package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
  227. package/dist/hosted-client/bundle-listing.js +36 -0
  228. package/dist/hosted-client/bundle-listing.js.map +1 -0
  229. package/dist/hosted-client/client.d.ts +249 -0
  230. package/dist/hosted-client/client.d.ts.map +1 -0
  231. package/dist/hosted-client/client.js +381 -0
  232. package/dist/hosted-client/client.js.map +1 -0
  233. package/dist/hosted-client/directory.d.ts +46 -0
  234. package/dist/hosted-client/directory.d.ts.map +1 -0
  235. package/dist/hosted-client/directory.js +74 -0
  236. package/dist/hosted-client/directory.js.map +1 -0
  237. package/dist/hosted-client/errors.d.ts +26 -0
  238. package/dist/hosted-client/errors.d.ts.map +1 -0
  239. package/dist/hosted-client/errors.js +35 -0
  240. package/dist/hosted-client/errors.js.map +1 -0
  241. package/dist/hosted-client/inbox.d.ts +320 -0
  242. package/dist/hosted-client/inbox.d.ts.map +1 -0
  243. package/dist/hosted-client/inbox.js +379 -0
  244. package/dist/hosted-client/inbox.js.map +1 -0
  245. package/dist/hosted-client/index.d.ts +31 -0
  246. package/dist/hosted-client/index.d.ts.map +1 -0
  247. package/dist/hosted-client/index.js +33 -0
  248. package/dist/hosted-client/index.js.map +1 -0
  249. package/dist/hosted-client/journal.d.ts +103 -0
  250. package/dist/hosted-client/journal.d.ts.map +1 -0
  251. package/dist/hosted-client/journal.js +464 -0
  252. package/dist/hosted-client/journal.js.map +1 -0
  253. package/dist/hosted-client/node.d.ts +74 -0
  254. package/dist/hosted-client/node.d.ts.map +1 -0
  255. package/dist/hosted-client/node.js +219 -0
  256. package/dist/hosted-client/node.js.map +1 -0
  257. package/dist/hosted-client/reference.d.ts +12 -0
  258. package/dist/hosted-client/reference.d.ts.map +1 -0
  259. package/dist/hosted-client/reference.js +29 -0
  260. package/dist/hosted-client/reference.js.map +1 -0
  261. package/dist/hosted-client/view-content.d.ts +184 -0
  262. package/dist/hosted-client/view-content.d.ts.map +1 -0
  263. package/dist/hosted-client/view-content.js +268 -0
  264. package/dist/hosted-client/view-content.js.map +1 -0
  265. package/dist/hosted-client/write.d.ts +219 -0
  266. package/dist/hosted-client/write.d.ts.map +1 -0
  267. package/dist/hosted-client/write.js +419 -0
  268. package/dist/hosted-client/write.js.map +1 -0
  269. package/dist/hosted-transport/answer-rows.d.ts +132 -4
  270. package/dist/hosted-transport/answer-rows.d.ts.map +1 -1
  271. package/dist/hosted-transport/answer-rows.js +211 -11
  272. package/dist/hosted-transport/answer-rows.js.map +1 -1
  273. package/dist/hosted-transport/attribution.d.ts +32 -0
  274. package/dist/hosted-transport/attribution.d.ts.map +1 -0
  275. package/dist/hosted-transport/attribution.js +38 -0
  276. package/dist/hosted-transport/attribution.js.map +1 -0
  277. package/dist/hosted-transport/blob-reads.d.ts +35 -0
  278. package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
  279. package/dist/hosted-transport/blob-reads.js +179 -0
  280. package/dist/hosted-transport/blob-reads.js.map +1 -0
  281. package/dist/hosted-transport/blob-write.d.ts +34 -0
  282. package/dist/hosted-transport/blob-write.d.ts.map +1 -0
  283. package/dist/hosted-transport/blob-write.js +115 -0
  284. package/dist/hosted-transport/blob-write.js.map +1 -0
  285. package/dist/hosted-transport/carrier.d.ts +35 -11
  286. package/dist/hosted-transport/carrier.d.ts.map +1 -1
  287. package/dist/hosted-transport/carrier.js +101 -57
  288. package/dist/hosted-transport/carrier.js.map +1 -1
  289. package/dist/hosted-transport/document-backend.d.ts +74 -0
  290. package/dist/hosted-transport/document-backend.d.ts.map +1 -0
  291. package/dist/hosted-transport/document-backend.js +160 -0
  292. package/dist/hosted-transport/document-backend.js.map +1 -0
  293. package/dist/hosted-transport/index.d.ts +7 -4
  294. package/dist/hosted-transport/index.d.ts.map +1 -1
  295. package/dist/hosted-transport/index.js +7 -4
  296. package/dist/hosted-transport/index.js.map +1 -1
  297. package/dist/hosted-transport/operations.d.ts +6 -0
  298. package/dist/hosted-transport/operations.d.ts.map +1 -1
  299. package/dist/hosted-transport/operations.js +2 -1
  300. package/dist/hosted-transport/operations.js.map +1 -1
  301. package/dist/hosted-transport/port-run.d.ts +41 -0
  302. package/dist/hosted-transport/port-run.d.ts.map +1 -0
  303. package/dist/hosted-transport/port-run.js +92 -0
  304. package/dist/hosted-transport/port-run.js.map +1 -0
  305. package/dist/hosted-transport/read-adapter.d.ts +19 -3
  306. package/dist/hosted-transport/read-adapter.d.ts.map +1 -1
  307. package/dist/hosted-transport/read-adapter.js +18 -5
  308. package/dist/hosted-transport/read-adapter.js.map +1 -1
  309. package/dist/hosted-transport/root-write.d.ts.map +1 -1
  310. package/dist/hosted-transport/root-write.js +5 -2
  311. package/dist/hosted-transport/root-write.js.map +1 -1
  312. package/dist/hosted-transport/whole-document-transport.d.ts +56 -7
  313. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -1
  314. package/dist/hosted-transport/whole-document-transport.js +120 -31
  315. package/dist/hosted-transport/whole-document-transport.js.map +1 -1
  316. package/dist/identity-fold.d.ts +16 -0
  317. package/dist/identity-fold.d.ts.map +1 -0
  318. package/dist/identity-fold.js +24 -0
  319. package/dist/identity-fold.js.map +1 -0
  320. package/dist/index-projection.d.ts +2 -1
  321. package/dist/index-projection.d.ts.map +1 -1
  322. package/dist/index-projection.js +38 -28
  323. package/dist/index-projection.js.map +1 -1
  324. package/dist/index.d.ts +59 -16
  325. package/dist/index.d.ts.map +1 -1
  326. package/dist/index.js +49 -20
  327. package/dist/index.js.map +1 -1
  328. package/dist/indexeddb-backend.d.ts +0 -31
  329. package/dist/indexeddb-backend.d.ts.map +1 -1
  330. package/dist/indexeddb-backend.js +5 -2
  331. package/dist/indexeddb-backend.js.map +1 -1
  332. package/dist/inventory-guard.d.ts +58 -0
  333. package/dist/inventory-guard.d.ts.map +1 -0
  334. package/dist/inventory-guard.js +169 -0
  335. package/dist/inventory-guard.js.map +1 -0
  336. package/dist/journaled-backend.d.ts +14 -4
  337. package/dist/journaled-backend.d.ts.map +1 -1
  338. package/dist/journaled-backend.js +19 -78
  339. package/dist/journaled-backend.js.map +1 -1
  340. package/dist/json-data.d.ts +3 -0
  341. package/dist/json-data.d.ts.map +1 -0
  342. package/dist/json-data.js +19 -0
  343. package/dist/json-data.js.map +1 -0
  344. package/dist/kind-authoring.d.ts +188 -0
  345. package/dist/kind-authoring.d.ts.map +1 -0
  346. package/dist/kind-authoring.js +520 -0
  347. package/dist/kind-authoring.js.map +1 -0
  348. package/dist/kind-changes.d.ts +45 -0
  349. package/dist/kind-changes.d.ts.map +1 -0
  350. package/dist/kind-changes.js +96 -0
  351. package/dist/kind-changes.js.map +1 -0
  352. package/dist/kind-conformance-error.d.ts +16 -0
  353. package/dist/kind-conformance-error.d.ts.map +1 -0
  354. package/dist/kind-conformance-error.js +20 -0
  355. package/dist/kind-conformance-error.js.map +1 -0
  356. package/dist/kind-coverage.d.ts +100 -0
  357. package/dist/kind-coverage.d.ts.map +1 -0
  358. package/dist/kind-coverage.js +185 -0
  359. package/dist/kind-coverage.js.map +1 -0
  360. package/dist/kind-deprecation.d.ts +32 -0
  361. package/dist/kind-deprecation.d.ts.map +1 -0
  362. package/dist/kind-deprecation.js +141 -0
  363. package/dist/kind-deprecation.js.map +1 -0
  364. package/dist/kind-field-mutation.d.ts +7 -2
  365. package/dist/kind-field-mutation.d.ts.map +1 -1
  366. package/dist/kind-field-mutation.js +28 -3
  367. package/dist/kind-field-mutation.js.map +1 -1
  368. package/dist/kind-undeclared-fields.d.ts +72 -0
  369. package/dist/kind-undeclared-fields.d.ts.map +1 -0
  370. package/dist/kind-undeclared-fields.js +124 -0
  371. package/dist/kind-undeclared-fields.js.map +1 -0
  372. package/dist/kinds-load.d.ts.map +1 -1
  373. package/dist/kinds-load.js +8 -5
  374. package/dist/kinds-load.js.map +1 -1
  375. package/dist/kinds.d.ts +105 -13
  376. package/dist/kinds.d.ts.map +1 -1
  377. package/dist/kinds.js +369 -30
  378. package/dist/kinds.js.map +1 -1
  379. package/dist/link-add.d.ts +81 -0
  380. package/dist/link-add.d.ts.map +1 -0
  381. package/dist/link-add.js +94 -0
  382. package/dist/link-add.js.map +1 -0
  383. package/dist/link-emit.d.ts +29 -0
  384. package/dist/link-emit.d.ts.map +1 -0
  385. package/dist/link-emit.js +39 -0
  386. package/dist/link-emit.js.map +1 -0
  387. package/dist/link-findings.d.ts +132 -0
  388. package/dist/link-findings.d.ts.map +1 -0
  389. package/dist/link-findings.js +263 -0
  390. package/dist/link-findings.js.map +1 -0
  391. package/dist/link-types.d.ts +34 -0
  392. package/dist/link-types.d.ts.map +1 -0
  393. package/dist/link-types.js +79 -0
  394. package/dist/link-types.js.map +1 -0
  395. package/dist/links.d.ts +68 -9
  396. package/dist/links.d.ts.map +1 -1
  397. package/dist/links.js +370 -57
  398. package/dist/links.js.map +1 -1
  399. package/dist/local-search-index.d.ts +86 -0
  400. package/dist/local-search-index.d.ts.map +1 -0
  401. package/dist/local-search-index.js +1055 -0
  402. package/dist/local-search-index.js.map +1 -0
  403. package/dist/managed-document-metadata.d.ts +5 -0
  404. package/dist/managed-document-metadata.d.ts.map +1 -0
  405. package/dist/managed-document-metadata.js +10 -0
  406. package/dist/managed-document-metadata.js.map +1 -0
  407. package/dist/markdown-syntax.d.ts +39 -0
  408. package/dist/markdown-syntax.d.ts.map +1 -0
  409. package/dist/markdown-syntax.js +10170 -0
  410. package/dist/markdown-syntax.js.map +1 -0
  411. package/dist/memory-backend.d.ts +3 -0
  412. package/dist/memory-backend.d.ts.map +1 -1
  413. package/dist/memory-backend.js +40 -2
  414. package/dist/memory-backend.js.map +1 -1
  415. package/dist/mutation-attribution.d.ts +2 -1
  416. package/dist/mutation-attribution.d.ts.map +1 -1
  417. package/dist/mutation-attribution.js.map +1 -1
  418. package/dist/okf-actor.d.ts +14 -3
  419. package/dist/okf-actor.d.ts.map +1 -1
  420. package/dist/okf-actor.js +25 -4
  421. package/dist/okf-actor.js.map +1 -1
  422. package/dist/okf-authored-values.d.ts +2 -0
  423. package/dist/okf-authored-values.d.ts.map +1 -1
  424. package/dist/okf-authored-values.js +4 -0
  425. package/dist/okf-authored-values.js.map +1 -1
  426. package/dist/okf-authoring.d.ts +7 -0
  427. package/dist/okf-authoring.d.ts.map +1 -0
  428. package/dist/okf-authoring.js +30 -0
  429. package/dist/okf-authoring.js.map +1 -0
  430. package/dist/okf-standard-fields.d.ts +4 -0
  431. package/dist/okf-standard-fields.d.ts.map +1 -1
  432. package/dist/okf-standard-fields.js +24 -14
  433. package/dist/okf-standard-fields.js.map +1 -1
  434. package/dist/okf-timestamps.d.ts +2 -2
  435. package/dist/okf-timestamps.d.ts.map +1 -1
  436. package/dist/okf-timestamps.js +25 -15
  437. package/dist/okf-timestamps.js.map +1 -1
  438. package/dist/page.d.ts +3 -7
  439. package/dist/page.d.ts.map +1 -1
  440. package/dist/page.js +3 -7
  441. package/dist/page.js.map +1 -1
  442. package/dist/path-fold.d.ts +67 -0
  443. package/dist/path-fold.d.ts.map +1 -0
  444. package/dist/path-fold.js +107 -0
  445. package/dist/path-fold.js.map +1 -0
  446. package/dist/paths.d.ts +46 -0
  447. package/dist/paths.d.ts.map +1 -1
  448. package/dist/paths.js +114 -1
  449. package/dist/paths.js.map +1 -1
  450. package/dist/platform.d.ts +13 -0
  451. package/dist/platform.d.ts.map +1 -1
  452. package/dist/platform.js +16 -0
  453. package/dist/platform.js.map +1 -1
  454. package/dist/portable-export-contract.d.ts +17 -0
  455. package/dist/portable-export-contract.d.ts.map +1 -0
  456. package/dist/portable-export-contract.js +59 -0
  457. package/dist/portable-export-contract.js.map +1 -0
  458. package/dist/portable-export.d.ts +115 -0
  459. package/dist/portable-export.d.ts.map +1 -0
  460. package/dist/portable-export.js +452 -0
  461. package/dist/portable-export.js.map +1 -0
  462. package/dist/portable-frontmatter.d.ts +17 -0
  463. package/dist/portable-frontmatter.d.ts.map +1 -1
  464. package/dist/portable-frontmatter.js +42 -5
  465. package/dist/portable-frontmatter.js.map +1 -1
  466. package/dist/publication-filesystem.d.ts +1 -1
  467. package/dist/publication-filesystem.d.ts.map +1 -1
  468. package/dist/publication-filesystem.js +1 -1
  469. package/dist/publication-filesystem.js.map +1 -1
  470. package/dist/qualified-links.d.ts +67 -0
  471. package/dist/qualified-links.d.ts.map +1 -0
  472. package/dist/qualified-links.js +121 -0
  473. package/dist/qualified-links.js.map +1 -0
  474. package/dist/query-filter.d.ts +11 -4
  475. package/dist/query-filter.d.ts.map +1 -1
  476. package/dist/query-filter.js +25 -6
  477. package/dist/query-filter.js.map +1 -1
  478. package/dist/query-order.d.ts.map +1 -1
  479. package/dist/query-order.js +2 -1
  480. package/dist/query-order.js.map +1 -1
  481. package/dist/recipe-lifecycle/errors.d.ts +96 -0
  482. package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
  483. package/dist/recipe-lifecycle/errors.js +122 -0
  484. package/dist/recipe-lifecycle/errors.js.map +1 -0
  485. package/dist/recipe-lifecycle/evolution.d.ts +134 -0
  486. package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
  487. package/dist/recipe-lifecycle/evolution.js +1047 -0
  488. package/dist/recipe-lifecycle/evolution.js.map +1 -0
  489. package/dist/recipe-lifecycle/index.d.ts +38 -0
  490. package/dist/recipe-lifecycle/index.d.ts.map +1 -0
  491. package/dist/recipe-lifecycle/index.js +31 -0
  492. package/dist/recipe-lifecycle/index.js.map +1 -0
  493. package/dist/recipe-lifecycle/install.d.ts +172 -0
  494. package/dist/recipe-lifecycle/install.d.ts.map +1 -0
  495. package/dist/recipe-lifecycle/install.js +652 -0
  496. package/dist/recipe-lifecycle/install.js.map +1 -0
  497. package/dist/recipe-lifecycle/legacy-aliases.d.ts +4 -0
  498. package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
  499. package/dist/recipe-lifecycle/legacy-aliases.js +22 -0
  500. package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
  501. package/dist/recipe-lifecycle/retirement-apply.d.ts +59 -0
  502. package/dist/recipe-lifecycle/retirement-apply.d.ts.map +1 -0
  503. package/dist/recipe-lifecycle/retirement-apply.js +165 -0
  504. package/dist/recipe-lifecycle/retirement-apply.js.map +1 -0
  505. package/dist/recipe-lifecycle/retirement.d.ts +89 -0
  506. package/dist/recipe-lifecycle/retirement.d.ts.map +1 -0
  507. package/dist/recipe-lifecycle/retirement.js +347 -0
  508. package/dist/recipe-lifecycle/retirement.js.map +1 -0
  509. package/dist/recipe-lifecycle/set-commit.d.ts +31 -0
  510. package/dist/recipe-lifecycle/set-commit.d.ts.map +1 -0
  511. package/dist/recipe-lifecycle/set-commit.js +37 -0
  512. package/dist/recipe-lifecycle/set-commit.js.map +1 -0
  513. package/dist/recipe-lifecycle/stamp.d.ts +146 -0
  514. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
  515. package/dist/recipe-lifecycle/stamp.js +361 -0
  516. package/dist/recipe-lifecycle/stamp.js.map +1 -0
  517. package/dist/recipe-qualify.d.ts +80 -0
  518. package/dist/recipe-qualify.d.ts.map +1 -0
  519. package/dist/recipe-qualify.js +352 -0
  520. package/dist/recipe-qualify.js.map +1 -0
  521. package/dist/recipe-set-preflight.d.ts +139 -0
  522. package/dist/recipe-set-preflight.d.ts.map +1 -0
  523. package/dist/recipe-set-preflight.js +536 -0
  524. package/dist/recipe-set-preflight.js.map +1 -0
  525. package/dist/recipe-sources.d.ts +209 -0
  526. package/dist/recipe-sources.d.ts.map +1 -0
  527. package/dist/recipe-sources.js +607 -0
  528. package/dist/recipe-sources.js.map +1 -0
  529. package/dist/recipes.d.ts +45 -1
  530. package/dist/recipes.d.ts.map +1 -1
  531. package/dist/recipes.js +138 -1
  532. package/dist/recipes.js.map +1 -1
  533. package/dist/record-overlay/apply.d.ts +45 -0
  534. package/dist/record-overlay/apply.d.ts.map +1 -0
  535. package/dist/record-overlay/apply.js +535 -0
  536. package/dist/record-overlay/apply.js.map +1 -0
  537. package/dist/record-overlay/canonical.d.ts +22 -0
  538. package/dist/record-overlay/canonical.d.ts.map +1 -0
  539. package/dist/record-overlay/canonical.js +47 -0
  540. package/dist/record-overlay/canonical.js.map +1 -0
  541. package/dist/record-overlay/digest.d.ts +4 -0
  542. package/dist/record-overlay/digest.d.ts.map +1 -0
  543. package/dist/record-overlay/digest.js +11 -0
  544. package/dist/record-overlay/digest.js.map +1 -0
  545. package/dist/record-overlay/errors.d.ts +44 -0
  546. package/dist/record-overlay/errors.d.ts.map +1 -0
  547. package/dist/record-overlay/errors.js +55 -0
  548. package/dist/record-overlay/errors.js.map +1 -0
  549. package/dist/record-overlay/findings.d.ts +5 -0
  550. package/dist/record-overlay/findings.d.ts.map +1 -0
  551. package/dist/record-overlay/findings.js +86 -0
  552. package/dist/record-overlay/findings.js.map +1 -0
  553. package/dist/record-overlay/index.d.ts +23 -0
  554. package/dist/record-overlay/index.d.ts.map +1 -0
  555. package/dist/record-overlay/index.js +21 -0
  556. package/dist/record-overlay/index.js.map +1 -0
  557. package/dist/record-overlay/plan.d.ts +12 -0
  558. package/dist/record-overlay/plan.d.ts.map +1 -0
  559. package/dist/record-overlay/plan.js +285 -0
  560. package/dist/record-overlay/plan.js.map +1 -0
  561. package/dist/record-overlay/policy.d.ts +77 -0
  562. package/dist/record-overlay/policy.d.ts.map +1 -0
  563. package/dist/record-overlay/policy.js +238 -0
  564. package/dist/record-overlay/policy.js.map +1 -0
  565. package/dist/record-overlay/redact.d.ts +3 -0
  566. package/dist/record-overlay/redact.d.ts.map +1 -0
  567. package/dist/record-overlay/redact.js +27 -0
  568. package/dist/record-overlay/redact.js.map +1 -0
  569. package/dist/record-overlay/signal-kind.d.ts +30 -0
  570. package/dist/record-overlay/signal-kind.d.ts.map +1 -0
  571. package/dist/record-overlay/signal-kind.js +38 -0
  572. package/dist/record-overlay/signal-kind.js.map +1 -0
  573. package/dist/record-overlay/signal-text.d.ts +52 -0
  574. package/dist/record-overlay/signal-text.d.ts.map +1 -0
  575. package/dist/record-overlay/signal-text.js +126 -0
  576. package/dist/record-overlay/signal-text.js.map +1 -0
  577. package/dist/record-overlay/source-index.d.ts +21 -0
  578. package/dist/record-overlay/source-index.d.ts.map +1 -0
  579. package/dist/record-overlay/source-index.js +109 -0
  580. package/dist/record-overlay/source-index.js.map +1 -0
  581. package/dist/record-overlay/types.d.ts +293 -0
  582. package/dist/record-overlay/types.d.ts.map +1 -0
  583. package/dist/record-overlay/types.js +2 -0
  584. package/dist/record-overlay/types.js.map +1 -0
  585. package/dist/relationships.d.ts +71 -0
  586. package/dist/relationships.d.ts.map +1 -0
  587. package/dist/relationships.js +87 -0
  588. package/dist/relationships.js.map +1 -0
  589. package/dist/remote-backend.d.ts +11 -21
  590. package/dist/remote-backend.d.ts.map +1 -1
  591. package/dist/remote-backend.js +20 -15
  592. package/dist/remote-backend.js.map +1 -1
  593. package/dist/remote-document-codec.d.ts +2 -1
  594. package/dist/remote-document-codec.d.ts.map +1 -1
  595. package/dist/remote-document-codec.js +3 -2
  596. package/dist/remote-document-codec.js.map +1 -1
  597. package/dist/remote-operations.d.ts +0 -41
  598. package/dist/remote-operations.d.ts.map +1 -1
  599. package/dist/remote-operations.js +14 -2
  600. package/dist/remote-operations.js.map +1 -1
  601. package/dist/remote-parsers.d.ts +19 -0
  602. package/dist/remote-parsers.d.ts.map +1 -1
  603. package/dist/remote-parsers.js.map +1 -1
  604. package/dist/remote.d.ts +2 -4
  605. package/dist/remote.d.ts.map +1 -1
  606. package/dist/remote.js +2 -3
  607. package/dist/remote.js.map +1 -1
  608. package/dist/reserved-write.d.ts +9 -0
  609. package/dist/reserved-write.d.ts.map +1 -0
  610. package/dist/reserved-write.js +15 -0
  611. package/dist/reserved-write.js.map +1 -0
  612. package/dist/search/backend-source.d.ts +6 -0
  613. package/dist/search/backend-source.d.ts.map +1 -0
  614. package/dist/search/backend-source.js +57 -0
  615. package/dist/search/backend-source.js.map +1 -0
  616. package/dist/search/contract.d.ts +162 -0
  617. package/dist/search/contract.d.ts.map +1 -0
  618. package/dist/search/contract.js +82 -0
  619. package/dist/search/contract.js.map +1 -0
  620. package/dist/search/errors.d.ts +30 -0
  621. package/dist/search/errors.d.ts.map +1 -0
  622. package/dist/search/errors.js +50 -0
  623. package/dist/search/errors.js.map +1 -0
  624. package/dist/search/identity.d.ts +12 -0
  625. package/dist/search/identity.d.ts.map +1 -0
  626. package/dist/search/identity.js +90 -0
  627. package/dist/search/identity.js.map +1 -0
  628. package/dist/search/index.d.ts +16 -0
  629. package/dist/search/index.d.ts.map +1 -0
  630. package/dist/search/index.js +15 -0
  631. package/dist/search/index.js.map +1 -0
  632. package/dist/search/memory-source.d.ts +36 -0
  633. package/dist/search/memory-source.d.ts.map +1 -0
  634. package/dist/search/memory-source.js +238 -0
  635. package/dist/search/memory-source.js.map +1 -0
  636. package/dist/search/rank.d.ts +29 -0
  637. package/dist/search/rank.d.ts.map +1 -0
  638. package/dist/search/rank.js +132 -0
  639. package/dist/search/rank.js.map +1 -0
  640. package/dist/search/row-text.d.ts +38 -0
  641. package/dist/search/row-text.d.ts.map +1 -0
  642. package/dist/search/row-text.js +88 -0
  643. package/dist/search/row-text.js.map +1 -0
  644. package/dist/search/search.d.ts +28 -0
  645. package/dist/search/search.d.ts.map +1 -0
  646. package/dist/search/search.js +265 -0
  647. package/dist/search/search.js.map +1 -0
  648. package/dist/search/source.d.ts +70 -0
  649. package/dist/search/source.d.ts.map +1 -0
  650. package/dist/search/source.js +2 -0
  651. package/dist/search/source.js.map +1 -0
  652. package/dist/search/text.d.ts +49 -0
  653. package/dist/search/text.d.ts.map +1 -0
  654. package/dist/search/text.js +165 -0
  655. package/dist/search/text.js.map +1 -0
  656. package/dist/search-index.d.ts +9 -0
  657. package/dist/search-index.d.ts.map +1 -0
  658. package/dist/search-index.js +9 -0
  659. package/dist/search-index.js.map +1 -0
  660. package/dist/sha256.d.ts.map +1 -1
  661. package/dist/sha256.js +3 -2
  662. package/dist/sha256.js.map +1 -1
  663. package/dist/site-capabilities.d.ts +345 -0
  664. package/dist/site-capabilities.d.ts.map +1 -0
  665. package/dist/site-capabilities.js +724 -0
  666. package/dist/site-capabilities.js.map +1 -0
  667. package/dist/site-manifest.d.ts +51 -0
  668. package/dist/site-manifest.d.ts.map +1 -0
  669. package/dist/site-manifest.js +115 -0
  670. package/dist/site-manifest.js.map +1 -0
  671. package/dist/skip-reasons.d.ts +12 -0
  672. package/dist/skip-reasons.d.ts.map +1 -0
  673. package/dist/skip-reasons.js +15 -0
  674. package/dist/skip-reasons.js.map +1 -0
  675. package/dist/source-engine/driver.d.ts +40 -0
  676. package/dist/source-engine/driver.d.ts.map +1 -0
  677. package/dist/source-engine/driver.js +513 -0
  678. package/dist/source-engine/driver.js.map +1 -0
  679. package/dist/source-engine/evidence.d.ts +39 -0
  680. package/dist/source-engine/evidence.d.ts.map +1 -0
  681. package/dist/source-engine/evidence.js +54 -0
  682. package/dist/source-engine/evidence.js.map +1 -0
  683. package/dist/source-engine/guard.d.ts +87 -0
  684. package/dist/source-engine/guard.d.ts.map +1 -0
  685. package/dist/source-engine/guard.js +427 -0
  686. package/dist/source-engine/guard.js.map +1 -0
  687. package/dist/source-engine/index.d.ts +35 -0
  688. package/dist/source-engine/index.d.ts.map +1 -0
  689. package/dist/source-engine/index.js +27 -0
  690. package/dist/source-engine/index.js.map +1 -0
  691. package/dist/source-engine/machine-state.d.ts +87 -0
  692. package/dist/source-engine/machine-state.d.ts.map +1 -0
  693. package/dist/source-engine/machine-state.js +94 -0
  694. package/dist/source-engine/machine-state.js.map +1 -0
  695. package/dist/source-engine/observe.d.ts +10 -0
  696. package/dist/source-engine/observe.d.ts.map +1 -0
  697. package/dist/source-engine/observe.js +276 -0
  698. package/dist/source-engine/observe.js.map +1 -0
  699. package/dist/source-engine/overlay.d.ts +50 -0
  700. package/dist/source-engine/overlay.d.ts.map +1 -0
  701. package/dist/source-engine/overlay.js +114 -0
  702. package/dist/source-engine/overlay.js.map +1 -0
  703. package/dist/source-engine/robots.d.ts +53 -0
  704. package/dist/source-engine/robots.d.ts.map +1 -0
  705. package/dist/source-engine/robots.js +158 -0
  706. package/dist/source-engine/robots.js.map +1 -0
  707. package/dist/source-engine/snapshot.d.ts +105 -0
  708. package/dist/source-engine/snapshot.d.ts.map +1 -0
  709. package/dist/source-engine/snapshot.js +240 -0
  710. package/dist/source-engine/snapshot.js.map +1 -0
  711. package/dist/source-engine/target-consumer.d.ts +12 -0
  712. package/dist/source-engine/target-consumer.d.ts.map +1 -0
  713. package/dist/source-engine/target-consumer.js +15 -0
  714. package/dist/source-engine/target-consumer.js.map +1 -0
  715. package/dist/source-engine/target-descriptor.d.ts +3 -0
  716. package/dist/source-engine/target-descriptor.d.ts.map +1 -0
  717. package/dist/source-engine/target-descriptor.js +26 -0
  718. package/dist/source-engine/target-descriptor.js.map +1 -0
  719. package/dist/source-engine/target.d.ts +82 -0
  720. package/dist/source-engine/target.d.ts.map +1 -0
  721. package/dist/source-engine/target.js +213 -0
  722. package/dist/source-engine/target.js.map +1 -0
  723. package/dist/source-engine/types.d.ts +296 -0
  724. package/dist/source-engine/types.d.ts.map +1 -0
  725. package/dist/source-engine/types.js +2 -0
  726. package/dist/source-engine/types.js.map +1 -0
  727. package/dist/source-harness/conformance.d.ts +16 -0
  728. package/dist/source-harness/conformance.d.ts.map +1 -0
  729. package/dist/source-harness/conformance.js +266 -0
  730. package/dist/source-harness/conformance.js.map +1 -0
  731. package/dist/source-harness/fixture.d.ts +97 -0
  732. package/dist/source-harness/fixture.d.ts.map +1 -0
  733. package/dist/source-harness/fixture.js +276 -0
  734. package/dist/source-harness/fixture.js.map +1 -0
  735. package/dist/source-harness/index.d.ts +22 -0
  736. package/dist/source-harness/index.d.ts.map +1 -0
  737. package/dist/source-harness/index.js +19 -0
  738. package/dist/source-harness/index.js.map +1 -0
  739. package/dist/source-harness/peer.d.ts +74 -0
  740. package/dist/source-harness/peer.d.ts.map +1 -0
  741. package/dist/source-harness/peer.js +106 -0
  742. package/dist/source-harness/peer.js.map +1 -0
  743. package/dist/source-profiles/index.d.ts +31 -0
  744. package/dist/source-profiles/index.d.ts.map +1 -0
  745. package/dist/source-profiles/index.js +206 -0
  746. package/dist/source-profiles/index.js.map +1 -0
  747. package/dist/source-profiles/link-header.d.ts +6 -0
  748. package/dist/source-profiles/link-header.d.ts.map +1 -0
  749. package/dist/source-profiles/link-header.js +131 -0
  750. package/dist/source-profiles/link-header.js.map +1 -0
  751. package/dist/storage-harness/contract.d.ts +109 -0
  752. package/dist/storage-harness/contract.d.ts.map +1 -0
  753. package/dist/storage-harness/contract.js +853 -0
  754. package/dist/storage-harness/contract.js.map +1 -0
  755. package/dist/storage-harness/index.d.ts +39 -0
  756. package/dist/storage-harness/index.d.ts.map +1 -0
  757. package/dist/storage-harness/index.js +55 -0
  758. package/dist/storage-harness/index.js.map +1 -0
  759. package/dist/storage.d.ts +10 -2
  760. package/dist/storage.d.ts.map +1 -1
  761. package/dist/storage.js +10 -2
  762. package/dist/storage.js.map +1 -1
  763. package/dist/string-identity-agreement.d.ts +35 -0
  764. package/dist/string-identity-agreement.d.ts.map +1 -0
  765. package/dist/string-identity-agreement.js +78 -0
  766. package/dist/string-identity-agreement.js.map +1 -0
  767. package/dist/system-documents.d.ts +82 -0
  768. package/dist/system-documents.d.ts.map +1 -0
  769. package/dist/system-documents.js +127 -0
  770. package/dist/system-documents.js.map +1 -0
  771. package/dist/types.d.ts +28 -4
  772. package/dist/types.d.ts.map +1 -1
  773. package/dist/types.js +0 -10
  774. package/dist/types.js.map +1 -1
  775. package/dist/uncertain-write.d.ts +119 -6
  776. package/dist/uncertain-write.d.ts.map +1 -1
  777. package/dist/uncertain-write.js +67 -32
  778. package/dist/uncertain-write.js.map +1 -1
  779. package/dist/validation.d.ts +5 -0
  780. package/dist/validation.d.ts.map +1 -1
  781. package/dist/verification.d.ts +22 -10
  782. package/dist/verification.d.ts.map +1 -1
  783. package/dist/verification.js +87 -39
  784. package/dist/verification.js.map +1 -1
  785. package/dist/view-launch-contract.d.ts +14 -0
  786. package/dist/view-launch-contract.d.ts.map +1 -0
  787. package/dist/view-launch-contract.js +23 -0
  788. package/dist/view-launch-contract.js.map +1 -0
  789. package/dist/write-identity.d.ts +5 -0
  790. package/dist/write-identity.d.ts.map +1 -0
  791. package/dist/write-identity.js +9 -0
  792. package/dist/write-identity.js.map +1 -0
  793. package/package.json +184 -10
@@ -0,0 +1,419 @@
1
+ // The one-call document write: one whole document to a hosted bundle, create-only or against an
2
+ // expected version, settled through the shared uncertain-write primitive over the whole-document
3
+ // transport. The client owns only what an app without a checkout lacks: a binding (minted once
4
+ // per client), an intent store the lookup rebuilds its request from, and the result's shape.
5
+ import { okfVersionOfRootIndex } from "../engine.js";
6
+ import { createHostedReadAdapter, createPortRunner, createWholeDocumentTransport, } from "../hosted-transport/index.js";
7
+ import { mintRequestId, performUncertainWrite, } from "../uncertain-write.js";
8
+ import { isContentVersion } from "../version-transport.js";
9
+ import { versionOfBytes } from "../versioning.js";
10
+ /** An in-memory {@link HostedIntentStore}: records live as long as the store. */
11
+ export function createMemoryIntentStore() {
12
+ const records = new Map();
13
+ return {
14
+ put(intent) {
15
+ records.set(intent.requestId, Object.freeze({ ...intent }));
16
+ },
17
+ get(requestId) {
18
+ return records.get(requestId);
19
+ },
20
+ delete(requestId) {
21
+ records.delete(requestId);
22
+ },
23
+ async *list() {
24
+ yield* [...records.values()];
25
+ },
26
+ };
27
+ }
28
+ /** The code of {@link HostedIntentsNotListable}. */
29
+ export const INTENTS_NOT_LISTABLE = "INTENTS_NOT_LISTABLE";
30
+ /** `heldWrites` was asked of a client whose intent store has no `list`. */
31
+ export class HostedIntentsNotListable extends Error {
32
+ code = INTENTS_NOT_LISTABLE;
33
+ constructor() {
34
+ super("this client's intent store cannot list its writes (it has no list method)");
35
+ this.name = "HostedIntentsNotListable";
36
+ }
37
+ }
38
+ /** The identity an app's request names: a lowercase UUID v4, the only form the host admits. */
39
+ const REQUEST_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
40
+ /** The default time a bundle's capabilities answer serves writes: 60 s. */
41
+ export const DEFAULT_CAPABILITIES_TTL_MS = 60_000;
42
+ export function createCapabilitiesCache(ttlMs = DEFAULT_CAPABILITIES_TTL_MS, now = Date.now) {
43
+ if (typeof ttlMs !== "number" || !Number.isFinite(ttlMs) || ttlMs < 0)
44
+ throw new TypeError("capabilitiesTtlMs is a finite number of milliseconds, 0 or more");
45
+ return { ttlMs, now, entries: new Map() };
46
+ }
47
+ /**
48
+ * The write side of a bundle named in `workspace`: the held one while its answer is in flight or
49
+ * fresh, so concurrent writes share one read, else (or when `fresh`) a new reader and read, which
50
+ * replaces the held one. A read that fails is never held. Each new read also removes every
51
+ * expired entry, so a long-lived client holds only bundles written within the TTL.
52
+ */
53
+ export function writeSide(context, workspace, bundleId, fresh = false) {
54
+ const cache = context.capabilities;
55
+ const key = JSON.stringify([workspace, bundleId]);
56
+ const live = (side) => side.answeredAt === undefined || cache.now() - side.answeredAt < cache.ttlMs;
57
+ const held = cache.entries.get(key);
58
+ if (held && !fresh && live(held))
59
+ return held;
60
+ for (const [other, side] of cache.entries)
61
+ if (!live(side))
62
+ cache.entries.delete(other);
63
+ const carrier = context.carrierFor(workspace);
64
+ const reader = createHostedReadAdapter({ carrier, bundleId, routes: context.readRoutes, runner: createPortRunner({ carrier, prefix: context.prefix, decisions: context.runDecisions }) });
65
+ const answer = reader.hostedCapabilities().then(async (capabilities) => {
66
+ // The edition from this same answer's root; the editions core parses, any other reads as
67
+ // none, as the CLI's checkout reads it. On 0.3 the transport sends the expected-edition header.
68
+ const edition = capabilities.root ? okfVersionOfRootIndex(capabilities.root.content) : undefined;
69
+ return { capabilities, okfVersion: edition === "0.1" || edition === "0.2" || edition === "0.3" ? edition : null };
70
+ });
71
+ const side = { reader, answer, answeredAt: undefined };
72
+ if (cache.ttlMs === 0)
73
+ return side;
74
+ cache.entries.set(key, side);
75
+ answer.then(() => {
76
+ side.answeredAt = cache.now();
77
+ }, () => {
78
+ if (cache.entries.get(key) === side)
79
+ cache.entries.delete(key);
80
+ });
81
+ return side;
82
+ }
83
+ /**
84
+ * Refusals after which a bundle's held capabilities may be what went wrong, so the next write
85
+ * reads them again: no writes served (`read_only`); input the host or the client's parse under
86
+ * the held edition refused (`invalid_input`, `validation_failed`); and the bundle gone or access
87
+ * withdrawn, which the write answer reports as `PERMISSION_DENIED` (`bundle_not_found`,
88
+ * `insufficient_scope`, `access_denied`).
89
+ */
90
+ const DROPPING_REFUSALS = new Set(["read_only", "invalid_input", "validation_failed", "bundle_not_found", "PERMISSION_DENIED"]);
91
+ /** Forget `side` as the bundle's held write side, so the next write reads its capabilities again. */
92
+ export function dropWriteSide(context, workspace, bundleId, side) {
93
+ const key = JSON.stringify([workspace, bundleId]);
94
+ if (context.capabilities.entries.get(key) === side)
95
+ context.capabilities.entries.delete(key);
96
+ }
97
+ /** Drop a write side after a result that may say its capabilities are stale: such a refusal, or any `unknown`. */
98
+ function settleWriteSide(context, workspace, bundleId, side, result) {
99
+ if (result.status === "unknown" || (result.status === "refused" && DROPPING_REFUSALS.has(result.code)))
100
+ dropWriteSide(context, workspace, bundleId, side);
101
+ return result;
102
+ }
103
+ /**
104
+ * The reader a transport needs. The retention window decides whether an `absent` lookup lets an
105
+ * intent be resent, so it always comes from a capabilities read made now, never a held answer: a
106
+ * window the host has since shortened must not resend an identity it may already have expired.
107
+ * That read refreshes the held entry. It runs only after an `absent` lookup; a failure leaves the
108
+ * outcome unknown.
109
+ */
110
+ function writeRemote(context, intent, reader) {
111
+ return {
112
+ read: (id) => reader.read(id),
113
+ operationsRetentionMs: async () => (await writeSide(context, intent.workspace, intent.bundleId, true).answer).capabilities.operationsRetentionMs,
114
+ };
115
+ }
116
+ /**
117
+ * Run `task` after every earlier task of this client under the same request identity, so two
118
+ * calls naming one identity never check and record it at the same time.
119
+ */
120
+ async function serialized(context, requestId, task) {
121
+ const previous = context.inFlight.get(requestId) ?? Promise.resolve();
122
+ const run = previous.then(task, task);
123
+ const settled = run.then(() => undefined, () => undefined);
124
+ context.inFlight.set(requestId, settled);
125
+ try {
126
+ return await run;
127
+ }
128
+ finally {
129
+ if (context.inFlight.get(requestId) === settled)
130
+ context.inFlight.delete(requestId);
131
+ }
132
+ }
133
+ function writeRoutes(prefix) {
134
+ return { create: `${prefix}/create`, replace: `${prefix}/replace`, delete: `${prefix}/delete`, outcome: `${prefix}/outcome` };
135
+ }
136
+ function operationIntent(intent) {
137
+ return {
138
+ requestId: intent.requestId,
139
+ kind: intent.operation === "create" ? "document.create" : "document.replace",
140
+ target: intent.documentId,
141
+ base: intent.expectedVersion,
142
+ local: intent.digest,
143
+ content: intent.document,
144
+ createdAt: intent.createdAt,
145
+ attempts: intent.attempts,
146
+ state: intent.state,
147
+ };
148
+ }
149
+ /** True when two intents are the same write: everything but its delivery progress and record time. */
150
+ function sameWrite(a, b) {
151
+ return (a.requestId === b.requestId &&
152
+ a.bundleId === b.bundleId &&
153
+ a.workspace === b.workspace &&
154
+ a.operation === b.operation &&
155
+ a.documentId === b.documentId &&
156
+ a.digest === b.digest &&
157
+ a.document === b.document &&
158
+ a.expectedVersion === b.expectedVersion);
159
+ }
160
+ /** True when two writes differ only in the workspace their bundle was named in. */
161
+ function onlyWorkspaceDiffers(a, b) {
162
+ return a.workspace !== b.workspace && sameWrite({ ...a, workspace: b.workspace }, b);
163
+ }
164
+ function resultOf(intent, outcome) {
165
+ const base = { requestId: intent.requestId, documentId: intent.documentId };
166
+ switch (outcome.kind) {
167
+ case "committed":
168
+ return { ...base, status: "committed", version: outcome.version };
169
+ case "conflict":
170
+ return { ...base, status: "conflict", reason: "version_conflict", currentVersion: outcome.actual, ...(outcome.tombstone !== undefined ? { tombstone: outcome.tombstone } : {}) };
171
+ case "refused":
172
+ // Settled, so final: the client never resends it, under this identity or a new one.
173
+ if (outcome.code === "concurrent_change")
174
+ return { ...base, status: "conflict", reason: "concurrent_change", message: outcome.message };
175
+ return { ...base, status: "refused", code: outcome.code, message: outcome.message };
176
+ case "unknown":
177
+ return { ...base, status: "unknown", ...(outcome.refusal ? { refusal: { code: outcome.refusal.code, message: outcome.refusal.message } } : {}) };
178
+ }
179
+ }
180
+ /**
181
+ * `work`, or the abort's reason as soon as `signal` aborts, whichever comes first. For a read made
182
+ * before anything is sent (the capabilities answer), so a hung credential provider never holds a
183
+ * caller past its own abort; the read itself goes on for any other caller sharing it.
184
+ */
185
+ export function untilAborted(work, signal) {
186
+ if (signal.aborted)
187
+ return Promise.reject(signal.reason);
188
+ return new Promise((resolve, reject) => {
189
+ const abort = () => reject(signal.reason);
190
+ signal.addEventListener("abort", abort, { once: true });
191
+ work.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
192
+ });
193
+ }
194
+ /** The signal a write's requests run under: the client's, and the caller's when given. */
195
+ export function writeSignal(context, signal) {
196
+ return signal ? AbortSignal.any([context.signal, signal]) : context.signal;
197
+ }
198
+ function transportFor(context, intent, reader, capabilities, signal) {
199
+ const { store } = context;
200
+ return createWholeDocumentTransport({
201
+ carrier: context.carrierFor(intent.workspace),
202
+ bundleId: intent.bundleId,
203
+ binding: intent.binding,
204
+ intentFor: async (requestId) => {
205
+ const stored = await store.get(requestId);
206
+ return stored ? operationIntent(stored) : undefined;
207
+ },
208
+ remote: writeRemote(context, intent, reader),
209
+ routes: writeRoutes(context.prefix),
210
+ ...(intent.okfVersion !== null ? { okfVersion: intent.okfVersion } : {}),
211
+ documentInputBytes: capabilities.documentInputBytes,
212
+ signal,
213
+ });
214
+ }
215
+ /**
216
+ * Record what an outcome leaves: a settled write leaves the store, an unknown one stays with its
217
+ * attempt count. Only the record of this same write is touched, never another write's under the
218
+ * identity. A store failure here never hides the outcome from the caller.
219
+ */
220
+ async function recordOutcome(context, intent, outcome, attempts) {
221
+ try {
222
+ const stored = await context.store.get(intent.requestId);
223
+ if (!stored || !sameWrite(stored, intent))
224
+ return;
225
+ if (outcome.kind === "unknown") {
226
+ if (attempts !== stored.attempts || stored.state !== "unknown")
227
+ await context.store.put({ ...stored, attempts, state: "unknown" });
228
+ }
229
+ else
230
+ await context.store.delete(intent.requestId);
231
+ }
232
+ catch {
233
+ // The record before the submission stands; the answer is the caller's either way.
234
+ }
235
+ }
236
+ /**
237
+ * Deliver a recorded intent and settle it: the submission (unless one already left) and, after
238
+ * an unclear answer, the lookup under the same identity and binding, as `performUncertainWrite`
239
+ * decides. The record's attempt count is stored before each submission leaves; when that fails
240
+ * before the first submission, nothing is sent and the store's error is thrown.
241
+ */
242
+ async function deliver(context, intent, reader, capabilities, callerSignal) {
243
+ // Stopping on a store failure ends the primitive's lookups at once, without the delay between them.
244
+ const halt = new AbortController();
245
+ const signal = AbortSignal.any([callerSignal, halt.signal]);
246
+ const transport = transportFor(context, intent, reader, capabilities, signal);
247
+ // The intent store failed before a first submission could be recorded: nothing was sent.
248
+ let storeFailure;
249
+ const recording = {
250
+ async submit(sending, options) {
251
+ try {
252
+ await context.store.put({ ...intent, attempts: sending.attempts, state: "in_flight" });
253
+ }
254
+ catch (error) {
255
+ // A first submission that cannot be recorded is not sent; a later one is not sent either,
256
+ // and the earlier submission's outcome stays unknown.
257
+ if (sending.attempts === 1)
258
+ storeFailure = { cause: error };
259
+ halt.abort();
260
+ throw error;
261
+ }
262
+ return transport.submit(sending, options);
263
+ },
264
+ lookup: (requestId) => transport.lookup(requestId),
265
+ };
266
+ const { outcome, intent: settled } = await performUncertainWrite(recording, operationIntent(intent), {
267
+ settlement: transport.settlement,
268
+ signal,
269
+ // Every held record with a submission is one whose answer was never definitive.
270
+ earlierDeliveryUnclear: intent.attempts > 0,
271
+ ...(context.lookupDelayMs !== undefined ? { lookupDelayMs: context.lookupDelayMs } : {}),
272
+ });
273
+ if (storeFailure)
274
+ throw storeFailure.cause;
275
+ // A refusal after the caller aborted is the abort's (the carrier sends nothing once it has),
276
+ // never the host's verdict: the identity stays unknown and its record is kept, with no reason.
277
+ const answer = callerSignal.aborted && (outcome.kind === "refused" || outcome.kind === "unknown") ? { kind: "unknown" } : outcome;
278
+ await recordOutcome(context, intent, answer, settled.attempts);
279
+ return resultOf(intent, answer);
280
+ }
281
+ /** `HostedClient.write`. */
282
+ export async function hostedWrite(context, bundleId, input, options = {}) {
283
+ if (typeof bundleId !== "string" || bundleId === "")
284
+ throw new TypeError("a write names its bundle");
285
+ if (typeof input !== "object" || input === null)
286
+ throw new TypeError("a write takes { id, document } with expectedVersion or expectAbsent");
287
+ const { id, document } = input;
288
+ if (typeof id !== "string" || id === "")
289
+ throw new TypeError("a write names its document id");
290
+ if (typeof document !== "string")
291
+ throw new TypeError("a write's document is the whole serialized document");
292
+ const creates = input.expectAbsent === true;
293
+ if (creates === (input.expectedVersion !== undefined))
294
+ throw new TypeError("a write takes exactly one of expectedVersion and expectAbsent: true");
295
+ if (!creates && !isContentVersion(input.expectedVersion))
296
+ throw new TypeError("expectedVersion is not a version");
297
+ if (options.requestId !== undefined && !REQUEST_ID.test(options.requestId))
298
+ throw new TypeError("a request identity is a lowercase UUID v4");
299
+ const requested = {
300
+ requestId: options.requestId ?? mintRequestId(),
301
+ bundleId,
302
+ workspace: context.workspace,
303
+ operation: creates ? "create" : "replace",
304
+ documentId: id,
305
+ document,
306
+ digest: versionOfBytes(document),
307
+ expectedVersion: creates ? null : input.expectedVersion,
308
+ };
309
+ return serialized(context, requested.requestId, async () => {
310
+ const signal = writeSignal(context, options.signal);
311
+ signal.throwIfAborted();
312
+ const known = options.requestId !== undefined ? await context.store.get(requested.requestId) : undefined;
313
+ if (known && !sameWrite(known, requested)) {
314
+ const message = onlyWorkspaceDiffers(known, requested)
315
+ ? `This request identity names the same write in ${known.workspace === null ? "no workspace" : `workspace '${known.workspace}'`}; confirm it from that client. Nothing was sent.`
316
+ : "This request identity already names a different write; nothing was sent.";
317
+ return { requestId: requested.requestId, documentId: id, status: "refused", code: "invalid_input", message };
318
+ }
319
+ // Nothing has left yet: a failure to read the bundle's capabilities is the caller's typed
320
+ // error. Everything this write uses from capabilities comes from this one answer.
321
+ const side = writeSide(context, requested.workspace, bundleId);
322
+ const { capabilities, okfVersion } = await side.answer;
323
+ const settle = (result) => settleWriteSide(context, requested.workspace, bundleId, side, result);
324
+ if (known)
325
+ return settle(await deliver(context, known, side.reader, capabilities, signal));
326
+ if (!capabilities.operations) {
327
+ return settle({ requestId: requested.requestId, documentId: id, status: "refused", code: "read_only", message: "The host serves no identified writes for this bundle; nothing was sent." });
328
+ }
329
+ const intent = {
330
+ ...requested,
331
+ binding: context.binding,
332
+ okfVersion,
333
+ createdAt: new Date().toISOString(),
334
+ attempts: 0,
335
+ state: "pending",
336
+ };
337
+ await context.store.put(intent);
338
+ return settle(await deliver(context, intent, side.reader, capabilities, signal));
339
+ });
340
+ }
341
+ /** The held intent and its bundle's write side and capabilities, or what a lookup answers without them. */
342
+ async function heldIntent(context, requestId) {
343
+ const intent = typeof requestId === "string" ? await context.store.get(requestId) : undefined;
344
+ if (!intent)
345
+ return { status: "unrecorded", requestId };
346
+ const side = writeSide(context, intent.workspace, intent.bundleId);
347
+ try {
348
+ return { intent, side, reader: side.reader, capabilities: (await side.answer).capabilities };
349
+ }
350
+ catch {
351
+ // The write may have left: an unreadable bundle is no evidence either way.
352
+ return { requestId: intent.requestId, documentId: intent.documentId, status: "unknown" };
353
+ }
354
+ }
355
+ /** One outcome lookup of a held write, never a send; a host holding no outcome yet is `unknown`. */
356
+ async function lookupOnly(context, intent, reader, capabilities, signal) {
357
+ const transport = transportFor(context, intent, reader, capabilities, signal);
358
+ let outcome;
359
+ try {
360
+ const recorded = await transport.lookup(intent.requestId);
361
+ outcome = recorded === null || recorded.kind === "pending" ? { kind: "unknown" } : recorded;
362
+ }
363
+ catch {
364
+ outcome = { kind: "unknown" };
365
+ }
366
+ await recordOutcome(context, intent, outcome, intent.attempts);
367
+ return resultOf(intent, outcome);
368
+ }
369
+ /**
370
+ * `HostedClient.lookupWrite`: what the host recorded for a held write, by one outcome lookup under
371
+ * the identity and binding it was sent with. It never sends the write: a host that holds no
372
+ * outcome yet (absent or pending), or a lookup that fails, is `unknown`.
373
+ */
374
+ export async function hostedLookupWrite(context, requestId, options = {}) {
375
+ const signal = writeSignal(context, options.signal);
376
+ signal.throwIfAborted();
377
+ return serialized(context, requestId, async () => {
378
+ // Aborted while an earlier call under this identity ran: this one sends nothing.
379
+ signal.throwIfAborted();
380
+ const held = await heldIntent(context, requestId);
381
+ if (!("intent" in held))
382
+ return held;
383
+ return settleWriteSide(context, held.intent.workspace, held.intent.bundleId, held.side, await lookupOnly(context, held.intent, held.reader, held.capabilities, signal));
384
+ });
385
+ }
386
+ /**
387
+ * `HostedClient.settleWrite`: settle a held write. It looks the identity up under the binding it
388
+ * was sent with; when the host never recorded it (within the retention window it serves), it
389
+ * delivers that same identity once more, as the write itself would have. An unclear lookup is
390
+ * `unknown` again. A bundle the host serves no writes for is only looked up.
391
+ */
392
+ export async function hostedSettleWrite(context, requestId, options = {}) {
393
+ const signal = writeSignal(context, options.signal);
394
+ signal.throwIfAborted();
395
+ return serialized(context, requestId, async () => {
396
+ // Aborted while an earlier call under this identity ran: this one sends nothing.
397
+ signal.throwIfAborted();
398
+ const held = await heldIntent(context, requestId);
399
+ if (!("intent" in held))
400
+ return held;
401
+ const settle = (result) => settleWriteSide(context, held.intent.workspace, held.intent.bundleId, held.side, result);
402
+ if (!held.capabilities.operations)
403
+ return settle(await lookupOnly(context, held.intent, held.reader, held.capabilities, signal));
404
+ // A recorded intent may never have left (a store written before a crash): delivery starts
405
+ // with a submission then, under the recorded identity, exactly as the write would have.
406
+ return settle(await deliver(context, held.intent, held.reader, held.capabilities, signal));
407
+ });
408
+ }
409
+ /** `HostedClient.heldWrites`: every write the intent store holds. */
410
+ export async function hostedHeldWrites(context) {
411
+ const { store } = context;
412
+ if (typeof store.list !== "function")
413
+ throw new HostedIntentsNotListable();
414
+ const held = [];
415
+ for await (const intent of store.list())
416
+ held.push(intent);
417
+ return held;
418
+ }
419
+ //# sourceMappingURL=write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/hosted-client/write.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,iGAAiG;AACjG,+FAA+F;AAC/F,6FAA6F;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,GAO7B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,aAAa,EACb,qBAAqB,GAKtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA8DlD,iFAAiF;AACjF,MAAM,UAAU,uBAAuB;IACrC,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;IACrD,OAAO;QACL,GAAG,CAAC,MAAM;YACR,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,GAAG,CAAC,SAAS;YACX,OAAO,OAAO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C,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;QACjI,0FAA0F;QAC1F,wFAAwF;QACxF,OAAO,MAAM,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAA2B;IAChE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;QAAE,MAAM,IAAI,wBAAwB,EAAE,CAAC;IAC3E,MAAM,IAAI,GAAwB,EAAE,CAAC;IACrC,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -15,6 +15,7 @@
15
15
  * primitive's authorization set and pause the store: `AUTH_REQUIRED` (the carrier denied the
16
16
  * request) and `PERMISSION_DENIED` (the host refused the caller's access to the bundle).
17
17
  */
18
+ import { type BlobWriteExpected, type BlobWriteSuccess, type BlobWriteFailure, type BlobWriteResult } from "../blob-contract.js";
18
19
  import type { Version } from "../types.js";
19
20
  import type { HostedAnswer } from "./carrier.js";
20
21
  /** A refusal code the shared primitive treats as lost authorization, pausing the store. */
@@ -59,7 +60,8 @@ export type UpdateAnswerRow = Readonly<{
59
60
  export declare const UPDATE_ANSWER_ROWS: readonly UpdateAnswerRow[];
60
61
  /**
61
62
  * One outcome-lookup answer and what the shared primitive receives: `null` says the host never
62
- * recorded the identity (or holds a claim without a result), an outcome is the recorded evidence,
63
+ * recorded the identity, `pending` that it holds a claim without a result (a delivery was
64
+ * admitted and may still commit), an outcome is the recorded evidence,
63
65
  * and `throws` leaves the intent recoverable because the evidence was unavailable. `absent` past
64
66
  * the host's retention window, less the skew margin, is `unknown` rather than `null`: an expired
65
67
  * identity looks absent, and absence must never let an old intent be resubmitted as if never
@@ -67,7 +69,7 @@ export declare const UPDATE_ANSWER_ROWS: readonly UpdateAnswerRow[];
67
69
  */
68
70
  export type OutcomeAnswerRow = Readonly<{
69
71
  answer: string;
70
- result: "null" | "committed" | "recorded" | "unknown" | "throws";
72
+ result: "null" | "pending" | "committed" | "recorded" | "unknown" | "throws";
71
73
  }>;
72
74
  export declare const OUTCOME_ANSWER_ROWS: readonly OutcomeAnswerRow[];
73
75
  /**
@@ -90,6 +92,49 @@ export declare const WRITE_ERROR_CODES: readonly ["field_action_refused", "inval
90
92
  export type WriteErrorCode = (typeof WRITE_ERROR_CODES)[number];
91
93
  /** The whole-document delete: its success names the tombstone as `version`, and the version that left. */
92
94
  export declare const DELETE_OPERATION_ID = "documents.delete.v1";
95
+ /**
96
+ * What a saved write registered as links, from the host's own parse of the stored document:
97
+ * `count` links in all, pointing at `targets` (distinct document ids, a bounded list), and
98
+ * `truncated` when the host left targets out.
99
+ */
100
+ export type WriteLinks = {
101
+ readonly count: number;
102
+ readonly targets: readonly string[];
103
+ readonly truncated?: boolean;
104
+ };
105
+ /** A finding the host reports on a saved write that did not block it: its code, never its text. */
106
+ export type WriteWarning = {
107
+ readonly code: string;
108
+ readonly severity: "error" | "warning";
109
+ readonly field?: string;
110
+ };
111
+ /** The Kind's description of an enum value the write set. */
112
+ export type WriteGuidance = {
113
+ readonly field: string;
114
+ readonly value: string;
115
+ readonly description: string;
116
+ };
117
+ /** What a refused input got wrong: the input path (keys and positions) and a fixed message. */
118
+ export type WriteInputIssue = {
119
+ readonly path: string;
120
+ readonly message: string;
121
+ };
122
+ /** One finding of a refusal's `diagnostics`: a stable code; the rest as the host sent it. */
123
+ export type WriteDiagnosticItem = {
124
+ readonly code: string;
125
+ readonly severity?: string;
126
+ readonly message?: string;
127
+ readonly location?: unknown;
128
+ readonly kindId?: string;
129
+ readonly [detail: string]: unknown;
130
+ };
131
+ /** A refusal's findings (`validation_failed`), carried as the host sent them. */
132
+ export type WriteDiagnostics = {
133
+ readonly version: number;
134
+ readonly items: readonly WriteDiagnosticItem[];
135
+ readonly truncated?: boolean;
136
+ readonly [detail: string]: unknown;
137
+ };
93
138
  export type WriteSuccess = {
94
139
  ok: true;
95
140
  operationId: string;
@@ -97,16 +142,26 @@ export type WriteSuccess = {
97
142
  * `version` is what committed: the document's new version, or for a delete the tombstone
98
143
  * version. A delete's data alone also carries `deletedVersion` (the version that left, which
99
144
  * is the request's `expectedVersion`) and `deleted: true`; `changed: false` there says the
100
- * document had already left at exactly that base, and `version` names that deletion.
145
+ * document had already left at exactly that base, and `version` names that deletion. A delete
146
+ * success with `changed: false` may instead carry neither `version` nor `deletedVersion`: the
147
+ * document was already gone and the host names no removal.
148
+ *
149
+ * `links`, `warnings` and `guidance` are the host's report on a saved write, when it sends one
150
+ * (hosted's write report). They are informational: present only when well formed, and never
151
+ * part of whether the write is admitted.
101
152
  */
102
153
  data: {
103
154
  bundleId: string;
104
155
  documentId: string;
105
- version: Version;
156
+ /** Absent only on a delete of a document already gone that names no removal. */
157
+ version?: Version;
106
158
  changed: boolean;
107
159
  scope?: unknown;
108
160
  deletedVersion?: Version;
109
161
  deleted?: true;
162
+ links?: WriteLinks;
163
+ warnings?: readonly WriteWarning[];
164
+ guidance?: readonly WriteGuidance[];
110
165
  };
111
166
  };
112
167
  export type WriteFailure = {
@@ -131,6 +186,14 @@ export type WriteFailure = {
131
186
  * field the host adds later never makes the recorded refusal unreadable.
132
187
  */
133
188
  definitionDetails?: unknown;
189
+ /** On `validation_failed`: the findings, carried as sent when they read as a finding set. */
190
+ diagnostics?: WriteDiagnostics;
191
+ /** On `invalid_input`: what the input got wrong, when the host names it. */
192
+ inputIssues?: readonly WriteInputIssue[];
193
+ /** Other detail blocks the host may send (`fieldActionDetails`, `candidate`, ...), carried but not read here. */
194
+ fieldActionDetails?: unknown;
195
+ candidate?: unknown;
196
+ retentionUnavailable?: unknown;
134
197
  };
135
198
  };
136
199
  export type WriteResult = WriteSuccess | WriteFailure;
@@ -145,6 +208,38 @@ export declare const DEFINITION_FINDINGS_TEXT_BYTES = 2048;
145
208
  * neither does this.
146
209
  */
147
210
  export declare function definitionFindingsText(details: unknown): string;
211
+ /**
212
+ * What the host reported with one write's answer, made safe to show: the saved write's report
213
+ * (`links`, `warnings`, `guidance`) or a refusal's findings (`diagnostics` items, `inputIssues`).
214
+ * Every string is host text through {@link stripHostText}, and every list is bounded, so a
215
+ * client can print it or keep it as data without trusting the host's bytes.
216
+ */
217
+ export type HostedWriteFindings = {
218
+ readonly links?: WriteLinks;
219
+ readonly warnings?: readonly WriteWarning[];
220
+ readonly guidance?: readonly WriteGuidance[];
221
+ readonly diagnostics?: readonly {
222
+ readonly code: string;
223
+ readonly severity?: string;
224
+ readonly message?: string;
225
+ readonly kindId?: string;
226
+ readonly field?: string;
227
+ }[];
228
+ readonly inputIssues?: readonly WriteInputIssue[];
229
+ };
230
+ /** At most this many entries of each list are kept in {@link HostedWriteFindings}. */
231
+ export declare const HOSTED_FINDINGS_SHOWN = 16;
232
+ /**
233
+ * The findings a write's answer carried ({@link HostedWriteFindings}), from a success's `data`
234
+ * or a refusal's `error`; undefined when it carried none (an older host sends none).
235
+ */
236
+ export declare function hostedWriteFindings(result: WriteResult): HostedWriteFindings | undefined;
237
+ /**
238
+ * A refusal's findings as one clause a person reads, appended to the refusal message: each
239
+ * diagnostic's code, field and message, then each input issue's path and message, within
240
+ * {@link DEFINITION_FINDINGS_TEXT_BYTES}. Empty when there are none.
241
+ */
242
+ export declare function refusalFindingsText(findings: HostedWriteFindings | undefined): string;
148
243
  export declare class HostedAnswerError extends Error {
149
244
  readonly name = "HostedAnswerError";
150
245
  }
@@ -153,6 +248,14 @@ export declare class HostedAnswerError extends Error {
153
248
  * the document it names, and a success with a content version or a refusal with a known code
154
249
  * and write state. A refusal's detail blocks (diagnostics, corrective details) are carried but
155
250
  * not interpreted here. `write_outcome_unknown` must say its write state is unknown.
251
+ *
252
+ * A tolerant reader: a key this client does not know, at the top level, in the receipt or in
253
+ * the refusal, is ignored and not carried, so a host can add fields without breaking a client
254
+ * that predates them. Every field the client reads is still checked, and a known field in the
255
+ * wrong place (a delete's `deletedVersion` on another write, `data` beside `error`, a capacity
256
+ * `scope` on another refusal) still refuses the envelope. The saved-write report (`links`,
257
+ * `warnings`, `guidance`) and a refusal's `diagnostics` and `inputIssues` are informational:
258
+ * kept when well formed, left out when not, and never part of whether a write is admitted.
156
259
  */
157
260
  export declare function parseWriteResult(raw: unknown, expected: {
158
261
  operationIds: readonly string[];
@@ -213,4 +316,29 @@ export declare function decodeOutcomeAnswer(value: unknown, expected: {
213
316
  documentId: string;
214
317
  operationIds: readonly string[];
215
318
  }): OutcomeAnswer;
319
+ export { BLOB_OPERATION_IDS } from "../blob-contract.js";
320
+ export type { BlobOperationId, BlobWriteExpected, BlobWriteSuccess, BlobWriteErrorCode, BlobWriteFailure, BlobWriteResult } from "../blob-contract.js";
321
+ export type BlobOutcomeAnswer = {
322
+ status: "absent";
323
+ } | {
324
+ status: "committed";
325
+ result: BlobWriteSuccess;
326
+ } | {
327
+ status: "refused";
328
+ result: BlobWriteFailure;
329
+ };
330
+ /** Preserve the hosted answer error facade around the neutral result grammar. */
331
+ export declare function parseBlobWriteResult(raw: unknown, expected: BlobWriteExpected): BlobWriteResult;
332
+ /** Blob operations share the document carrier rows, while retaining their separate result
333
+ * grammar. Malformed 200 answers stay unknown, never settling a possible delivery. */
334
+ export declare function classifyBlobWriteAnswer(answer: HostedAnswer, expected: BlobWriteExpected): {
335
+ row: UpdateAnswerRow;
336
+ result?: BlobWriteResult;
337
+ };
338
+ /** Immutable blob evidence uses the common status/identity envelope without content bytes.
339
+ * A terminal result is checked against the original intent, never a later head observation. */
340
+ export declare function decodeBlobOutcomeAnswer(value: unknown, expected: BlobWriteExpected & {
341
+ requestId: string;
342
+ binding: string;
343
+ }): BlobOutcomeAnswer;
216
344
  //# sourceMappingURL=answer-rows.d.ts.map