@ref0/git 0.7.0 → 0.9.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 (245) hide show
  1. package/dist/access/private-refs.mjs +0 -2
  2. package/dist/auth/authorize.mjs +31 -24
  3. package/dist/auth/bridge.mjs +8 -8
  4. package/dist/auth/fences.d.mts +0 -1
  5. package/dist/auth/fences.mjs +1 -1
  6. package/dist/auth/grants.d.mts +0 -1
  7. package/dist/auth/grants.mjs +2 -2
  8. package/dist/auth/host-function.d.mts +1 -7
  9. package/dist/auth/host-function.mjs +38 -38
  10. package/dist/auth/identify.d.mts +0 -1
  11. package/dist/auth/identify.mjs +1 -1
  12. package/dist/auth/policy.d.mts +7 -4
  13. package/dist/auth/policy.mjs +13 -10
  14. package/dist/auth/token-rows.mjs +2 -5
  15. package/dist/auth/tokens-layer.d.mts +0 -2
  16. package/dist/auth/tokens-public.d.mts +3 -3
  17. package/dist/auth/tokens-public.mjs +4 -2
  18. package/dist/auth/tokens.d.mts +6 -1
  19. package/dist/auth/tokens.mjs +7 -1
  20. package/dist/client/client.d.mts +22 -15
  21. package/dist/client/client.mjs +31 -27
  22. package/dist/client/git-http.mjs +22 -5
  23. package/dist/client/local.mjs +1 -1
  24. package/dist/client/namespace.d.mts +2 -0
  25. package/dist/client/push-upload.d.mts +1 -0
  26. package/dist/client/push-upload.mjs +169 -2
  27. package/dist/client/remote-helper.mjs +2 -4
  28. package/dist/client/remote.mjs +37 -15
  29. package/dist/client/run-remote-helper.mjs +4 -4
  30. package/dist/client/transport.mjs +26 -19
  31. package/dist/contracts/actors.d.mts +57 -28
  32. package/dist/contracts/actors.mjs +38 -2
  33. package/dist/contracts/authorize.d.mts +21 -15
  34. package/dist/contracts/callers.mjs +40 -0
  35. package/dist/contracts/calls-spent.d.mts +2 -12
  36. package/dist/contracts/calls-spent.mjs +4 -5
  37. package/dist/contracts/client.d.mts +16 -9
  38. package/dist/contracts/events.d.mts +82 -14
  39. package/dist/contracts/events.mjs +35 -9
  40. package/dist/contracts/files.d.mts +42 -42
  41. package/dist/contracts/forks.d.mts +0 -24
  42. package/dist/contracts/git-hooks.d.mts +217 -0
  43. package/dist/contracts/git-hooks.mjs +3 -1
  44. package/dist/contracts/git.d.mts +13 -3
  45. package/dist/contracts/grants.d.mts +46 -27
  46. package/dist/contracts/lfs.d.mts +17 -4
  47. package/dist/contracts/merges.d.mts +7 -7
  48. package/dist/contracts/objects.d.mts +38 -4
  49. package/dist/contracts/opaque.mjs +19 -1
  50. package/dist/contracts/operations.d.mts +8 -1
  51. package/dist/contracts/operations.mjs +209 -0
  52. package/dist/contracts/queue.d.mts +6 -5
  53. package/dist/contracts/queue.mjs +9 -20
  54. package/dist/contracts/remote.d.mts +13 -4
  55. package/dist/contracts/remote.mjs +3 -3
  56. package/dist/contracts/repos.d.mts +11 -40
  57. package/dist/contracts/repos.mjs +11 -10
  58. package/dist/contracts/result.d.mts +28 -11
  59. package/dist/contracts/result.mjs +32 -2
  60. package/dist/contracts/rules.d.mts +706 -46
  61. package/dist/contracts/rules.mjs +81 -2
  62. package/dist/contracts/server.d.mts +5 -275
  63. package/dist/contracts/services.d.mts +0 -3
  64. package/dist/contracts/services.mjs +1 -3
  65. package/dist/contracts/signin.d.mts +2 -2
  66. package/dist/contracts/signin.mjs +4 -5
  67. package/dist/contracts/sync.d.mts +1 -4
  68. package/dist/contracts/tokens.d.mts +29 -17
  69. package/dist/contracts/tokens.mjs +14 -3
  70. package/dist/contracts/topics.d.mts +38 -11
  71. package/dist/contracts/topics.mjs +8 -2
  72. package/dist/core/access.d.mts +0 -2
  73. package/dist/core/access.mjs +15 -4
  74. package/dist/core/ancestry.mjs +5 -4
  75. package/dist/core/events/deliver.mjs +19 -1
  76. package/dist/core/forks.mjs +30 -11
  77. package/dist/core/hooks/groups.d.mts +0 -1
  78. package/dist/core/hooks/groups.mjs +8 -9
  79. package/dist/core/index-job.mjs +23 -1
  80. package/dist/core/index-lost.d.mts +11 -0
  81. package/dist/core/index-lost.mjs +55 -0
  82. package/dist/core/loose-tally.mjs +46 -0
  83. package/dist/core/objects/commit-writes.mjs +1 -1
  84. package/dist/core/objects/commits.mjs +10 -9
  85. package/dist/core/objects/merges.mjs +1 -1
  86. package/dist/core/objects/reading.mjs +28 -13
  87. package/dist/core/objects/trees.mjs +1 -1
  88. package/dist/core/objects/writing.mjs +1 -0
  89. package/dist/core/parts.d.mts +7 -0
  90. package/dist/core/promise.mjs +1 -15
  91. package/dist/core/publish.mjs +9 -5
  92. package/dist/core/purge.mjs +30 -12
  93. package/dist/core/push.mjs +39 -16
  94. package/dist/core/ref-view.mjs +14 -6
  95. package/dist/core/repack.mjs +54 -27
  96. package/dist/core/repo-info.mjs +8 -6
  97. package/dist/core/repos.mjs +1 -0
  98. package/dist/core/rules/check.mjs +10 -10
  99. package/dist/core/rules/context.d.mts +3 -1
  100. package/dist/core/rules/context.mjs +16 -13
  101. package/dist/core/rules/fetch.mjs +17 -23
  102. package/dist/core/tokens.mjs +2 -1
  103. package/dist/core/view.d.mts +10 -1
  104. package/dist/core/view.mjs +15 -6
  105. package/dist/effect.d.mts +3 -6
  106. package/dist/effect.mjs +3 -6
  107. package/dist/engine/commits.mjs +23 -50
  108. package/dist/engine/failures.d.mts +1 -2
  109. package/dist/engine/failures.mjs +1 -3
  110. package/dist/engine/merge-base-walk.mjs +57 -142
  111. package/dist/engine/merge-bases.mjs +9 -7
  112. package/dist/engine/merge.mjs +20 -17
  113. package/dist/engine/parts.d.mts +1 -0
  114. package/dist/engine/parts.mjs +1 -1
  115. package/dist/engine/walk.mjs +15 -11
  116. package/dist/extend.d.mts +1 -2
  117. package/dist/extend.mjs +1 -2
  118. package/dist/http/core-parts.mjs +18 -10
  119. package/dist/http/handler.mjs +11 -31
  120. package/dist/http/parts.d.mts +0 -1
  121. package/dist/index.d.mts +29 -22
  122. package/dist/index.mjs +5 -2
  123. package/dist/lfs/base.d.mts +6 -3
  124. package/dist/lfs/base.mjs +2 -1
  125. package/dist/lfs/layer.d.mts +4 -3
  126. package/dist/lfs/layer.mjs +23 -9
  127. package/dist/lfs/objects.mjs +93 -41
  128. package/dist/lfs/pointers.mjs +69 -18
  129. package/dist/lfs/purge.mjs +6 -2
  130. package/dist/lfs/rows.mjs +24 -7
  131. package/dist/lfs/service.d.mts +6 -3
  132. package/dist/lfs/service.mjs +8 -2
  133. package/dist/lfs/upkeep.mjs +47 -28
  134. package/dist/lfs/upload-most.mjs +47 -0
  135. package/dist/lfs/uploaded.mjs +59 -0
  136. package/dist/protocol/bytes/sha256-hasher.mjs +51 -0
  137. package/dist/protocol/bytes/streams.mjs +84 -2
  138. package/dist/protocol/bytes/text.mjs +6 -1
  139. package/dist/protocol/diff/read.d.mts +1 -0
  140. package/dist/protocol/diff/read.mjs +5 -2
  141. package/dist/protocol/objects/commit.d.mts +7 -0
  142. package/dist/protocol/objects/commit.mjs +5 -1
  143. package/dist/protocol/objects/fsck.mjs +6 -3
  144. package/dist/queue/advance.mjs +77 -18
  145. package/dist/queue/calls.mjs +4 -14
  146. package/dist/queue/host.d.mts +4 -0
  147. package/dist/queue/lanes.mjs +1 -1
  148. package/dist/queue/layer.mjs +4 -2
  149. package/dist/queue/limits.mjs +18 -2
  150. package/dist/queue/rows.mjs +10 -1
  151. package/dist/queue/schedule.mjs +1 -1
  152. package/dist/queue/search.mjs +3 -4
  153. package/dist/queue/trim.mjs +2 -2
  154. package/dist/rest/client-namespace.d.mts +2 -0
  155. package/dist/rest/client.d.mts +32 -8
  156. package/dist/rest/client.mjs +308 -382
  157. package/dist/rest/commits.d.mts +150 -150
  158. package/dist/rest/files.d.mts +18 -18
  159. package/dist/rest/forks.d.mts +77 -89
  160. package/dist/rest/handlers.mjs +2 -1
  161. package/dist/rest/listen.d.mts +8 -6
  162. package/dist/rest/listen.mjs +31 -75
  163. package/dist/rest/me.d.mts +2 -2
  164. package/dist/rest/merges.d.mts +7 -7
  165. package/dist/rest/refs.d.mts +27 -27
  166. package/dist/rest/repos.d.mts +40 -52
  167. package/dist/rest/tokens.d.mts +12 -12
  168. package/dist/rest/topics.d.mts +13 -13
  169. package/dist/rest/trees.d.mts +66 -66
  170. package/dist/rest/wire.d.mts +20 -2
  171. package/dist/rest/work.d.mts +39 -39
  172. package/dist/rest.d.mts +1 -7
  173. package/dist/rest.mjs +1 -5
  174. package/dist/server/git-layer.d.mts +10 -2
  175. package/dist/server/git-layer.mjs +29 -10
  176. package/dist/server/joined.d.mts +12 -6
  177. package/dist/server/joined.mjs +3 -2
  178. package/dist/server/registry.mjs +11 -5
  179. package/dist/server/server.d.mts +0 -1
  180. package/dist/server/server.mjs +42 -49
  181. package/dist/signin/context.d.mts +0 -1
  182. package/dist/signin/context.mjs +5 -9
  183. package/dist/storage/clean-up.mjs +3 -1
  184. package/dist/storage/fsck.mjs +12 -2
  185. package/dist/storage/graph-rebuild.mjs +262 -0
  186. package/dist/storage/index-bitmaps.mjs +16 -10
  187. package/dist/storage/index-build.mjs +160 -24
  188. package/dist/storage/index-graph.d.mts +1 -0
  189. package/dist/storage/index-graph.mjs +29 -5
  190. package/dist/storage/index-layers.d.mts +1 -0
  191. package/dist/storage/index-layers.mjs +5 -2
  192. package/dist/storage/index-reach.mjs +7 -5
  193. package/dist/storage/index-remap.mjs +5 -5
  194. package/dist/storage/index-visible.mjs +16 -5
  195. package/dist/storage/lfs-pointers.d.mts +5 -5
  196. package/dist/storage/lfs-pointers.mjs +37 -11
  197. package/dist/storage/links.mjs +3 -3
  198. package/dist/storage/loose.mjs +4 -1
  199. package/dist/storage/memory-budget.mjs +1 -1
  200. package/dist/storage/merge-fence.mjs +81 -19
  201. package/dist/storage/merge-most.mjs +1 -0
  202. package/dist/storage/merge-row.mjs +16 -4
  203. package/dist/storage/merge-stream.mjs +9 -6
  204. package/dist/storage/object-rows.mjs +17 -1
  205. package/dist/storage/pack-order.d.mts +1 -0
  206. package/dist/storage/pack-order.mjs +18 -1
  207. package/dist/storage/pack-receive.mjs +10 -6
  208. package/dist/storage/packs.mjs +58 -27
  209. package/dist/storage/prune-walk.mjs +5 -2
  210. package/dist/storage/prune.mjs +168 -70
  211. package/dist/storage/ready.d.mts +1 -1
  212. package/dist/storage/ready.mjs +12 -3
  213. package/dist/storage/receive-bounds.mjs +3 -2
  214. package/dist/storage/receive-state.mjs +1 -1
  215. package/dist/storage/repack-contained.mjs +22 -14
  216. package/dist/storage/repack.d.mts +1 -1
  217. package/dist/storage/repack.mjs +3 -2
  218. package/dist/storage/unpack.mjs +7 -0
  219. package/dist/storage/visible.mjs +3 -2
  220. package/dist/storage/walk.d.mts +1 -0
  221. package/dist/storage/walk.mjs +9 -5
  222. package/dist/storage/wants.mjs +17 -11
  223. package/dist/store/call-count.d.mts +31 -3
  224. package/dist/store/call-count.mjs +51 -20
  225. package/dist/store/errors.d.mts +7 -1
  226. package/dist/store/errors.mjs +7 -1
  227. package/dist/store/job-try.mjs +3 -1
  228. package/dist/store/records.mjs +26 -5
  229. package/dist/store/repo-record.mjs +36 -12
  230. package/dist/store/scopes.mjs +15 -2
  231. package/dist/sync/bound.d.mts +1 -1
  232. package/dist/sync/import.mjs +15 -3
  233. package/dist/sync/layer.d.mts +5 -1
  234. package/dist/sync/layer.mjs +11 -9
  235. package/dist/sync/mirror.mjs +1 -1
  236. package/dist/sync/step.mjs +15 -15
  237. package/dist/topics/advance.mjs +11 -10
  238. package/dist/topics/layer.mjs +1 -1
  239. package/dist/topics/members.mjs +38 -9
  240. package/package.json +3 -3
  241. package/dist/engine/merge-base-walk.d.mts +0 -3
  242. package/dist/server/routes.d.mts +0 -32
  243. package/dist/server/routes.mjs +0 -69
  244. package/dist/sync/bridge.d.mts +0 -6
  245. package/dist/sync/bridge.mjs +0 -29
