@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,9 +1,9 @@
1
1
  import { EffectCalls } from "./services.mjs";
2
- import { GitError, Result } from "./result.mjs";
3
2
  import { Caller } from "./actors.mjs";
4
3
  import { Acting } from "./blobs.mjs";
5
4
  import { DiffListing, ReadPage } from "./engine.mjs";
6
5
  import { RepoName } from "./ids.mjs";
6
+ import { GitError } from "./result.mjs";
7
7
  import { TreeEntry } from "./trees.mjs";
8
8
  import * as Effect from "effect/Effect";
9
9
  import * as Schema from "effect/Schema";
@@ -152,18 +152,18 @@ export declare const FileDiff: Schema.Union<readonly [Schema.Struct<{
152
152
  export type FileDiff = typeof FileDiff.Type;
153
153
  export interface FileCalls {
154
154
  /**
155
- * Files at a revision, each its `bytes` streamed as `blobs.get` streams a blob, to the file
156
- * limit, 100 MiB. A page holds as many as fit 8 MiB as base64, and a file past it alone, which
155
+ * Files at a revision, each its `bytes` streamed as `blobs.get` streams a blob, to the largest
156
+ * file a host may let a push take, 1 GiB. A page holds as many as fit 8 MiB as base64, and a file past it alone, which
157
157
  * REST sends with no content and its client streams from the blob route. Its `bytes` limit has
158
158
  * no default for a file's bytes: when the caller sets one, the page's files count against it.
159
159
  */
160
- readonly read: (repo: RepoName, input: Acting<FileReadInput>) => Promise<Result<FilesRead>>;
161
- readonly list: (repo: RepoName, input: Acting<FilesListInput>) => Promise<Result<Listing<TreeEntry>>>;
160
+ readonly read: (repo: RepoName, input: Acting<FileReadInput>) => Effect.Effect<FilesRead, GitError>;
161
+ readonly list: (repo: RepoName, input: Acting<FilesListInput>) => Effect.Effect<Listing<TreeEntry>, GitError>;
162
162
  /** `git diff <base> <head> -- <paths>`, a file at a time: `patch` unless `format` is `hunks`. */
163
- readonly diff: (repo: RepoName, input: Acting<FilesDiffInput>) => Promise<Result<DiffListing<FileDiff>>>;
163
+ readonly diff: (repo: RepoName, input: Acting<FilesDiffInput>) => Effect.Effect<DiffListing<FileDiff>, GitError>;
164
164
  }
165
165
  declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectCalls<{
166
- readonly read: (repo: string, input: Acting<FileReadInput>, by?: Caller<unknown> | undefined) => Promise<Result<{
166
+ readonly read: (repo: string, input: Acting<FileReadInput>, by?: Caller<unknown> | undefined) => Effect.Effect<{
167
167
  readonly files: {
168
168
  readonly items: {
169
169
  readonly path: string;
@@ -175,8 +175,8 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
175
175
  readonly next?: string;
176
176
  };
177
177
  readonly missing: readonly string[];
178
- }>>;
179
- readonly list: (repo: string, input: Acting<FilesListInput>, by?: Caller<unknown> | undefined) => Promise<Result<Listing<{
178
+ }, GitError, never>;
179
+ readonly list: (repo: string, input: Acting<FilesListInput>, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
180
180
  readonly name: string;
181
181
  readonly path: string;
182
182
  readonly mode: string;
@@ -184,8 +184,8 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
184
184
  readonly oid: string;
185
185
  readonly size?: number;
186
186
  readonly pathBytes?: Uint8Array<ArrayBufferLike>;
187
- }>>>;
188
- readonly diff: (repo: string, input: Acting<FilesDiffInput>, by?: Caller<unknown> | undefined) => Promise<Result<DiffListing<{
187
+ }>, GitError, never>;
188
+ readonly diff: (repo: string, input: Acting<FilesDiffInput>, by?: Caller<unknown> | undefined) => Effect.Effect<DiffListing<{
189
189
  readonly status: "A" | "D" | "M" | "R" | "T";
190
190
  readonly path: string;
191
191
  readonly from?: string;
@@ -236,7 +236,7 @@ declare const Files_base: Context.ServiceClass<Files, "@ref0/git/Files", EffectC
236
236
  readonly noNewline?: true;
237
237
  }[];
238
238
  }[];
239
- }>>>;
239
+ }>, GitError, never>;
240
240
  }, never>>;
241
241
  /**
242
242
  * A repo's files at a revision: read, listed and compared. `FileCalls` as Effects, each deciding for `by`. The server builds it inside its runtime's
@@ -1,8 +1,8 @@
1
1
  import { EffectCalls } from "./services.mjs";
2
- import { GitError, Result } from "./result.mjs";
3
2
  import { ActorInput, Caller, WriteInput } from "./actors.mjs";
4
3
  import { RepoName } from "./ids.mjs";
5
4
  import { RepoInfo, RepoInput } from "./repos.mjs";
5
+ import { GitError } from "./result.mjs";
6
6
  import * as Effect from "effect/Effect";
7
7
  import * as Schema from "effect/Schema";
8
8
  import { Listing, Page } from "@ref0/infra";
@@ -57,16 +57,18 @@ export interface ForkCalls {
57
57
  * `FAILED_PRECONDITION`, `reason: 'own-repo'`, when the default `id` is `repo` itself, as the
58
58
  * holder's own repo is (Q327).
59
59
  */
60
- readonly create: (repo: RepoName, input: ForkCreateInput) => Promise<Result<RepoInfo>>;
60
+ readonly create: (repo: RepoName, input: ForkCreateInput) => Effect.Effect<RepoInfo, GitError>;
61
61
  /** The holder's fork of `repo`, by the source's internal ID, across either's renames. */
62
- readonly get: (repo: RepoName, input: ForkGetInput) => Promise<Result<RepoInfo>>;
62
+ readonly get: (repo: RepoName, input: ForkGetInput) => Effect.Effect<RepoInfo, GitError>;
63
63
  /**
64
64
  * `repo`'s live forks, the newest first, each named as it's named now. A fork the caller may not
65
65
  * read is left out, and nothing counts it, so a page can be short while `next` says more may
66
66
  * follow. Each `next` is sealed for this source's list and names no fork, and one that isn't a
67
- * `next` of it is `INVALID_ARGUMENT`.
67
+ * `next` of it is `INVALID_ARGUMENT`. Unlike `Repos.list`'s names, each fork is read again
68
+ * once `authorize` answers, and one renamed or made public or private meanwhile is asked of again
69
+ * as it is now, so none is listed as it was.
68
70
  */
69
- readonly list: (repo: RepoName, input: ForkListInput) => Promise<Result<Listing<RepoInfo>>>;
71
+ readonly list: (repo: RepoName, input: ForkListInput) => Effect.Effect<Listing<RepoInfo>, GitError>;
70
72
  /**
71
73
  * Fast-forwards the fork's default branch to its source's, in one commit that takes the
72
74
  * source's list as `create` does, and leaves its other refs alone. A fork whose branch has
@@ -76,7 +78,7 @@ export interface ForkCalls {
76
78
  * A fork whose default branch, or its source's, the caller can't see is `FAILED_PRECONDITION`,
77
79
  * naming neither, the same whether or not the branch exists.
78
80
  */
79
- readonly sync: (fork: RepoName, input: WriteInput & Pick<RepoInput, 'internalId'>) => Promise<Result<RepoInfo>>;
81
+ readonly sync: (fork: RepoName, input: WriteInput & Pick<RepoInput, 'internalId'>) => Effect.Effect<RepoInfo, GitError>;
80
82
  /**
81
83
  * Copies every object its source lists into the fork, as `sync` does, and moves no ref, as
82
84
  * `git fetch upstream` does: the caller decides the move, such as `merges.create` of a diverged
@@ -92,14 +94,15 @@ export interface ForkCalls {
92
94
  * leaves no ref at a missing object. Refused as `sync` is, but never `diverged`, nor for a
93
95
  * default branch the caller can't see: `head` is left out instead.
94
96
  */
95
- readonly fetch: (fork: RepoName, input: ActorInput & Pick<RepoInput, 'internalId'>) => Promise<Result<ForkFetched>>;
97
+ readonly fetch: (fork: RepoName, input: ActorInput & Pick<RepoInput, 'internalId'>) => Effect.Effect<ForkFetched, GitError>;
96
98
  }
