@ref0/git 0.12.0 → 0.20.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 (436) hide show
  1. package/dist/access/private-refs.mjs +3 -3
  2. package/dist/auth/access-jwt.mjs +2 -2
  3. package/dist/auth/auth.d.mts +2 -2
  4. package/dist/auth/auth.mjs +3 -6
  5. package/dist/auth/authorize.mjs +4 -20
  6. package/dist/auth/fences.d.mts +1 -2
  7. package/dist/auth/fences.mjs +3 -3
  8. package/dist/auth/grants.mjs +4 -4
  9. package/dist/auth/helpers.mjs +3 -11
  10. package/dist/auth/host-function.mjs +18 -1
  11. package/dist/auth/host-services.mjs +11 -0
  12. package/dist/auth/identify.d.mts +1 -1
  13. package/dist/auth/identify.mjs +3 -3
  14. package/dist/auth/policy.d.mts +27 -7
  15. package/dist/auth/policy.mjs +8 -4
  16. package/dist/auth/token-cleanup.mjs +67 -0
  17. package/dist/auth/token-rows.mjs +1 -1
  18. package/dist/auth/token-text.mjs +9 -1
  19. package/dist/auth/tokens-base.d.mts +35 -0
  20. package/dist/auth/tokens-base.mjs +13 -0
  21. package/dist/auth/tokens-layer.d.mts +2 -28
  22. package/dist/auth/tokens-layer.mjs +6 -12
  23. package/dist/auth/tokens-public.d.mts +3 -3
  24. package/dist/auth/tokens.d.mts +7 -17
  25. package/dist/auth/tokens.mjs +9 -87
  26. package/dist/auth.d.mts +1 -4
  27. package/dist/auth.mjs +1 -3
  28. package/dist/client/answer.mjs +21 -42
  29. package/dist/client/client.d.mts +2 -4
  30. package/dist/client/git-http.mjs +35 -11
  31. package/dist/client/local.mjs +14 -13
  32. package/dist/client/push-upload.mjs +39 -12
  33. package/dist/client/remote.mjs +95 -31
  34. package/dist/client/run-remote-helper.d.mts +1 -0
  35. package/dist/client/run-remote-helper.mjs +58 -24
  36. package/dist/client/slice-push.d.mts +1 -1
  37. package/dist/client/transport.mjs +105 -46
  38. package/dist/contracts/access.d.mts +8 -8
  39. package/dist/contracts/actors.d.mts +2 -34
  40. package/dist/contracts/blobs.d.mts +57 -10
  41. package/dist/contracts/blobs.mjs +16 -2
  42. package/dist/contracts/call-allowance.d.mts +13 -0
  43. package/dist/contracts/call-allowance.mjs +44 -0
  44. package/dist/contracts/calls-spent.mjs +8 -3
  45. package/dist/contracts/client.d.mts +23 -19
  46. package/dist/contracts/commits.d.mts +34 -26
  47. package/dist/contracts/commits.mjs +9 -1
  48. package/dist/contracts/engine.d.mts +6 -1
  49. package/dist/contracts/engine.mjs +10 -1
  50. package/dist/contracts/files.d.mts +12 -12
  51. package/dist/contracts/forks.d.mts +27 -17
  52. package/dist/contracts/git-events.d.mts +29 -1
  53. package/dist/contracts/git-hooks.d.mts +1 -1
  54. package/dist/contracts/git.d.mts +39 -7
  55. package/dist/contracts/git.mjs +3 -2
  56. package/dist/contracts/grants.d.mts +24 -4
  57. package/dist/contracts/handlers.d.mts +1 -1
  58. package/dist/contracts/lfs.d.mts +28 -9
  59. package/dist/contracts/merges.d.mts +3 -2
  60. package/dist/contracts/objects.d.mts +103 -35
  61. package/dist/contracts/operations.d.mts +3 -0
  62. package/dist/contracts/operations.mjs +12 -2
  63. package/dist/contracts/push-uploads.d.mts +44 -5
  64. package/dist/contracts/push-uploads.mjs +7 -3
  65. package/dist/contracts/queue.d.mts +40 -12
  66. package/dist/contracts/queue.mjs +3 -4
  67. package/dist/contracts/refs.d.mts +50 -25
  68. package/dist/contracts/remote.d.mts +6 -7
  69. package/dist/contracts/remote.mjs +5 -4
  70. package/dist/contracts/repo-records.d.mts +1 -0
  71. package/dist/contracts/repos.d.mts +106 -127
  72. package/dist/contracts/repos.mjs +33 -4
  73. package/dist/contracts/result.d.mts +49 -25
  74. package/dist/contracts/result.mjs +52 -11
  75. package/dist/contracts/rules.d.mts +22 -22
  76. package/dist/contracts/server.d.mts +37 -111
  77. package/dist/contracts/services.d.mts +1 -1
  78. package/dist/contracts/signin.d.mts +1 -1
  79. package/dist/contracts/store.d.mts +6 -5
  80. package/dist/contracts/sync.d.mts +90 -26
  81. package/dist/contracts/sync.mjs +45 -11
  82. package/dist/contracts/tags.d.mts +10 -10
  83. package/dist/contracts/time.d.mts +3 -0
  84. package/dist/contracts/{promises.mjs → time.mjs} +1 -1
  85. package/dist/contracts/tokens.d.mts +15 -22
  86. package/dist/contracts/tokens.mjs +3 -3
  87. package/dist/contracts/topics.d.mts +1 -6
  88. package/dist/contracts/trees.d.mts +12 -12
  89. package/dist/contracts/work.d.mts +87 -12
  90. package/dist/contracts/work.mjs +8 -1
  91. package/dist/core/access.d.mts +1 -2
  92. package/dist/core/access.mjs +46 -13
  93. package/dist/core/ancestry.d.mts +10 -0
  94. package/dist/core/ancestry.mjs +6 -6
  95. package/dist/core/asked.mjs +43 -5
  96. package/dist/core/call-names.mjs +7 -1
  97. package/dist/core/call-services.mjs +13 -4
  98. package/dist/core/events/deliver.d.mts +1 -2
  99. package/dist/core/events/deliver.mjs +48 -33
  100. package/dist/core/events/retired.mjs +119 -0
  101. package/dist/core/forks.mjs +931 -435
  102. package/dist/core/hooks/groups.mjs +1 -1
  103. package/dist/core/imports.mjs +159 -15
  104. package/dist/core/index-job.mjs +128 -37
  105. package/dist/core/index-lost.d.mts +1 -2
  106. package/dist/core/index-lost.mjs +2 -2
  107. package/dist/core/job-view.mjs +8 -9
  108. package/dist/core/loose-tally.mjs +1 -1
  109. package/dist/core/mirror-rows.mjs +19 -4
  110. package/dist/core/objects/blobs.mjs +129 -3
  111. package/dist/core/objects/commits.mjs +16 -6
  112. package/dist/core/objects/lines.mjs +2 -2
  113. package/dist/core/objects/merges.mjs +4 -1
  114. package/dist/core/objects/objects-layer.d.mts +1 -1
  115. package/dist/core/objects/objects-layer.mjs +3 -3
  116. package/dist/core/objects/reading.mjs +24 -13
  117. package/dist/core/objects/tags.mjs +4 -1
  118. package/dist/core/objects/trees.mjs +2 -2
  119. package/dist/core/objects/writing.mjs +2 -2
  120. package/dist/core/own-writes.mjs +1 -1
  121. package/dist/core/parts.d.mts +10 -6
  122. package/dist/core/parts.mjs +3 -11
  123. package/dist/core/promise.mjs +9 -12
  124. package/dist/core/purge.mjs +316 -42
  125. package/dist/core/push-decide.mjs +3 -1
  126. package/dist/core/push-files.d.mts +12 -0
  127. package/dist/core/push-files.mjs +225 -0
  128. package/dist/core/push-repo.d.mts +8 -0
  129. package/dist/core/push-repo.mjs +56 -0
  130. package/dist/core/push.d.mts +17 -0
  131. package/dist/core/push.mjs +153 -70
  132. package/dist/core/receipts.mjs +34 -13
  133. package/dist/core/ref-index-job.mjs +4 -4
  134. package/dist/core/ref-view.mjs +61 -7
  135. package/dist/core/refs.mjs +18 -13
  136. package/dist/core/registered-rows.mjs +2 -2
  137. package/dist/core/repack.mjs +46 -28
  138. package/dist/core/repo-info.mjs +19 -12
  139. package/dist/core/repos.mjs +50 -22
  140. package/dist/core/rules/commit-changes.d.mts +0 -1
  141. package/dist/core/saved-caller-views.d.mts +7 -2
  142. package/dist/core/saved-caller-views.mjs +2 -2
  143. package/dist/core/saved-callers.d.mts +19 -2
  144. package/dist/core/seam.d.mts +16 -26
  145. package/dist/core/seam.mjs +7 -28
  146. package/dist/core/tokens.mjs +1 -1
  147. package/dist/core/view.d.mts +6 -0
  148. package/dist/core/view.mjs +51 -26
  149. package/dist/core/work.mjs +105 -35
  150. package/dist/effect.d.mts +5 -12
  151. package/dist/effect.mjs +3 -10
  152. package/dist/engine/failures.mjs +2 -1
  153. package/dist/engine/reads.mjs +17 -10
  154. package/dist/engine/walk.mjs +4 -4
  155. package/dist/event-streams/event-streams.d.mts +1 -1
  156. package/dist/event-streams/event-streams.mjs +1 -1
  157. package/dist/event-streams/stream.d.mts +3 -3
  158. package/dist/event-streams/stream.mjs +38 -15
  159. package/dist/extend.d.mts +4 -5
  160. package/dist/extend.mjs +3 -2
  161. package/dist/http/answers.mjs +12 -7
  162. package/dist/http/core-parts.mjs +129 -64
  163. package/dist/http/handler.mjs +36 -9
  164. package/dist/http/node.d.mts +14 -1
  165. package/dist/http/node.mjs +61 -31
  166. package/dist/http/parts.d.mts +2 -0
  167. package/dist/http/push-upload-job.mjs +507 -0
  168. package/dist/http/push-uploads.d.mts +1 -0
  169. package/dist/http/push-uploads.mjs +142 -69
  170. package/dist/http/upload-pack.mjs +10 -9
  171. package/dist/index.d.mts +27 -28
  172. package/dist/index.mjs +5 -8
  173. package/dist/lfs/answer.mjs +37 -0
  174. package/dist/lfs/base.d.mts +9 -3
  175. package/dist/lfs/base.mjs +27 -2
  176. package/dist/lfs/copy.d.mts +60 -0
  177. package/dist/lfs/copy.mjs +109 -0
  178. package/dist/lfs/layer.d.mts +15 -1
  179. package/dist/lfs/layer.mjs +28 -13
  180. package/dist/lfs/locks.mjs +2 -2
  181. package/dist/lfs/objects.d.mts +7 -0
  182. package/dist/lfs/objects.mjs +152 -55
  183. package/dist/lfs/pointers.mjs +2 -2
  184. package/dist/lfs/rows.d.mts +13 -0
  185. package/dist/lfs/rows.mjs +42 -8
  186. package/dist/lfs/service.d.mts +1 -7
  187. package/dist/lfs/service.mjs +1 -9
  188. package/dist/lfs/upkeep.mjs +48 -14
  189. package/dist/lfs/upload-most.mjs +5 -5
  190. package/dist/lfs/wire.mjs +6 -31
  191. package/dist/merges/merges.mjs +2 -2
  192. package/dist/node.d.mts +3 -3
  193. package/dist/protocol/bytes/buffers.mjs +13 -5
  194. package/dist/protocol/bytes/reader.mjs +6 -1
  195. package/dist/protocol/bytes/sha256-hasher.d.mts +15 -0
  196. package/dist/protocol/bytes/sha256.d.mts +32 -0
  197. package/dist/protocol/bytes/sha256.mjs +105 -49
  198. package/dist/protocol/bytes/streams.mjs +27 -1
  199. package/dist/protocol/diff/read.d.mts +4 -3
  200. package/dist/protocol/diff/read.mjs +8 -3
  201. package/dist/protocol/objects/lfs-pointer.d.mts +14 -2
  202. package/dist/protocol/objects/lfs-pointer.mjs +1 -3
  203. package/dist/protocol/objects/links-raw.mjs +24 -10
  204. package/dist/protocol/objects/tag.d.mts +1 -1
  205. package/dist/protocol/objects/tree.mjs +23 -6
  206. package/dist/protocol/packs/delta.d.mts +6 -3
  207. package/dist/protocol/packs/delta.mjs +96 -32
  208. package/dist/protocol/packs/idx.d.mts +2 -1
  209. package/dist/protocol/packs/idx.mjs +22 -3
  210. package/dist/protocol/packs/parts.d.mts +4 -1
  211. package/dist/protocol/packs/parts.mjs +10 -7
  212. package/dist/protocol/packs/reader.d.mts +5 -0
  213. package/dist/protocol/packs/reader.mjs +3 -2
  214. package/dist/protocol/packs/writer.mjs +26 -8
  215. package/dist/protocol/wire/advertisement.mjs +9 -4
  216. package/dist/protocol/wire/lines.d.mts +4 -2
  217. package/dist/protocol/wire/lines.mjs +11 -5
  218. package/dist/protocol/wire/push-uploads.mjs +13 -1
  219. package/dist/protocol/wire/v2.mjs +2 -2
  220. package/dist/protocol.d.mts +3 -1
  221. package/dist/protocol.mjs +3 -1
  222. package/dist/queue/advance.mjs +22 -25
  223. package/dist/queue/base.d.mts +55 -0
  224. package/dist/queue/base.mjs +44 -0
  225. package/dist/queue/calls.mjs +51 -54
  226. package/dist/queue/commit.mjs +1 -1
  227. package/dist/queue/host.d.mts +2 -22
  228. package/dist/queue/host.mjs +2 -13
  229. package/dist/queue/layer.d.mts +2 -1
  230. package/dist/queue/layer.mjs +11 -4
  231. package/dist/queue/limits.mjs +2 -0
  232. package/dist/queue/push-option.mjs +9 -24
  233. package/dist/queue/schedule.mjs +1 -1
  234. package/dist/queue/state.mjs +2 -10
  235. package/dist/queue/trim.mjs +6 -4
  236. package/dist/rest/blobs.mjs +29 -5
  237. package/dist/rest/caller.d.mts +4 -4231
  238. package/dist/rest/caller.mjs +5 -1
  239. package/dist/rest/client.d.mts +15 -5
  240. package/dist/rest/client.mjs +23 -2
  241. package/dist/rest/events.mjs +1 -2
  242. package/dist/rest/handler.mjs +4 -57
  243. package/dist/rest/handlers.mjs +68 -9
  244. package/dist/rest/layer.d.mts +2 -2
  245. package/dist/rest/layer.mjs +7 -13
  246. package/dist/rest/me.d.mts +3 -428
  247. package/dist/rest/paths.mjs +1 -0
  248. package/dist/rest/work.mjs +8 -0
  249. package/dist/server/check-fetch.mjs +3 -3
  250. package/dist/server/edge-node.d.mts +14 -15
  251. package/dist/server/edge-node.mjs +12 -12
  252. package/dist/server/edge.d.mts +21 -7
  253. package/dist/server/edge.mjs +32 -11
  254. package/dist/server/extension.mjs +1 -1
  255. package/dist/server/git-layer.d.mts +6 -11
  256. package/dist/server/git-layer.mjs +29 -23
  257. package/dist/server/git-namespace.d.mts +5 -4
  258. package/dist/server/git-namespace.mjs +3 -2
  259. package/dist/server/joined.d.mts +21 -40
  260. package/dist/server/joined.mjs +11 -62
  261. package/dist/server/lifecycle.mjs +65 -69
  262. package/dist/server/registry.mjs +28 -3
  263. package/dist/server/server.mjs +245 -465
  264. package/dist/signin/context.d.mts +1 -2
  265. package/dist/signin/layer.d.mts +1 -1
  266. package/dist/signin/layer.mjs +1 -1
  267. package/dist/storage/allotted.mjs +18 -3
  268. package/dist/storage/batch-upkeep.mjs +274 -0
  269. package/dist/{core/purge.d.mts → storage/batches.d.mts} +4 -4
  270. package/dist/storage/batches.mjs +344 -0
  271. package/dist/storage/budget.mjs +2 -2
  272. package/dist/storage/calls.d.mts +1 -2
  273. package/dist/storage/calls.mjs +144 -158
  274. package/dist/storage/chunks.d.mts +9 -0
  275. package/dist/storage/chunks.mjs +297 -0
  276. package/dist/storage/clean-up.mjs +85 -19
  277. package/dist/storage/counted-bucket.mjs +4 -4
  278. package/dist/storage/fetch.d.mts +1 -0
  279. package/dist/storage/fetch.mjs +298 -216
  280. package/dist/storage/file-limits.mjs +24 -0
  281. package/dist/storage/host-bucket.mjs +1 -2
  282. package/dist/storage/id-mix.mjs +19 -5
  283. package/dist/storage/index-bitmaps.mjs +9 -2
  284. package/dist/storage/index-build.d.mts +1 -1
  285. package/dist/storage/index-build.mjs +185 -84
  286. package/dist/storage/index-fetch.mjs +128 -74
  287. package/dist/storage/index-files.d.mts +3 -0
  288. package/dist/storage/index-files.mjs +10 -5
  289. package/dist/storage/index-graph.mjs +72 -22
  290. package/dist/storage/index-reach.mjs +33 -5
  291. package/dist/storage/index-remap.mjs +208 -65
  292. package/dist/storage/index-shallow.mjs +5 -3
  293. package/dist/storage/index-whole.mjs +127 -0
  294. package/dist/storage/largest-files.mjs +48 -0
  295. package/dist/storage/layout.mjs +23 -0
  296. package/dist/storage/lfs-pointers.mjs +10 -1
  297. package/dist/storage/loose.d.mts +7 -4
  298. package/dist/storage/loose.mjs +214 -67
  299. package/dist/storage/memory-budget.mjs +44 -8
  300. package/dist/storage/merge-plan.mjs +3 -2
  301. package/dist/storage/merge-row.mjs +7 -1
  302. package/dist/storage/merge-stream.mjs +164 -25
  303. package/dist/storage/merge-walk.mjs +8 -4
  304. package/dist/storage/merge-write.mjs +1 -1
  305. package/dist/storage/merge.d.mts +1 -1
  306. package/dist/storage/merge.mjs +1 -1
  307. package/dist/storage/object-rows.d.mts +1 -0
  308. package/dist/storage/object-rows.mjs +385 -65
  309. package/dist/storage/oid-table.mjs +171 -0
  310. package/dist/storage/pack-order.mjs +8 -4
  311. package/dist/storage/pack-ranges.d.mts +1 -2
  312. package/dist/storage/pack-ranges.mjs +4 -5
  313. package/dist/storage/pack-reads.d.mts +2 -1
  314. package/dist/storage/pack-reads.mjs +165 -49
  315. package/dist/storage/pack-receive.d.mts +1 -1
  316. package/dist/storage/pack-receive.mjs +85 -27
  317. package/dist/storage/packs.d.mts +1 -1
  318. package/dist/storage/packs.mjs +172 -86
  319. package/dist/storage/placed-reads.mjs +1 -1
  320. package/dist/storage/plan-columns.d.mts +4 -0
  321. package/dist/storage/plan-columns.mjs +238 -0
  322. package/dist/storage/prune-keep.mjs +299 -37
  323. package/dist/storage/prune-walk.mjs +240 -62
  324. package/dist/storage/prune.mjs +749 -213
  325. package/dist/storage/push-allotment.mjs +91 -12
  326. package/dist/storage/push-uploads.mjs +40 -16
  327. package/dist/storage/pushed-commits.mjs +4 -2
  328. package/dist/storage/quarantine.d.mts +1 -1
  329. package/dist/storage/quarantine.mjs +9 -9
  330. package/dist/storage/range-cache.mjs +125 -8
  331. package/dist/storage/ready.d.mts +1 -1
  332. package/dist/storage/ready.mjs +55 -25
  333. package/dist/storage/receive-bounds.mjs +51 -15
  334. package/dist/storage/receive-state.mjs +8 -0
  335. package/dist/storage/receive-steps.mjs +71 -18
  336. package/dist/storage/repack-backlog.mjs +6 -3
  337. package/dist/storage/repack.d.mts +2 -2
  338. package/dist/storage/repack.mjs +1 -8
  339. package/dist/storage/rows.d.mts +1 -1
  340. package/dist/storage/rows.mjs +13 -2
  341. package/dist/storage/runs.mjs +195 -43
  342. package/dist/storage/send-list.d.mts +1 -0
  343. package/dist/storage/send-list.mjs +54 -10
  344. package/dist/storage/shallow.d.mts +1 -0
  345. package/dist/storage/shallow.mjs +26 -4
  346. package/dist/storage/single-flight.mjs +13 -7
  347. package/dist/storage/stream-whole.mjs +132 -28
  348. package/dist/storage/unpack.mjs +371 -79
  349. package/dist/storage/visible.mjs +31 -3
  350. package/dist/storage/walk.mjs +194 -39
  351. package/dist/storage/wants.mjs +5 -5
  352. package/dist/store/bodies.mjs +38 -0
  353. package/dist/store/call-count.d.mts +8 -12
  354. package/dist/store/call-count.mjs +34 -46
  355. package/dist/store/catalogue.d.mts +2 -2
  356. package/dist/store/catalogue.mjs +146 -35
  357. package/dist/store/crossing.mjs +1 -3
  358. package/dist/store/cursor-seal-namespace.d.mts +2 -0
  359. package/dist/store/cursor-seal-public.d.mts +5 -0
  360. package/dist/store/cursor-seal-public.mjs +5 -0
  361. package/dist/store/cursor-seal.d.mts +16 -3
  362. package/dist/store/cursor-seal.mjs +40 -18
  363. package/dist/store/door.mjs +183 -0
  364. package/dist/store/errors.d.mts +3 -4
  365. package/dist/store/errors.mjs +24 -34
  366. package/dist/store/git-store.mjs +25 -7
  367. package/dist/store/job-try.mjs +9 -32
  368. package/dist/store/list-job.mjs +44 -8
  369. package/dist/store/records.d.mts +5 -0
  370. package/dist/store/records.mjs +12 -6
  371. package/dist/store/repo-record.d.mts +10 -9
  372. package/dist/store/repo-record.mjs +123 -28
  373. package/dist/store/reservations.mjs +1 -1
  374. package/dist/store/scopes.mjs +21 -2
  375. package/dist/store/settle.mjs +4 -4
  376. package/dist/sync/bound.d.mts +2 -0
  377. package/dist/sync/bound.mjs +11 -2
  378. package/dist/sync/github.d.mts +6 -1
  379. package/dist/sync/github.mjs +56 -44
  380. package/dist/sync/http.mjs +36 -1
  381. package/dist/sync/import.mjs +32 -18
  382. package/dist/sync/layer.mjs +6 -2
  383. package/dist/sync/lfs-batch.mjs +118 -0
  384. package/dist/sync/lfs-copy.mjs +262 -0
  385. package/dist/sync/mirror.mjs +227 -151
  386. package/dist/sync/said.mjs +16 -37
  387. package/dist/sync/smart-http.mjs +4 -2
  388. package/dist/sync/step.mjs +58 -30
  389. package/dist/sync/tries.mjs +52 -21
  390. package/dist/sync.d.mts +2 -2
  391. package/dist/topics/advance.mjs +10 -11
  392. package/dist/topics/base.d.mts +15 -0
  393. package/dist/topics/base.mjs +8 -0
  394. package/dist/topics/host.mjs +2 -20
  395. package/dist/topics/layer.d.mts +4 -9
  396. package/dist/topics/layer.mjs +3 -4
  397. package/dist/topics/members.mjs +4 -4
  398. package/dist/topics/public.d.mts +2 -1
  399. package/dist/topics/topic.mjs +2 -2
  400. package/package.json +5 -9
  401. package/dist/auth/bridge.mjs +0 -30
  402. package/dist/auth/helpers.d.mts +0 -17
  403. package/dist/contracts/promises.d.mts +0 -39
  404. package/dist/core/call-names.d.mts +0 -3
  405. package/dist/core/clock.mjs +0 -18
  406. package/dist/core/registered-rows.d.mts +0 -5
  407. package/dist/core/repack.d.mts +0 -11
  408. package/dist/http/handler.d.mts +0 -2
  409. package/dist/lfs/calls.mjs +0 -26
  410. package/dist/rest/api.d.mts +0 -23
  411. package/dist/rest/blobs.d.mts +0 -825
  412. package/dist/rest/commits.d.mts +0 -3510
  413. package/dist/rest/errors.d.mts +0 -2104
  414. package/dist/rest/events.d.mts +0 -423
  415. package/dist/rest/files.d.mts +0 -1330
  416. package/dist/rest/forks.d.mts +0 -2136
  417. package/dist/rest/handler.d.mts +0 -21
  418. package/dist/rest/handlers.d.mts +0 -8
  419. package/dist/rest/merges.d.mts +0 -473
  420. package/dist/rest/queue.d.mts +0 -5861
  421. package/dist/rest/refs.d.mts +0 -2959
  422. package/dist/rest/repos.d.mts +0 -2539
  423. package/dist/rest/tags.d.mts +0 -1304
  424. package/dist/rest/tokens.d.mts +0 -2590
  425. package/dist/rest/topics.d.mts +0 -2204
  426. package/dist/rest/trees.d.mts +0 -1693
  427. package/dist/rest/work.d.mts +0 -1248
  428. package/dist/rest.d.mts +0 -2
  429. package/dist/rest.mjs +0 -1
  430. package/dist/server/lifecycle.d.mts +0 -2
  431. package/dist/server/registry.d.mts +0 -16
  432. package/dist/server/server.d.mts +0 -36
  433. package/dist/storage/repack-job.d.mts +0 -3
  434. package/dist/store/promises.d.mts +0 -11
  435. package/dist/store/promises.mjs +0 -327
  436. package/dist/topics/host.d.mts +0 -7
