@ref0/git 0.20.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/dist/access/private-refs.mjs +1 -1
  2. package/dist/auth/access-jwt.mjs +3 -3
  3. package/dist/auth/auth-namespace.d.mts +3 -3
  4. package/dist/auth/auth-namespace.mjs +3 -2
  5. package/dist/auth/auth.d.mts +3 -3
  6. package/dist/auth/auth.mjs +9 -8
  7. package/dist/auth/authorize.mjs +1 -1
  8. package/dist/auth/fences.d.mts +1 -1
  9. package/dist/auth/host-function.mjs +1 -1
  10. package/dist/auth/host-services.mjs +4 -6
  11. package/dist/auth/identify.d.mts +1 -1
  12. package/dist/auth/identify.mjs +6 -0
  13. package/dist/auth/token-cleanup.mjs +2 -2
  14. package/dist/auth/token-rows.mjs +6 -1
  15. package/dist/auth/token-text.mjs +1 -1
  16. package/dist/auth/tokens-base.d.mts +1 -1
  17. package/dist/auth/tokens.d.mts +1 -1
  18. package/dist/auth/tokens.mjs +1 -1
  19. package/dist/client/client.d.mts +15 -7
  20. package/dist/client/client.mjs +21 -12
  21. package/dist/client/git-http.mjs +1 -1
  22. package/dist/client/local.mjs +60 -24
  23. package/dist/client/negotiate.mjs +3 -3
  24. package/dist/client/push-upload.mjs +26 -10
  25. package/dist/client/remote.mjs +4 -3
  26. package/dist/client/run-remote-helper.d.mts +2 -2
  27. package/dist/client/run-remote-helper.mjs +6 -6
  28. package/dist/client/slice-push.d.mts +1 -1
  29. package/dist/client/transport.mjs +3 -3
  30. package/dist/contracts/blobs.d.mts +3 -3
  31. package/dist/contracts/blobs.mjs +1 -1
  32. package/dist/contracts/calls-spent.mjs +5 -33
  33. package/dist/contracts/client.d.mts +15 -14
  34. package/dist/contracts/commits.d.mts +4 -4
  35. package/dist/contracts/commits.mjs +1 -1
  36. package/dist/contracts/engine.d.mts +2 -2
  37. package/dist/contracts/events.d.mts +1 -1
  38. package/dist/contracts/events.mjs +1 -1
  39. package/dist/contracts/files.d.mts +4 -4
  40. package/dist/contracts/files.mjs +1 -1
  41. package/dist/contracts/forks.d.mts +4 -4
  42. package/dist/contracts/forks.mjs +1 -1
  43. package/dist/contracts/git-hooks.d.mts +1 -1
  44. package/dist/contracts/git.d.mts +9 -5
  45. package/dist/contracts/grants.d.mts +1 -1
  46. package/dist/contracts/merges.d.mts +1 -1
  47. package/dist/contracts/object-values.d.mts +1 -0
  48. package/dist/contracts/object-values.mjs +16 -1
  49. package/dist/contracts/objects.d.mts +30 -18
  50. package/dist/contracts/opaque.mjs +1 -1
  51. package/dist/contracts/operations.mjs +1 -1
  52. package/dist/contracts/queue.d.mts +208 -44
  53. package/dist/contracts/queue.mjs +5 -5
  54. package/dist/contracts/refs.d.mts +5 -5
  55. package/dist/contracts/refs.mjs +1 -1
  56. package/dist/contracts/remote.d.mts +3 -6
  57. package/dist/contracts/repos.d.mts +3 -3
  58. package/dist/contracts/repos.mjs +1 -1
  59. package/dist/contracts/result.d.mts +10 -7
  60. package/dist/contracts/result.mjs +8 -3
  61. package/dist/contracts/rules.d.mts +13 -12
  62. package/dist/contracts/server.d.mts +8 -10
  63. package/dist/contracts/services.d.mts +6 -9
  64. package/dist/contracts/services.mjs +1 -2
  65. package/dist/contracts/signin.d.mts +1 -1
  66. package/dist/contracts/store.d.mts +2 -2
  67. package/dist/contracts/sync.d.mts +63 -6
  68. package/dist/contracts/sync.mjs +3 -2
  69. package/dist/contracts/tags.d.mts +3 -3
  70. package/dist/contracts/tags.mjs +1 -1
  71. package/dist/contracts/tokens.d.mts +2 -2
  72. package/dist/contracts/tokens.mjs +1 -1
  73. package/dist/contracts/topics.d.mts +9 -9
  74. package/dist/contracts/trees.d.mts +4 -4
  75. package/dist/contracts/trees.mjs +1 -1
  76. package/dist/contracts/work.d.mts +4 -4
  77. package/dist/contracts/work.mjs +2 -2
  78. package/dist/core/access.d.mts +1 -1
  79. package/dist/core/ancestry.mjs +30 -34
  80. package/dist/core/{promise.mjs → call-groups.mjs} +7 -30
  81. package/dist/core/call-services.mjs +1 -1
  82. package/dist/core/events/deliver.d.mts +2 -2
  83. package/dist/core/events/deliver.mjs +3 -3
  84. package/dist/core/events/retired.mjs +1 -1
  85. package/dist/core/forks.mjs +5 -5
  86. package/dist/core/hooks/groups.mjs +2 -2
  87. package/dist/core/imports.mjs +101 -21
  88. package/dist/core/index-job.mjs +14 -9
  89. package/dist/core/index-lost.d.mts +1 -1
  90. package/dist/core/loose-tally.mjs +38 -15
  91. package/dist/core/merge-parts.d.mts +17 -4
  92. package/dist/core/merge-parts.mjs +7 -2
  93. package/dist/core/mirror-rows.mjs +31 -1
  94. package/dist/core/objects/blobs.mjs +8 -10
  95. package/dist/core/objects/files.mjs +20 -17
  96. package/dist/core/objects/objects-layer.mjs +1 -1
  97. package/dist/core/objects/peel.mjs +1 -7
  98. package/dist/core/objects/reading.mjs +19 -18
  99. package/dist/core/objects/tree-edits.mjs +1 -1
  100. package/dist/core/objects/trees.mjs +257 -58
  101. package/dist/core/objects/writing.mjs +3 -9
  102. package/dist/core/own-writes.mjs +1 -1
  103. package/dist/core/parts.d.mts +8 -1
  104. package/dist/core/parts.mjs +8 -4
  105. package/dist/core/purge.mjs +31 -18
  106. package/dist/core/push.d.mts +2 -2
  107. package/dist/core/push.mjs +145 -98
  108. package/dist/core/receipts.d.mts +2 -2
  109. package/dist/core/receipts.mjs +9 -2
  110. package/dist/core/ref-index-job.mjs +4 -4
  111. package/dist/core/ref-view.mjs +74 -31
  112. package/dist/core/refs.mjs +3 -3
  113. package/dist/core/repack.mjs +25 -30
  114. package/dist/core/repo-info.mjs +1 -1
  115. package/dist/core/repos.mjs +1 -1
  116. package/dist/core/rules/changes.mjs +18 -40
  117. package/dist/core/rules/check.mjs +6 -5
  118. package/dist/core/rules/commit-changes.mjs +114 -58
  119. package/dist/core/rules/context.d.mts +3 -3
  120. package/dist/core/rules/context.mjs +18 -14
  121. package/dist/core/rules/fetch.mjs +1 -1
  122. package/dist/core/rules/protect.mjs +30 -17
  123. package/dist/core/saved-caller-views.d.mts +1 -1
  124. package/dist/core/saved-caller-views.mjs +3 -3
  125. package/dist/core/saved-callers.d.mts +1 -1
  126. package/dist/core/saved-callers.mjs +1 -1
  127. package/dist/core/seam.d.mts +1 -2
  128. package/dist/core/view.d.mts +6 -3
  129. package/dist/core/view.mjs +11 -10
  130. package/dist/core/work.mjs +2 -2
  131. package/dist/engine/allotted-xdiff.mjs +3 -16
  132. package/dist/engine/combined.d.mts +3 -0
  133. package/dist/engine/combined.mjs +200 -185
  134. package/dist/engine/content.d.mts +2 -2
  135. package/dist/engine/content.mjs +1 -1
  136. package/dist/engine/merge.mjs +7 -9
  137. package/dist/engine/reads.d.mts +2 -2
  138. package/dist/engine/reads.mjs +22 -14
  139. package/dist/engine/xdiff.d.mts +1 -1
  140. package/dist/engine/xdiff.mjs +1 -1
  141. package/dist/event-streams/event-streams.d.mts +1 -1
  142. package/dist/event-streams/event-streams.mjs +1 -1
  143. package/dist/event-streams/stream.d.mts +2 -2
  144. package/dist/event-streams/stream.mjs +3 -3
  145. package/dist/extend.d.mts +2 -6
  146. package/dist/extend.mjs +1 -5
  147. package/dist/http/core-parts.mjs +83 -26
  148. package/dist/http/handler.mjs +54 -9
  149. package/dist/http/parts.d.mts +1 -0
  150. package/dist/http/push-upload-job.mjs +138 -24
  151. package/dist/http/push-uploads.mjs +2 -2
  152. package/dist/http/receive-pack.mjs +14 -53
  153. package/dist/http/request-snapshot.mjs +258 -0
  154. package/dist/http/upload-pack.mjs +23 -18
  155. package/dist/index.d.mts +29 -21
  156. package/dist/index.mjs +11 -2
  157. package/dist/lfs/base.d.mts +1 -1
  158. package/dist/lfs/copy.d.mts +49 -1
  159. package/dist/lfs/copy.mjs +135 -22
  160. package/dist/lfs/layer.d.mts +4 -3
  161. package/dist/lfs/layer.mjs +4 -5
  162. package/dist/lfs/locks.mjs +2 -2
  163. package/dist/lfs/objects.d.mts +1 -1
  164. package/dist/lfs/objects.mjs +3 -3
  165. package/dist/lfs/pointers.mjs +1 -1
  166. package/dist/lfs/rows.d.mts +1 -1
  167. package/dist/lfs/rows.mjs +11 -4
  168. package/dist/lfs/upkeep.mjs +40 -9
  169. package/dist/lfs/uploaded.mjs +1 -1
  170. package/dist/lfs/wire.mjs +1 -1
  171. package/dist/merges/merges.mjs +17 -2
  172. package/dist/protocol/bytes/buffers.d.mts +1 -1
  173. package/dist/protocol/bytes/buffers.mjs +1 -1
  174. package/dist/protocol/bytes/deflate.d.mts +1 -1
  175. package/dist/protocol/bytes/deflate.mjs +1 -1
  176. package/dist/protocol/bytes/inflate.d.mts +1 -1
  177. package/dist/protocol/bytes/inflate.mjs +1 -1
  178. package/dist/protocol/bytes/sha1.d.mts +1 -1
  179. package/dist/protocol/bytes/sha1.mjs +1 -1
  180. package/dist/protocol/diff/read.d.mts +2 -1
  181. package/dist/protocol/diff/read.mjs +102 -8
  182. package/dist/protocol/packs/graph.mjs +1 -1
  183. package/dist/protocol/packs/idx.d.mts +1 -1
  184. package/dist/protocol/packs/idx.mjs +1 -1
  185. package/dist/protocol/packs/parts.mjs +1 -1
  186. package/dist/protocol/packs/reader.d.mts +1 -1
  187. package/dist/protocol/packs/reader.mjs +1 -1
  188. package/dist/protocol/packs/write-error.d.mts +1 -1
  189. package/dist/protocol/packs/write-error.mjs +1 -1
  190. package/dist/protocol/packs/writer.mjs +3 -3
  191. package/dist/protocol/wire/advertisement.d.mts +1 -1
  192. package/dist/protocol/wire/advertisement.mjs +3 -2
  193. package/dist/protocol/wire/fetch.d.mts +1 -1
  194. package/dist/protocol/wire/fetch.mjs +1 -1
  195. package/dist/protocol/wire/lines.d.mts +9 -1
  196. package/dist/protocol/wire/lines.mjs +28 -1
  197. package/dist/protocol/wire/push-uploads.mjs +10 -7
  198. package/dist/protocol/wire/receive-pack.d.mts +1 -1
  199. package/dist/protocol/wire/receive-pack.mjs +1 -1
  200. package/dist/protocol/wire/report-status.d.mts +1 -1
  201. package/dist/protocol/wire/report-status.mjs +1 -1
  202. package/dist/protocol/wire/v2.d.mts +1 -1
  203. package/dist/protocol/wire/v2.mjs +1 -1
  204. package/dist/queue/advance.mjs +31 -24
  205. package/dist/queue/base.d.mts +5 -3
  206. package/dist/queue/calls.mjs +5 -5
  207. package/dist/queue/commit.mjs +1 -1
  208. package/dist/queue/host.d.mts +1 -1
  209. package/dist/queue/layer.d.mts +0 -1
  210. package/dist/queue/layer.mjs +9 -5
  211. package/dist/queue/schedule.mjs +1 -1
  212. package/dist/queue/search.mjs +1 -1
  213. package/dist/queue/state.mjs +1 -1
  214. package/dist/queue/trim.mjs +2 -2
  215. package/dist/rest/client.d.mts +1 -1
  216. package/dist/rest/client.mjs +6 -6
  217. package/dist/rest/errors.mjs +1 -1
  218. package/dist/rest/handler.mjs +2 -2
  219. package/dist/rest/handlers.mjs +16 -6
  220. package/dist/rest/layer.mjs +1 -1
  221. package/dist/rest/listen.mjs +2 -2
  222. package/dist/rest/refs.mjs +1 -1
  223. package/dist/server/edge.mjs +27 -3
  224. package/dist/server/git-layer.d.mts +1 -2
  225. package/dist/server/git-layer.mjs +4 -5
  226. package/dist/server/lifecycle.mjs +1 -1
  227. package/dist/server/registry.mjs +2 -8
  228. package/dist/server/server.mjs +62 -43
  229. package/dist/signin/context.d.mts +1 -1
  230. package/dist/signin/context.mjs +1 -1
  231. package/dist/signin/forms.mjs +1 -1
  232. package/dist/signin/grants.d.mts +2 -2
  233. package/dist/signin/grants.mjs +1 -1
  234. package/dist/signin/wire.mjs +1 -1
  235. package/dist/storage/allotted.mjs +4 -9
  236. package/dist/storage/batch-upkeep.mjs +31 -12
  237. package/dist/storage/batches.d.mts +2 -3
  238. package/dist/storage/batches.mjs +52 -49
  239. package/dist/storage/budget.mjs +23 -1
  240. package/dist/storage/calls.d.mts +1 -1
  241. package/dist/storage/calls.mjs +41 -43
  242. package/dist/storage/charged-cache.mjs +180 -0
  243. package/dist/storage/chunks.d.mts +3 -3
  244. package/dist/storage/chunks.mjs +121 -8
  245. package/dist/storage/counted-bucket.mjs +32 -10
  246. package/dist/storage/fetch-row-cache.d.mts +6 -0
  247. package/dist/storage/fetch-row-cache.mjs +211 -0
  248. package/dist/storage/fetch.d.mts +1 -0
  249. package/dist/storage/fetch.mjs +54 -242
  250. package/dist/storage/held-types.d.mts +0 -1
  251. package/dist/storage/held-types.mjs +13 -4
  252. package/dist/storage/host-bucket.mjs +9 -4
  253. package/dist/storage/index-bitmaps.mjs +340 -65
  254. package/dist/storage/index-build.d.mts +2 -3
  255. package/dist/storage/index-build.mjs +274 -56
  256. package/dist/storage/index-fetch.d.mts +3 -1
  257. package/dist/storage/index-fetch.mjs +60 -21
  258. package/dist/storage/index-graph.mjs +1 -1
  259. package/dist/storage/index-layers.mjs +55 -25
  260. package/dist/storage/index-reach.mjs +15 -22
  261. package/dist/storage/index-whole.d.mts +7 -0
  262. package/dist/storage/index-whole.mjs +145 -37
  263. package/dist/storage/largest-files.mjs +1 -7
  264. package/dist/storage/layout.mjs +17 -1
  265. package/dist/storage/lfs-pointers.mjs +1 -6
  266. package/dist/storage/link-join.mjs +55 -16
  267. package/dist/storage/list-source.d.mts +7 -0
  268. package/dist/storage/list-source.mjs +288 -0
  269. package/dist/storage/loose.d.mts +8 -8
  270. package/dist/storage/loose.mjs +157 -91
  271. package/dist/storage/memory-budget.mjs +226 -22
  272. package/dist/storage/merge-cut.mjs +9 -6
  273. package/dist/storage/merge-fence.mjs +1 -1
  274. package/dist/storage/merge-row.mjs +1 -1
  275. package/dist/storage/merge.d.mts +2 -3
  276. package/dist/storage/merge.mjs +2 -2
  277. package/dist/storage/object-rows.d.mts +3 -3
  278. package/dist/storage/object-rows.mjs +179 -38
  279. package/dist/storage/pack-order.mjs +97 -44
  280. package/dist/storage/pack-ranges.mjs +44 -16
  281. package/dist/storage/pack-reads.d.mts +5 -3
  282. package/dist/storage/pack-reads.mjs +236 -72
  283. package/dist/storage/pack-receive.d.mts +1 -2
  284. package/dist/storage/pack-receive.mjs +24 -18
  285. package/dist/storage/packs.d.mts +1 -1
  286. package/dist/storage/packs.mjs +477 -116
  287. package/dist/storage/placed-reads.mjs +33 -16
  288. package/dist/storage/prune-seen.mjs +1 -1
  289. package/dist/storage/prune-walk.mjs +1 -1
  290. package/dist/storage/prune.mjs +4 -31
  291. package/dist/storage/push-allotment.mjs +26 -14
  292. package/dist/storage/push-uploads.mjs +195 -57
  293. package/dist/storage/pushed-commits.mjs +20 -1
  294. package/dist/storage/quarantine.d.mts +2 -3
  295. package/dist/storage/range-cache.mjs +175 -40
  296. package/dist/storage/raw-ids.mjs +39 -10
  297. package/dist/storage/ready.d.mts +2 -3
  298. package/dist/storage/ready.mjs +114 -38
  299. package/dist/storage/receive-bounds.mjs +31 -9
  300. package/dist/storage/receive-cache.d.mts +7 -0
  301. package/dist/storage/receive-cache.mjs +147 -0
  302. package/dist/storage/receive-files.mjs +1 -1
  303. package/dist/storage/receive-links.mjs +1 -1
  304. package/dist/storage/receive-state.d.mts +2 -2
  305. package/dist/storage/receive-state.mjs +6 -8
  306. package/dist/storage/receive-steps.d.mts +20 -0
  307. package/dist/storage/receive-steps.mjs +298 -13
  308. package/dist/storage/repack-backlog.mjs +1 -6
  309. package/dist/storage/repack-contained.mjs +2 -2
  310. package/dist/storage/repack-job.mjs +1 -1
  311. package/dist/storage/repack.d.mts +2 -3
  312. package/dist/storage/repack.mjs +54 -9
  313. package/dist/storage/request-cache.mjs +57 -0
  314. package/dist/storage/roots.mjs +1 -24
  315. package/dist/storage/rows.d.mts +2 -2
  316. package/dist/storage/rows.mjs +1 -1
  317. package/dist/storage/runs.d.mts +2 -2
  318. package/dist/storage/runs.mjs +1 -1
  319. package/dist/storage/send-list.mjs +62 -25
  320. package/dist/storage/stream-whole.mjs +84 -63
  321. package/dist/storage/swap-walk.mjs +1 -1
  322. package/dist/storage/unpack.mjs +878 -450
  323. package/dist/storage/visible.mjs +110 -32
  324. package/dist/storage/walk.mjs +1 -0
  325. package/dist/storage/wants.mjs +22 -58
  326. package/dist/store/call-count.d.mts +2 -2
  327. package/dist/store/call-count.mjs +24 -11
  328. package/dist/store/catalogue.d.mts +1 -1
  329. package/dist/store/catalogue.mjs +19 -7
  330. package/dist/store/crossing.mjs +1 -7
  331. package/dist/store/cursor-seal.d.mts +1 -1
  332. package/dist/store/cursor-seal.mjs +1 -1
  333. package/dist/store/door.mjs +9 -4
  334. package/dist/store/errors.d.mts +2 -2
  335. package/dist/store/errors.mjs +107 -19
  336. package/dist/store/git-store.mjs +7 -2
  337. package/dist/store/job-try.mjs +90 -9
  338. package/dist/store/list-job.mjs +10 -34
  339. package/dist/store/outbox.d.mts +2 -2
  340. package/dist/store/outbox.mjs +2 -2
  341. package/dist/store/queue-jobs.mjs +6 -12
  342. package/dist/store/records.d.mts +2 -2
  343. package/dist/store/records.mjs +2 -2
  344. package/dist/store/ref-rows.d.mts +2 -2
  345. package/dist/store/ref-rows.mjs +2 -2
  346. package/dist/store/repo-record.d.mts +2 -2
  347. package/dist/store/repo-record.mjs +3 -3
  348. package/dist/store/request-snapshot.mjs +5 -0
  349. package/dist/store/reservations.mjs +2 -2
  350. package/dist/store/topic-jobs.mjs +5 -11
  351. package/dist/sync/bound.d.mts +3 -3
  352. package/dist/sync/bound.mjs +10 -7
  353. package/dist/sync/github.mjs +65 -67
  354. package/dist/sync/http.mjs +1 -1
  355. package/dist/sync/import.mjs +201 -66
  356. package/dist/sync/layer.d.mts +1 -1
  357. package/dist/sync/layer.mjs +6 -6
  358. package/dist/sync/lfs-batch.mjs +1 -1
  359. package/dist/sync/lfs-copy.mjs +175 -15
  360. package/dist/sync/mirror.mjs +5 -10
  361. package/dist/sync/said.mjs +1 -1
  362. package/dist/sync/step.mjs +268 -86
  363. package/dist/sync/tries.mjs +25 -6
  364. package/dist/sync.d.mts +2 -2
  365. package/dist/sync.mjs +2 -2
  366. package/dist/topics/advance.mjs +3 -3
  367. package/dist/topics/calls.mjs +1 -1
  368. package/dist/topics/layer.d.mts +15 -14
  369. package/dist/topics/members.mjs +1 -1
  370. package/dist/topics/topic.mjs +1 -1
  371. package/package.json +3 -13
  372. package/dist/auth/helpers.mjs +0 -17
  373. package/dist/auth.d.mts +0 -5
  374. package/dist/auth.mjs +0 -5
  375. package/dist/core/rules/commit-changes.d.mts +0 -12
  376. package/dist/effect.d.mts +0 -9
  377. package/dist/effect.mjs +0 -7
  378. package/dist/server/joined.d.mts +0 -70
  379. package/dist/server/joined.mjs +0 -41
