@ref0/git 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/dist/access/namespace.d.mts +2 -0
  2. package/dist/access/private-refs.d.mts +6 -29
  3. package/dist/access/private-refs.mjs +26 -13
  4. package/dist/access/public.d.mts +6 -0
  5. package/dist/access/public.mjs +9 -0
  6. package/dist/auth/access-jwt.d.mts +10 -6
  7. package/dist/auth/access-jwt.mjs +59 -40
  8. package/dist/auth/auth-namespace.d.mts +6 -0
  9. package/dist/auth/auth-namespace.mjs +12 -0
  10. package/dist/auth/auth.d.mts +3 -6
  11. package/dist/auth/auth.mjs +2 -9
  12. package/dist/auth/authorize.mjs +35 -29
  13. package/dist/auth/bridge.mjs +8 -8
  14. package/dist/auth/fences.d.mts +1 -2
  15. package/dist/auth/fences.mjs +1 -1
  16. package/dist/auth/grants.d.mts +0 -1
  17. package/dist/auth/grants.mjs +2 -2
  18. package/dist/auth/host-function.d.mts +1 -7
  19. package/dist/auth/host-function.mjs +51 -42
  20. package/dist/auth/identify.d.mts +0 -1
  21. package/dist/auth/identify.mjs +3 -2
  22. package/dist/auth/namespaces.d.mts +2 -2
  23. package/dist/auth/policy.d.mts +7 -4
  24. package/dist/auth/policy.mjs +13 -10
  25. package/dist/auth/token-rows.mjs +3 -6
  26. package/dist/auth/tokens-layer.d.mts +40 -0
  27. package/dist/auth/tokens-layer.mjs +29 -0
  28. package/dist/auth/tokens-namespace.d.mts +2 -0
  29. package/dist/auth/tokens-public.d.mts +6 -0
  30. package/dist/auth/tokens-public.mjs +31 -0
  31. package/dist/auth/tokens.d.mts +19 -7
  32. package/dist/auth/tokens.mjs +12 -6
  33. package/dist/auth.d.mts +2 -2
  34. package/dist/auth.mjs +2 -2
  35. package/dist/client/client.d.mts +22 -15
  36. package/dist/client/client.mjs +31 -27
  37. package/dist/client/git-http.mjs +23 -6
  38. package/dist/client/local.mjs +5 -4
  39. package/dist/client/namespace.d.mts +2 -0
  40. package/dist/client/push-upload.d.mts +1 -0
  41. package/dist/client/push-upload.mjs +169 -2
  42. package/dist/client/remote-helper.mjs +5 -12
  43. package/dist/client/remote.mjs +63 -22
  44. package/dist/client/run-remote-helper.d.mts +1 -1
  45. package/dist/client/run-remote-helper.mjs +6 -6
  46. package/dist/client/slice-push.d.mts +1 -1
  47. package/dist/client/transport.mjs +26 -19
  48. package/dist/contracts/access.d.mts +18 -10
  49. package/dist/contracts/access.mjs +17 -0
  50. package/dist/contracts/actors.d.mts +73 -28
  51. package/dist/contracts/actors.mjs +45 -2
  52. package/dist/contracts/authorize.d.mts +26 -17
  53. package/dist/contracts/blobs.d.mts +1 -1
  54. package/dist/contracts/blobs.mjs +1 -1
  55. package/dist/contracts/callers.mjs +40 -0
  56. package/dist/contracts/calls-spent.d.mts +6 -4
  57. package/dist/contracts/calls-spent.mjs +10 -8
  58. package/dist/contracts/client.d.mts +16 -9
  59. package/dist/contracts/commits.d.mts +2 -2
  60. package/dist/contracts/commits.mjs +1 -1
  61. package/dist/contracts/engine.d.mts +1 -1
  62. package/dist/contracts/events.d.mts +45 -32
  63. package/dist/contracts/events.mjs +21 -10
  64. package/dist/contracts/files.d.mts +44 -44
  65. package/dist/contracts/files.mjs +1 -1
  66. package/dist/contracts/forks.d.mts +34 -58
  67. package/dist/contracts/forks.mjs +1 -1
  68. package/dist/contracts/git-events.d.mts +50 -0
  69. package/dist/contracts/git-events.mjs +23 -0
  70. package/dist/contracts/git-hooks.d.mts +254 -0
  71. package/dist/contracts/git-hooks.mjs +12 -0
  72. package/dist/contracts/git.d.mts +93 -42
  73. package/dist/contracts/git.mjs +6 -5
  74. package/dist/contracts/grants.d.mts +46 -27
  75. package/dist/contracts/ids.d.mts +16 -0
  76. package/dist/contracts/ids.mjs +19 -4
  77. package/dist/contracts/lfs.d.mts +19 -4
  78. package/dist/contracts/merges.d.mts +7 -7
  79. package/dist/contracts/namespaces.d.mts +2 -2
  80. package/dist/contracts/objects.d.mts +21 -5
  81. package/dist/contracts/opaque.mjs +27 -0
  82. package/dist/contracts/operations.d.mts +301 -101
  83. package/dist/contracts/operations.mjs +209 -0
  84. package/dist/contracts/promises.d.mts +2 -0
  85. package/dist/contracts/push-uploads.d.mts +4 -1
  86. package/dist/contracts/push-uploads.mjs +9 -4
  87. package/dist/contracts/queue.d.mts +220 -49
  88. package/dist/contracts/queue.mjs +68 -6
  89. package/dist/contracts/refs.d.mts +30 -8
  90. package/dist/contracts/refs.mjs +1 -1
  91. package/dist/contracts/remote.d.mts +53 -23
  92. package/dist/contracts/remote.mjs +22 -0
  93. package/dist/contracts/repo-records.d.mts +2 -2
  94. package/dist/contracts/repos.d.mts +100 -82
  95. package/dist/contracts/repos.mjs +47 -8
  96. package/dist/contracts/result.d.mts +73 -41
  97. package/dist/contracts/result.mjs +74 -17
  98. package/dist/contracts/rules.d.mts +734 -68
  99. package/dist/contracts/rules.mjs +84 -1
  100. package/dist/contracts/server.d.mts +20 -206
  101. package/dist/contracts/services.d.mts +1 -10
  102. package/dist/contracts/services.mjs +1 -5
  103. package/dist/contracts/signin.d.mts +140 -43
  104. package/dist/contracts/signin.mjs +36 -3
  105. package/dist/contracts/store.d.mts +1 -1
  106. package/dist/contracts/sync.d.mts +109 -90
  107. package/dist/contracts/sync.mjs +34 -7
  108. package/dist/contracts/tags.d.mts +1 -1
  109. package/dist/contracts/tags.mjs +1 -1
  110. package/dist/contracts/tokens.d.mts +247 -60
  111. package/dist/contracts/tokens.mjs +93 -21
  112. package/dist/contracts/topics.d.mts +59 -20
  113. package/dist/contracts/topics.mjs +14 -5
  114. package/dist/contracts/trees.d.mts +2 -2
  115. package/dist/contracts/trees.mjs +1 -1
  116. package/dist/contracts/work.d.mts +2 -2
  117. package/dist/contracts/work.mjs +2 -2
  118. package/dist/core/access.d.mts +10 -12
  119. package/dist/core/access.mjs +45 -11
  120. package/dist/core/clock.mjs +1 -1
  121. package/dist/core/events/deliver.d.mts +3 -2
  122. package/dist/core/events/deliver.mjs +188 -92
  123. package/dist/core/forks.mjs +78 -34
  124. package/dist/core/hooks/groups.d.mts +26 -0
  125. package/dist/core/hooks/groups.mjs +73 -0
  126. package/dist/core/hooks/namespace.d.mts +2 -0
  127. package/dist/core/hooks/order.d.mts +2 -2
  128. package/dist/core/hooks/order.mjs +6 -6
  129. package/dist/core/hooks/public.d.mts +7 -0
  130. package/dist/core/hooks/public.mjs +5 -0
  131. package/dist/core/imports.mjs +94 -10
  132. package/dist/core/index-job.mjs +11 -8
  133. package/dist/core/loose-tally.mjs +46 -0
  134. package/dist/core/merge-parts.d.mts +1 -1
  135. package/dist/core/merge-parts.mjs +1 -1
  136. package/dist/core/mirror-rows.mjs +18 -0
  137. package/dist/core/names.mjs +1 -1
  138. package/dist/core/namespaces.d.mts +2 -1
  139. package/dist/core/objects/commit-writes.mjs +5 -5
  140. package/dist/core/objects/merges.mjs +1 -1
  141. package/dist/core/objects/objects-layer.mjs +1 -1
  142. package/dist/core/objects/reading.mjs +52 -7
  143. package/dist/core/objects/tree-edits.mjs +13 -28
  144. package/dist/core/objects/trees.mjs +4 -4
  145. package/dist/core/objects/writing.mjs +4 -3
  146. package/dist/core/own-writes.mjs +1 -1
  147. package/dist/core/parts.d.mts +22 -3
  148. package/dist/core/parts.mjs +5 -3
  149. package/dist/core/promise.mjs +23 -17
  150. package/dist/core/purge.d.mts +2 -2
  151. package/dist/core/purge.mjs +89 -34
  152. package/dist/core/push.mjs +67 -79
  153. package/dist/core/receipts.d.mts +2 -2
  154. package/dist/core/receipts.mjs +28 -4
  155. package/dist/core/ref-index-job.mjs +4 -4
  156. package/dist/core/ref-view.mjs +16 -8
  157. package/dist/core/refs.mjs +41 -10
  158. package/dist/core/registered-records.mjs +30 -0
  159. package/dist/core/{claim-rows.mjs → registered-rows.mjs} +6 -6
  160. package/dist/core/repack.d.mts +2 -2
  161. package/dist/core/repack.mjs +30 -23
  162. package/dist/core/repo-info.mjs +62 -26
  163. package/dist/core/repos.mjs +18 -11
  164. package/dist/core/rules/changes.mjs +2 -2
  165. package/dist/core/rules/check.mjs +10 -10
  166. package/dist/core/rules/commit-changes.mjs +1 -1
  167. package/dist/core/rules/context.d.mts +7 -6
  168. package/dist/core/rules/context.mjs +18 -16
  169. package/dist/core/rules/fetch.mjs +78 -31
  170. package/dist/core/saved-caller-views.d.mts +72 -0
  171. package/dist/core/saved-caller-views.mjs +123 -0
  172. package/dist/core/saved-callers-public.d.mts +5 -0
  173. package/dist/core/saved-callers-public.mjs +10 -0
  174. package/dist/core/saved-callers.mjs +95 -0
  175. package/dist/core/seam.d.mts +12 -1
  176. package/dist/core/seam.mjs +4 -2
  177. package/dist/core/tokens.mjs +7 -2
  178. package/dist/core/view.d.mts +1 -1
  179. package/dist/core/view.mjs +1 -1
  180. package/dist/core/work.mjs +6 -5
  181. package/dist/effect.d.mts +2 -4
  182. package/dist/effect.mjs +2 -4
  183. package/dist/engine/commits.mjs +19 -47
  184. package/dist/engine/content.d.mts +2 -2
  185. package/dist/engine/content.mjs +1 -1
  186. package/dist/engine/diff.mjs +2 -2
  187. package/dist/engine/failures.d.mts +1 -2
  188. package/dist/engine/failures.mjs +1 -3
  189. package/dist/engine/merge-base-walk.mjs +57 -142
  190. package/dist/engine/merge-bases.mjs +5 -5
  191. package/dist/engine/merge-renames.mjs +1 -1
  192. package/dist/engine/merge.mjs +16 -14
  193. package/dist/engine/reads.d.mts +2 -2
  194. package/dist/engine/reads.mjs +1 -1
  195. package/dist/engine/xdiff.d.mts +1 -1
  196. package/dist/engine/xdiff.mjs +2 -2
  197. package/dist/event-streams/event-streams.d.mts +6 -2
  198. package/dist/event-streams/event-streams.mjs +6 -2
  199. package/dist/event-streams/stream.mjs +5 -2
  200. package/dist/extend.d.mts +2 -3
  201. package/dist/extend.mjs +2 -2
  202. package/dist/http/answers.mjs +4 -3
  203. package/dist/http/core-parts.mjs +3 -4
  204. package/dist/http/handler.mjs +12 -32
  205. package/dist/http/parts.d.mts +1 -1
  206. package/dist/http/push-uploads.mjs +7 -5
  207. package/dist/http/receive-pack.mjs +3 -3
  208. package/dist/http/upload-pack.mjs +6 -5
  209. package/dist/index.d.mts +44 -24
  210. package/dist/index.mjs +17 -8
  211. package/dist/lfs/base.d.mts +8 -5
  212. package/dist/lfs/base.mjs +2 -1
  213. package/dist/lfs/calls.mjs +3 -2
  214. package/dist/lfs/layer.d.mts +9 -7
  215. package/dist/lfs/layer.mjs +37 -22
  216. package/dist/lfs/locks.mjs +3 -3
  217. package/dist/lfs/objects.d.mts +3 -2
  218. package/dist/lfs/objects.mjs +235 -71
  219. package/dist/lfs/pointers.mjs +70 -19
  220. package/dist/lfs/purge.mjs +7 -3
  221. package/dist/lfs/rows.mjs +25 -8
  222. package/dist/lfs/service.d.mts +6 -3
  223. package/dist/lfs/service.mjs +8 -2
  224. package/dist/lfs/upkeep.mjs +53 -31
  225. package/dist/lfs/upload-most.mjs +41 -0
  226. package/dist/lfs/uploaded.mjs +59 -0
  227. package/dist/lfs/wire.mjs +1 -1
  228. package/dist/protocol/bytes/buffers.d.mts +1 -1
  229. package/dist/protocol/bytes/buffers.mjs +1 -1
  230. package/dist/protocol/bytes/deflate.d.mts +1 -1
  231. package/dist/protocol/bytes/deflate.mjs +1 -1
  232. package/dist/protocol/bytes/hmac-sha256.mjs +3 -6
  233. package/dist/protocol/bytes/inflate.d.mts +1 -1
  234. package/dist/protocol/bytes/inflate.mjs +1 -1
  235. package/dist/protocol/bytes/sha1.d.mts +1 -1
  236. package/dist/protocol/bytes/sha1.mjs +2 -2
  237. package/dist/protocol/bytes/sha256-hasher.mjs +51 -0
  238. package/dist/protocol/bytes/text.mjs +6 -1
  239. package/dist/protocol/diff/read.d.mts +1 -1
  240. package/dist/protocol/diff/read.mjs +1 -1
  241. package/dist/protocol/diff/tree-diff.d.mts +1 -1
  242. package/dist/protocol/diff/tree-diff.mjs +11 -11
  243. package/dist/protocol/objects/fsck.mjs +6 -3
  244. package/dist/protocol/objects/lfs-pointer.mjs +6 -1
  245. package/dist/protocol/objects/tag.mjs +1 -1
  246. package/dist/protocol/objects/tree.mjs +1 -1
  247. package/dist/protocol/packs/graph.mjs +1 -1
  248. package/dist/protocol/packs/idx.d.mts +1 -1
  249. package/dist/protocol/packs/idx.mjs +1 -1
  250. package/dist/protocol/packs/parts.mjs +1 -1
  251. package/dist/protocol/packs/reader.d.mts +1 -1
  252. package/dist/protocol/packs/reader.mjs +2 -2
  253. package/dist/protocol/packs/write-error.d.mts +1 -1
  254. package/dist/protocol/packs/write-error.mjs +1 -1
  255. package/dist/protocol/packs/writer.mjs +4 -4
  256. package/dist/protocol/wire/advertisement.d.mts +1 -1
  257. package/dist/protocol/wire/advertisement.mjs +1 -1
  258. package/dist/protocol/wire/fetch.d.mts +1 -1
  259. package/dist/protocol/wire/fetch.mjs +1 -1
  260. package/dist/protocol/wire/lines.d.mts +1 -1
  261. package/dist/protocol/wire/lines.mjs +2 -2
  262. package/dist/protocol/wire/push-uploads.mjs +4 -2
  263. package/dist/protocol/wire/receive-pack.d.mts +1 -1
  264. package/dist/protocol/wire/receive-pack.mjs +1 -1
  265. package/dist/protocol/wire/report-status.d.mts +1 -1
  266. package/dist/protocol/wire/report-status.mjs +1 -1
  267. package/dist/protocol/wire/v2.d.mts +2 -2
  268. package/dist/protocol/wire/v2.mjs +2 -2
  269. package/dist/queue/advance.mjs +190 -68
  270. package/dist/queue/callers.mjs +56 -69
  271. package/dist/queue/calls.mjs +10 -11
  272. package/dist/queue/commit.mjs +28 -22
  273. package/dist/queue/host.d.mts +10 -11
  274. package/dist/queue/host.mjs +15 -7
  275. package/dist/queue/lanes.mjs +9 -18
  276. package/dist/queue/layer.d.mts +3 -3
  277. package/dist/queue/layer.mjs +11 -10
  278. package/dist/queue/limits.mjs +17 -5
  279. package/dist/queue/rows.mjs +13 -10
  280. package/dist/queue/schedule.mjs +7 -6
  281. package/dist/queue/search.mjs +11 -17
  282. package/dist/queue/state.mjs +7 -2
  283. package/dist/queue/trim.mjs +10 -5
  284. package/dist/rest/api.d.mts +1 -1
  285. package/dist/rest/blobs.d.mts +20 -20
  286. package/dist/rest/caller.d.mts +22 -20
  287. package/dist/rest/client-namespace.d.mts +2 -0
  288. package/dist/rest/client.d.mts +32 -8
  289. package/dist/rest/client.mjs +314 -388
  290. package/dist/rest/commits.d.mts +284 -284
  291. package/dist/rest/errors.d.mts +10 -10
  292. package/dist/rest/errors.mjs +1 -1
  293. package/dist/rest/events.d.mts +13 -11
  294. package/dist/rest/events.mjs +3 -1
  295. package/dist/rest/files.d.mts +48 -48
  296. package/dist/rest/forks.d.mts +131 -143
  297. package/dist/rest/handler.mjs +4 -3
  298. package/dist/rest/handlers.mjs +15 -8
  299. package/dist/rest/layer.d.mts +3 -3
  300. package/dist/rest/layer.mjs +8 -7
  301. package/dist/rest/listen.d.mts +8 -6
  302. package/dist/rest/listen.mjs +33 -77
  303. package/dist/rest/me.d.mts +18 -20
  304. package/dist/rest/me.mjs +1 -1
  305. package/dist/rest/merges.d.mts +17 -17
  306. package/dist/rest/queue.d.mts +140 -140
  307. package/dist/rest/queue.mjs +1 -1
  308. package/dist/rest/refs.d.mts +214 -214
  309. package/dist/rest/refs.mjs +1 -1
  310. package/dist/rest/repos.d.mts +123 -135
  311. package/dist/rest/tags.d.mts +30 -30
  312. package/dist/rest/tokens.d.mts +250 -260
  313. package/dist/rest/tokens.mjs +10 -42
  314. package/dist/rest/topics.d.mts +162 -162
  315. package/dist/rest/topics.mjs +1 -1
  316. package/dist/rest/trees.d.mts +117 -117
  317. package/dist/rest/wire.d.mts +7 -5
  318. package/dist/rest/wire.mjs +4 -3
  319. package/dist/rest/work.d.mts +69 -69
  320. package/dist/rest/work.mjs +1 -1
  321. package/dist/rest.d.mts +1 -7
  322. package/dist/rest.mjs +1 -5
  323. package/dist/server/check-fetch.mjs +9 -0
  324. package/dist/server/extension.mjs +3 -115
  325. package/dist/server/git-layer.d.mts +30 -5
  326. package/dist/server/git-layer.mjs +59 -29
  327. package/dist/server/git-namespace.d.mts +4 -4
  328. package/dist/server/git-namespace.mjs +6 -4
  329. package/dist/server/joined.d.mts +83 -0
  330. package/dist/server/joined.mjs +91 -0
  331. package/dist/server/registry.d.mts +7 -3
  332. package/dist/server/registry.mjs +135 -31
  333. package/dist/server/server.d.mts +9 -3
  334. package/dist/server/server.mjs +277 -208
  335. package/dist/signin/context.d.mts +2 -2
  336. package/dist/signin/context.mjs +28 -37
  337. package/dist/signin/device.mjs +5 -5
  338. package/dist/signin/forms.mjs +1 -1
  339. package/dist/signin/grants.d.mts +2 -3
  340. package/dist/signin/grants.mjs +5 -5
  341. package/dist/signin/layer.d.mts +9 -0
  342. package/dist/signin/layer.mjs +41 -0
  343. package/dist/signin/namespace.d.mts +2 -0
  344. package/dist/signin/public.d.mts +6 -0
  345. package/dist/signin/public.mjs +5 -0
  346. package/dist/signin/route.mjs +47 -21
  347. package/dist/signin/web.mjs +3 -3
  348. package/dist/signin/wire.mjs +1 -1
  349. package/dist/storage/calls.d.mts +1 -1
  350. package/dist/storage/calls.mjs +4 -4
  351. package/dist/storage/clean-up.mjs +15 -6
  352. package/dist/storage/counted-bucket.mjs +34 -51
  353. package/dist/storage/fetch.mjs +1 -1
  354. package/dist/storage/fsck.mjs +12 -2
  355. package/dist/storage/graph-rebuild.mjs +262 -0
  356. package/dist/storage/host-bucket.mjs +1 -1
  357. package/dist/storage/index-build.d.mts +2 -2
  358. package/dist/storage/index-build.mjs +103 -15
  359. package/dist/storage/index-fetch.mjs +10 -6
  360. package/dist/storage/index-graph.mjs +1 -1
  361. package/dist/storage/index-layers.mjs +1 -1
  362. package/dist/storage/index-visible.mjs +1 -1
  363. package/dist/storage/lfs-pointers.d.mts +5 -5
  364. package/dist/storage/lfs-pointers.mjs +37 -11
  365. package/dist/storage/loose.mjs +4 -1
  366. package/dist/storage/memory-budget.mjs +8 -2
  367. package/dist/storage/merge-cut.mjs +24 -1
  368. package/dist/storage/merge-fence.mjs +82 -20
  369. package/dist/storage/merge-most.mjs +1 -0
  370. package/dist/storage/merge-plan.mjs +5 -2
  371. package/dist/storage/merge-row.mjs +17 -5
  372. package/dist/storage/merge-stream.mjs +25 -13
  373. package/dist/storage/merge-write.mjs +1 -1
  374. package/dist/storage/merge.d.mts +2 -2
  375. package/dist/storage/merge.mjs +1 -1
  376. package/dist/storage/object-rows.d.mts +2 -2
  377. package/dist/storage/object-rows.mjs +20 -4
  378. package/dist/storage/pack-ranges.d.mts +3 -1
  379. package/dist/storage/pack-ranges.mjs +168 -69
  380. package/dist/storage/pack-reads.mjs +4 -4
  381. package/dist/storage/pack-receive.d.mts +1 -1
  382. package/dist/storage/pack-receive.mjs +17 -15
  383. package/dist/storage/packs.d.mts +1 -1
  384. package/dist/storage/packs.mjs +103 -79
  385. package/dist/storage/placed-reads.mjs +81 -15
  386. package/dist/storage/prune-seen.mjs +126 -0
  387. package/dist/storage/prune-walk.mjs +87 -99
  388. package/dist/storage/prune.mjs +113 -50
  389. package/dist/storage/push-uploads.mjs +4 -2
  390. package/dist/storage/quarantine.d.mts +2 -2
  391. package/dist/storage/ready.d.mts +2 -2
  392. package/dist/storage/ready.mjs +15 -6
  393. package/dist/storage/receive-files.mjs +1 -1
  394. package/dist/storage/receive-links.mjs +1 -1
  395. package/dist/storage/receive-state.d.mts +2 -2
  396. package/dist/storage/receive-state.mjs +2 -2
  397. package/dist/storage/receive-steps.mjs +1 -1
  398. package/dist/storage/repack-contained.mjs +24 -16
  399. package/dist/storage/repack-job.d.mts +2 -2
  400. package/dist/storage/repack-job.mjs +5 -4
  401. package/dist/storage/repack.d.mts +2 -2
  402. package/dist/storage/repack.mjs +12 -5
  403. package/dist/storage/rows.d.mts +2 -2
  404. package/dist/storage/rows.mjs +1 -1
  405. package/dist/storage/runs.d.mts +2 -2
  406. package/dist/storage/runs.mjs +15 -6
  407. package/dist/storage/send-list.mjs +6 -6
  408. package/dist/storage/single-flight.mjs +2 -2
  409. package/dist/storage/swap-walk.mjs +1 -1
  410. package/dist/storage/unpack.mjs +8 -1
  411. package/dist/store/call-count.d.mts +24 -4
  412. package/dist/store/call-count.mjs +158 -44
  413. package/dist/store/catalogue.d.mts +1 -1
  414. package/dist/store/catalogue.mjs +2 -2
  415. package/dist/store/crossing.mjs +2 -6
  416. package/dist/store/cursor-seal.mjs +1 -1
  417. package/dist/store/errors.d.mts +7 -3
  418. package/dist/store/errors.mjs +41 -13
  419. package/dist/store/job-try.mjs +119 -15
  420. package/dist/store/list-job.mjs +5 -5
  421. package/dist/store/outbox.d.mts +2 -2
  422. package/dist/store/outbox.mjs +75 -16
  423. package/dist/store/promises.d.mts +2 -2
  424. package/dist/store/promises.mjs +31 -6
  425. package/dist/store/queue-jobs.mjs +1 -1
  426. package/dist/store/records.d.mts +2 -2
  427. package/dist/store/records.mjs +22 -24
  428. package/dist/store/ref-rows.d.mts +2 -2
  429. package/dist/store/ref-rows.mjs +6 -6
  430. package/dist/store/repo-record.mjs +29 -12
  431. package/dist/store/reservations.mjs +35 -8
  432. package/dist/store/scopes.mjs +12 -5
  433. package/dist/store/topic-jobs.mjs +8 -8
  434. package/dist/sync/bound.d.mts +1 -3
  435. package/dist/sync/bound.mjs +30 -42
  436. package/dist/sync/github.d.mts +5 -6
  437. package/dist/sync/github.mjs +37 -42
  438. package/dist/sync/http.mjs +15 -0
  439. package/dist/sync/import.mjs +30 -19
  440. package/dist/sync/layer.d.mts +13 -0
  441. package/dist/sync/layer.mjs +73 -0
  442. package/dist/sync/mirror.mjs +137 -58
  443. package/dist/sync/publish.mjs +3 -6
  444. package/dist/sync/step.mjs +223 -85
  445. package/dist/sync/tries.mjs +22 -15
  446. package/dist/sync.d.mts +3 -6
  447. package/dist/sync.mjs +3 -6
  448. package/dist/topics/advance.mjs +210 -94
  449. package/dist/topics/calls.mjs +8 -8
  450. package/dist/topics/directory.mjs +35 -12
  451. package/dist/topics/host.d.mts +5 -8
  452. package/dist/topics/host.mjs +42 -19
  453. package/dist/topics/layer.d.mts +381 -0
  454. package/dist/topics/layer.mjs +62 -0
  455. package/dist/topics/members.mjs +39 -10
  456. package/dist/topics/namespace.d.mts +2 -0
  457. package/dist/topics/public.d.mts +6 -0
  458. package/dist/topics/public.mjs +13 -0
  459. package/dist/topics/rows.mjs +12 -3
  460. package/dist/topics/topic.mjs +11 -10
  461. package/package.json +8 -13
  462. package/dist/access.d.mts +0 -2
  463. package/dist/access.mjs +0 -1
  464. package/dist/core/hooks/post-receive.mjs +0 -216
  465. package/dist/core/hooks/pre-receive.d.mts +0 -12
  466. package/dist/core/hooks/pre-receive.mjs +0 -36
  467. package/dist/engine/merge-base-walk.d.mts +0 -3
  468. package/dist/server/extension.d.mts +0 -21
  469. package/dist/server/routes.d.mts +0 -32
  470. package/dist/server/routes.mjs +0 -69
  471. package/dist/sync/import.d.mts +0 -10
  472. package/dist/sync/jobs.d.mts +0 -9
  473. package/dist/sync/jobs.mjs +0 -75
  474. package/dist/sync/mirror.d.mts +0 -13
  475. package/dist/sync/publish.d.mts +0 -6
  476. /package/dist/core/{claim-rows.d.mts → registered-rows.d.mts} +0 -0