97
99
  declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectCalls<{
98
- readonly create: (repo: string, input: ForkCreateInput, by?: Caller<unknown> | undefined) => Promise<Result<{
100
+ readonly create: (repo: string, input: ForkCreateInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
99
101
  readonly name: string;
100
102
  readonly defaultBranch?: string;
101
103
  readonly public: boolean;
102
104
  readonly upstream?: string;
105
+ readonly shallow: boolean;
103
106
  readonly stats: {
104
107
  readonly repo: string;
105
108
  readonly refs: number;
@@ -121,12 +124,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
121
124
  readonly state: "too-large";
122
125
  };
123
126
  };
124
- }>>;
125
- readonly get: (repo: string, input: ForkGetInput, by?: Caller<unknown> | undefined) => Promise<Result<{
127
+ }, GitError, never>;
128
+ readonly get: (repo: string, input: ForkGetInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
126
129
  readonly name: string;
127
130
  readonly defaultBranch?: string;
128
131
  readonly public: boolean;
129
132
  readonly upstream?: string;
133
+ readonly shallow: boolean;
130
134
  readonly stats: {
131
135
  readonly repo: string;
132
136
  readonly refs: number;
@@ -148,12 +152,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
148
152
  readonly state: "too-large";
149
153
  };
150
154
  };
151
- }>>;
152
- readonly list: (repo: string, input: ForkListInput, by?: Caller<unknown> | undefined) => Promise<Result<Listing<{
155
+ }, GitError, never>;
156
+ readonly list: (repo: string, input: ForkListInput, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
153
157
  readonly name: string;
154
158
  readonly defaultBranch?: string;
155
159
  readonly public: boolean;
156
160
  readonly upstream?: string;
161
+ readonly shallow: boolean;
157
162
  readonly stats: {
158
163
  readonly repo: string;
159
164
  readonly refs: number;
@@ -175,12 +180,13 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
175
180
  readonly state: "too-large";
176
181
  };
177
182
  };