@@ -12,8 +12,8 @@ import { checkOwned } from "../queue/calls.mjs";
12
12
  import { admitMember } from "./members.mjs";
13
13
  import { TopicReportRow, unwaited } from "./rows.mjs";
14
14
  import { answeredFailure, commitTopic, currentSet, existing, failureOf, hintOf, readTopic, sameMembers, setKeyOf, topicOf } from "./topic.mjs";
15
- import * as Effect from "effect/Effect";
16
15
  import * as Schema from "effect/Schema";
16
+ import * as Effect from "effect/Effect";
17
17
  // src/topics/calls.ts
18
18
  /** The most members a topic has, as a candidate's entries. */
19
19
  const topicMembers = queueLimits.candidateEntries;
@@ -1,19 +1,18 @@
1
1
  import { TopicAddInput, TopicListInput, TopicReportInput, TopicsLayerOptions } from "../contracts/topics.mjs";
2
- import { GitError, Result } from "../contracts/result.mjs";
3
2
  import { ActorInput, Caller } from "../contracts/actors.mjs";
4
- import { EffectCalls } from "../contracts/services.mjs";
5
- import { MergeQueue, ReportResult } from "../contracts/queue.mjs";
6
- import "../effect.mjs";
3
+ import { Needing } from "../contracts/services.mjs";
7
4
  import { Authorize } from "../contracts/authorize.mjs";
