@opendatalabs/personal-server-ts-core 1.37.0 → 1.38.1

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/contracts/host-contract.json +115 -0
  2. package/contracts/raw-end.json +2360 -0
  3. package/contracts/replace-conformance.json +729 -0
  4. package/contracts/routes.json +349 -0
  5. package/contracts/run-finish-plan.json +3238 -0
  6. package/contracts/run-saved.json +1308 -0
  7. package/contracts/scope-delete-receipt.json +616 -0
  8. package/dist/api/account-storage-mode.d.ts +77 -0
  9. package/dist/api/account-storage-mode.d.ts.map +1 -0
  10. package/dist/api/account-storage-mode.js +72 -0
  11. package/dist/api/account-storage-mode.js.map +1 -0
  12. package/dist/api/index.d.ts +139 -3
  13. package/dist/api/index.d.ts.map +1 -1
  14. package/dist/api/index.js +973 -191
  15. package/dist/api/index.js.map +1 -1
  16. package/dist/api/legacy-write-gate.d.ts +51 -0
  17. package/dist/api/legacy-write-gate.d.ts.map +1 -0
  18. package/dist/api/legacy-write-gate.js +88 -0
  19. package/dist/api/legacy-write-gate.js.map +1 -0
  20. package/dist/api/owner-connector-delete.d.ts +103 -0
  21. package/dist/api/owner-connector-delete.d.ts.map +1 -0
  22. package/dist/api/owner-connector-delete.js +158 -0
  23. package/dist/api/owner-connector-delete.js.map +1 -0
  24. package/dist/api/pdpp-record-query.d.ts +25 -0
  25. package/dist/api/pdpp-record-query.d.ts.map +1 -0
  26. package/dist/api/pdpp-record-query.js +72 -0
  27. package/dist/api/pdpp-record-query.js.map +1 -0
  28. package/dist/api/pdpp-records-list.d.ts +133 -0
  29. package/dist/api/pdpp-records-list.d.ts.map +1 -0
  30. package/dist/api/pdpp-records-list.js +380 -0
  31. package/dist/api/pdpp-records-list.js.map +1 -0
  32. package/dist/api/scope-delete-verdict.d.ts +107 -0
  33. package/dist/api/scope-delete-verdict.d.ts.map +1 -0
  34. package/dist/api/scope-delete-verdict.js +92 -0
  35. package/dist/api/scope-delete-verdict.js.map +1 -0
  36. package/dist/api/switched-delete-refusal.d.ts +16 -0
  37. package/dist/api/switched-delete-refusal.d.ts.map +1 -0
  38. package/dist/api/switched-delete-refusal.js +30 -0
  39. package/dist/api/switched-delete-refusal.js.map +1 -0
  40. package/dist/client.d.ts +29 -0
  41. package/dist/client.d.ts.map +1 -1
  42. package/dist/client.js +34 -2
  43. package/dist/client.js.map +1 -1
  44. package/dist/contracts/access-logs.d.ts +1 -0
  45. package/dist/contracts/access-logs.d.ts.map +1 -1
  46. package/dist/contracts/access-logs.js +7 -1
  47. package/dist/contracts/access-logs.js.map +1 -1
  48. package/dist/contracts/data.d.ts +12 -0
  49. package/dist/contracts/data.d.ts.map +1 -1
  50. package/dist/contracts/data.js +30 -1
  51. package/dist/contracts/data.js.map +1 -1
  52. package/dist/contracts/grants.d.ts.map +1 -1
  53. package/dist/contracts/grants.js +9 -0
  54. package/dist/contracts/grants.js.map +1 -1
  55. package/dist/contracts/index.d.ts +1 -1
  56. package/dist/contracts/index.d.ts.map +1 -1
  57. package/dist/contracts/index.js +1 -1
  58. package/dist/contracts/index.js.map +1 -1
  59. package/dist/contracts/sync.d.ts +9 -1
  60. package/dist/contracts/sync.d.ts.map +1 -1
  61. package/dist/contracts/sync.js +6 -2
  62. package/dist/contracts/sync.js.map +1 -1
  63. package/dist/derivatives/compute.d.ts.map +1 -1
  64. package/dist/derivatives/compute.js +19 -0
  65. package/dist/derivatives/compute.js.map +1 -1
  66. package/dist/encoding/base64url.d.ts +6 -0
  67. package/dist/encoding/base64url.d.ts.map +1 -0
  68. package/dist/encoding/base64url.js +29 -0
  69. package/dist/encoding/base64url.js.map +1 -0
  70. package/dist/errors/pdpp-catalog.d.ts +1 -1
  71. package/dist/errors/pdpp-catalog.d.ts.map +1 -1
  72. package/dist/errors/pdpp-catalog.js +6 -0
  73. package/dist/errors/pdpp-catalog.js.map +1 -1
  74. package/dist/keys/index.d.ts +1 -0
  75. package/dist/keys/index.d.ts.map +1 -1
  76. package/dist/keys/index.js +1 -0
  77. package/dist/keys/index.js.map +1 -1
  78. package/dist/keys/owner-master-key.d.ts +37 -0
  79. package/dist/keys/owner-master-key.d.ts.map +1 -0
  80. package/dist/keys/owner-master-key.js +45 -0
  81. package/dist/keys/owner-master-key.js.map +1 -0
  82. package/dist/legacy-projection/bindings.d.ts.map +1 -1
  83. package/dist/legacy-projection/bindings.js +10 -4
  84. package/dist/legacy-projection/bindings.js.map +1 -1
  85. package/dist/legacy-projection/erase-connector.d.ts +18 -0
  86. package/dist/legacy-projection/erase-connector.d.ts.map +1 -0
  87. package/dist/legacy-projection/erase-connector.js +29 -0
  88. package/dist/legacy-projection/erase-connector.js.map +1 -0
  89. package/dist/legacy-projection/index.d.ts +17 -0
  90. package/dist/legacy-projection/index.d.ts.map +1 -1
  91. package/dist/legacy-projection/index.js +41 -0
  92. package/dist/legacy-projection/index.js.map +1 -1
  93. package/dist/legacy-projection/types.d.ts +12 -2
  94. package/dist/legacy-projection/types.d.ts.map +1 -1
  95. package/dist/lineage/gateway.d.ts +3 -1
  96. package/dist/lineage/gateway.d.ts.map +1 -1
  97. package/dist/lineage/gateway.js +2 -1
  98. package/dist/lineage/gateway.js.map +1 -1
  99. package/dist/localdb/admit.d.ts +138 -0
  100. package/dist/localdb/admit.d.ts.map +1 -0
  101. package/dist/localdb/admit.js +344 -0
  102. package/dist/localdb/admit.js.map +1 -0
  103. package/dist/localdb/apply-meter.d.ts +14 -0
  104. package/dist/localdb/apply-meter.d.ts.map +1 -0
  105. package/dist/localdb/apply-meter.js +31 -0
  106. package/dist/localdb/apply-meter.js.map +1 -0
  107. package/dist/localdb/apply-progress.d.ts +10 -0
  108. package/dist/localdb/apply-progress.d.ts.map +1 -0
  109. package/dist/localdb/apply-progress.js +39 -0
  110. package/dist/localdb/apply-progress.js.map +1 -0
  111. package/dist/localdb/apply.d.ts +17 -0
  112. package/dist/localdb/apply.d.ts.map +1 -0
  113. package/dist/localdb/apply.js +291 -0
  114. package/dist/localdb/apply.js.map +1 -0
  115. package/dist/localdb/batch-commit.d.ts +70 -0
  116. package/dist/localdb/batch-commit.d.ts.map +1 -0
  117. package/dist/localdb/batch-commit.js +91 -0
  118. package/dist/localdb/batch-commit.js.map +1 -0
  119. package/dist/localdb/batch-contract.d.ts +19 -0
  120. package/dist/localdb/batch-contract.d.ts.map +1 -0
  121. package/dist/localdb/batch-contract.js +24 -0
  122. package/dist/localdb/batch-contract.js.map +1 -0
  123. package/dist/localdb/blobs.d.ts +71 -0
  124. package/dist/localdb/blobs.d.ts.map +1 -0
  125. package/dist/localdb/blobs.js +306 -0
  126. package/dist/localdb/blobs.js.map +1 -0
  127. package/dist/localdb/bootstrap-copy.d.ts +6 -0
  128. package/dist/localdb/bootstrap-copy.d.ts.map +1 -0
  129. package/dist/localdb/bootstrap-copy.js +79 -0
  130. package/dist/localdb/bootstrap-copy.js.map +1 -0
  131. package/dist/localdb/bootstrap-keys.d.ts +33 -0
  132. package/dist/localdb/bootstrap-keys.d.ts.map +1 -0
  133. package/dist/localdb/bootstrap-keys.js +89 -0
  134. package/dist/localdb/bootstrap-keys.js.map +1 -0
  135. package/dist/localdb/bootstrap-swap.d.ts +17 -0
  136. package/dist/localdb/bootstrap-swap.d.ts.map +1 -0
  137. package/dist/localdb/bootstrap-swap.js +78 -0
  138. package/dist/localdb/bootstrap-swap.js.map +1 -0
  139. package/dist/localdb/bootstrap.d.ts +55 -0
  140. package/dist/localdb/bootstrap.d.ts.map +1 -0
  141. package/dist/localdb/bootstrap.js +195 -0
  142. package/dist/localdb/bootstrap.js.map +1 -0
  143. package/dist/localdb/complete-read.d.ts +77 -0
  144. package/dist/localdb/complete-read.d.ts.map +1 -0
  145. package/dist/localdb/complete-read.js +136 -0
  146. package/dist/localdb/complete-read.js.map +1 -0
  147. package/dist/localdb/connection-link.d.ts +12 -0
  148. package/dist/localdb/connection-link.d.ts.map +1 -0
  149. package/dist/localdb/connection-link.js +79 -0
  150. package/dist/localdb/connection-link.js.map +1 -0
  151. package/dist/localdb/cursor.d.ts +61 -0
  152. package/dist/localdb/cursor.d.ts.map +1 -0
  153. package/dist/localdb/cursor.js +178 -0
  154. package/dist/localdb/cursor.js.map +1 -0
  155. package/dist/localdb/cycle.d.ts +69 -0
  156. package/dist/localdb/cycle.d.ts.map +1 -0
  157. package/dist/localdb/cycle.js +189 -0
  158. package/dist/localdb/cycle.js.map +1 -0
  159. package/dist/localdb/delete-batch.d.ts +29 -0
  160. package/dist/localdb/delete-batch.d.ts.map +1 -0
  161. package/dist/localdb/delete-batch.js +84 -0
  162. package/dist/localdb/delete-batch.js.map +1 -0
  163. package/dist/localdb/delete-lifetime.d.ts +24 -0
  164. package/dist/localdb/delete-lifetime.d.ts.map +1 -0
  165. package/dist/localdb/delete-lifetime.js +83 -0
  166. package/dist/localdb/delete-lifetime.js.map +1 -0
  167. package/dist/localdb/delete.d.ts +88 -0
  168. package/dist/localdb/delete.d.ts.map +1 -0
  169. package/dist/localdb/delete.js +521 -0
  170. package/dist/localdb/delete.js.map +1 -0
  171. package/dist/localdb/delta-apply.d.ts +4 -0
  172. package/dist/localdb/delta-apply.d.ts.map +1 -0
  173. package/dist/localdb/delta-apply.js +253 -0
  174. package/dist/localdb/delta-apply.js.map +1 -0
  175. package/dist/localdb/deps.d.ts +87 -0
  176. package/dist/localdb/deps.d.ts.map +1 -0
  177. package/dist/localdb/deps.js +10 -0
  178. package/dist/localdb/deps.js.map +1 -0
  179. package/dist/localdb/driver.d.ts +51 -0
  180. package/dist/localdb/driver.d.ts.map +1 -0
  181. package/dist/localdb/driver.js +3 -0
  182. package/dist/localdb/driver.js.map +1 -0
  183. package/dist/localdb/fence.d.ts +31 -0
  184. package/dist/localdb/fence.d.ts.map +1 -0
  185. package/dist/localdb/fence.js +69 -0
  186. package/dist/localdb/fence.js.map +1 -0
  187. package/dist/localdb/history.d.ts +76 -0
  188. package/dist/localdb/history.d.ts.map +1 -0
  189. package/dist/localdb/history.js +256 -0
  190. package/dist/localdb/history.js.map +1 -0
  191. package/dist/localdb/import-fingerprint.d.ts +8 -0
  192. package/dist/localdb/import-fingerprint.d.ts.map +1 -0
  193. package/dist/localdb/import-fingerprint.js +35 -0
  194. package/dist/localdb/import-fingerprint.js.map +1 -0
  195. package/dist/localdb/import-ledger.d.ts +27 -0
  196. package/dist/localdb/import-ledger.d.ts.map +1 -0
  197. package/dist/localdb/import-ledger.js +197 -0
  198. package/dist/localdb/import-ledger.js.map +1 -0
  199. package/dist/localdb/import-readback.d.ts +8 -0
  200. package/dist/localdb/import-readback.d.ts.map +1 -0
  201. package/dist/localdb/import-readback.js +69 -0
  202. package/dist/localdb/import-readback.js.map +1 -0
  203. package/dist/localdb/import-snapshot.d.ts +21 -0
  204. package/dist/localdb/import-snapshot.d.ts.map +1 -0
  205. package/dist/localdb/import-snapshot.js +94 -0
  206. package/dist/localdb/import-snapshot.js.map +1 -0
  207. package/dist/localdb/index.d.ts +42 -0
  208. package/dist/localdb/index.d.ts.map +1 -0
  209. package/dist/localdb/index.js +40 -0
  210. package/dist/localdb/index.js.map +1 -0
  211. package/dist/localdb/legacy-import-types.d.ts +112 -0
  212. package/dist/localdb/legacy-import-types.d.ts.map +1 -0
  213. package/dist/localdb/legacy-import-types.js +2 -0
  214. package/dist/localdb/legacy-import-types.js.map +1 -0
  215. package/dist/localdb/legacy-import.d.ts +67 -0
  216. package/dist/localdb/legacy-import.d.ts.map +1 -0
  217. package/dist/localdb/legacy-import.js +320 -0
  218. package/dist/localdb/legacy-import.js.map +1 -0
  219. package/dist/localdb/legacy-retire.d.ts +26 -0
  220. package/dist/localdb/legacy-retire.d.ts.map +1 -0
  221. package/dist/localdb/legacy-retire.js +93 -0
  222. package/dist/localdb/legacy-retire.js.map +1 -0
  223. package/dist/localdb/lifetime.d.ts +29 -0
  224. package/dist/localdb/lifetime.d.ts.map +1 -0
  225. package/dist/localdb/lifetime.js +64 -0
  226. package/dist/localdb/lifetime.js.map +1 -0
  227. package/dist/localdb/listing.d.ts +70 -0
  228. package/dist/localdb/listing.d.ts.map +1 -0
  229. package/dist/localdb/listing.js +345 -0
  230. package/dist/localdb/listing.js.map +1 -0
  231. package/dist/localdb/log-apply.d.ts +46 -0
  232. package/dist/localdb/log-apply.d.ts.map +1 -0
  233. package/dist/localdb/log-apply.js +827 -0
  234. package/dist/localdb/log-apply.js.map +1 -0
  235. package/dist/localdb/log-batch.d.ts +204 -0
  236. package/dist/localdb/log-batch.d.ts.map +1 -0
  237. package/dist/localdb/log-batch.js +418 -0
  238. package/dist/localdb/log-batch.js.map +1 -0
  239. package/dist/localdb/log-bodies.d.ts +27 -0
  240. package/dist/localdb/log-bodies.d.ts.map +1 -0
  241. package/dist/localdb/log-bodies.js +142 -0
  242. package/dist/localdb/log-bodies.js.map +1 -0
  243. package/dist/localdb/log-bootstrap-stage.d.ts +5 -0
  244. package/dist/localdb/log-bootstrap-stage.d.ts.map +1 -0
  245. package/dist/localdb/log-bootstrap-stage.js +60 -0
  246. package/dist/localdb/log-bootstrap-stage.js.map +1 -0
  247. package/dist/localdb/log-bootstrap.d.ts +23 -0
  248. package/dist/localdb/log-bootstrap.d.ts.map +1 -0
  249. package/dist/localdb/log-bootstrap.js +399 -0
  250. package/dist/localdb/log-bootstrap.js.map +1 -0
  251. package/dist/localdb/log-compact.d.ts +28 -0
  252. package/dist/localdb/log-compact.d.ts.map +1 -0
  253. package/dist/localdb/log-compact.js +83 -0
  254. package/dist/localdb/log-compact.js.map +1 -0
  255. package/dist/localdb/log-keyed.d.ts +118 -0
  256. package/dist/localdb/log-keyed.d.ts.map +1 -0
  257. package/dist/localdb/log-keyed.js +640 -0
  258. package/dist/localdb/log-keyed.js.map +1 -0
  259. package/dist/localdb/log-progressive.d.ts +18 -0
  260. package/dist/localdb/log-progressive.d.ts.map +1 -0
  261. package/dist/localdb/log-progressive.js +58 -0
  262. package/dist/localdb/log-progressive.js.map +1 -0
  263. package/dist/localdb/log-publish-phases.d.ts +31 -0
  264. package/dist/localdb/log-publish-phases.d.ts.map +1 -0
  265. package/dist/localdb/log-publish-phases.js +40 -0
  266. package/dist/localdb/log-publish-phases.js.map +1 -0
  267. package/dist/localdb/log-publish.d.ts +16 -0
  268. package/dist/localdb/log-publish.d.ts.map +1 -0
  269. package/dist/localdb/log-publish.js +1745 -0
  270. package/dist/localdb/log-publish.js.map +1 -0
  271. package/dist/localdb/log-rebase.d.ts +12 -0
  272. package/dist/localdb/log-rebase.d.ts.map +1 -0
  273. package/dist/localdb/log-rebase.js +74 -0
  274. package/dist/localdb/log-rebase.js.map +1 -0
  275. package/dist/localdb/log-recommit.d.ts +15 -0
  276. package/dist/localdb/log-recommit.d.ts.map +1 -0
  277. package/dist/localdb/log-recommit.js +88 -0
  278. package/dist/localdb/log-recommit.js.map +1 -0
  279. package/dist/localdb/log-seed.d.ts +25 -0
  280. package/dist/localdb/log-seed.d.ts.map +1 -0
  281. package/dist/localdb/log-seed.js +129 -0
  282. package/dist/localdb/log-seed.js.map +1 -0
  283. package/dist/localdb/log-state.d.ts +34 -0
  284. package/dist/localdb/log-state.d.ts.map +1 -0
  285. package/dist/localdb/log-state.js +79 -0
  286. package/dist/localdb/log-state.js.map +1 -0
  287. package/dist/localdb/merge.d.ts +122 -0
  288. package/dist/localdb/merge.d.ts.map +1 -0
  289. package/dist/localdb/merge.js +339 -0
  290. package/dist/localdb/merge.js.map +1 -0
  291. package/dist/localdb/migrate.d.ts +10 -0
  292. package/dist/localdb/migrate.d.ts.map +1 -0
  293. package/dist/localdb/migrate.js +27 -0
  294. package/dist/localdb/migrate.js.map +1 -0
  295. package/dist/localdb/name.d.ts +10 -0
  296. package/dist/localdb/name.d.ts.map +1 -0
  297. package/dist/localdb/name.js +15 -0
  298. package/dist/localdb/name.js.map +1 -0
  299. package/dist/localdb/open.d.ts +33 -0
  300. package/dist/localdb/open.d.ts.map +1 -0
  301. package/dist/localdb/open.js +46 -0
  302. package/dist/localdb/open.js.map +1 -0
  303. package/dist/localdb/part-layout.d.ts +6 -0
  304. package/dist/localdb/part-layout.d.ts.map +1 -0
  305. package/dist/localdb/part-layout.js +6 -0
  306. package/dist/localdb/part-layout.js.map +1 -0
  307. package/dist/localdb/part-readahead.d.ts +87 -0
  308. package/dist/localdb/part-readahead.d.ts.map +1 -0
  309. package/dist/localdb/part-readahead.js +130 -0
  310. package/dist/localdb/part-readahead.js.map +1 -0
  311. package/dist/localdb/partial-load.d.ts +42 -0
  312. package/dist/localdb/partial-load.d.ts.map +1 -0
  313. package/dist/localdb/partial-load.js +120 -0
  314. package/dist/localdb/partial-load.js.map +1 -0
  315. package/dist/localdb/partial-read.d.ts +64 -0
  316. package/dist/localdb/partial-read.d.ts.map +1 -0
  317. package/dist/localdb/partial-read.js +110 -0
  318. package/dist/localdb/partial-read.js.map +1 -0
  319. package/dist/localdb/plan-inputs.d.ts +31 -0
  320. package/dist/localdb/plan-inputs.d.ts.map +1 -0
  321. package/dist/localdb/plan-inputs.js +26 -0
  322. package/dist/localdb/plan-inputs.js.map +1 -0
  323. package/dist/localdb/publication-work.d.ts +20 -0
  324. package/dist/localdb/publication-work.d.ts.map +1 -0
  325. package/dist/localdb/publication-work.js +60 -0
  326. package/dist/localdb/publication-work.js.map +1 -0
  327. package/dist/localdb/publish-meter.d.ts +32 -0
  328. package/dist/localdb/publish-meter.d.ts.map +1 -0
  329. package/dist/localdb/publish-meter.js +36 -0
  330. package/dist/localdb/publish-meter.js.map +1 -0
  331. package/dist/localdb/publish.d.ts +153 -0
  332. package/dist/localdb/publish.d.ts.map +1 -0
  333. package/dist/localdb/publish.js +329 -0
  334. package/dist/localdb/publish.js.map +1 -0
  335. package/dist/localdb/purge.d.ts +40 -0
  336. package/dist/localdb/purge.d.ts.map +1 -0
  337. package/dist/localdb/purge.js +159 -0
  338. package/dist/localdb/purge.js.map +1 -0
  339. package/dist/localdb/query.d.ts +77 -0
  340. package/dist/localdb/query.d.ts.map +1 -0
  341. package/dist/localdb/query.js +330 -0
  342. package/dist/localdb/query.js.map +1 -0
  343. package/dist/localdb/queue.d.ts +10 -0
  344. package/dist/localdb/queue.d.ts.map +1 -0
  345. package/dist/localdb/queue.js +31 -0
  346. package/dist/localdb/queue.js.map +1 -0
  347. package/dist/localdb/raw-end-evidence.d.ts +16 -0
  348. package/dist/localdb/raw-end-evidence.d.ts.map +1 -0
  349. package/dist/localdb/raw-end-evidence.js +27 -0
  350. package/dist/localdb/raw-end-evidence.js.map +1 -0
  351. package/dist/localdb/read-selection.d.ts +182 -0
  352. package/dist/localdb/read-selection.d.ts.map +1 -0
  353. package/dist/localdb/read-selection.js +290 -0
  354. package/dist/localdb/read-selection.js.map +1 -0
  355. package/dist/localdb/registered-read.d.ts +15 -0
  356. package/dist/localdb/registered-read.d.ts.map +1 -0
  357. package/dist/localdb/registered-read.js +62 -0
  358. package/dist/localdb/registered-read.js.map +1 -0
  359. package/dist/localdb/replace.d.ts +33 -0
  360. package/dist/localdb/replace.d.ts.map +1 -0
  361. package/dist/localdb/replace.js +22 -0
  362. package/dist/localdb/replace.js.map +1 -0
  363. package/dist/localdb/requirements.d.ts +35 -0
  364. package/dist/localdb/requirements.d.ts.map +1 -0
  365. package/dist/localdb/requirements.js +66 -0
  366. package/dist/localdb/requirements.js.map +1 -0
  367. package/dist/localdb/resolve.d.ts +69 -0
  368. package/dist/localdb/resolve.d.ts.map +1 -0
  369. package/dist/localdb/resolve.js +436 -0
  370. package/dist/localdb/resolve.js.map +1 -0
  371. package/dist/localdb/run-end.d.ts +35 -0
  372. package/dist/localdb/run-end.d.ts.map +1 -0
  373. package/dist/localdb/run-end.js +520 -0
  374. package/dist/localdb/run-end.js.map +1 -0
  375. package/dist/localdb/run-intake.d.ts +17 -0
  376. package/dist/localdb/run-intake.d.ts.map +1 -0
  377. package/dist/localdb/run-intake.js +662 -0
  378. package/dist/localdb/run-intake.js.map +1 -0
  379. package/dist/localdb/run-receipts.d.ts +19 -0
  380. package/dist/localdb/run-receipts.d.ts.map +1 -0
  381. package/dist/localdb/run-receipts.js +151 -0
  382. package/dist/localdb/run-receipts.js.map +1 -0
  383. package/dist/localdb/schema.d.ts +7 -0
  384. package/dist/localdb/schema.d.ts.map +1 -0
  385. package/dist/localdb/schema.js +686 -0
  386. package/dist/localdb/schema.js.map +1 -0
  387. package/dist/localdb/seed.d.ts +39 -0
  388. package/dist/localdb/seed.d.ts.map +1 -0
  389. package/dist/localdb/seed.js +188 -0
  390. package/dist/localdb/seed.js.map +1 -0
  391. package/dist/localdb/slot.d.ts +9 -0
  392. package/dist/localdb/slot.d.ts.map +1 -0
  393. package/dist/localdb/slot.js +15 -0
  394. package/dist/localdb/slot.js.map +1 -0
  395. package/dist/localdb/stream-digest.d.ts +35 -0
  396. package/dist/localdb/stream-digest.d.ts.map +1 -0
  397. package/dist/localdb/stream-digest.js +50 -0
  398. package/dist/localdb/stream-digest.js.map +1 -0
  399. package/dist/localdb/sync.d.ts +75 -0
  400. package/dist/localdb/sync.d.ts.map +1 -0
  401. package/dist/localdb/sync.js +339 -0
  402. package/dist/localdb/sync.js.map +1 -0
  403. package/dist/localdb/system-stream-descriptor.d.ts +22 -0
  404. package/dist/localdb/system-stream-descriptor.d.ts.map +1 -0
  405. package/dist/localdb/system-stream-descriptor.js +24 -0
  406. package/dist/localdb/system-stream-descriptor.js.map +1 -0
  407. package/dist/localdb/system-stream-page.d.ts +15 -0
  408. package/dist/localdb/system-stream-page.d.ts.map +1 -0
  409. package/dist/localdb/system-stream-page.js +98 -0
  410. package/dist/localdb/system-stream-page.js.map +1 -0
  411. package/dist/localdb/system-streams.d.ts +35 -0
  412. package/dist/localdb/system-streams.d.ts.map +1 -0
  413. package/dist/localdb/system-streams.js +350 -0
  414. package/dist/localdb/system-streams.js.map +1 -0
  415. package/dist/localdb/transfer-memory.d.ts +17 -0
  416. package/dist/localdb/transfer-memory.d.ts.map +1 -0
  417. package/dist/localdb/transfer-memory.js +17 -0
  418. package/dist/localdb/transfer-memory.js.map +1 -0
  419. package/dist/localdb/unwrite.d.ts +28 -0
  420. package/dist/localdb/unwrite.d.ts.map +1 -0
  421. package/dist/localdb/unwrite.js +62 -0
  422. package/dist/localdb/unwrite.js.map +1 -0
  423. package/dist/localdb/update-required.d.ts +10 -0
  424. package/dist/localdb/update-required.d.ts.map +1 -0
  425. package/dist/localdb/update-required.js +27 -0
  426. package/dist/localdb/update-required.js.map +1 -0
  427. package/dist/localdb/view-changes.d.ts +58 -0
  428. package/dist/localdb/view-changes.d.ts.map +1 -0
  429. package/dist/localdb/view-changes.js +174 -0
  430. package/dist/localdb/view-changes.js.map +1 -0
  431. package/dist/logging/access-log.d.ts +2 -2
  432. package/dist/logging/access-log.d.ts.map +1 -1
  433. package/dist/logging/access-reader.d.ts +4 -1
  434. package/dist/logging/access-reader.d.ts.map +1 -1
  435. package/dist/logging/activity-stream.d.ts +37 -0
  436. package/dist/logging/activity-stream.d.ts.map +1 -0
  437. package/dist/logging/activity-stream.js +86 -0
  438. package/dist/logging/activity-stream.js.map +1 -0
  439. package/dist/mcp/approval-url.d.ts +32 -0
  440. package/dist/mcp/approval-url.d.ts.map +1 -1
  441. package/dist/mcp/approval-url.js +76 -0
  442. package/dist/mcp/approval-url.js.map +1 -1
  443. package/dist/mcp/connection-api.d.ts +54 -27
  444. package/dist/mcp/connection-api.d.ts.map +1 -1
  445. package/dist/mcp/connection-api.js +267 -77
  446. package/dist/mcp/connection-api.js.map +1 -1
  447. package/dist/mcp/grant-registration.d.ts +15 -0
  448. package/dist/mcp/grant-registration.d.ts.map +1 -0
  449. package/dist/mcp/grant-registration.js +44 -0
  450. package/dist/mcp/grant-registration.js.map +1 -0
  451. package/dist/mcp/index.d.ts +1 -0
  452. package/dist/mcp/index.d.ts.map +1 -1
  453. package/dist/mcp/index.js +1 -0
  454. package/dist/mcp/index.js.map +1 -1
  455. package/dist/mcp/read-client.d.ts +32 -10
  456. package/dist/mcp/read-client.d.ts.map +1 -1
  457. package/dist/mcp/read-client.js +299 -15
  458. package/dist/mcp/read-client.js.map +1 -1
  459. package/dist/mcp/resources.d.ts +3 -1
  460. package/dist/mcp/resources.d.ts.map +1 -1
  461. package/dist/mcp/resources.js +11 -2
  462. package/dist/mcp/resources.js.map +1 -1
  463. package/dist/mcp/server.d.ts +17 -0
  464. package/dist/mcp/server.d.ts.map +1 -1
  465. package/dist/mcp/server.js +54 -7
  466. package/dist/mcp/server.js.map +1 -1
  467. package/dist/mcp/session.d.ts +2 -0
  468. package/dist/mcp/session.d.ts.map +1 -1
  469. package/dist/mcp/session.js +41 -8
  470. package/dist/mcp/session.js.map +1 -1
  471. package/dist/mcp/store.d.ts +14 -1
  472. package/dist/mcp/store.d.ts.map +1 -1
  473. package/dist/mcp/store.js +31 -2
  474. package/dist/mcp/store.js.map +1 -1
  475. package/dist/mcp/tools.d.ts +62 -0
  476. package/dist/mcp/tools.d.ts.map +1 -1
  477. package/dist/mcp/tools.js +186 -64
  478. package/dist/mcp/tools.js.map +1 -1
  479. package/dist/mcp/types.d.ts +3 -1
  480. package/dist/mcp/types.d.ts.map +1 -1
  481. package/dist/oura/index.d.ts +1 -1
  482. package/dist/oura/index.d.ts.map +1 -1
  483. package/dist/oura/index.js +15 -0
  484. package/dist/oura/index.js.map +1 -1
  485. package/dist/payment/x402.d.ts +6 -3
  486. package/dist/payment/x402.d.ts.map +1 -1
  487. package/dist/payment/x402.js +35 -0
  488. package/dist/payment/x402.js.map +1 -1
  489. package/dist/pdpp/pkce.d.ts +1 -22
  490. package/dist/pdpp/pkce.d.ts.map +1 -1
  491. package/dist/pdpp/pkce.js +3 -2
  492. package/dist/pdpp/pkce.js.map +1 -1
  493. package/dist/policy/reserved-scopes.d.ts +3 -0
  494. package/dist/policy/reserved-scopes.d.ts.map +1 -1
  495. package/dist/policy/reserved-scopes.js +12 -1
  496. package/dist/policy/reserved-scopes.js.map +1 -1
  497. package/dist/ports/index.d.ts +61 -9
  498. package/dist/ports/index.d.ts.map +1 -1
  499. package/dist/ports/index.js.map +1 -1
  500. package/dist/publication/publish.d.ts +31 -1
  501. package/dist/publication/publish.d.ts.map +1 -1
  502. package/dist/publication/publish.js +30 -14
  503. package/dist/publication/publish.js.map +1 -1
  504. package/dist/replication/copies.d.ts +1 -1
  505. package/dist/replication/dpv2.d.ts.map +1 -1
  506. package/dist/replication/dpv2.js +33 -0
  507. package/dist/replication/dpv2.js.map +1 -1
  508. package/dist/schemas/server-config.d.ts +16 -0
  509. package/dist/schemas/server-config.d.ts.map +1 -1
  510. package/dist/schemas/server-config.js +49 -0
  511. package/dist/schemas/server-config.js.map +1 -1
  512. package/dist/storage/adapters/interface.d.ts +12 -2
  513. package/dist/storage/adapters/interface.d.ts.map +1 -1
  514. package/dist/storage/adapters/interface.js.map +1 -1
  515. package/dist/storage/adapters/rate-limit-policy.d.ts +71 -0
  516. package/dist/storage/adapters/rate-limit-policy.d.ts.map +1 -0
  517. package/dist/storage/adapters/rate-limit-policy.js +107 -0
  518. package/dist/storage/adapters/rate-limit-policy.js.map +1 -0
  519. package/dist/storage/adapters/sdk.d.ts +7 -0
  520. package/dist/storage/adapters/sdk.d.ts.map +1 -1
  521. package/dist/storage/adapters/sdk.js +12 -6
  522. package/dist/storage/adapters/sdk.js.map +1 -1
  523. package/dist/storage/adapters/throttle.d.ts +30 -0
  524. package/dist/storage/adapters/throttle.d.ts.map +1 -0
  525. package/dist/storage/adapters/throttle.js +94 -0
  526. package/dist/storage/adapters/throttle.js.map +1 -0
  527. package/dist/storage/adapters/vana-audience.d.ts +4 -1
  528. package/dist/storage/adapters/vana-audience.d.ts.map +1 -1
  529. package/dist/storage/adapters/vana-audience.js +23 -11
  530. package/dist/storage/adapters/vana-audience.js.map +1 -1
  531. package/dist/storage/adapters/vana.d.ts +5 -0
  532. package/dist/storage/adapters/vana.d.ts.map +1 -1
  533. package/dist/storage/adapters/vana.js +82 -18
  534. package/dist/storage/adapters/vana.js.map +1 -1
  535. package/dist/storage/blocks/cursor.d.ts.map +1 -1
  536. package/dist/storage/blocks/cursor.js +3 -13
  537. package/dist/storage/blocks/cursor.js.map +1 -1
  538. package/dist/storage/canonical-legacy-projection.d.ts +13 -1
  539. package/dist/storage/canonical-legacy-projection.d.ts.map +1 -1
  540. package/dist/storage/canonical-legacy-projection.js +92 -24
  541. package/dist/storage/canonical-legacy-projection.js.map +1 -1
  542. package/dist/storage/hierarchy/paths.d.ts.map +1 -1
  543. package/dist/storage/hierarchy/paths.js +9 -2
  544. package/dist/storage/hierarchy/paths.js.map +1 -1
  545. package/dist/storage/index/manager.d.ts +19 -5
  546. package/dist/storage/index/manager.d.ts.map +1 -1
  547. package/dist/storage/legacy-scope-view.d.ts +4 -6
  548. package/dist/storage/legacy-scope-view.d.ts.map +1 -1
  549. package/dist/storage/legacy-scope-view.js +50 -57
  550. package/dist/storage/legacy-scope-view.js.map +1 -1
  551. package/dist/storage/legacy-write-seal.d.ts +73 -0
  552. package/dist/storage/legacy-write-seal.d.ts.map +1 -0
  553. package/dist/storage/legacy-write-seal.js +74 -0
  554. package/dist/storage/legacy-write-seal.js.map +1 -0
  555. package/dist/storage/pdpp-records/cursor.d.ts.map +1 -1
  556. package/dist/storage/pdpp-records/cursor.js +3 -29
  557. package/dist/storage/pdpp-records/cursor.js.map +1 -1
  558. package/dist/storage/pdpp-records/declaration-witness.d.ts.map +1 -1
  559. package/dist/storage/pdpp-records/declaration-witness.js +4 -3
  560. package/dist/storage/pdpp-records/declaration-witness.js.map +1 -1
  561. package/dist/storage/pdpp-records/types.d.ts +2 -0
  562. package/dist/storage/pdpp-records/types.d.ts.map +1 -1
  563. package/dist/storage/pdpp-records/types.js.map +1 -1
  564. package/dist/stream-sync/artifacts.d.ts +38 -0
  565. package/dist/stream-sync/artifacts.d.ts.map +1 -0
  566. package/dist/stream-sync/artifacts.js +179 -0
  567. package/dist/stream-sync/artifacts.js.map +1 -0
  568. package/dist/stream-sync/blobs.d.ts +18 -0
  569. package/dist/stream-sync/blobs.d.ts.map +1 -0
  570. package/dist/stream-sync/blobs.js +83 -0
  571. package/dist/stream-sync/blobs.js.map +1 -0
  572. package/dist/stream-sync/crypto-port.d.ts +30 -0
  573. package/dist/stream-sync/crypto-port.d.ts.map +1 -0
  574. package/dist/stream-sync/crypto-port.js +29 -0
  575. package/dist/stream-sync/crypto-port.js.map +1 -0
  576. package/dist/stream-sync/crypto.d.ts +27 -0
  577. package/dist/stream-sync/crypto.d.ts.map +1 -0
  578. package/dist/stream-sync/crypto.js +67 -0
  579. package/dist/stream-sync/crypto.js.map +1 -0
  580. package/dist/stream-sync/delete-metadata.d.ts +23 -0
  581. package/dist/stream-sync/delete-metadata.d.ts.map +1 -0
  582. package/dist/stream-sync/delete-metadata.js +40 -0
  583. package/dist/stream-sync/delete-metadata.js.map +1 -0
  584. package/dist/stream-sync/design-flags.d.ts +31 -0
  585. package/dist/stream-sync/design-flags.d.ts.map +1 -0
  586. package/dist/stream-sync/design-flags.js +44 -0
  587. package/dist/stream-sync/design-flags.js.map +1 -0
  588. package/dist/stream-sync/host-contract.d.ts +50 -0
  589. package/dist/stream-sync/host-contract.d.ts.map +1 -0
  590. package/dist/stream-sync/host-contract.js +80 -0
  591. package/dist/stream-sync/host-contract.js.map +1 -0
  592. package/dist/stream-sync/index.d.ts +19 -0
  593. package/dist/stream-sync/index.d.ts.map +1 -0
  594. package/dist/stream-sync/index.js +19 -0
  595. package/dist/stream-sync/index.js.map +1 -0
  596. package/dist/stream-sync/intake.d.ts +319 -0
  597. package/dist/stream-sync/intake.d.ts.map +1 -0
  598. package/dist/stream-sync/intake.js +62 -0
  599. package/dist/stream-sync/intake.js.map +1 -0
  600. package/dist/stream-sync/memory-registry.d.ts +85 -0
  601. package/dist/stream-sync/memory-registry.d.ts.map +1 -0
  602. package/dist/stream-sync/memory-registry.js +293 -0
  603. package/dist/stream-sync/memory-registry.js.map +1 -0
  604. package/dist/stream-sync/normalize-raw-end.d.ts +25 -0
  605. package/dist/stream-sync/normalize-raw-end.d.ts.map +1 -0
  606. package/dist/stream-sync/normalize-raw-end.js +177 -0
  607. package/dist/stream-sync/normalize-raw-end.js.map +1 -0
  608. package/dist/stream-sync/ports.d.ts +486 -0
  609. package/dist/stream-sync/ports.d.ts.map +1 -0
  610. package/dist/stream-sync/ports.js +91 -0
  611. package/dist/stream-sync/ports.js.map +1 -0
  612. package/dist/stream-sync/publish-plan.d.ts +129 -0
  613. package/dist/stream-sync/publish-plan.d.ts.map +1 -0
  614. package/dist/stream-sync/publish-plan.js +134 -0
  615. package/dist/stream-sync/publish-plan.js.map +1 -0
  616. package/dist/stream-sync/raw-end.d.ts +59 -0
  617. package/dist/stream-sync/raw-end.d.ts.map +1 -0
  618. package/dist/stream-sync/raw-end.js +113 -0
  619. package/dist/stream-sync/raw-end.js.map +1 -0
  620. package/dist/stream-sync/registry.d.ts +31 -0
  621. package/dist/stream-sync/registry.d.ts.map +1 -0
  622. package/dist/stream-sync/registry.js +645 -0
  623. package/dist/stream-sync/registry.js.map +1 -0
  624. package/dist/stream-sync/run-finish-plan.d.ts +61 -0
  625. package/dist/stream-sync/run-finish-plan.d.ts.map +1 -0
  626. package/dist/stream-sync/run-finish-plan.js +373 -0
  627. package/dist/stream-sync/run-finish-plan.js.map +1 -0
  628. package/dist/stream-sync/run-saved.d.ts +51 -0
  629. package/dist/stream-sync/run-saved.d.ts.map +1 -0
  630. package/dist/stream-sync/run-saved.js +83 -0
  631. package/dist/stream-sync/run-saved.js.map +1 -0
  632. package/dist/stream-sync/scope-routing.d.ts +17 -0
  633. package/dist/stream-sync/scope-routing.d.ts.map +1 -0
  634. package/dist/stream-sync/scope-routing.js +24 -0
  635. package/dist/stream-sync/scope-routing.js.map +1 -0
  636. package/dist/stream-sync/seed-staging.d.ts +85 -0
  637. package/dist/stream-sync/seed-staging.d.ts.map +1 -0
  638. package/dist/stream-sync/seed-staging.js +325 -0
  639. package/dist/stream-sync/seed-staging.js.map +1 -0
  640. package/dist/stream-sync/semver.d.ts +3 -0
  641. package/dist/stream-sync/semver.d.ts.map +1 -0
  642. package/dist/stream-sync/semver.js +49 -0
  643. package/dist/stream-sync/semver.js.map +1 -0
  644. package/dist/stream-sync/send-gate.d.ts +149 -0
  645. package/dist/stream-sync/send-gate.d.ts.map +1 -0
  646. package/dist/stream-sync/send-gate.js +382 -0
  647. package/dist/stream-sync/send-gate.js.map +1 -0
  648. package/dist/stream-sync/storage-retry.d.ts +216 -0
  649. package/dist/stream-sync/storage-retry.d.ts.map +1 -0
  650. package/dist/stream-sync/storage-retry.js +315 -0
  651. package/dist/stream-sync/storage-retry.js.map +1 -0
  652. package/dist/stream-sync/stream-aead.d.ts +33 -0
  653. package/dist/stream-sync/stream-aead.d.ts.map +1 -0
  654. package/dist/stream-sync/stream-aead.js +183 -0
  655. package/dist/stream-sync/stream-aead.js.map +1 -0
  656. package/dist/stream-sync/timer.d.ts +3 -0
  657. package/dist/stream-sync/timer.d.ts.map +1 -0
  658. package/dist/stream-sync/timer.js +3 -0
  659. package/dist/stream-sync/timer.js.map +1 -0
  660. package/dist/stream-sync-read/index.d.ts +4 -0
  661. package/dist/stream-sync-read/index.d.ts.map +1 -0
  662. package/dist/stream-sync-read/index.js +3 -0
  663. package/dist/stream-sync-read/index.js.map +1 -0
  664. package/dist/stream-sync-read/routing.d.ts +27 -0
  665. package/dist/stream-sync-read/routing.d.ts.map +1 -0
  666. package/dist/stream-sync-read/routing.js +49 -0
  667. package/dist/stream-sync-read/routing.js.map +1 -0
  668. package/dist/stream-sync-read/service.d.ts +281 -0
  669. package/dist/stream-sync-read/service.d.ts.map +1 -0
  670. package/dist/stream-sync-read/service.js +18 -0
  671. package/dist/stream-sync-read/service.js.map +1 -0
  672. package/dist/sync/account-mode/authority.d.ts +121 -0
  673. package/dist/sync/account-mode/authority.d.ts.map +1 -0
  674. package/dist/sync/account-mode/authority.js +446 -0
  675. package/dist/sync/account-mode/authority.js.map +1 -0
  676. package/dist/sync/account-mode/evidence-wire.d.ts +42 -0
  677. package/dist/sync/account-mode/evidence-wire.d.ts.map +1 -0
  678. package/dist/sync/account-mode/evidence-wire.js +76 -0
  679. package/dist/sync/account-mode/evidence-wire.js.map +1 -0
  680. package/dist/sync/account-mode/import-waker.d.ts +36 -0
  681. package/dist/sync/account-mode/import-waker.d.ts.map +1 -0
  682. package/dist/sync/account-mode/import-waker.js +55 -0
  683. package/dist/sync/account-mode/import-waker.js.map +1 -0
  684. package/dist/sync/account-mode/index.d.ts +10 -0
  685. package/dist/sync/account-mode/index.d.ts.map +1 -0
  686. package/dist/sync/account-mode/index.js +10 -0
  687. package/dist/sync/account-mode/index.js.map +1 -0
  688. package/dist/sync/account-mode/port.d.ts +11 -0
  689. package/dist/sync/account-mode/port.d.ts.map +1 -0
  690. package/dist/sync/account-mode/port.js +21 -0
  691. package/dist/sync/account-mode/port.js.map +1 -0
  692. package/dist/sync/account-mode/record.d.ts +54 -0
  693. package/dist/sync/account-mode/record.d.ts.map +1 -0
  694. package/dist/sync/account-mode/record.js +62 -0
  695. package/dist/sync/account-mode/record.js.map +1 -0
  696. package/dist/sync/account-mode/rw-lock.d.ts +14 -0
  697. package/dist/sync/account-mode/rw-lock.d.ts.map +1 -0
  698. package/dist/sync/account-mode/rw-lock.js +59 -0
  699. package/dist/sync/account-mode/rw-lock.js.map +1 -0
  700. package/dist/sync/cancellable-gateway.d.ts +25 -0
  701. package/dist/sync/cancellable-gateway.d.ts.map +1 -0
  702. package/dist/sync/cancellable-gateway.js +64 -0
  703. package/dist/sync/cancellable-gateway.js.map +1 -0
  704. package/dist/sync/engine/change-probe.d.ts +49 -0
  705. package/dist/sync/engine/change-probe.d.ts.map +1 -0
  706. package/dist/sync/engine/change-probe.js +84 -0
  707. package/dist/sync/engine/change-probe.js.map +1 -0
  708. package/dist/sync/engine/change-push.d.ts +56 -0
  709. package/dist/sync/engine/change-push.d.ts.map +1 -0
  710. package/dist/sync/engine/change-push.js +176 -0
  711. package/dist/sync/engine/change-push.js.map +1 -0
  712. package/dist/sync/engine/sync-manager.d.ts +208 -1
  713. package/dist/sync/engine/sync-manager.d.ts.map +1 -1
  714. package/dist/sync/engine/sync-manager.js +1005 -34
  715. package/dist/sync/engine/sync-manager.js.map +1 -1
  716. package/dist/sync/index.d.ts +6 -2
  717. package/dist/sync/index.d.ts.map +1 -1
  718. package/dist/sync/index.js +5 -1
  719. package/dist/sync/index.js.map +1 -1
  720. package/dist/sync/pdpp-import.d.ts +12 -2
  721. package/dist/sync/pdpp-import.d.ts.map +1 -1
  722. package/dist/sync/pdpp-import.js +32 -7
  723. package/dist/sync/pdpp-import.js.map +1 -1
  724. package/dist/sync/tombstone-resubmits.d.ts +7 -4
  725. package/dist/sync/tombstone-resubmits.d.ts.map +1 -1
  726. package/dist/sync/tombstone-resubmits.js.map +1 -1
  727. package/dist/sync/types.d.ts +29 -0
  728. package/dist/sync/types.d.ts.map +1 -1
  729. package/dist/sync/upload-attempts.d.ts +244 -0
  730. package/dist/sync/upload-attempts.d.ts.map +1 -0
  731. package/dist/sync/upload-attempts.js +548 -0
  732. package/dist/sync/upload-attempts.js.map +1 -0
  733. package/dist/sync/upload-state.d.ts +163 -0
  734. package/dist/sync/upload-state.d.ts.map +1 -0
  735. package/dist/sync/upload-state.js +239 -0
  736. package/dist/sync/upload-state.js.map +1 -0
  737. package/dist/sync/workers/delete.d.ts +33 -1
  738. package/dist/sync/workers/delete.d.ts.map +1 -1
  739. package/dist/sync/workers/delete.js +83 -11
  740. package/dist/sync/workers/delete.js.map +1 -1
  741. package/dist/sync/workers/download.d.ts +3 -0
  742. package/dist/sync/workers/download.d.ts.map +1 -1
  743. package/dist/sync/workers/download.js +67 -12
  744. package/dist/sync/workers/download.js.map +1 -1
  745. package/dist/sync/workers/upload.d.ts +70 -2
  746. package/dist/sync/workers/upload.d.ts.map +1 -1
  747. package/dist/sync/workers/upload.js +354 -23
  748. package/dist/sync/workers/upload.js.map +1 -1
  749. package/dist/test-support/memory-oracle.calibration.d.ts +16 -0
  750. package/dist/test-support/memory-oracle.calibration.d.ts.map +1 -0
  751. package/dist/test-support/memory-oracle.calibration.js +43 -0
  752. package/dist/test-support/memory-oracle.calibration.js.map +1 -0
  753. package/dist/test-support/memory-oracle.d.ts +82 -0
  754. package/dist/test-support/memory-oracle.d.ts.map +1 -0
  755. package/dist/test-support/memory-oracle.js +104 -0
  756. package/dist/test-support/memory-oracle.js.map +1 -0
  757. package/dist/test-utils/account-mode.d.ts +36 -0
  758. package/dist/test-utils/account-mode.d.ts.map +1 -0
  759. package/dist/test-utils/account-mode.js +78 -0
  760. package/dist/test-utils/account-mode.js.map +1 -0
  761. package/dist/test-utils/index.d.ts +3 -0
  762. package/dist/test-utils/index.d.ts.map +1 -1
  763. package/dist/test-utils/index.js +3 -0
  764. package/dist/test-utils/index.js.map +1 -1
  765. package/dist/test-utils/legacy-write-seal.d.ts +16 -0
  766. package/dist/test-utils/legacy-write-seal.d.ts.map +1 -0
  767. package/dist/test-utils/legacy-write-seal.js +20 -0
  768. package/dist/test-utils/legacy-write-seal.js.map +1 -0
  769. package/dist/test-utils/live-grants.d.ts +24 -0
  770. package/dist/test-utils/live-grants.d.ts.map +1 -0
  771. package/dist/test-utils/live-grants.js +6 -0
  772. package/dist/test-utils/live-grants.js.map +1 -0
  773. package/dist/test-utils/memory-storage.d.ts +17 -1
  774. package/dist/test-utils/memory-storage.d.ts.map +1 -1
  775. package/dist/test-utils/memory-storage.js +94 -46
  776. package/dist/test-utils/memory-storage.js.map +1 -1
  777. package/dist/test-utils/run-end.d.ts +27 -0
  778. package/dist/test-utils/run-end.d.ts.map +1 -0
  779. package/dist/test-utils/run-end.js +44 -0
  780. package/dist/test-utils/run-end.js.map +1 -0
  781. package/dist/test-utils/wallet.d.ts +0 -4
  782. package/dist/test-utils/wallet.d.ts.map +1 -1
  783. package/dist/test-utils/wallet.js +3 -12
  784. package/dist/test-utils/wallet.js.map +1 -1
  785. package/dist/write/attribution.d.ts.map +1 -1
  786. package/dist/write/attribution.js +2 -4
  787. package/dist/write/attribution.js.map +1 -1
  788. package/dist-test/localdb/conformance.d.ts +13 -0
  789. package/dist-test/localdb/conformance.d.ts.map +1 -0
  790. package/dist-test/localdb/conformance.js +372 -0
  791. package/dist-test/localdb/conformance.js.map +1 -0
  792. package/dist-test/tsconfig.tsbuildinfo +1 -0
  793. package/package.json +60 -5