@@ -1,22 +1,26 @@
1
1
  import { RefName } from "./ids.mjs";
2
+ import * as Schema from "effect/Schema";
3
+ import * as Context from "effect/Context";
2
4
  /**
3
5
  * What `authorize` accepts a `refs.private` operation with: the patterns, of those it was asked
4
6
  * about, whose refs the caller sees, and those whose commits the caller may publish. A list left
5
7
  * out is empty.
6
8
  */
7
- export interface RefAudience {
8
- readonly read?: readonly RefName[];
9
- readonly publish?: readonly RefName[];
10
- }
9
+ export declare const RefAudience: Schema.Struct<{
10
+ readonly read: Schema.optionalKey<Schema.$Array<Schema.String>>;
11
+ readonly publish: Schema.optionalKey<Schema.$Array<Schema.String>>;
12
+ }>;
13
+ export type RefAudience = typeof RefAudience.Type;
11
14
  /**
12
15
  * Ref names from `from`, and before `to`, in the stores' id order: with no `to`, to the end of the
13
16
  * names under the listing's prefix. A `to` ending in U+0000, which no ref name holds, ends just
14
17
  * after the name before it, so a span can end at one name.
15
18
  */
16
- export interface HiddenSpan {
17
- readonly from: string;
18
- readonly to?: string;
19
- }
19
+ export declare const HiddenSpan: Schema.Struct<{
20
+ readonly from: Schema.String;
21
+ readonly to: Schema.optionalKey<Schema.String>;
22
+ }>;
23
+ export type HiddenSpan = typeof HiddenSpan.Type;
20
24
  /**
21
25
  * Which refs one caller sees, from its `refs.private` answer. A ref it doesn't see answers as a
22
26
  * missing one on every surface. `whole` is true when it reads every pattern: then it sees every
@@ -95,7 +99,7 @@ export interface RefView {
95
99
  readonly publishes: (pattern: RefName) => boolean;
96
100
  }
97
101
  /**
98
- * Private branches, as `privateRefs` from `@ref0/git/access` makes them, for `createGitServer`'s
102
+ * Private branches, as `PrivateRefs.layer` configures them, for `createGitServer`'s
99
103
  * `access`. Without it, everyone who may read a repo sees all of it, and none of this runs.
100
104
  */
