@ref0/git 0.12.0 → 0.14.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 (247) hide show
  1. package/dist/access/private-refs.mjs +3 -3
  2. package/dist/auth/auth.d.mts +2 -2
  3. package/dist/auth/auth.mjs +3 -6
  4. package/dist/auth/authorize.mjs +1 -17
  5. package/dist/auth/helpers.mjs +3 -11
  6. package/dist/auth/host-services.mjs +11 -0
  7. package/dist/auth/policy.d.mts +27 -7
  8. package/dist/auth/policy.mjs +8 -4
  9. package/dist/auth/tokens-layer.d.mts +1 -2
  10. package/dist/auth/tokens-layer.mjs +2 -3
  11. package/dist/auth/tokens-public.d.mts +3 -3
  12. package/dist/auth/tokens.d.mts +1 -8
  13. package/dist/auth/tokens.mjs +1 -8
  14. package/dist/auth.d.mts +1 -4
  15. package/dist/auth.mjs +1 -3
  16. package/dist/client/git-http.mjs +18 -4
  17. package/dist/client/push-upload.mjs +33 -7
  18. package/dist/client/remote.mjs +94 -28
  19. package/dist/client/slice-push.d.mts +1 -1
  20. package/dist/contracts/access.d.mts +8 -8
  21. package/dist/contracts/actors.d.mts +2 -34
  22. package/dist/contracts/blobs.d.mts +2 -2
  23. package/dist/contracts/client.d.mts +8 -3
  24. package/dist/contracts/commits.d.mts +10 -2
  25. package/dist/contracts/commits.mjs +9 -1
  26. package/dist/contracts/files.d.mts +2 -2
  27. package/dist/contracts/forks.d.mts +11 -1
  28. package/dist/contracts/git.d.mts +18 -7
  29. package/dist/contracts/git.mjs +3 -2
  30. package/dist/contracts/lfs.d.mts +0 -7
  31. package/dist/contracts/objects.d.mts +80 -10
  32. package/dist/contracts/operations.d.mts +3 -0
  33. package/dist/contracts/operations.mjs +12 -2
  34. package/dist/contracts/push-uploads.d.mts +44 -5
  35. package/dist/contracts/push-uploads.mjs +7 -3
  36. package/dist/contracts/refs.d.mts +28 -6
  37. package/dist/contracts/remote.mjs +1 -3
  38. package/dist/contracts/repo-records.d.mts +1 -0
  39. package/dist/contracts/repos.d.mts +90 -2
  40. package/dist/contracts/repos.mjs +29 -2
  41. package/dist/contracts/result.d.mts +23 -18
  42. package/dist/contracts/result.mjs +17 -4
  43. package/dist/contracts/rules.d.mts +22 -22
  44. package/dist/contracts/server.d.mts +28 -77
  45. package/dist/contracts/signin.d.mts +1 -1
  46. package/dist/contracts/sync.d.mts +79 -19
  47. package/dist/contracts/sync.mjs +34 -10
  48. package/dist/contracts/tokens.d.mts +1 -6
  49. package/dist/contracts/tokens.mjs +1 -2
  50. package/dist/contracts/topics.d.mts +0 -5
  51. package/dist/contracts/work.d.mts +66 -2
  52. package/dist/contracts/work.mjs +8 -1
  53. package/dist/core/access.mjs +27 -5
  54. package/dist/core/ancestry.d.mts +9 -0
  55. package/dist/core/ancestry.mjs +6 -6
  56. package/dist/core/asked.mjs +42 -4
  57. package/dist/core/call-names.mjs +1 -0
  58. package/dist/core/call-services.mjs +2 -1
  59. package/dist/core/events/deliver.mjs +10 -2
  60. package/dist/core/forks.mjs +3 -3
  61. package/dist/core/imports.mjs +147 -9
  62. package/dist/core/index-job.mjs +9 -6
  63. package/dist/core/job-view.mjs +8 -9
  64. package/dist/core/mirror-rows.mjs +19 -4
  65. package/dist/core/objects/commits.mjs +16 -6
  66. package/dist/core/parts.d.mts +6 -1
  67. package/dist/core/parts.mjs +1 -4
  68. package/dist/core/purge.mjs +76 -6
  69. package/dist/core/push-decide.mjs +1 -1
  70. package/dist/core/push-files.d.mts +12 -0
  71. package/dist/core/push-files.mjs +225 -0
  72. package/dist/core/push-repo.d.mts +8 -0
  73. package/dist/core/push-repo.mjs +56 -0
  74. package/dist/core/push.d.mts +17 -0
  75. package/dist/core/push.mjs +98 -26
  76. package/dist/core/receipts.mjs +26 -10
  77. package/dist/core/ref-view.mjs +59 -5
  78. package/dist/core/refs.mjs +13 -8
  79. package/dist/core/repack.mjs +11 -8
  80. package/dist/core/repo-info.mjs +16 -9
  81. package/dist/core/repos.mjs +30 -14
  82. package/dist/core/seam.mjs +2 -2
  83. package/dist/core/view.d.mts +6 -0
  84. package/dist/core/view.mjs +45 -12
  85. package/dist/core/work.mjs +47 -22
  86. package/dist/effect.d.mts +3 -1
  87. package/dist/effect.mjs +3 -1
  88. package/dist/engine/reads.mjs +13 -6
  89. package/dist/engine/walk.mjs +4 -4
  90. package/dist/event-streams/event-streams.d.mts +1 -1
  91. package/dist/event-streams/event-streams.mjs +1 -1
  92. package/dist/event-streams/stream.d.mts +1 -1
  93. package/dist/event-streams/stream.mjs +1 -1
  94. package/dist/extend.d.mts +3 -3
  95. package/dist/extend.mjs +2 -2
  96. package/dist/http/answers.mjs +4 -2
  97. package/dist/http/core-parts.mjs +64 -15
  98. package/dist/http/handler.mjs +2 -2
  99. package/dist/http/node.mjs +5 -4
  100. package/dist/http/parts.d.mts +1 -0
  101. package/dist/http/push-upload-job.mjs +503 -0
  102. package/dist/http/push-uploads.d.mts +1 -0
  103. package/dist/http/push-uploads.mjs +114 -56
  104. package/dist/http/upload-pack.mjs +7 -6
  105. package/dist/index.d.mts +23 -24
  106. package/dist/index.mjs +4 -7
  107. package/dist/lfs/base.d.mts +7 -3
  108. package/dist/lfs/base.mjs +2 -1
  109. package/dist/lfs/copy.d.mts +46 -0
  110. package/dist/lfs/copy.mjs +26 -0
  111. package/dist/lfs/layer.mjs +4 -2
  112. package/dist/lfs/objects.d.mts +6 -0
  113. package/dist/lfs/objects.mjs +68 -41
  114. package/dist/lfs/rows.d.mts +13 -0
  115. package/dist/lfs/service.d.mts +1 -7
  116. package/dist/lfs/service.mjs +1 -9
  117. package/dist/lfs/upload-most.mjs +5 -5
  118. package/dist/node.d.mts +2 -2
  119. package/dist/protocol/bytes/sha256-hasher.d.mts +15 -0
  120. package/dist/protocol/bytes/sha256.d.mts +32 -0
  121. package/dist/protocol/bytes/sha256.mjs +105 -49
  122. package/dist/protocol/wire/advertisement.mjs +9 -4
  123. package/dist/protocol/wire/lines.d.mts +4 -2
  124. package/dist/protocol/wire/lines.mjs +11 -5
  125. package/dist/protocol/wire/push-uploads.mjs +13 -1
  126. package/dist/protocol/wire/v2.mjs +2 -2
  127. package/dist/protocol.d.mts +3 -1
  128. package/dist/protocol.mjs +3 -1
  129. package/dist/queue/advance.mjs +1 -1
  130. package/dist/queue/host.d.mts +1 -7
  131. package/dist/queue/host.mjs +1 -7
  132. package/dist/queue/layer.mjs +1 -1
  133. package/dist/queue/trim.mjs +1 -1
  134. package/dist/rest/blobs.d.mts +31 -23
  135. package/dist/rest/blobs.mjs +1 -1
  136. package/dist/rest/caller.d.mts +49 -9
  137. package/dist/rest/caller.mjs +1 -1
  138. package/dist/rest/client.d.mts +10 -3
  139. package/dist/rest/client.mjs +4 -0
  140. package/dist/rest/commits.d.mts +273 -240
  141. package/dist/rest/errors.d.mts +24 -4
  142. package/dist/rest/events.d.mts +9 -6
  143. package/dist/rest/events.mjs +1 -2
  144. package/dist/rest/files.d.mts +127 -115
  145. package/dist/rest/forks.d.mts +121 -97
  146. package/dist/rest/handler.mjs +4 -57
  147. package/dist/rest/handlers.d.mts +1 -1
  148. package/dist/rest/handlers.mjs +18 -4
  149. package/dist/rest/layer.mjs +2 -1
  150. package/dist/rest/me.d.mts +8 -4
  151. package/dist/rest/merges.d.mts +8 -4
  152. package/dist/rest/paths.mjs +1 -0
  153. package/dist/rest/queue.d.mts +282 -226
  154. package/dist/rest/refs.d.mts +205 -176
  155. package/dist/rest/repos.d.mts +108 -80
  156. package/dist/rest/tags.d.mts +24 -12
  157. package/dist/rest/tokens.d.mts +235 -211
  158. package/dist/rest/topics.d.mts +53 -33
  159. package/dist/rest/trees.d.mts +105 -89
  160. package/dist/rest/work.d.mts +467 -20
  161. package/dist/rest/work.mjs +8 -0
  162. package/dist/server/edge-node.d.mts +9 -13
  163. package/dist/server/edge-node.mjs +9 -12
  164. package/dist/server/git-layer.d.mts +1 -6
  165. package/dist/server/git-layer.mjs +2 -2
  166. package/dist/server/git-namespace.d.mts +3 -3
  167. package/dist/server/joined.d.mts +15 -22
  168. package/dist/server/joined.mjs +5 -29
  169. package/dist/server/lifecycle.mjs +107 -23
  170. package/dist/server/registry.mjs +9 -1
  171. package/dist/server/server.mjs +133 -212
  172. package/dist/storage/budget.mjs +2 -2
  173. package/dist/storage/clean-up.mjs +13 -10
  174. package/dist/storage/fetch.mjs +13 -8
  175. package/dist/storage/file-limits.mjs +24 -0
  176. package/dist/storage/index-build.d.mts +1 -0
  177. package/dist/storage/index-build.mjs +106 -62
  178. package/dist/storage/index-fetch.mjs +16 -3
  179. package/dist/storage/index-reach.mjs +33 -5
  180. package/dist/storage/index-remap.mjs +8 -1
  181. package/dist/storage/index-shallow.mjs +5 -3
  182. package/dist/storage/largest-files.mjs +48 -0
  183. package/dist/storage/lfs-pointers.mjs +10 -1
  184. package/dist/storage/loose.mjs +3 -1
  185. package/dist/storage/memory-budget.mjs +28 -4
  186. package/dist/storage/pack-reads.mjs +8 -8
  187. package/dist/storage/pack-receive.mjs +83 -25
  188. package/dist/storage/packs.mjs +37 -21
  189. package/dist/storage/prune-keep.mjs +203 -34
  190. package/dist/storage/prune-walk.mjs +54 -16
  191. package/dist/storage/prune.mjs +629 -196
  192. package/dist/storage/push-uploads.mjs +36 -12
  193. package/dist/storage/quarantine.mjs +9 -9
  194. package/dist/storage/ready.mjs +47 -19
  195. package/dist/storage/receive-bounds.mjs +29 -8
  196. package/dist/storage/receive-state.mjs +8 -0
  197. package/dist/storage/receive-steps.mjs +71 -18
  198. package/dist/storage/repack.d.mts +1 -1
  199. package/dist/storage/repack.mjs +1 -8
  200. package/dist/storage/rows.mjs +12 -1
  201. package/dist/storage/shallow.d.mts +1 -0
  202. package/dist/storage/shallow.mjs +26 -4
  203. package/dist/storage/stream-whole.mjs +5 -2
  204. package/dist/storage/visible.mjs +29 -1
  205. package/dist/storage/walk.mjs +2 -1
  206. package/dist/store/catalogue.mjs +1 -0
  207. package/dist/store/cursor-seal-namespace.d.mts +2 -0
  208. package/dist/store/cursor-seal-public.d.mts +5 -0
  209. package/dist/store/cursor-seal-public.mjs +5 -0
  210. package/dist/store/cursor-seal.d.mts +16 -2
  211. package/dist/store/cursor-seal.mjs +26 -14
  212. package/dist/store/errors.mjs +9 -1
  213. package/dist/store/records.d.mts +2 -0
  214. package/dist/store/records.mjs +9 -6
  215. package/dist/store/repo-record.d.mts +9 -7
  216. package/dist/store/repo-record.mjs +102 -19
  217. package/dist/store/scopes.mjs +10 -2
  218. package/dist/sync/bound.d.mts +2 -0
  219. package/dist/sync/bound.mjs +11 -2
  220. package/dist/sync/github.d.mts +6 -1
  221. package/dist/sync/github.mjs +55 -43
  222. package/dist/sync/http.mjs +36 -1
  223. package/dist/sync/import.mjs +1 -0
  224. package/dist/sync/layer.mjs +6 -2
  225. package/dist/sync/lfs-batch.mjs +119 -0
  226. package/dist/sync/lfs-copy.mjs +251 -0
  227. package/dist/sync/mirror.mjs +210 -137
  228. package/dist/sync/smart-http.mjs +4 -2
  229. package/dist/sync/step.mjs +25 -5
  230. package/dist/sync/tries.mjs +45 -14
  231. package/dist/sync.d.mts +2 -2
  232. package/dist/topics/host.mjs +1 -19
  233. package/dist/topics/layer.mjs +1 -1
  234. package/package.json +3 -8
  235. package/dist/auth/bridge.mjs +0 -30
  236. package/dist/auth/helpers.d.mts +0 -17
  237. package/dist/core/purge.d.mts +0 -8
  238. package/dist/core/registered-rows.d.mts +0 -5
  239. package/dist/core/repack.d.mts +0 -11
  240. package/dist/http/handler.d.mts +0 -2
  241. package/dist/rest/handler.d.mts +0 -21
  242. package/dist/rest.d.mts +0 -2
  243. package/dist/rest.mjs +0 -1
  244. package/dist/server/registry.d.mts +0 -16
  245. package/dist/server/server.d.mts +0 -36
  246. package/dist/storage/repack-job.d.mts +0 -3
  247. package/dist/topics/host.d.mts +0 -7
