@ref0/git 0.6.0 → 0.8.0

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 (476) hide show
  1. package/dist/access/namespace.d.mts +2 -0
  2. package/dist/access/private-refs.d.mts +6 -29
  3. package/dist/access/private-refs.mjs +26 -13
  4. package/dist/access/public.d.mts +6 -0
  5. package/dist/access/public.mjs +9 -0
  6. package/dist/auth/access-jwt.d.mts +10 -6
  7. package/dist/auth/access-jwt.mjs +59 -40
  8. package/dist/auth/auth-namespace.d.mts +6 -0
  9. package/dist/auth/auth-namespace.mjs +12 -0
  10. package/dist/auth/auth.d.mts +3 -6
  11. package/dist/auth/auth.mjs +2 -9
  12. package/dist/auth/authorize.mjs +35 -29
  13. package/dist/auth/bridge.mjs +8 -8
  14. package/dist/auth/fences.d.mts +1 -2
  15. package/dist/auth/fences.mjs +1 -1
  16. package/dist/auth/grants.d.mts +0 -1
  17. package/dist/auth/grants.mjs +2 -2
  18. package/dist/auth/host-function.d.mts +1 -7
  19. package/dist/auth/host-function.mjs +51 -42
  20. package/dist/auth/identify.d.mts +0 -1
  21. package/dist/auth/identify.mjs +3 -2
  22. package/dist/auth/namespaces.d.mts +2 -2
  23. package/dist/auth/policy.d.mts +7 -4
  24. package/dist/auth/policy.mjs +13 -10
  25. package/dist/auth/token-rows.mjs +3 -6
  26. package/dist/auth/tokens-layer.d.mts +40 -0
  27. package/dist/auth/tokens-layer.mjs +29 -0
  28. package/dist/auth/tokens-namespace.d.mts +2 -0
  29. package/dist/auth/tokens-public.d.mts +6 -0
  30. package/dist/auth/tokens-public.mjs +31 -0
  31. package/dist/auth/tokens.d.mts +19 -7
  32. package/dist/auth/tokens.mjs +12 -6
  33. package/dist/auth.d.mts +2 -2
  34. package/dist/auth.mjs +2 -2
  35. package/dist/client/client.d.mts +22 -15
  36. package/dist/client/client.mjs +31 -27
  37. package/dist/client/git-http.mjs +23 -6
  38. package/dist/client/local.mjs +5 -4
  39. package/dist/client/namespace.d.mts +2 -0
  40. package/dist/client/push-upload.d.mts +1 -0
  41. package/dist/client/push-upload.mjs +169 -2
  42. package/dist/client/remote-helper.mjs +5 -12
  43. package/dist/client/remote.mjs +63 -22
  44. package/dist/client/run-remote-helper.d.mts +1 -1
  45. package/dist/client/run-remote-helper.mjs +6 -6
  46. package/dist/client/slice-push.d.mts +1 -1
  47. package/dist/client/transport.mjs +26 -19
  48. package/dist/contracts/access.d.mts +18 -10
  49. package/dist/contracts/access.mjs +17 -0
  50. package/dist/contracts/actors.d.mts +73 -28
  51. package/dist/contracts/actors.mjs +45 -2
  52. package/dist/contracts/authorize.d.mts +26 -17
  53. package/dist/contracts/blobs.d.mts +1 -1
  54. package/dist/contracts/blobs.mjs +1 -1
  55. package/dist/contracts/callers.mjs +40 -0
  56. package/dist/contracts/calls-spent.d.mts +6 -4
  57. package/dist/contracts/calls-spent.mjs +10 -8
  58. package/dist/contracts/client.d.mts +16 -9
  59. package/dist/contracts/commits.d.mts +2 -2
  60. package/dist/contracts/commits.mjs +1 -1
  61. package/dist/contracts/engine.d.mts +1 -1
  62. package/dist/contracts/events.d.mts +45 -32
  63. package/dist/contracts/events.mjs +21 -10
  64. package/dist/contracts/files.d.mts +44 -44
  65. package/dist/contracts/files.mjs +1 -1
  66. package/dist/contracts/forks.d.mts +34 -58
  67. package/dist/contracts/forks.mjs +1 -1
  68. package/dist/contracts/git-events.d.mts +50 -0
  69. package/dist/contracts/git-events.mjs +23 -0
  70. package/dist/contracts/git-hooks.d.mts +254 -0
  71. package/dist/contracts/git-hooks.mjs +12 -0
  72. package/dist/contracts/git.d.mts +93 -42
  73. package/dist/contracts/git.mjs +6 -5
  74. package/dist/contracts/grants.d.mts +46 -27
  75. package/dist/contracts/ids.d.mts +16 -0
  76. package/dist/contracts/ids.mjs +19 -4
  77. package/dist/contracts/lfs.d.mts +19 -4
  78. package/dist/contracts/merges.d.mts +7 -7
  79. package/dist/contracts/namespaces.d.mts +2 -2
  80. package/dist/contracts/objects.d.mts +21 -5
  81. package/dist/contracts/opaque.mjs +27 -0
  82. package/dist/contracts/operations.d.mts +301 -101
  83. package/dist/contracts/operations.mjs +209 -0
  84. package/dist/contracts/promises.d.mts +2 -0
  85. package/dist/contracts/push-uploads.d.mts +4 -1
  86. package/dist/contracts/push-uploads.mjs +9 -4
  87. package/dist/contracts/queue.d.mts +220 -49
  88. package/dist/contracts/queue.mjs +68 -6
  89. package/dist/contracts/refs.d.mts +30 -8
  90. package/dist/contracts/refs.mjs +1 -1
  91. package/dist/contracts/remote.d.mts +53 -23
  92. package/dist/contracts/remote.mjs +22 -0
  93. package/dist/contracts/repo-records.d.mts +2 -2
  94. package/dist/contracts/repos.d.mts +100 -82
  95. package/dist/contracts/repos.mjs +47 -8
  96. package/dist/contracts/result.d.mts +73 -41
  97. package/dist/contracts/result.mjs +74 -17
  98. package/dist/contracts/rules.d.mts +734 -68
  99. package/dist/contracts/rules.mjs +84 -1
  100. package/dist/contracts/server.d.mts +20 -206
  101. package/dist/contracts/services.d.mts +1 -10
  102. package/dist/contracts/services.mjs +1 -5
  103. package/dist/contracts/signin.d.mts +140 -43
  104. package/dist/contracts/signin.mjs +36 -3
  105. package/dist/contracts/store.d.mts +1 -1
  106. package/dist/contracts/sync.d.mts +109 -90
  107. package/dist/contracts/sync.mjs +34 -7
  108. package/dist/contracts/tags.d.mts +1 -1
  109. package/dist/contracts/tags.mjs +1 -1
  110. package/dist/contracts/tokens.d.mts +247 -60
  111. package/dist/contracts/tokens.mjs +93 -21
  112. package/dist/contracts/topics.d.mts +59 -20
  113. package/dist/contracts/topics.mjs +14 -5
  114. package/dist/contracts/trees.d.mts +2 -2
  115. package/dist/contracts/trees.mjs +1 -1
  116. package/dist/contracts/work.d.mts +2 -2
  117. package/dist/contracts/work.mjs +2 -2
  118. package/dist/core/access.d.mts +10 -12
  119. package/dist/core/access.mjs +45 -11
  120. package/dist/core/clock.mjs +1 -1
  121. package/dist/core/events/deliver.d.mts +3 -2
  122. package/dist/core/events/deliver.mjs +188 -92
  123. package/dist/core/forks.mjs +78 -34
  124. package/dist/core/hooks/groups.d.mts +26 -0
  125. package/dist/core/hooks/groups.mjs +73 -0
  126. package/dist/core/hooks/namespace.d.mts +2 -0
  127. package/dist/core/hooks/order.d.mts +2 -2
  128. package/dist/core/hooks/order.mjs +6 -6
  129. package/dist/core/hooks/public.d.mts +7 -0
  130. package/dist/core/hooks/public.mjs +5 -0
  131. package/dist/core/imports.mjs +94 -10
  132. package/dist/core/index-job.mjs +11 -8
  133. package/dist/core/loose-tally.mjs +46 -0
  134. package/dist/core/merge-parts.d.mts +1 -1
  135. package/dist/core/merge-parts.mjs +1 -1
  136. package/dist/core/mirror-rows.mjs +18 -0
  137. package/dist/core/names.mjs +1 -1
  138. package/dist/core/namespaces.d.mts +2 -1
  139. package/dist/core/objects/commit-writes.mjs +5 -5
  140. package/dist/core/objects/merges.mjs +1 -1
  141. package/dist/core/objects/objects-layer.mjs +1 -1
  142. package/dist/core/objects/reading.mjs +52 -7
  143. package/dist/core/objects/tree-edits.mjs +13 -28
  144. package/dist/core/objects/trees.mjs +4 -4
  145. package/dist/core/objects/writing.mjs +4 -3
  146. package/dist/core/own-writes.mjs +1 -1
  147. package/dist/core/parts.d.mts +22 -3
  148. package/dist/core/parts.mjs +5 -3
  149. package/dist/core/promise.mjs +23 -17
  150. package/dist/core/purge.d.mts +2 -2
  151. package/dist/core/purge.mjs +89 -34
  152. package/dist/core/push.mjs +67 -79
  153. package/dist/core/receipts.d.mts +2 -2
  154. package/dist/core/receipts.mjs +28 -4
  155. package/dist/core/ref-index-job.mjs +4 -4
  156. package/dist/core/ref-view.mjs +16 -8
  157. package/dist/core/refs.mjs +41 -10
  158. package/dist/core/registered-records.mjs +30 -0
  159. package/dist/core/{claim-rows.mjs → registered-rows.mjs} +6 -6
  160. package/dist/core/repack.d.mts +2 -2
  161. package/dist/core/repack.mjs +30 -23
  162. package/dist/core/repo-info.mjs +62 -26
  163. package/dist/core/repos.mjs +18 -11
  164. package/dist/core/rules/changes.mjs +2 -2
  165. package/dist/core/rules/check.mjs +10 -10
  166. package/dist/core/rules/commit-changes.mjs +1 -1
  167. package/dist/core/rules/context.d.mts +7 -6
  168. package/dist/core/rules/context.mjs +18 -16
  169. package/dist/core/rules/fetch.mjs +78 -31
  170. package/dist/core/saved-caller-views.d.mts +72 -0
  171. package/dist/core/saved-caller-views.mjs +123 -0
  172. package/dist/core/saved-callers-public.d.mts +5 -0
  173. package/dist/core/saved-callers-public.mjs +10 -0
  174. package/dist/core/saved-callers.mjs +95 -0
  175. package/dist/core/seam.d.mts +12 -1
  176. package/dist/core/seam.mjs +4 -2
  177. package/dist/core/tokens.mjs +7 -2
  178. package/dist/core/view.d.mts +1 -1
  179. package/dist/core/view.mjs +1 -1
  180. package/dist/core/work.mjs +6 -5
  181. package/dist/effect.d.mts +2 -4
  182. package/dist/effect.mjs +2 -4
  183. package/dist/engine/commits.mjs +19 -47
  184. package/dist/engine/content.d.mts +2 -2
  185. package/dist/engine/content.mjs +1 -1
  186. package/dist/engine/diff.mjs +2 -2
  187. package/dist/engine/failures.d.mts +1 -2
  188. package/dist/engine/failures.mjs +1 -3
  189. package/dist/engine/merge-base-walk.mjs +57 -142
  190. package/dist/engine/merge-bases.mjs +5 -5
  191. package/dist/engine/merge-renames.mjs +1 -1
  192. package/dist/engine/merge.mjs +16 -14
  193. package/dist/engine/reads.d.mts +2 -2
  194. package/dist/engine/reads.mjs +1 -1
  195. package/dist/engine/xdiff.d.mts +1 -1
  196. package/dist/engine/xdiff.mjs +2 -2
  197. package/dist/event-streams/event-streams.d.mts +6 -2
  198. package/dist/event-streams/event-streams.mjs +6 -2
  199. package/dist/event-streams/stream.mjs +5 -2
  200. package/dist/extend.d.mts +2 -3
  201. package/dist/extend.mjs +2 -2
  202. package/dist/http/answers.mjs +4 -3
  203. package/dist/http/core-parts.mjs +3 -4
  204. package/dist/http/handler.mjs +12 -32
  205. package/dist/http/parts.d.mts +1 -1
  206. package/dist/http/push-uploads.mjs +7 -5
  207. package/dist/http/receive-pack.mjs +3 -3
  208. package/dist/http/upload-pack.mjs +6 -5
  209. package/dist/index.d.mts +44 -24
  210. package/dist/index.mjs +17 -8
  211. package/dist/lfs/base.d.mts +8 -5
  212. package/dist/lfs/base.mjs +2 -1
  213. package/dist/lfs/calls.mjs +3 -2
  214. package/dist/lfs/layer.d.mts +9 -7
  215. package/dist/lfs/layer.mjs +37 -22
  216. package/dist/lfs/locks.mjs +3 -3
  217. package/dist/lfs/objects.d.mts +3 -2
  218. package/dist/lfs/objects.mjs +235 -71
  219. package/dist/lfs/pointers.mjs +70 -19
  220. package/dist/lfs/purge.mjs +7 -3
  221. package/dist/lfs/rows.mjs +25 -8
  222. package/dist/lfs/service.d.mts +6 -3
  223. package/dist/lfs/service.mjs +8 -2
  224. package/dist/lfs/upkeep.mjs +53 -31
  225. package/dist/lfs/upload-most.mjs +41 -0
  226. package/dist/lfs/uploaded.mjs +59 -0
  227. package/dist/lfs/wire.mjs +1 -1
  228. package/dist/protocol/bytes/buffers.d.mts +1 -1
  229. package/dist/protocol/bytes/buffers.mjs +1 -1
  230. package/dist/protocol/bytes/deflate.d.mts +1 -1
  231. package/dist/protocol/bytes/deflate.mjs +1 -1
  232. package/dist/protocol/bytes/hmac-sha256.mjs +3 -6
  233. package/dist/protocol/bytes/inflate.d.mts +1 -1
  234. package/dist/protocol/bytes/inflate.mjs +1 -1
  235. package/dist/protocol/bytes/sha1.d.mts +1 -1
  236. package/dist/protocol/bytes/sha1.mjs +2 -2
  237. package/dist/protocol/bytes/sha256-hasher.mjs +51 -0
  238. package/dist/protocol/bytes/text.mjs +6 -1
  239. package/dist/protocol/diff/read.d.mts +1 -1
  240. package/dist/protocol/diff/read.mjs +1 -1
  241. package/dist/protocol/diff/tree-diff.d.mts +1 -1
  242. package/dist/protocol/diff/tree-diff.mjs +11 -11
  243. package/dist/protocol/objects/fsck.mjs +6 -3
  244. package/dist/protocol/objects/lfs-pointer.mjs +6 -1
  245. package/dist/protocol/objects/tag.mjs +1 -1
  246. package/dist/protocol/objects/tree.mjs +1 -1
  247. package/dist/protocol/packs/graph.mjs +1 -1
  248. package/dist/protocol/packs/idx.d.mts +1 -1
  249. package/dist/protocol/packs/idx.mjs +1 -1
  250. package/dist/protocol/packs/parts.mjs +1 -1
  251. package/dist/protocol/packs/reader.d.mts +1 -1
  252. package/dist/protocol/packs/reader.mjs +2 -2
  253. package/dist/protocol/packs/write-error.d.mts +1 -1
  254. package/dist/protocol/packs/write-error.mjs +1 -1
  255. package/dist/protocol/packs/writer.mjs +4 -4
  256. package/dist/protocol/wire/advertisement.d.mts +1 -1
  257. package/dist/protocol/wire/advertisement.mjs +1 -1
  258. package/dist/protocol/wire/fetch.d.mts +1 -1
  259. package/dist/protocol/wire/fetch.mjs +1 -1
  260. package/dist/protocol/wire/lines.d.mts +1 -1
  261. package/dist/protocol/wire/lines.mjs +2 -2
  262. package/dist/protocol/wire/push-uploads.mjs +4 -2
  263. package/dist/protocol/wire/receive-pack.d.mts +1 -1
  264. package/dist/protocol/wire/receive-pack.mjs +1 -1
  265. package/dist/protocol/wire/report-status.d.mts +1 -1
  266. package/dist/protocol/wire/report-status.mjs +1 -1
  267. package/dist/protocol/wire/v2.d.mts +2 -2
  268. package/dist/protocol/wire/v2.mjs +2 -2
  269. package/dist/queue/advance.mjs +190 -68
  270. package/dist/queue/callers.mjs +56 -69
  271. package/dist/queue/calls.mjs +10 -11
  272. package/dist/queue/commit.mjs +28 -22
  273. package/dist/queue/host.d.mts +10 -11
  274. package/dist/queue/host.mjs +15 -7
  275. package/dist/queue/lanes.mjs +9 -18
  276. package/dist/queue/layer.d.mts +3 -3
  277. package/dist/queue/layer.mjs +11 -10
  278. package/dist/queue/limits.mjs +17 -5
  279. package/dist/queue/rows.mjs +13 -10
  280. package/dist/queue/schedule.mjs +7 -6
  281. package/dist/queue/search.mjs +11 -17
  282. package/dist/queue/state.mjs +7 -2
  283. package/dist/queue/trim.mjs +10 -5
  284. package/dist/rest/api.d.mts +1 -1
  285. package/dist/rest/blobs.d.mts +20 -20
  286. package/dist/rest/caller.d.mts +22 -20
  287. package/dist/rest/client-namespace.d.mts +2 -0
  288. package/dist/rest/client.d.mts +32 -8
  289. package/dist/rest/client.mjs +314 -388
  290. package/dist/rest/commits.d.mts +284 -284
  291. package/dist/rest/errors.d.mts +10 -10
  292. package/dist/rest/errors.mjs +1 -1
  293. package/dist/rest/events.d.mts +13 -11
  294. package/dist/rest/events.mjs +3 -1
  295. package/dist/rest/files.d.mts +48 -48
  296. package/dist/rest/forks.d.mts +131 -143
  297. package/dist/rest/handler.mjs +4 -3
  298. package/dist/rest/handlers.mjs +15 -8
  299. package/dist/rest/layer.d.mts +3 -3
  300. package/dist/rest/layer.mjs +8 -7
  301. package/dist/rest/listen.d.mts +8 -6
  302. package/dist/rest/listen.mjs +33 -77
  303. package/dist/rest/me.d.mts +18 -20
  304. package/dist/rest/me.mjs +1 -1
  305. package/dist/rest/merges.d.mts +17 -17
  306. package/dist/rest/queue.d.mts +140 -140
  307. package/dist/rest/queue.mjs +1 -1
  308. package/dist/rest/refs.d.mts +214 -214
  309. package/dist/rest/refs.mjs +1 -1
  310. package/dist/rest/repos.d.mts +123 -135
  311. package/dist/rest/tags.d.mts +30 -30
  312. package/dist/rest/tokens.d.mts +250 -260
  313. package/dist/rest/tokens.mjs +10 -42
  314. package/dist/rest/topics.d.mts +162 -162
  315. package/dist/rest/topics.mjs +1 -1
  316. package/dist/rest/trees.d.mts +117 -117
  317. package/dist/rest/wire.d.mts +7 -5
  318. package/dist/rest/wire.mjs +4 -3
  319. package/dist/rest/work.d.mts +69 -69
  320. package/dist/rest/work.mjs +1 -1
  321. package/dist/rest.d.mts +1 -7
  322. package/dist/rest.mjs +1 -5
  323. package/dist/server/check-fetch.mjs +9 -0
  324. package/dist/server/extension.mjs +3 -115
  325. package/dist/server/git-layer.d.mts +30 -5
  326. package/dist/server/git-layer.mjs +59 -29
  327. package/dist/server/git-namespace.d.mts +4 -4
  328. package/dist/server/git-namespace.mjs +6 -4
  329. package/dist/server/joined.d.mts +83 -0
  330. package/dist/server/joined.mjs +91 -0
  331. package/dist/server/registry.d.mts +7 -3
  332. package/dist/server/registry.mjs +135 -31
  333. package/dist/server/server.d.mts +9 -3
  334. package/dist/server/server.mjs +277 -208
  335. package/dist/signin/context.d.mts +2 -2
  336. package/dist/signin/context.mjs +28 -37
  337. package/dist/signin/device.mjs +5 -5
  338. package/dist/signin/forms.mjs +1 -1
  339. package/dist/signin/grants.d.mts +2 -3
  340. package/dist/signin/grants.mjs +5 -5
  341. package/dist/signin/layer.d.mts +9 -0
  342. package/dist/signin/layer.mjs +41 -0
  343. package/dist/signin/namespace.d.mts +2 -0
  344. package/dist/signin/public.d.mts +6 -0
  345. package/dist/signin/public.mjs +5 -0
  346. package/dist/signin/route.mjs +47 -21
  347. package/dist/signin/web.mjs +3 -3
  348. package/dist/signin/wire.mjs +1 -1
  349. package/dist/storage/calls.d.mts +1 -1
  350. package/dist/storage/calls.mjs +4 -4
  351. package/dist/storage/clean-up.mjs +15 -6
  352. package/dist/storage/counted-bucket.mjs +34 -51
  353. package/dist/storage/fetch.mjs +1 -1
  354. package/dist/storage/fsck.mjs +12 -2
  355. package/dist/storage/graph-rebuild.mjs +262 -0
  356. package/dist/storage/host-bucket.mjs +1 -1
  357. package/dist/storage/index-build.d.mts +2 -2
  358. package/dist/storage/index-build.mjs +103 -15
  359. package/dist/storage/index-fetch.mjs +10 -6
  360. package/dist/storage/index-graph.mjs +1 -1
  361. package/dist/storage/index-layers.mjs +1 -1
  362. package/dist/storage/index-visible.mjs +1 -1
  363. package/dist/storage/lfs-pointers.d.mts +5 -5
  364. package/dist/storage/lfs-pointers.mjs +37 -11
  365. package/dist/storage/loose.mjs +4 -1
  366. package/dist/storage/memory-budget.mjs +8 -2
  367. package/dist/storage/merge-cut.mjs +24 -1
  368. package/dist/storage/merge-fence.mjs +82 -20
  369. package/dist/storage/merge-most.mjs +1 -0
  370. package/dist/storage/merge-plan.mjs +5 -2
  371. package/dist/storage/merge-row.mjs +17 -5
  372. package/dist/storage/merge-stream.mjs +25 -13
  373. package/dist/storage/merge-write.mjs +1 -1
  374. package/dist/storage/merge.d.mts +2 -2
  375. package/dist/storage/merge.mjs +1 -1
  376. package/dist/storage/object-rows.d.mts +2 -2
  377. package/dist/storage/object-rows.mjs +20 -4
  378. package/dist/storage/pack-ranges.d.mts +3 -1
  379. package/dist/storage/pack-ranges.mjs +168 -69
  380. package/dist/storage/pack-reads.mjs +4 -4
  381. package/dist/storage/pack-receive.d.mts +1 -1
  382. package/dist/storage/pack-receive.mjs +17 -15
  383. package/dist/storage/packs.d.mts +1 -1
  384. package/dist/storage/packs.mjs +103 -79
  385. package/dist/storage/placed-reads.mjs +81 -15
  386. package/dist/storage/prune-seen.mjs +126 -0
  387. package/dist/storage/prune-walk.mjs +87 -99
  388. package/dist/storage/prune.mjs +113 -50
  389. package/dist/storage/push-uploads.mjs +4 -2
  390. package/dist/storage/quarantine.d.mts +2 -2
  391. package/dist/storage/ready.d.mts +2 -2
  392. package/dist/storage/ready.mjs +15 -6
  393. package/dist/storage/receive-files.mjs +1 -1
  394. package/dist/storage/receive-links.mjs +1 -1
  395. package/dist/storage/receive-state.d.mts +2 -2
  396. package/dist/storage/receive-state.mjs +2 -2
  397. package/dist/storage/receive-steps.mjs +1 -1
  398. package/dist/storage/repack-contained.mjs +24 -16
  399. package/dist/storage/repack-job.d.mts +2 -2
  400. package/dist/storage/repack-job.mjs +5 -4
  401. package/dist/storage/repack.d.mts +2 -2
  402. package/dist/storage/repack.mjs +12 -5
  403. package/dist/storage/rows.d.mts +2 -2
  404. package/dist/storage/rows.mjs +1 -1
  405. package/dist/storage/runs.d.mts +2 -2
  406. package/dist/storage/runs.mjs +15 -6
  407. package/dist/storage/send-list.mjs +6 -6
  408. package/dist/storage/single-flight.mjs +2 -2
  409. package/dist/storage/swap-walk.mjs +1 -1
  410. package/dist/storage/unpack.mjs +8 -1
  411. package/dist/store/call-count.d.mts +24 -4
  412. package/dist/store/call-count.mjs +158 -44
  413. package/dist/store/catalogue.d.mts +1 -1
  414. package/dist/store/catalogue.mjs +2 -2
  415. package/dist/store/crossing.mjs +2 -6
  416. package/dist/store/cursor-seal.mjs +1 -1
  417. package/dist/store/errors.d.mts +7 -3
  418. package/dist/store/errors.mjs +41 -13
  419. package/dist/store/job-try.mjs +119 -15
  420. package/dist/store/list-job.mjs +5 -5
  421. package/dist/store/outbox.d.mts +2 -2
  422. package/dist/store/outbox.mjs +75 -16
  423. package/dist/store/promises.d.mts +2 -2
  424. package/dist/store/promises.mjs +31 -6
  425. package/dist/store/queue-jobs.mjs +1 -1
  426. package/dist/store/records.d.mts +2 -2
  427. package/dist/store/records.mjs +22 -24
  428. package/dist/store/ref-rows.d.mts +2 -2
  429. package/dist/store/ref-rows.mjs +6 -6
  430. package/dist/store/repo-record.mjs +29 -12
  431. package/dist/store/reservations.mjs +35 -8
  432. package/dist/store/scopes.mjs +12 -5
  433. package/dist/store/topic-jobs.mjs +8 -8
  434. package/dist/sync/bound.d.mts +1 -3
  435. package/dist/sync/bound.mjs +30 -42
  436. package/dist/sync/github.d.mts +5 -6
  437. package/dist/sync/github.mjs +37 -42
  438. package/dist/sync/http.mjs +15 -0
  439. package/dist/sync/import.mjs +30 -19
  440. package/dist/sync/layer.d.mts +13 -0
  441. package/dist/sync/layer.mjs +73 -0
  442. package/dist/sync/mirror.mjs +137 -58
  443. package/dist/sync/publish.mjs +3 -6
  444. package/dist/sync/step.mjs +223 -85
  445. package/dist/sync/tries.mjs +22 -15
  446. package/dist/sync.d.mts +3 -6
  447. package/dist/sync.mjs +3 -6
  448. package/dist/topics/advance.mjs +210 -94
  449. package/dist/topics/calls.mjs +8 -8
  450. package/dist/topics/directory.mjs +35 -12
  451. package/dist/topics/host.d.mts +5 -8
  452. package/dist/topics/host.mjs +42 -19
  453. package/dist/topics/layer.d.mts +381 -0
  454. package/dist/topics/layer.mjs +62 -0
  455. package/dist/topics/members.mjs +39 -10
  456. package/dist/topics/namespace.d.mts +2 -0
  457. package/dist/topics/public.d.mts +6 -0
  458. package/dist/topics/public.mjs +13 -0
  459. package/dist/topics/rows.mjs +12 -3
  460. package/dist/topics/topic.mjs +11 -10
  461. package/package.json +8 -13
  462. package/dist/access.d.mts +0 -2
  463. package/dist/access.mjs +0 -1
  464. package/dist/core/hooks/post-receive.mjs +0 -216
  465. package/dist/core/hooks/pre-receive.d.mts +0 -12
  466. package/dist/core/hooks/pre-receive.mjs +0 -36
  467. package/dist/engine/merge-base-walk.d.mts +0 -3
  468. package/dist/server/extension.d.mts +0 -21
  469. package/dist/server/routes.d.mts +0 -32
  470. package/dist/server/routes.mjs +0 -69
  471. package/dist/sync/import.d.mts +0 -10
  472. package/dist/sync/jobs.d.mts +0 -9
  473. package/dist/sync/jobs.mjs +0 -75
  474. package/dist/sync/mirror.d.mts +0 -13
  475. package/dist/sync/publish.d.mts +0 -6
  476. /package/dist/core/{claim-rows.d.mts → registered-rows.d.mts} +0 -0