@@ -0,0 +1,84 @@
1
+ import { createRegistryChangePush, } from "./change-push.js";
2
+ /**
3
+ * Period of the timed registry probe.
4
+ *
5
+ * Two measured limits bound it (D4-SYNC-TRIGGERS, 2026-11-14):
6
+ *
7
+ * - Cost floor. One idle cycle of one connection of six streams makes 29
8
+ * registry requests (3 listings, 26 reads; `idle-cycle-requests.test.ts`),
9
+ * and the timer makes one per 60 s on every open device. The probe ADDS to
10
+ * that: 60 s / P requests a minute (12 at 5 s). Below 60 s / 29 = 2.1 s the
11
+ * probe alone would out-request the idle cycle it supplements. More
12
+ * connections raise the cycle's cost (1 + 28 per connection), so the floor
13
+ * only falls. The probe is not a saving; it buys latency.
14
+ * - Latency. A change waits half a period on average. The remaining path is
15
+ * the writer's publish (about 4.5 s) plus this device's apply (1 to 4 s), so
16
+ * waiting P/2 = 2.5 s keeps the added wait below the work it follows.
17
+ *
18
+ * 5 s sits inside both bounds. Hosts may change it; 0 switches the probe off.
19
+ * The probe runs only while the held push request cannot announce changes
20
+ * (absent, failing, or answering without a position); a healthy push makes it
21
+ * redundant and the manager skips it.
22
+ */
23
+ export const DEFAULT_CHANGE_PROBE_MS = 5_000;
24
+ /**
25
+ * A probe read that has not answered after this long failed. A probe is
26
+ * optional: a read that never settles must not hold a pull in flight, so the
27
+ * ordinary timed path and every later poke stay free. It matches the push
28
+ * request's grace (`REQUEST_GRACE_MS`), the same "this connection is dead" bar.
29
+ */
30
+ export const PROBE_TIMEOUT_MS = 10_000;
31
+ /** The manager's probe over a registry that can answer one; none otherwise. */
32
+ export function createRegistryChangeProbe(registry, options = {}) {
33
+ const intervalMs = Number.isFinite(options.intervalMs)
34
+ ? options.intervalMs
35
+ : DEFAULT_CHANGE_PROBE_MS;
36
+ const probeChange = registry.probeChange?.bind(registry);
37
+ if (!probeChange || !(intervalMs > 0))
38
+ return undefined;
39
+ const push = createRegistryChangePush(registry, options.push);
40
+ return {
41
+ read: (lifecycle) => readWithDeadline(probeChange, lifecycle),
42
+ intervalMs,
43
+ ...(push && { push }),
44
+ };
45
+ }
46
+ /**
47
+ * One probe read that ends. It ends on the first of: the registry's answer,
48
+ * the deadline, or the manager's lifecycle signal (a hide or a stop). Deadline
49
+ * and lifecycle abort the request so it frees its connection, and both settle
50
+ * the read at once even when the registry ignores the signal. Every way out
51
+ * clears the deadline timer and the lifecycle listener, and a late answer from
52
+ * the registry finds the read already settled.
53
+ */
54
+ function readWithDeadline(probeChange, lifecycle) {
55
+ const asError = (reason) => reason instanceof Error ? reason : new Error("registry change probe ended");
56
+ if (lifecycle.aborted)
57
+ return Promise.reject(asError(lifecycle.reason));
58
+ const controller = new AbortController();
59
+ return new Promise((resolve, reject) => {
60
+ let settled = false;
61
+ const finish = (settle) => {
62
+ if (settled)
63
+ return;
64
+ settled = true;
65
+ clearTimeout(timer);
66
+ lifecycle.removeEventListener("abort", onLifecycle);
67
+ settle();
68
+ };
69
+ const fail = (error) => {
70
+ controller.abort(error);
71
+ finish(() => reject(error));
72
+ };
73
+ const onLifecycle = () => fail(asError(lifecycle.reason));
74
+ const timer = setTimeout(() => fail(new Error("registry change probe got no answer")), PROBE_TIMEOUT_MS);
75
+ lifecycle.addEventListener("abort", onLifecycle, { once: true });
76
+ try {
77
+ probeChange(controller.signal).then((marker) => finish(() => resolve(marker)), (error) => finish(() => reject(error)));
78
+ }
79
+ catch (error) {
80
+ finish(() => reject(error));
81
+ }
82
+ });
83
+ }
84
+ //# sourceMappingURL=change-probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-probe.js","sourceRoot":"","sources":["../../../src/sync/engine/change-probe.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,GAEzB,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C;;;;;GAKG;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stream-sync/ports.js";
2
+ import type { ChangePush } from "./sync-manager.js";
3
+ export { ChangeFeedAbsentError };
4
+ /**
5
+ * How long one held request waits at the gateway before it answers "nothing
6
+ * yet". Each answer starts the next request, so an idle client makes one
7
+ * request per this period: 25 s is 0.04 req/s, against 0.2 req/s for the 5 s
8
+ * probe it relieves. It stays under common proxy idle limits (30 to 60 s), and
9
+ * the gateway refuses a wait above 55 s.
10
+ */
11
+ export declare const CHANGE_PUSH_WAIT_MS = 25000;
12
+ /**
13
+ * The wait before retry number `failures` + 1 (0 for the first retry): 1 s
14
+ * doubling to 30 s, spread over half to one and a half of the step so a fleet
15
+ * that lost the same dependency together does not return together. The push
16
+ * uses it for its transport; the manager uses it to space retries of a failing
17
+ * cycle, so a failure has one back-off schedule.
18
+ */
19
+ export declare function changePushBackoffMs(failures: number, random?: () => number): number;
20
+ export interface RegistryChangePushOptions {
21
+ /** Default true; false: no push, the timed probe alone (as before). */
22
+ enabled?: boolean;
23
+ /**
24
+ * Default {@link CHANGE_PUSH_WAIT_MS}, also for a value that is not a finite
25
+ * positive number: a held request of NaN or Infinity seconds is no period.
26
+ */
27
+ waitMs?: number;
28
+ }
29
+ /**
30
+ * A subscription to the gateway's "the registry moved" signal.
31
+ *
32
+ * It keeps one held request open. Each answer carries the registry's
33
+ * sequence, the registry's position; the next request sends it back, so the
34
+ * gateway compares two numbers and a poke that was lost on the wire is found
35
+ * by the next request. An answer that ends the wait with nothing new carries
36
+ * the gateway's current sequence too, read when the wait ended. The position is
37
+ * not data: the manager reads the registry itself and trusts the position only
38
+ * to say that nothing moved since a cycle that started under it, so a wake that
39
+ * was lost is found at the next answer. It does four things:
40
+ *
41
+ * - every answer reports its sequence as the position (`onPosition`), before
42
+ * anything else, so the cycle a poke starts samples the position it follows;
43
+ * - an answer that says `changed` is a poke (`onChange`): the manager pulls,
44
+ * or applies the answer's delta. Each held request sends the position the
45
+ * manager holds the registry up to (`since`), so the gateway can answer
46
+ * with what changed after it;
47
+ * - the first answer after any failure is a poke too, whether or not the
48
+ * sequence moved, so a poke lost with the connection costs one pull. A
49
+ * failed attempt is not a poke: with every answer lost, only the manager's
50
+ * timer cycle (and its probe) finds the change;
51
+ * - `onHealth(false)` on any failure or silence, `onHealth(true)` on the next
52
+ * answer: only while healthy does the manager skip its timer cycle and
53
+ * probe.
54
+ */
55
+ export declare function createRegistryChangePush(registry: Pick<StreamSyncRegistry, "waitForChange">, options?: RegistryChangePushOptions): ChangePush | undefined;
56
+ //# sourceMappingURL=change-push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-push.d.ts","sourceRoot":"","sources":["../../../src/sync/engine/change-push.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EAErB,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAY1C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,MAAM,MAAoB,GACjC,MAAM,CAGR;AAED,MAAM,WAAW,yBAAyB;IACxC,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,EACnD,OAAO,GAAE,yBAA8B,GACtC,UAAU,GAAG,SAAS,CA2HxB"}
@@ -0,0 +1,176 @@
1
+ import { NODE_MAX_TIMER_DELAY_MS } from "../../stream-sync/timer.js";
2
+ import { ChangeFeedAbsentError, RegistryOverloadError, } from "../../stream-sync/ports.js";
3
+ export { ChangeFeedAbsentError };
4
+ /**
5
+ * How long one held request waits at the gateway before it answers "nothing
6
+ * yet". Each answer starts the next request, so an idle client makes one
7
+ * request per this period: 25 s is 0.04 req/s, against 0.2 req/s for the 5 s
8
+ * probe it relieves. It stays under common proxy idle limits (30 to 60 s), and
9
+ * the gateway refuses a wait above 55 s.
10
+ */
11
+ export const CHANGE_PUSH_WAIT_MS = 25_000;
12
+ /**
13
+ * Longer than the wait by this much, a request with no answer is declared
14
+ * dead (a half-open connection never errors). The cost of a dead request is
15
+ * bounded by this: the push says it is unhealthy and the 5 s probe returns.
16
+ */
17
+ const REQUEST_GRACE_MS = 10_000;
18
+ const BACKOFF_MIN_MS = 1_000;
19
+ const BACKOFF_MAX_MS = 30_000;
20
+ /**
21
+ * The wait before retry number `failures` + 1 (0 for the first retry): 1 s
22
+ * doubling to 30 s, spread over half to one and a half of the step so a fleet
23
+ * that lost the same dependency together does not return together. The push
24
+ * uses it for its transport; the manager uses it to space retries of a failing
25
+ * cycle, so a failure has one back-off schedule.
26
+ */
27
+ export function changePushBackoffMs(failures, random = Math.random) {
28
+ const base = BACKOFF_MIN_MS * 2 ** Math.min(failures, 5);
29
+ return Math.min(BACKOFF_MAX_MS, base * (0.5 + random()));
30
+ }
31
+ /**
32
+ * A subscription to the gateway's "the registry moved" signal.
33
+ *
34
+ * It keeps one held request open. Each answer carries the registry's
35
+ * sequence, the registry's position; the next request sends it back, so the
36
+ * gateway compares two numbers and a poke that was lost on the wire is found
37
+ * by the next request. An answer that ends the wait with nothing new carries
38
+ * the gateway's current sequence too, read when the wait ended. The position is
39
+ * not data: the manager reads the registry itself and trusts the position only
40
+ * to say that nothing moved since a cycle that started under it, so a wake that
41
+ * was lost is found at the next answer. It does four things:
42
+ *
43
+ * - every answer reports its sequence as the position (`onPosition`), before
44
+ * anything else, so the cycle a poke starts samples the position it follows;
45
+ * - an answer that says `changed` is a poke (`onChange`): the manager pulls,
46
+ * or applies the answer's delta. Each held request sends the position the
47
+ * manager holds the registry up to (`since`), so the gateway can answer
48
+ * with what changed after it;
49
+ * - the first answer after any failure is a poke too, whether or not the
50
+ * sequence moved, so a poke lost with the connection costs one pull. A
51
+ * failed attempt is not a poke: with every answer lost, only the manager's
52
+ * timer cycle (and its probe) finds the change;
53
+ * - `onHealth(false)` on any failure or silence, `onHealth(true)` on the next
54
+ * answer: only while healthy does the manager skip its timer cycle and
55
+ * probe.
56
+ */
57
+ export function createRegistryChangePush(registry, options = {}) {
58
+ const waitForChange = registry.waitForChange?.bind(registry);
59
+ if (!waitForChange || options.enabled === false)
60
+ return undefined;
61
+ const waitMs = Number.isFinite(options.waitMs) && options.waitMs > 0
62
+ ? options.waitMs
63
+ : CHANGE_PUSH_WAIT_MS;
64
+ return {
65
+ subscribe(handlers) {
66
+ const lifetime = new AbortController();
67
+ let cursor;
68
+ let healthy = false;
69
+ let afterFailure = false;
70
+ let failures = 0;
71
+ const setHealth = (next) => {
72
+ if (healthy === next || lifetime.signal.aborted)
73
+ return;
74
+ healthy = next;
75
+ handlers.onHealth(next);
76
+ };
77
+ // The abort listener goes away on both ways out. An outage sleeps once
78
+ // per attempt; a listener left behind by each sleep is a leak that grows
79
+ // with the subscription's age.
80
+ const sleep = async (ms) => {
81
+ const deadline = Date.now() + ms;
82
+ while (!lifetime.signal.aborted && Date.now() < deadline) {
83
+ await new Promise((resolve) => {
84
+ const done = () => {
85
+ clearTimeout(timer);
86
+ lifetime.signal.removeEventListener("abort", done);
87
+ resolve();
88
+ };
89
+ const timer = setTimeout(done, Math.min(deadline - Date.now(), NODE_MAX_TIMER_DELAY_MS));
90
+ lifetime.signal.addEventListener("abort", done, { once: true });
91
+ });
92
+ }
93
+ };
94
+ async function once() {
95
+ const request = new AbortController();
96
+ let timer;
97
+ let onStop;
98
+ // The request ends on the first of: the registry's answer, the
99
+ // deadline, or the subscription's end. The last two settle it at once
100
+ // and clear the deadline timer in the same turn, even when the
101
+ // registry ignores the abort; a late answer then finds nobody waiting.
102
+ const ended = new Promise((_resolve, reject) => {
103
+ timer = setTimeout(() => {
104
+ const error = new Error("change request got no answer");
105
+ request.abort(error);
106
+ reject(error);
107
+ }, waitMs + REQUEST_GRACE_MS);
108
+ onStop = () => {
109
+ clearTimeout(timer);
110
+ request.abort(lifetime.signal.reason);
111
+ reject(lifetime.signal.reason);
112
+ };
113
+ lifetime.signal.addEventListener("abort", onStop, { once: true });
114
+ });
115
+ try {
116
+ const wait = waitForChange(cursor, waitMs, request.signal, cursor === undefined ? undefined : handlers.since());
117
+ wait.catch(() => { }); // a late failure after the race is not ours
118
+ const answer = await Promise.race([wait, ended]);
119
+ if (lifetime.signal.aborted)
120
+ return "failed";
121
+ cursor = answer.seq;
122
+ failures = 0;
123
+ setHealth(true);
124
+ // The position first: the cycle a poke starts samples it.
125
+ handlers.onPosition(answer.seq);
126
+ if (answer.changed || afterFailure) {
127
+ afterFailure = false;
128
+ handlers.onChange(answer.changed ? answer.delta : undefined);
129
+ }
130
+ return "answer";
131
+ }
132
+ catch (error) {
133
+ if (error instanceof RegistryOverloadError)
134
+ return error.retryAfterMs;
135
+ if (error instanceof ChangeFeedAbsentError)
136
+ return "absent";
137
+ return "failed";
138
+ }
139
+ finally {
140
+ clearTimeout(timer);
141
+ lifetime.signal.removeEventListener("abort", onStop);
142
+ }
143
+ }
144
+ void (async () => {
145
+ while (!lifetime.signal.aborted) {
146
+ const outcome = await once();
147
+ if (lifetime.signal.aborted)
148
+ return;
149
+ if (typeof outcome === "number") {
150
+ await sleep(outcome);
151
+ continue;
152
+ }
153
+ if (outcome === "absent") {
154
+ // No route: stay unhealthy, so the manager's timer and probe keep
155
+ // watching, and ask again after one held period. An absent route
156
+ // then costs at most the one request per period a present route
157
+ // costs, and a gateway that gains the route is found within a
158
+ // period, with no restart.
159
+ setHealth(false);
160
+ await sleep(waitMs);
161
+ continue;
162
+ }
163
+ if (outcome === "failed") {
164
+ setHealth(false);
165
+ afterFailure = true;
166
+ const wait = changePushBackoffMs(failures);
167
+ failures += 1;
168
+ await sleep(wait);
169
+ }
170
+ }
171
+ })();
172
+ return () => lifetime.abort(new Error("change push stopped"));
173
+ },
174
+ };
175
+ }
176
+ //# sourceMappingURL=change-push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-push.js","sourceRoot":"","sources":["../../../src/sync/engine/change-push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GAEtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAE1C;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC,MAAM,cAAc,GAAG,KAAK,CAAC;AAC7B,MAAM,cAAc,GAAG,MAAM,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAgB,EAChB,SAAuB,IAAI,CAAC,MAAM;IAElC,MAAM,IAAI,GAAG,cAAc,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,GAAG,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,wBAAwB,CACtC,QAAmD,EACnD,UAAqC,EAAE;IAEvC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7D,IAAI,CAAC,aAAa,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK;QAAE,OAAO,SAAS,CAAC;IAClE,MAAM,MAAM,GACV,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAK,OAAO,CAAC,MAAiB,GAAG,CAAC;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O;oBACpC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;wBAChC,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;wBACrB,SAAS;oBACX,CAAC;oBACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;wBACzB,kEAAkE;wBAClE,iEAAiE;wBACjE,gEAAgE;wBAChE,8DAA8D;wBAC9D,2BAA2B;wBAC3B,SAAS,CAAC,KAAK,CAAC,CAAC;wBACjB,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;wBACpB,SAAS;oBACX,CAAC;oBACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;wBACzB,SAAS,CAAC,KAAK,CAAC,CAAC;wBACjB,YAAY,GAAG,IAAI,CAAC;wBACpB,MAAM,IAAI,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;wBAC3C,QAAQ,IAAI,CAAC,CAAC;wBACd,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;oBACpB,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,EAAE,CAAC;YAEL,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,11 +1,122 @@
1
+ import type { OwnedAccountStorageMode } from "../../api/account-storage-mode.js";
1
2
  import type { UploadWorkerDeps } from "../workers/upload.js";