@@ -1,18 +1,22 @@
1
- import { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadStarted } from "../contracts/push-uploads.mjs";
1
+ import { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadReceiving, PushUploadStarted } from "../contracts/push-uploads.mjs";
2
2
  import { fail, gitError } from "../contracts/result.mjs";
3
3
  import { openFor } from "../core/access.mjs";
4
4
  import { CoreParts, ObjectsParts } from "../core/parts.mjs";
5
5
  import { pushOptionsRefusal } from "../protocol/wire/receive-pack.mjs";
6
6
  import { pushReasonsCapability } from "../protocol/wire/push-limits.mjs";
7
+ import { retryAfterOf } from "../protocol/wire/push-uploads.mjs";
7
8
  import { decodeJson } from "../protocol/wire/json.mjs";
8
- import { bucketCall, bucketStream, readWhole } from "../storage/calls.mjs";
9
- import { PushUploadRow, completeMost, endUpload, partBytes, partLinkLife, partSizeOf, partsOf, pushPackTooLarge, pushUploadGrace, pushUploadKey, pushUploadLife, pushUploadMost, pushUploadRead, pushUploadRowKey } from "../storage/push-uploads.mjs";
9
+ import { bucketCall, readWhole } from "../storage/calls.mjs";
10
+ import "../storage/receive-bounds.mjs";
11
+ import { PushUploadRow, claimLapsed, completingMost, endUpload, partBytes, partLinkLife, partSizeOf, partsOf, pushPackTooLarge, pushUploadGrace, pushUploadKey, pushUploadLife, pushUploadMost, pushUploadRead, pushUploadRowKey } from "../storage/push-uploads.mjs";
10
12
  import { afterWrites, bestEffort, decodeRow, storeCall } from "../store/errors.mjs";
11
13
  import { randomText } from "../store/random.mjs";
12
14
  import { heldAdd, heldStore } from "../store/repo-record.mjs";
13
15
  import { newChangeId, repoScope } from "../store/scopes.mjs";
14
16
  import { gitAnswer, resultType } from "./answers.mjs";
15
17
  import { brokenBody, plainBody, readWhole as readWhole$1 } from "./bodies.mjs";
18
+ import { keptError } from "../core/receipts.mjs";
19
+ import { answerRow, pushedOf, rowsOf, startSteps } from "./push-upload-job.mjs";
16
20
  import { refusalLog, reportOf, routeCounted, thrownLog } from "./receive-pack.mjs";
17
21
  import * as Clock$1 from "effect/Clock";
18
22
  import * as Effect from "effect/Effect";
@@ -24,8 +28,11 @@ const bodyMost = 1048576;
24
28
  /** A pack's header: `PACK`, its version, and how many objects it holds. */
25
29
  const packHeader = 12;
26
30
  const zero = "0".repeat(40);