@@ -1,10 +1,8 @@
1
- import { SavedHandlerOptions } from "./handlers.mjs";
2
- import { Awaitable } from "./result.mjs";
3
- import { JobInput } from "@ref0/infra";
4
1
  import * as Schema from "effect/Schema";
2
+ import { JobInput } from "@ref0/infra";
5
3
  import * as Context from "effect/Context";
6
4
  declare namespace events_d_exports {
7
- export { BeforeAfter, CandidateClosed, CandidateClosedFields, CandidateOpened, CandidateReported, EntryAdded, EntryFailed, EntryMerged, EntryPinned, EntryRemoved, EntryRetried, EventDelivery, EventEnvelope, EventFeature, EventLog, Events, EventsHandler, EventsInput, EventsService, FeedItem, FenceReason, FencedPack, GitEvent, HoldEvent, HoldEventFields, IndexRefusal, QueueEvent, QueueRestarted, RefPush, RefUpdated, RepoCreated, RepoDeletedEvent, RepoEnvelope, RepoEvent, RepoIndexRefused, RepoJobFailed, RepoMaintained, RepoRenamed, RepoTokenEvent, RepoVisibilityChanged, RepoWorkFailed, TokenEvent, TokenEventFields, TopicAdded, TopicEnvelope, TopicEvent, TopicFailed, TopicMerged, TopicOpened, TopicRemoved, TopicReported, TopicWorkFailed };
5
+ export { BeforeAfter, CandidateClosed, CandidateClosedFields, CandidateOpened, CandidateReported, EntryAdded, EntryFailed, EntryMerged, EntryPinned, EntryRemoved, EntryRetried, EventEnvelope, EventFeature, EventLog, Events, EventsService, FeedItem, FenceReason, FencedPack, GitEvent, HoldEvent, HoldEventFields, IndexRefusal, QueueEvent, QueueRestarted, RefPush, RefUpdated, RepoCreated, RepoDeletedEvent, RepoEnvelope, RepoEvent, RepoIndexRefused, RepoJobFailed, RepoMaintained, RepoRenamed, RepoTokenEvent, RepoVisibilityChanged, RepoWorkFailed, TokenEvent, TokenEventFields, TopicAdded, TopicEnvelope, TopicEvent, TopicFailed, TopicMerged, TopicOpened, TopicRemoved, TopicReported, TopicWorkFailed, keepsEvents };
8
6
  }