2
3
  import type { DownloadWorkerDeps } from "../workers/download.js";
3
4
  import type { SyncStatus } from "../types.js";
5
+ import { type UploadAttemptStore } from "../upload-attempts.js";
4
6
  import { type DeleteScopeResult } from "../workers/delete.js";
7
+ import type { DeltaApplyResult, RegistryChangeDelta } from "../../stream-sync/ports.js";
5
8
  import type { DeleteDataPort, PendingBlobDeletionStore, TombstoneFinalityPort } from "../../ports/index.js";
9
+ import type { LegacyWriteSeal } from "../../storage/legacy-write-seal.js";
10
+ /**
11
+ * A cheap read of "did anything in the owner's registry change?": one request,
12
+ * whatever the number of rows. The marker is opaque and only compared for
13
+ * equality; `null` is an empty registry; `undefined` is "cannot tell" (the
14
+ * gateway sent nothing to compare). A read that throws is a failed probe.
15
+ *
16
+ * The marker is a HINT, not a proof of "nothing changed". It fingerprints one
17
+ * row, so a change that leaves that row alone (two rows stamped in the same
18
+ * millisecond, a lower row changed under an unchanged top row) is invisible to
19
+ * it. A manager therefore uses it only to start a cycle early. It never uses
20
+ * it to skip a cycle. A failed or "cannot tell" probe never starts a cycle by
21
+ * itself (see `requestPull`). What may skip the timer's cycle is the push's
22
+ * position, which the gateway makes exact (see {@link ChangePush}).
23
+ */
24
+ export interface ChangeProbe {
25
+ /**
26
+ * One read. `lifecycle` is the manager's: it aborts on a pause and on a stop,
27
+ * and the read must then end at once (reject, abort its request, clear its
28
+ * timers) whether or not the registry honours the signal.
29
+ */
30
+ read(lifecycle: AbortSignal): Promise<string | null | undefined>;
31
+ /**
32
+ * Period of the timed probe in milliseconds. Signals (`requestPull`) probe
33
+ * at once and do not wait for it. See D4-SYNC-TRIGGERS for how the host
34
+ * derives it from the cost of one idle cycle.
35
+ */
36
+ intervalMs: number;
37
+ /**
38
+ * A server push that tells the manager when to pull. While it is healthy and
39
+ * its position is the one the last clean cycle started under, the timer's
40
+ * cycle and the timed probe are skipped; otherwise nothing differs.
41
+ */
42
+ push?: ChangePush;
43
+ }
44
+ /**
45
+ * A server push that says where the registry is. Its position is the gateway's
46
+ * exact sequence for the owner: it changes whenever anything a client can see
47
+ * changed. A poke can still be lost, doubled or late, and the marker the probe
48
+ * compares fingerprints one row, so neither decides alone.
49
+ *
50
+ * A poke runs a cycle at once. It does not go through the marker comparison,
51
+ * and it does not wait for the probe: a probe that never answers cannot hold
52
+ * it up. A failed attempt is not a poke.
53
+ *
54
+ * The position lets the manager skip work. A cycle reads the registry after
55
+ * the position it started under, so when the push is healthy and its position
56
+ * is still the one the last clean cycle started under, that cycle already
57
+ * holds everything the registry has, and the timer's cycle and the probe would
58
+ * only repeat it. Both resume the moment the push is not healthy, the position
59
+ * moved, or the last cycle was not clean. Every answer of the held request,
60
+ * an empty one at the end of its wait included, carries the current position.
61
+ * An answer whose position moved also says `changed`, so a wake that was lost
62
+ * on the way is found by the next answer: `onChange` runs a cycle at once.
63
+ * `onPosition` only records the position. A moved position that arrives
64
+ * without `onChange` ends the skip, and the next timer tick or probe runs the
65
+ * cycle.
66
+ *
67
+ * A clean cycle threw nothing, was not blocked and left no work behind (see
68
+ * `connectionsOwingWork`). A legacy (unswitched) cycle is never clean: its retries
69
+ * run on the clock, and no position announces them. While the push is healthy
70
+ * and the last cycle was clean, an idle device costs one held request per
71
+ * period. That holds only for what the gateway's position covers: the data
72
+ * rows and the server registration the cycle reads.
73
+ */
74
+ export interface ChangePush {
75
+ /**
76
+ * Start a subscription; the returned function ends it. `onPosition(p)` is
77
+ * the registry's position as of an answer; it comes before the `onChange` of
78
+ * the same answer. `onChange` means the registry's sequence moved since the
79
+ * last answer, or the first answer after a failure came back: run a cycle.
80
+ * Its `delta`, when the gateway sent one, is what changed after the `since`
81
+ * the request carried. Both are called on a successful answer only; a
82
+ * failed attempt calls nothing. `onHealth(true)`: the channel answered
83
+ * lately, so positions can be trusted; `onHealth(false)`: it failed or went
84
+ * quiet, so do not rely on one. `since()` is read as each held request is
85
+ * sent: the position the manager holds the registry up to once its work in
86
+ * flight ends, if any. A pass that has started or is queued counts: the
87
+ * request asks for what follows the position that pass settles at, so a
88
+ * change that lands during it comes back as a delta.
89
+ */
90
+ subscribe(handlers: {
91
+ onChange(delta: RegistryChangeDelta | undefined): void;
92
+ onHealth(healthy: boolean): void;
93
+ onPosition(position: string): void;
94
+ since(): string | undefined;
95
+ }): () => void;
96
+ }
6
97
  export interface SyncManagerOptions {
98
+ /** Personal Server hosts always supply their owner-bound Account mode. */
99
+ accountStorageMode?: Pick<OwnedAccountStorageMode, "read">;
100
+ localSync?: {
101
+ hasPendingPublication?(): Promise<boolean>;
102
+ cycle(scope?: {
103
+ readonly connections: readonly string[];
104
+ }): Promise<unknown>;
105
+ /**
106
+ * Apply a change delta without the cycle's registry reads, when it can
107
+ * (`applyRegistryDelta`).
108
+ */
109
+ applyDelta(delta: RegistryChangeDelta): Promise<DeltaApplyResult>;
110
+ };
7
111
  /** Polling interval in milliseconds (default: 60_000 = 1 minute) */
8
112
  pollInterval?: number;
113
+ /**
114
+ * Starts a cycle when the registry changed, between the timer's cycles. The
115
+ * timer's cycle is never gated on the marker: a probe that fails or misses a
116
+ * change (see {@link ChangeProbe}) costs at most one poll interval. Only a
117
+ * healthy push whose position has not moved lets the timer skip.
118
+ */
119
+ changeProbe?: ChangeProbe;
9
120
  /** Max upload batch size per cycle (default: 50) */
10
121
  uploadBatchSize?: number;
11
122
  /** Debounce for immediate sync after local ingest (default: 500ms) */
@@ -17,6 +128,13 @@ export interface SyncManagerOptions {
17
128
  * `deleteScope` is local-only and reports `durable: false`.
18
129
  */
19
130
  deleteData?: DeleteDataPort | null;
131
+ /**
132
+ * Durable host storage for upload-attempt markers. With it, an upload that
133
+ * kills the process is counted across restarts and host rebuilds, and the
134
+ * entry is quarantined after repeated crashes. Without it the markers live
135
+ * in memory and protect nothing across a restart.
136
+ */
137
+ uploadAttemptStore?: UploadAttemptStore;
20
138
  /** Durable retry marker for blob deletions that failed after the tombstone. */
21
139
  pendingBlobDeletions?: PendingBlobDeletionStore;
22
140
  /**
@@ -28,6 +146,17 @@ export interface SyncManagerOptions {
28
146
  transferMode?: "upload-download" | "download-only";
29
147
  /** Exact owner scopes to hydrate before the first full download cycle. */
30
148
  hydrateScopes?: string[];
149
+ /**
150
+ * A host's whole-file publisher hook (default absent). When `write` is
151
+ * true, each upload cycle runs the publisher after the legacy upload. When
152
+ * it is false or absent, nothing changes. No server config key sets it.
153
+ */
154
+ streamSync?: {
155
+ readonly write: boolean;
156
+ readonly publisher: {
157
+ cycle(): Promise<unknown>;
158
+ };
159
+ } | null;
31
160
  }
32
161
  export type SyncCanRunResult = {
33
162
  ok: true;
@@ -43,19 +172,97 @@ export interface SyncManager {
43
172
  stop(): Promise<void>;
44
173
  /** Trigger an immediate sync cycle (skips wait) */
45
174
  trigger(): Promise<void>;
175
+ /**
176
+ * A signal that remote state may have changed: a tab or window came back, the
177
+ * network returned, a probe period passed. With a `changeProbe`, one cheap
178
+ * registry read decides: a cycle runs only when the registry moved since the
179
+ * last cycle this method ran. Without one, it requests a cycle. Requests
180
+ * coalesce (one probe in flight, one cycle running, one follow-up for any
181
+ * number of requests during it) and never reset the timer. Does nothing
182
+ * while stopped. Rejects when the cycle it ran rejects.
183
+ */
184
+ requestPull(): Promise<void>;
46
185
  /** Get current sync status */
47
186
  getStatus(): SyncStatus;
187
+ /**
188
+ * Calls `listener` with the new `getStatus()` value after each change of it:
189
+ * a cycle starting or ending, a pass finishing, an error, a blocked or
190
+ * unblocked state, scopes hydrated, the pending count moving, the manager
191
+ * starting or stopping. A change is found by comparing the whole status with
192
+ * the last one delivered at each of those points, so a point that changed
193
+ * nothing is silent, and a subscriber is never told twice for one value.
194
+ *
195
+ * Listeners run after the state change, one at a time and never nested: a
196
+ * change made while they run (for instance by a `trigger` they call) is
197
+ * delivered after they return, once, and only if the value still differs. A
198
+ * listener that throws is logged and skipped. `getStatus` only reads, so a
199
+ * listener that calls it cannot cause an event. No timer is involved.
200
+ *
201
+ * A subscription belongs to the subscriber, not to a run: it works before
202
+ * `start`, and `stop` leaves it registered (the stop itself is delivered as
203
+ * `running: false`), so a manager that starts again is heard again. With no
204
+ * subscriber the manager reads nothing extra; the first subscriber's value is
205
+ * the baseline and is not delivered. Returns the unsubscribe.
206
+ *
207
+ * Do not call `trigger` on every event. Each cycle changes `lastSync`, so
208
+ * each cycle ends with an event that would start the next one, and nothing
209
+ * here bounds that loop: delivery is never nested and coalesces events, but
210
+ * it does not stop a listener that always triggers. Trigger only on a change
211
+ * the listener acts on, such as the first `lastSync`.
212
+ *
213
+ * Disposal: the manager does not close with its host. Unsubscribe before the
214
+ * storage or the stream database the status reads is closed (in Lite,
215
+ * before `closeStreamSync`), because a stop, or a cycle that is still ending,
216
+ * can deliver one more event after the host has begun to close.
217
+ */
218
+ subscribeStatus(listener: (status: SyncStatus) => void): () => void;
48
219
  /** Download exact owner scopes without advancing the registry cursor. */
49
220
  hydrateScopes(scopes: string[]): Promise<void>;
221
+ /**
222
+ * Owner retry: lift the quarantine of uploads that crashed the process, for
223
+ * one scope or all. The next cycle attempts them again.
224
+ */
225
+ retryQuarantinedUploads(scope?: string): Promise<void>;
50
226
  /** Signal that new data has been ingested (next cycle picks it up) */
51
227
  notifyNewData(): void;
228
+ /**
229
+ * A run or an import committed its rows: the data is complete, and nothing
230
+ * more is coming that a wait could gather. Starts the cycle now; a cycle in
231
+ * flight runs once more after it. `notifyNewData` instead waits out the
232
+ * debounce, for callers that signal one record at a time.
233
+ */
234
+ notifyRecordsCommitted(): void;
235
+ /**
236
+ * The host says no one is looking (a hidden Web tab). The manager holds no
237
+ * request and no timer until `resume`: it aborts the held push request and
238
+ * clears the push's cooldown, the failure retry, the poll, the probe and the
239
+ * ingest-debounce timers, and forgets the push's health and the failure
240
+ * streak. A cycle already running finishes. Work that came in meanwhile (a
241
+ * follow-up it owes, a local ingest) is remembered, not run. Pulls and
242
+ * signals do nothing while paused; `trigger` still runs. Does nothing when
243
+ * stopped or already paused.
244
+ */
245
+ pause(): void;
246
+ /**
247
+ * The host says someone is looking again. Restarts the timers and starts
248
+ * exactly one push subscription, and runs one cycle if work was owed while
249
+ * paused. A signal that follows (`requestPull`) still does its own probe.
250
+ * Does nothing when stopped or not paused.
251
+ */
252
+ resume(): void;
52
253
  /**
53
254
  * Durable scope deletion: gateway tombstone, then storage blobs, then the
54
255
  * local copy (see workers/delete.ts for why that order is the only safe
55
256
  * one). Resolves with a per-step result; a gateway failure leaves the
56
257
  * local copy in place and is reported as `steps.gateway.status = "failed"`.
258
+ *
259
+ * `within` is the legacy-write seal's `commit`. When given, the delete runs
260
+ * inside it (and a refusal rejects with `LegacyWriteRefusedError` before
261
+ * anything is sent or removed). It is entered AFTER this manager's mutation
262
+ * queue: a sync cycle holds the queue and asks the seal, so the seal must be
263
+ * the innermost lock or a waiting On deadlocks the two.
57
264
  */
58
- deleteScope(scope: string): Promise<DeleteScopeResult>;
265
+ deleteScope(scope: string, within?: LegacyWriteSeal["commit"]): Promise<DeleteScopeResult>;
59
266
  /** Whether the sync manager is currently running */
60
267
  readonly running: boolean;
61
268
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sync-manager.d.ts","sourceRoot":"","sources":["../../../src/sync/engine/sync-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAgC,MAAM,aAAa,CAAC;AAI5E,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EACV,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;IAC7D;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACnC,+EAA+E;IAC/E,oBAAoB,CAAC,EAAE,wBAAwB,CAAC;IAChD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C,4EAA4E;IAC5E,YAAY,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAAC;IACnD,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,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