@@ -1,4 +1,3 @@
1
- import { Clock } from "./promises.mjs";
2
1
  import { CallInput } from "./actors.mjs";
3
2
  import { FencedPack } from "./events.mjs";
4
3
  import { InternalRepoId, Oid } from "./ids.mjs";
@@ -7,6 +6,7 @@ import { RepoStats } from "./repos.mjs";
7
6
  import { GitError, Result } from "./result.mjs";
8
7
  import { EffectCalls } from "./services.mjs";
9
8
  import { GitStore, Holding, Listed, Pack } from "./store.mjs";
9
+ import * as Clock from "effect/Clock";
10
10
  import * as Effect from "effect/Effect";
11
11
  import { Bucket, BucketLinks, BucketUploads, CallLimits, Key, Listing, Moment, Page, Row } from "@ref0/infra";
12
12
  export interface EffectiveLimits {
@@ -212,11 +212,11 @@ export interface ReceiveInput extends CallInput {
212
212
  readonly cutMost?: number;
213
213
  }
214
214
  /**
215
- * An import segment's pack to stage for its receive in steps: its bytes, as `receive` takes them,
216
- * and the boundary, needs and cut's most its steps check as `ReceiveInput` says. Sync's import
217
- * alone stages one.
215
+ * A pack to stage for its receive in steps, an import segment's or a push upload's: its bytes, as
216
+ * `receive` takes them, and the boundary, needs and cut's most, or the shallow lines, its steps
217
+ * check as `ReceiveInput` says. Sync's import and a push upload's job stage one.
218
218
  */
219
- export type StageInput = Omit<ReceiveInput, 'partial' | 'shallow'>;
219
+ export type StageInput = Omit<ReceiveInput, 'partial'>;
220
220
  /** A segment's pack staged: its ID, which each step and the landing name, and its bytes. */
221
221
  export interface Staged {
222
222
  readonly pack: string;
@@ -234,6 +234,29 @@ export interface StepInput extends CallInput {
234
234
  readonly pack: string;
235
235
  readonly objects: number;
236
236
  readonly needs?: readonly Oid[];
237
+ /**
238
+ * The bytes a streaming step reads before it pauses, a push upload's `pushStepBytesOf` its host's
239
+ * CPU: its pack then streams in as many steps as that takes. A step pauses only between entries,
240
+ * so it reads its share and at most the entry it's in, a blob past the share whole. With none,
241
+ * an import segment's eighth, in at most `receiveStreamStepsMost`.
242
+ */
243
+ readonly share?: number;
244
+ /**
245
+ * The step lists the push's largest blobs, carried from step to step, as `Quarantine.largest`:
246
+ * core then names a file past `pushes.files`' sizes by its path whichever way the push came
247
+ * (#2468). It reads an entry whole to four times its `share`, what the try's CPU leaves past the
248
+ * share, 240 MiB at Workers' 30 s, and refuses a larger one at its header, by its offset in the
249
+ * pack, before reading it: one step can't read it whole within its CPU, so a file from 240 MiB
250
+ * to 1 GiB at 30 s is refused by its offset rather than its path. It also pauses between
251
+ * entries once it has inflated 12 shares, its entries' data and its deltas' results, though it
252
+ * read less than its share, so with one more delta it stays within its try's CPU before its
253
+ * state's reads and its commit, and resolves each delta to its largest entry where that's under
254
+ * 16 MiB, a chain still to 16 MiB in all, refusing a larger one `delta-too-large` with a message
255
+ * that names that smaller limit (#2500).
256
+ * A push upload's steps set it. Left out, as an import's are, a file past 100 MiB is refused as
257
+ * it's read, by its offset. A host whose own objects ignore it keeps refusing by offset.
258
+ */
259
+ readonly largest?: true;
237
260
  }
238
261
  /**
239
262
  * What one step of a staged receive ended at: paused, with the step its next try runs, or the
@@ -309,6 +332,20 @@ export interface Quarantine {
309
332
  * parse isn't listed. A receive past `lfsPointersMost` of them is refused.
310
333
  */
311
334
  readonly lfsPointers: LfsPointers;
335
+ /**
336
+ * The push's largest blobs, each with its size, its result's for a delta, largest first: at most
337
+ * `largestFilesMost` (64), so the largest is always among them. Core holds a push to its file
338
+ * limits by them (#2395). A push upload's receive in steps lists them too, carried from one step
339
+ * to the next, as `StepInput.largest` says (#2468). Left out by an import's receive in steps, and
340
+ * by a storage that doesn't say: no file of such a push is held to a limit past what its storage
341
+ * reads.
342
+ */
343
+ readonly largest?: readonly LargeFile[];
344
+ /**
345
+ * Whether `largest` left out blobs no larger than its last, the push holding more than
346
+ * `largestFilesMost`: when each listed is past a limit, others may be too, and a refusal says so.
347
+ */
348
+ readonly largestPartial?: boolean;
312
349
  /** What the storage keeps for the push's rules, when it keeps any: core releases it. */
313
350
  readonly allotment?: Allotment;
314
351
  /**
@@ -334,6 +371,11 @@ export interface Quarantine {
334
371
  */
335
372
  readonly cut?: readonly SegmentCut[];
336
373
  }
374
+ /** A blob a receive took, by its ID, and its size in bytes, as `git cat-file -s` gives it. */
375
+ export interface LargeFile {
376
+ readonly oid: Oid;
377
+ readonly size: number;
378
+ }
337
379
  /**
338
380
  * Where a receive's links resolved. A pack counts outside cruft while it's listed and isn't cruft;
339
381
  * a row while it's still there, since only a pass step deletes a row whose object it leaves in
@@ -366,8 +408,18 @@ export interface ObjectsFetchInput extends CallInput {
366
408
  * fetch.
367
409
  */
368
410
  readonly thin?: true;
411
+ /**
412
+ * The repo's roots, read in the same snapshot as the refs the request names: storage's walks see
413
+ * each as a commit with no parents, and its answer names those its pack sends as `shallow`.
414
+ * Absent, the repo has none.
415
+ */
416
+ readonly roots?: readonly Oid[];
369
417
  }