101
105
  export interface AccessOption {
@@ -115,4 +119,8 @@ export interface AccessOption {
115
119
  * whole caller sees.
116
120
  */
117
121
  readonly refViewOf: (audience: RefAudience, hidden: readonly string[]) => RefView;
118
- }
122
+ }
123
+ declare const PrivateRefs_base: Context.ServiceClass<PrivateRefs, "@ref0/git/PrivateRefs", AccessOption>;
124
+ /** A host's ref view, provided under Git.layer; absent, every ref is listed. */
125
+ export declare class PrivateRefs extends /* @__PURE__ */ PrivateRefs_base {}
126
+ export {};
@@ -0,0 +1,17 @@
1
+ import { RefName } from "./ids.mjs";
2
+ import * as Schema from "effect/Schema";
3
+ import * as Context from "effect/Context";
4
+ // src/contracts/access.ts
5
+ /**
6
+ * What `authorize` accepts a `refs.private` operation with: the patterns, of those it was asked
7
+ * about, whose refs the caller sees, and those whose commits the caller may publish. A list left
8
+ * out is empty.
9
+ */
10
+ const RefAudience = /* @__PURE__ */ Schema.Struct({
11
+ read: Schema.optionalKey(Schema.Array(RefName)),
12
+ publish: Schema.optionalKey(Schema.Array(RefName))
13
+ });
14
+ Schema.String, Schema.optionalKey(Schema.String);
15
+ /** A host's ref view, provided under Git.layer; absent, every ref is listed. */
16
+ var PrivateRefs = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/PrivateRefs")) {};
17
+ export { PrivateRefs, RefAudience };
@@ -27,15 +27,31 @@ export interface AnonymousActor<Meta = unknown> {
27
27
  readonly anonymous: true;
28
28
  readonly meta?: Meta;
29
29
  }