178
- }>>>;
179
- readonly sync: (fork: string, input: WriteInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) => Promise<Result<{
183
+ }>, GitError, never>;
184
+ readonly sync: (fork: string, input: WriteInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) => Effect.Effect<{
180
185
  readonly name: string;
181
186
  readonly defaultBranch?: string;
182
187
  readonly public: boolean;
183
188
  readonly upstream?: string;
189
+ readonly shallow: boolean;
184
190
  readonly stats: {
185
191
  readonly repo: string;
186
192
  readonly refs: number;
@@ -202,15 +208,15 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
202
208
  readonly state: "too-large";
203
209
  };
204
210
  };
205
- }>>;
206
- readonly fetch: (fork: string, input: ActorInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) => Promise<Result<{
211
+ }, GitError, never>;
212
+ readonly fetch: (fork: string, input: ActorInput<unknown> & Pick<RepoInput, "internalId">, by?: Caller<unknown> | undefined) => Effect.Effect<{
207
213
  readonly source: string;
208
214
  readonly head?: string;
209
215
  readonly tips: readonly {
210
216
  readonly name: string;
211
217
  readonly oid: string;
212
218
  }[];
213
- }>>;
219
+ }, GitError, never>;
214
220
  }, never>>;
215
221
  /**
216
222
  * A repo's forks: made, read, listed, and synced with or fetched from their parent. `ForkCalls` as Effects, each deciding for `by`. The server builds it inside its runtime's
@@ -222,6 +228,7 @@ export declare const create: (repo: RepoName, input: ForkCreateInput, by?: Calle
222
228
  readonly defaultBranch?: string;
223
229
  readonly public: boolean;
224
230
  readonly upstream?: string;
231
+ readonly shallow: boolean;
225
232
  readonly stats: {
226
233
  readonly repo: string;
227
234
  readonly refs: number;
@@ -249,6 +256,7 @@ export declare const get: (repo: RepoName, input: ForkGetInput, by?: Caller) =>
249
256
  readonly defaultBranch?: string;
250
257
  readonly public: boolean;
251
258
  readonly upstream?: string;
259
+ readonly shallow: boolean;
252
260
  readonly stats: {
253
261
  readonly repo: string;
254
262
  readonly refs: number;
@@ -276,6 +284,7 @@ export declare const list: (repo: RepoName, input: ForkListInput, by?: Caller) =
276
284
  readonly defaultBranch?: string;
277
285
  readonly public: boolean;
278
286
  readonly upstream?: string;
287
+ readonly shallow: boolean;
279
288
  readonly stats: {
280
289
  readonly repo: string;
281
290
  readonly refs: number;
@@ -303,6 +312,7 @@ export declare const sync: (fork: RepoName, input: WriteInput & Pick<RepoInput,
303
312
  readonly defaultBranch?: string;
304
313
  readonly public: boolean;
305
314
  readonly upstream?: string;
315
+ readonly shallow: boolean;
306
316
  readonly stats: {
307
317
  readonly repo: string;
308
318
  readonly refs: number;
@@ -2,7 +2,7 @@ import { GitEvent } from "./events.mjs";
2
2
  import { SavedHandlerOptions } from "./handlers.mjs";
3
3
  import * as Effect from "effect/Effect";
4
4
  declare namespace git_events_d_exports {
5
- export { DeliveryOptions, EventType, Group, GroupHandler, Handlers, Run, group };
5
+ export { DeliveryOptions, EventType, EventsOptions, Group, GroupHandler, Handlers, Run, group };
6
6
  }
7
7
  /** An event's type, such as `ref.updated`. */