370
418
  export interface FetchAnswer {
419
+ /**
420
+ * The commits the client is to hold without their parents: those the request's depth cuts at,
421
+ * and the repo's roots its pack sends, as Git's server names a shallow repo's own.
422
+ */
371
423
  readonly shallow: readonly Oid[];
372
424
  readonly unshallow: readonly Oid[];
373
425
  readonly objects: number;
@@ -474,10 +526,12 @@ export interface MaintainInput extends CallInput {
474
526
  */
475
527
  readonly steps?: 'prune' | 'others';
476
528
  /**
477
- * `true` for a deleted repo, whose `repack` row's run takes its packs out and whose pass runs no
478
- * more: a prune pass's merge under way is dropped then, never yielded to.
529
+ * When the repo was deleted, for a deleted repo, whose `repack` row's run takes its packs out and
530
+ * whose pass runs no more: a prune pass's merge under way is dropped then, never yielded to, and
531
+ * clean-up abandons each open `quarantine` row by the delete's `fetchLimits`, not its own
532
+ * `removeAt`; the `staged` row each leaves still waits its grace after (#1558).
479
533
  */
480
- readonly deleted?: true;
534
+ readonly deleted?: Moment;
481
535
  }
482
536
  /**
483
537
  * One step of upkeep, its change for the core to commit. `more`: another step is due now. `due`:
@@ -594,19 +648,19 @@ export interface ObjectsOpenInput<NeedsBucket extends boolean = boolean> {
594
648
  */
595
649
  readonly store: EffectCalls<GitStore>;
596
650
  readonly bucket: NeedsBucket extends true ? Bucket$1 : Bucket$1 | undefined;
597
- readonly clock: Clock;
651
+ /** The host's Effect `Clock` service (`effect/Clock`). */
652
+ readonly clock: Clock.Clock;
598
653
  readonly fetchLimits: EffectiveLimits;
599
654
  /**
600
- * The most calls a fetch may make: the adapter's `callLimits` less `requestCallsBefore`.
601
- * `packs()` counts a Git fetch's whole request against them, its negotiation with its pack. A
602
- * host's own objects are held to them per fetch, not per request: they're called across a
603
- * Promise, which no request's context crosses (#647, #709).
655
+ * The most calls a fetch may make: the adapter's `callLimits` less `requestCallsBefore`. A Git
656
+ * fetch's whole request counts against them, its negotiation with its pack: each call of the
657
+ * objects runs in its caller's fiber, so its store and bucket calls count into that request.
604
658
  */
605
659
  readonly callLimits?: CallLimits.CallLimits['Service'];
606
660
  }