30
+ /** An `AnonymousActor` as JSON names one, its `meta` unread. */
31
+ export declare const AnonymousActor: Schema.Struct<{
32
+ readonly anonymous: Schema.Literal<true>;
33
+ readonly meta: Schema.optionalKey<Schema.Unknown>;
34
+ }>;
30
35
  export type Actor<Meta = unknown> = NamedActor<Meta> | AnonymousActor<Meta>;
36
+ /** An `Actor` as JSON names one, its `meta` unread. */
37
+ export declare const Actor: Schema.Union<readonly [Schema.Struct<{
38
+ readonly id: Schema.String;
39
+ readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
40
+ readonly meta: Schema.optionalKey<Schema.Unknown>;
41
+ }>, Schema.Struct<{
42
+ readonly anonymous: Schema.Literal<true>;
43
+ readonly meta: Schema.optionalKey<Schema.Unknown>;
44
+ }>]>;
31
45
  /**
32
46
  * The actor of a merge queue's publish of an entry, asked again after it waited: its ID alone. It
33
47
  * has no `meta`, which was a snapshot of the sign-in at `queue.add`, and replaying it would decide
34
48
  * the publish on what held then.
35
49
  */
36
- export interface QueuedActor extends ActorId {
37
- readonly anonymous?: false;
38
- }
50
+ export declare const QueuedActor: Schema.Struct<{
51
+ readonly id: Schema.String;
52
+ readonly anonymous: Schema.optionalKey<Schema.Literal<false>>;
53
+ }>;
54
+ export type QueuedActor = typeof QueuedActor.Type;
39
55
  /**
40
56
  * Who a check is asked about. `at: 'queued'`: the merge queue's publish of an entry that waited,
41
57
  * asked again as the caller that added it, its actor named by ID alone, with no `meta`. Narrow on
@@ -49,9 +65,10 @@ export type Acting<Meta = unknown> = {
49
65
  readonly at: 'queued';
50
66
  readonly actor: QueuedActor;
51
67
  };
52
- export interface CallInput {
53
- readonly signal?: AbortSignal;
54
- }
68
+ export declare const CallInput: Schema.Struct<{
69
+ readonly signal: Schema.optionalKey<Schema.declare<AbortSignal, AbortSignal>>;
70
+ }>;
71
+ export type CallInput = typeof CallInput.Type;
55
72
  /** Every call names who it acts for, reads included, and `authorize` decides it. */