8
5
  import { Events } from "../contracts/events.mjs";
9
6
  import { Git } from "../contracts/git.mjs";
7
+ import { MergeQueue } from "../contracts/queue.mjs";
8
+ import { GitError } from "../contracts/result.mjs";
10
9
  import { QueueInternals } from "../queue/host.mjs";
11
10
  import { TopicsBase, TopicsService } from "./base.mjs";
12
11
  import * as Effect from "effect/Effect";
13
12
  import * as Context from "effect/Context";
14
13
  import * as Layer from "effect/Layer";
15
- declare const Topics_base: Context.ServiceClass<Topics, "@ref0/git/Topics", EffectCalls<{
16
- readonly add: (input: TopicAddInput, by?: Caller<unknown> | undefined) => Promise<Result<{
14
+ declare const Topics_base: Context.ServiceClass<Topics, "@ref0/git/Topics", Needing<{
15
+ readonly add: (input: TopicAddInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
17
16
  readonly id: string;
18
17
  readonly key: string;
19
18
  readonly state: "checking" | "failed" | "merged" | "publishing" | "removed" | "reserving";
@@ -56,8 +55,8 @@ declare const Topics_base: Context.ServiceClass<Topics, "@ref0/git/Topics", Effe
56
55
  readonly topic?: string;
57
56
  readonly hold?: string;
58
57
  };
59
- }>>;
60
- readonly get: (topic: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Promise<Result<{
58
+ }, GitError, never>;
59
+ readonly get: (topic: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
61
60
  readonly id: string;
62
61
  readonly key: string;
63
62
  readonly state: "checking" | "failed" | "merged" | "publishing" | "removed" | "reserving";
@@ -100,8 +99,8 @@ declare const Topics_base: Context.ServiceClass<Topics, "@ref0/git/Topics", Effe
100
99
  readonly topic?: string;
101
100
  readonly hold?: string;
102
101
  };
103
- }>>;
104
- readonly list: (input: TopicListInput, by?: Caller<unknown> | undefined) => Promise<Result<import("@ref0/infra").Listing<{
102
+ }, GitError, never>;
103
+ readonly list: (input: TopicListInput, by?: Caller<unknown> | undefined) => Effect.Effect<import("@ref0/infra").Listing<{
105
104
  readonly id: string;
106
105
  readonly key: string;
107
106
  readonly state: "checking" | "failed" | "merged" | "publishing" | "removed" | "reserving";
@@ -144,8 +143,8 @@ declare const Topics_base: Context.ServiceClass<Topics, "@ref0/git/Topics", Effe
144
143
  readonly topic?: string;
145
144
  readonly hold?: string;
146
145
  };
147
- }>>>;
148
- readonly remove: (topic: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Promise<Result<{
146
+ }>, GitError, never>;
147
+ readonly remove: (topic: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
149
148
  readonly id: string;
150
149
  readonly key: string;
151
150
  readonly state: "checking" | "failed" | "merged" | "publishing" | "removed" | "reserving";
@@ -188,8 +187,10 @@ declare const Topics_base: Context.ServiceClass<Topics, "@ref0/git/Topics", Effe
188
187
  readonly topic?: string;
189
188
  readonly hold?: string;
190
189
  };
191
- }>>;
192
- readonly report: (topic: string, input: TopicReportInput, by?: Caller<unknown> | undefined) => Promise<ReportResult>;
190
+ }, GitError, never>;
191
+ readonly report: (topic: string, input: TopicReportInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
192
+ readonly repeat: boolean;
193
+ }, GitError, never>;
193
194
  }, never>>;
