@ref0/git 0.20.0 → 0.26.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 (379) hide show
  1. package/dist/access/private-refs.mjs +1 -1
  2. package/dist/auth/access-jwt.mjs +3 -3
  3. package/dist/auth/auth-namespace.d.mts +3 -3
  4. package/dist/auth/auth-namespace.mjs +3 -2
  5. package/dist/auth/auth.d.mts +3 -3
  6. package/dist/auth/auth.mjs +9 -8
  7. package/dist/auth/authorize.mjs +1 -1
  8. package/dist/auth/fences.d.mts +1 -1
  9. package/dist/auth/host-function.mjs +1 -1
  10. package/dist/auth/host-services.mjs +4 -6
  11. package/dist/auth/identify.d.mts +1 -1
  12. package/dist/auth/identify.mjs +6 -0
  13. package/dist/auth/token-cleanup.mjs +2 -2
  14. package/dist/auth/token-rows.mjs +6 -1
  15. package/dist/auth/token-text.mjs +1 -1
  16. package/dist/auth/tokens-base.d.mts +1 -1
  17. package/dist/auth/tokens.d.mts +1 -1
  18. package/dist/auth/tokens.mjs +1 -1
  19. package/dist/client/client.d.mts +15 -7
  20. package/dist/client/client.mjs +21 -12
  21. package/dist/client/git-http.mjs +1 -1
  22. package/dist/client/local.mjs +60 -24
  23. package/dist/client/negotiate.mjs +3 -3
  24. package/dist/client/push-upload.mjs +26 -10
  25. package/dist/client/remote.mjs +4 -3
  26. package/dist/client/run-remote-helper.d.mts +2 -2
  27. package/dist/client/run-remote-helper.mjs +6 -6
  28. package/dist/client/slice-push.d.mts +1 -1
  29. package/dist/client/transport.mjs +3 -3
  30. package/dist/contracts/blobs.d.mts +3 -3
  31. package/dist/contracts/blobs.mjs +1 -1
  32. package/dist/contracts/calls-spent.mjs +5 -33
  33. package/dist/contracts/client.d.mts +15 -14
  34. package/dist/contracts/commits.d.mts +4 -4
  35. package/dist/contracts/commits.mjs +1 -1
  36. package/dist/contracts/engine.d.mts +2 -2
  37. package/dist/contracts/events.d.mts +1 -1
  38. package/dist/contracts/events.mjs +1 -1
  39. package/dist/contracts/files.d.mts +4 -4
  40. package/dist/contracts/files.mjs +1 -1
  41. package/dist/contracts/forks.d.mts +4 -4
  42. package/dist/contracts/forks.mjs +1 -1
  43. package/dist/contracts/git-hooks.d.mts +1 -1
  44. package/dist/contracts/git.d.mts +9 -5
  45. package/dist/contracts/grants.d.mts +1 -1
  46. package/dist/contracts/merges.d.mts +1 -1
  47. package/dist/contracts/object-values.d.mts +1 -0
  48. package/dist/contracts/object-values.mjs +16 -1
  49. package/dist/contracts/objects.d.mts +30 -18
  50. package/dist/contracts/opaque.mjs +1 -1
  51. package/dist/contracts/operations.mjs +1 -1
  52. package/dist/contracts/queue.d.mts +208 -44
  53. package/dist/contracts/queue.mjs +5 -5
  54. package/dist/contracts/refs.d.mts +5 -5
  55. package/dist/contracts/refs.mjs +1 -1
  56. package/dist/contracts/remote.d.mts +3 -6
  57. package/dist/contracts/repos.d.mts +3 -3
  58. package/dist/contracts/repos.mjs +1 -1
  59. package/dist/contracts/result.d.mts +10 -7
  60. package/dist/contracts/result.mjs +8 -3
  61. package/dist/contracts/rules.d.mts +13 -12
  62. package/dist/contracts/server.d.mts +8 -10
  63. package/dist/contracts/services.d.mts +6 -9
  64. package/dist/contracts/services.mjs +1 -2
  65. package/dist/contracts/signin.d.mts +1 -1
  66. package/dist/contracts/store.d.mts +2 -2
  67. package/dist/contracts/sync.d.mts +63 -6
  68. package/dist/contracts/sync.mjs +3 -2
  69. package/dist/contracts/tags.d.mts +3 -3
  70. package/dist/contracts/tags.mjs +1 -1
  71. package/dist/contracts/tokens.d.mts +2 -2
  72. package/dist/contracts/tokens.mjs +1 -1
  73. package/dist/contracts/topics.d.mts +9 -9
  74. package/dist/contracts/trees.d.mts +4 -4
  75. package/dist/contracts/trees.mjs +1 -1
  76. package/dist/contracts/work.d.mts +4 -4
  77. package/dist/contracts/work.mjs +2 -2
  78. package/dist/core/access.d.mts +1 -1
  79. package/dist/core/ancestry.mjs +30 -34
  80. package/dist/core/{promise.mjs → call-groups.mjs} +7 -30
  81. package/dist/core/call-services.mjs +1 -1
  82. package/dist/core/events/deliver.d.mts +2 -2
  83. package/dist/core/events/deliver.mjs +3 -3
  84. package/dist/core/events/retired.mjs +1 -1
  85. package/dist/core/forks.mjs +5 -5
  86. package/dist/core/hooks/groups.mjs +2 -2
  87. package/dist/core/imports.mjs +101 -21
  88. package/dist/core/index-job.mjs +14 -9
  89. package/dist/core/index-lost.d.mts +1 -1
  90. package/dist/core/loose-tally.mjs +38 -15
  91. package/dist/core/merge-parts.d.mts +17 -4
  92. package/dist/core/merge-parts.mjs +7 -2
  93. package/dist/core/mirror-rows.mjs +31 -1
  94. package/dist/core/objects/blobs.mjs +8 -10
  95. package/dist/core/objects/files.mjs +20 -17
  96. package/dist/core/objects/objects-layer.mjs +1 -1
  97. package/dist/core/objects/peel.mjs +1 -7
  98. package/dist/core/objects/reading.mjs +19 -18
  99. package/dist/core/objects/tree-edits.mjs +1 -1
  100. package/dist/core/objects/trees.mjs +257 -58
  101. package/dist/core/objects/writing.mjs +3 -9
  102. package/dist/core/own-writes.mjs +1 -1
  103. package/dist/core/parts.d.mts +8 -1
  104. package/dist/core/parts.mjs +8 -4
  105. package/dist/core/purge.mjs +31 -18
  106. package/dist/core/push.d.mts +2 -2
  107. package/dist/core/push.mjs +145 -98
  108. package/dist/core/receipts.d.mts +2 -2
  109. package/dist/core/receipts.mjs +9 -2
  110. package/dist/core/ref-index-job.mjs +4 -4
  111. package/dist/core/ref-view.mjs +74 -31
  112. package/dist/core/refs.mjs +3 -3
  113. package/dist/core/repack.mjs +25 -30
  114. package/dist/core/repo-info.mjs +1 -1
  115. package/dist/core/repos.mjs +1 -1
  116. package/dist/core/rules/changes.mjs +18 -40
  117. package/dist/core/rules/check.mjs +6 -5
  118. package/dist/core/rules/commit-changes.mjs +114 -58
  119. package/dist/core/rules/context.d.mts +3 -3
  120. package/dist/core/rules/context.mjs +18 -14
  121. package/dist/core/rules/fetch.mjs +1 -1
  122. package/dist/core/rules/protect.mjs +30 -17
  123. package/dist/core/saved-caller-views.d.mts +1 -1
  124. package/dist/core/saved-caller-views.mjs +3 -3
  125. package/dist/core/saved-callers.d.mts +1 -1
  126. package/dist/core/saved-callers.mjs +1 -1
  127. package/dist/core/seam.d.mts +1 -2
  128. package/dist/core/view.d.mts +6 -3
  129. package/dist/core/view.mjs +11 -10
  130. package/dist/core/work.mjs +2 -2
  131. package/dist/engine/allotted-xdiff.mjs +3 -16
  132. package/dist/engine/combined.d.mts +3 -0
  133. package/dist/engine/combined.mjs +200 -185
  134. package/dist/engine/content.d.mts +2 -2
  135. package/dist/engine/content.mjs +1 -1
  136. package/dist/engine/merge.mjs +7 -9
  137. package/dist/engine/reads.d.mts +2 -2
  138. package/dist/engine/reads.mjs +22 -14
  139. package/dist/engine/xdiff.d.mts +1 -1
  140. package/dist/engine/xdiff.mjs +1 -1
  141. package/dist/event-streams/event-streams.d.mts +1 -1
  142. package/dist/event-streams/event-streams.mjs +1 -1
  143. package/dist/event-streams/stream.d.mts +2 -2
  144. package/dist/event-streams/stream.mjs +3 -3
  145. package/dist/extend.d.mts +2 -6
  146. package/dist/extend.mjs +1 -5
  147. package/dist/http/core-parts.mjs +83 -26
  148. package/dist/http/handler.mjs +54 -9
  149. package/dist/http/parts.d.mts +1 -0
  150. package/dist/http/push-upload-job.mjs +138 -24
  151. package/dist/http/push-uploads.mjs +2 -2
  152. package/dist/http/receive-pack.mjs +14 -53
  153. package/dist/http/request-snapshot.mjs +258 -0
  154. package/dist/http/upload-pack.mjs +23 -18
  155. package/dist/index.d.mts +29 -21
  156. package/dist/index.mjs +11 -2
  157. package/dist/lfs/base.d.mts +1 -1
  158. package/dist/lfs/copy.d.mts +49 -1
  159. package/dist/lfs/copy.mjs +135 -22
  160. package/dist/lfs/layer.d.mts +4 -3
  161. package/dist/lfs/layer.mjs +4 -5
  162. package/dist/lfs/locks.mjs +2 -2
  163. package/dist/lfs/objects.d.mts +1 -1
  164. package/dist/lfs/objects.mjs +3 -3
  165. package/dist/lfs/pointers.mjs +1 -1
  166. package/dist/lfs/rows.d.mts +1 -1
  167. package/dist/lfs/rows.mjs +11 -4
  168. package/dist/lfs/upkeep.mjs +40 -9
  169. package/dist/lfs/uploaded.mjs +1 -1
  170. package/dist/lfs/wire.mjs +1 -1
  171. package/dist/merges/merges.mjs +17 -2
  172. package/dist/protocol/bytes/buffers.d.mts +1 -1
  173. package/dist/protocol/bytes/buffers.mjs +1 -1
  174. package/dist/protocol/bytes/deflate.d.mts +1 -1
  175. package/dist/protocol/bytes/deflate.mjs +1 -1
  176. package/dist/protocol/bytes/inflate.d.mts +1 -1
  177. package/dist/protocol/bytes/inflate.mjs +1 -1
  178. package/dist/protocol/bytes/sha1.d.mts +1 -1
  179. package/dist/protocol/bytes/sha1.mjs +1 -1
  180. package/dist/protocol/diff/read.d.mts +2 -1
  181. package/dist/protocol/diff/read.mjs +102 -8
  182. package/dist/protocol/packs/graph.mjs +1 -1
  183. package/dist/protocol/packs/idx.d.mts +1 -1
  184. package/dist/protocol/packs/idx.mjs +1 -1
  185. package/dist/protocol/packs/parts.mjs +1 -1
  186. package/dist/protocol/packs/reader.d.mts +1 -1
  187. package/dist/protocol/packs/reader.mjs +1 -1
  188. package/dist/protocol/packs/write-error.d.mts +1 -1
  189. package/dist/protocol/packs/write-error.mjs +1 -1
  190. package/dist/protocol/packs/writer.mjs +3 -3
  191. package/dist/protocol/wire/advertisement.d.mts +1 -1
  192. package/dist/protocol/wire/advertisement.mjs +3 -2
  193. package/dist/protocol/wire/fetch.d.mts +1 -1
  194. package/dist/protocol/wire/fetch.mjs +1 -1
  195. package/dist/protocol/wire/lines.d.mts +9 -1
  196. package/dist/protocol/wire/lines.mjs +28 -1
  197. package/dist/protocol/wire/push-uploads.mjs +10 -7
  198. package/dist/protocol/wire/receive-pack.d.mts +1 -1
  199. package/dist/protocol/wire/receive-pack.mjs +1 -1
  200. package/dist/protocol/wire/report-status.d.mts +1 -1
  201. package/dist/protocol/wire/report-status.mjs +1 -1
  202. package/dist/protocol/wire/v2.d.mts +1 -1
  203. package/dist/protocol/wire/v2.mjs +1 -1
  204. package/dist/queue/advance.mjs +31 -24
  205. package/dist/queue/base.d.mts +5 -3
  206. package/dist/queue/calls.mjs +5 -5
  207. package/dist/queue/commit.mjs +1 -1
  208. package/dist/queue/host.d.mts +1 -1
  209. package/dist/queue/layer.d.mts +0 -1
  210. package/dist/queue/layer.mjs +9 -5
  211. package/dist/queue/schedule.mjs +1 -1
  212. package/dist/queue/search.mjs +1 -1
  213. package/dist/queue/state.mjs +1 -1
  214. package/dist/queue/trim.mjs +2 -2
  215. package/dist/rest/client.d.mts +1 -1
  216. package/dist/rest/client.mjs +6 -6
  217. package/dist/rest/errors.mjs +1 -1
  218. package/dist/rest/handler.mjs +2 -2
  219. package/dist/rest/handlers.mjs +16 -6
  220. package/dist/rest/layer.mjs +1 -1
  221. package/dist/rest/listen.mjs +2 -2
  222. package/dist/rest/refs.mjs +1 -1
  223. package/dist/server/edge.mjs +27 -3
  224. package/dist/server/git-layer.d.mts +1 -2
  225. package/dist/server/git-layer.mjs +4 -5
  226. package/dist/server/lifecycle.mjs +1 -1
  227. package/dist/server/registry.mjs +2 -8
  228. package/dist/server/server.mjs +62 -43
  229. package/dist/signin/context.d.mts +1 -1
  230. package/dist/signin/context.mjs +1 -1
  231. package/dist/signin/forms.mjs +1 -1
  232. package/dist/signin/grants.d.mts +2 -2
  233. package/dist/signin/grants.mjs +1 -1
  234. package/dist/signin/wire.mjs +1 -1
  235. package/dist/storage/allotted.mjs +4 -9
  236. package/dist/storage/batch-upkeep.mjs +31 -12
  237. package/dist/storage/batches.d.mts +2 -3
  238. package/dist/storage/batches.mjs +52 -49
  239. package/dist/storage/budget.mjs +23 -1
  240. package/dist/storage/calls.d.mts +1 -1
  241. package/dist/storage/calls.mjs +41 -43
  242. package/dist/storage/charged-cache.mjs +180 -0
  243. package/dist/storage/chunks.d.mts +3 -3
  244. package/dist/storage/chunks.mjs +121 -8
  245. package/dist/storage/counted-bucket.mjs +32 -10
  246. package/dist/storage/fetch-row-cache.d.mts +6 -0
  247. package/dist/storage/fetch-row-cache.mjs +211 -0
  248. package/dist/storage/fetch.d.mts +1 -0
  249. package/dist/storage/fetch.mjs +54 -242
  250. package/dist/storage/held-types.d.mts +0 -1
  251. package/dist/storage/held-types.mjs +13 -4
  252. package/dist/storage/host-bucket.mjs +9 -4
  253. package/dist/storage/index-bitmaps.mjs +340 -65
  254. package/dist/storage/index-build.d.mts +2 -3
  255. package/dist/storage/index-build.mjs +274 -56
  256. package/dist/storage/index-fetch.d.mts +3 -1
  257. package/dist/storage/index-fetch.mjs +60 -21
  258. package/dist/storage/index-graph.mjs +1 -1
  259. package/dist/storage/index-layers.mjs +55 -25
  260. package/dist/storage/index-reach.mjs +15 -22
  261. package/dist/storage/index-whole.d.mts +7 -0
  262. package/dist/storage/index-whole.mjs +145 -37
  263. package/dist/storage/largest-files.mjs +1 -7
  264. package/dist/storage/layout.mjs +17 -1
  265. package/dist/storage/lfs-pointers.mjs +1 -6
  266. package/dist/storage/link-join.mjs +55 -16
  267. package/dist/storage/list-source.d.mts +7 -0
  268. package/dist/storage/list-source.mjs +288 -0
  269. package/dist/storage/loose.d.mts +8 -8
  270. package/dist/storage/loose.mjs +157 -91
  271. package/dist/storage/memory-budget.mjs +226 -22
  272. package/dist/storage/merge-cut.mjs +9 -6
  273. package/dist/storage/merge-fence.mjs +1 -1
  274. package/dist/storage/merge-row.mjs +1 -1
  275. package/dist/storage/merge.d.mts +2 -3
  276. package/dist/storage/merge.mjs +2 -2
  277. package/dist/storage/object-rows.d.mts +3 -3
  278. package/dist/storage/object-rows.mjs +179 -38
  279. package/dist/storage/pack-order.mjs +97 -44
  280. package/dist/storage/pack-ranges.mjs +44 -16
  281. package/dist/storage/pack-reads.d.mts +5 -3
  282. package/dist/storage/pack-reads.mjs +236 -72
  283. package/dist/storage/pack-receive.d.mts +1 -2
  284. package/dist/storage/pack-receive.mjs +24 -18
  285. package/dist/storage/packs.d.mts +1 -1
  286. package/dist/storage/packs.mjs +477 -116
  287. package/dist/storage/placed-reads.mjs +33 -16
  288. package/dist/storage/prune-seen.mjs +1 -1
  289. package/dist/storage/prune-walk.mjs +1 -1
  290. package/dist/storage/prune.mjs +4 -31
  291. package/dist/storage/push-allotment.mjs +26 -14
  292. package/dist/storage/push-uploads.mjs +195 -57
  293. package/dist/storage/pushed-commits.mjs +20 -1
  294. package/dist/storage/quarantine.d.mts +2 -3
  295. package/dist/storage/range-cache.mjs +175 -40
  296. package/dist/storage/raw-ids.mjs +39 -10
  297. package/dist/storage/ready.d.mts +2 -3
  298. package/dist/storage/ready.mjs +114 -38
  299. package/dist/storage/receive-bounds.mjs +31 -9
  300. package/dist/storage/receive-cache.d.mts +7 -0
  301. package/dist/storage/receive-cache.mjs +147 -0
  302. package/dist/storage/receive-files.mjs +1 -1
  303. package/dist/storage/receive-links.mjs +1 -1
  304. package/dist/storage/receive-state.d.mts +2 -2
  305. package/dist/storage/receive-state.mjs +6 -8
  306. package/dist/storage/receive-steps.d.mts +20 -0
  307. package/dist/storage/receive-steps.mjs +298 -13
  308. package/dist/storage/repack-backlog.mjs +1 -6
  309. package/dist/storage/repack-contained.mjs +2 -2
  310. package/dist/storage/repack-job.mjs +1 -1
  311. package/dist/storage/repack.d.mts +2 -3
  312. package/dist/storage/repack.mjs +54 -9
  313. package/dist/storage/request-cache.mjs +57 -0
  314. package/dist/storage/roots.mjs +1 -24
  315. package/dist/storage/rows.d.mts +2 -2
  316. package/dist/storage/rows.mjs +1 -1
  317. package/dist/storage/runs.d.mts +2 -2
  318. package/dist/storage/runs.mjs +1 -1
  319. package/dist/storage/send-list.mjs +62 -25
  320. package/dist/storage/stream-whole.mjs +84 -63
  321. package/dist/storage/swap-walk.mjs +1 -1
  322. package/dist/storage/unpack.mjs +878 -450
  323. package/dist/storage/visible.mjs +110 -32
  324. package/dist/storage/walk.mjs +1 -0
  325. package/dist/storage/wants.mjs +22 -58
  326. package/dist/store/call-count.d.mts +2 -2
  327. package/dist/store/call-count.mjs +24 -11
  328. package/dist/store/catalogue.d.mts +1 -1
  329. package/dist/store/catalogue.mjs +19 -7
  330. package/dist/store/crossing.mjs +1 -7
  331. package/dist/store/cursor-seal.d.mts +1 -1
  332. package/dist/store/cursor-seal.mjs +1 -1
  333. package/dist/store/door.mjs +9 -4
  334. package/dist/store/errors.d.mts +2 -2
  335. package/dist/store/errors.mjs +107 -19
  336. package/dist/store/git-store.mjs +7 -2
  337. package/dist/store/job-try.mjs +90 -9
  338. package/dist/store/list-job.mjs +10 -34
  339. package/dist/store/outbox.d.mts +2 -2
  340. package/dist/store/outbox.mjs +2 -2
  341. package/dist/store/queue-jobs.mjs +6 -12
  342. package/dist/store/records.d.mts +2 -2
  343. package/dist/store/records.mjs +2 -2
  344. package/dist/store/ref-rows.d.mts +2 -2
  345. package/dist/store/ref-rows.mjs +2 -2
  346. package/dist/store/repo-record.d.mts +2 -2
  347. package/dist/store/repo-record.mjs +3 -3
  348. package/dist/store/request-snapshot.mjs +5 -0
  349. package/dist/store/reservations.mjs +2 -2
  350. package/dist/store/topic-jobs.mjs +5 -11
  351. package/dist/sync/bound.d.mts +3 -3
  352. package/dist/sync/bound.mjs +10 -7
  353. package/dist/sync/github.mjs +65 -67
  354. package/dist/sync/http.mjs +1 -1
  355. package/dist/sync/import.mjs +201 -66
  356. package/dist/sync/layer.d.mts +1 -1
  357. package/dist/sync/layer.mjs +6 -6
  358. package/dist/sync/lfs-batch.mjs +1 -1
  359. package/dist/sync/lfs-copy.mjs +175 -15
  360. package/dist/sync/mirror.mjs +5 -10
  361. package/dist/sync/said.mjs +1 -1
  362. package/dist/sync/step.mjs +268 -86
  363. package/dist/sync/tries.mjs +25 -6
  364. package/dist/sync.d.mts +2 -2
  365. package/dist/sync.mjs +2 -2
  366. package/dist/topics/advance.mjs +3 -3
  367. package/dist/topics/calls.mjs +1 -1
  368. package/dist/topics/layer.d.mts +15 -14
  369. package/dist/topics/members.mjs +1 -1
  370. package/dist/topics/topic.mjs +1 -1
  371. package/package.json +3 -13
  372. package/dist/auth/helpers.mjs +0 -17
  373. package/dist/auth.d.mts +0 -5
  374. package/dist/auth.mjs +0 -5
  375. package/dist/core/rules/commit-changes.d.mts +0 -12
  376. package/dist/effect.d.mts +0 -9
  377. package/dist/effect.mjs +0 -7
  378. package/dist/server/joined.d.mts +0 -70
  379. package/dist/server/joined.mjs +0 -41