56
73
  export interface ActorInput<Meta = unknown> extends CallInput {
57
74
  readonly actor: Actor<Meta>;
@@ -66,40 +83,64 @@ export interface ActorInput<Meta = unknown> extends CallInput {
66
83
  * receipts: only the writes do. A key past `maxWriteKeyLength` bytes in UTF-8 is
67
84
  * `INVALID_ARGUMENT`, `context.field` naming it.
68
85
  * `tokens.create`'s key is refused for the token's life instead, since its secret is shown once.
86
+ * A resent fork key answers the fork as it is now, read as `repos.get` reads it for that caller,
87
+ * while every other key answers as it first did. An object write, such as `blobs.create` or
88
+ * `commits.create`, sent again once its repo is deleted answers `NOT_FOUND`, as any call on the
89
+ * repo does then: its answer reads objects the delete lets go of.
69
90
  */
70
91
  export interface WriteInput<Meta = unknown> extends ActorInput<Meta> {
71
92
  readonly key?: string;
72
93
  }
73
- export interface CredentialsBasic {
74
- readonly kind: 'basic';
75
- readonly username: string;
76
- readonly password: string;
77
- }
78
- export interface CredentialsBearer {
79
- readonly kind: 'bearer';
80
- readonly token: string;
81
- }
82
- export type Credentials = CredentialsBasic | CredentialsBearer;
83
- export interface AuthInput {
84
- readonly request: Request;
85
- readonly credentials?: Credentials;
86
- readonly signal: AbortSignal;
87
- }
94
+ export declare const CredentialsBasic: Schema.Struct<{
95
+ readonly kind: Schema.Literal<"basic">;
96
+ readonly username: Schema.String;
97
+ readonly password: Schema.String;
98
+ }>;
99
+ export type CredentialsBasic = typeof CredentialsBasic.Type;
100
+ export declare const CredentialsBearer: Schema.Struct<{
101
+ readonly kind: Schema.Literal<"bearer">;
102
+ readonly token: Schema.String;
103
+ }>;
104
+ export type CredentialsBearer = typeof CredentialsBearer.Type;
105
+ export declare const Credentials: Schema.Union<readonly [Schema.Struct<{
106
+ readonly kind: Schema.Literal<"basic">;
107
+ readonly username: Schema.String;
108
+ readonly password: Schema.String;
109
+ }>, Schema.Struct<{
110
+ readonly kind: Schema.Literal<"bearer">;
111
+ readonly token: Schema.String;
112
+ }>]>;
113
+ export type Credentials = typeof Credentials.Type;
114
+ export declare const AuthInput: Schema.Struct<{
115
+ readonly request: Schema.declare<Request, Request>;
116
+ readonly credentials: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
117
+ readonly kind: Schema.Literal<"basic">;
118
+ readonly username: Schema.String;
119
+ readonly password: Schema.String;
120
+ }>, Schema.Struct<{
121
+ readonly kind: Schema.Literal<"bearer">;
122
+ readonly token: Schema.String;
123
+ }>]>>;
124
+ readonly signal: Schema.declare<AbortSignal, AbortSignal>;
125
+ }>;
126
+ export type AuthInput = typeof AuthInput.Type;
88
127
  /** Who is calling: `undefined` for a credential it doesn't know. */
89
128
  export type GitAuth<Meta = unknown> = (input: AuthInput) => Awaitable<Actor<Meta> | undefined>;
90
129
  /**
91
130
  * The extension's grant resolver that identified a caller, by its `name`, for reading only: Git
92
131
  * never trusts it, so a caller built by hand with it is a plain caller. To keep a caller's grant,
93
- * such as a link or a queued entry does, read `ExtendedGit.grantOf`.
132
+ * such as a link or a queued entry does, read `Authorize.grantOf`.
94
133
  */
95
- export interface CallerGrant {
96
- readonly resolver: string;
97
- }
134
+ export declare const CallerGrant: Schema.Struct<{
135
+ readonly resolver: Schema.String;
136
+ }>;
137
+ export type CallerGrant = typeof CallerGrant.Type;
98
138
  /**
99
139
  * `subject`: whom the actor acts for. `token`: set when the credential is one of Git's tokens.
100
140
  * `grant`: set when an extension's grant resolver identified the caller, and absent for a token
101
141
  * or the host's `auth`. `at: 'queued'`: the merge queue publishing an entry as the caller that
102
- * added it, its token and grant identified again, its actor with no `meta`.
142
+ * added it, its token and grant identified again, its actor with no `meta`. Its Schema is
143
+ * `callers.ts`' `Caller`.
103
144
  */