9
7
  /**
10
8
  * What every event carries. `seq` orders a scope's events: a repo's name keeps one sequence
@@ -170,6 +168,12 @@ export declare const RefPush: Schema.Struct<{
170
168
  * options to its server's hooks alone, so the event stream sends every event without them.
171
169
  */
172
170
  readonly options: Schema.optionalKey<Schema.$Array<Schema.String>>;
171
+ /**
172
+ * On a write of `Git.host`'s `refs.update` with `onBehalfOf`: the host's right covered the push,
173
+ * while the event's `actor` is the caller it was for. Never `false`: a caller's own write, and
174
+ * one `actingAs` names, has none.
175
+ */
176
+ readonly onBehalfOf: Schema.optionalKey<Schema.Literal<true>>;
173
177
  }>;
174
178
  export type RefPush = typeof RefPush.Type;
175
179
  /**
@@ -183,6 +187,9 @@ export type RefPush = typeof RefPush.Type;
183
187
  * such as `Rules.protect(main)`, in the order the rules ran.
184
188
  */
185
189
  export declare const RefUpdated: Schema.Struct<{
190
+ readonly ref: Schema.String;
191
+ readonly from: Schema.NullOr<Schema.String>;
192
+ readonly to: Schema.NullOr<Schema.String>;
186
193
  readonly seq: Schema.Int;
187
194
  readonly at: Schema.Number;
188
195
  readonly actor: Schema.optionalKey<Schema.Struct<{
@@ -220,12 +227,15 @@ export declare const RefUpdated: Schema.Struct<{
220
227
  * options to its server's hooks alone, so the event stream sends every event without them.
221
228
  */
222
229
  readonly options: Schema.optionalKey<Schema.$Array<Schema.String>>;
230
+ /**
231
+ * On a write of `Git.host`'s `refs.update` with `onBehalfOf`: the host's right covered the push,
232
+ * while the event's `actor` is the caller it was for. Never `false`: a caller's own write, and
233
+ * one `actingAs` names, has none.
234
+ */
235
+ readonly onBehalfOf: Schema.optionalKey<Schema.Literal<true>>;
223
236
  }>;
224
237
  readonly filesAllowed: Schema.optionalKey<Schema.$Array<Schema.String>>;
225
238
  readonly bypassed: Schema.optionalKey<Schema.$Array<Schema.String>>;
226
- readonly ref: Schema.String;
227
- readonly from: Schema.NullOr<Schema.String>;
228
- readonly to: Schema.NullOr<Schema.String>;
229
239
  }>;
230
240
  export type RefUpdated = typeof RefUpdated.Type;
231
241
  export declare const BeforeAfter: Schema.Struct<{
@@ -237,11 +247,12 @@ export type BeforeAfter = typeof BeforeAfter.Type;
237
247
  * Why a geometric merge left a pack out. A fenced pack is left as it is: it stays listed, its
238
248
  * objects read, clone and fetch as before, and nothing is lost. Upkeep never merges it again on its
239
249
  * own while it stays listed, and no prune pass rewrites it, since a pass reads its classes over the
240
- * packs out of the fence and keeps a fenced pack whole. So each reason names what the host can do:
250
+ * packs out of the fence and keeps a fenced pack whole. A fence for calls lifts on its own once a
251
+ * fresh try has more than the one that fenced it. So each reason names what the host can do:
241
252
  * - `open-past-try`: opening a merge of it alone, its choose, its quarantine and its walk's first
242
253
  * reads, takes more calls than a fresh merge try has, about 1.84M objects at R2's charges, fenced
243
- * before the merge reads anything. Raise the host's `callLimits`; a later merge takes the pack
244
- * only once it leaves the listing.
254
+ * before the merge reads anything. Raise the host's `callLimits`, and the next step merges the
255
+ * pack again; one still past the try is fenced again at its calls.
245
256
  * - `entry-past-try`: one of its entries takes more calls to resolve than a merge try has. As for
246
257
  * `open-past-try`.
247
258
  * - `resolve-past-try`: its longest delta chain could take more calls to resolve than a fresh
@@ -249,8 +260,9 @@ export type BeforeAfter = typeof BeforeAfter.Type;
249
260
  * `open-past-try`.
250
261
  * - `graph-length`: its `.graph` reads past the bytes its pack row records, or ends short of them.
251
262
  * - `graph-broken`: its `.graph` is missing or broken, or counts a commit past 4,096 parents, which
252
- * every write refuses. Nothing rebuilds a pack's `.graph` yet: for either `.graph` reason, the
253
- * pack keeps its file as it is.
263
+ * every write refuses. For either `.graph` reason, the next upkeep steps rebuild the file from the
264
+ * pack's commits, a part each step, and then the pack merges again. One whose commits can't be
265
+ * read stays fenced, and no step rebuilds it again.
254
266
  * - `packs-past-most`: the merge would write more than `mergePacksMost` packs, about 418, and this
255
267
  * pack held the step that reached them. A prune that keeps deltas whose bases it drops writes them
256
268
  * whole, so each pack fills a try's calls after a few dozen. The host can do nothing for it yet:
@@ -461,6 +473,9 @@ export declare const RepoEvent: Schema.Union<readonly [Schema.Union<readonly [Sc
461
473
  readonly type: Schema.Literal<"repo.visibility.changed">;
462
474
  readonly public: Schema.Boolean;
463
475
  }>, Schema.Struct<{
476
+ readonly ref: Schema.String;
477
+ readonly from: Schema.NullOr<Schema.String>;
478
+ readonly to: Schema.NullOr<Schema.String>;
464
479
  readonly seq: Schema.Int;
465
480
  readonly at: Schema.Number;
466
481
  readonly actor: Schema.optionalKey<Schema.Struct<{
@@ -498,12 +513,15 @@ export declare const RepoEvent: Schema.Union<readonly [Schema.Union<readonly [Sc
498
513
  * options to its server's hooks alone, so the event stream sends every event without them.
499
514
  */
500
515
  readonly options: Schema.optionalKey<Schema.$Array<Schema.String>>;
516
+ /**
517
+ * On a write of `Git.host`'s `refs.update` with `onBehalfOf`: the host's right covered the push,
518
+ * while the event's `actor` is the caller it was for. Never `false`: a caller's own write, and
519
+ * one `actingAs` names, has none.
520
+ */
521
+ readonly onBehalfOf: Schema.optionalKey<Schema.Literal<true>>;
501
522
  }>;
502
523
  readonly filesAllowed: Schema.optionalKey<Schema.$Array<Schema.String>>;
503
524
  readonly bypassed: Schema.optionalKey<Schema.$Array<Schema.String>>;
504
- readonly ref: Schema.String;
505
- readonly from: Schema.NullOr<Schema.String>;
506
- readonly to: Schema.NullOr<Schema.String>;
507
525
  }>, Schema.Struct<{
508
526
  readonly seq: Schema.Int;
509
527
  readonly at: Schema.Number;
@@ -573,7 +591,7 @@ export declare const TokenEventFields: Schema.Struct<{
573
591
  }>>;
574
592
  readonly type: Schema.Literals<readonly ["token.created", "token.revoked"]>;
575
593
  readonly token: Schema.String;
576
- readonly scope: Schema.Literals<readonly ["read", "report", "write"]>;
594
+ readonly scope: Schema.Literals<readonly ["read", "report", "write", "admin"]>;
577
595
  readonly subject: Schema.Struct<{
578
596
  readonly id: Schema.String;
579
597
  }>;
@@ -588,7 +606,7 @@ export declare const RepoTokenEvent: Schema.Struct<{
588
606
  }>>;
589
607
  readonly type: Schema.Literals<readonly ["token.created", "token.revoked"]>;
590
608
  readonly token: Schema.String;
591
- readonly scope: Schema.Literals<readonly ["read", "report", "write"]>;
609
+ readonly scope: Schema.Literals<readonly ["read", "report", "write", "admin"]>;
592
610
  readonly subject: Schema.Struct<{
593
611
  readonly id: Schema.String;
594
612
  }>;
@@ -606,7 +624,7 @@ export declare const TokenEvent: Schema.Union<readonly [Schema.Struct<{
606
624
  }>>;
607
625
  readonly type: Schema.Literals<readonly ["token.created", "token.revoked"]>;
608
626
  readonly token: Schema.String;
609
- readonly scope: Schema.Literals<readonly ["read", "report", "write"]>;
627
+ readonly scope: Schema.Literals<readonly ["read", "report", "write", "admin"]>;
610
628
  readonly subject: Schema.Struct<{
611
629
  readonly id: Schema.String;
612
630
  }>;
@@ -621,7 +639,7 @@ export declare const TokenEvent: Schema.Union<readonly [Schema.Struct<{
621
639
  }>>;
622
640
  readonly type: Schema.Literals<readonly ["token.created", "token.revoked"]>;
623
641
  readonly token: Schema.String;
624
- readonly scope: Schema.Literals<readonly ["read", "report", "write"]>;
642
+ readonly scope: Schema.Literals<readonly ["read", "report", "write", "admin"]>;
625
643
  readonly subject: Schema.Struct<{
626
644
  readonly id: Schema.String;
627
645
  }>;
@@ -669,7 +687,7 @@ export declare const EntryMerged: Schema.Struct<{
669
687
  readonly commit: Schema.String;
670
688
  }>;
671
689
  export type EntryMerged = typeof EntryMerged.Type;
672
- /** `error`: for `host-error`, the failure's ID, which `onError` got too. */
690
+ /** `error`: for `host-error`, the failure's ID, which the host's log line names too. */
673
691
  export declare const EntryFailed: Schema.Struct<{
674
692
  readonly seq: Schema.Int;
675
693
  readonly at: Schema.Number;
@@ -686,7 +704,7 @@ export declare const EntryFailed: Schema.Struct<{
686
704
  readonly url: Schema.optionalKey<Schema.String>;
687
705
  readonly type: Schema.Literal<"queue.entry.failed">;
688
706
  readonly entry: Schema.String;
689
- readonly reason: Schema.Literals<readonly ["conflict", "reported", "host-error", "interaction", "refused"]>;
707
+ readonly reason: Schema.Literals<readonly ["conflict", "reported", "host-error", "interaction", "refused", "tooManyCommits"]>;
690
708
  readonly candidate: Schema.optionalKey<Schema.String>;
691
709
  readonly error: Schema.optionalKey<Schema.String>;
692
710
  }>;
@@ -970,7 +988,7 @@ export declare const QueueEvent: Schema.Union<readonly [Schema.Struct<{
970
988
  readonly url: Schema.optionalKey<Schema.String>;
971
989
  readonly type: Schema.Literal<"queue.entry.failed">;
972
990
  readonly entry: Schema.String;
973
- readonly reason: Schema.Literals<readonly ["conflict", "reported", "host-error", "interaction", "refused"]>;
991
+ readonly reason: Schema.Literals<readonly ["conflict", "reported", "host-error", "interaction", "refused", "tooManyCommits"]>;
974
992
  readonly candidate: Schema.optionalKey<Schema.String>;
975
993
  readonly error: Schema.optionalKey<Schema.String>;
976
994
  }>, Schema.Struct<{
@@ -1433,15 +1451,6 @@ export type EventFeature = 'queue' | 'topics' | 'tokens';
1433
1451
  * server has is chosen where it's built, and each member is a Schema above.
1434
1452
  */
1435
1453
  export type GitEvent<Enabled extends EventFeature = EventFeature> = RepoEvent | ('queue' extends Enabled ? QueueEvent : never) | ('topics' extends Enabled ? TopicEvent : never) | ('tokens' extends Enabled ? TokenEvent : never);
1436
- /** One batch: up to 100 of one scope's events, in `seq` order. `attempt` is 1 on a first try. */
1437
- export interface EventsInput<Event extends GitEvent = GitEvent> {
1438
- readonly events: readonly Event[];
1439
- readonly attempt: number;
1440
- readonly signal: AbortSignal;
1441
- }
1442
- /** Delivers a batch whole, or throws, and the whole batch is sent again. */
1443
- export type EventsHandler<Event extends GitEvent = GitEvent> = (input: EventsInput<Event>) => Awaitable<void>;
1444
- export interface EventDelivery extends SavedHandlerOptions<EventsHandler> {}
1445
1454
  /**
1446
1455
  * What a repo's event stream gives, one at a time: a batch of events in `seq` order, a heartbeat
1447
1456
  * once 9 seconds pass with none, or `gap`, the last, when the store keeps no events after
@@ -1459,12 +1468,16 @@ export type FeedItem = {
1459
1468
  /**
1460
1469
  * How a server writes events: `deliverJobs` are the scope's job of each delivery, its
1461
1470
  * `git.deliver.<name>`, due now, saved with each write that adds events, and `deliveries` their
1462
- * names. A server whose host passed no `events` has none, and writes no events.
1471
+ * names. A server with no delivery has none, and writes no events, as `keepsEvents` says. With
1472
+ * one, a write adds every event it makes, whatever type, since every server serves feeds and a
1473
+ * feed shows each (#1966, #2124).
1463
1474
  */
1464
1475
  export interface EventLog {
1465
1476
  readonly deliveries: readonly string[];
1466
1477
  readonly deliverJobs: () => readonly JobInput[];
1467
1478
  }
1479
+ /** Whether `log` keeps events: it has a delivery to hand them to. A write adds none without one. */
1480
+ export declare const keepsEvents: (log: EventLog | undefined) => log is EventLog;
1468
1481
  /** What `Events` holds: core's own log, until the deliveries bring its public members (2a2-D2). */
1469
1482
  export interface EventsService {
1470
1483
  /** @internal How core's writes add events, or none when the host keeps no events. */
@@ -6,8 +6,8 @@ import { RefEdit, RefSource, RefUpdateKind } from "./refs.mjs";
6
6
  import { Moment as Moment$1 } from "./repos.mjs";
7
7
  import { TokenId, TokenScope } from "./tokens.mjs";
8
8
  import { TopicCandidate, TopicEntry, TopicFailure, TopicMergedEntry } from "./topics.mjs";
9
- import { JobRef } from "@ref0/infra";
10
9
  import * as Schema from "effect/Schema";
10
+ import { JobRef } from "@ref0/infra";
11
11
  import * as Context from "effect/Context";
12
12
  // src/contracts/events.ts
13
13
  var events_exports = /* @__PURE__ */ __exportAll({
@@ -54,7 +54,8 @@ var events_exports = /* @__PURE__ */ __exportAll({
54
54
  TopicOpened: () => TopicOpened,
55
55
  TopicRemoved: () => TopicRemoved,
56
56
  TopicReported: () => TopicReported,
57
- TopicWorkFailed: () => TopicWorkFailed
57
+ TopicWorkFailed: () => TopicWorkFailed,
58
+ keepsEvents: () => keepsEvents
58
59
  });
59
60
  /**
60
61
  * What every event carries. `seq` orders a scope's events: a repo's name keeps one sequence
@@ -154,7 +155,13 @@ const RefPush = /* @__PURE__ */ Schema.Struct({
154
155
  * the queue, an import or a fork, has none. Only the host's handler gets them: Git hands push
155
156
  * options to its server's hooks alone, so the event stream sends every event without them.
156
157
  */
157
- options: Schema.optionalKey(Schema.Array(Schema.String))
158
+ options: Schema.optionalKey(Schema.Array(Schema.String)),
159
+ /**
160
+ * On a write of `Git.host`'s `refs.update` with `onBehalfOf`: the host's right covered the push,
161
+ * while the event's `actor` is the caller it was for. Never `false`: a caller's own write, and
162
+ * one `actingAs` names, has none.
163
+ */
164
+ onBehalfOf: Schema.optionalKey(Schema.Literal(true))
158
165
  });
159
166
  /**
160
167
  * Each ref a write moved, with the same `push` as the others that write moved. `kind`: how the ref
@@ -183,11 +190,12 @@ const BeforeAfter = /* @__PURE__ */ Schema.Struct({
183
190
  * Why a geometric merge left a pack out. A fenced pack is left as it is: it stays listed, its
184
191
  * objects read, clone and fetch as before, and nothing is lost. Upkeep never merges it again on its
185
192
  * own while it stays listed, and no prune pass rewrites it, since a pass reads its classes over the
186
- * packs out of the fence and keeps a fenced pack whole. So each reason names what the host can do:
193
+ * packs out of the fence and keeps a fenced pack whole. A fence for calls lifts on its own once a
194
+ * fresh try has more than the one that fenced it. So each reason names what the host can do:
187
195
  * - `open-past-try`: opening a merge of it alone, its choose, its quarantine and its walk's first
188
196
  * reads, takes more calls than a fresh merge try has, about 1.84M objects at R2's charges, fenced
189
- * before the merge reads anything. Raise the host's `callLimits`; a later merge takes the pack
190
- * only once it leaves the listing.
197
+ * before the merge reads anything. Raise the host's `callLimits`, and the next step merges the
198
+ * pack again; one still past the try is fenced again at its calls.
191
199
  * - `entry-past-try`: one of its entries takes more calls to resolve than a merge try has. As for
192
200
  * `open-past-try`.
193
201
  * - `resolve-past-try`: its longest delta chain could take more calls to resolve than a fresh
@@ -195,8 +203,9 @@ const BeforeAfter = /* @__PURE__ */ Schema.Struct({
195
203
  * `open-past-try`.
196
204
  * - `graph-length`: its `.graph` reads past the bytes its pack row records, or ends short of them.
197
205
  * - `graph-broken`: its `.graph` is missing or broken, or counts a commit past 4,096 parents, which
198
- * every write refuses. Nothing rebuilds a pack's `.graph` yet: for either `.graph` reason, the
199
- * pack keeps its file as it is.
206
+ * every write refuses. For either `.graph` reason, the next upkeep steps rebuild the file from the
207
+ * pack's commits, a part each step, and then the pack merges again. One whose commits can't be
208
+ * read stays fenced, and no step rebuilds it again.
200
209
  * - `packs-past-most`: the merge would write more than `mergePacksMost` packs, about 418, and this
201
210
  * pack held the step that reached them. A prune that keeps deltas whose bases it drops writes them
202
211
  * whole, so each pack fills a try's calls after a few dozen. The host can do nothing for it yet:
@@ -307,7 +316,7 @@ const EntryMerged = /* @__PURE__ */ Schema.Struct({
307
316
  candidate: CandidateId,
308
317
  commit: Oid
309
318
  });
310
- /** `error`: for `host-error`, the failure's ID, which `onError` got too. */
319
+ /** `error`: for `host-error`, the failure's ID, which the host's log line names too. */
311
320
  const EntryFailed = /* @__PURE__ */ Schema.Struct({
312
321
  ...RepoEnvelope.fields,
313
322
  summary: ReportDetails.fields.summary,
@@ -487,10 +496,12 @@ const TopicEvent = /* @__PURE__ */ Schema.Union([
487
496
  TopicRemoved,
488
497
  TopicWorkFailed
489
498
  ]);
499
+ /** Whether `log` keeps events: it has a delivery to hand them to. A write adds none without one. */
500
+ const keepsEvents = (log) => log !== void 0 && log.deliveries.length > 0;
490
501
  /**
491
502
  * A repo's events, which core writes as each change commits. A feature that writes its own, as the
492
503
  * merge queue does, requires it. The server builds it inside its runtime's build, so it has no
493
504
  * `layer`; a repo's feed is `EventStreams`'.
494
505
  */
495
506
  var Events = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/Events")) {};
496
- export { BeforeAfter, CandidateClosed, CandidateClosedFields, CandidateOpened, CandidateReported, EntryAdded, EntryFailed, EntryMerged, EntryPinned, EntryRemoved, EntryRetried, EventEnvelope, Events, FenceReason, FencedPack, HoldEvent, HoldEventFields, IndexRefusal, QueueEvent, QueueRestarted, RefPush, RefUpdated, RepoCreated, RepoDeletedEvent, RepoEnvelope, RepoEvent, RepoIndexRefused, RepoJobFailed, RepoMaintained, RepoRenamed, RepoTokenEvent, RepoVisibilityChanged, RepoWorkFailed, TokenEvent, TokenEventFields, TopicAdded, TopicEnvelope, TopicEvent, TopicFailed, TopicMerged, TopicOpened, TopicRemoved, TopicReported, TopicWorkFailed, events_exports };
507
+ export { BeforeAfter, CandidateClosed, CandidateClosedFields, CandidateOpened, CandidateReported, EntryAdded, EntryFailed, EntryMerged, EntryPinned, EntryRemoved, EntryRetried, EventEnvelope, Events, FenceReason, FencedPack, HoldEvent, HoldEventFields, IndexRefusal, QueueEvent, QueueRestarted, RefPush, RefUpdated, RepoCreated, RepoDeletedEvent, RepoEnvelope, RepoEvent, RepoIndexRefused, RepoJobFailed, RepoMaintained, RepoRenamed, RepoTokenEvent, RepoVisibilityChanged, RepoWorkFailed, TokenEvent, TokenEventFields, TopicAdded, TopicEnvelope, TopicEvent, TopicFailed, TopicMerged, TopicOpened, TopicRemoved, TopicReported, TopicWorkFailed, events_exports, keepsEvents };
@@ -5,9 +5,9 @@ import { Acting } from "./blobs.mjs";
5
5
  import { DiffListing, ReadPage } from "./engine.mjs";
6
6
  import { RepoName } from "./ids.mjs";
7
7
  import { TreeEntry } from "./trees.mjs";
8
- import { Listing } from "@ref0/infra";
9
- import * as Schema from "effect/Schema";
10
8
  import * as Effect from "effect/Effect";
9
+ import * as Schema from "effect/Schema";
10
+ import { Listing } from "@ref0/infra";
11
11
  import * as Context from "effect/Context";
12
12
  declare namespace files_d_exports {
13
13
  export { File, FileCalls, FileDiff, FileFields, FileRead, FileReadInput, Files, FilesDiff, FilesDiffInput, FilesList, FilesListInput, FilesRead, Hunk, HunkLine, diff, list, read };
@@ -60,11 +60,11 @@ export type FilesList = typeof FilesList.Type;
60
60
  export interface FilesListInput extends ReadPage, FilesList {}
61
61
  /** A diff's files, only those at or under `paths` when given, as a patch or as hunks. */
62
62
  export declare const FilesDiff: Schema.Struct<{
63
- readonly paths: Schema.optionalKey<Schema.$Array<Schema.String>>;
64
- readonly format: Schema.optionalKey<Schema.Literals<readonly ["patch", "hunks"]>>;
65
63
  readonly base: Schema.String;
66
64
  readonly head: Schema.String;
67
65
  readonly renames: Schema.optionalKey<Schema.Boolean>;
66
+ readonly paths: Schema.optionalKey<Schema.$Array<Schema.String>>;
67
+ readonly format: Schema.optionalKey<Schema.Literals<readonly ["patch", "hunks"]>>;
68
68
  }>;
69
69
  export type FilesDiff = typeof FilesDiff.Type;
70
70
  export interface FilesDiffInput extends ReadPage, FilesDiff {}
@@ -97,7 +97,6 @@ export type Hunk = typeof Hunk.Type;
97
97
  * decodes with replacements.
98
98
  */
99
99
  export declare const FileDiff: Schema.Union<readonly [Schema.Struct<{
100
- readonly patch: Schema.String;
101
100
  readonly status: Schema.Literals<readonly ["A", "D", "M", "R", "T"]>;
102
101
  readonly path: Schema.String;
103
102
  readonly from: Schema.optionalKey<Schema.String>;
@@ -116,20 +115,8 @@ export declare const FileDiff: Schema.Union<readonly [Schema.Struct<{
116
115
  readonly added: Schema.Int;
117
116
  readonly deleted: Schema.Int;
118
117
  }>, Schema.Literal<"binary">]>;
118
+ readonly patch: Schema.String;
119
119
  }>, Schema.Struct<{
120
- readonly hunks: Schema.$Array<Schema.Struct<{
121
- readonly oldStart: Schema.Int;
122
- readonly oldLines: Schema.Int;
123
- readonly newStart: Schema.Int;
124
- readonly newLines: Schema.Int;
125
- /** The hunk header's function context, after `@@ ... @@ `: empty when there's none. */
126
- readonly context: Schema.String;
127
- readonly lines: Schema.$Array<Schema.Struct<{
128
- readonly kind: Schema.Literals<readonly ["context", "add", "delete"]>;
129
- readonly text: Schema.String;
130
- readonly noNewline: Schema.optionalKey<Schema.Literal<true>>;
131
- }>>;
132
- }>>;
133
120
  readonly status: Schema.Literals<readonly ["A", "D", "M", "R", "T"]>;
134
121
  readonly path: Schema.String;
135
122
  readonly from: Schema.optionalKey<Schema.String>;
@@ -148,6 +135,19 @@ export declare const FileDiff: Schema.Union<readonly [Schema.Struct<{
148
135
  readonly added: Schema.Int;
149
136
  readonly deleted: Schema.Int;
150
137
  }>, Schema.Literal<"binary">]>;
138
+ readonly hunks: Schema.$Array<Schema.Struct<{
139
+ readonly oldStart: Schema.Int;
140
+ readonly oldLines: Schema.Int;
141
+ readonly newStart: Schema.Int;
142
+ readonly newLines: Schema.Int;
143
+ /** The hunk header's function context, after `@@ ... @@ `: empty when there's none. */
144
+ readonly context: Schema.String;
145
+ readonly lines: Schema.$Array<Schema.Struct<{
146
+ readonly kind: Schema.Literals<readonly ["context", "add", "delete"]>;
147
+ readonly text: Schema.String;
148
+ readonly noNewline: Schema.optionalKey<Schema.Literal<true>>;
149
+ }>>;
150
+ }>>;
151
151
  }>]>;
152
152
  export type FileDiff = typeof FileDiff.Type;
153
153
  export interface FileCalls {
@@ -186,7 +186,6 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
186
186
  readonly pathBytes?: Uint8Array<ArrayBufferLike>;
187
187
  }>>>;
188
188
  readonly diff: (repo: string, input: Acting<FilesDiffInput>, by?: Caller<unknown> | undefined) => Promise<Result<DiffListing<{
189
- readonly patch: string;
190
189
  readonly status: "A" | "D" | "M" | "R" | "T";
191
190
  readonly path: string;
192
191
  readonly from?: string;
@@ -205,19 +204,8 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
205
204
  readonly added: number;
206
205
  readonly deleted: number;
207
206
  };
207
+ readonly patch: string;
208
208
  } | {
209
- readonly hunks: readonly {
210
- readonly oldStart: number;
211
- readonly oldLines: number;
212
- readonly newStart: number;
213
- readonly newLines: number;
214
- readonly context: string;
215
- readonly lines: readonly {
216
- readonly kind: "add" | "context" | "delete";
217
- readonly text: string;
218
- readonly noNewline?: true;
219
- }[];
220
- }[];
221
209
  readonly status: "A" | "D" | "M" | "R" | "T";
222
210
  readonly path: string;
223
211
  readonly from?: string;
@@ -236,6 +224,18 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
236
224
  readonly added: number;
237
225
  readonly deleted: number;
238
226
  };
227
+ readonly hunks: readonly {
228
+ readonly oldStart: number;
229
+ readonly oldLines: number;
230
+ readonly newStart: number;
231
+ readonly newLines: number;
232
+ readonly context: string;
233
+ readonly lines: readonly {
234
+ readonly kind: "add" | "context" | "delete";
235
+ readonly text: string;
236
+ readonly noNewline?: true;
237
+ }[];
238
+ }[];
239
239
  }>>>;
240
240
  }, never>>;
241
241
  /**
@@ -266,7 +266,6 @@ export declare const list: (repo: RepoName, input: Acting<FilesListInput>, by?:
266
266
  readonly pathBytes?: Uint8Array<ArrayBufferLike>;
267
267
  }>, GitError, Files>;
268
268
  export declare const diff: (repo: RepoName, input: Acting<FilesDiffInput>, by?: Caller) => Effect.Effect<DiffListing<{
269
- readonly patch: string;
270
269
  readonly status: "A" | "D" | "M" | "R" | "T";
271
270
  readonly path: string;
272
271
  readonly from?: string;
@@ -285,19 +284,8 @@ export declare const diff: (repo: RepoName, input: Acting<FilesDiffInput>, by?:
285
284
  readonly added: number;
286
285
  readonly deleted: number;
287
286
  };
287
+ readonly patch: string;
288
288
  } | {
289
- readonly hunks: readonly {
290
- readonly oldStart: number;
291
- readonly oldLines: number;
292
- readonly newStart: number;
293
- readonly newLines: number;
294
- readonly context: string;
295
- readonly lines: readonly {
296
- readonly kind: "add" | "context" | "delete";
297
- readonly text: string;
298
- readonly noNewline?: true;
299
- }[];
300
- }[];
301
289
  readonly status: "A" | "D" | "M" | "R" | "T";
302
290
  readonly path: string;
303
291
  readonly from?: string;
@@ -316,5 +304,17 @@ export declare const diff: (repo: RepoName, input: Acting<FilesDiffInput>, by?:
316
304
  readonly added: number;
317
305
  readonly deleted: number;
318
306
  };
307
+ readonly hunks: readonly {
308
+ readonly oldStart: number;
309
+ readonly oldLines: number;
310
+ readonly newStart: number;
311
+ readonly newLines: number;
312
+ readonly context: string;
313
+ readonly lines: readonly {
314
+ readonly kind: "add" | "context" | "delete";
315
+ readonly text: string;
316
+ readonly noNewline?: true;
317
+ }[];
318
+ }[];
319
319
  }>, GitError, Files>;
320
320
  export { files_d_exports };
@@ -3,8 +3,8 @@ import { CommitDiff, ComparisonFileFields, Revision } from "./commits.mjs";
3
3
  import { Listing } from "./engine.mjs";
4
4
  import { Oid } from "./ids.mjs";
5
5
  import { Bytes } from "./object-values.mjs";
6
- import * as Schema from "effect/Schema";
7
6
  import * as Effect from "effect/Effect";
7
+ import * as Schema from "effect/Schema";
8
8
  import * as Context from "effect/Context";
9
9
  // src/contracts/files.ts
10
10
  var files_exports = /* @__PURE__ */ __exportAll({
@@ -3,9 +3,9 @@ import { GitError, Result } from "./result.mjs";
3
3
  import { ActorInput, Caller, WriteInput } from "./actors.mjs";
4
4
  import { RepoName } from "./ids.mjs";
5
5
  import { RepoInfo, RepoInput } from "./repos.mjs";
6
- import { Listing, Page } from "@ref0/infra";
7
- import * as Schema from "effect/Schema";
8
6
  import * as Effect from "effect/Effect";
7
+ import * as Schema from "effect/Schema";
8
+ import { Listing, Page } from "@ref0/infra";
9
9
  import * as Context from "effect/Context";
10
10
  declare namespace forks_d_exports {
11
11
  export { ForkCalls, ForkCreateInput, ForkFetched, ForkGetInput, ForkHolder, ForkListInput, Forks, create, fetch, get, list, sync };
@@ -102,16 +102,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
102
102
  readonly stats: {
103
103
  readonly repo: string;
104
104
  readonly refs: number;
105
- readonly packs: number;
106
- readonly packBytes: number;
107
- readonly ownBytes: number;
108
- readonly looseObjects: number;
109
- readonly looseBytes: number;
110
- readonly leavingBytes: number;
105
+ readonly packs?: number;
106
+ readonly packBytes?: number;
107
+ readonly ownBytes?: number;
111
108
  readonly pushedAt?: number;
112
109
  readonly maintainedAt?: number;
113
110
  };
114
- readonly work: {
111
+ readonly work?: {
115
112
  readonly waiting: number;
116
113
  readonly oldestDue?: number;
117
114
  readonly failed: number;
@@ -132,16 +129,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
132
129
  readonly stats: {
133
130
  readonly repo: string;
134
131
  readonly refs: number;
135
- readonly packs: number;
136
- readonly packBytes: number;
137
- readonly ownBytes: number;
138
- readonly looseObjects: number;
139
- readonly looseBytes: number;
140
- readonly leavingBytes: number;
132
+ readonly packs?: number;
133
+ readonly packBytes?: number;
134
+ readonly ownBytes?: number;
141
135
  readonly pushedAt?: number;
142
136
  readonly maintainedAt?: number;
143
137
  };
144
- readonly work: {
138
+ readonly work?: {
145
139
  readonly waiting: number;
146
140
  readonly oldestDue?: number;
147
141
  readonly failed: number;
@@ -162,16 +156,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
162
156
  readonly stats: {
163
157
  readonly repo: string;
164
158
  readonly refs: number;
165
- readonly packs: number;
166
- readonly packBytes: number;
167
- readonly ownBytes: number;
168
- readonly looseObjects: number;
169
- readonly looseBytes: number;
170
- readonly leavingBytes: number;
159
+ readonly packs?: number;
160
+ readonly packBytes?: number;
161
+ readonly ownBytes?: number;
171
162
  readonly pushedAt?: number;
172
163
  readonly maintainedAt?: number;
173
164
  };
174
- readonly work: {
165
+ readonly work?: {
175
166
  readonly waiting: number;
176
167
  readonly oldestDue?: number;
177
168
  readonly failed: number;
@@ -192,16 +183,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
192
183
  readonly stats: {
193
184
  readonly repo: string;
194
185
  readonly refs: number;
195
- readonly packs: number;
196
- readonly packBytes: number;
197
- readonly ownBytes: number;
198
- readonly looseObjects: number;
199
- readonly looseBytes: number;
200
- readonly leavingBytes: number;
186
+ readonly packs?: number;
187
+ readonly packBytes?: number;
188
+ readonly ownBytes?: number;
201
189
  readonly pushedAt?: number;
202
190
  readonly maintainedAt?: number;
203
191
  };
204
- readonly work: {
192
+ readonly work?: {
205
193
  readonly waiting: number;
206
194
  readonly oldestDue?: number;
207
195
  readonly failed: number;
@@ -236,16 +224,13 @@ export declare const create: (repo: RepoName, input: ForkCreateInput, by?: Calle
236
224
  readonly stats: {
237
225
  readonly repo: string;
238
226
  readonly refs: number;
239
- readonly packs: number;
240
- readonly packBytes: number;
241
- readonly ownBytes: number;
242
- readonly looseObjects: number;
243
- readonly looseBytes: number;
244
- readonly leavingBytes: number;
227
+ readonly packs?: number;
228
+ readonly packBytes?: number;
229
+ readonly ownBytes?: number;
245
230
  readonly pushedAt?: number;
246
231
  readonly maintainedAt?: number;
247
232
  };
248
- readonly work: {
233
+ readonly work?: {
249
234
  readonly waiting: number;
250
235
  readonly oldestDue?: number;
251
236
  readonly failed: number;
@@ -266,16 +251,13 @@ export declare const get: (repo: RepoName, input: ForkGetInput, by?: Caller) =>
266
251
  readonly stats: {
267
252
  readonly repo: string;
268
253
  readonly refs: number;
269
- readonly packs: number;
270
- readonly packBytes: number;
271
- readonly ownBytes: number;
272
- readonly looseObjects: number;
273
- readonly looseBytes: number;
274
- readonly leavingBytes: number;
254
+ readonly packs?: number;
255
+ readonly packBytes?: number;
256
+ readonly ownBytes?: number;
275
257
  readonly pushedAt?: number;
276
258
  readonly maintainedAt?: number;
277
259
  };
278
- readonly work: {
260
+ readonly work?: {
279
261
  readonly waiting: number;
280
262
  readonly oldestDue?: number;
281
263
  readonly failed: number;
@@ -296,16 +278,13 @@ export declare const list: (repo: RepoName, input: ForkListInput, by?: Caller) =
296
278
  readonly stats: {
297
279
  readonly repo: string;
298
280
  readonly refs: number;
299
- readonly packs: number;
300
- readonly packBytes: number;
301
- readonly ownBytes: number;
302
- readonly looseObjects: number;
303
- readonly looseBytes: number;
304
- readonly leavingBytes: number;
281
+ readonly packs?: number;
282
+ readonly packBytes?: number;
283
+ readonly ownBytes?: number;
305
284
  readonly pushedAt?: number;
306
285
  readonly maintainedAt?: number;
307
286
  };
308
- readonly work: {
287
+ readonly work?: {
309
288
  readonly waiting: number;
310
289
  readonly oldestDue?: number;
311
290
  readonly failed: number;
@@ -326,16 +305,13 @@ export declare const sync: (fork: RepoName, input: WriteInput & Pick<RepoInput,
326
305
  readonly stats: {
327
306
  readonly repo: string;
328
307
  readonly refs: number;
329
- readonly packs: number;
330
- readonly packBytes: number;
331
- readonly ownBytes: number;
332
- readonly looseObjects: number;
333
- readonly looseBytes: number;
334
- readonly leavingBytes: number;
308
+ readonly packs?: number;
309
+ readonly packBytes?: number;
310
+ readonly ownBytes?: number;
335
311
  readonly pushedAt?: number;
336
312
  readonly maintainedAt?: number;
337
313
  };
338
- readonly work: {
314
+ readonly work?: {
339
315
  readonly waiting: number;
340
316
  readonly oldestDue?: number;
341
317
  readonly failed: number;
@@ -1,8 +1,8 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
2
  import { RefName, RepoName } from "./ids.mjs";
3
3
  import { Ref } from "./refs.mjs";
4
- import * as Schema from "effect/Schema";
5
4
  import * as Effect from "effect/Effect";
5
+ import * as Schema from "effect/Schema";
6
6
  import * as Context from "effect/Context";
7
7
  // src/contracts/forks.ts
8
8
  var forks_exports = /* @__PURE__ */ __exportAll({