@@ -4,11 +4,10 @@ import { InternalRepoId, Oid } from "./ids.mjs";
4
4
  import { BlobLimit, BlobNone, Bytes, FetchRequest, Filter, LfsPointers, ObjectType, ReadLimits, TreeFilter } from "./object-values.mjs";
5
5
  import { RepoStats } from "./repos.mjs";
6
6
  import { GitError, Result } from "./result.mjs";
7
- import { EffectCalls } from "./services.mjs";
8
7
  import { GitStore, Holding, Listed, Pack } from "./store.mjs";
9
- import * as Clock from "effect/Clock";
10
- import * as Effect from "effect/Effect";
11
8
  import { Bucket, BucketLinks, BucketUploads, CallLimits, Key, Listing, Moment, Page, Row } from "@ref0/infra";
9
+ import * as Effect from "effect/Effect";
10
+ import * as Clock from "effect/Clock";
12
11
  export interface EffectiveLimits {
13
12
  readonly objects: number;
14
13
  readonly bytes: number;
@@ -59,7 +58,7 @@ export interface ObjectSizesInput extends CallInput {
59
58
  * after `close` fails as `FAILED_PRECONDITION`.
60
59
  */
61
60
  export interface ObjectReader {
62
- readonly read: (input: ObjectReadInput) => Promise<ObjectReadResult>;
61
+ readonly read: (input: ObjectReadInput) => Effect.Effect<GitObject | undefined, GitError>;
63
62
  /**
64
63
  * The size of each of `oids` the repo holds, as `git cat-file -s` gives it, from the object's
65
64
  * header: a packed entry's, a delta's result's, or its row's. No object's bytes are read whole,
@@ -67,7 +66,7 @@ export interface ObjectReader {
67
66
  * object's type already, as a tree listing does from its entries' modes: it reads no delta's
68
67
  * chain, so it costs each entry's own header alone.
69
68
  */
70
- readonly sizes: (input: ObjectSizesInput) => Promise<Result<ReadonlyMap<Oid, number>>>;
69
+ readonly sizes: (input: ObjectSizesInput) => Effect.Effect<ReadonlyMap<Oid, number>, GitError>;
71
70
  /**
72
71
  * The type and size of each of `oids` the repo holds, as `git cat-file --batch-check` gives
73
72
  * them, from each one's header: a packed entry's, or its row's. A delta's size is its result's,
@@ -78,21 +77,21 @@ export interface ObjectReader {
78
77
  * For a caller that doesn't know the types, as a fetch's want check doesn't: a delta's type costs
79
78
  * a header for each entry down its chain, its base's among them, which `sizes` never reads.
80
79
  */
81
- readonly headers: (input: ObjectHeadersInput) => Promise<Result<ReadonlyMap<Oid, ObjectHeader>>>;
80
+ readonly headers: (input: ObjectHeadersInput) => Effect.Effect<ReadonlyMap<Oid, ObjectHeader>, GitError>;
82
81
  /**
83
82
  * Which of `oids` the repo holds, by its rows and its packs' indexes alone, no object's bytes
84
83
  * read: a fetch's haves, a batch at a time, so each lookup a missing ID needs is made once for
85
84
  * the batch, not once for each (#709). An ID the repo doesn't hold, or the caller can't see, is
86
85
  * absent.
87
86
  */
88
- readonly held: (input: ObjectHeldInput) => Promise<Result<ReadonlySet<Oid>>>;
87
+ readonly held: (input: ObjectHeldInput) => Effect.Effect<ReadonlySet<Oid>, GitError>;
89
88
  /**
90
89
  * The IDs the repo holds that start with `input.prefix`, lowest first, at most `input.most`: from
91
90
  * the listed packs' `.idx`, the rows, the packs listed since and those leaving, no object's bytes
92
91
  * read. An ID the caller can't see is left out, and `more` says the repo holds more than `most`,
93
92
  * counted before that, so a view that shows one of many hears there are many.
94
93
  */
95
- readonly startingWith: (input: ObjectsStartingInput) => Promise<Result<ObjectsStarting>>;
94
+ readonly startingWith: (input: ObjectsStartingInput) => Effect.Effect<ObjectsStarting, GitError>;
96
95
  /**
97
96
  * Each of `oids` the repo holds, whole, in one call: a level of a walk's trees, or its commits.
98
97
  * Each object answered is charged to `input.bytes` before it's kept, the first one too, so the
@@ -105,7 +104,7 @@ export interface ObjectReader {
105
104
  * shrinks the allotment by each object's when it lets the object go, and nothing the reader
106
105
  * holds streams from them.
107
106
  */
108
- readonly objects: (input: ObjectsReadInput) => Promise<Result<ObjectsRead>>;
107
+ readonly objects: (input: ObjectsReadInput) => Effect.Effect<ObjectsRead, GitError>;
109
108
  /**
110
109
  * Bytes the caller holds beside the reader's own, such as a diff's xdiff calls: at most `most`
111
110
  * at once, `refusal` past it. Within a storage's memory budget, a grow that doesn't fit at once
@@ -161,9 +160,9 @@ export interface ObjectHeader {
161
160
  readonly type: ObjectType;
162
161
  readonly size: number;
163
162
  }
164
- export type ReadObject = (input: ObjectReadInput) => Promise<ObjectReadResult>;
163
+ export type ReadObject = (input: ObjectReadInput) => Effect.Effect<GitObject | undefined, GitError>;
165
164
  /** Reads objects whole, a batch at a time, as `ObjectReader.objects` does. */
166
- export type ReadObjects = (input: ObjectsReadInput) => Promise<Result<ObjectsRead>>;
165
+ export type ReadObjects = (input: ObjectsReadInput) => Effect.Effect<ObjectsRead, GitError>;
167
166
  export interface ReceiveInput extends CallInput {
168
167
  readonly pack: Bytes;
169
168
  readonly objects: number;
@@ -210,13 +209,22 @@ export interface ReceiveInput extends CallInput {
210
209
  * `too-large`. Sync's import alone sets it.
211
210
  */
212
211
  readonly cutMost?: number;
212
+ /**
213
+ * Whether the repo held any loose object rows at `listed.version`, as core's opening snapshot
214
+ * read `stats/loose`. When `false`, the receive skips reading object rows upfront and checks
215
+ * listed packs directly, falling back to object rows only for IDs still unresolved after listed
216
+ * packs and before unlisted-pack discovery (so a stale `false` costs at most extra reads on a
217
+ * miss); when `true` or left out, it reads rows upfront as usual. A host whose own objects
218
+ * ignore it keeps reading rows.
219
+ */
220
+ readonly hasLooseRows?: boolean;
213
221
  }
214
222
  /**
215
223
  * A pack to stage for its receive in steps, an import segment's or a push upload's: its bytes, as
216
224
  * `receive` takes them, and the boundary, needs and cut's most, or the shallow lines, its steps
217
225
  * check as `ReceiveInput` says. Sync's import and a push upload's job stage one.
218
226
  */
219
- export type StageInput = Omit<ReceiveInput, 'partial'>;
227
+ export type StageInput = Omit<ReceiveInput, 'partial' | 'hasLooseRows'>;
220
228
  /** A segment's pack staged: its ID, which each step and the landing name, and its bytes. */
221
229
  export interface Staged {
222
230
  readonly pack: string;
@@ -230,7 +238,7 @@ export interface StepInput extends CallInput {
230
238
  * row, goes through it, so a try whose claim is lost writes nothing (#1378). The store `open`
231
239
  * was given is the server's, fenced by no try.
232
240
  */
233
- readonly store: EffectCalls<GitStore>;
241
+ readonly store: GitStore;
234
242
  readonly pack: string;
235
243
  readonly objects: number;
236
244
  readonly needs?: readonly Oid[];
@@ -298,8 +306,9 @@ export interface ObjectsChange {
298
306
  /**
299
307
  * The bytes of a server's memory budget one call takes, which it grows as it needs more and
300
308
  * releases when it ends. `grow` answers `undefined` once the bytes are allotted, on the spot when
301
- * they fit, else after a wait; or the refusal: busy, when no room came within the wait, or
302
- * `too-large` or `diff-limit`, past the most the call may take.
309
+ * they fit, else as an Effect that waits; or the refusal: busy, when no room came within the wait,
310
+ * or `too-large` or `diff-limit`, past the most the call may take. A wait interrupted holds
311
+ * nothing.
303
312
  *
304
313
  * A push's is what a storage keeps past its receive's answer, for its rules: the readers' floors,
305
314
  * its pointers and its open trees, whose walk grows and shrinks it. Core passes it to each reader
@@ -307,7 +316,7 @@ export interface ObjectsChange {
307
316
  * it ends.
308
317
  */
309
318
  export interface Allotment {
310
- readonly grow: (bytes: number) => GitError | undefined | Promise<GitError | undefined>;
319
+ readonly grow: (bytes: number) => GitError | undefined | Effect.Effect<GitError | undefined>;
311
320
  /** Gives back `bytes` of what `grow` allotted, such as when a walk closes a tree. */
312
321
  readonly shrink: (bytes: number) => void;
313
322
  /** Gives back everything it was allotted. Called again, it does nothing. */
@@ -478,7 +487,7 @@ export interface MaintainInput extends CallInput {
478
487
  * delete of that row, goes through it, so a try whose claim is lost writes nothing (#784). The
479
488
  * store `open` was given is the server's, fenced by no try.
480
489
  */
481
- readonly store: EffectCalls<GitStore>;
490
+ readonly store: GitStore;
482
491
  readonly stats: RepoStats;
483
492
  readonly at: Moment;
484
493
  /** The default branch's tip, when the repo has the branch: what a ready shallow pack is for. */
@@ -646,7 +655,7 @@ export interface ObjectsOpenInput<NeedsBucket extends boolean = boolean> {
646
655
  * request and budget at the store's door, and a server's refuses once the server is closed and
647
656
  * dies closed as it closes.
648
657
  */
649
- readonly store: EffectCalls<GitStore>;
658
+ readonly store: GitStore;
650
659
  readonly bucket: NeedsBucket extends true ? Bucket$1 : Bucket$1 | undefined;
651
660
  /** The host's Effect `Clock` service (`effect/Clock`). */
652
661
  readonly clock: Clock.Clock;
@@ -971,6 +980,9 @@ export interface IndexTryInput extends CallInput {
971
980
  * the row again and asks once more with `lastCheck`, so a move that changed none of them costs a
972
981
  * second check, not an update. An implementation never has to answer it: one that updates instead
973
982
  * is answered as today. No answer to a `lastCheck` try is `moved`.
983
+ *
984
+ * A `more` whose data is the data the try was given made no progress, as a build a staged batch
985
+ * held back: the job runs it on its next try, not again in this one.
974
986
  */
975
987
  export type IndexTry = {
976
988
  readonly kind: 'more';
@@ -1,5 +1,5 @@
1
- import * as Effect from "effect/Effect";
2
1
  import * as Schema from "effect/Schema";
2
+ import * as Effect from "effect/Effect";
3
3
  import * as Predicate from "effect/Predicate";
4
4
  import * as Stream from "effect/Stream";
5
5
  // src/contracts/opaque.ts
@@ -3,8 +3,8 @@ import { CandidateId, EntryFields, EntryId, HoldId } from "./queue.mjs";
3
3
  import { RefEdit, RefSource } from "./refs.mjs";
4
4
  import { ActorId } from "./actors.mjs";
5
5
  import { TokenCoverage, TokenScope } from "./tokens.mjs";
6
- import * as Schema from "effect/Schema";
7
6
  import { JobRef } from "@ref0/infra";
7
+ import * as Schema from "effect/Schema";
8
8
  // src/contracts/operations.ts
9
9
  /** What `authorize` is asked about. */
10
10
  const RepoOperation = /* @__PURE__ */ Schema.Struct({
@@ -1,12 +1,12 @@
1
1
  import { ActorInput, Caller, WriteInput } from "./actors.mjs";
2
- import { ByCalls, EffectCalls } from "./services.mjs";
2
+ import { ByCalls, Needing } from "./services.mjs";
3
3
  import { Duration } from "./time.mjs";
4
4
  import { RefName, RepoName } from "./ids.mjs";
5
5
  import { RepoInput } from "./repos.mjs";
6
- import { DecisionAnswer, GitError, Result } from "./result.mjs";
7
- import * as Effect from "effect/Effect";
8
- import * as Schema from "effect/Schema";
6
+ import { DecisionAnswer, GitError } from "./result.mjs";
9
7
  import { Listing, Page } from "@ref0/infra";
8
+ import * as Schema from "effect/Schema";
9
+ import * as Effect from "effect/Effect";
10
10
  import * as Context from "effect/Context";
11
11
  /**
12
12
  * The merge queue: entries ask for a source's head on a target, and candidates, the commits a
@@ -491,23 +491,199 @@ export type QueueOf = (input: {
491
491
  }) => MergeQueueOptions | undefined;
492
492
  /** What `MergeQueue.layer` takes: one queue every repo has, or one per repo. */
493
493
  export type MergeQueueLayerOptions = MergeQueueOptions | QueueOf;
494
- declare const MergeQueue_base: Context.ServiceClass<MergeQueue, "@ref0/git/MergeQueue", EffectCalls<{
495
- readonly add: (repo: string, input: QueueAddInput, by?: Caller<unknown> | undefined) => Promise<AddResult>;
496
- readonly remove: (entry: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Promise<RemoveResult>;
497
- readonly hold: (...args: [entry: string, input: EntryHoldInput, by?: Caller<unknown>] | [repo: string, input: TargetHoldInput, by?: Caller<unknown>]) => Promise<HoldResult>;
498
- readonly release: (hold: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Promise<ReleaseResult>;
499
- readonly report: (candidate: string, input: CandidateReportInput, by?: Caller<unknown> | undefined) => Promise<ReportResult>;
500
- readonly retry: (candidate: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Promise<RetryResult>;
501
- readonly restart: (repo: string, input: QueueTargetInput, by?: Caller<unknown> | undefined) => Promise<RestartResult>;
502
- readonly get: (entry: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Promise<EntryResult>;
503
- readonly list: (repo: string, input: QueueListInput, by?: Caller<unknown> | undefined) => Promise<QueueListResult>;
504
- readonly holds: (...args: [entry: string, input: EntryHoldsInput, by?: Caller<unknown>] | [repo: string, input: QueueListInput, by?: Caller<unknown>]) => Promise<HoldsResult>;
505
- readonly candidates: (repo: string, input: QueueListInput, by?: Caller<unknown> | undefined) => Promise<CandidatesResult>;
506
- readonly candidate: (candidate: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Promise<CandidateResult>;
507
- }, never>>;
494
+ declare const MergeQueue_base: Context.ServiceClass<MergeQueue, "@ref0/git/MergeQueue", Needing<{
495
+ readonly add: (repo: string, input: QueueAddInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
496
+ readonly revision: number;
497
+ readonly repeat: boolean;
498
+ readonly entry: {
499
+ readonly target: string;
500
+ readonly source: string;
501
+ readonly head: string;
502
+ readonly key: string;
503
+ readonly priority?: number;
504
+ readonly meta?: {
505
+ readonly [x: string]: Schema.Json;
506
+ };
507
+ readonly id: string;
508
+ readonly repo: string;
509
+ readonly actor: {
510
+ readonly id: string;
511
+ };
512
+ readonly subject?: {
513
+ readonly id: string;
514
+ };
515
+ readonly state: "checking" | "failed" | "held" | "merged" | "removed" | "waiting";
516
+ readonly lanes: readonly string[];
517
+ readonly report?: {
518
+ readonly summary?: string;
519
+ readonly url?: string;
520
+ readonly meta?: {
521
+ readonly [x: string]: Schema.Json;
522
+ };
523
+ readonly verdict: "cancel" | "fail" | "pass";
524
+ };
525
+ readonly pinned?: true;
526
+ };
527
+ readonly ahead: number;
528
+ readonly replaced?: string;
529
+ }, GitError, never>;
530
+ readonly remove: (entry: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
531
+ readonly revision: number;
532
+ readonly repeat: boolean;
533
+ readonly entry: string;
534
+ }, GitError, never>;
535
+ readonly hold: (...args: [entry: string, input: EntryHoldInput, by?: Caller<unknown>] | [repo: string, input: TargetHoldInput, by?: Caller<unknown>]) => Effect.Effect<{
536
+ readonly revision: number;
537
+ readonly repeat: boolean;
538
+ readonly hold: {
539
+ readonly id: string;
540
+ readonly repo: string;
541
+ readonly reason: string;
542
+ readonly entry: string;
543
+ } | {
544
+ readonly id: string;
545
+ readonly repo: string;
546
+ readonly reason: string;
547
+ readonly target: string;
548
+ };
549
+ }, GitError, never>;
550
+ readonly release: (hold: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
551
+ readonly revision: number;
552
+ readonly repeat: boolean;
553
+ readonly hold: string;
554
+ readonly entry?: string;
555
+ }, GitError, never>;
556
+ readonly report: (candidate: string, input: CandidateReportInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
557
+ readonly repeat: boolean;
558
+ }, GitError, never>;
559
+ readonly retry: (candidate: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
560
+ readonly revision: number;
561
+ readonly repeat: boolean;
562
+ readonly candidate: string;
563
+ }, GitError, never>;
564
+ readonly restart: (repo: string, input: QueueTargetInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
565
+ readonly revision: number;
566
+ readonly repeat: boolean;
567
+ readonly target: string;
568
+ readonly head: string;
569
+ }, GitError, never>;
570
+ readonly get: (entry: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
571
+ readonly target: string;
572
+ readonly source: string;
573
+ readonly head: string;
574
+ readonly key: string;
575
+ readonly priority?: number;
576
+ readonly meta?: {
577
+ readonly [x: string]: Schema.Json;
578
+ };
579
+ readonly id: string;
580
+ readonly repo: string;
581
+ readonly actor: {
582
+ readonly id: string;
583
+ };
584
+ readonly subject?: {
585
+ readonly id: string;
586
+ };
587
+ readonly state: "checking" | "failed" | "held" | "merged" | "removed" | "waiting";
588
+ readonly lanes: readonly string[];
589
+ readonly report?: {
590
+ readonly summary?: string;
591
+ readonly url?: string;
592
+ readonly meta?: {
593
+ readonly [x: string]: Schema.Json;
594
+ };
595
+ readonly verdict: "cancel" | "fail" | "pass";
596
+ };
597
+ readonly pinned?: true;
598
+ }, GitError, never>;
599
+ readonly list: (repo: string, input: QueueListInput, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
600
+ readonly target: string;
601
+ readonly source: string;
602
+ readonly head: string;
603
+ readonly key: string;
604
+ readonly priority?: number;
605
+ readonly meta?: {
606
+ readonly [x: string]: Schema.Json;
607
+ };
608
+ readonly id: string;
609
+ readonly repo: string;
610
+ readonly actor: {
611
+ readonly id: string;
612
+ };
613
+ readonly subject?: {
614
+ readonly id: string;
615
+ };
616
+ readonly state: "checking" | "failed" | "held" | "merged" | "removed" | "waiting";
617
+ readonly lanes: readonly string[];
618
+ readonly report?: {
619
+ readonly summary?: string;
620
+ readonly url?: string;
621
+ readonly meta?: {
622
+ readonly [x: string]: Schema.Json;
623
+ };
624
+ readonly verdict: "cancel" | "fail" | "pass";
625
+ };
626
+ readonly pinned?: true;
627
+ }>, GitError, never>;
628
+ readonly holds: (...args: [entry: string, input: EntryHoldsInput, by?: Caller<unknown>] | [repo: string, input: QueueListInput, by?: Caller<unknown>]) => Effect.Effect<Listing<{
629
+ readonly id: string;
630
+ readonly repo: string;
631
+ readonly reason: string;
632
+ readonly entry: string;
633
+ } | {
634
+ readonly id: string;
635
+ readonly repo: string;
636
+ readonly reason: string;
637
+ readonly target: string;
638
+ }>, GitError, never>;
639
+ readonly candidates: (repo: string, input: QueueListInput, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
640
+ readonly id: string;
641
+ readonly repo: string;
642
+ readonly target: string;
643
+ readonly base: string | null;
644
+ readonly entries: readonly string[];
645
+ readonly state: "building" | "checking" | "closed";
646
+ readonly ref?: string;
647
+ readonly commit?: string;
648
+ readonly report?: {
649
+ readonly summary?: string;
650
+ readonly url?: string;
651
+ readonly meta?: {
652
+ readonly [x: string]: Schema.Json;
653
+ };
654
+ readonly verdict: "cancel" | "fail" | "pass";
655
+ };
656
+ readonly reason?: "cancelled" | "failed" | "merged" | "passed" | "restarted" | "superseded" | "timeout";
657
+ }>, GitError, never>;
658
+ readonly candidate: (candidate: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
659
+ readonly id: string;
660
+ readonly repo: string;
661
+ readonly target: string;
662
+ readonly base: string | null;
663
+ readonly entries: readonly string[];
664
+ readonly state: "building" | "checking" | "closed";
665
+ readonly ref?: string;
666
+ readonly commit?: string;
667
+ readonly report?: {
668
+ readonly summary?: string;
669
+ readonly url?: string;
670
+ readonly meta?: {
671
+ readonly [x: string]: Schema.Json;
672
+ };
673
+ readonly verdict: "cancel" | "fail" | "pass";
674
+ };
675
+ readonly reason?: "cancelled" | "failed" | "merged" | "passed" | "restarted" | "superseded" | "timeout";
676
+ }, GitError, never>;
677
+ }, never> & {
678
+ /**
679
+ * The `keys` every repo's queue has, as `MergeQueue.layer`'s options name them, read once
680
+ * the queue builds: `undefined` for a queue per repo, whose options each name their own.
681
+ */
682
+ readonly keys: QueueKeys | undefined;
683
+ }>;
508
684
  /**
509
- * `git.queue`'s calls as Effects, each deciding for `by`: what `MergeQueue.layer` provides, and
510
- * the queue's jobs, events and `git push -o queue` with them.
685
+ * `git.queue`'s calls as Effects, each deciding for `by`, and the queue's `keys`: what
686
+ * `MergeQueue.layer` provides, and the queue's jobs, events and `git push -o queue` with them.
511
687
  */
512
688
  export declare class MergeQueue extends /* @__PURE__ */ MergeQueue_base {}
513
689
  /**
@@ -641,18 +817,6 @@ export declare const Restarted: Schema.Struct<{
641
817
  readonly head: Schema.String;
642
818
  }>;
643
819
  export type Restarted = typeof Restarted.Type;
644
- export type AddResult = Result<Added>;
645
- export type RemoveResult = Result<Removed>;
646
- export type HoldResult = Result<Held>;
647
- export type ReleaseResult = Result<Released>;
648
- export type ReportResult = Result<Reported>;
649
- export type RetryResult = Result<Retried>;
650
- export type RestartResult = Result<Restarted>;
651
- export type EntryResult = Result<Entry>;
652
- export type QueueListResult = Result<Listing<Entry>>;
653
- export type HoldsResult = Result<Listing<Hold>>;
654
- export type CandidateResult = Result<Candidate>;
655
- export type CandidatesResult = Result<Listing<Candidate>>;
656
820
  /**
657
821
  * `git.queue`. A repo whose `QueueOf` answers `undefined` has none: each call is `NOT_FOUND`,
658
822
  * reason `no-queue`, its message naming the repo and any target, as "acme/app's main has no merge
@@ -669,22 +833,22 @@ export type CandidatesResult = Result<Listing<Candidate>>;
669
833
  * `ALREADY_EXISTS`, naming nothing of that entry.
670
834
  */
671
835
  export interface MergeQueueCalls {
672
- readonly add: (repo: RepoName, input: QueueAddInput) => Promise<AddResult>;
673
- readonly remove: (entry: EntryId, input: WriteInput) => Promise<RemoveResult>;
836
+ readonly add: (repo: RepoName, input: QueueAddInput) => Effect.Effect<Added, GitError>;
837
+ readonly remove: (entry: EntryId, input: WriteInput) => Effect.Effect<Removed, GitError>;
674
838
  /** A target's hold names its `target`; an entry's names none. */
675
- readonly hold: (...args: [repo: RepoName, input: TargetHoldInput] | [entry: EntryId, input: EntryHoldInput]) => Promise<HoldResult>;
839
+ readonly hold: (...args: [repo: RepoName, input: TargetHoldInput] | [entry: EntryId, input: EntryHoldInput]) => Effect.Effect<Held, GitError>;
676
840
  /**
677
841
  * The last hold on an entry released sends it to the back. A `work-failed` hold's release retries
678
842
  * the job it names: while that job runs, its failure perhaps not yet settled, or once it failed
679
843
  * again since the release read it, the release is `UNAVAILABLE` and the hold stays, so release it
680
844
  * again. 14 days after its release, `queue.trim` deletes a hold, and it's `NOT_FOUND`.
681
845
  */
682
- readonly release: (hold: HoldId, input: WriteInput) => Promise<ReleaseResult>;
846
+ readonly release: (hold: HoldId, input: WriteInput) => Effect.Effect<Released, GitError>;
683
847
  /**
684
848
  * A `fail` with `blame` fails those entries, and the rest wait again. One without, of more than
685
849
  * one entry, asks `bisect`; of one, fails it. A `retry` brings back the entries it failed.
686
850
  */
687
- readonly report: (candidate: CandidateId, input: CandidateReportInput) => Promise<ReportResult>;
851
+ readonly report: (candidate: CandidateId, input: CandidateReportInput) => Effect.Effect<Reported, GitError>;
688
852
  /**
689
853
  * Closes the candidate, puts its entries back at their places and wakes advance, which opens
690
854
  * them in order under a new ID, `queue.candidate.opened`. After a `fail`, each entry its report
@@ -694,14 +858,14 @@ export interface MergeQueueCalls {
694
858
  * and one on a target deleted since is `FAILED_PRECONDITION`, as `restart` is. One `queue.trim`
695
859
  * deleted, 14 days after it closed and its entries went, is `NOT_FOUND`.
696
860
  */
697
- readonly retry: (candidate: CandidateId, input: WriteInput) => Promise<RetryResult>;
861
+ readonly retry: (candidate: CandidateId, input: WriteInput) => Effect.Effect<Retried, GitError>;
698
862
  /** Closes the target's open candidates and builds them again under new IDs. */
699
- readonly restart: (repo: RepoName, input: QueueTargetInput) => Promise<RestartResult>;
863
+ readonly restart: (repo: RepoName, input: QueueTargetInput) => Effect.Effect<Restarted, GitError>;
700
864
  /**
701
865
  * One entry, open or ended. One that merged, failed or was removed 14 days ago is `NOT_FOUND`:
702
866
  * `queue.trim` deleted it, and each other write by its ID is `NOT_FOUND` too.
703
867
  */
704
- readonly get: (entry: EntryId, input: ActorInput) => Promise<EntryResult>;
868
+ readonly get: (entry: EntryId, input: ActorInput) => Effect.Effect<Entry, GitError>;
705
869
  /**
706
870
  * A target's entries in the order they're tried in. A page's `next` names where it ended in that
707
871
  * order, and the page after it goes on from there, though that entry left (Q435): an entry that
@@ -711,27 +875,27 @@ export interface MergeQueueCalls {
711
875
  * names its list: one from another target, entry or repo, or with a number no place has, is
712
876
  * `INVALID_ARGUMENT`.
713
877
  */
714
- readonly list: (repo: RepoName, input: QueueListInput) => Promise<QueueListResult>;
878
+ readonly list: (repo: RepoName, input: QueueListInput) => Effect.Effect<Listing<Entry>, GitError>;
715
879
  /**
716
880
  * A target's holds, or one entry's: an ID an entry could have names the entry. They come in the
717
881
  * order they were made, and `next` names where a page ended, as `list`'s does: each hold open
718
882
  * throughout comes exactly once, though the one `next` names was released.
719
883
  */
720
- readonly holds: (...args: [repo: RepoName, input: QueueListInput] | [entry: EntryId, input: EntryHoldsInput]) => Promise<HoldsResult>;
884
+ readonly holds: (...args: [repo: RepoName, input: QueueListInput] | [entry: EntryId, input: EntryHoldsInput]) => Effect.Effect<Listing<Hold>, GitError>;
721
885
  /**
722
886
  * A target's open candidates, a bisect's groups among them, in the order advance opened them.
723
887
  * `next` names where a page ended, as `holds`' does: each candidate open throughout comes
724
888
  * exactly once, though the one `next` names closed. Under `access`, a caller who doesn't see
725
889
  * every ref gets none, since a candidate holds what its entries hold.
726
890
  */
727
- readonly candidates: (repo: RepoName, input: QueueListInput) => Promise<CandidatesResult>;
891
+ readonly candidates: (repo: RepoName, input: QueueListInput) => Effect.Effect<Listing<Candidate>, GitError>;
728
892
  /**
729
893
  * One candidate, open or closed. A closed one keeps its base, entries, commit, report and
730
894
  * `reason`, and has no `ref`. Under `access`, one is `NOT_FOUND` to a caller who doesn't see
731
895
  * every ref, as an ID that names nothing is. 14 days after it closed, once none of its entries
732
896
  * is left, `queue.trim` deletes it, with its report, and it's `NOT_FOUND`.
733
897
  */
734
- readonly candidate: (candidate: CandidateId, input: ActorInput) => Promise<CandidateResult>;
898
+ readonly candidate: (candidate: CandidateId, input: ActorInput) => Effect.Effect<Candidate, GitError>;
735
899
  }
736
900
  type QueueService = ByCalls<MergeQueueCalls>;
737
901
  export declare const add: (...args: Parameters<QueueService['add']>) => Effect.Effect<{
@@ -5,11 +5,11 @@ import { Oid, RefName, RepoName } from "./ids.mjs";
5
5
  import { EffectValue } from "./opaque.mjs";
6
6
  import "./repos.mjs";
7
7
  import { Verdict, decisionAnswer } from "./result.mjs";
8
- import * as Effect from "effect/Effect";
9
- import * as Schema from "effect/Schema";
10
8
  import { jsonBytes } from "@ref0/infra";
11
- import * as SchemaTransformation from "effect/SchemaTransformation";
9
+ import * as Schema from "effect/Schema";
10
+ import * as Effect from "effect/Effect";
12
11
  import * as Context from "effect/Context";
12
+ import * as SchemaTransformation from "effect/SchemaTransformation";
13
13
  // src/contracts/queue.ts
14
14
  /**
15
15
  * The merge queue: entries ask for a source's head on a target, and candidates, the commits a
@@ -202,8 +202,8 @@ const EntryGroups = /* @__PURE__ */ Schema.Array(EntryGroup).check(Schema.isMinL
202
202
  /** What a numeric schedule function (`concurrency` or `batch.maxSize`) answers: a finite number. */
203
203
  const ScheduleAnswer = Schema.Finite;
204
204
  /**
205
- * `git.queue`'s calls as Effects, each deciding for `by`: what `MergeQueue.layer` provides, and
206
- * the queue's jobs, events and `git push -o queue` with them.
205
+ * `git.queue`'s calls as Effects, each deciding for `by`, and the queue's `keys`: what
206
+ * `MergeQueue.layer` provides, and the queue's jobs, events and `git push -o queue` with them.
207
207
  */
208
208
  var MergeQueue = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/MergeQueue")) {};
209
209
  /** `revision` is the event's `seq`: every event at or under it came before. */
@@ -1,12 +1,12 @@
1
- import { ByCalls, EffectCalls } from "./services.mjs";
1
+ import { ByCalls, Needing } from "./services.mjs";
2
2
  import { ActorInput, Caller, WriteInput } from "./actors.mjs";
3
3
  import { RefOwner } from "./git.mjs";
4
4
  import { RefName, RepoName } from "./ids.mjs";
5
5
  import { RepoInput } from "./repos.mjs";
6
6
  import { GitError } from "./result.mjs";
7
- import * as Effect from "effect/Effect";
8
- import * as Schema from "effect/Schema";
9
7
  import { Listing, Page } from "@ref0/infra";
8
+ import * as Schema from "effect/Schema";
9
+ import * as Effect from "effect/Effect";
10
10
  import * as Context from "effect/Context";
11
11
  declare namespace refs_d_exports {
12
12
  export { Ref, RefApplied, RefCalls, RefCount, RefCountFields, RefCountInput, RefEdit, RefGetInput, RefInput, RefList, RefListInput, RefOutcome, RefProtection, RefRejected, RefSource, RefUpdate, RefUpdateKind, Refs, RefsCalls, RefsProtections, RefsProtectionsInput, RefsSees, RefsSeesInput, RefsUpdate, RefsUpdateInput, RefsUpdated, count, get, list, maxProtectionRefs, maxSeenRefs, protection, protections, sees, update };
@@ -225,7 +225,7 @@ export declare const RefOutcome: Schema.Union<readonly [Schema.Struct<{
225
225
  readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
226
226
  readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
227
227
  readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
228
- reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
228
+ reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget", "delta-chain-too-deep"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
229
229
  indexBytes: Schema.optionalKey<Schema.Number>;
230
230
  pushBytes: Schema.optionalKey<Schema.Number>;
231
231
  most: Schema.optionalKey<Schema.Number>;
@@ -297,7 +297,7 @@ export interface RefCalls {
297
297
  }
298
298
  /** `RefCalls` as Effects, each deciding for `by`, as `ByCalls` says. */
299
299
  export type RefsCalls<R = never> = ByCalls<RefCalls, R>;
300
- declare const Refs_base: Context.ServiceClass<Refs, "@ref0/git/Refs", EffectCalls<{
300
+ declare const Refs_base: Context.ServiceClass<Refs, "@ref0/git/Refs", Needing<{
301
301
  readonly get: (repo: string, input: RefGetInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
302
302
  readonly name: string;
303
303
  readonly oid: string;
@@ -1,8 +1,8 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
2
  import { Oid, RefName } from "./ids.mjs";
3
3
  import { GitErrorBody } from "./result.mjs";
4
- import * as Effect from "effect/Effect";
5
4
  import * as Schema from "effect/Schema";
5
+ import * as Effect from "effect/Effect";
6
6
  import * as Context from "effect/Context";
7
7
  // src/contracts/refs.ts
8
8
  var refs_exports = /* @__PURE__ */ __exportAll({
@@ -1,7 +1,7 @@
1
1
  import { ActorInput } from "./actors.mjs";
2
- import { GitError, Result } from "./result.mjs";
3
- import * as Effect from "effect/Effect";
2
+ import { GitError } from "./result.mjs";
4
3
  import * as Schema from "effect/Schema";
4
+ import * as Effect from "effect/Effect";
5
5
  /** What a client sends as Basic: Git's own credential, such as `x-access-token` and a token. */
6
6
  export declare const BasicCredential: Schema.Struct<{
7
7
  readonly username: Schema.String;
@@ -69,11 +69,8 @@ export interface RemoteOptions {
69
69
  export type WithoutActor<Input> = Input extends ActorInput ? Omit<Input, 'actor' | 'internalId'> : Input;
70
70
  /** A call's input without `signal`: interrupting the call's fiber stops it. */
71
71
  export type WithoutSignal<Input> = Input extends object ? Omit<Input, 'signal'> : Input;
72
- /** A call's answer as a remote gives it: an Effect that fails with the call's `GitError`. */
73
- type RemoteAnswer<Answer> = Answer extends Promise<Result<infer A>> ? Effect.Effect<A, GitError> : Answer;
74
72
  /**
75
73
  * A group of server calls as a remote makes them: each an Effect, its input without `actor` or
76
74
  * `signal`.
77
75
  */
78
- export type RemoteCalls<Calls> = { readonly [Key in keyof Calls]-?: NonNullable<Calls[Key]> extends ((...args: infer Args) => infer Answer) ? (...args: { [Index in keyof Args]: WithoutSignal<WithoutActor<Args[Index]>>; }) => RemoteAnswer<Answer> : RemoteCalls<NonNullable<Calls[Key]>>; };
79
- export {};
76
+ export type RemoteCalls<Calls> = { readonly [Key in keyof Calls]-?: NonNullable<Calls[Key]> extends ((...args: infer Args) => infer Answer) ? (...args: { [Index in keyof Args]: WithoutSignal<WithoutActor<Args[Index]>>; }) => Answer : RemoteCalls<NonNullable<Calls[Key]>>; };
@@ -2,9 +2,9 @@ import { ActorInput, Caller, WriteInput } from "./actors.mjs";
2
2
  import { InternalRepoId, RefName, RepoName } from "./ids.mjs";
3
3
  import { GitError } from "./result.mjs";
4
4
  import { ImportStatus } from "./sync.mjs";
5
- import * as Effect from "effect/Effect";
6
- import * as Schema from "effect/Schema";
7
5
  import { Listing, Page } from "@ref0/infra";
6
+ import * as Schema from "effect/Schema";
7
+ import * as Effect from "effect/Effect";
8
8
  import * as Context from "effect/Context";
9
9
  declare namespace repos_d_exports {
10
10
  export { JobCounts, Moment$1 as Moment, PinnedRepo, RenamedRepo, RepoCatalogueEntry, RepoCreate, RepoCreateInput, RepoDeleted, RepoGetInput, RepoIndexHold, RepoInfo, RepoInfoStats, RepoInput, RepoListInput, RepoListOrder, RepoRecord, RepoRenameInput, RepoStats, RepoUpdateInput, RepoWork, Repos, create, remove as delete, get, importState, list, rename, update };
@@ -412,7 +412,7 @@ export declare const create: (input: RepoCreateInput, by?: Caller) => Effect.Eff
412
412
  };
413
413
  };
414
414
  }, GitError, Repos>;
415
- export declare const get: (repo: RepoName, input: ActorInput & Pick<RepoInput, 'internalId'>, by?: Caller) => Effect.Effect<{
415
+ export declare const get: (repo: RepoName, input: RepoGetInput, by?: Caller) => Effect.Effect<{
416
416
  readonly name: string;
417
417
  readonly defaultBranch?: string;
418
418
  readonly public: boolean;
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
2
  import { InternalRepoId, RepoName } from "./ids.mjs";
3
- import * as Effect from "effect/Effect";
4
3
  import * as Schema from "effect/Schema";
4
+ import * as Effect from "effect/Effect";
5
5
  import * as Context from "effect/Context";
6
6
  // src/contracts/repos.ts
7
7
  var repos_exports = /* @__PURE__ */ __exportAll({