104
145
  export interface Caller<Meta = unknown> {
105
146
  readonly actor: Actor<Meta>;
@@ -122,7 +163,8 @@ export type RepoAccess = typeof RepoAccess.Type;
122
163
  /**
123
164
  * `subject` and `token`: the caller's, as `Caller` has them. With `at: 'queued'`, the merge
124
165
  * queue's publish of an entry that waited, asked as the caller that added it, again: its actor
125
- * is its ID alone, with no `meta`, and its token is the one it added with, read again live.
166
+ * is its ID alone, with no `meta`, and its token is the one it added with, read again live. Its
167
+ * Schema is `callers.ts`' `AuthorizeInput`.
126
168
  */
127
169
  export type AuthorizeInput<Meta = unknown> = Acting<Meta> & {
128
170
  readonly subject?: ActorId;
@@ -151,7 +193,10 @@ export type AuthorizeInput<Meta = unknown> = Acting<Meta> & {
151
193
  * Decided 21 Nov by the coordinator.
152
194
  *
153
195
  * A `refs.private` operation, asked only of a server made with `access`, is accepted with the
154
- * caller's `RefAudience`: `accept({ read, publish })`. Any other is accepted with no value.
196
+ * caller's `RefAudience`: `accept({ read, publish })`. Any other is accepted with no value. One
197
+ * asked with no `repo` is an import's, before it makes the repo the operation names: decide it
198
+ * from the caller, the name and the patterns, as `repo.create`, and read no repo, as none is
199
+ * there yet. An importer who reads fewer than every pattern is refused the import.
155
200
  *
156
201
  * Decide about a repo by its `repo.internalId`, the repo the call then acts on. A name can move
157
202
  * between repos while you decide: swap two repos' names and back around one call, and a host that
@@ -1,3 +1,4 @@
1
+ import { AbortSignalValue } from "./opaque.mjs";
1
2
  import { PinnedRepo } from "./repos.mjs";
2
3
  import * as Schema from "effect/Schema";
3
4
  // src/contracts/actors.ts
@@ -13,5 +14,47 @@ const NamedActor = /* @__PURE__ */ Schema.Struct({
13
14
  anonymous: Schema.optionalKey(Schema.Literal(false)),
14
15
  meta: Schema.optionalKey(Schema.Unknown)
15
16
  });
16
- ({ ...PinnedRepo.fields }), Schema.Boolean;
17
- export { ActorId, NamedActor };
17
+ /** An `AnonymousActor` as JSON names one, its `meta` unread. */
18
+ const AnonymousActor = /* @__PURE__ */ Schema.Struct({
19
+ anonymous: Schema.Literal(true),
20
+ meta: Schema.optionalKey(Schema.Unknown)
21
+ });
22
+ /** An `Actor` as JSON names one, its `meta` unread. */
23
+ const Actor = /* @__PURE__ */ Schema.Union([NamedActor, AnonymousActor]);
24
+ /**
25
+ * The actor of a merge queue's publish of an entry, asked again after it waited: its ID alone. It
26
+ * has no `meta`, which was a snapshot of the sign-in at `queue.add`, and replaying it would decide
27
+ * the publish on what held then.
28
+ */
29
+ const QueuedActor = /* @__PURE__ */ Schema.Struct({
30
+ ...ActorId.fields,
31
+ anonymous: Schema.optionalKey(Schema.Literal(false))
32
+ });
33
+ const CallInput = /* @__PURE__ */ Schema.Struct({ signal: Schema.optionalKey(AbortSignalValue) });
34
+ const CredentialsBasic = /* @__PURE__ */ Schema.Struct({
35
+ kind: Schema.Literal("basic"),
36
+ username: Schema.String,
37
+ password: Schema.String
38
+ });
39
+ const CredentialsBearer = /* @__PURE__ */ Schema.Struct({
40
+ kind: Schema.Literal("bearer"),
41
+ token: Schema.String
42
+ });
43
+ const Credentials = /* @__PURE__ */ Schema.Union([CredentialsBasic, CredentialsBearer]);
44
+ Schema.optionalKey(Credentials);
45
+ /**
46
+ * The extension's grant resolver that identified a caller, by its `name`, for reading only: Git
47
+ * never trusts it, so a caller built by hand with it is a plain caller. To keep a caller's grant,
48
+ * such as a link or a queued entry does, read `Authorize.grantOf`.
49
+ */
50
+ const CallerGrant = /* @__PURE__ */ Schema.Struct({ resolver: Schema.String });
51
+ /**
52
+ * The repo an operation names, when it exists: its name, its visibility and which repo it is
53
+ * underneath, all read in one snapshot. `internalId` stays with the repo across a rename, so a
54
+ * host that keys its grants by it decides about the repo the call then acts on.
55
+ */
56
+ const RepoAccess = /* @__PURE__ */ Schema.Struct({
57
+ ...PinnedRepo.fields,
58
+ public: Schema.Boolean
59
+ });
60
+ export { Actor, ActorId, AnonymousActor, CallInput, CallerGrant, Credentials, CredentialsBasic, CredentialsBearer, NamedActor, QueuedActor, RepoAccess };
@@ -4,11 +4,11 @@ import { GrantAgainRequest } from "./grants.mjs";
4
4
  import { InternalRepoId, RefName, RepoName } from "./ids.mjs";
5
5
  import { Operation } from "./operations.mjs";
6
6
  import { GitError } from "./result.mjs";
7
- import { TokenScope } from "./tokens.mjs";
7
+ import { GrantScope } from "./tokens.mjs";
8
8
  import * as Effect from "effect/Effect";
9
9
  import * as Context from "effect/Context";
10
10
  declare namespace authorize_d_exports {
11
- export { Authorize, AuthorizeRequest, CeilingInput, audience, ceiling, check, grantAgain, grantOf };
11
+ export { AudienceInput, Authorize, AuthorizeRequest, CeilingInput, audience, ceiling, check, grantAgain, grantOf };
12
12
  }
13
13
  /** What `check` is asked: who acts, what they do, and the repo it names, when it names one. */
14
14
  export interface AuthorizeRequest {
@@ -27,29 +27,39 @@ export interface CeilingInput {
27
27
  readonly repo: RepoName;
28
28
  readonly internalId?: InternalRepoId;
29
29
  }
30
+ /**
31
+ * What `audience` is asked: who acts and the private patterns, about `repo`, a repo that exists,
32
+ * or `creating`, the name of one an import is about to make, which no repo has yet.
33
+ */
34
+ export type AudienceInput = {
35
+ readonly caller: Caller;
36
+ readonly patterns: readonly RefName[];
37
+ } & ({
38
+ readonly repo: RepoAccess;
39
+ readonly creating?: never;
40
+ } | {
41
+ readonly creating: RepoName;
42
+ readonly repo?: never;
43
+ });
30
44
  declare const Authorize_base: Context.ServiceClass<Authorize, "@ref0/git/Authorize", {
31
45
  /** Nothing when `request.caller` may do `request.operation`, else the refusal. */
32
46
  readonly check: (request: AuthorizeRequest) => Effect.Effect<void, GitError>;
33
47
  /** `refs.private`'s answer for `patterns`, for a server with `access`. */
34
- readonly audience: (input: {
35
- readonly caller: Caller;
36
- readonly repo: RepoAccess;
37
- readonly patterns: readonly RefName[];
38
- }) => Effect.Effect<RefAudience, GitError>;
48
+ readonly audience: (input: AudienceInput) => Effect.Effect<RefAudience, GitError>;
39
49
  /**
40
50
  * Git's own ceiling on `caller` for `repo`: its token's scope when the token covers the repo,
41
- * its grant's when the grant reaches it, `undefined` when either doesn't, and `'write'` for a
42
- * caller with neither. As `ExtendedGit.access` does today.
51
+ * its grant's when the grant reaches it, `undefined` when either doesn't, and `'write'` for an
52
+ * `admin` token or a caller with neither.
43
53
  */
44
- readonly ceiling: (input: CeilingInput) => Effect.Effect<TokenScope | undefined, GitError>;
45
- /** The resolver and grant that gave `caller`, if a grant did. As `ExtendedGit.grantOf` does today. */
54
+ readonly ceiling: (input: CeilingInput) => Effect.Effect<GrantScope | undefined, GitError>;
55
+ /** The resolver and grant that gave `caller`, if a grant did. */
46
56
  readonly grantOf: (caller: Caller) => {
47
57
  readonly resolver: string;
48
58
  readonly id: string;
49
59
  } | undefined;
50
60
  /**
51
61
  * The caller the resolver named `resolver` gives back for `request.id` now, or `undefined` when
52
- * none has that name or its grant ended. As `ExtendedGit.grantAgain` does today.
62
+ * none has that name or its grant ended.
53
63
  */
54
64
  readonly grantAgain: (input: {
55
65
  readonly resolver: string;
@@ -64,11 +74,10 @@ declare const Authorize_base: Context.ServiceClass<Authorize, "@ref0/git/Authori
64
74
  */
65
75
  export declare class Authorize extends /* @__PURE__ */ Authorize_base {}
66
76
  export declare const check: (request: AuthorizeRequest) => Effect.Effect<void, GitError, Authorize>;
67
- export declare const audience: (input: {
68
- readonly caller: Caller;
69
- readonly repo: RepoAccess;
70
- readonly patterns: readonly RefName[];
71
- }) => Effect.Effect<RefAudience, GitError, Authorize>;
77
+ export declare const audience: (input: AudienceInput) => Effect.Effect<{
78
+ readonly read?: readonly string[];
79
+ readonly publish?: readonly string[];
80
+ }, GitError, Authorize>;
72
81
  export declare const ceiling: (input: CeilingInput) => Effect.Effect<"read" | "report" | "write" | undefined, GitError, Authorize>;
73
82
  export declare const grantOf: (caller: Caller) => Effect.Effect<{
74
83
  readonly resolver: string;
@@ -5,8 +5,8 @@ import { ReadOptions } from "./engine.mjs";
5
5
  import { Oid, RepoName } from "./ids.mjs";
6
6
  import { Bytes } from "./object-values.mjs";
7
7
  import { RepoInput } from "./repos.mjs";
8
- import * as Schema from "effect/Schema";
9
8
  import * as Effect from "effect/Effect";
9
+ import * as Schema from "effect/Schema";
10
10
  import * as Context from "effect/Context";
11
11
  declare namespace blobs_d_exports {
12
12
  export { Acting, Blob, BlobCalls, BlobCreateInput, Blobs, CreatedObject, ObjectInput, create, get };
@@ -1,8 +1,8 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
2
  import { Oid } from "./ids.mjs";
3
3
  import { Bytes } from "./object-values.mjs";
4
- import * as Schema from "effect/Schema";
5
4
  import * as Effect from "effect/Effect";
5
+ import * as Schema from "effect/Schema";
6
6
  import * as Context from "effect/Context";
7
7
  // src/contracts/blobs.ts
8
8
  var blobs_exports = /* @__PURE__ */ __exportAll({
@@ -0,0 +1,40 @@
1
+ import { Actor, ActorId, CallInput, CallerGrant, QueuedActor, RepoAccess } from "./actors.mjs";
2
+ import "./opaque.mjs";
3
+ import "./operations.mjs";
4
+ import { TokenInfo } from "./tokens.mjs";
5
+ import * as Schema from "effect/Schema";
6
+ // src/contracts/callers.ts
7
+ /** An `Acting`: by the caller, or queued. */
8
+ const Acting = /* @__PURE__ */ Schema.Union([Schema.Struct({
9
+ at: Schema.optionalKey(Schema.Never),
10
+ actor: Actor
11
+ }), Schema.Struct({
12
+ at: Schema.Literal("queued"),
13
+ actor: QueuedActor
14
+ })]);
15
+ const ActorInput = /* @__PURE__ */ Schema.Struct({
16
+ ...CallInput.fields,
17
+ actor: Actor
18
+ });
19
+ ({ ...ActorInput.fields }), Schema.optionalKey(Schema.String);
20
+ /** A `Caller` as Git identified it. */
21
+ const Caller = /* @__PURE__ */ Schema.Struct({
22
+ actor: Actor,
23
+ subject: Schema.optionalKey(ActorId),
24
+ token: Schema.optionalKey(TokenInfo),
25
+ grant: Schema.optionalKey(CallerGrant),
26
+ at: Schema.optionalKey(Schema.Literal("queued"))
27
+ });
28
+ Schema.optionalKey(ActorId), Schema.optionalKey(TokenInfo), Schema.optionalKey(RepoAccess);
29
+ /**
30
+ * The Schema of a shape typed `Acting & { …fields }`: each arm of `Acting` with `fields`, so a
31
+ * queued arm's actor is read as `QueuedActor`'s.
32
+ */
33
+ const actingWith = (fields) => Schema.Union([Schema.Struct({
34
+ ...Acting.members[0].fields,
35
+ ...fields
36
+ }), Schema.Struct({
37
+ ...Acting.members[1].fields,
38
+ ...fields
39
+ })]);
40
+ export { Acting, ActorInput, Caller, actingWith };
@@ -4,9 +4,11 @@ import "effect/Cause";
4
4
  import "effect/Exit";
5
5
  /**
6
6
  * The refusal of the spent bound `cause` holds, `spentAt`'s, or `undefined` for a cause that holds
7
- * none: a Promise edge's answer, such as a host's route catching what a door's defect rejected
8
- * with (Q826). A bridge, as Q787 names one: it carries a spent bound across a Promise edge, where
9
- * `answerSpent` can't reach, since Effect's context stops at a Promise. The drop-in's Effect step
10
- * 2b (Q783) deletes it with the Promise edges, once its routes answer as Effects.
7
+ * none. A Promise edge reads it for its answer, such as a host's route catching what a door's
8
+ * defect rejected with (Q826): a bridge, as Q787 names one, carrying a spent bound across a
9
+ * Promise edge, where `answerSpent` can't reach, since Effect's context stops at a Promise. The
10
+ * drop-in's import reads it too, outside Git, where `answerSpent` isn't exported: a spent
11
+ * publication answers `RESOURCE_EXHAUSTED`, typed. The drop-in's Effect step 2b (Q783) deletes
12
+ * the edges' reads with the Promise edges, once its routes answer as Effects.
11
13
  */
12
14
  export declare const spentRefusalOf: (cause: unknown) => GitError | undefined;
@@ -1,11 +1,11 @@
1
1
  import { gitError } from "./result.mjs";
2
- import { isInfraError } from "@ref0/infra";
3
2
  import * as Effect from "effect/Effect";
4
- import * as Predicate from "effect/Predicate";
5
- import * as EffectResult from "effect/Result";
3
+ import * as Option from "effect/Option";
6
4
  import * as Cause from "effect/Cause";
7
5
  import * as Exit from "effect/Exit";
8
- import * as Option from "effect/Option";
6
+ import * as EffectResult from "effect/Result";
7
+ import { isInfraError } from "@ref0/infra";
8
+ import * as Predicate from "effect/Predicate";
9
9
  // src/contracts/calls-spent.ts
10
10
  /**
11
11
  * A call that never started, or that the platform refused, past a bound: `most` of `bound`'s calls
@@ -128,10 +128,12 @@ const catchSpent = (effect, spent) => Effect.catchCause(effect, (cause) => {
128
128
  });
129
129
  /**
130
130
  * The refusal of the spent bound `cause` holds, `spentAt`'s, or `undefined` for a cause that holds
131
- * none: a Promise edge's answer, such as a host's route catching what a door's defect rejected
132
- * with (Q826). A bridge, as Q787 names one: it carries a spent bound across a Promise edge, where
133
- * `answerSpent` can't reach, since Effect's context stops at a Promise. The drop-in's Effect step
134
- * 2b (Q783) deletes it with the Promise edges, once its routes answer as Effects.
131
+ * none. A Promise edge reads it for its answer, such as a host's route catching what a door's
132
+ * defect rejected with (Q826): a bridge, as Q787 names one, carrying a spent bound across a
133
+ * Promise edge, where `answerSpent` can't reach, since Effect's context stops at a Promise. The
134
+ * drop-in's import reads it too, outside Git, where `answerSpent` isn't exported: a spent
135
+ * publication answers `RESOURCE_EXHAUSTED`, typed. The drop-in's Effect step 2b (Q783) deletes
136
+ * the edges' reads with the Promise edges, once its routes answer as Effects.
135
137
  */
136
138
  const spentRefusalOf = (cause) => {
137
139
  const spent = spentAt(cause);
@@ -1,14 +1,14 @@
1
- import { CallInput } from "./actors.mjs";
2
1
  import { BlobCalls } from "./blobs.mjs";
3
2
  import { CommitCalls } from "./commits.mjs";
4
- import { Filter } from "./object-values.mjs";
5
3
  import { FileCalls } from "./files.mjs";
6
4
  import { Oid, RefName, RepoName } from "./ids.mjs";
5
+ import { Filter } from "./object-values.mjs";
7
6
  import { MergeCalls } from "./merges.mjs";
8
7
  import { ObjectsFactory } from "./objects.mjs";
9
8
  import { Ref, RefApplied, RefCalls, RefEdit, RefRejected, RefsUpdated } from "./refs.mjs";
10
- import { RemoteOptions, WithoutActor } from "./remote.mjs";
9
+ import { RemoteOptions, WithoutActor, WithoutSignal } from "./remote.mjs";
11
10
  import { Result } from "./result.mjs";
11
+ import { EffectCalls } from "./services.mjs";
12
12
  import { TagCalls } from "./tags.mjs";
13
13
  import { TreeCalls } from "./trees.mjs";
14
14
  import { Listing, Page, Records } from "@ref0/infra";
@@ -28,7 +28,7 @@ export interface GitClientOptions extends RemoteOptions {
28
28
  readonly adapter?: ClientAdapter;
29
29
  readonly objects?: ObjectsFactory<false>;
30
30
  }
31
- export interface RemoteRefsInput extends CallInput {
31
+ export interface RemoteRefsInput {
32
32
  /** Only refs whose full name starts with it, such as `refs/heads/`. */
33
33
  readonly prefix?: string;
34
34
  readonly page?: Page;
@@ -39,7 +39,7 @@ export interface RemoteRefsInput extends CallInput {
39
39
  * partial fetch, such as `{ kind: 'blob:none' }`. `force`: move a local ref that holds commits
40
40
  * the remote's tip doesn't to that tip anyway, as `git fetch --force` does.
41
41
  */
42
- export interface ClientFetchInput extends CallInput {
42
+ export interface ClientFetchInput {
43
43
  readonly refs?: readonly RefName[];
44
44
  readonly depth?: number;
45
45
  readonly filter?: Filter;
@@ -63,14 +63,15 @@ export interface ClientFetchResult {
63
63
  readonly updates: readonly (RefApplied | RefForced | RefRejected)[];
64
64
  }
65
65
  /** `from` is the remote's tip as last seen; `atomic`: all move or none, where the remote can. */
66
- export interface ClientPushInput extends CallInput {
66
+ export interface ClientPushInput {
67
67
  readonly updates: readonly RefEdit[];
68
68
  readonly atomic?: boolean;
69
69
  readonly pushOptions?: readonly string[];
70
70
  }
71
- /** A server's call group as a client makes it: no repo, and no actor. */
72
- export type Localize<Calls> = { readonly [Key in keyof Calls]: Calls[Key] extends ((repo: RepoName, input: infer Input) => infer Answer) ? (input: WithoutActor<Input>) => Answer : never; };
73
- export interface GitClient {
71
+ /** A server's call group as a client makes it: no repo, no actor, and no `signal`. */
72
+ export type Localize<Calls> = { readonly [Key in keyof Calls]: Calls[Key] extends ((repo: RepoName, input: infer Input) => infer Answer) ? (input: WithoutSignal<WithoutActor<Input>>) => Answer : never; };
73
+ /** A client's calls as their Promise twins describe them: `GitClientCalls` is their Effect face. */
74
+ export interface GitClientPromises {
74
75
  readonly remoteRefs: (input?: RemoteRefsInput) => Promise<Result<Listing<Ref>>>;
75
76
  readonly fetch: (input?: ClientFetchInput) => Promise<Result<ClientFetchResult>>;
76
77
  readonly push: (input: ClientPushInput) => Promise<Result<RefsUpdated>>;
@@ -82,6 +83,12 @@ export interface GitClient {
82
83
  readonly files: Localize<FileCalls>;
83
84
  readonly merges: Localize<MergeCalls>;
84
85
  }
86
+ /**
87
+ * A client of one remote, as `GitClient.make` gives it: `remoteRefs`, `fetch` and `push` on the
88
+ * remote, and the server's calls on its own storage, with no repo. Each call is an Effect that
89
+ * fails with the call's `GitError`.
90
+ */
91
+ export type GitClientCalls = EffectCalls<GitClientPromises>;
85
92
  /** A list call's input: the page it starts from. */
86
93
  export interface PagedInput {
87
94
  readonly page?: Page;
@@ -6,9 +6,9 @@ import { Commit, MergeBases, ReadOptions, ReadPage, TreeChanges } from "./engine
6
6
  import { Oid, RepoName } from "./ids.mjs";
7
7
  import { RepoInput } from "./repos.mjs";
8
8
  import { TreeEdit } from "./trees.mjs";
9
- import { Listing } from "@ref0/infra";
10
- import * as Schema from "effect/Schema";
11
9
  import * as Effect from "effect/Effect";
10
+ import * as Schema from "effect/Schema";
11
+ import { Listing } from "@ref0/infra";
12
12
  import * as Context from "effect/Context";
13
13
  declare namespace commits_d_exports {
14
14
  export { CommitCalls, CommitCreate, CommitCreateFields, CommitCreateInput, CommitDiff, CommitDiffInput, CommitMessage, CommitPick, CommitPickInput, CommitRevert, CommitRevertInput, Commits, CommitsMergeBase, CommitsMergeBaseInput, Compare, CompareInput, CompareRange, ComparisonFile, ComparisonFileFields, LineCounts, Log, LogInput, RefPublication, Revision, compare, create, diff, get, list, mergeBase, pick, revert };
@@ -1,8 +1,8 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
2
  import { Commit, DiffListing, Listing, Page, Signature, TreeChangeFields } from "./engine.mjs";
3
3
  import { Oid, RefName } from "./ids.mjs";
4
- import * as Schema from "effect/Schema";
5
4
  import * as Effect from "effect/Effect";
5
+ import * as Schema from "effect/Schema";
6
6
  import * as Context from "effect/Context";
7
7
  // src/contracts/commits.ts
8
8
  var commits_exports = /* @__PURE__ */ __exportAll({
@@ -1,8 +1,8 @@
1
1
  import { CallInput } from "./actors.mjs";
2
2
  import { Oid } from "./ids.mjs";
3
3
  import { Bytes, ObjectType, ReadLimits } from "./object-values.mjs";
4
- import { Listing, Page } from "@ref0/infra";
5
4
  import * as Schema from "effect/Schema";
5
+ import { Listing, Page } from "@ref0/infra";
6
6
  export interface ReadOptions extends CallInput {
7
7
  readonly limits?: ReadLimits;
8
8
  }