8
8
  export type EventType = GitEvent['type'];
@@ -19,6 +19,34 @@ export interface Run<Event extends GitEvent = GitEvent> {
19
19
  * at most for three days by default.
20
20
  */
21
21
  export type DeliveryOptions = Omit<SavedHandlerOptions<unknown>, 'handler'>;
22
+ /**
23
+ * The host's events settings, `Git.layer`'s `events`. `retired` names each delivery the host has
24
+ * dropped for good, at most 64, `retiredLimit`, each under a delivery name's rules. Once each
25
+ * instance is live, it writes the list as its rows in `git/repos`, and deletes the row of a name
26
+ * the list no longer holds, till the write lands or a later start's does. The store orders the
27
+ * starts: a start whose write lands after a later start's writes nothing, and so does one whose
28
+ * list the rows already hold. A name it runs through `Git.addDelivery` too fails the start.
29
+ *
30
+ * A deleted repo's `git.purge` waits on the job of a delivery the server doesn't run, as on any
31
+ * delivery's, until a retirement row names it: then it claims and ends the job, unless a try of it
32
+ * runs. A restore, a start that runs the delivery again, takes effect when its write lands: a
33
+ * purge's end decided before then stands, and a settle it decided can still land after.
34
+ *
35
+ * Never change a name here and its `Git.addDelivery` in the same deploy (#2602). Mid-rollout, the
36
+ * start whose write lands last wins, whatever its list, so an instance that still runs the delivery
37
+ * could find it retired. To retire one, a deploy drops its `Git.addDelivery`, and once that deploy
38
+ * has rolled out, the next adds its name here. A queue claims only the jobs of the deliveries it
39
+ * registers, so an instance that still registers it, mid-deploy, goes on sending to it until it
40
+ * restarts.
41
+ *
42
+ * Retiring gives up what the delivery was owed: the purge settles its job unsent, `repo.deleted`
43
+ * included, and deletes the repo's events. To run it again, a deploy drops its name here, and once
44
+ * that has rolled out, the next adds its `Git.addDelivery` back: it then sends what the repos that
45
+ * remain owe it, and never what a purge settled while it was retired.
46
+ */
47
+ export interface EventsOptions {
48
+ readonly retired?: readonly string[];
49
+ }
22
50
  /** One handler of a group: the types it takes, and what it runs for a run of them. */
23
51
  export interface GroupHandler<R> {
24
52
  readonly types: ReadonlySet<EventType>;
@@ -1,4 +1,4 @@
1
- import { Duration } from "./promises.mjs";
1
+ import { Duration } from "./time.mjs";
2
2
  import { DecisionAnswer, GitError } from "./result.mjs";
3
3
  import { PushContext } from "./rules.mjs";
4
4
  import * as Effect from "effect/Effect";
@@ -1,4 +1,5 @@
1
1
  import { Caller } from "./actors.mjs";
2
+ import { CallAllowance } from "./call-allowance.mjs";
2
3
  import { TreeChange } from "./engine.mjs";
3
4
  import { DeliveryOptions, Group } from "./git-events.mjs";
4
5
  import { GrantResolver } from "./grants.mjs";
@@ -12,11 +13,13 @@ import * as Option from "effect/Option";
12
13
  import { Committed, CurrentJob, Job, Key, Moment, Read, Records, Row, WatchedRow } from "@ref0/infra";
13
14
  import * as Context from "effect/Context";
14
15
  import * as Stream from "effect/Stream";
16
+ import * as Duration from "effect/Duration";
15
17
  /**
16
18
  * The host, acting as itself (Q223): the caller host code's calls name, as `hostCalls()` do. A
17
19
  * call made by it skips the host's `authorize`, but for a push rule's bypass, sees every ref,
18
- * private or not, and lists every repo. Only this one value is the host: a copy of it, or any
19
- * caller built to look like it, is an anonymous caller, refused what a stranger is.
20
+ * private or not, but an owned prefix's, which only its owner reads, and lists every repo. Only
21
+ * this one value is the host: a copy of it, or any caller built to look like it, is an anonymous
22
+ * caller, refused what a stranger is.
20
23
  */
21
24
  export declare const host: Caller;
22
25
  /** Whether `caller` is `host` itself, the one value that is. */
@@ -40,11 +43,19 @@ export interface RegisterInput {
40
43
  */
41
44
  readonly repoScopes?: (repo: InternalRepoId) => readonly string[];
42
45
  /**
43
- * A registered prefix, such as `refs/queue/`: a ref under it only the registration moves, and only a
44
- * caller who reads every private pattern sees. No two registrations' prefixes overlap, none overlaps
45
- * Git's own `refs/import/`, and none is under `refs/heads/` or `refs/tags/`.
46
+ * A registered prefix, such as `refs/queue/`: a ref under it only the registration moves, and
47
+ * only a caller who reads every private pattern sees, or with `refsReadBy: 'owner'` only the
48
+ * registration. No two registrations' prefixes overlap, none overlaps Git's own `refs/import/`,
49
+ * and none is under `refs/heads/` or `refs/tags/`.
46
50
  */
47
51
  readonly refs?: `refs/${string}/`;
52
+ /**
53
+ * Who reads `refs`' refs. `readers`, when left out: a caller who reads every private pattern, as
54
+ * above. `owner`: the registration alone, with its `owner` on `refs.get`. No listing, count,
55
+ * fetch, fork or other `refs.get` shows one, whatever the caller reads, such as the drop-in's
56
+ * merge fences. Given with no `refs`, it fails the build.
57
+ */
58
+ readonly refsReadBy?: 'readers' | 'owner';
48
59
  /**
49
60
  * Prefixes whose refs `Git.host` writes for someone with `refs.update`'s `onBehalfOf`, such as
50
61
  * `refs/pull/`: every reader of the repo sees them, and anyone with push may move them too. Each
@@ -54,8 +65,10 @@ export interface RegisterInput {
54
65
  readonly publishes?: readonly `refs/${string}/`[];
55
66
  }
56
67
  /**
57
- * What only a registered prefix's owner holds: it moves the prefix's refs, which no one else sees.
58
- * Only Git's registry makes one, as a registration's `owner`: a copy of it owns nothing.
68
+ * What only a registered prefix's owner holds: it moves the prefix's refs, which no one else does,
69
+ * and reads them through any view. An owned prefix's, registered with `refsReadBy: 'owner'`, no
70
+ * one else reads either. Only Git's registry makes one, as a registration's `owner`: a copy of it
71
+ * owns nothing.
59
72
  */
60
73
  export interface RefOwner {
61
74
  readonly prefix: `refs/${string}/`;
@@ -201,6 +214,25 @@ export interface Registration {
201
214
  readonly rows: RegisteredRows;
202
215
  /** Charged records held to the registration's scopes; failures are GitError, outside access a defect. */
203
216
  readonly records: RegisteredRecords;
217
+ /** The server's `basePath`, which Git's routes and a registration's own sit beneath: `''` at the root. */
218
+ readonly basePath: string;
219
+ /**
220
+ * The server's `fetchLimits.milliseconds`: core's purge drops a deleted repo's scopes, the
221
+ * registration's among them, no sooner than this past the delete, so a write that read the repo
222
+ * live and lands by `heldUntil` lands before the drop.
223
+ */
224
+ readonly fetchWindow: Duration.Duration;
225
+ /**
226
+ * Adds `check` to `Git.layer`'s seal, which runs it once every feature has built, after the push
227
+ * rules' sources and before any job registers: a check that dies fails the build with its defect.
228
+ */
229
+ readonly addSealCheck: (check: Effect.Effect<void>) => Effect.Effect<void>;
230
+ /**
231
+ * A fresh budget for one request the registration serves, counting from its first call against
232
+ * the adapter's whole `callLimits`, as Git's REST counts one. Provided as `CallBudget`, it nests
233
+ * every call the request makes.
234
+ */
235
+ readonly allowance: () => CallAllowance;
204
236
  readonly addPushCheck: (check: Hook<PushCheck>) => Effect.Effect<void>;
205
237
  /**
206
238
  * The registration's one delivery, named after it, its job `git.deliver.<registration name>`: `group`'s
@@ -4,8 +4,9 @@ import * as Context from "effect/Context";
4
4
  /**
5
5
  * The host, acting as itself (Q223): the caller host code's calls name, as `hostCalls()` do. A
6
6
  * call made by it skips the host's `authorize`, but for a push rule's bypass, sees every ref,
7
- * private or not, and lists every repo. Only this one value is the host: a copy of it, or any
8
- * caller built to look like it, is an anonymous caller, refused what a stranger is.
7
+ * private or not, but an owned prefix's, which only its owner reads, and lists every repo. Only
8
+ * this one value is the host: a copy of it, or any caller built to look like it, is an anonymous
9
+ * caller, refused what a stranger is.
9
10
  */
10
11
  const host = Object.freeze({ actor: Object.freeze({ anonymous: true }) });
11
12
  /** Whether `caller` is `host` itself, the one value that is. */
@@ -1,4 +1,5 @@
1
- import { Awaitable } from "./result.mjs";
1
+ import { GitError } from "./result.mjs";
2
+ import * as Effect from "effect/Effect";
2
3
  import * as Schema from "effect/Schema";
3
4
  export declare const GrantInput: Schema.Struct<{
4
5
  readonly credentials: Schema.Union<readonly [Schema.Struct<{
@@ -49,7 +50,14 @@ export declare const Grant: Schema.Struct<{
49
50
  * that repo from the list.
50
51
  */
51
52
  readonly reach: Schema.optionalKey<Schema.String>;
52
- readonly reaches: Schema.declare<(input: GrantReachInput) => Awaitable<boolean>, (input: GrantReachInput) => Awaitable<boolean>>;
53
+ /**
54
+ * Whether this grant reaches `input.repo`. Runs in the caller's fiber, so ordinary fiber
55
+ * interruption stops its reads; implementers must also honour `input.signal` (including one
56
+ * already aborted), stop reading, and fail with a typed `UNAVAILABLE` `GitError` on abort
57
+ * (for example, failing immediately when `input.signal.aborted` and otherwise racing the read
58
+ * against an `Effect.callback` listening for `'abort'` with `Effect.raceFirst`).
59
+ */
60
+ readonly reaches: Schema.declare<(input: GrantReachInput) => Effect.Effect<boolean, GitError>, (input: GrantReachInput) => Effect.Effect<boolean, GitError>>;
53
61
  }>;
54
62
  export type Grant = typeof Grant.Type;
55
63
  /** A grant asked for again by the `id` it had, with the actor and subject it acted as then. */
@@ -79,6 +87,18 @@ export type GrantAgainRequest = Omit<GrantAgainInput, 'signal'> & {
79
87
  */
80
88
  export interface GrantResolver {
81
89
  readonly name: string;
82
- readonly resolve: (input: GrantInput) => Awaitable<Grant | undefined>;
83
- readonly again: (input: GrantAgainInput) => Awaitable<Grant | undefined>;
90
+ /**
91
+ * Runs in the caller's fiber, so ordinary fiber interruption stops its reads; implementers must
92
+ * also honour `input.signal` (including one already aborted), stop reading, and fail with a
93
+ * typed `UNAVAILABLE` `GitError` on abort (for example, failing immediately when
94
+ * `input.signal.aborted` and otherwise racing the read against an `Effect.callback` listening
95
+ * for `'abort'` with `Effect.raceFirst`).
96
+ */
97
+ readonly resolve: (input: GrantInput) => Effect.Effect<Grant | undefined, GitError>;
98
+ /**
99
+ * Runs in the caller's fiber, with the same `input.signal` contract as `resolve`: honour an
100
+ * already-aborted or later-aborted signal, stop reading, and fail with a typed `UNAVAILABLE`
101
+ * `GitError`.
102
+ */
103
+ readonly again: (input: GrantAgainInput) => Effect.Effect<Grant | undefined, GitError>;
84
104
  }
@@ -1,4 +1,4 @@
1
- import { Duration } from "./promises.mjs";
1
+ import { Duration } from "./time.mjs";
2
2
  import { Retry } from "@ref0/infra";
3
3
  /** A host function Git calls inside a request or a job, with the length of one try. */
4
4
  export interface HandlerOptions<Handler> {
@@ -2,8 +2,9 @@ import { ActorInput } from "./actors.mjs";
2
2
  import { RepoName } from "./ids.mjs";
3
3
  import "./objects.mjs";
4
4
  import { RepoInput } from "./repos.mjs";
5
- import { Result } from "./result.mjs";
5
+ import { GitError } from "./result.mjs";
6
6
  import { Bytes } from "./object-values.mjs";
7
+ import * as Effect from "effect/Effect";
7
8
  /**
8
9
  * The caps an upload through the server meets, on a bucket that signs no links, so each upload's
9
10
  * bytes stream through it: an upload past what they let finish is refused at the batch, 422, and
@@ -17,13 +18,6 @@ export interface LfsOptions {
17
18
  /** The CPU one of the host's requests may use, in milliseconds, as a Worker's `limits.cpu_ms`. */
18
19
  readonly cpuMs?: number;
19
20
  }
20
- /**
21
- * Turns on Git LFS: `lfs()`, from `@ref0/git`, which `createGitServer` builds `Lfs.layer()` for,
22
- * with its options. A bucket alone turns nothing on.
23
- */
24
- export interface LfsFeature extends LfsOptions {
25
- readonly kind: 'lfs';
26
- }
27
21
  /** An LFS object, by its oid, the SHA-256 of its bytes in 64 hex digits. */
28
22
  export interface LfsGetInput extends ActorInput, Pick<RepoInput, 'internalId'> {
29
23
  readonly oid: string;
@@ -32,6 +26,20 @@ export interface LfsGetInput extends ActorInput, Pick<RepoInput, 'internalId'> {
32
26
  /** The HTTP request the read serves, which the host's fetch rules see: none for a direct read. */
33
27
  readonly request?: Request | undefined;
34
28
  }
29
+ /** LFS objects, each by the oid and size its pointer names: 1 to 1,000, duplicates allowed. */
30
+ export interface LfsGetManyInput extends ActorInput, Pick<RepoInput, 'internalId'> {
31
+ readonly objects: readonly {
32
+ readonly oid: string;
33
+ readonly size: number;
34
+ }[];
35
+ /**
36
+ * What ends the handle: its owner aborts it when the work the read serves ends, answered or not,
37
+ * and an open after it, or opening as it comes, fails `handle-ended`.
38
+ */
39
+ readonly signal: AbortSignal;
40
+ /** The HTTP request the read serves, which the host's fetch rules see: none for a direct read. */
41
+ readonly request?: Request | undefined;
42
+ }
35
43
  /** An LFS object: its oid, its size in bytes, and its bytes, streamed from the bucket. */
36
44
  export interface LfsObject {
37
45
  readonly oid: string;
@@ -46,5 +54,16 @@ export interface LfsCalls {
46
54
  * or on a server without `Lfs.layer()`; `DATA_LOSS` for a listed object whose bytes are gone. `signal`
47
55
  * aborted cancels the bucket's stream.
48
56
  */
49
- readonly get: (repo: RepoName, input: LfsGetInput) => Promise<Result<LfsObject>>;
57
+ readonly get: (repo: RepoName, input: LfsGetInput) => Effect.Effect<LfsObject, GitError>;
58
+ }
59
+ /**
60
+ * What `Lfs.getMany` answered: `readable`, each object the caller may read, by its oid and size,
61
+ * in the order asked, and `open`, which reads one of them from the bucket.
62
+ */
63
+ export interface LfsObjects {
64
+ readonly readable: readonly {
65
+ readonly oid: string;
66
+ readonly size: number;
67
+ }[];
68
+ readonly open: (oid: string) => Effect.Effect<LfsObject, GitError>;
50
69
  }
@@ -1,7 +1,8 @@
1
1
  import { WriteInput } from "./actors.mjs";
2
2
  import { RepoName } from "./ids.mjs";
3
3
  import { RepoInput } from "./repos.mjs";
4
- import { Result } from "./result.mjs";
4
+ import { GitError } from "./result.mjs";
5
+ import * as Effect from "effect/Effect";
5
6
  import * as Schema from "effect/Schema";
6
7
  /**
7
8
  * `git merge --no-ff <theirs>` on the branch `ours`, published there: a merge commit whose
@@ -81,5 +82,5 @@ export declare const MergeAnswer: Schema.Union<readonly [Schema.Struct<{
81
82
  export type MergeAnswer = typeof MergeAnswer.Type;
82
83
  export interface MergeCalls {
83
84
  /** A conflict fails `FAILED_PRECONDITION` with `merge-conflict`, and writes nothing. */
84
- readonly create: (repo: RepoName, input: MergeCreateInput) => Promise<Result<MergeAnswer>>;
85
+ readonly create: (repo: RepoName, input: MergeCreateInput) => Effect.Effect<MergeAnswer, GitError>;
85
86
  }