194
195
  export declare class Topics extends /* @__PURE__ */ Topics_base {}
195
196
  /** Topics across repos: owns its scopes and jobs; MergeQueue.layer supplies the queue internals. */
@@ -6,8 +6,8 @@ import { queueWrite } from "../queue/commit.mjs";
6
6
  import { QueuePlan, loadTarget } from "../queue/state.mjs";
7
7
  import { advanceAfter, isOpen, removeEntry } from "../queue/steps.mjs";
8
8
  import { isLive } from "../store/reservations.mjs";
9
- import * as Clock from "effect/Clock";
10
9
  import * as Effect from "effect/Effect";
10
+ import * as Clock from "effect/Clock";
11
11
  // src/topics/members.ts
12
12
  /**
13
13
  * A topic's work in its members' repos, each one commit in that repo's scope through the queue's
@@ -9,9 +9,9 @@ import { newChangeId, topicScope } from "../store/scopes.mjs";
9
9
  import { projectTopic } from "./directory.mjs";
10
10
  import { TopicRow } from "./rows.mjs";
11
11
  import { fail } from "../contracts/result.mjs";
12
- import * as Clock from "effect/Clock";
13
12
  import * as Effect from "effect/Effect";
14
13
  import * as Predicate from "effect/Predicate";
14
+ import * as Clock from "effect/Clock";
15
15
  // src/topics/topic.ts
16
16
  const readTopic = /* @__PURE__ */ Effect.fnUntraced(function* (id) {
17
17
  const snapshot = yield* (yield* TopicsHost).records.read(topicScope(id), [topicKey, ...outboxReads]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ref0/git",
3
- "version": "0.20.0",
3
+ "version": "0.26.0",
4
4
  "private": false,
5
5
  "description": "Git hosting as a library: a server, a client and their merges",
6
6
  "license": "Apache-2.0",
@@ -20,16 +20,6 @@
20
20
  "import": "./dist/index.mjs",
21
21
  "default": "./dist/index.mjs"
22
22
  },
23
- "./auth": {
24
- "types": "./dist/auth.d.mts",
25
- "import": "./dist/auth.mjs",
26
- "default": "./dist/auth.mjs"
27
- },
28
- "./effect": {
29
- "types": "./dist/effect.d.mts",
30
- "import": "./dist/effect.mjs",
31
- "default": "./dist/effect.mjs"
32
- },
33
23
  "./extend": {
34
24
  "types": "./dist/extend.d.mts",
35
25
  "import": "./dist/extend.mjs",
@@ -57,12 +47,12 @@
57
47
  }
58
48
  },
59
49
  "dependencies": {
60
- "@ref0/infra": "0.20.0",
50
+ "@ref0/infra": "0.26.0",
61
51
  "pako": "2.1.0"
62
52
  },
63
53
  "devDependencies": {
64
54
  "@effect/vitest": "4.1.7",
65
- "@ref0/xdiff-wasm": "0.20.0",
55
+ "@ref0/xdiff-wasm": "0.26.0",
66
56
  "effect": "4.1.7",
67
57
  "vite-plus": "1.8.0",
68
58
  "vitest": "5.1.1",
@@ -1,17 +0,0 @@
1
- import { credentialSecret } from "./credentials.mjs";
2
- import { sameHash, sha256Hex } from "./token-text.mjs";
3
- // src/auth/helpers.ts
4
- /** Whether `given` is `secret`, compared by hash so the time taken doesn't say where they differ. */
5
- const sameSecret = async (given, secret) => sameHash(await sha256Hex(given), await secret);
6
- /**
7
- * A check that knows one secret, as `actor`: sent as a Bearer token, or as Basic's password, as
8
- * Git sends one from its credential helper. `Auth.bearer` asks it, and a test's `auth` is it.
9
- */
10
- const bearer = (options) => {
11
- const secret = sha256Hex(options.token);
12
- return async ({ credentials }) => {
13
- if (credentials === void 0) return void 0;
14
- return await sameSecret(credentialSecret(credentials), secret) ? options.actor : void 0;
15
- };
16
- };
17
- export { bearer };
package/dist/auth.d.mts DELETED
@@ -1,5 +0,0 @@
1
- import { accessHeader } from "./auth/access-jwt.mjs";
2
- import { ghClientId } from "./signin/context.mjs";
3
- import { ghWriteScope } from "./contracts/signin.mjs";
4
- import { AccessTokenAnswer, DeviceCodeAnswer, deviceGrant, readAccessTokenAnswer, readDeviceCodeAnswer, signInPaths } from "./signin/wire.mjs";
5
- export { type AccessTokenAnswer, type DeviceCodeAnswer, accessHeader, deviceGrant, ghClientId, ghWriteScope, readAccessTokenAnswer, readDeviceCodeAnswer, signInPaths };
package/dist/auth.mjs DELETED
@@ -1,5 +0,0 @@
1
- import { accessHeader } from "./auth/access-jwt.mjs";
2
- import { ghClientId } from "./signin/context.mjs";
3
- import { ghWriteScope } from "./contracts/signin.mjs";
4
- import { deviceGrant, readAccessTokenAnswer, readDeviceCodeAnswer, signInPaths } from "./signin/wire.mjs";
5
- export { accessHeader, deviceGrant, ghClientId, ghWriteScope, readAccessTokenAnswer, readDeviceCodeAnswer, signInPaths };
@@ -1,12 +0,0 @@
1
- import "../../contracts/engine.mjs";
2
- import "../../contracts/ids.mjs";
3
- import "../../contracts/objects.mjs";
4
- import "../../contracts/refs.mjs";
5
- import { GitError } from "../../contracts/result.mjs";
6
- import "../../contracts/rules.mjs";
7
- import "../../contracts/store.mjs";
8
- import { WalkRefused } from "../../engine/combined.mjs";
9
- import "effect/Effect";
10
- import "effect/Stream";
11
- /** What a walk's stream fails with: Git's error, or its allotment's refusal, which a rule answers. */
12
- export type WalkFailure = GitError | WalkRefused;
package/dist/effect.d.mts DELETED
@@ -1,9 +0,0 @@
1
- import { EffectCalls, GitCaller, GitStore } from "./contracts/services.mjs";
2
- import { IndexCalls, IndexReachInput, IndexReached, IndexStatus, IndexTip, IndexTry, IndexTryInput } from "./contracts/objects.mjs";
3
- import { Actor } from "./contracts/actors.mjs";
4
- import { RepoName } from "./contracts/ids.mjs";
5
- import { CallAllowance } from "./contracts/call-allowance.mjs";
6
- import { CallBudget, CallBudgetOptions } from "./store/call-count.mjs";
7
- import { commitCallsMost, storeCall } from "./store/errors.mjs";
8
- import { bucketCall } from "./storage/calls.mjs";
9
- export { Actor, type CallAllowance, CallBudget, type CallBudgetOptions, type EffectCalls, GitCaller, GitStore, type IndexCalls, type IndexReachInput, type IndexReached, type IndexStatus, type IndexTip, type IndexTry, type IndexTryInput, RepoName, bucketCall, commitCallsMost, storeCall };
package/dist/effect.mjs DELETED
@@ -1,7 +0,0 @@
1
- import { GitCaller, GitStore } from "./contracts/services.mjs";
2
- import { Actor } from "./contracts/actors.mjs";
3
- import { RepoName } from "./contracts/ids.mjs";
4
- import { CallBudget } from "./store/call-count.mjs";
5
- import { commitCallsMost, storeCall } from "./store/errors.mjs";
6
- import { bucketCall } from "./storage/calls.mjs";
7
- export { Actor, CallBudget, GitCaller, GitStore, RepoName, bucketCall, commitCallsMost, storeCall };
@@ -1,70 +0,0 @@
1
- import { Caller } from "../contracts/actors.mjs";
2
- import { InternalRepoId, RepoName } from "../contracts/ids.mjs";
3
- import { Bucket, EffectiveLimits } from "../contracts/objects.mjs";
4
- import { QueueKeys } from "../contracts/queue.mjs";
5
- import { RepoRecord } from "../contracts/repos.mjs";
6
- import { GitError } from "../contracts/result.mjs";
7
- import { ServerCalls } from "../contracts/server.mjs";
8
- import { EffectCalls } from "../contracts/services.mjs";
9
- import { ImportStatus } from "../contracts/sync.mjs";
10
- import "../core/parts.mjs";
11
- import { CallAllowance } from "../contracts/call-allowance.mjs";
12
- import "../store/call-count.mjs";
13
- import * as Effect from "effect/Effect";
14
- import * as Context from "effect/Context";
15
- /** The host's bucket through the server's door, when the host provides one. */
16
- export interface JoinedAdapter {
17
- readonly bucket: Bucket | undefined;
18
- }
19
- /**
20
- * What a joined package reads beside Git's services: the calls `RepoRecords`, `Authorize` and
21
- * `Refs` don't make, each through the server's door. `Git.layer` provides it to the drop-in.
22
- */
23
- export interface Joined {
24
- readonly basePath: string;
25
- /** The server's one queue's `keys`, or `undefined` with no queue. */
26
- readonly queueKeys: QueueKeys | undefined;
27
- /**
28
- * Adds `check` to `Git.layer`'s seal, which runs it once every feature has built, after the push
29
- * rules' sources and before any job registers: a check that dies fails the build with its defect.
30
- * One added after the seal is a defect. The drop-in's check of the queue's keys is one (#2313).
31
- */
32
- readonly addSealCheck: (check: Effect.Effect<void>) => Effect.Effect<void>;
33
- readonly adapter: JoinedAdapter;
34
- /**
35
- * The server's `fetchLimits`: core's purge drops a deleted repo's scopes, its joined package's
36
- * too, no sooner than `milliseconds` past the delete, so a write that read the repo live and
37
- * commits within that, less `jobLeaseMargin`, commits before the drop.
38
- */
39
- readonly fetchLimits: EffectiveLimits;
40
- /**
41
- * A request's budget: the adapter's `callLimits`, named `request`. Made before `identify`, so the
42
- * sign-in read counts into it too (#725).
43
- */
44
- readonly request: () => CallAllowance;
45
- /**
46
- * A caller's Effect calls. With `budget`, a call with no `CallBudget` in scope counts into it, and
47
- * one with a budget in scope counts into that one alone: a budget made inside `budget`, as the
48
- * drop-in's search and review budgets are, nests in it, so its calls count into both.
49
- */
50
- readonly effectCallsFor: (caller: Caller, budget?: CallAllowance) => EffectCalls<ServerCalls>;
51
- readonly effectHostCalls: EffectCalls<ServerCalls>;
52
- /**
53
- * `effect` through the door, where a spent bound is its refusal: counted into `budget` when given
54
- * and no budget is in scope.
55
- */
56
- readonly effectRun: <A>(effect: Effect.Effect<A, GitError>, budget?: CallAllowance) => Effect.Effect<A, GitError>;
57
- /** The repo `repo` names now: `NOT_FOUND` naming a rename's new name for one renamed. */
58
- readonly internalId: (repo: RepoName) => Effect.Effect<InternalRepoId, GitError>;
59
- /** The record of the repo `internalId` holds, as a host reads it: `undefined` once it's gone. */
60
- readonly record: (internalId: InternalRepoId) => Effect.Effect<RepoRecord | undefined, GitError>;
61
- /**
62
- * The repo's `sync.import`, as `ImportStatus` says: its state, and the Git LFS objects it copied
63
- * and missed, on a server with `Lfs.layer`. `undefined` for a repo no import made.
64
- */
65
- readonly importState: (internalId: InternalRepoId) => Effect.Effect<ImportStatus | undefined, GitError>;
66
- }
67
- declare const JoinedCalls_base: Context.ServiceClass<JoinedCalls, "@ref0/git/JoinedCalls", Joined>;
68
- /** A joined package's `Joined`, which `Git.layer` provides. */
69
- export declare class JoinedCalls extends /* @__PURE__ */ JoinedCalls_base {}
70
- export {};
@@ -1,41 +0,0 @@
1
- import { importStateOf } from "../core/imports.mjs";
2
- import { CoreParts } from "../core/parts.mjs";
3
- import { aroundCalls, guardedCall } from "../core/promise.mjs";
4
- import { CallBudget, requestBudget } from "../store/call-count.mjs";
5
- import { noCall, syncIn } from "../store/crossing.mjs";
6
- import { hostRecordOf, internalIdOf } from "../store/catalogue.mjs";
7
- import * as Effect from "effect/Effect";
8
- import * as Option from "effect/Option";
9
- import * as Context from "effect/Context";
10
- // src/server/joined.ts
11
- /** A joined package's `Joined`, which `Git.layer` provides. */
12
- var JoinedCalls = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/JoinedCalls")) {};
13
- /** `effect`, counted into `budget` unless a budget is in scope, which nests in it. */
14
- const within = (budget) => (effect) => Effect.flatMap(Effect.serviceOption(CallBudget), (inScope) => Option.isSome(inScope) ? effect : Effect.provideService(effect, CallBudget, budget));
15
- /** The server's `Joined`, over `built`, what its build made. */
16
- const joinedOf = (attached, built) => {
17
- const { through } = attached;
18
- const { store } = Context.get(built.needs, CoreParts);
19
- const guarded = guardedCall(through);
20
- const effectRun = (effect, budget) => guarded(budget === void 0 ? effect : within(budget)(effect));
21
- return {
22
- basePath: attached.basePath,
23
- get queueKeys() {
24
- return attached.queueKeys;
25
- },
26
- addSealCheck: attached.addSealCheck,
27
- adapter: built.adapter,
28
- fetchLimits: attached.fetchLimits,
29
- request: () => syncIn(requestBudget(built.requestMost), noCall),
30
- effectCallsFor: (caller, budget) => {
31
- const made = attached.effectCallsFor(caller);
32
- return budget === void 0 ? made : aroundCalls(made, within(budget));
33
- },
34
- effectHostCalls: attached.effectHostCalls,
35
- effectRun,
36
- internalId: (repo) => effectRun(internalIdOf(store, repo)),
37
- record: (internalId) => effectRun(hostRecordOf(store, internalId)),
38
- importState: (internalId) => effectRun(importStateOf(store, internalId))
39
- };
40
- };
41
- export { JoinedCalls, joinedOf };