@@ -15,8 +15,8 @@ import { answerSpent, decodeRow } from "../store/errors.mjs";
15
15
  import { refPageRows, storedPeel } from "../store/ref-rows.mjs";
16
16
  import { decodePacks } from "../store/git-store.mjs";
17
17
  import { ReachedMark, markHolds } from "../store/records.mjs";
18
- import { readRecord } from "../store/repo-record.mjs";
19
- import { collections, reachedKey } from "../store/scopes.mjs";
18
+ import { readRecord, rootsOf } from "../store/repo-record.mjs";
19
+ import { collections, reachedKey, repoRootsKey } from "../store/scopes.mjs";
20
20
  import { fetchReaches, hiddenUnder } from "../protocol/wire/lines.mjs";
21
21
  import { read } from "../core/objects/objects.mjs";
22
22
  import * as Effect from "effect/Effect";
@@ -114,12 +114,14 @@ const coreHttpParts = (parts, options = {}) => {
114
114
  refsRead,
115
115
  packsRead,
116
116
  indexRowKey,
117
- reachedKey
117
+ reachedKey,
118
+ repoRootsKey
118
119
  ]);
119
120
  const { record, snapshot } = read$1;
120
121
  if (record === void 0 || record.deleted === true) return yield* fail("NOT_FOUND", `No repo '${operation.repo}'`);