27
- /** Push uploads over `needs`, the server's, staged in `staging`, offered above `above` bytes. */
28
- const pushUploads = (needs, staging, above) => ({
31
+ /**
32
+ * Push uploads over `needs`, the server's, staged in `staging`, offered above `above` bytes, on a
33
+ * host whose requests get `cpuMs` of CPU: complete's 202 asks a client to wait that long.
34
+ */
35
+ const pushUploads = (needs, staging, above, cpuMs) => ({
29
36
  above,
30
37
  serve: (parts, call) => {
31
38
  const { route } = call;
@@ -34,13 +41,15 @@ const pushUploads = (needs, staging, above) => ({
34
41
  const parted = part(staging.uploads, call, route.upload, route.part);
35
42
  return routeCounted(parts, Effect.provideContext(parted, needs));
36
43
  }
37
- return routeCounted(parts, complete(staging, parts, call, route.upload).pipe(Effect.tapError((error) => refusalLog(call.repo, error)), Effect.provideContext(needs)));
44
+ const retryAfter = retryAfterOf((cpuMs ?? 3e4) / 1e3);
45
+ return routeCounted(parts, complete(staging, call, route.upload, retryAfter).pipe(Effect.tapError((error) => refusalLog(call.repo, error)), Effect.provideContext(needs)));
38
46
  }
39
47
  });
40
- /** `body` as `schema`'s JSON, the answer a push upload's begin or part gives. */
41
- const jsonAnswer = (schema, body) => new Response(Schema.encodeSync(Schema.fromJsonString(schema))(body), {
42
- status: 200,
48
+ /** `body` as `schema`'s JSON, the answer a push upload's route gives, with `headers` beside. */
49
+ const jsonAnswer = (schema, body, status = 200, headers = {}) => new Response(Schema.encodeSync(Schema.fromJsonString(schema))(body), {
50
+ status,
43
51
  headers: {
52
+ ...headers,
44
53
  "content-type": "application/json",
45
54
  "cache-control": "no-store"
46
55
  }
@@ -147,18 +156,21 @@ const part = /* @__PURE__ */ Effect.fnUntraced(function* (uploads, call, upload,
147
156
  });
148
157
  /**
149
158
  * The upload, `completing` from now: committed at the version its row was read, so of two
150
- * completes only one pushes, and no part link is given after.
159
+ * completes only one pushes, and no part link is given after. `undefined` when another complete
160
+ * claimed it first.
151
161
  */
152
162
  const claim = /* @__PURE__ */ Effect.fnUntraced(function* (repo, upload, actor, parts, maxParts) {
153
163
  for (let tries = 0; tries < 5; tries += 1) {
154
164
  const { row, version } = yield* rowOf(repo, upload, actor);
165
+ if (row.state !== "open") return void 0;
155
166
  const at = yield* Clock$1.currentTimeMillis;
156
- if (row.state !== "open" || at >= row.removeAt - completeMost) return yield* ended(upload);
167
+ if (at >= row.removeAt - 432e5) return yield* ended(upload);
157
168
  const count = partsOf(row.bytes, partSizeOf(row.bytes, maxParts));
158
169
  if (!(parts.length === count && parts.every((one, at) => one.part === at + 1))) return yield* fail("INVALID_ARGUMENT", `Name each of its ${count} parts, in order`);
159
170
  const claimed = {
160
171
  ...row,
161
- state: "completing"
172
+ state: "completing",
173
+ claimedAt: at
162
174
  };
163
175
  const { store } = yield* CoreParts;
164
176
  if ((yield* storeCall(() => store.commit(repoScope(repo), {
@@ -203,20 +215,49 @@ const startOf = (row) => ({
203
215
  packOffset: 0
204
216
  });
205
217
  /**
206
- * `POST <repo>/push-uploads/{upload}/complete`: the upload claimed, its parts joined, and its pack
207
- * streamed from the bucket into the push, which checks the caller's grant again, as any push. It
208
- * answers `git-receive-pack`'s report; then the upload ends, its key deleted and its row `ended`,
209
- * and upkeep at its `removeAt` deletes both.
218
+ * `POST <repo>/push-uploads/{upload}/complete`: an open upload claimed, its parts joined, and
219
+ * handed to `git.push-upload`'s steps, which check the caller's grant again each try; then the
220
+ * same complete sent again answers 202 while they receive it, asking the client to wait
221
+ * `retryAfter` seconds, and once the upload ended, the report its push answered, as
222
+ * `git-receive-pack` does. Upkeep at its `removeAt` deletes the upload, and its answer with it.
210
223
  */
211
- const complete = /* @__PURE__ */ Effect.fnUntraced(function* (staging, parts, call, upload) {
224
+ const complete = /* @__PURE__ */ Effect.fnUntraced(function* (staging, call, upload, retryAfter) {
212
225
  const finish = yield* bodyOf(call.request, FinishPushUpload);
213
226
  const repo = yield* openFor(call.caller, call.repo, true);
214
227
  const actor = yield* actorOf(call.caller);
215
- const receiving = yield* parts.receive(call.caller, call.repo);
216
- const row = yield* claim(repo.internalId, upload, actor, finish.parts, staging.uploads.maxParts);
217
- const pushed = yield* pushStaged(staging, receiving.push, call.request, row, finish.parts).pipe(Effect.map(Result.mapError(afterWrites)), Effect.mapError(afterWrites), Effect.ensuring(ending(staging, repo.internalId, upload, row)));
218
- yield* thrownLog(call.repo, pushed);
219
- return gitAnswer(resultType("git-receive-pack"), yield* reportOf(startOf(row), pushed));
228
+ const first = yield* uploadOf(repo.internalId, upload, actor);
229
+ const receiving = (step) => jsonAnswer(PushUploadReceiving, { step }, 202, { "retry-after": String(retryAfter) });
230
+ const handed = first.row.state === "open" ? yield* handOff(staging, repo.internalId, upload, call.caller, finish.parts) : void 0;
231
+ if (handed?.kind === "handed") return receiving(0);
232
+ const refused = handed?.kind === "refused" ? Result.fail(handed.error) : void 0;
233
+ if (refused !== void 0) yield* thrownLog(call.repo, refused);
234
+ const read = first.row.state === "open" ? yield* uploadOf(repo.internalId, upload, actor) : first;
235
+ const at = yield* Clock$1.currentTimeMillis;
236
+ const lapsed = read.row.state === "completing" && at >= (read.row.claimedAt ?? 0) + completingMost;
237
+ if (lapsed) {
238
+ const failed = {
239
+ kind: "failed",
240
+ error: keptError(claimLapsed)
241
+ };
242
+ yield* ending(staging, repo.internalId, upload, read.row, failed);
243
+ }
244
+ const { row, steps, answer } = lapsed ? yield* uploadOf(repo.internalId, upload, actor) : read;
245
+ if (row.state === "ended" && answer !== void 0) return yield* report(row, pushedOf(answer));
246
+ if (refused !== void 0) return yield* report(first.row, refused);
247
+ if (row.state === "completing" || row.state === "receiving") return receiving(steps?.step ?? 0);
248
+ return yield* ended(upload);
249
+ });
250
+ /** `pushed` as receive-pack's report on the start `row` names. */
251
+ const report = (row, pushed) => Effect.map(reportOf(startOf(row), pushed), (body) => gitAnswer(resultType("git-receive-pack"), body));
252
+ /** The upload's rows, when it's `actor`'s: its own, its steps' and its answer. */
253
+ const uploadOf = /* @__PURE__ */ Effect.fnUntraced(function* (repo, upload, actor) {
254
+ const { row, steps, answer } = yield* rowsOf(repo, upload);
255
+ if (row === void 0 || row.actor !== actor) return yield* ended(upload);
256
+ return {
257
+ row,
258
+ steps,
259
+ answer
260
+ };
220
261
  });
221
262
  /** The upload's parts as the bucket lists them, each the length signed and the one named. */
222
263
  const checkedParts = (row, size, named, listed) => {
@@ -234,11 +275,12 @@ const checkedParts = (row, size, named, listed) => {
234
275
  etag
235
276
  })));
236
277
  };
278
+ const notAPack = () => gitError("INVALID_ARGUMENT", "the push's pack is missing or isn't a pack");
237
279
  /**
238
- * The parts checked and joined, then the pack they make pushed, or why it can't be. The join names
239
- * the ETags the bucket listed, so a part sent again after the check makes the bucket refuse it.
280
+ * The upload's parts checked and joined, or why they can't be. The join names the ETags the bucket
281
+ * listed, so a part sent again after the check makes the bucket refuse it.
240
282
  */
241
- const pushStaged = /* @__PURE__ */ Effect.fnUntraced(function* ({ bucket, uploads }, push, request, row, named) {
283
+ const joinedParts = /* @__PURE__ */ Effect.fnUntraced(function* ({ uploads }, row, named) {
242
284
  const listed = yield* Effect.result(bucketCall(uploads.listParts(row.key, row.uploadId)));
243
285
  const size = partSizeOf(row.bytes, uploads.maxParts);
244
286
  const parts = Result.flatMap(listed, (listing) => checkedParts(row, size, named, listing));
@@ -247,52 +289,68 @@ const pushStaged = /* @__PURE__ */ Effect.fnUntraced(function* ({ bucket, upload
247
289
  uploadId: row.uploadId,
248
290
  parts: parts.success
249
291
  })));
250
- if (Result.isFailure(stored)) return Result.fail(stored.failure);
251
- const objects = yield* objectsOf(bucket, row.key);
252
- const bytes = objects === void 0 ? void 0 : yield* bucketStream(bucket, row.key);
253
- if (objects === void 0 || bytes === void 0) return Result.fail(gitError("INVALID_ARGUMENT", "the push's pack is missing or isn't a pack"));
254
- const input = {
255
- request,
256
- edits: row.updates,
257
- atomic: row.atomic,
258
- pushOptions: row.pushOptions,
259
- pack: {
260
- bytes,
261
- objects,
262
- length: row.bytes
263
- },
264
- signal: request.signal
292
+ return Result.map(stored, () => void 0);
293
+ });
294
+ /**
295
+ * An upload `actor` claims, its parts joined, handed to `git.push-upload`'s steps as `caller`:
296
+ * what complete does with an open upload, `handed` once the job is saved, or `undefined` when
297
+ * another complete claimed it first. An upload whose parts or pack are refused after the claim,
298
+ * or whose claim lapsed, ends with the refusal as its answer, unless another complete ended it
299
+ * first, and complete reports the answer that's stored.
300
+ */
301
+ const handOff = /* @__PURE__ */ Effect.fnUntraced(function* (staging, internalId, upload, caller, named) {
302
+ const actor = yield* actorOf(caller);
303
+ const row = yield* claim(internalId, upload, actor, named, staging.uploads.maxParts);
304
+ if (row === void 0) return void 0;
305
+ const started = Effect.gen(function* () {
306
+ const joined = yield* joinedParts(staging, row, named);
307
+ if (Result.isFailure(joined)) return joined;
308
+ const objects = yield* objectsOf(staging.bucket, row.key);
309
+ if (objects === void 0) return Result.fail(notAPack());
310
+ return yield* startSteps(internalId, upload, actor, caller, objects, row.claimedAt);
311
+ });
312
+ const failed = (error) => ending(staging, internalId, upload, row, {
313
+ kind: "failed",
314
+ error: keptError(error)
315
+ });
316
+ const begun = yield* started.pipe(Effect.mapError(afterWrites), Effect.tapError(failed), Effect.map(Result.mapError(afterWrites)));
317
+ if (Result.isSuccess(begun)) return { kind: "handed" };
318
+ yield* failed(begun.failure);
319
+ return {
320
+ kind: "refused",
321
+ error: begun.failure
265
322
  };
266
- if (row.shallow.length > 0) input.shallow = row.shallow;
267
- return yield* Effect.result(push(input));
268
323
  });
269
324
  /**
270
- * The upload ended: its parts aborted and its key deleted, then its row marked `ended`. Upkeep at
271
- * its `removeAt` deletes the key again, and the row, so a PUT that lands while a link lives goes too.
272
- * A row upkeep already deleted, under a complete stalled past `removeAt`, stays deleted. An end
273
- * refused, as past a spent count, is logged at warning, and upkeep ends it instead.
325
+ * The upload ended, with `answer` when given, while its row is as `row` holds it, the same state
326
+ * and the same claim: its row marked `ended`, its answer beside it, at the version it was read,
327
+ * then, only once that lands, its parts aborted and its key deleted. An end that loses to a
328
+ * hand-off frees nothing, so the job the hand-off saved still finds its pack. Upkeep at its
329
+ * `removeAt` deletes the key again, and the row, so a PUT that lands while a link lives goes too.
330
+ * A row upkeep already deleted, or one a hand-off moved on, is left as it is. An end refused, as
331
+ * past a spent count, is logged at warning, and upkeep ends it instead.
274
332
  */
275
- const ending = /* @__PURE__ */ Effect.fnUntraced(function* (staging, repo, upload, row) {
276
- yield* endUpload(staging.bucket, staging.uploads, row);
333
+ const ending = /* @__PURE__ */ Effect.fnUntraced(function* (staging, repo, upload, row, answer) {
277
334
  const { store } = yield* CoreParts;
278
- const snapshot = yield* storeCall(() => store.read(repoScope(repo), [pushUploadRead(upload)]));
279
- if ((snapshot.results[0] ?? []).length === 0) return;
280
- yield* storeCall(() => store.commit(repoScope(repo), {
335
+ const now = yield* rowsOf(repo, upload);
336
+ if (!(now.row?.state === row.state && now.row.claimedAt === row.claimedAt)) return;
337
+ if (!(yield* storeCall(() => store.commit(repoScope(repo), {
281
338
  id: newChangeId(),
282
- expect: snapshot.version,
339
+ expect: now.version,
283
340
  put: [{
284
341
  ...pushUploadRowKey(upload),
285
342
  value: {
286
343
  ...row,
287
344
  state: "ended"
288
345
  }
289
- }]
290
- }));
291
- }, (ended, _staging, repo, upload, row) => bestEffort(ended, (error) => Effect.logWarning("An upload's end was refused: upkeep ends it at its removeAt").pipe(Effect.annotateLogs({
346
+ }, ...answer === void 0 ? [] : [answerRow(upload, answer)]]
347
+ }))).ok) return;
348
+ yield* endUpload(staging.bucket, staging.uploads, row);
349
+ }, (ended, _staging, repo, upload, row, _answer) => bestEffort(ended, (error) => Effect.logWarning("An upload's end was refused: upkeep ends it at its removeAt").pipe(Effect.annotateLogs({
292
350
  repo,
293
351
  upload,
294
352
  key: row.key,
295
353
  code: error.code,
296
354
  reason: error.message
297
355
  }))));
298
- export { pushUploads };
356
+ export { handOff, pushUploads };
@@ -69,19 +69,20 @@ const wentAwayMidAnswer = (request) => request.method === "HEAD" ? Effect.void :
69
69
  }));
70
70
  /**
71
71
  * A listing's body (Q884): `lines.start`, then each page `next` answers as the client reads it,
72
- * then `lines.end`, so it holds one page at a time. Its pages' reads count on the request's one
72
+ * then `lines.end` with the roots `roots` answers once the last page is read, so it holds one page
73
+ * at a time. Its pages' reads count on the request's one
73
74
  * count (#709). Once its status has gone, a failure can't be one: a page that fails, a tag row
74
75
  * with no stored peel, a store's refusal or a spent count among them, ends the body with an `ERR`
75
76
  * in its words, which Git prints as `remote error:`, or, before any page, `refused`'s bytes. A
76
77
  * page asked past `deadline`, as a client that stalls asks it, ends the body so too, unread. A
77
78
  * client that cancels the body logs `wentAwayMidAnswer` of `request`.
78
79
  */
79
- const listingBody = (lines, next, refused, deadline, request) => Effect.suspend(() => {
80
+ const listingBody = (lines, next, roots, refused, deadline, request) => Effect.suspend(() => {
80
81
  let begun = false;
81
82
  const chunk = Effect.gen(function* () {
82
83
  const refs = yield* next;
83
84
  const start = begun ? /* @__PURE__ */ new Uint8Array() : yield* lines.start;
84
- const body = refs === void 0 ? yield* lines.end : yield* lines.page(refs);
85
+ const body = refs === void 0 ? yield* lines.end(roots === void 0 ? [] : yield* roots) : yield* lines.page(refs);
85
86
  return {
86
87
  bytes: joinedBytes([start, body]),
87
88
  done: refs === void 0
@@ -111,7 +112,7 @@ const uploadPackRefs = (parts, caller, repo, request, started, missing) => {
111
112
  if (v2) return gitAnswer(advertisementType(service), yield* encodeV2Capabilities(v2Capabilities(parts.agent)));
112
113
  const listed = yield* open.lists;
113
114
  const capabilities = uploadPackCapabilities(servedHead(listed), parts.agent);
114
- const body = yield* listingBody(advertisementPages(service, listed, capabilities, listed.hidden), listed.next, (message) => encodeRefusedAdvertisement(service, message), deadline, request);
115
+ const body = yield* listingBody(advertisementPages(service, listed, capabilities, listed.hidden), listed.next, listed.roots, (message) => encodeRefusedAdvertisement(service, message), deadline, request);
115
116
  return gitAnswer(advertisementType(service), body);
116
117
  }).pipe(Effect.catchTag("WireEncodeError", (error) => Effect.fail(unwritable(error))), Effect.catch(missing));
117
118
  return countedRequest(parts, Effect.fail)(answered);
@@ -169,7 +170,7 @@ const uploadPack = (parts, caller, repo, request, started) => {
169
170
  if (command.command === "ls-refs") {
170
171
  const asked = yield* readLsRefs(command);
171
172
  const listed = yield* open.lists;
172
- const pages = yield* listingBody(lsRefsPages(listed, asked, listed.hidden), listed.next, encodeErr, deadline, request);
173
+ const pages = yield* listingBody(lsRefsPages(listed, asked, listed.hidden), listed.next, void 0, encodeErr, deadline, request);
173
174
  return gitAnswer(resultType(service), pages);
174
175
  }
175
176
  const served = yield* open.serve;
@@ -213,7 +214,7 @@ const answerRound = /* @__PURE__ */ Effect.fnUntraced(function* (served, asked,
213
214
  const fetched = yield* Effect.result(served.fetch(request, AbortSignal.any([http.signal, stop.signal]))).pipe(Effect.onInterrupt(() => Effect.sync(() => stop.abort())));
214
215
  if (Result.isFailure(fetched)) return yield* errAnswer(refusalOf(request, fetched.failure));
215
216
  const answer = fetched.success;
216
- const shallowLines = version === "v2" ? deepens || request.shallows.length > 0 ? encodeShallowInfo(answer) : Effect.succeed(/* @__PURE__ */ new Uint8Array()) : deepens ? encodeV0Shallow(answer) : Effect.succeed(/* @__PURE__ */ new Uint8Array());
217
+ const shallowLines = version === "v2" ? deepens || request.shallows.length > 0 || answer.shallow.length > 0 ? encodeShallowInfo(answer) : Effect.succeed(/* @__PURE__ */ new Uint8Array()) : deepens ? encodeV0Shallow(answer) : Effect.succeed(/* @__PURE__ */ new Uint8Array());
217
218
  const shallow = yield* Effect.mapError(shallowLines, unwritable);
218
219
  const acks = version === "v2" ? Effect.succeed(packfileLine) : round.wantsOnly ? Effect.succeed(/* @__PURE__ */ new Uint8Array()) : Effect.mapError(encodeV0Acks(round, held), unwritable);
219
220
  const before = joinedBytes([shallow, yield* acks]);
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Actor, ActorId, ActorInput, AnonymousActor, AuthInput, AuthorizeAnswer, AuthorizeInput, CallInput, Caller, CallerGrant, Credentials, CredentialsBasic, CredentialsBearer, GitAuth, GitAuthorize, NamedActor, RepoAccess, WriteInput } from "./contracts/actors.mjs";
1
+ import { Actor, ActorId, ActorInput, AnonymousActor, AuthInput, AuthorizeAnswer, AuthorizeInput, CallInput, Caller, CallerGrant, Credentials, CredentialsBasic, CredentialsBearer, NamedActor, RepoAccess, WriteInput } from "./contracts/actors.mjs";
2
2
  import { AccessOption, HiddenSpan, RefAudience, RefView } from "./contracts/access.mjs";
3
3
  import { Acting, Blob, BlobCalls, BlobCreateInput, CreatedObject, ObjectInput, blobs_d_exports } from "./contracts/blobs.mjs";
4
4
  import { ClientAdapter, ClientFetchInput, ClientFetchResult, ClientPushInput, GitClientCalls, GitClientOptions, Localize, PagedInput, RefForced, RemoteRefsInput } from "./contracts/client.mjs";
@@ -7,7 +7,7 @@ import "./rest/client-namespace.mjs";
7
7
  import { RestClientCalls, RestTokenCalls, client_d_exports as client_d_exports$1 } from "./rest/client.mjs";
8
8
  import { ListenInput, RestEvents } from "./rest/listen.mjs";
9
9
  import { Me } from "./rest/me.mjs";
10
- import { CreatedToken, GrantScope, PrefixTarget, TokenCalls, TokenCoverage, TokenCreateInput, TokenFields, TokenId, TokenInfo, TokenListInput, TokenRecord, TokenScope, TokenState, TokenTarget, TokensFeature, TrustedWriteInput, VerifiedToken, grantScopes, tokenScopes, tokenStates } from "./contracts/tokens.mjs";
10
+ import { CreatedToken, GrantScope, PrefixTarget, TokenCalls, TokenCoverage, TokenCreateInput, TokenFields, TokenId, TokenInfo, TokenListInput, TokenRecord, TokenScope, TokenState, TokenTarget, TrustedWriteInput, VerifiedToken, grantScopes, tokenScopes, tokenStates } from "./contracts/tokens.mjs";
11
11
  import "./contracts/namespaces.mjs";
12
12
  import "./server/namespaces.mjs";
13
13
  import "./core/namespaces.mjs";
@@ -19,58 +19,57 @@ import "./merges/namespace.mjs";
19
19
  import { authorize_d_exports } from "./contracts/authorize.mjs";
20
20
  import "./queue/namespace.mjs";
21
21
  import "./lfs/namespace.mjs";
22
- import { QueueInternals, mergeQueue } from "./queue/host.mjs";
22
+ import "./store/cursor-seal-namespace.mjs";
23
+ import { QueueInternals } from "./queue/host.mjs";
23
24
  import { CommitCalls, CommitCreateInput, CommitDiffInput, Compare, CompareInput, ComparisonFile, LineCounts, LogInput, RefPublication, Revision, commits_d_exports, logEmailsMost } from "./contracts/commits.mjs";
24
25
  import { Commit, DiffListing, MergeBaseInput, MergeBases, MergeLabels, MergeTree, ObjectWrite, ObjectWrites, PathObject, ReadOptions, ReadPage, RenamesSkipped, Signature, Tag, TagFields, TreeChange, TreeChanges, TreeDiffInput, TreeMergeInput, WalkInput } from "./contracts/engine.mjs";
25
26
  import { BeforeAfter, CandidateClosed, CandidateClosedFields, CandidateOpened, CandidateReported, EntryAdded, EntryFailed, EntryMerged, EntryRemoved, EntryRetried, EventEnvelope, EventFeature, FeedItem, FenceReason, FencedPack, GitEvent, HoldEvent, HoldEventFields, IndexRefusal, QueueEvent, QueueRestarted, RefPush, RefUpdated, RepoCreated, RepoDeletedEvent, RepoEnvelope, RepoEvent, RepoIndexRefused, RepoJobFailed, RepoMaintained, RepoPruneRefused, RepoRenamed, RepoVisibilityChanged, RepoWorkFailed, TokenEvent, TokenEventFields, TopicAdded, TopicEnvelope, TopicEvent, TopicFailed, TopicMerged, TopicOpened, TopicRemoved, TopicReported, TopicWorkFailed, events_d_exports } from "./contracts/events.mjs";
26
27
  import { File, FileCalls, FileDiff, FileReadInput, FilesDiffInput, FilesListInput, FilesRead, files_d_exports } from "./contracts/files.mjs";
27
28
  import { ForkCalls, ForkCreateInput, ForkFetched, ForkGetInput, ForkHolder, ForkListInput, forks_d_exports } from "./contracts/forks.mjs";
28
- import { LfsCalls, LfsFeature, LfsGetInput, LfsObject, LfsOptions } from "./contracts/lfs.mjs";
29
29
  import { repo_records_d_exports } from "./contracts/repo-records.mjs";
30
+ import { LfsCalls, LfsGetInput, LfsObject, LfsOptions } from "./contracts/lfs.mjs";
30
31
  import { MergeAnswer, MergeCalls, MergeCreateInput } from "./contracts/merges.mjs";
31
32
  import { HandlerOptions, SavedHandlerOptions } from "./contracts/handlers.mjs";
32
33
  import { Grant, GrantAgainInput, GrantAgainRequest, GrantInput, GrantReachInput, GrantResolver } from "./contracts/grants.mjs";
33
34
  import { GitScope, InternalRepoId, Oid, RefName, RepoName, TopicId, isInternalId, maxActorIdLength, maxRefNameLength } from "./contracts/ids.mjs";
34
35
  import { Allotment, CopyRow, CopyRowsInput, CopyRowsPage, EffectiveLimits, FetchAnswer, GitObject, GitObjects, HoldingsInput, HoldingsWalked, IndexCalls, IndexReachInput, IndexReached, IndexStatus, IndexTip, IndexTry, IndexTryInput, LinkedObjects, MaintainInput, ObjectHeader, ObjectHeadersInput, ObjectReadInput, ObjectReadResult, ObjectReader, ObjectReaderInput, ObjectSizesInput, ObjectsChange, ObjectsFactory, ObjectsFetchInput, ObjectsOpenInput, ObjectsRead, ObjectsReadInput, ObjectsStarting, ObjectsStartingInput, ObjectsStep, PushedCommit, PushedCommitsInput, Quarantine, ReadObject, ReadObjects, ReceiveInput, RowsMoved, ShareInput, StageInput, Staged, StepAnswer, StepInput, WholeObject } from "./contracts/objects.mjs";
35
- import { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, OperationKind, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TopicOperation, WorkOperation } from "./contracts/operations.mjs";
36
36
  import { client_d_exports } from "./client/client.mjs";
37
- import { AddResult, Added, BatchOptions, Bisect, Candidate, CandidateCloseReason, CandidateId, CandidateReportInput, CandidateResult, CandidateState, CandidatesResult, Entry, EntryFailureReason, EntryFields, EntryGroups, EntryHoldInput, EntryHoldsInput, EntryId, EntryResult, EntryState, Held, Hold, HoldFields, HoldId, HoldResult, HoldsResult, JoinInput, Judged, LanesInput, MergeInput, MergeMethod, MergePlan, MergeQueueCalls, MergeQueueLayerOptions, MergeQueueOptions, MetaValue, PreviousQueueSchedule, QueueAddInput, QueueFailureCounts, QueueKeys, QueueListInput, QueueListResult, QueueMeta, QueueOf, QueueRecent, QueueTargetInput, QueueView, ReleaseResult, Released, RemoveResult, Removed, Report, ReportDetails, ReportOptions, ReportResult, Reported, RestartResult, Restarted, Retried, RetryResult, ScheduleOption, TargetHoldInput } from "./contracts/queue.mjs";
37
+ import { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, OperationKind, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TopicOperation, WorkOperation } from "./contracts/operations.mjs";
38
38
  import { RepoStreamEvent } from "./rest/wire.mjs";
39
- import { Ref, RefCalls, RefCount, RefCountInput, RefEdit, RefInput, RefListInput, RefProtection, RefSource, RefUpdate, RefUpdateKind, RefsUpdateInput, RefsUpdated, maxSeenRefs, refs_d_exports } from "./contracts/refs.mjs";
39
+ import { AddResult, Added, BatchOptions, Bisect, Candidate, CandidateCloseReason, CandidateId, CandidateReportInput, CandidateResult, CandidateState, CandidatesResult, Entry, EntryFailureReason, EntryFields, EntryGroups, EntryHoldInput, EntryHoldsInput, EntryId, EntryResult, EntryState, Held, Hold, HoldFields, HoldId, HoldResult, HoldsResult, JoinInput, Judged, LanesInput, MergeInput, MergeMethod, MergePlan, MergeQueueCalls, MergeQueueLayerOptions, MergeQueueOptions, MetaValue, PreviousQueueSchedule, QueueAddInput, QueueFailureCounts, QueueKeys, QueueListInput, QueueListResult, QueueMeta, QueueOf, QueueRecent, QueueTargetInput, QueueView, ReleaseResult, Released, RemoveResult, Removed, Report, ReportDetails, ReportOptions, ReportResult, Reported, RestartResult, Restarted, Retried, RetryResult, ScheduleOption, TargetHoldInput } from "./contracts/queue.mjs";
40
+ import { Ref, RefCalls, RefCount, RefCountInput, RefEdit, RefGetInput, RefInput, RefListInput, RefProtection, RefSource, RefUpdate, RefUpdateKind, RefsUpdateInput, RefsUpdated, maxSeenRefs, refs_d_exports } from "./contracts/refs.mjs";
40
41
  import { BasicCredential, BearerCredential, ClientCredential, ClientCredentials, CredentialInput, RemoteCalls, RemoteOptions, TransportFailure, TransportRetry, WithoutActor, WithoutSignal } from "./contracts/remote.mjs";
41
- import { PinnedRepo, RepoCalls, RepoCatalogueEntry, RepoCreateInput, RepoDeleted, RepoGetInput, RepoIndexHold, RepoInfo, RepoInfoStats, RepoInput, RepoListInput, RepoListOrder, RepoRecord, RepoRenameInput, RepoStats, RepoUpdateInput, RepoWork, repos_d_exports } from "./contracts/repos.mjs";
42
+ import { PinnedRepo, RenamedRepo, RepoCalls, RepoCatalogueEntry, RepoCreateInput, RepoDeleted, RepoGetInput, RepoIndexHold, RepoInfo, RepoInfoStats, RepoInput, RepoListInput, RepoListOrder, RepoRecord, RepoRenameInput, RepoStats, RepoUpdateInput, RepoWork, repos_d_exports } from "./contracts/repos.mjs";
42
43
  import { PeelInput, Peeled, TagCalls, TagCreateInput, peelMost, peelTagsMost, tags_d_exports } from "./contracts/tags.mjs";
43
- import { Prepare, PrepareInput, Topic, TopicAddInput, TopicCalls, TopicCandidate, TopicEntry, TopicEntryInput, TopicFailure, TopicFailureReason, TopicListInput, TopicMergedEntry, TopicReportInput, TopicReportOptions, TopicReportQuestion, TopicState, TopicTarget, TopicWait, TopicsFactory } from "./contracts/topics.mjs";
44
44
  import { policy_d_exports } from "./auth/policy.mjs";
45
- import { TreeCalls, TreeCreateInput, TreeEdit, TreeEntry, TreeInput, trees_d_exports } from "./contracts/trees.mjs";
45
+ import { Prepare, PrepareInput, Topic, TopicAddInput, TopicCalls, TopicCandidate, TopicEntry, TopicEntryInput, TopicFailure, TopicFailureReason, TopicListInput, TopicMergedEntry, TopicReportInput, TopicReportOptions, TopicReportQuestion, TopicState, TopicTarget, TopicWait } from "./contracts/topics.mjs";
46
46
  import { event_streams_d_exports } from "./event-streams/event-streams.mjs";
47
+ import { TreeCalls, TreeCreateInput, TreeEdit, TreeEntry, TreeInput, trees_d_exports } from "./contracts/trees.mjs";
47
48
  import { BlobLimit, BlobNone, Bytes, FetchRequest, Filter, LfsPointers, ObjectType, ReadLimits, TreeFilter, allotmentWithin, objectsReadMost } from "./contracts/object-values.mjs";
48
- import { Accepted, Awaitable, ContextValue, DataLossContext, DataLossReason, DecisionAnswer, ErrorContext, ExistingContext, ExistingReason, FailureResult, GitError, GitErrorBody, GitErrorCode, GitErrorContexts, GitErrorFields, GitErrorInput, GitErrorTagged, HostErrorContext, HostFunctionName, InvalidInputContext, InvalidInputReason, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, PreconditionContext, PreconditionReason, RefusalReason, RejectInput, Rejected, ResourceContext, ResourceReason, Result, Success, UnavailableContext, UnavailableReason, Verdict, accept, gitError, httpStatus, isGitError, isRefusalReason, reject } from "./contracts/result.mjs";
49
+ import { Accepted, Awaitable, ContextValue, DataLossContext, DataLossReason, DecisionAnswer, ErrorContext, ExistingContext, ExistingReason, FailureResult, GitError, GitErrorBody, GitErrorCode, GitErrorContexts, GitErrorFields, GitErrorInput, GitErrorTagged, HostErrorContext, HostFunctionName, InvalidInputContext, InvalidInputReason, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, PreconditionContext, PreconditionReason, RefusalReason, RejectInput, Rejected, ResourceContext, ResourceReason, Result, Success, UnavailableContext, UnavailableReason, Verdict, gitError, httpStatus, isGitError, isRefusalReason } from "./contracts/result.mjs";
50
+ import { git_namespace_d_exports } from "./server/git-namespace.mjs";
49
51
  import { SliceRefusal } from "./client/slice-push.mjs";
50
52
  import { gitPathOf } from "./http/paths.mjs";
51
- import { git_namespace_d_exports } from "./server/git-namespace.mjs";
52
- import { createGitServer } from "./server/server.mjs";
53
- import { lfs } from "./lfs/service.mjs";
54
53
  import { branchRef, shortTarget } from "./queue/ids.mjs";
55
- import { topics } from "./topics/host.mjs";
56
54
  import { lfsPointerOid, maxLfsPointerBytes } from "./protocol/objects/lfs-pointer.mjs";
57
55
  import { LfsPointersBuilder, lfsPointers } from "./storage/lfs-pointers.mjs";
56
+ import { loose, looseLimits } from "./storage/loose.mjs";
58
57
  import { objects_namespace_d_exports } from "./core/objects/objects-namespace.mjs";
59
58
  import { saved_callers_public_d_exports } from "./core/saved-callers-public.mjs";
60
- import { loose, looseLimits } from "./storage/loose.mjs";
61
- import { auth_namespace_d_exports } from "./auth/auth-namespace.mjs";
62
59
  import { PacksOptions, UnpackOptions, packs } from "./storage/packs.mjs";
60
+ import { auth_namespace_d_exports } from "./auth/auth-namespace.mjs";
63
61
  import { PacksMemory, packsMemory } from "./storage/packs-memory.mjs";
64
- import { layer_d_exports } from "./rest/layer.mjs";
65
62
  import { Option, RepackOptions } from "./storage/repack.mjs";
66
- import { public_d_exports as public_d_exports$3 } from "./merges/public.mjs";
63
+ import { layer_d_exports } from "./rest/layer.mjs";
67
64
  import "./core/rules/namespace.mjs";
68
- import { public_d_exports as public_d_exports$2 } from "./queue/public.mjs";
65
+ import { public_d_exports as public_d_exports$3 } from "./merges/public.mjs";
69
66
  import { FetchAdjustment, FetchReadInput, FetchReadTarget, FetchRule, FetchRuleInput, FileRuleOptions, ProtectOptions, PushContext, PushFacts, PushRule, PushRuleInput, RefPatterns, RuleOperation } from "./contracts/rules.mjs";
67
+ import { public_d_exports as public_d_exports$2 } from "./queue/public.mjs";
68
+ import { BeginPushUpload, FinishPushUpload, PushFileOptions, PushOptions, PushRepoOptions, PushUploadOptions, PushUploadPart, PushUploadReceiving, PushUploadStarted } from "./contracts/push-uploads.mjs";
70
69
  import { public_d_exports as public_d_exports$1 } from "./lfs/public.mjs";
71
- import { BeginPushUpload, FinishPushUpload, PushOptions, PushUploadOptions, PushUploadPart, PushUploadStarted } from "./contracts/push-uploads.mjs";
72
- import { GitAdapter, GitNeeds, GitServer, GitServerOptions, ProvidedBy, ServerCalls, ServerSetup } from "./contracts/server.mjs";
73
- import { ImportState } from "./contracts/sync.mjs";
70
+ import { GitAdapter, GitNeeds, ProvidedBy, ServerCalls } from "./contracts/server.mjs";
71
+ import { cursor_seal_public_d_exports } from "./store/cursor-seal-public.mjs";
72
+ import { ImportLfsMissed, ImportLfsReason, ImportState, ImportStatus } from "./contracts/sync.mjs";
74
73
  import { ApprovalBase, ApprovalDecision, ApprovalPageContext, ApprovalPageInput, ApprovalPrompt, ApprovedGrant, ConfirmApprovalPage, DeniedGrant, DeviceApproval, DeviceCodePage, DeviceCodeRequest, DeviceCodeResponse, DeviceExchange, OAuthClient, OAuthError, OAuthTokenResponse, WebApproval, WebAuthorize, WebExchange } from "./contracts/signin.mjs";
75
74
  import { GitStore, GitStoreAddInput, GitStoreCommitInput, GitStoreReadInput, HeldPack, Holding, Listed, ListedInput, Pack } from "./contracts/store.mjs";
76
75
  import { WorkCalls, WorkItem, WorkListInput, WorkWriteInput, work_d_exports } from "./contracts/work.mjs";
@@ -87,4 +86,4 @@ import { PushHookInput } from "./contracts/git-hooks.mjs";
87
86
  import { public_d_exports as public_d_exports$5 } from "./signin/public.mjs";
88
87
  import "./signin/namespace.mjs";
89
88
  import { jobStates } from "@ref0/infra";
90
- export { type Accepted, type AccessOption, type Acting, type Actor, type ActorId, type ActorInput, type AddResult, type Added, type Allotment, type AnonymousActor, type ApprovalBase, type ApprovalDecision, type ApprovalPageContext, type ApprovalPageInput, type ApprovalPrompt, type ApprovedGrant, auth_namespace_d_exports as Auth, type AuthInput, authorize_d_exports as Authorize, type AuthorizeAnswer, type AuthorizeInput, type Awaitable, type BasicCredential, type BatchOptions, type BearerCredential, type BeforeAfter, BeginPushUpload, type Bisect, type Blob, type BlobCalls, type BlobCreateInput, BlobLimit, BlobNone, blobs_d_exports as Blobs, type BypassOperation, type Bytes, type CallInput, type Caller, type CallerGrant, type Candidate, type CandidateCloseReason, type CandidateClosed, type CandidateClosedFields, type CandidateId, type CandidateOpened, type CandidateReportInput, type CandidateReported, type CandidateResult, type CandidateState, type CandidatesResult, type ClientAdapter, type ClientCredential, type ClientCredentials, type ClientFetchInput, type ClientFetchResult, type ClientPushInput, type Commit, type CommitCalls, type CommitCreateInput, type CommitDiffInput, commits_d_exports as Commits, type Compare, type CompareInput, type ComparisonFile, type ConfirmApprovalPage, ContextValue, type CopyRow, type CopyRowsInput, type CopyRowsPage, type CreatedObject, type CreatedToken, type CredentialInput, type Credentials, type CredentialsBasic, type CredentialsBearer, DataLossContext, DataLossReason, type DecisionAnswer, type DeniedGrant, type DeviceApproval, type DeviceCodePage, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceExchange, type DiffListing, type EffectiveLimits, type Entry, type EntryAdded, type EntryFailed, type EntryFailureReason, type EntryFields, type EntryGroups, type EntryHoldInput, type EntryHoldsInput, type EntryId, type EntryMerged, type EntryRemoved, type EntryResult, type EntryRetried, type EntryState, ErrorContext, type EventEnvelope, type EventFeature, event_streams_d_exports as EventStreams, events_d_exports as Events, ExistingContext, ExistingReason, type FailureResult, type FeedItem, type FenceReason, type FencedPack, type FetchAdjustment, type FetchAnswer, type FetchReadInput, type FetchReadTarget, FetchRequest, type FetchRule, type FetchRuleInput, type File, type FileCalls, type FileDiff, type FileReadInput, type FileRuleOptions, files_d_exports as Files, type FilesAllowOperation, type FilesDiffInput, type FilesListInput, type FilesRead, Filter, FinishPushUpload, type ForkCalls, type ForkCreateInput, type ForkFetched, type ForkGetInput, type ForkHolder, type ForkListInput, type ForkOperation, forks_d_exports as Forks, git_namespace_d_exports as Git, type GitAdapter, type GitAuth, type GitAuthorize, client_d_exports as GitClient, type GitClientCalls, type GitClientOptions, type GitError, GitErrorBody, type GitErrorCode, type GitErrorContexts, type GitErrorFields, type GitErrorInput, type GitErrorTagged, type GitEvent, git_events_d_exports as GitEvents, public_d_exports as GitHooks, type GitNeeds, type GitObject, type GitObjects, type GitScope, type GitServer, type GitServerOptions, type GitStore, type GitStoreAddInput, type GitStoreCommitInput, type GitStoreReadInput, type Grant, type GrantAgainInput, type GrantAgainRequest, type GrantInput, type GrantReachInput, type GrantResolver, type GrantScope, type HandlerOptions, type Held, type HeldPack, type HiddenSpan, type Hold, type HoldEvent, type HoldEventFields, type HoldFields, type HoldId, type HoldResult, type Holding, type HoldingsInput, type HoldingsWalked, type HoldsResult, HostErrorContext, type HostFunctionName, type ImportState, type IndexCalls, type IndexReachInput, type IndexReached, type IndexRefusal, type IndexStatus, type IndexTip, type IndexTry, type IndexTryInput, InternalRepoId, InvalidInputContext, InvalidInputReason, type JoinInput, type Judged, type LanesInput, public_d_exports$1 as Lfs, type LfsCalls, type LfsFeature, type LfsGetInput, type LfsObject, type LfsOptions, type LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type ListenInput, type Localize, type LogInput, type MaintainInput, type Me, type MeOperation, type MergeAnswer, type MergeBaseInput, type MergeBases, type MergeCalls, type MergeCreateInput, type MergeInput, type MergeLabels, type MergeMethod, type MergePlan, public_d_exports$2 as MergeQueue, type MergeQueueCalls, type MergeQueueLayerOptions, type MergeQueueOptions, type MergeTree, public_d_exports$3 as Merges, type MetaValue, MissingContext, MissingReason, type NamedActor, NotAllowedContext, NotAllowedReason, type OAuthClient, type OAuthError, type OAuthTokenResponse, type ObjectHeader, type ObjectHeadersInput, type ObjectInput, type ObjectReadInput, type ObjectReadResult, type ObjectReader, type ObjectReaderInput, type ObjectSizesInput, type ObjectType, type ObjectWrite, type ObjectWrites, objects_namespace_d_exports as Objects, type ObjectsChange, type ObjectsFactory, type ObjectsFetchInput, type ObjectsOpenInput, type ObjectsRead, type ObjectsReadInput, type ObjectsStarting, type ObjectsStartingInput, type ObjectsStep, type Oid, type Operation, type OperationKind, type Option, type Pack, type PacksMemory, type PacksOptions, type PagedInput, type PathObject, type PeelInput, type Peeled, type PinnedRepo, policy_d_exports as Policy, PreconditionContext, PreconditionReason, type PrefixTarget, type Prepare, type PrepareInput, type PreviousQueueSchedule, public_d_exports$4 as PrivateRefs, type ProtectOptions, type ProvidedBy, type PushContext, type PushFacts, type PushHookInput, type PushOperation, type PushOptions, type PushRule, type PushRuleInput, type PushUploadOptions, PushUploadPart, PushUploadStarted, type PushedCommit, type PushedCommitsInput, type Quarantine, type QueueAddInput, type QueueAddOperation, type QueueCandidateOperation, type QueueEntryOperation, type QueueEvent, type QueueFailureCounts, type QueueInternals, type QueueKeys, type QueueListInput, type QueueListResult, type QueueMeta, type QueueOf, type QueueRecent, type QueueReleaseOperation, type QueueRestarted, type QueueTargetInput, type QueueTargetOperation, type QueueView, type ReadLimits, type ReadObject, type ReadObjects, type ReadOptions, type ReadPage, type ReceiveInput, type Ref, type RefAudience, type RefCalls, type RefCount, type RefCountInput, type RefEdit, type RefForced, type RefInput, type RefListInput, type RefName, type RefPatterns, type RefProtection, type RefPublication, type RefPush, type RefSource, type RefUpdate, type RefUpdateKind, type RefUpdated, type RefView, refs_d_exports as Refs, type RefsPrivateOperation, type RefsUpdateInput, type RefsUpdated, type RefusalReason, type RejectInput, type Rejected, type ReleaseResult, type Released, type RemoteCalls, type RemoteOptions, type RemoteRefsInput, type RemoveResult, type Removed, type RenamesSkipped, type RepackOptions, type RepoAccess, type RepoCalls, type RepoCatalogueEntry, type RepoCreateInput, type RepoCreated, type RepoDeleted, type RepoDeletedEvent, type RepoEnvelope, type RepoEvent, type RepoGetInput, type RepoIndexHold, type RepoIndexRefused, type RepoInfo, type RepoInfoStats, type RepoInput, type RepoJobFailed, type RepoListInput, type RepoListOperation, type RepoListOrder, type RepoMaintained, type RepoName, type RepoOperation, type RepoPruneRefused, type RepoRecord, repo_records_d_exports as RepoRecords, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoStreamEvent, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, repos_d_exports as Repos, ResourceContext, ResourceReason, layer_d_exports as Rest, client_d_exports$1 as RestClient, type RestClientCalls, type RestEvents, type RestTokenCalls, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, type RowsMoved, type RuleOperation, rules_d_exports as Rules, saved_callers_public_d_exports as SavedCallers, type SavedHandlerOptions, type ScheduleOption, type ServerCalls, type ServerSetup, type ShareInput, public_d_exports$5 as SignIn, type Signature, type SliceRefusal, type StageInput, type Staged, type StepAnswer, type StepInput, type Success, type Tag, type TagCalls, type TagCreateInput, type TagFields, tags_d_exports as Tags, type TargetHoldInput, type TokenCalls, type TokenCoverage, type TokenCreateInput, type TokenCreateOperation, type TokenEvent, type TokenEventFields, type TokenFields, type TokenId, type TokenInfo, type TokenListInput, type TokenOperation, type TokenParties, type TokenRecord, type TokenScope, type TokenState, type TokenTarget, tokens_public_d_exports as Tokens, type TokensFeature, type Topic, type TopicAddInput, type TopicAdded, type TopicCalls, type TopicCandidate, type TopicEntry, type TopicEntryInput, type TopicEnvelope, type TopicEvent, type TopicFailed, type TopicFailure, type TopicFailureReason, type TopicId, type TopicListInput, type TopicMerged, type TopicMergedEntry, type TopicOpened, type TopicOperation, type TopicRemoved, type TopicReportInput, type TopicReportOptions, type TopicReportQuestion, type TopicReported, type TopicState, type TopicTarget, type TopicWait, type TopicWorkFailed, public_d_exports$6 as Topics, type TopicsFactory, type TransportFailure, type TransportRetry, type TreeCalls, type TreeChange, type TreeChanges, type TreeCreateInput, type TreeDiffInput, type TreeEdit, type TreeEntry, TreeFilter, type TreeInput, type TreeMergeInput, trees_d_exports as Trees, type TrustedWriteInput, UnavailableContext, UnavailableReason, type UnpackOptions, Verdict, type VerifiedToken, type WalkInput, type WebApproval, type WebAuthorize, type WebExchange, type WholeObject, type WithoutActor, type WithoutSignal, work_d_exports as Work, type WorkCalls, type WorkItem, type WorkListInput, type WorkOperation, type WorkWriteInput, type WriteInput, accept, allotmentWithin, branchRef, createGitServer, gitError, gitPathOf, grantScopes, httpStatus, isGitError, isInternalId, isRefusalReason, jobStates, lfs, lfsPointerOid, lfsPointers, logEmailsMost, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, maxSeenRefs, mergeQueue, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, reject, shortTarget, tokenScopes, tokenStates, topics };
89
+ export { type Accepted, type AccessOption, type Acting, type Actor, type ActorId, type ActorInput, type AddResult, type Added, type Allotment, type AnonymousActor, type ApprovalBase, type ApprovalDecision, type ApprovalPageContext, type ApprovalPageInput, type ApprovalPrompt, type ApprovedGrant, auth_namespace_d_exports as Auth, type AuthInput, authorize_d_exports as Authorize, type AuthorizeAnswer, type AuthorizeInput, type Awaitable, type BasicCredential, type BatchOptions, type BearerCredential, type BeforeAfter, BeginPushUpload, type Bisect, type Blob, type BlobCalls, type BlobCreateInput, BlobLimit, BlobNone, blobs_d_exports as Blobs, type BypassOperation, type Bytes, type CallInput, type Caller, type CallerGrant, type Candidate, type CandidateCloseReason, type CandidateClosed, type CandidateClosedFields, type CandidateId, type CandidateOpened, type CandidateReportInput, type CandidateReported, type CandidateResult, type CandidateState, type CandidatesResult, type ClientAdapter, type ClientCredential, type ClientCredentials, type ClientFetchInput, type ClientFetchResult, type ClientPushInput, type Commit, type CommitCalls, type CommitCreateInput, type CommitDiffInput, commits_d_exports as Commits, type Compare, type CompareInput, type ComparisonFile, type ConfirmApprovalPage, ContextValue, type CopyRow, type CopyRowsInput, type CopyRowsPage, type CreatedObject, type CreatedToken, type CredentialInput, type Credentials, type CredentialsBasic, type CredentialsBearer, cursor_seal_public_d_exports as CursorSeal, DataLossContext, DataLossReason, type DecisionAnswer, type DeniedGrant, type DeviceApproval, type DeviceCodePage, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceExchange, type DiffListing, type EffectiveLimits, type Entry, type EntryAdded, type EntryFailed, type EntryFailureReason, type EntryFields, type EntryGroups, type EntryHoldInput, type EntryHoldsInput, type EntryId, type EntryMerged, type EntryRemoved, type EntryResult, type EntryRetried, type EntryState, ErrorContext, type EventEnvelope, type EventFeature, event_streams_d_exports as EventStreams, events_d_exports as Events, ExistingContext, ExistingReason, type FailureResult, type FeedItem, type FenceReason, type FencedPack, type FetchAdjustment, type FetchAnswer, type FetchReadInput, type FetchReadTarget, FetchRequest, type FetchRule, type FetchRuleInput, type File, type FileCalls, type FileDiff, type FileReadInput, type FileRuleOptions, files_d_exports as Files, type FilesAllowOperation, type FilesDiffInput, type FilesListInput, type FilesRead, Filter, FinishPushUpload, type ForkCalls, type ForkCreateInput, type ForkFetched, type ForkGetInput, type ForkHolder, type ForkListInput, type ForkOperation, forks_d_exports as Forks, git_namespace_d_exports as Git, type GitAdapter, client_d_exports as GitClient, type GitClientCalls, type GitClientOptions, type GitError, GitErrorBody, type GitErrorCode, type GitErrorContexts, type GitErrorFields, type GitErrorInput, type GitErrorTagged, type GitEvent, git_events_d_exports as GitEvents, public_d_exports as GitHooks, type GitNeeds, type GitObject, type GitObjects, type GitScope, type GitStore, type GitStoreAddInput, type GitStoreCommitInput, type GitStoreReadInput, type Grant, type GrantAgainInput, type GrantAgainRequest, type GrantInput, type GrantReachInput, type GrantResolver, type GrantScope, type HandlerOptions, type Held, type HeldPack, type HiddenSpan, type Hold, type HoldEvent, type HoldEventFields, type HoldFields, type HoldId, type HoldResult, type Holding, type HoldingsInput, type HoldingsWalked, type HoldsResult, HostErrorContext, type HostFunctionName, type ImportLfsMissed, type ImportLfsReason, type ImportState, type ImportStatus, type IndexCalls, type IndexReachInput, type IndexReached, type IndexRefusal, type IndexStatus, type IndexTip, type IndexTry, type IndexTryInput, InternalRepoId, InvalidInputContext, InvalidInputReason, type JoinInput, type Judged, type LanesInput, public_d_exports$1 as Lfs, type LfsCalls, type LfsGetInput, type LfsObject, type LfsOptions, type LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type ListenInput, type Localize, type LogInput, type MaintainInput, type Me, type MeOperation, type MergeAnswer, type MergeBaseInput, type MergeBases, type MergeCalls, type MergeCreateInput, type MergeInput, type MergeLabels, type MergeMethod, type MergePlan, public_d_exports$2 as MergeQueue, type MergeQueueCalls, type MergeQueueLayerOptions, type MergeQueueOptions, type MergeTree, public_d_exports$3 as Merges, type MetaValue, MissingContext, MissingReason, type NamedActor, NotAllowedContext, NotAllowedReason, type OAuthClient, type OAuthError, type OAuthTokenResponse, type ObjectHeader, type ObjectHeadersInput, type ObjectInput, type ObjectReadInput, type ObjectReadResult, type ObjectReader, type ObjectReaderInput, type ObjectSizesInput, type ObjectType, type ObjectWrite, type ObjectWrites, objects_namespace_d_exports as Objects, type ObjectsChange, type ObjectsFactory, type ObjectsFetchInput, type ObjectsOpenInput, type ObjectsRead, type ObjectsReadInput, type ObjectsStarting, type ObjectsStartingInput, type ObjectsStep, type Oid, type Operation, type OperationKind, type Option, type Pack, type PacksMemory, type PacksOptions, type PagedInput, type PathObject, type PeelInput, type Peeled, type PinnedRepo, policy_d_exports as Policy, PreconditionContext, PreconditionReason, type PrefixTarget, type Prepare, type PrepareInput, type PreviousQueueSchedule, public_d_exports$4 as PrivateRefs, type ProtectOptions, type ProvidedBy, type PushContext, type PushFacts, type PushFileOptions, type PushHookInput, type PushOperation, type PushOptions, type PushRepoOptions, type PushRule, type PushRuleInput, type PushUploadOptions, PushUploadPart, PushUploadReceiving, PushUploadStarted, type PushedCommit, type PushedCommitsInput, type Quarantine, type QueueAddInput, type QueueAddOperation, type QueueCandidateOperation, type QueueEntryOperation, type QueueEvent, type QueueFailureCounts, type QueueInternals, type QueueKeys, type QueueListInput, type QueueListResult, type QueueMeta, type QueueOf, type QueueRecent, type QueueReleaseOperation, type QueueRestarted, type QueueTargetInput, type QueueTargetOperation, type QueueView, type ReadLimits, type ReadObject, type ReadObjects, type ReadOptions, type ReadPage, type ReceiveInput, type Ref, type RefAudience, type RefCalls, type RefCount, type RefCountInput, type RefEdit, type RefForced, type RefGetInput, type RefInput, type RefListInput, type RefName, type RefPatterns, type RefProtection, type RefPublication, type RefPush, type RefSource, type RefUpdate, type RefUpdateKind, type RefUpdated, type RefView, refs_d_exports as Refs, type RefsPrivateOperation, type RefsUpdateInput, type RefsUpdated, type RefusalReason, type RejectInput, type Rejected, type ReleaseResult, type Released, type RemoteCalls, type RemoteOptions, type RemoteRefsInput, type RemoveResult, type Removed, type RenamedRepo, type RenamesSkipped, type RepackOptions, type RepoAccess, type RepoCalls, type RepoCatalogueEntry, type RepoCreateInput, type RepoCreated, type RepoDeleted, type RepoDeletedEvent, type RepoEnvelope, type RepoEvent, type RepoGetInput, type RepoIndexHold, type RepoIndexRefused, type RepoInfo, type RepoInfoStats, type RepoInput, type RepoJobFailed, type RepoListInput, type RepoListOperation, type RepoListOrder, type RepoMaintained, type RepoName, type RepoOperation, type RepoPruneRefused, type RepoRecord, repo_records_d_exports as RepoRecords, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoStreamEvent, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, repos_d_exports as Repos, ResourceContext, ResourceReason, layer_d_exports as Rest, client_d_exports$1 as RestClient, type RestClientCalls, type RestEvents, type RestTokenCalls, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, type RowsMoved, type RuleOperation, rules_d_exports as Rules, saved_callers_public_d_exports as SavedCallers, type SavedHandlerOptions, type ScheduleOption, type ServerCalls, type ShareInput, public_d_exports$5 as SignIn, type Signature, type SliceRefusal, type StageInput, type Staged, type StepAnswer, type StepInput, type Success, type Tag, type TagCalls, type TagCreateInput, type TagFields, tags_d_exports as Tags, type TargetHoldInput, type TokenCalls, type TokenCoverage, type TokenCreateInput, type TokenCreateOperation, type TokenEvent, type TokenEventFields, type TokenFields, type TokenId, type TokenInfo, type TokenListInput, type TokenOperation, type TokenParties, type TokenRecord, type TokenScope, type TokenState, type TokenTarget, tokens_public_d_exports as Tokens, type Topic, type TopicAddInput, type TopicAdded, type TopicCalls, type TopicCandidate, type TopicEntry, type TopicEntryInput, type TopicEnvelope, type TopicEvent, type TopicFailed, type TopicFailure, type TopicFailureReason, type TopicId, type TopicListInput, type TopicMerged, type TopicMergedEntry, type TopicOpened, type TopicOperation, type TopicRemoved, type TopicReportInput, type TopicReportOptions, type TopicReportQuestion, type TopicReported, type TopicState, type TopicTarget, type TopicWait, type TopicWorkFailed, public_d_exports$6 as Topics, type TransportFailure, type TransportRetry, type TreeCalls, type TreeChange, type TreeChanges, type TreeCreateInput, type TreeDiffInput, type TreeEdit, type TreeEntry, TreeFilter, type TreeInput, type TreeMergeInput, trees_d_exports as Trees, type TrustedWriteInput, UnavailableContext, UnavailableReason, type UnpackOptions, Verdict, type VerifiedToken, type WalkInput, type WebApproval, type WebAuthorize, type WebExchange, type WholeObject, type WithoutActor, type WithoutSignal, work_d_exports as Work, type WorkCalls, type WorkItem, type WorkListInput, type WorkOperation, type WorkWriteInput, type WriteInput, allotmentWithin, branchRef, gitError, gitPathOf, grantScopes, httpStatus, isGitError, isInternalId, isRefusalReason, jobStates, lfsPointerOid, lfsPointers, logEmailsMost, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, maxSeenRefs, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, shortTarget, tokenScopes, tokenStates };
package/dist/index.mjs CHANGED
@@ -24,26 +24,23 @@ import { layer_exports } from "./rest/layer.mjs";
24
24
  import { public_exports as public_exports$3 } from "./merges/public.mjs";
25
25
  import { public_exports as public_exports$2 } from "./queue/public.mjs";
26
26
  import { public_exports as public_exports$1 } from "./lfs/public.mjs";
27
- import { mergeQueue } from "./queue/host.mjs";
27
+ import { cursor_seal_public_exports } from "./store/cursor-seal-public.mjs";
28
28
  import { InternalRepoId, isInternalId, maxActorIdLength, maxRefNameLength } from "./contracts/ids.mjs";
29
29
  import { BlobLimit, BlobNone, FetchRequest, Filter, TreeFilter, allotmentWithin, objectsReadMost } from "./contracts/object-values.mjs";
30
- import { ContextValue, DataLossContext, DataLossReason, ErrorContext, ExistingContext, ExistingReason, GitErrorBody, HostErrorContext, InvalidInputContext, InvalidInputReason, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, PreconditionContext, PreconditionReason, ResourceContext, ResourceReason, UnavailableContext, UnavailableReason, Verdict, accept, gitError, httpStatus, isGitError, isRefusalReason, reject } from "./contracts/result.mjs";
30
+ import { ContextValue, DataLossContext, DataLossReason, ErrorContext, ExistingContext, ExistingReason, GitErrorBody, HostErrorContext, InvalidInputContext, InvalidInputReason, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, PreconditionContext, PreconditionReason, ResourceContext, ResourceReason, UnavailableContext, UnavailableReason, Verdict, gitError, httpStatus, isGitError, isRefusalReason } from "./contracts/result.mjs";
31
31
  import { gitPathOf } from "./http/paths.mjs";
32
- import { createGitServer } from "./server/server.mjs";
33
- import { lfs } from "./lfs/service.mjs";
34
32
  import { branchRef, shortTarget } from "./queue/ids.mjs";
35
- import { topics } from "./topics/host.mjs";
36
33
  import { lfsPointerOid, maxLfsPointerBytes } from "./protocol/objects/lfs-pointer.mjs";
37
34
  import { lfsPointers } from "./storage/lfs-pointers.mjs";
38
35
  import { loose, looseLimits } from "./storage/loose.mjs";
39
36
  import { packs } from "./storage/packs.mjs";
40
37
  import { packsMemory } from "./storage/packs-memory.mjs";
41
38
  import { rules_exports } from "./core/rules/rules.mjs";
42
- import { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadStarted } from "./contracts/push-uploads.mjs";
39
+ import { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadReceiving, PushUploadStarted } from "./contracts/push-uploads.mjs";
43
40
  import { public_exports as public_exports$4 } from "./access/public.mjs";
44
41
  import { public_exports as public_exports$6 } from "./topics/public.mjs";
45
42
  import { tokens_public_exports } from "./auth/tokens-public.mjs";
46
43
  import { public_exports } from "./core/hooks/public.mjs";
47
44
  import { public_exports as public_exports$5 } from "./signin/public.mjs";
48
45
  import { jobStates } from "@ref0/infra";
49
- export { auth_namespace_exports as Auth, authorize_exports as Authorize, BeginPushUpload, BlobLimit, BlobNone, blobs_exports as Blobs, commits_exports as Commits, ContextValue, DataLossContext, DataLossReason, ErrorContext, event_streams_exports as EventStreams, events_exports as Events, ExistingContext, ExistingReason, FetchRequest, files_exports as Files, Filter, FinishPushUpload, forks_exports as Forks, git_namespace_exports as Git, client_exports as GitClient, GitErrorBody, git_events_exports as GitEvents, public_exports as GitHooks, HostErrorContext, InternalRepoId, InvalidInputContext, InvalidInputReason, public_exports$1 as Lfs, public_exports$2 as MergeQueue, public_exports$3 as Merges, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, objects_namespace_exports as Objects, policy_exports as Policy, PreconditionContext, PreconditionReason, public_exports$4 as PrivateRefs, PushUploadPart, PushUploadStarted, refs_exports as Refs, repo_records_exports as RepoRecords, repos_exports as Repos, ResourceContext, ResourceReason, layer_exports as Rest, client_exports$1 as RestClient, rules_exports as Rules, saved_callers_public_exports as SavedCallers, public_exports$5 as SignIn, tags_exports as Tags, tokens_public_exports as Tokens, public_exports$6 as Topics, TreeFilter, trees_exports as Trees, UnavailableContext, UnavailableReason, Verdict, work_exports as Work, accept, allotmentWithin, branchRef, createGitServer, gitError, gitPathOf, grantScopes, httpStatus, isGitError, isInternalId, isRefusalReason, jobStates, lfs, lfsPointerOid, lfsPointers, logEmailsMost, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, maxSeenRefs, mergeQueue, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, reject, shortTarget, tokenScopes, tokenStates, topics };
46
+ export { auth_namespace_exports as Auth, authorize_exports as Authorize, BeginPushUpload, BlobLimit, BlobNone, blobs_exports as Blobs, commits_exports as Commits, ContextValue, cursor_seal_public_exports as CursorSeal, DataLossContext, DataLossReason, ErrorContext, event_streams_exports as EventStreams, events_exports as Events, ExistingContext, ExistingReason, FetchRequest, files_exports as Files, Filter, FinishPushUpload, forks_exports as Forks, git_namespace_exports as Git, client_exports as GitClient, GitErrorBody, git_events_exports as GitEvents, public_exports as GitHooks, HostErrorContext, InternalRepoId, InvalidInputContext, InvalidInputReason, public_exports$1 as Lfs, public_exports$2 as MergeQueue, public_exports$3 as Merges, MissingContext, MissingReason, NotAllowedContext, NotAllowedReason, objects_namespace_exports as Objects, policy_exports as Policy, PreconditionContext, PreconditionReason, public_exports$4 as PrivateRefs, PushUploadPart, PushUploadReceiving, PushUploadStarted, refs_exports as Refs, repo_records_exports as RepoRecords, repos_exports as Repos, ResourceContext, ResourceReason, layer_exports as Rest, client_exports$1 as RestClient, rules_exports as Rules, saved_callers_public_exports as SavedCallers, public_exports$5 as SignIn, tags_exports as Tags, tokens_public_exports as Tokens, public_exports$6 as Topics, TreeFilter, trees_exports as Trees, UnavailableContext, UnavailableReason, Verdict, work_exports as Work, allotmentWithin, branchRef, gitError, gitPathOf, grantScopes, httpStatus, isGitError, isInternalId, isRefusalReason, jobStates, lfsPointerOid, lfsPointers, logEmailsMost, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, maxSeenRefs, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, shortTarget, tokenScopes, tokenStates };
@@ -3,6 +3,7 @@ import { GitError } from "../contracts/result.mjs";
3
3
  import { RegisteredCheck } from "../core/rules/context.mjs";
4
4
  import { Bucket as Bucket$1, Links } from "../contracts/objects.mjs";
5
5
  import { CoreNeeds } from "../core/parts.mjs";
6
+ import { LfsCopy } from "./copy.mjs";
6
7
  import { ObjectRead } from "./objects.mjs";
7
8
  import { LfsService } from "./service.mjs";
8
9
  import * as Effect from "effect/Effect";
@@ -11,13 +12,14 @@ import * as Context from "effect/Context";
11
12
  /** A listed object's bytes, as `objectOf` reads them over LFS's parts. */
12
13
  export type LfsRead = (read: ObjectRead) => Effect.Effect<LfsObject, GitError, CoreNeeds>;
13
14
  /**
14
- * What LFS attaches to the server: its routes, which Git's handler serves, its push check, and its
15
- * object reads, which `git.lfs.get` calls.
15
+ * What LFS attaches to the server: its routes, which Git's handler serves, its push check, its
16
+ * object reads, which `git.lfs.get` calls, and the copy import lists a source's objects through.
16
17
  */
17
18
  export interface LfsAttached {
18
19
  readonly service: LfsService;
19
20
  readonly check: RegisteredCheck;
20
21
  readonly read: LfsRead;
22
+ readonly copy: LfsCopy;
21
23
  }
22
24
  declare const LfsBase_base: Context.ServiceClass<LfsBase, "@ref0/git/lfs/LfsBase", {
23
25
  readonly needs: Context.Context<CoreNeeds>;
@@ -25,11 +27,13 @@ declare const LfsBase_base: Context.ServiceClass<LfsBase, "@ref0/git/lfs/LfsBase
25
27
  readonly links: Links | undefined;
26
28
  readonly requestLimits: RequestLimits.RequestLimits['Service'];
27
29
  readonly attach: (lfs: LfsAttached) => Effect.Effect<void>;
30
+ readonly copy: Effect.Effect<LfsCopy | undefined>;
28
31
  }>;
29
32
  /**
30
33
  * What `Git.layer` gives `Lfs.layer`: the server's services, the adapter's bucket, each call it
31
34
  * makes charged, its links, when it has them, and its `RequestLimits`, none when it gives none;
32
- * and `attach`, once, before the seal.
35
+ * and `attach`, once, before the seal. `copy` is the attached LFS's copy, read as a call runs, so
36
+ * `Sync.layer` built beside `Lfs.layer`, in either order, finds it: `undefined` without LFS.
33
37
  */
34
38
  export declare class LfsBase extends /* @__PURE__ */ LfsBase_base {}
35
39
  export {};
package/dist/lfs/base.mjs CHANGED
@@ -3,7 +3,8 @@ import * as Context from "effect/Context";
3
3
  /**
4
4
  * What `Git.layer` gives `Lfs.layer`: the server's services, the adapter's bucket, each call it
5
5
  * makes charged, its links, when it has them, and its `RequestLimits`, none when it gives none;
6
- * and `attach`, once, before the seal.
6
+ * and `attach`, once, before the seal. `copy` is the attached LFS's copy, read as a call runs, so
7
+ * `Sync.layer` built beside `Lfs.layer`, in either order, finds it: `undefined` without LFS.
7
8
  */
8
9
  var LfsBase = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/lfs/LfsBase")) {};
9
10
  export { LfsBase };