607
661
  /**
608
662
  * How bytes are kept: `packs()` or `loose()`. `needsBucket` carries the requirement, and
609
- * `createGitServer` opens it once per server, keeping no state for any one repo.
663
+ * `Git.layer` opens it once per server, keeping no state for any one repo.
610
664
  */
611
665
  export interface ObjectsFactory<NeedsBucket extends boolean = boolean> {
612
666
  readonly needsBucket: NeedsBucket;
@@ -616,10 +670,9 @@ export interface ObjectsFactory<NeedsBucket extends boolean = boolean> {
616
670
  */
617
671
  readonly indexed?: true;
618
672
  /**
619
- * The objects for `input`'s server. A host may wrap what `packs()` or `loose()` opens, but a
620
- * member its wrapper replaces with its own function doesn't count its store calls toward a
621
- * request's limits: Git's core calls it across its Promise. A spread that keeps the member, as
622
- * `{ ...opened }` does, keeps them counted.
673
+ * The objects for `input`'s server. A host may wrap what `packs()` or `loose()` opens, or bring
674
+ * its own: each call is an Effect Git's core runs in its caller's fiber, so the store and bucket
675
+ * calls it makes count toward the caller's request, and an interrupt stops it.
623
676
  */
624
677
  readonly open: (input: ObjectsOpenInput<NeedsBucket>) => GitObjects;
625
678
  }
@@ -661,7 +714,7 @@ export interface VisibleSet {
661
714
  }
662
715
  /**
663
716
  * A server's opened objects that keep the reachability index, which a caller's view of a repo
664
- * reads from: `createGitServer` takes `access` only over these.
717
+ * reads from: `PrivateRefs.layer` takes only these.
665
718
  */
666
719
  export interface IndexedObjects extends GitObjects {
667
720
  /**
@@ -676,6 +729,17 @@ export interface IndexedObjects extends GitObjects {
676
729
  * repo lacks.
677
730
  */
678
731
  readonly seen: (set: VisibleSet) => GitObjects;
732
+ /**
733
+ * Which of `input.roots` the commits `input.tips` reach in `listed`, by the index `input.row`
734
+ * names, which a v0 listing tells as `shallow` lines to a caller who doesn't see every ref. A
735
+ * pure fast path: its answer is always the one a walk of the commits from the tips to its end
736
+ * gives, following no root's parents, and it's `undefined` where the index can't give it, as
737
+ * where none covers `listed`. A root the tips don't reach costs it no call. Without it, or where
738
+ * it's `undefined`, the server walks the visible commits to their end, within its want walk's
739
+ * 10,000 objects, and past that refuses the listing with `RESOURCE_EXHAUSTED`, reason
740
+ * `walk-limit`.
741
+ */
742
+ readonly rootsReached?: (listed: Listed, input: VisibleInput) => Effect.Effect<ReadonlySet<Oid> | undefined, GitError>;
679
743
  }
680
744
  /** A commit a push brings, with its parents, as its receive listed it. */
681
745
  export interface PushedCommit {
@@ -688,9 +752,8 @@ export interface PushedCommitsInput extends CallInput {
688
752
  readonly page?: Page;
689
753
  }
690
754
  /**
691
- * A server's opened objects, over each repo's `Listed`. A host's own are held to `callLimits` per
692
- * fetch, not per request: they're called across a Promise, which no request's context crosses,
693
- * so only `packs()`' count a Git fetch's negotiation with its pack (#709).
755
+ * A server's opened objects, over each repo's `Listed`, each call an Effect run in its caller's
756
+ * fiber: its store and bucket calls count into the caller's request, and an interrupt stops it.
694
757
  */
695
758
  export interface GitObjects {
696
759
  /**
@@ -701,7 +764,7 @@ export interface GitObjects {
701
764
  /**
702
765
  * The most objects one push may carry here, which receive-pack advertises as
703
766
  * `ref0-push-objects=<most>`, so ref0's remote helper cuts a bigger push into slices that each
704
- * fit (Q901): `packs()`' `receiveObjectsMostOf` its memory, `loose()`'s `looseObjectsMost`. A host's own
767
+ * fit (Q901): `packs()`' `pushObjectsMostOf` its memory, `loose()`'s `looseObjectsMost`. A host's own
705
768
  * objects with none advertise none, and the helper pushes whole.
706
769
  */
707
770
  readonly pushObjectsMost?: number;
@@ -712,7 +775,7 @@ export interface GitObjects {
712
775
  * never keeps it past its request or shares it between requests. Every read of the repo's
713
776
  * objects is through a reader: a call that reads one object opens a reader of its own for it.
714
777
  */
715
- readonly reader: (listed: Listed, input?: ObjectReaderInput) => Promise<Result<ObjectReader>>;
778
+ readonly reader: (listed: Listed, input?: ObjectReaderInput) => Effect.Effect<ObjectReader, GitError>;
716
779
  /**
717
780
  * The commits a push brings, a page at a time, each once: those in its received packs, then
718
781
  * those among its rows. A commit the client sent again is listed too: stock Git resends one the
@@ -721,15 +784,15 @@ export interface GitObjects {
721
784
  * push's list, never all of it, so a walk of the push's commits needs no set of those it has
722
785
  * seen. Every implementation serves it: a push's file rules read it.
723
786
  */
724
- readonly pushedCommits: (listed: Listed, input: PushedCommitsInput) => Promise<Result<Listing<PushedCommit>>>;
725
- readonly receive: (listed: Listed, input: ReceiveInput) => Promise<Result<Quarantine>>;
787
+ readonly pushedCommits: (listed: Listed, input: PushedCommitsInput) => Effect.Effect<Listing<PushedCommit>, GitError>;
788
+ readonly receive: (listed: Listed, input: ReceiveInput) => Effect.Effect<Quarantine, GitError>;
726
789
  /**
727
790
  * An import segment's pack staged under a quarantine of its own, its trailer checked, for its
728
791
  * receive a step at a time: `packs()` stages it in its bucket. A pack cut short, past its
729
792
  * `atMost`, or with a wrong trailer stages nothing. A host's own objects that omit `stage`
730
793
  * receive each segment in one invocation, through `receive`, as before.
731
794
  */
732
- readonly stage?: (listed: Listed, input: StageInput) => Promise<Result<Staged>>;
795
+ readonly stage?: (listed: Listed, input: StageInput) => Effect.Effect<Staged, GitError>;
733
796
  /**
734
797
  * One step of a staged segment's receive, within one invocation: it goes on from where the last
735
798
  * step paused, and pauses again or ends with the pack received, as `receive` ends it. A step
@@ -737,22 +800,22 @@ export interface GitObjects {
737
800
  * no try of that segment lands; a join refused `too-large` keeps it, for a try with more calls.
738
801
  * A host's own objects that omit it receive each segment through `receive`, as `stage` says.
739
802
  */
740
- readonly receiveStep?: (listed: Listed, input: StepInput) => Promise<Result<StepAnswer>>;
741
- readonly fetch: (listed: Listed, input: ObjectsFetchInput) => Promise<Result<FetchAnswer>>;
742
- readonly maintain: (listed: Listed, input: MaintainInput) => Promise<Result<ObjectsStep | undefined>>;
803
+ readonly receiveStep?: (listed: Listed, input: StepInput) => Effect.Effect<StepAnswer, GitError>;
804
+ readonly fetch: (listed: Listed, input: ObjectsFetchInput) => Effect.Effect<FetchAnswer, GitError>;
805
+ readonly maintain: (listed: Listed, input: MaintainInput) => Effect.Effect<ObjectsStep | undefined, GitError>;
743
806
  /**
744
807
  * Keeps each of `listed`'s packs for `input.into` before a fork's commit lists them: `packs()`
745
808
  * puts a marker on each, named by the fork's internal ID, so a source that lets one go leaves
746
809
  * its bytes to the fork. `loose()` has no packs, and does nothing.
747
810
  */
748
- readonly share: (listed: Listed, input: ShareInput) => Promise<Result<void>>;
811
+ readonly share: (listed: Listed, input: ShareInput) => Effect.Effect<void, GitError>;
749
812
  /**
750
813
  * Whether each of `input.holdings`' holders holds every object of the pack it names, by their
751
814
  * `.idx` IDs: in order, within `input.most` reads, each holder's read once against all it names.
752
815
  * A fork's sync unlists a copy only once it's walked held (Q903). `loose()` has no packs, and
753
816
  * none.
754
817
  */
755
- readonly holdings?: (listed: Listed, input: HoldingsInput) => Promise<Result<HoldingsWalked>>;
818
+ readonly holdings?: (listed: Listed, input: HoldingsInput) => Effect.Effect<HoldingsWalked, GitError>;
756
819
  /**
757
820
  * A page of `listed`'s object rows at its version, in ID order, after `input.after`: of those,
758
821
  * the rows `input.lacking` doesn't hold, read by the page's IDs, when it's given. A fork's
@@ -760,14 +823,14 @@ export interface GitObjects {
760
823
  * (`no-copy-rows`). A view narrowed to a caller's set (`IndexedObjects.seen`) hasn't it: a copy
761
824
  * reads the whole repo.
762
825
  */
763
- readonly copyRows?: (listed: Listed, input: CopyRowsInput) => Promise<Result<CopyRowsPage>>;
826
+ readonly copyRows?: (listed: Listed, input: CopyRowsInput) => Effect.Effect<CopyRowsPage, GitError>;
764
827
  /** The reachability index's build (#597). `loose()` keeps no index, and has none. */
765
828
  readonly index?: IndexCalls;
766
829
  }
767
830
  /** The reachability index's build, as `git.index` and the commits that save it call it. */
768
831
  export interface IndexCalls {
769
832
  /** One `git.index` try: the next step of the build under way in `input.data`, or a new one. */
770
- readonly step: (listed: Listed, input: IndexTryInput) => Promise<Result<IndexTry>>;
833
+ readonly step: (listed: Listed, input: IndexTryInput) => Effect.Effect<IndexTry, GitError>;
771
834
  /**
772
835
  * What the repo's `index` row, `row`, says at `at` with `packs` listed, by their IDs: what a
773
836
  * ref-moving commit saves, or why none. A refusal of a slice of a pack stands while that pack
@@ -785,7 +848,7 @@ export interface IndexCalls {
785
848
  * bitmaps, within the read's allotment, once an instance. A tip the index doesn't hold, as a
786
849
  * push's before its update, is walked until it meets the index.
787
850
  */
788
- readonly reach: (listed: Listed, input: IndexReachInput) => Promise<Result<IndexReached>>;
851
+ readonly reach: (listed: Listed, input: IndexReachInput) => Effect.Effect<IndexReached, GitError>;
789
852
  }
790
853
  /**
791
854
  * The index's answer to a want check: `answers` as `IndexCalls.reach` says, and `pastLimit`, the
@@ -885,6 +948,11 @@ export interface IndexTryInput extends CallInput {
885
948
  readonly failed?: {
886
949
  readonly reason: string;
887
950
  };
951
+ /**
952
+ * The repo's roots, read at the same version as the tips and the row. Absent, it has none. An
953
+ * index built over other roots is stale: the try builds it again whole.
954
+ */
955
+ readonly roots?: readonly Oid[];
888
956
  /**
889
957
  * This try follows a moved answer, so a moved listing counts as failed and the step updates.
890
958
  * The job reads the tips, the listing and the row again at a fresh version before it sets it.
@@ -330,6 +330,9 @@ export declare const Operation: Schema.Union<readonly [Schema.Struct<{
330
330
  readonly repo: Schema.String;
331
331
  readonly name: Schema.optionalKey<Schema.String>;
332
332
  readonly key: Schema.optionalKey<Schema.String>;
333
+ }>, Schema.Struct<{
334
+ readonly kind: Schema.Literal<"work.listById">;
335
+ readonly internalId: Schema.TemplateLiteral<readonly ["r_", Schema.String]>;
333
336
  }>, Schema.Struct<{
334
337
  readonly kind: Schema.Literal<"refs.private">;
335
338
  readonly repo: Schema.String;
@@ -1,4 +1,4 @@
1
- import { RefName, RepoName, TopicId } from "./ids.mjs";
1
+ import { InternalRepoId, RefName, RepoName, TopicId } from "./ids.mjs";
2
2
  import { CandidateId, EntryFields, EntryId, HoldId } from "./queue.mjs";
3
3
  import { RefEdit, RefSource } from "./refs.mjs";
4
4
  import { ActorId } from "./actors.mjs";
@@ -188,6 +188,15 @@ const WorkOperation = /* @__PURE__ */ Schema.Struct({
188
188
  name: Schema.optionalKey(JobRef.fields.name),
189
189
  key: Schema.optionalKey(JobRef.fields.key)
190
190
  });
191
+ /**
192
+ * Admin-only: a repo's work by its internal ID, and works on a deleted record. `Policy.signedIn`
193
+ * refuses it to everyone, `NOT_ALLOWED`; only a host's own policy grants it, as `ref0-git init`'s
194
+ * does for its admin. No token scope's ceiling names it, and no name opens it, so it names no repo.
195
+ */
196
+ const WorkByIdOperation = /* @__PURE__ */ Schema.Struct({
197
+ kind: Schema.Literal("work.listById"),
198
+ internalId: InternalRepoId
199
+ });
191
200
  const Operation = /* @__PURE__ */ Schema.Union([
192
201
  RepoOperation,
193
202
  PushOperation,
@@ -203,7 +212,8 @@ const Operation = /* @__PURE__ */ Schema.Union([
203
212
  QueueReleaseOperation,
204
213
  TopicOperation,
205
214
  WorkOperation,
215
+ WorkByIdOperation,
206
216
  RefsPrivateOperation,
207
217
  MeOperation
208
218
  ]);
209
- export { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TokenRevokeOperation, TopicOperation, WorkOperation };
219
+ export { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TokenRevokeOperation, TopicOperation, WorkByIdOperation, WorkOperation };
@@ -1,7 +1,39 @@
1
1
  import * as Schema from "effect/Schema";
2
- /** How a server takes pushes: a large one's pack can go straight to the bucket. */
2
+ /**
3
+ * How a server takes pushes: a large one's pack can go straight to the bucket, and its files and
4
+ * its repo are held to sizes.
5
+ */
3
6
  export interface PushOptions {
4
- readonly upload: PushUploadOptions;
7
+ readonly upload?: PushUploadOptions;
8
+ readonly files?: PushFileOptions;
9
+ readonly repo?: PushRepoOptions;
10
+ }
11
+ /**
12
+ * The sizes a repo a push lands in is held to, in bytes of its `RepoStats.ownBytes` once the push
13
+ * lands, which leaves Git LFS out (#2395). Past `warnAbove`, 5 GiB by default as GitHub advises, or
14
+ * `false` for none, every Git push that lands is told on band 2; an API write lands with no
15
+ * warning, as with a file's. Past `refuseAbove`, which has no default, a push or an API write that
16
+ * adds bytes is refused, `repo-too-large`; one that only deletes or moves refs still lands.
17
+ * `warnAbove` is below `refuseAbove` when both are set.
18
+ */
19
+ export interface PushRepoOptions {
20
+ readonly warnAbove?: number | false;
21
+ readonly refuseAbove?: number;
22
+ }
23
+ /**
24
+ * The sizes a pushed file is held to, in bytes, as GitHub holds them (#2395). A push carrying a
25
+ * file past `refuseAbove`, 100 MiB by default, is refused: each ref is told why, with the file's
26
+ * path, its size and how to track it with Git LFS. One past `warnAbove`, 50 MiB by default, or
27
+ * `false` for none, is taken, and a Git push is told on band 2; an API write gets no warning.
28
+ * `refuseAbove` is at most 1 GiB, a push's pack's own bound, and `warnAbove` is below it. A blob
29
+ * pushed whole counts, though `.gitattributes` names it for Git LFS. A push uploaded in steps is
30
+ * held to these as a streamed one is, but a file past what its step's CPU reads, as
31
+ * `StepInput.largest` says, is refused by its offset (#2468). An import received in steps, as
32
+ * `packs()` stages one, refuses a file past 100 MiB as it reads it, whatever these say.
33
+ */
34
+ export interface PushFileOptions {
35
+ readonly warnAbove?: number | false;
36
+ readonly refuseAbove?: number;
5
37
  }
6
38
  /**
7
39
  * A push whose pack is larger than `above` bytes may upload it to the bucket in parts, past the
@@ -50,8 +82,10 @@ export declare const PushUploadPart: Schema.Struct<{
50
82
  export type PushUploadPart = typeof PushUploadPart.Type;
51
83
  /**
52
84
  * `POST <repo>/push-uploads/{upload}/complete`, with each part's number and ETag in order, as the
53
- * bucket's `UploadPart`. It answers what `git-receive-pack` answers: report-status-v2 on
54
- * side-band-64k.
85
+ * bucket's `UploadPart`. The first hands the pack to the server's steps, and it answers
86
+ * `PushUploadReceiving` with 202 and `Retry-After` while they receive it; a client sends the same
87
+ * complete again until it answers what `git-receive-pack` answers: report-status-v2 on
88
+ * side-band-64k, the same report each time.
55
89
  */
56
90
  export declare const FinishPushUpload: Schema.Struct<{
57
91
  readonly parts: Schema.$Array<Schema.Struct<{
@@ -59,4 +93,9 @@ export declare const FinishPushUpload: Schema.Struct<{
59
93
  readonly etag: Schema.String;
60
94
  }>>;
61
95
  }>;
62
- export type FinishPushUpload = typeof FinishPushUpload.Type;
96
+ export type FinishPushUpload = typeof FinishPushUpload.Type;
97
+ /** Complete's 202, while the server receives the pack: the receive's steps taken so far. */
98
+ export declare const PushUploadReceiving: Schema.Struct<{
99
+ readonly step: Schema.Int;
100
+ }>;
101
+ export type PushUploadReceiving = typeof PushUploadReceiving.Type;
@@ -43,17 +43,21 @@ const PushUploadStarted = /* @__PURE__ */ Schema.Struct({
43
43
  const PushUploadPart = /* @__PURE__ */ Schema.Struct({ url: Schema.String });
44
44
  /**
45
45
  * `POST <repo>/push-uploads/{upload}/complete`, with each part's number and ETag in order, as the
46
- * bucket's `UploadPart`. It answers what `git-receive-pack` answers: report-status-v2 on
47
- * side-band-64k.
46
+ * bucket's `UploadPart`. The first hands the pack to the server's steps, and it answers
47
+ * `PushUploadReceiving` with 202 and `Retry-After` while they receive it; a client sends the same
48
+ * complete again until it answers what `git-receive-pack` answers: report-status-v2 on
49
+ * side-band-64k, the same report each time.
48
50
  */
49
51
  const FinishPushUpload = /* @__PURE__ */ Schema.Struct({ parts: Schema.Array(Schema.Struct({
50
52
  part: Schema.Int,
51
53
  etag: Schema.String
52
54
  })) });
55
+ /** Complete's 202, while the server receives the pack: the receive's steps taken so far. */
56
+ const PushUploadReceiving = /* @__PURE__ */ Schema.Struct({ step: Schema.Int });
53
57
  /** What a client POSTs to a push upload's routes: begin's body, complete's, or a part's, which is empty. */
54
58
  const PushUploadRequest = /* @__PURE__ */ Schema.Union([
55
59
  BeginPushUpload,
56
60
  FinishPushUpload,
57
61
  Schema.Record(Schema.String, Schema.Never)
58
62
  ]);
59
- export { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadRequest, PushUploadStarted };
63
+ export { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadReceiving, PushUploadRequest, PushUploadStarted };
@@ -1,10 +1,9 @@
1
1
  import { ActorInput, Caller, WriteInput } from "./actors.mjs";
2
2
  import { ByCalls, EffectCalls } from "./services.mjs";
3
- import { Awaitable, DecisionAnswer, GitError, Result } from "./result.mjs";
4
- import { Duration } from "./promises.mjs";
5
- import { TreeChange } from "./engine.mjs";
3
+ import { Duration } from "./time.mjs";
6
4
  import { RefName, RepoName } from "./ids.mjs";
7
5
  import { RepoInput } from "./repos.mjs";
6
+ import { DecisionAnswer, GitError, Result } from "./result.mjs";
8
7
  import * as Effect from "effect/Effect";
9
8
  import * as Schema from "effect/Schema";
10
9
  import { Listing, Page } from "@ref0/infra";
@@ -342,10 +341,9 @@ export declare const JoinInput: Schema.Struct<{
342
341
  readonly priority: Schema.optionalKey<Schema.Number>;
343
342
  readonly meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
344
343
  }>;
345
- readonly signal: Schema.declare<AbortSignal, AbortSignal>;
346
344
  }>;
347
345
  export type JoinInput = typeof JoinInput.Type;
348
- /** `changes()`: the head's tree against the target's, computed once when asked. */
346
+ /** `changes`: the head's tree against the target's, diffed on its first run and kept for the rest. */
349
347
  export declare const LanesInput: Schema.Struct<{
350
348
  readonly actor: Schema.Union<readonly [Schema.Struct<{
351
349
  readonly id: Schema.String;
@@ -365,8 +363,37 @@ export declare const LanesInput: Schema.Struct<{
365
363
  readonly priority: Schema.optionalKey<Schema.Number>;
366
364
  readonly meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
367
365
  }>;
368
- readonly signal: Schema.declare<AbortSignal, AbortSignal>;
369
- readonly changes: Schema.declare<() => Promise<readonly TreeChange[]>, () => Promise<readonly TreeChange[]>>;
366
+ readonly changes: Schema.declare<Effect.Effect<readonly {
367
+ readonly status: "A" | "D" | "M" | "R" | "T";
368
+ readonly path: string;
369
+ readonly from?: string;
370
+ readonly similarity?: number;
371
+ readonly old?: {
372
+ readonly mode: string;
373
+ readonly oid: string;
374
+ };
375
+ readonly new?: {
376
+ readonly mode: string;
377
+ readonly oid: string;
378
+ };
379
+ readonly pathBytes?: Uint8Array<ArrayBufferLike>;
380
+ readonly fromPathBytes?: Uint8Array<ArrayBufferLike>;
381
+ }[], GitError, never>, Effect.Effect<readonly {
382
+ readonly status: "A" | "D" | "M" | "R" | "T";
383
+ readonly path: string;
384
+ readonly from?: string;
385
+ readonly similarity?: number;
386
+ readonly old?: {
387
+ readonly mode: string;
388
+ readonly oid: string;
389
+ };
390
+ readonly new?: {
391
+ readonly mode: string;
392
+ readonly oid: string;
393
+ };
394
+ readonly pathBytes?: Uint8Array<ArrayBufferLike>;
395
+ readonly fromPathBytes?: Uint8Array<ArrayBufferLike>;
396
+ }[], GitError, never>>;
370
397
  }>;
371
398
  export type LanesInput = typeof LanesInput.Type;
372
399
  /**
@@ -402,9 +429,10 @@ export interface ReportOptions {
402
429
  readonly timeout?: Duration;
403
430
  }
404
431
  /**
405
- * The host's queue. Each function is pure but `join` and `lanes`, whose I/O gets a signal, aborted
406
- * after 30 seconds. A throw in `merge` or `lanes` fails the entry `host-error`; one in `bisect` or
407
- * a schedule function takes the default. Either is logged at `Error`, as `queue.merge` and the rest.
432
+ * The host's queue. Each function is pure but `join` and `lanes`, Effects that may do I/O, each
433
+ * interrupted after 30 seconds. A throw in `merge`, or a failure or defect of `lanes`, fails the
434
+ * entry `host-error`; a throw in `bisect` or a schedule function takes the default. Either is
435
+ * logged at `Error`, as `queue.merge` and the rest.
408
436
  */
409
437
  export interface MergeQueueOptions {
410
438
  /**
@@ -416,7 +444,7 @@ export interface MergeQueueOptions {
416
444
  readonly keys: QueueKeys;
417
445
  readonly merge: (input: MergeInput) => MergePlan;
418
446
  /** Whether an entry may join: a `Reject` refuses `add` and the push option with it. */
419
- readonly join?: (input: JoinInput) => Awaitable<DecisionAnswer>;
447
+ readonly join?: (input: JoinInput) => Effect.Effect<DecisionAnswer, GitError>;
420
448
  /**
421
449
  * The lanes an entry checks in: at most 8, each once, and each 1 to 64 bytes counted as UTF-8
422
450
  * JSON, quotes aside, so a control character counts 6. An answer past that fails the entry
@@ -436,7 +464,7 @@ export interface MergeQueueOptions {
436
464
  * merged judged `lane`. A land that conflicts restarts the candidate; at the land-restart limit,
437
465
  * 3, its entries are pinned, and one pinned candidate holds every lane until it ends.
438
466
  */
439
- readonly lanes?: (input: LanesInput) => Awaitable<LanesAnswer>;
467
+ readonly lanes?: (input: LanesInput) => Effect.Effect<LanesAnswer, GitError>;
440
468
  /** By default, halves the failed candidate. */
441
469
  readonly bisect?: Bisect;
442
470
  /**
@@ -2,7 +2,7 @@ import { Actor, ActorId } from "./actors.mjs";
2
2
  import { CommitMessage } from "./commits.mjs";
3
3
  import { Commit } from "./engine.mjs";
4
4
  import { Oid, RefName, RepoName } from "./ids.mjs";
5
- import { AbortSignalValue, FunctionValue } from "./opaque.mjs";
5
+ import { EffectValue } from "./opaque.mjs";
6
6
  import "./repos.mjs";
7
7
  import { Verdict, decisionAnswer } from "./result.mjs";
8
8
  import * as Effect from "effect/Effect";
@@ -188,10 +188,9 @@ Schema.Array(Commit);
188
188
  const JoinInput = /* @__PURE__ */ Schema.Struct({
189
189
  actor: Actor,
190
190
  repo: RepoName,
191
- entry: EntryFields,
192
- signal: AbortSignalValue
191
+ entry: EntryFields
193
192
  });
194
- ({ ...JoinInput.fields }), FunctionValue();
193
+ ({ ...JoinInput.fields }), EffectValue();
195
194
  /** One bisect group: at least one entry, none named twice. */
196
195
  const EntryGroup = /* @__PURE__ */ Schema.Array(EntryId).check(Schema.isMinLength(1), Schema.makeFilter((group) => new Set(group).size === group.length || "a bisect group names no entry twice"));
197
196
  /**