121
- const [, refRows = [], packRows = [], indexRows = [], markRows = []] = snapshot.results;
122
+ const [, refRows = [], packRows = [], indexRows = [], markRows = [], rootRows] = snapshot.results;
122
123
  const packs = yield* decodePacks(packRows);
124
+ const roots = yield* rootsOf(rootRows);
123
125
  const listed = {
124
126
  repo: resolved.internalId,
125
127
  version: snapshot.version,
@@ -134,13 +136,17 @@ const coreHttpParts = (parts, options = {}) => {
134
136
  listed,
135
137
  refs: seen,
136
138
  refRows,
137
- index: row
139
+ index: row,
140
+ roots
138
141
  }
139
142
  });
140
143
  const objects = objectsFace(viewed);
144
+ const [stored] = indexRows;
145
+ const lost = stored === void 0 ? void 0 : core.indexLost?.(resolved.internalId, stored, listed);
141
146
  const index = viewed.index === void 0 ? void 0 : {
142
147
  calls: viewed.index,
143
- row
148
+ row,
149
+ ...lost !== void 0 && { lost }
144
150
  };
145
151
  const refs = peel ? yield* advertised(refRows, seen) : [...seen].map(([name, oid]) => ({
146
152
  name,
@@ -163,13 +169,15 @@ const coreHttpParts = (parts, options = {}) => {
163
169
  refs: served,
164
170
  objects,
165
171
  whole,
166
- seesAll
172
+ seesAll,
173
+ roots
167
174
  } : {
168
175
  listed,
169
176
  refs: served,
170
177
  objects,
171
178
  whole,
172
179
  seesAll,
180
+ roots,
173
181
  index
174
182
  };
175
183
  });
@@ -265,7 +273,7 @@ const coreHttpParts = (parts, options = {}) => {
265
273
  return {
266
274
  refs: at.refs,
267
275
  held: (oids) => heldOf(at.objects, at.listed, oids),
268
- ruledDepth: (fetch, request) => runFetchRules(core.checks.reports, {
276
+ ruledDepth: (fetch, request) => runFetchRules({
269
277
  caller,
270
278
  repo,
271
279
  fetch,
@@ -277,7 +285,8 @@ const coreHttpParts = (parts, options = {}) => {
277
285
  listed: at.listed,
278
286
  tips,
279
287
  wants: request.wants,
280
- signal
288
+ signal,
289
+ roots: at.roots
281
290
  };
282
291
  if (at.index !== void 0) input.index = at.index;
283
292
  const missing = yield* unreachableWant(input);
@@ -323,7 +332,6 @@ const coreHttpParts = (parts, options = {}) => {
323
332
  updates: []
324
333
  }, { peel: false }).pipe(Effect.map((at) => receiving(caller, repo, at)), Effect.catch((error) => readersOnly(caller, repo, error)), Effect.provideContext(needs))
325
334
  };
326
- if (options.resolve !== void 0) http.resolve = options.resolve;
327
335
  if (options.pushObjectsMost !== void 0) http.pushObjectsMost = options.pushObjectsMost;
328
336
  if (options.maxDuration !== void 0) http.maxDuration = options.maxDuration;
329
337
  if (options.calls !== void 0) http.fetchCalls = options.calls;
@@ -1,7 +1,5 @@
1
- import { gitError } from "../contracts/result.mjs";
2
- import { tryUnlessSpent } from "../contracts/calls-spent.mjs";
3
1
  import { routeEdge } from "../store/errors.mjs";
4
- import { moved, notFound, refusal, requestType, told } from "./answers.mjs";
2
+ import { moved, refusal, requestType, told } from "./answers.mjs";
5
3
  import { lfsAnswer, lfsRefusal } from "../lfs/wire.mjs";
6
4
  import { gitUrlOf, infoRefsPath, isGitService, normalBase } from "./paths.mjs";
7
5
  import { receivePack, receivePackRefs, routeCounted } from "./receive-pack.mjs";
@@ -15,11 +13,11 @@ const gitHttp = (parts) => {
15
13
  const url = new URL(request.url);
16
14
  const git = gitUrlOf(url, base);
17
15
  if (git === void 0) return Effect.succeed(void 0);
18
- if (git.kind === "lfs") return lfsRoute(parts, git, url, request);
19
- if (git.kind === "push-upload") return uploadRoute(parts, git, url, request);
16
+ if (git.kind === "lfs") return lfsRoute(parts, git, request);
17
+ if (git.kind === "push-upload") return uploadRoute(parts, git, request);
20
18
  const malformed = malformedRequest(git, request);
21
19
  if (malformed !== void 0) return Effect.succeed(malformed);
22
- return answer(parts, base, git, url, request);
20
+ return answer(parts, base, git, request);
23
21
  } };
24
22
  };
25
23
  /**
@@ -28,12 +26,11 @@ const gitHttp = (parts) => {
28
26
  */
29
27
  const lfsOff = "This server has no Git LFS: its host turns it on";
30
28
  /** A request to Git LFS's API: its refusals are LFS's JSON, as git-lfs reads them. */
31
- const lfsRoute = /* @__PURE__ */ Effect.fnUntraced(function* (parts, git, url, request) {
29
+ const lfsRoute = /* @__PURE__ */ Effect.fnUntraced(function* (parts, git, request) {
32
30
  const lfs = parts.lfs();
33
31
  if (lfs === void 0) return lfsAnswer(404, { message: lfsOff });
34
32
  const caller = yield* parts.identify(request);
35
- const repo = yield* repoOf(parts, git, url, caller);
36
- if (repo === void 0) return lfsAnswer(404, { message: "Repository not found" });
33
+ const repo = git.path;
37
34
  return yield* routeCounted(parts, lfs({
38
35
  caller,
39
36
  repo,
@@ -43,13 +40,12 @@ const lfsRoute = /* @__PURE__ */ Effect.fnUntraced(function* (parts, git, url, r
43
40
  }));
44
41
  }, (route) => routeEdge(route, lfsRefusal));
45
42
  /** A large push's upload: its refusals are a push's, as `git-remote-ref0` reads them. */
46
- const uploadRoute = /* @__PURE__ */ Effect.fnUntraced(function* (parts, git, url, request) {
43
+ const uploadRoute = /* @__PURE__ */ Effect.fnUntraced(function* (parts, git, request) {
47
44
  const uploads = parts.uploads();
48
45
  if (uploads === void 0) return told(404, "This server takes no push uploads");
49
46
  if (request.method !== "POST") return told(405, "Method not allowed", { allow: "POST" });
50
47
  const caller = yield* parts.identify(request);
51
- const repo = yield* repoOf(parts, git, url, caller);
52
- if (repo === void 0) return notFound();
48
+ const repo = git.path;
53
49
  return yield* uploads.serve(parts, {
54
50
  caller,
55
51
  repo,
@@ -66,33 +62,17 @@ const malformedRequest = (git, request) => {
66
62
  if (request.method !== "POST") return told(405, "Method not allowed", { allow: "POST" });
67
63
  return (request.headers.get("content-type") ?? "").split(";")[0]?.trim().toLowerCase() === requestType(git.service) ? void 0 : told(415, "Unsupported media type");
68
64
  };
69
- /**
70
- * The repo `git` names for `caller`: the host's `resolve`, or the path itself. Its signal aborts
71
- * when the request does or the server closes.
72
- */
73
- const repoOf = (parts, git, url, caller) => {
74
- const { resolve } = parts;
75
- if (resolve === void 0) return Effect.succeed(git.path);
76
- return tryUnlessSpent(async (signal) => resolve({
77
- actor: caller.actor,
78
- url,
79
- path: git.path,
80
- signal
81
- }), (cause) => gitError("INTERNAL", "The host's resolve failed", { cause }));
82
- };
83
- const answer = /* @__PURE__ */ Effect.fnUntraced(function* (parts, base, git, url, request) {
65
+ const answer = /* @__PURE__ */ Effect.fnUntraced(function* (parts, base, git, request) {
84
66
  const started = yield* Clock$1.currentTimeMillis;
85
67
  const caller = yield* parts.identify(request);
86
- const repo = yield* repoOf(parts, git, url, caller);
87
- if (repo === void 0) return notFound();
88
- return yield* serve(parts, base, git, caller, repo, request, started);
68
+ return yield* serve(parts, base, git, caller, git.path, request, started);
89
69
  }, (route, _parts, _base, git) => routeEdge(route, (error) => refusal(error, git.service === "git-receive-pack")));
90
70
  /** A refusal a repo that isn't there gets, which a renamed repo's old name may answer instead. */
91
71
  const isMissing = (error) => error.code === "NOT_FOUND" || error.code === "UNAUTHENTICATED" || error.code === "NOT_ALLOWED";
92
72
  const serve = (parts, base, git, caller, repo, request, started) => {
93
73
  if (git.kind === "info-refs") {
94
74
  const { service, dotGit } = git;
95
- const missing = (error) => parts.resolve !== void 0 || !isMissing(error) || !isGitService(service) ? Effect.fail(error) : Effect.flatMap(parts.renamedTo(caller, repo), (renamed) => renamed === void 0 ? Effect.fail(error) : Effect.succeed(moved(infoRefsPath(base, renamed, dotGit, service))));
75
+ const missing = (error) => !isMissing(error) || !isGitService(service) ? Effect.fail(error) : Effect.flatMap(parts.renamedTo(caller, repo), (renamed) => renamed === void 0 ? Effect.fail(error) : Effect.succeed(moved(infoRefsPath(base, renamed, dotGit, service))));
96
76
  return git.service === "git-receive-pack" ? receivePackRefs(parts, caller, repo, missing) : uploadPackRefs(parts, caller, repo, request, started, missing);
97
77
  }
98
78
  return git.service === "git-receive-pack" ? receivePack(parts, caller, repo, request) : uploadPack(parts, caller, repo, request, started);
@@ -3,7 +3,6 @@ import "../contracts/ids.mjs";
3
3
  import "../contracts/objects.mjs";
4
4
  import "../contracts/refs.mjs";
5
5
  import "../contracts/result.mjs";
6
- import "../contracts/server.mjs";
7
6
  import "../auth/identify.mjs";
8
7
  import "../core/access.mjs";
9
8
  import "../store/call-count.mjs";
package/dist/index.d.mts CHANGED
@@ -1,72 +1,78 @@
1
1
  import { Actor, ActorId, ActorInput, AnonymousActor, AuthInput, AuthorizeAnswer, AuthorizeInput, CallInput, Caller, CallerGrant, Credentials, CredentialsBasic, CredentialsBearer, GitAuth, GitAuthorize, 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
- import { ClientAdapter, ClientFetchInput, ClientFetchResult, ClientPushInput, GitClient, GitClientOptions, Localize, PagedInput, RefForced, RemoteRefsInput } from "./contracts/client.mjs";
5
- import { createGitClient, paginate } from "./client/client.mjs";
4
+ import { ClientAdapter, ClientFetchInput, ClientFetchResult, ClientPushInput, GitClientCalls, GitClientOptions, Localize, PagedInput, RefForced, RemoteRefsInput } from "./contracts/client.mjs";
5
+ import "./client/namespace.mjs";
6
+ import "./rest/client-namespace.mjs";
7
+ import { RestClientCalls, RestTokenCalls, client_d_exports as client_d_exports$1 } from "./rest/client.mjs";
8
+ import { ListenInput, RestEvents } from "./rest/listen.mjs";
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";
6
11
  import "./contracts/namespaces.mjs";
7
12
  import "./server/namespaces.mjs";
8
13
  import "./core/namespaces.mjs";
14
+ import { git_events_d_exports } from "./contracts/git-events.mjs";
9
15
  import "./auth/namespaces.mjs";
10
16
  import "./event-streams/namespace.mjs";
11
17
  import "./rest/namespace.mjs";
12
18
  import "./merges/namespace.mjs";
19
+ import { authorize_d_exports } from "./contracts/authorize.mjs";
13
20
  import "./queue/namespace.mjs";
14
21
  import "./lfs/namespace.mjs";
15
- import { mergeQueue } from "./queue/host.mjs";
22
+ import { QueueInternals, mergeQueue } from "./queue/host.mjs";
16
23
  import { CommitCalls, CommitCreateInput, CommitDiffInput, Compare, CompareInput, ComparisonFile, LineCounts, LogInput, RefPublication, Revision, commits_d_exports } from "./contracts/commits.mjs";
17
24
  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";
18
- 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, RepoRenamed, RepoVisibilityChanged, RepoWorkFailed, TokenEvent, TokenEventFields, TopicAdded, TopicEnvelope, TopicEvent, TopicFailed, TopicMerged, TopicOpened, TopicRemoved, TopicReported, TopicWorkFailed, events_d_exports } from "./contracts/events.mjs";
25
+ 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";
19
26
  import { File, FileCalls, FileDiff, FileReadInput, FilesDiffInput, FilesListInput, FilesRead, files_d_exports } from "./contracts/files.mjs";
20
27
  import { ForkCalls, ForkCreateInput, ForkFetched, ForkGetInput, ForkHolder, ForkListInput, forks_d_exports } from "./contracts/forks.mjs";
21
- import { LfsCalls, LfsFeature, LfsGetInput, LfsObject } from "./contracts/lfs.mjs";
28
+ import { LfsCalls, LfsFeature, LfsGetInput, LfsObject, LfsOptions } from "./contracts/lfs.mjs";
29
+ import { repo_records_d_exports } from "./contracts/repo-records.mjs";
22
30
  import { MergeAnswer, MergeCalls, MergeCreateInput } from "./contracts/merges.mjs";
23
- import { git_events_d_exports } from "./contracts/git-events.mjs";
24
31
  import { HandlerOptions, SavedHandlerOptions } from "./contracts/handlers.mjs";
25
32
  import { Grant, GrantAgainInput, GrantAgainRequest, GrantInput, GrantReachInput, GrantResolver } from "./contracts/grants.mjs";
26
33
  import { GitScope, InternalRepoId, Oid, RefName, RepoName, TopicId, isInternalId, maxActorIdLength, maxRefNameLength } from "./contracts/ids.mjs";
27
- import { authorize_d_exports } from "./contracts/authorize.mjs";
28
- 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, ShareInput, StageInput, Staged, StepAnswer, StepInput, WholeObject } from "./contracts/objects.mjs";
34
+ 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";
29
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
+ import { client_d_exports } from "./client/client.mjs";
30
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";
38
+ import { RepoStreamEvent } from "./rest/wire.mjs";
31
39
  import { Ref, RefCalls, RefCount, RefCountInput, RefEdit, RefInput, RefListInput, RefProtection, RefSource, RefUpdate, RefUpdateKind, RefsUpdateInput, RefsUpdated, refs_d_exports } from "./contracts/refs.mjs";
32
- import { repo_records_d_exports } from "./contracts/repo-records.mjs";
33
- import { BasicCredential, BearerCredential, ClientCredential, ClientCredentials, CredentialInput, RemoteCalls, RemoteOptions, TransportFailure, TransportRetry, WithoutActor } from "./contracts/remote.mjs";
40
+ import { BasicCredential, BearerCredential, ClientCredential, ClientCredentials, CredentialInput, RemoteCalls, RemoteOptions, TransportFailure, TransportRetry, WithoutActor, WithoutSignal } from "./contracts/remote.mjs";
34
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";
35
42
  import { PeelInput, Peeled, TagCalls, TagCreateInput, peelMost, peelTagsMost, tags_d_exports } from "./contracts/tags.mjs";
36
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";
37
- import { TreeCalls, TreeCreateInput, TreeEdit, TreeEntry, TreeInput, trees_d_exports } from "./contracts/trees.mjs";
38
44
  import { policy_d_exports } from "./auth/policy.mjs";
39
- import { BlobLimit, BlobNone, Bytes, FetchRequest, Filter, LfsPointers, ObjectType, ReadLimits, TreeFilter, allotmentWithin, objectsReadMost } from "./contracts/object-values.mjs";
45
+ import { TreeCalls, TreeCreateInput, TreeEdit, TreeEntry, TreeInput, trees_d_exports } from "./contracts/trees.mjs";
40
46
  import { event_streams_d_exports } from "./event-streams/event-streams.mjs";
47
+ import { BlobLimit, BlobNone, Bytes, FetchRequest, Filter, LfsPointers, ObjectType, ReadLimits, TreeFilter, allotmentWithin, objectsReadMost } from "./contracts/object-values.mjs";
41
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";
42
49
  import { SliceRefusal } from "./client/slice-push.mjs";
43
50
  import { gitPathOf } from "./http/paths.mjs";
44
- import { createGitServer } from "./server/server.mjs";
45
51
  import { git_namespace_d_exports } from "./server/git-namespace.mjs";
52
+ import { createGitServer } from "./server/server.mjs";
46
53
  import { lfs } from "./lfs/service.mjs";
47
54
  import { branchRef, shortTarget } from "./queue/ids.mjs";
48
55
  import { topics } from "./topics/host.mjs";
49
56
  import { lfsPointerOid, maxLfsPointerBytes } from "./protocol/objects/lfs-pointer.mjs";
50
57
  import { LfsPointersBuilder, lfsPointers } from "./storage/lfs-pointers.mjs";
51
- import { loose, looseLimits } from "./storage/loose.mjs";
52
58
  import { objects_namespace_d_exports } from "./core/objects/objects-namespace.mjs";
53
59
  import { saved_callers_public_d_exports } from "./core/saved-callers-public.mjs";
54
- import { PacksOptions, UnpackOptions, packs } from "./storage/packs.mjs";
60
+ import { loose, looseLimits } from "./storage/loose.mjs";
55
61
  import { auth_namespace_d_exports } from "./auth/auth-namespace.mjs";
62
+ import { PacksOptions, UnpackOptions, packs } from "./storage/packs.mjs";
56
63
  import { PacksMemory, packsMemory } from "./storage/packs-memory.mjs";
57
- import { Option, RepackOptions } from "./storage/repack.mjs";
58
64
  import { layer_d_exports } from "./rest/layer.mjs";
59
- import "./core/rules/namespace.mjs";
65
+ import { Option, RepackOptions } from "./storage/repack.mjs";
60
66
  import { public_d_exports as public_d_exports$3 } from "./merges/public.mjs";
61
- import { FetchAdjustment, FetchReadInput, FetchReadTarget, FetchRule, FetchRuleInput, FileRuleOptions, ProtectOptions, PushContext, PushFacts, PushRule, PushRuleInput, RefPatterns, RuleOperation } from "./contracts/rules.mjs";
67
+ import "./core/rules/namespace.mjs";
62
68
  import { public_d_exports as public_d_exports$2 } from "./queue/public.mjs";
63
- import { BeginPushUpload, FinishPushUpload, PushOptions, PushUploadOptions, PushUploadPart, PushUploadStarted } from "./contracts/push-uploads.mjs";
69
+ import { FetchAdjustment, FetchReadInput, FetchReadTarget, FetchRule, FetchRuleInput, FileRuleOptions, ProtectOptions, PushContext, PushFacts, PushRule, PushRuleInput, RefPatterns, RuleOperation } from "./contracts/rules.mjs";
64
70
  import { public_d_exports as public_d_exports$1 } from "./lfs/public.mjs";
65
- import { GitAdapter, GitNeeds, GitServer, GitServerOptions, HostFunctionFailure, ProvidedBy, Refusal, Resolve, ResolveInput, ServerCalls, ServerSetup } from "./contracts/server.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";
66
73
  import { ImportState } from "./contracts/sync.mjs";
67
74
  import { ApprovalBase, ApprovalDecision, ApprovalPageContext, ApprovalPageInput, ApprovalPrompt, ApprovedGrant, ConfirmApprovalPage, DeniedGrant, DeviceApproval, DeviceCodePage, DeviceCodeRequest, DeviceCodeResponse, DeviceExchange, OAuthClient, OAuthError, OAuthTokenResponse, WebApproval, WebAuthorize, WebExchange } from "./contracts/signin.mjs";
68
75
  import { GitStore, GitStoreAddInput, GitStoreCommitInput, GitStoreReadInput, HeldPack, Holding, Listed, ListedInput, Pack } from "./contracts/store.mjs";
69
- import { CreatedToken, PrefixTarget, TokenCalls, TokenCoverage, TokenCreateInput, TokenFields, TokenId, TokenInfo, TokenListInput, TokenRecord, TokenScope, TokenState, TokenTarget, TokensFeature, TrustedWriteInput, VerifiedToken } from "./contracts/tokens.mjs";
70
76
  import { WorkCalls, WorkItem, WorkListInput, WorkWriteInput, work_d_exports } from "./contracts/work.mjs";
71
77
  import { rules_d_exports } from "./core/rules/rules.mjs";
72
78
  import "./access/namespace.mjs";
@@ -80,4 +86,5 @@ import { public_d_exports } from "./core/hooks/public.mjs";
80
86
  import { PushHookInput } from "./contracts/git-hooks.mjs";
81
87
  import { public_d_exports as public_d_exports$5 } from "./signin/public.mjs";
82
88
  import "./signin/namespace.mjs";
83
- 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, type GitClient, 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 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 HostFunctionFailure, 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 LfsPointers, type LfsPointersBuilder, type LineCounts, type LinkedObjects, type Listed, type ListedInput, type Localize, type LogInput, type MaintainInput, 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 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 Refusal, 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 RepoRecord, repo_records_d_exports as RepoRecords, type RepoRenameInput, type RepoRenamed, type RepoStats, type RepoUpdateInput, type RepoVisibilityChanged, type RepoWork, type RepoWorkFailed, type Report, type ReportDetails, type ReportOptions, type ReportResult, type Reported, repos_d_exports as Repos, type Resolve, type ResolveInput, ResourceContext, ResourceReason, layer_d_exports as Rest, type RestartResult, type Restarted, type Result, type Retried, type RetryResult, type Revision, 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, work_d_exports as Work, type WorkCalls, type WorkItem, type WorkListInput, type WorkOperation, type WorkWriteInput, type WriteInput, accept, allotmentWithin, branchRef, createGitClient, createGitServer, gitError, gitPathOf, httpStatus, isGitError, isInternalId, isRefusalReason, lfs, lfsPointerOid, lfsPointers, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, mergeQueue, objectsReadMost, packs, packsMemory, paginate, peelMost, peelTagsMost, reject, shortTarget, topics };
89
+ 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, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, mergeQueue, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, reject, shortTarget, tokenScopes, tokenStates, topics };
package/dist/index.mjs CHANGED
@@ -1,4 +1,6 @@
1
- import { createGitClient, paginate } from "./client/client.mjs";
1
+ import { client_exports } from "./client/client.mjs";
2
+ import { client_exports as client_exports$1 } from "./rest/client.mjs";
3
+ import { grantScopes, tokenScopes, tokenStates } from "./contracts/tokens.mjs";
2
4
  import { authorize_exports } from "./contracts/authorize.mjs";
3
5
  import { blobs_exports } from "./contracts/blobs.mjs";
4
6
  import { commits_exports } from "./contracts/commits.mjs";
@@ -43,4 +45,5 @@ import { public_exports as public_exports$6 } from "./topics/public.mjs";
43
45
  import { tokens_public_exports } from "./auth/tokens-public.mjs";
44
46
  import { public_exports } from "./core/hooks/public.mjs";
45
47
  import { public_exports as public_exports$5 } from "./signin/public.mjs";
46
- 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, 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, 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, createGitClient, createGitServer, gitError, gitPathOf, httpStatus, isGitError, isInternalId, isRefusalReason, lfs, lfsPointerOid, lfsPointers, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, mergeQueue, objectsReadMost, packs, packsMemory, paginate, peelMost, peelTagsMost, reject, shortTarget, topics };
48
+ 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, loose, looseLimits, maxActorIdLength, maxLfsPointerBytes, maxRefNameLength, mergeQueue, objectsReadMost, packs, packsMemory, peelMost, peelTagsMost, reject, shortTarget, tokenScopes, tokenStates, topics };
@@ -1,11 +1,12 @@
1
1
  import { LfsObject } from "../contracts/lfs.mjs";
2
2
  import { GitError } from "../contracts/result.mjs";
3
3
  import { RegisteredCheck } from "../core/rules/context.mjs";
4
- import { Bucket, Links } from "../contracts/objects.mjs";
4
+ import { Bucket as Bucket$1, Links } from "../contracts/objects.mjs";
5
5
  import { CoreNeeds } from "../core/parts.mjs";
6
6
  import { ObjectRead } from "./objects.mjs";
7
7
  import { LfsService } from "./service.mjs";
8
8
  import * as Effect from "effect/Effect";
9
+ import { RequestLimits } from "@ref0/infra";
9
10
  import * as Context from "effect/Context";
10
11
  /** A listed object's bytes, as `objectOf` reads them over LFS's parts. */
11
12
  export type LfsRead = (read: ObjectRead) => Effect.Effect<LfsObject, GitError, CoreNeeds>;
@@ -20,13 +21,15 @@ export interface LfsAttached {
20
21
  }
21
22
  declare const LfsBase_base: Context.ServiceClass<LfsBase, "@ref0/git/lfs/LfsBase", {
22
23
  readonly needs: Context.Context<CoreNeeds>;
23
- readonly bucket: Bucket | undefined;
24
+ readonly bucket: Bucket$1 | undefined;
24
25
  readonly links: Links | undefined;
26
+ readonly requestLimits: RequestLimits.RequestLimits['Service'];
25
27
  readonly attach: (lfs: LfsAttached) => Effect.Effect<void>;
26
28
  }>;
27
29
  /**
28
30
  * What `Git.layer` gives `Lfs.layer`: the server's services, the adapter's bucket, each call it
29
- * makes charged, and its links, when it has them; and `attach`, once, before the seal.
31
+ * makes charged, its links, when it has them, and its `RequestLimits`, none when it gives none;
32
+ * and `attach`, once, before the seal.
30
33
  */
31
34
  export declare class LfsBase extends /* @__PURE__ */ LfsBase_base {}
32
35
  export {};
package/dist/lfs/base.mjs CHANGED
@@ -2,7 +2,8 @@ import * as Context from "effect/Context";
2
2
  // src/lfs/base.ts
3
3
  /**
4
4
  * What `Git.layer` gives `Lfs.layer`: the server's services, the adapter's bucket, each call it
5
- * makes charged, and its links, when it has them; and `attach`, once, before the seal.
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
7
  */
7
8
  var LfsBase = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/lfs/LfsBase")) {};
8
9
  export { LfsBase };
@@ -1,5 +1,5 @@
1
1
  import { Git } from "../contracts/git.mjs";
2
- import { LfsGetInput, LfsObject } from "../contracts/lfs.mjs";
2
+ import { LfsGetInput, LfsObject, LfsOptions } from "../contracts/lfs.mjs";
3
3
  import { RepoName } from "../contracts/ids.mjs";
4
4
  import { GitError } from "../contracts/result.mjs";
5
5
  import { LfsBase } from "./base.mjs";
@@ -22,7 +22,8 @@ export declare class Lfs extends /* @__PURE__ */ Lfs_base {}
22
22
  /**
23
23
  * Git LFS, a feature over core: it registers `lfs`, keeps its objects in the host's `Bucket`, and
24
24
  * serves git-lfs's API under each repo's `info/lfs/`. With `BucketLinks` its transfers go straight
25
- * to the bucket; without, through the Worker.
25
+ * to the bucket; without, through the Worker, each upload held to what the host's caps let finish:
26
+ * `options`, each winning over the adapter's `RequestLimits`, as `LfsOptions` says.
26
27
  */
27
- export declare const layer: () => Layer.Layer<Lfs, GitError, Git | LfsBase | Bucket.Bucket>;
28
+ export declare const layer: (options?: LfsOptions) => Layer.Layer<Lfs, GitError, Git | LfsBase | Bucket.Bucket>;
28
29
  export {};
@@ -1,11 +1,13 @@
1
1
  import { register } from "../contracts/git.mjs";
2
- import { callerFor } from "../core/access.mjs";
2
+ import { callerFor, resolvedAs } from "../core/access.mjs";
3
+ import { seenIn } from "../core/objects/reading.mjs";
3
4
  import { LfsBase } from "./base.mjs";
4
5
  import { objectOf } from "./objects.mjs";
5
6
  import { pointerCheck } from "./pointers.mjs";
6
7
  import { lfsPurge } from "./purge.mjs";
7
8
  import { lfsService } from "./service.mjs";
8
9
  import { lfsUpkeep } from "./upkeep.mjs";
10
+ import { capsRefusal, uploadMostOf } from "./upload-most.mjs";
9
11
  import * as Effect from "effect/Effect";
10
12
  import { Bucket } from "@ref0/infra";
11
13
  import * as Context from "effect/Context";
@@ -15,16 +17,25 @@ import * as Layer from "effect/Layer";
15
17
  var Lfs = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/Lfs")) {};
16
18
  /**
17
19
  * LFS over `registration`: its routes and pointer check attached to the server, its upkeep and purge on
18
- * the registration, its rows the registration's, under `lfs/`. A server with no bucket is a defect.
20
+ * the registration, its rows the registration's, under `lfs/`. Its uploads through the server are
21
+ * held to the adapter's `RequestLimits`, each of `options` winning over its own. A server with no
22
+ * bucket, or `options` that aren't caps, is a defect.
19
23
  */
20
- const lfsRegistration = /* @__PURE__ */ Effect.fnUntraced(function* (registration) {
24
+ const lfsRegistration = /* @__PURE__ */ Effect.fnUntraced(function* (registration, options = {}) {
21
25
  const base = yield* LfsBase;
22
- const { needs, bucket, links } = base;
26
+ const { needs, bucket, links, requestLimits } = base;
23
27
  if (bucket === void 0) return yield* Effect.die(/* @__PURE__ */ new TypeError("lfs() keeps its objects in the adapter's bucket: give the adapter a bucket"));
28
+ const caps = {
29
+ bodyCap: options.bodyCap ?? requestLimits.bodyBytes,
30
+ cpuMs: options.cpuMs ?? requestLimits.cpuMs
31
+ };
32
+ const refusal = capsRefusal(caps);
33
+ if (refusal !== void 0) return yield* Effect.die(new TypeError(refusal));
24
34
  const parts = {
25
35
  rows: registration.rows,
26
36
  bucket,
27
- signed: links
37
+ signed: links,
38
+ uploadMost: uploadMostOf(caps)
28
39
  };
29
40
  const read = (one) => objectOf(parts, one);
30
41
  const callerOf = callerFor(void 0);
@@ -35,7 +46,9 @@ const lfsRegistration = /* @__PURE__ */ Effect.fnUntraced(function* (registratio
35
46
  band: "post",
36
47
  handler: (input, updates) => pointerCheck(registration.rows, {
37
48
  updates,
38
- objects: input.objects
49
+ objects: input.objects,
50
+ caller: input.caller,
51
+ seen: (blobs) => Effect.provideContext(Effect.flatMap(resolvedAs(input.repo, input.objects.repo), (resolved) => seenIn(input.caller, resolved, blobs)), needs)
39
52
  })
40
53
  },
41
54
  read
@@ -55,11 +68,12 @@ const lfsRegistration = /* @__PURE__ */ Effect.fnUntraced(function* (registratio
55
68
  /**
56
69
  * Git LFS, a feature over core: it registers `lfs`, keeps its objects in the host's `Bucket`, and
57
70
  * serves git-lfs's API under each repo's `info/lfs/`. With `BucketLinks` its transfers go straight
58
- * to the bucket; without, through the Worker.
71
+ * to the bucket; without, through the Worker, each upload held to what the host's caps let finish:
72
+ * `options`, each winning over the adapter's `RequestLimits`, as `LfsOptions` says.
59
73
  */
60
- const layer = () => Layer.effect(Lfs, Effect.gen(function* () {
74
+ const layer = (options = {}) => Layer.effect(Lfs, Effect.gen(function* () {
61
75
  yield* Bucket.Bucket;
62
76
  const registration = yield* register({ name: "lfs" });
63
- return yield* lfsRegistration(registration);
77
+ return yield* lfsRegistration(registration, options);
64
78
  }));
65
79
  export { Lfs, layer, lfsRegistration };