@ref0/git 0.12.0 → 0.20.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.
- package/dist/access/private-refs.mjs +3 -3
- package/dist/auth/access-jwt.mjs +2 -2
- package/dist/auth/auth.d.mts +2 -2
- package/dist/auth/auth.mjs +3 -6
- package/dist/auth/authorize.mjs +4 -20
- package/dist/auth/fences.d.mts +1 -2
- package/dist/auth/fences.mjs +3 -3
- package/dist/auth/grants.mjs +4 -4
- package/dist/auth/helpers.mjs +3 -11
- package/dist/auth/host-function.mjs +18 -1
- package/dist/auth/host-services.mjs +11 -0
- package/dist/auth/identify.d.mts +1 -1
- package/dist/auth/identify.mjs +3 -3
- package/dist/auth/policy.d.mts +27 -7
- package/dist/auth/policy.mjs +8 -4
- package/dist/auth/token-cleanup.mjs +67 -0
- package/dist/auth/token-rows.mjs +1 -1
- package/dist/auth/token-text.mjs +9 -1
- package/dist/auth/tokens-base.d.mts +35 -0
- package/dist/auth/tokens-base.mjs +13 -0
- package/dist/auth/tokens-layer.d.mts +2 -28
- package/dist/auth/tokens-layer.mjs +6 -12
- package/dist/auth/tokens-public.d.mts +3 -3
- package/dist/auth/tokens.d.mts +7 -17
- package/dist/auth/tokens.mjs +9 -87
- package/dist/auth.d.mts +1 -4
- package/dist/auth.mjs +1 -3
- package/dist/client/answer.mjs +21 -42
- package/dist/client/client.d.mts +2 -4
- package/dist/client/git-http.mjs +35 -11
- package/dist/client/local.mjs +14 -13
- package/dist/client/push-upload.mjs +39 -12
- package/dist/client/remote.mjs +95 -31
- package/dist/client/run-remote-helper.d.mts +1 -0
- package/dist/client/run-remote-helper.mjs +58 -24
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/client/transport.mjs +105 -46
- package/dist/contracts/access.d.mts +8 -8
- package/dist/contracts/actors.d.mts +2 -34
- package/dist/contracts/blobs.d.mts +57 -10
- package/dist/contracts/blobs.mjs +16 -2
- package/dist/contracts/call-allowance.d.mts +13 -0
- package/dist/contracts/call-allowance.mjs +44 -0
- package/dist/contracts/calls-spent.mjs +8 -3
- package/dist/contracts/client.d.mts +23 -19
- package/dist/contracts/commits.d.mts +34 -26
- package/dist/contracts/commits.mjs +9 -1
- package/dist/contracts/engine.d.mts +6 -1
- package/dist/contracts/engine.mjs +10 -1
- package/dist/contracts/files.d.mts +12 -12
- package/dist/contracts/forks.d.mts +27 -17
- package/dist/contracts/git-events.d.mts +29 -1
- package/dist/contracts/git-hooks.d.mts +1 -1
- package/dist/contracts/git.d.mts +39 -7
- package/dist/contracts/git.mjs +3 -2
- package/dist/contracts/grants.d.mts +24 -4
- package/dist/contracts/handlers.d.mts +1 -1
- package/dist/contracts/lfs.d.mts +28 -9
- package/dist/contracts/merges.d.mts +3 -2
- package/dist/contracts/objects.d.mts +103 -35
- package/dist/contracts/operations.d.mts +3 -0
- package/dist/contracts/operations.mjs +12 -2
- package/dist/contracts/push-uploads.d.mts +44 -5
- package/dist/contracts/push-uploads.mjs +7 -3
- package/dist/contracts/queue.d.mts +40 -12
- package/dist/contracts/queue.mjs +3 -4
- package/dist/contracts/refs.d.mts +50 -25
- package/dist/contracts/remote.d.mts +6 -7
- package/dist/contracts/remote.mjs +5 -4
- package/dist/contracts/repo-records.d.mts +1 -0
- package/dist/contracts/repos.d.mts +106 -127
- package/dist/contracts/repos.mjs +33 -4
- package/dist/contracts/result.d.mts +49 -25
- package/dist/contracts/result.mjs +52 -11
- package/dist/contracts/rules.d.mts +22 -22
- package/dist/contracts/server.d.mts +37 -111
- package/dist/contracts/services.d.mts +1 -1
- package/dist/contracts/signin.d.mts +1 -1
- package/dist/contracts/store.d.mts +6 -5
- package/dist/contracts/sync.d.mts +90 -26
- package/dist/contracts/sync.mjs +45 -11
- package/dist/contracts/tags.d.mts +10 -10
- package/dist/contracts/time.d.mts +3 -0
- package/dist/contracts/{promises.mjs → time.mjs} +1 -1
- package/dist/contracts/tokens.d.mts +15 -22
- package/dist/contracts/tokens.mjs +3 -3
- package/dist/contracts/topics.d.mts +1 -6
- package/dist/contracts/trees.d.mts +12 -12
- package/dist/contracts/work.d.mts +87 -12
- package/dist/contracts/work.mjs +8 -1
- package/dist/core/access.d.mts +1 -2
- package/dist/core/access.mjs +46 -13
- package/dist/core/ancestry.d.mts +10 -0
- package/dist/core/ancestry.mjs +6 -6
- package/dist/core/asked.mjs +43 -5
- package/dist/core/call-names.mjs +7 -1
- package/dist/core/call-services.mjs +13 -4
- package/dist/core/events/deliver.d.mts +1 -2
- package/dist/core/events/deliver.mjs +48 -33
- package/dist/core/events/retired.mjs +119 -0
- package/dist/core/forks.mjs +931 -435
- package/dist/core/hooks/groups.mjs +1 -1
- package/dist/core/imports.mjs +159 -15
- package/dist/core/index-job.mjs +128 -37
- package/dist/core/index-lost.d.mts +1 -2
- package/dist/core/index-lost.mjs +2 -2
- package/dist/core/job-view.mjs +8 -9
- package/dist/core/loose-tally.mjs +1 -1
- package/dist/core/mirror-rows.mjs +19 -4
- package/dist/core/objects/blobs.mjs +129 -3
- package/dist/core/objects/commits.mjs +16 -6
- package/dist/core/objects/lines.mjs +2 -2
- package/dist/core/objects/merges.mjs +4 -1
- package/dist/core/objects/objects-layer.d.mts +1 -1
- package/dist/core/objects/objects-layer.mjs +3 -3
- package/dist/core/objects/reading.mjs +24 -13
- package/dist/core/objects/tags.mjs +4 -1
- package/dist/core/objects/trees.mjs +2 -2
- package/dist/core/objects/writing.mjs +2 -2
- package/dist/core/own-writes.mjs +1 -1
- package/dist/core/parts.d.mts +10 -6
- package/dist/core/parts.mjs +3 -11
- package/dist/core/promise.mjs +9 -12
- package/dist/core/purge.mjs +316 -42
- package/dist/core/push-decide.mjs +3 -1
- package/dist/core/push-files.d.mts +12 -0
- package/dist/core/push-files.mjs +225 -0
- package/dist/core/push-repo.d.mts +8 -0
- package/dist/core/push-repo.mjs +56 -0
- package/dist/core/push.d.mts +17 -0
- package/dist/core/push.mjs +153 -70
- package/dist/core/receipts.mjs +34 -13
- package/dist/core/ref-index-job.mjs +4 -4
- package/dist/core/ref-view.mjs +61 -7
- package/dist/core/refs.mjs +18 -13
- package/dist/core/registered-rows.mjs +2 -2
- package/dist/core/repack.mjs +46 -28
- package/dist/core/repo-info.mjs +19 -12
- package/dist/core/repos.mjs +50 -22
- package/dist/core/rules/commit-changes.d.mts +0 -1
- package/dist/core/saved-caller-views.d.mts +7 -2
- package/dist/core/saved-caller-views.mjs +2 -2
- package/dist/core/saved-callers.d.mts +19 -2
- package/dist/core/seam.d.mts +16 -26
- package/dist/core/seam.mjs +7 -28
- package/dist/core/tokens.mjs +1 -1
- package/dist/core/view.d.mts +6 -0
- package/dist/core/view.mjs +51 -26
- package/dist/core/work.mjs +105 -35
- package/dist/effect.d.mts +5 -12
- package/dist/effect.mjs +3 -10
- package/dist/engine/failures.mjs +2 -1
- package/dist/engine/reads.mjs +17 -10
- package/dist/engine/walk.mjs +4 -4
- package/dist/event-streams/event-streams.d.mts +1 -1
- package/dist/event-streams/event-streams.mjs +1 -1
- package/dist/event-streams/stream.d.mts +3 -3
- package/dist/event-streams/stream.mjs +38 -15
- package/dist/extend.d.mts +4 -5
- package/dist/extend.mjs +3 -2
- package/dist/http/answers.mjs +12 -7
- package/dist/http/core-parts.mjs +129 -64
- package/dist/http/handler.mjs +36 -9
- package/dist/http/node.d.mts +14 -1
- package/dist/http/node.mjs +61 -31
- package/dist/http/parts.d.mts +2 -0
- package/dist/http/push-upload-job.mjs +507 -0
- package/dist/http/push-uploads.d.mts +1 -0
- package/dist/http/push-uploads.mjs +142 -69
- package/dist/http/upload-pack.mjs +10 -9
- package/dist/index.d.mts +27 -28
- package/dist/index.mjs +5 -8
- package/dist/lfs/answer.mjs +37 -0
- package/dist/lfs/base.d.mts +9 -3
- package/dist/lfs/base.mjs +27 -2
- package/dist/lfs/copy.d.mts +60 -0
- package/dist/lfs/copy.mjs +109 -0
- package/dist/lfs/layer.d.mts +15 -1
- package/dist/lfs/layer.mjs +28 -13
- package/dist/lfs/locks.mjs +2 -2
- package/dist/lfs/objects.d.mts +7 -0
- package/dist/lfs/objects.mjs +152 -55
- package/dist/lfs/pointers.mjs +2 -2
- package/dist/lfs/rows.d.mts +13 -0
- package/dist/lfs/rows.mjs +42 -8
- package/dist/lfs/service.d.mts +1 -7
- package/dist/lfs/service.mjs +1 -9
- package/dist/lfs/upkeep.mjs +48 -14
- package/dist/lfs/upload-most.mjs +5 -5
- package/dist/lfs/wire.mjs +6 -31
- package/dist/merges/merges.mjs +2 -2
- package/dist/node.d.mts +3 -3
- package/dist/protocol/bytes/buffers.mjs +13 -5
- package/dist/protocol/bytes/reader.mjs +6 -1
- package/dist/protocol/bytes/sha256-hasher.d.mts +15 -0
- package/dist/protocol/bytes/sha256.d.mts +32 -0
- package/dist/protocol/bytes/sha256.mjs +105 -49
- package/dist/protocol/bytes/streams.mjs +27 -1
- package/dist/protocol/diff/read.d.mts +4 -3
- package/dist/protocol/diff/read.mjs +8 -3
- package/dist/protocol/objects/lfs-pointer.d.mts +14 -2
- package/dist/protocol/objects/lfs-pointer.mjs +1 -3
- package/dist/protocol/objects/links-raw.mjs +24 -10
- package/dist/protocol/objects/tag.d.mts +1 -1
- package/dist/protocol/objects/tree.mjs +23 -6
- package/dist/protocol/packs/delta.d.mts +6 -3
- package/dist/protocol/packs/delta.mjs +96 -32
- package/dist/protocol/packs/idx.d.mts +2 -1
- package/dist/protocol/packs/idx.mjs +22 -3
- package/dist/protocol/packs/parts.d.mts +4 -1
- package/dist/protocol/packs/parts.mjs +10 -7
- package/dist/protocol/packs/reader.d.mts +5 -0
- package/dist/protocol/packs/reader.mjs +3 -2
- package/dist/protocol/packs/writer.mjs +26 -8
- package/dist/protocol/wire/advertisement.mjs +9 -4
- package/dist/protocol/wire/lines.d.mts +4 -2
- package/dist/protocol/wire/lines.mjs +11 -5
- package/dist/protocol/wire/push-uploads.mjs +13 -1
- package/dist/protocol/wire/v2.mjs +2 -2
- package/dist/protocol.d.mts +3 -1
- package/dist/protocol.mjs +3 -1
- package/dist/queue/advance.mjs +22 -25
- package/dist/queue/base.d.mts +55 -0
- package/dist/queue/base.mjs +44 -0
- package/dist/queue/calls.mjs +51 -54
- package/dist/queue/commit.mjs +1 -1
- package/dist/queue/host.d.mts +2 -22
- package/dist/queue/host.mjs +2 -13
- package/dist/queue/layer.d.mts +2 -1
- package/dist/queue/layer.mjs +11 -4
- package/dist/queue/limits.mjs +2 -0
- package/dist/queue/push-option.mjs +9 -24
- package/dist/queue/schedule.mjs +1 -1
- package/dist/queue/state.mjs +2 -10
- package/dist/queue/trim.mjs +6 -4
- package/dist/rest/blobs.mjs +29 -5
- package/dist/rest/caller.d.mts +4 -4231
- package/dist/rest/caller.mjs +5 -1
- package/dist/rest/client.d.mts +15 -5
- package/dist/rest/client.mjs +23 -2
- package/dist/rest/events.mjs +1 -2
- package/dist/rest/handler.mjs +4 -57
- package/dist/rest/handlers.mjs +68 -9
- package/dist/rest/layer.d.mts +2 -2
- package/dist/rest/layer.mjs +7 -13
- package/dist/rest/me.d.mts +3 -428
- package/dist/rest/paths.mjs +1 -0
- package/dist/rest/work.mjs +8 -0
- package/dist/server/check-fetch.mjs +3 -3
- package/dist/server/edge-node.d.mts +14 -15
- package/dist/server/edge-node.mjs +12 -12
- package/dist/server/edge.d.mts +21 -7
- package/dist/server/edge.mjs +32 -11
- package/dist/server/extension.mjs +1 -1
- package/dist/server/git-layer.d.mts +6 -11
- package/dist/server/git-layer.mjs +29 -23
- package/dist/server/git-namespace.d.mts +5 -4
- package/dist/server/git-namespace.mjs +3 -2
- package/dist/server/joined.d.mts +21 -40
- package/dist/server/joined.mjs +11 -62
- package/dist/server/lifecycle.mjs +65 -69
- package/dist/server/registry.mjs +28 -3
- package/dist/server/server.mjs +245 -465
- package/dist/signin/context.d.mts +1 -2
- package/dist/signin/layer.d.mts +1 -1
- package/dist/signin/layer.mjs +1 -1
- package/dist/storage/allotted.mjs +18 -3
- package/dist/storage/batch-upkeep.mjs +274 -0
- package/dist/{core/purge.d.mts → storage/batches.d.mts} +4 -4
- package/dist/storage/batches.mjs +344 -0
- package/dist/storage/budget.mjs +2 -2
- package/dist/storage/calls.d.mts +1 -2
- package/dist/storage/calls.mjs +144 -158
- package/dist/storage/chunks.d.mts +9 -0
- package/dist/storage/chunks.mjs +297 -0
- package/dist/storage/clean-up.mjs +85 -19
- package/dist/storage/counted-bucket.mjs +4 -4
- package/dist/storage/fetch.d.mts +1 -0
- package/dist/storage/fetch.mjs +298 -216
- package/dist/storage/file-limits.mjs +24 -0
- package/dist/storage/host-bucket.mjs +1 -2
- package/dist/storage/id-mix.mjs +19 -5
- package/dist/storage/index-bitmaps.mjs +9 -2
- package/dist/storage/index-build.d.mts +1 -1
- package/dist/storage/index-build.mjs +185 -84
- package/dist/storage/index-fetch.mjs +128 -74
- package/dist/storage/index-files.d.mts +3 -0
- package/dist/storage/index-files.mjs +10 -5
- package/dist/storage/index-graph.mjs +72 -22
- package/dist/storage/index-reach.mjs +33 -5
- package/dist/storage/index-remap.mjs +208 -65
- package/dist/storage/index-shallow.mjs +5 -3
- package/dist/storage/index-whole.mjs +127 -0
- package/dist/storage/largest-files.mjs +48 -0
- package/dist/storage/layout.mjs +23 -0
- package/dist/storage/lfs-pointers.mjs +10 -1
- package/dist/storage/loose.d.mts +7 -4
- package/dist/storage/loose.mjs +214 -67
- package/dist/storage/memory-budget.mjs +44 -8
- package/dist/storage/merge-plan.mjs +3 -2
- package/dist/storage/merge-row.mjs +7 -1
- package/dist/storage/merge-stream.mjs +164 -25
- package/dist/storage/merge-walk.mjs +8 -4
- package/dist/storage/merge-write.mjs +1 -1
- package/dist/storage/merge.d.mts +1 -1
- package/dist/storage/merge.mjs +1 -1
- package/dist/storage/object-rows.d.mts +1 -0
- package/dist/storage/object-rows.mjs +385 -65
- package/dist/storage/oid-table.mjs +171 -0
- package/dist/storage/pack-order.mjs +8 -4
- package/dist/storage/pack-ranges.d.mts +1 -2
- package/dist/storage/pack-ranges.mjs +4 -5
- package/dist/storage/pack-reads.d.mts +2 -1
- package/dist/storage/pack-reads.mjs +165 -49
- package/dist/storage/pack-receive.d.mts +1 -1
- package/dist/storage/pack-receive.mjs +85 -27
- package/dist/storage/packs.d.mts +1 -1
- package/dist/storage/packs.mjs +172 -86
- package/dist/storage/placed-reads.mjs +1 -1
- package/dist/storage/plan-columns.d.mts +4 -0
- package/dist/storage/plan-columns.mjs +238 -0
- package/dist/storage/prune-keep.mjs +299 -37
- package/dist/storage/prune-walk.mjs +240 -62
- package/dist/storage/prune.mjs +749 -213
- package/dist/storage/push-allotment.mjs +91 -12
- package/dist/storage/push-uploads.mjs +40 -16
- package/dist/storage/pushed-commits.mjs +4 -2
- package/dist/storage/quarantine.d.mts +1 -1
- package/dist/storage/quarantine.mjs +9 -9
- package/dist/storage/range-cache.mjs +125 -8
- package/dist/storage/ready.d.mts +1 -1
- package/dist/storage/ready.mjs +55 -25
- package/dist/storage/receive-bounds.mjs +51 -15
- package/dist/storage/receive-state.mjs +8 -0
- package/dist/storage/receive-steps.mjs +71 -18
- package/dist/storage/repack-backlog.mjs +6 -3
- package/dist/storage/repack.d.mts +2 -2
- package/dist/storage/repack.mjs +1 -8
- package/dist/storage/rows.d.mts +1 -1
- package/dist/storage/rows.mjs +13 -2
- package/dist/storage/runs.mjs +195 -43
- package/dist/storage/send-list.d.mts +1 -0
- package/dist/storage/send-list.mjs +54 -10
- package/dist/storage/shallow.d.mts +1 -0
- package/dist/storage/shallow.mjs +26 -4
- package/dist/storage/single-flight.mjs +13 -7
- package/dist/storage/stream-whole.mjs +132 -28
- package/dist/storage/unpack.mjs +371 -79
- package/dist/storage/visible.mjs +31 -3
- package/dist/storage/walk.mjs +194 -39
- package/dist/storage/wants.mjs +5 -5
- package/dist/store/bodies.mjs +38 -0
- package/dist/store/call-count.d.mts +8 -12
- package/dist/store/call-count.mjs +34 -46
- package/dist/store/catalogue.d.mts +2 -2
- package/dist/store/catalogue.mjs +146 -35
- package/dist/store/crossing.mjs +1 -3
- package/dist/store/cursor-seal-namespace.d.mts +2 -0
- package/dist/store/cursor-seal-public.d.mts +5 -0
- package/dist/store/cursor-seal-public.mjs +5 -0
- package/dist/store/cursor-seal.d.mts +16 -3
- package/dist/store/cursor-seal.mjs +40 -18
- package/dist/store/door.mjs +183 -0
- package/dist/store/errors.d.mts +3 -4
- package/dist/store/errors.mjs +24 -34
- package/dist/store/git-store.mjs +25 -7
- package/dist/store/job-try.mjs +9 -32
- package/dist/store/list-job.mjs +44 -8
- package/dist/store/records.d.mts +5 -0
- package/dist/store/records.mjs +12 -6
- package/dist/store/repo-record.d.mts +10 -9
- package/dist/store/repo-record.mjs +123 -28
- package/dist/store/reservations.mjs +1 -1
- package/dist/store/scopes.mjs +21 -2
- package/dist/store/settle.mjs +4 -4
- package/dist/sync/bound.d.mts +2 -0
- package/dist/sync/bound.mjs +11 -2
- package/dist/sync/github.d.mts +6 -1
- package/dist/sync/github.mjs +56 -44
- package/dist/sync/http.mjs +36 -1
- package/dist/sync/import.mjs +32 -18
- package/dist/sync/layer.mjs +6 -2
- package/dist/sync/lfs-batch.mjs +118 -0
- package/dist/sync/lfs-copy.mjs +262 -0
- package/dist/sync/mirror.mjs +227 -151
- package/dist/sync/said.mjs +16 -37
- package/dist/sync/smart-http.mjs +4 -2
- package/dist/sync/step.mjs +58 -30
- package/dist/sync/tries.mjs +52 -21
- package/dist/sync.d.mts +2 -2
- package/dist/topics/advance.mjs +10 -11
- package/dist/topics/base.d.mts +15 -0
- package/dist/topics/base.mjs +8 -0
- package/dist/topics/host.mjs +2 -20
- package/dist/topics/layer.d.mts +4 -9
- package/dist/topics/layer.mjs +3 -4
- package/dist/topics/members.mjs +4 -4
- package/dist/topics/public.d.mts +2 -1
- package/dist/topics/topic.mjs +2 -2
- package/package.json +5 -9
- package/dist/auth/bridge.mjs +0 -30
- package/dist/auth/helpers.d.mts +0 -17
- package/dist/contracts/promises.d.mts +0 -39
- package/dist/core/call-names.d.mts +0 -3
- package/dist/core/clock.mjs +0 -18
- package/dist/core/registered-rows.d.mts +0 -5
- package/dist/core/repack.d.mts +0 -11
- package/dist/http/handler.d.mts +0 -2
- package/dist/lfs/calls.mjs +0 -26
- package/dist/rest/api.d.mts +0 -23
- package/dist/rest/blobs.d.mts +0 -825
- package/dist/rest/commits.d.mts +0 -3510
- package/dist/rest/errors.d.mts +0 -2104
- package/dist/rest/events.d.mts +0 -423
- package/dist/rest/files.d.mts +0 -1330
- package/dist/rest/forks.d.mts +0 -2136
- package/dist/rest/handler.d.mts +0 -21
- package/dist/rest/handlers.d.mts +0 -8
- package/dist/rest/merges.d.mts +0 -473
- package/dist/rest/queue.d.mts +0 -5861
- package/dist/rest/refs.d.mts +0 -2959
- package/dist/rest/repos.d.mts +0 -2539
- package/dist/rest/tags.d.mts +0 -1304
- package/dist/rest/tokens.d.mts +0 -2590
- package/dist/rest/topics.d.mts +0 -2204
- package/dist/rest/trees.d.mts +0 -1693
- package/dist/rest/work.d.mts +0 -1248
- package/dist/rest.d.mts +0 -2
- package/dist/rest.mjs +0 -1
- package/dist/server/lifecycle.d.mts +0 -2
- package/dist/server/registry.d.mts +0 -16
- package/dist/server/server.d.mts +0 -36
- package/dist/storage/repack-job.d.mts +0 -3
- package/dist/store/promises.d.mts +0 -11
- package/dist/store/promises.mjs +0 -327
- package/dist/topics/host.d.mts +0 -7
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Clock } from "./promises.mjs";
|
|
2
1
|
import { CallInput } from "./actors.mjs";
|
|
3
2
|
import { FencedPack } from "./events.mjs";
|
|
4
3
|
import { InternalRepoId, Oid } from "./ids.mjs";
|
|
@@ -7,6 +6,7 @@ import { RepoStats } from "./repos.mjs";
|
|
|
7
6
|
import { GitError, Result } from "./result.mjs";
|
|
8
7
|
import { EffectCalls } from "./services.mjs";
|
|
9
8
|
import { GitStore, Holding, Listed, Pack } from "./store.mjs";
|
|
9
|
+
import * as Clock from "effect/Clock";
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
11
11
|
import { Bucket, BucketLinks, BucketUploads, CallLimits, Key, Listing, Moment, Page, Row } from "@ref0/infra";
|
|
12
12
|
export interface EffectiveLimits {
|
|
@@ -212,11 +212,11 @@ export interface ReceiveInput extends CallInput {
|
|
|
212
212
|
readonly cutMost?: number;
|
|
213
213
|
}
|
|
214
214
|
/**
|
|
215
|
-
*
|
|
216
|
-
* and the boundary, needs and cut's most
|
|
217
|
-
*
|
|
215
|
+
* A pack to stage for its receive in steps, an import segment's or a push upload's: its bytes, as
|
|
216
|
+
* `receive` takes them, and the boundary, needs and cut's most, or the shallow lines, its steps
|
|
217
|
+
* check as `ReceiveInput` says. Sync's import and a push upload's job stage one.
|
|
218
218
|
*/
|
|
219
|
-
export type StageInput = Omit<ReceiveInput, 'partial'
|
|
219
|
+
export type StageInput = Omit<ReceiveInput, 'partial'>;
|
|
220
220
|
/** A segment's pack staged: its ID, which each step and the landing name, and its bytes. */
|
|
221
221
|
export interface Staged {
|
|
222
222
|
readonly pack: string;
|
|
@@ -234,6 +234,29 @@ export interface StepInput extends CallInput {
|
|
|
234
234
|
readonly pack: string;
|
|
235
235
|
readonly objects: number;
|
|
236
236
|
readonly needs?: readonly Oid[];
|
|
237
|
+
/**
|
|
238
|
+
* The bytes a streaming step reads before it pauses, a push upload's `pushStepBytesOf` its host's
|
|
239
|
+
* CPU: its pack then streams in as many steps as that takes. A step pauses only between entries,
|
|
240
|
+
* so it reads its share and at most the entry it's in, a blob past the share whole. With none,
|
|
241
|
+
* an import segment's eighth, in at most `receiveStreamStepsMost`.
|
|
242
|
+
*/
|
|
243
|
+
readonly share?: number;
|
|
244
|
+
/**
|
|
245
|
+
* The step lists the push's largest blobs, carried from step to step, as `Quarantine.largest`:
|
|
246
|
+
* core then names a file past `pushes.files`' sizes by its path whichever way the push came
|
|
247
|
+
* (#2468). It reads an entry whole to four times its `share`, what the try's CPU leaves past the
|
|
248
|
+
* share, 240 MiB at Workers' 30 s, and refuses a larger one at its header, by its offset in the
|
|
249
|
+
* pack, before reading it: one step can't read it whole within its CPU, so a file from 240 MiB
|
|
250
|
+
* to 1 GiB at 30 s is refused by its offset rather than its path. It also pauses between
|
|
251
|
+
* entries once it has inflated 12 shares, its entries' data and its deltas' results, though it
|
|
252
|
+
* read less than its share, so with one more delta it stays within its try's CPU before its
|
|
253
|
+
* state's reads and its commit, and resolves each delta to its largest entry where that's under
|
|
254
|
+
* 16 MiB, a chain still to 16 MiB in all, refusing a larger one `delta-too-large` with a message
|
|
255
|
+
* that names that smaller limit (#2500).
|
|
256
|
+
* A push upload's steps set it. Left out, as an import's are, a file past 100 MiB is refused as
|
|
257
|
+
* it's read, by its offset. A host whose own objects ignore it keeps refusing by offset.
|
|
258
|
+
*/
|
|
259
|
+
readonly largest?: true;
|
|
237
260
|
}
|
|
238
261
|
/**
|
|
239
262
|
* What one step of a staged receive ended at: paused, with the step its next try runs, or the
|
|
@@ -309,6 +332,20 @@ export interface Quarantine {
|
|
|
309
332
|
* parse isn't listed. A receive past `lfsPointersMost` of them is refused.
|
|
310
333
|
*/
|
|
311
334
|
readonly lfsPointers: LfsPointers;
|
|
335
|
+
/**
|
|
336
|
+
* The push's largest blobs, each with its size, its result's for a delta, largest first: at most
|
|
337
|
+
* `largestFilesMost` (64), so the largest is always among them. Core holds a push to its file
|
|
338
|
+
* limits by them (#2395). A push upload's receive in steps lists them too, carried from one step
|
|
339
|
+
* to the next, as `StepInput.largest` says (#2468). Left out by an import's receive in steps, and
|
|
340
|
+
* by a storage that doesn't say: no file of such a push is held to a limit past what its storage
|
|
341
|
+
* reads.
|
|
342
|
+
*/
|
|
343
|
+
readonly largest?: readonly LargeFile[];
|
|
344
|
+
/**
|
|
345
|
+
* Whether `largest` left out blobs no larger than its last, the push holding more than
|
|
346
|
+
* `largestFilesMost`: when each listed is past a limit, others may be too, and a refusal says so.
|
|
347
|
+
*/
|
|
348
|
+
readonly largestPartial?: boolean;
|
|
312
349
|
/** What the storage keeps for the push's rules, when it keeps any: core releases it. */
|
|
313
350
|
readonly allotment?: Allotment;
|
|
314
351
|
/**
|
|
@@ -334,6 +371,11 @@ export interface Quarantine {
|
|
|
334
371
|
*/
|
|
335
372
|
readonly cut?: readonly SegmentCut[];
|
|
336
373
|
}
|
|
374
|
+
/** A blob a receive took, by its ID, and its size in bytes, as `git cat-file -s` gives it. */
|
|
375
|
+
export interface LargeFile {
|
|
376
|
+
readonly oid: Oid;
|
|
377
|
+
readonly size: number;
|
|
378
|
+
}
|
|
337
379
|
/**
|
|
338
380
|
* Where a receive's links resolved. A pack counts outside cruft while it's listed and isn't cruft;
|
|
339
381
|
* a row while it's still there, since only a pass step deletes a row whose object it leaves in
|
|
@@ -366,8 +408,18 @@ export interface ObjectsFetchInput extends CallInput {
|
|
|
366
408
|
* fetch.
|
|
367
409
|
*/
|
|
368
410
|
readonly thin?: true;
|
|
411
|
+
/**
|
|
412
|
+
* The repo's roots, read in the same snapshot as the refs the request names: storage's walks see
|
|
413
|
+
* each as a commit with no parents, and its answer names those its pack sends as `shallow`.
|
|
414
|
+
* Absent, the repo has none.
|
|
415
|
+
*/
|
|
416
|
+
readonly roots?: readonly Oid[];
|
|
369
417
|
}
|
|
370
418
|
export interface FetchAnswer {
|
|
419
|
+
/**
|
|
420
|
+
* The commits the client is to hold without their parents: those the request's depth cuts at,
|
|
421
|
+
* and the repo's roots its pack sends, as Git's server names a shallow repo's own.
|
|
422
|
+
*/
|
|
371
423
|
readonly shallow: readonly Oid[];
|
|
372
424
|
readonly unshallow: readonly Oid[];
|
|
373
425
|
readonly objects: number;
|
|
@@ -474,10 +526,12 @@ export interface MaintainInput extends CallInput {
|
|
|
474
526
|
*/
|
|
475
527
|
readonly steps?: 'prune' | 'others';
|
|
476
528
|
/**
|
|
477
|
-
*
|
|
478
|
-
* more: a prune pass's merge under way is dropped then, never yielded to
|
|
529
|
+
* When the repo was deleted, for a deleted repo, whose `repack` row's run takes its packs out and
|
|
530
|
+
* whose pass runs no more: a prune pass's merge under way is dropped then, never yielded to, and
|
|
531
|
+
* clean-up abandons each open `quarantine` row by the delete's `fetchLimits`, not its own
|
|
532
|
+
* `removeAt`; the `staged` row each leaves still waits its grace after (#1558).
|
|
479
533
|
*/
|
|
480
|
-
readonly deleted?:
|
|
534
|
+
readonly deleted?: Moment;
|
|
481
535
|
}
|
|
482
536
|
/**
|
|
483
537
|
* One step of upkeep, its change for the core to commit. `more`: another step is due now. `due`:
|
|
@@ -594,19 +648,19 @@ export interface ObjectsOpenInput<NeedsBucket extends boolean = boolean> {
|
|
|
594
648
|
*/
|
|
595
649
|
readonly store: EffectCalls<GitStore>;
|
|
596
650
|
readonly bucket: NeedsBucket extends true ? Bucket$1 : Bucket$1 | undefined;
|
|
597
|
-
|
|
651
|
+
/** The host's Effect `Clock` service (`effect/Clock`). */
|
|
652
|
+
readonly clock: Clock.Clock;
|
|
598
653
|
readonly fetchLimits: EffectiveLimits;
|
|
599
654
|
/**
|
|
600
|
-
* The most calls a fetch may make: the adapter's `callLimits` less `requestCallsBefore`.
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
* Promise, which no request's context crosses (#647, #709).
|
|
655
|
+
* The most calls a fetch may make: the adapter's `callLimits` less `requestCallsBefore`. A Git
|
|
656
|
+
* fetch's whole request counts against them, its negotiation with its pack: each call of the
|
|
657
|
+
* objects runs in its caller's fiber, so its store and bucket calls count into that request.
|
|
604
658
|
*/
|
|
605
659
|
readonly callLimits?: CallLimits.CallLimits['Service'];
|
|
606
660
|
}
|
|
607
661
|
/**
|
|
608
662
|
* How bytes are kept: `packs()` or `loose()`. `needsBucket` carries the requirement, and
|
|
609
|
-
* `
|
|
663
|
+
* `Git.layer` opens it once per server, keeping no state for any one repo.
|
|
610
664
|
*/
|
|
611
665
|
export interface ObjectsFactory<NeedsBucket extends boolean = boolean> {
|
|
612
666
|
readonly needsBucket: NeedsBucket;
|
|
@@ -616,10 +670,9 @@ export interface ObjectsFactory<NeedsBucket extends boolean = boolean> {
|
|
|
616
670
|
*/
|
|
617
671
|
readonly indexed?: true;
|
|
618
672
|
/**
|
|
619
|
-
* The objects for `input`'s server. A host may wrap what `packs()` or `loose()` opens,
|
|
620
|
-
*
|
|
621
|
-
*
|
|
622
|
-
* `{ ...opened }` does, keeps them counted.
|
|
673
|
+
* The objects for `input`'s server. A host may wrap what `packs()` or `loose()` opens, or bring
|
|
674
|
+
* its own: each call is an Effect Git's core runs in its caller's fiber, so the store and bucket
|
|
675
|
+
* calls it makes count toward the caller's request, and an interrupt stops it.
|
|
623
676
|
*/
|
|
624
677
|
readonly open: (input: ObjectsOpenInput<NeedsBucket>) => GitObjects;
|
|
625
678
|
}
|
|
@@ -661,7 +714,7 @@ export interface VisibleSet {
|
|
|
661
714
|
}
|
|
662
715
|
/**
|
|
663
716
|
* A server's opened objects that keep the reachability index, which a caller's view of a repo
|
|
664
|
-
* reads from: `
|
|
717
|
+
* reads from: `PrivateRefs.layer` takes only these.
|
|
665
718
|
*/
|
|
666
719
|
export interface IndexedObjects extends GitObjects {
|
|
667
720
|
/**
|
|
@@ -676,6 +729,17 @@ export interface IndexedObjects extends GitObjects {
|
|
|
676
729
|
* repo lacks.
|
|
677
730
|
*/
|
|
678
731
|
readonly seen: (set: VisibleSet) => GitObjects;
|
|
732
|
+
/**
|
|
733
|
+
* Which of `input.roots` the commits `input.tips` reach in `listed`, by the index `input.row`
|
|
734
|
+
* names, which a v0 listing tells as `shallow` lines to a caller who doesn't see every ref. A
|
|
735
|
+
* pure fast path: its answer is always the one a walk of the commits from the tips to its end
|
|
736
|
+
* gives, following no root's parents, and it's `undefined` where the index can't give it, as
|
|
737
|
+
* where none covers `listed`. A root the tips don't reach costs it no call. Without it, or where
|
|
738
|
+
* it's `undefined`, the server walks the visible commits to their end, within its want walk's
|
|
739
|
+
* 10,000 objects, and past that refuses the listing with `RESOURCE_EXHAUSTED`, reason
|
|
740
|
+
* `walk-limit`.
|
|
741
|
+
*/
|
|
742
|
+
readonly rootsReached?: (listed: Listed, input: VisibleInput) => Effect.Effect<ReadonlySet<Oid> | undefined, GitError>;
|
|
679
743
|
}
|
|
680
744
|
/** A commit a push brings, with its parents, as its receive listed it. */
|
|
681
745
|
export interface PushedCommit {
|
|
@@ -688,9 +752,8 @@ export interface PushedCommitsInput extends CallInput {
|
|
|
688
752
|
readonly page?: Page;
|
|
689
753
|
}
|
|
690
754
|
/**
|
|
691
|
-
* A server's opened objects, over each repo's `Listed
|
|
692
|
-
*
|
|
693
|
-
* so only `packs()`' count a Git fetch's negotiation with its pack (#709).
|
|
755
|
+
* A server's opened objects, over each repo's `Listed`, each call an Effect run in its caller's
|
|
756
|
+
* fiber: its store and bucket calls count into the caller's request, and an interrupt stops it.
|
|
694
757
|
*/
|
|
695
758
|
export interface GitObjects {
|
|
696
759
|
/**
|
|
@@ -701,7 +764,7 @@ export interface GitObjects {
|
|
|
701
764
|
/**
|
|
702
765
|
* The most objects one push may carry here, which receive-pack advertises as
|
|
703
766
|
* `ref0-push-objects=<most>`, so ref0's remote helper cuts a bigger push into slices that each
|
|
704
|
-
* fit (Q901): `packs()`' `
|
|
767
|
+
* fit (Q901): `packs()`' `pushObjectsMostOf` its memory, `loose()`'s `looseObjectsMost`. A host's own
|
|
705
768
|
* objects with none advertise none, and the helper pushes whole.
|
|
706
769
|
*/
|
|
707
770
|
readonly pushObjectsMost?: number;
|
|
@@ -712,7 +775,7 @@ export interface GitObjects {
|
|
|
712
775
|
* never keeps it past its request or shares it between requests. Every read of the repo's
|
|
713
776
|
* objects is through a reader: a call that reads one object opens a reader of its own for it.
|
|
714
777
|
*/
|
|
715
|
-
readonly reader: (listed: Listed, input?: ObjectReaderInput) =>
|
|
778
|
+
readonly reader: (listed: Listed, input?: ObjectReaderInput) => Effect.Effect<ObjectReader, GitError>;
|
|
716
779
|
/**
|
|
717
780
|
* The commits a push brings, a page at a time, each once: those in its received packs, then
|
|
718
781
|
* those among its rows. A commit the client sent again is listed too: stock Git resends one the
|
|
@@ -721,15 +784,15 @@ export interface GitObjects {
|
|
|
721
784
|
* push's list, never all of it, so a walk of the push's commits needs no set of those it has
|
|
722
785
|
* seen. Every implementation serves it: a push's file rules read it.
|
|
723
786
|
*/
|
|
724
|
-
readonly pushedCommits: (listed: Listed, input: PushedCommitsInput) =>
|
|
725
|
-
readonly receive: (listed: Listed, input: ReceiveInput) =>
|
|
787
|
+
readonly pushedCommits: (listed: Listed, input: PushedCommitsInput) => Effect.Effect<Listing<PushedCommit>, GitError>;
|
|
788
|
+
readonly receive: (listed: Listed, input: ReceiveInput) => Effect.Effect<Quarantine, GitError>;
|
|
726
789
|
/**
|
|
727
790
|
* An import segment's pack staged under a quarantine of its own, its trailer checked, for its
|
|
728
791
|
* receive a step at a time: `packs()` stages it in its bucket. A pack cut short, past its
|
|
729
792
|
* `atMost`, or with a wrong trailer stages nothing. A host's own objects that omit `stage`
|
|
730
793
|
* receive each segment in one invocation, through `receive`, as before.
|
|
731
794
|
*/
|
|
732
|
-
readonly stage?: (listed: Listed, input: StageInput) =>
|
|
795
|
+
readonly stage?: (listed: Listed, input: StageInput) => Effect.Effect<Staged, GitError>;
|
|
733
796
|
/**
|
|
734
797
|
* One step of a staged segment's receive, within one invocation: it goes on from where the last
|
|
735
798
|
* step paused, and pauses again or ends with the pack received, as `receive` ends it. A step
|
|
@@ -737,22 +800,22 @@ export interface GitObjects {
|
|
|
737
800
|
* no try of that segment lands; a join refused `too-large` keeps it, for a try with more calls.
|
|
738
801
|
* A host's own objects that omit it receive each segment through `receive`, as `stage` says.
|
|
739
802
|
*/
|
|
740
|
-
readonly receiveStep?: (listed: Listed, input: StepInput) =>
|
|
741
|
-
readonly fetch: (listed: Listed, input: ObjectsFetchInput) =>
|
|
742
|
-
readonly maintain: (listed: Listed, input: MaintainInput) =>
|
|
803
|
+
readonly receiveStep?: (listed: Listed, input: StepInput) => Effect.Effect<StepAnswer, GitError>;
|
|
804
|
+
readonly fetch: (listed: Listed, input: ObjectsFetchInput) => Effect.Effect<FetchAnswer, GitError>;
|
|
805
|
+
readonly maintain: (listed: Listed, input: MaintainInput) => Effect.Effect<ObjectsStep | undefined, GitError>;
|
|
743
806
|
/**
|
|
744
807
|
* Keeps each of `listed`'s packs for `input.into` before a fork's commit lists them: `packs()`
|
|
745
808
|
* puts a marker on each, named by the fork's internal ID, so a source that lets one go leaves
|
|
746
809
|
* its bytes to the fork. `loose()` has no packs, and does nothing.
|
|
747
810
|
*/
|
|
748
|
-
readonly share: (listed: Listed, input: ShareInput) =>
|
|
811
|
+
readonly share: (listed: Listed, input: ShareInput) => Effect.Effect<void, GitError>;
|
|
749
812
|
/**
|
|
750
813
|
* Whether each of `input.holdings`' holders holds every object of the pack it names, by their
|
|
751
814
|
* `.idx` IDs: in order, within `input.most` reads, each holder's read once against all it names.
|
|
752
815
|
* A fork's sync unlists a copy only once it's walked held (Q903). `loose()` has no packs, and
|
|
753
816
|
* none.
|
|
754
817
|
*/
|
|
755
|
-
readonly holdings?: (listed: Listed, input: HoldingsInput) =>
|
|
818
|
+
readonly holdings?: (listed: Listed, input: HoldingsInput) => Effect.Effect<HoldingsWalked, GitError>;
|
|
756
819
|
/**
|
|
757
820
|
* A page of `listed`'s object rows at its version, in ID order, after `input.after`: of those,
|
|
758
821
|
* the rows `input.lacking` doesn't hold, read by the page's IDs, when it's given. A fork's
|
|
@@ -760,14 +823,14 @@ export interface GitObjects {
|
|
|
760
823
|
* (`no-copy-rows`). A view narrowed to a caller's set (`IndexedObjects.seen`) hasn't it: a copy
|
|
761
824
|
* reads the whole repo.
|
|
762
825
|
*/
|
|
763
|
-
readonly copyRows?: (listed: Listed, input: CopyRowsInput) =>
|
|
826
|
+
readonly copyRows?: (listed: Listed, input: CopyRowsInput) => Effect.Effect<CopyRowsPage, GitError>;
|
|
764
827
|
/** The reachability index's build (#597). `loose()` keeps no index, and has none. */
|
|
765
828
|
readonly index?: IndexCalls;
|
|
766
829
|
}
|
|
767
830
|
/** The reachability index's build, as `git.index` and the commits that save it call it. */
|
|
768
831
|
export interface IndexCalls {
|
|
769
832
|
/** One `git.index` try: the next step of the build under way in `input.data`, or a new one. */
|
|
770
|
-
readonly step: (listed: Listed, input: IndexTryInput) =>
|
|
833
|
+
readonly step: (listed: Listed, input: IndexTryInput) => Effect.Effect<IndexTry, GitError>;
|
|
771
834
|
/**
|
|
772
835
|
* What the repo's `index` row, `row`, says at `at` with `packs` listed, by their IDs: what a
|
|
773
836
|
* ref-moving commit saves, or why none. A refusal of a slice of a pack stands while that pack
|
|
@@ -785,7 +848,7 @@ export interface IndexCalls {
|
|
|
785
848
|
* bitmaps, within the read's allotment, once an instance. A tip the index doesn't hold, as a
|
|
786
849
|
* push's before its update, is walked until it meets the index.
|
|
787
850
|
*/
|
|
788
|
-
readonly reach: (listed: Listed, input: IndexReachInput) =>
|
|
851
|
+
readonly reach: (listed: Listed, input: IndexReachInput) => Effect.Effect<IndexReached, GitError>;
|
|
789
852
|
}
|
|
790
853
|
/**
|
|
791
854
|
* The index's answer to a want check: `answers` as `IndexCalls.reach` says, and `pastLimit`, the
|
|
@@ -885,6 +948,11 @@ export interface IndexTryInput extends CallInput {
|
|
|
885
948
|
readonly failed?: {
|
|
886
949
|
readonly reason: string;
|
|
887
950
|
};
|
|
951
|
+
/**
|
|
952
|
+
* The repo's roots, read at the same version as the tips and the row. Absent, it has none. An
|
|
953
|
+
* index built over other roots is stale: the try builds it again whole.
|
|
954
|
+
*/
|
|
955
|
+
readonly roots?: readonly Oid[];
|
|
888
956
|
/**
|
|
889
957
|
* This try follows a moved answer, so a moved listing counts as failed and the step updates.
|
|
890
958
|
* The job reads the tips, the listing and the row again at a fresh version before it sets it.
|
|
@@ -330,6 +330,9 @@ export declare const Operation: Schema.Union<readonly [Schema.Struct<{
|
|
|
330
330
|
readonly repo: Schema.String;
|
|
331
331
|
readonly name: Schema.optionalKey<Schema.String>;
|
|
332
332
|
readonly key: Schema.optionalKey<Schema.String>;
|
|
333
|
+
}>, Schema.Struct<{
|
|
334
|
+
readonly kind: Schema.Literal<"work.listById">;
|
|
335
|
+
readonly internalId: Schema.TemplateLiteral<readonly ["r_", Schema.String]>;
|
|
333
336
|
}>, Schema.Struct<{
|
|
334
337
|
readonly kind: Schema.Literal<"refs.private">;
|
|
335
338
|
readonly repo: Schema.String;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefName, RepoName, TopicId } from "./ids.mjs";
|
|
1
|
+
import { InternalRepoId, RefName, RepoName, TopicId } from "./ids.mjs";
|
|
2
2
|
import { CandidateId, EntryFields, EntryId, HoldId } from "./queue.mjs";
|
|
3
3
|
import { RefEdit, RefSource } from "./refs.mjs";
|
|
4
4
|
import { ActorId } from "./actors.mjs";
|
|
@@ -188,6 +188,15 @@ const WorkOperation = /* @__PURE__ */ Schema.Struct({
|
|
|
188
188
|
name: Schema.optionalKey(JobRef.fields.name),
|
|
189
189
|
key: Schema.optionalKey(JobRef.fields.key)
|
|
190
190
|
});
|
|
191
|
+
/**
|
|
192
|
+
* Admin-only: a repo's work by its internal ID, and works on a deleted record. `Policy.signedIn`
|
|
193
|
+
* refuses it to everyone, `NOT_ALLOWED`; only a host's own policy grants it, as `ref0-git init`'s
|
|
194
|
+
* does for its admin. No token scope's ceiling names it, and no name opens it, so it names no repo.
|
|
195
|
+
*/
|
|
196
|
+
const WorkByIdOperation = /* @__PURE__ */ Schema.Struct({
|
|
197
|
+
kind: Schema.Literal("work.listById"),
|
|
198
|
+
internalId: InternalRepoId
|
|
199
|
+
});
|
|
191
200
|
const Operation = /* @__PURE__ */ Schema.Union([
|
|
192
201
|
RepoOperation,
|
|
193
202
|
PushOperation,
|
|
@@ -203,7 +212,8 @@ const Operation = /* @__PURE__ */ Schema.Union([
|
|
|
203
212
|
QueueReleaseOperation,
|
|
204
213
|
TopicOperation,
|
|
205
214
|
WorkOperation,
|
|
215
|
+
WorkByIdOperation,
|
|
206
216
|
RefsPrivateOperation,
|
|
207
217
|
MeOperation
|
|
208
218
|
]);
|
|
209
|
-
export { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TokenRevokeOperation, TopicOperation, WorkOperation };
|
|
219
|
+
export { BypassOperation, FilesAllowOperation, ForkOperation, MeOperation, Operation, PushOperation, QueueAddOperation, QueueCandidateOperation, QueueEntryOperation, QueueReleaseOperation, QueueTargetOperation, RefsPrivateOperation, RepoListOperation, RepoOperation, TokenCreateOperation, TokenOperation, TokenParties, TokenRevokeOperation, TopicOperation, WorkByIdOperation, WorkOperation };
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* How a server takes pushes: a large one's pack can go straight to the bucket, and its files and
|
|
4
|
+
* its repo are held to sizes.
|
|
5
|
+
*/
|
|
3
6
|
export interface PushOptions {
|
|
4
|
-
readonly upload
|
|
7
|
+
readonly upload?: PushUploadOptions;
|
|
8
|
+
readonly files?: PushFileOptions;
|
|
9
|
+
readonly repo?: PushRepoOptions;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The sizes a repo a push lands in is held to, in bytes of its `RepoStats.ownBytes` once the push
|
|
13
|
+
* lands, which leaves Git LFS out (#2395). Past `warnAbove`, 5 GiB by default as GitHub advises, or
|
|
14
|
+
* `false` for none, every Git push that lands is told on band 2; an API write lands with no
|
|
15
|
+
* warning, as with a file's. Past `refuseAbove`, which has no default, a push or an API write that
|
|
16
|
+
* adds bytes is refused, `repo-too-large`; one that only deletes or moves refs still lands.
|
|
17
|
+
* `warnAbove` is below `refuseAbove` when both are set.
|
|
18
|
+
*/
|
|
19
|
+
export interface PushRepoOptions {
|
|
20
|
+
readonly warnAbove?: number | false;
|
|
21
|
+
readonly refuseAbove?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The sizes a pushed file is held to, in bytes, as GitHub holds them (#2395). A push carrying a
|
|
25
|
+
* file past `refuseAbove`, 100 MiB by default, is refused: each ref is told why, with the file's
|
|
26
|
+
* path, its size and how to track it with Git LFS. One past `warnAbove`, 50 MiB by default, or
|
|
27
|
+
* `false` for none, is taken, and a Git push is told on band 2; an API write gets no warning.
|
|
28
|
+
* `refuseAbove` is at most 1 GiB, a push's pack's own bound, and `warnAbove` is below it. A blob
|
|
29
|
+
* pushed whole counts, though `.gitattributes` names it for Git LFS. A push uploaded in steps is
|
|
30
|
+
* held to these as a streamed one is, but a file past what its step's CPU reads, as
|
|
31
|
+
* `StepInput.largest` says, is refused by its offset (#2468). An import received in steps, as
|
|
32
|
+
* `packs()` stages one, refuses a file past 100 MiB as it reads it, whatever these say.
|
|
33
|
+
*/
|
|
34
|
+
export interface PushFileOptions {
|
|
35
|
+
readonly warnAbove?: number | false;
|
|
36
|
+
readonly refuseAbove?: number;
|
|
5
37
|
}
|
|
6
38
|
/**
|
|
7
39
|
* A push whose pack is larger than `above` bytes may upload it to the bucket in parts, past the
|
|
@@ -50,8 +82,10 @@ export declare const PushUploadPart: Schema.Struct<{
|
|
|
50
82
|
export type PushUploadPart = typeof PushUploadPart.Type;
|
|
51
83
|
/**
|
|
52
84
|
* `POST <repo>/push-uploads/{upload}/complete`, with each part's number and ETag in order, as the
|
|
53
|
-
* bucket's `UploadPart`.
|
|
54
|
-
*
|
|
85
|
+
* bucket's `UploadPart`. The first hands the pack to the server's steps, and it answers
|
|
86
|
+
* `PushUploadReceiving` with 202 and `Retry-After` while they receive it; a client sends the same
|
|
87
|
+
* complete again until it answers what `git-receive-pack` answers: report-status-v2 on
|
|
88
|
+
* side-band-64k, the same report each time.
|
|
55
89
|
*/
|
|
56
90
|
export declare const FinishPushUpload: Schema.Struct<{
|
|
57
91
|
readonly parts: Schema.$Array<Schema.Struct<{
|
|
@@ -59,4 +93,9 @@ export declare const FinishPushUpload: Schema.Struct<{
|
|
|
59
93
|
readonly etag: Schema.String;
|
|
60
94
|
}>>;
|
|
61
95
|
}>;
|
|
62
|
-
export type FinishPushUpload = typeof FinishPushUpload.Type;
|
|
96
|
+
export type FinishPushUpload = typeof FinishPushUpload.Type;
|
|
97
|
+
/** Complete's 202, while the server receives the pack: the receive's steps taken so far. */
|
|
98
|
+
export declare const PushUploadReceiving: Schema.Struct<{
|
|
99
|
+
readonly step: Schema.Int;
|
|
100
|
+
}>;
|
|
101
|
+
export type PushUploadReceiving = typeof PushUploadReceiving.Type;
|
|
@@ -43,17 +43,21 @@ const PushUploadStarted = /* @__PURE__ */ Schema.Struct({
|
|
|
43
43
|
const PushUploadPart = /* @__PURE__ */ Schema.Struct({ url: Schema.String });
|
|
44
44
|
/**
|
|
45
45
|
* `POST <repo>/push-uploads/{upload}/complete`, with each part's number and ETag in order, as the
|
|
46
|
-
* bucket's `UploadPart`.
|
|
47
|
-
*
|
|
46
|
+
* bucket's `UploadPart`. The first hands the pack to the server's steps, and it answers
|
|
47
|
+
* `PushUploadReceiving` with 202 and `Retry-After` while they receive it; a client sends the same
|
|
48
|
+
* complete again until it answers what `git-receive-pack` answers: report-status-v2 on
|
|
49
|
+
* side-band-64k, the same report each time.
|
|
48
50
|
*/
|
|
49
51
|
const FinishPushUpload = /* @__PURE__ */ Schema.Struct({ parts: Schema.Array(Schema.Struct({
|
|
50
52
|
part: Schema.Int,
|
|
51
53
|
etag: Schema.String
|
|
52
54
|
})) });
|
|
55
|
+
/** Complete's 202, while the server receives the pack: the receive's steps taken so far. */
|
|
56
|
+
const PushUploadReceiving = /* @__PURE__ */ Schema.Struct({ step: Schema.Int });
|
|
53
57
|
/** What a client POSTs to a push upload's routes: begin's body, complete's, or a part's, which is empty. */
|
|
54
58
|
const PushUploadRequest = /* @__PURE__ */ Schema.Union([
|
|
55
59
|
BeginPushUpload,
|
|
56
60
|
FinishPushUpload,
|
|
57
61
|
Schema.Record(Schema.String, Schema.Never)
|
|
58
62
|
]);
|
|
59
|
-
export { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadRequest, PushUploadStarted };
|
|
63
|
+
export { BeginPushUpload, FinishPushUpload, PushUploadPart, PushUploadReceiving, PushUploadRequest, PushUploadStarted };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ActorInput, Caller, WriteInput } from "./actors.mjs";
|
|
2
2
|
import { ByCalls, EffectCalls } from "./services.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { Duration } from "./promises.mjs";
|
|
5
|
-
import { TreeChange } from "./engine.mjs";
|
|
3
|
+
import { Duration } from "./time.mjs";
|
|
6
4
|
import { RefName, RepoName } from "./ids.mjs";
|
|
7
5
|
import { RepoInput } from "./repos.mjs";
|
|
6
|
+
import { DecisionAnswer, GitError, Result } from "./result.mjs";
|
|
8
7
|
import * as Effect from "effect/Effect";
|
|
9
8
|
import * as Schema from "effect/Schema";
|
|
10
9
|
import { Listing, Page } from "@ref0/infra";
|
|
@@ -342,10 +341,9 @@ export declare const JoinInput: Schema.Struct<{
|
|
|
342
341
|
readonly priority: Schema.optionalKey<Schema.Number>;
|
|
343
342
|
readonly meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
344
343
|
}>;
|
|
345
|
-
readonly signal: Schema.declare<AbortSignal, AbortSignal>;
|
|
346
344
|
}>;
|
|
347
345
|
export type JoinInput = typeof JoinInput.Type;
|
|
348
|
-
/** `changes
|
|
346
|
+
/** `changes`: the head's tree against the target's, diffed on its first run and kept for the rest. */
|
|
349
347
|
export declare const LanesInput: Schema.Struct<{
|
|
350
348
|
readonly actor: Schema.Union<readonly [Schema.Struct<{
|
|
351
349
|
readonly id: Schema.String;
|
|
@@ -365,8 +363,37 @@ export declare const LanesInput: Schema.Struct<{
|
|
|
365
363
|
readonly priority: Schema.optionalKey<Schema.Number>;
|
|
366
364
|
readonly meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
367
365
|
}>;
|
|
368
|
-
readonly
|
|
369
|
-
|
|
366
|
+
readonly changes: Schema.declare<Effect.Effect<readonly {
|
|
367
|
+
readonly status: "A" | "D" | "M" | "R" | "T";
|
|
368
|
+
readonly path: string;
|
|
369
|
+
readonly from?: string;
|
|
370
|
+
readonly similarity?: number;
|
|
371
|
+
readonly old?: {
|
|
372
|
+
readonly mode: string;
|
|
373
|
+
readonly oid: string;
|
|
374
|
+
};
|
|
375
|
+
readonly new?: {
|
|
376
|
+
readonly mode: string;
|
|
377
|
+
readonly oid: string;
|
|
378
|
+
};
|
|
379
|
+
readonly pathBytes?: Uint8Array<ArrayBufferLike>;
|
|
380
|
+
readonly fromPathBytes?: Uint8Array<ArrayBufferLike>;
|
|
381
|
+
}[], GitError, never>, Effect.Effect<readonly {
|
|
382
|
+
readonly status: "A" | "D" | "M" | "R" | "T";
|
|
383
|
+
readonly path: string;
|
|
384
|
+
readonly from?: string;
|
|
385
|
+
readonly similarity?: number;
|
|
386
|
+
readonly old?: {
|
|
387
|
+
readonly mode: string;
|
|
388
|
+
readonly oid: string;
|
|
389
|
+
};
|
|
390
|
+
readonly new?: {
|
|
391
|
+
readonly mode: string;
|
|
392
|
+
readonly oid: string;
|
|
393
|
+
};
|
|
394
|
+
readonly pathBytes?: Uint8Array<ArrayBufferLike>;
|
|
395
|
+
readonly fromPathBytes?: Uint8Array<ArrayBufferLike>;
|
|
396
|
+
}[], GitError, never>>;
|
|
370
397
|
}>;
|
|
371
398
|
export type LanesInput = typeof LanesInput.Type;
|
|
372
399
|
/**
|
|
@@ -402,9 +429,10 @@ export interface ReportOptions {
|
|
|
402
429
|
readonly timeout?: Duration;
|
|
403
430
|
}
|
|
404
431
|
/**
|
|
405
|
-
* The host's queue. Each function is pure but `join` and `lanes`,
|
|
406
|
-
* after 30 seconds. A throw in `merge
|
|
407
|
-
* a schedule function takes the default. Either is
|
|
432
|
+
* The host's queue. Each function is pure but `join` and `lanes`, Effects that may do I/O, each
|
|
433
|
+
* interrupted after 30 seconds. A throw in `merge`, or a failure or defect of `lanes`, fails the
|
|
434
|
+
* entry `host-error`; a throw in `bisect` or a schedule function takes the default. Either is
|
|
435
|
+
* logged at `Error`, as `queue.merge` and the rest.
|
|
408
436
|
*/
|
|
409
437
|
export interface MergeQueueOptions {
|
|
410
438
|
/**
|
|
@@ -416,7 +444,7 @@ export interface MergeQueueOptions {
|
|
|
416
444
|
readonly keys: QueueKeys;
|
|
417
445
|
readonly merge: (input: MergeInput) => MergePlan;
|
|
418
446
|
/** Whether an entry may join: a `Reject` refuses `add` and the push option with it. */
|
|
419
|
-
readonly join?: (input: JoinInput) =>
|
|
447
|
+
readonly join?: (input: JoinInput) => Effect.Effect<DecisionAnswer, GitError>;
|
|
420
448
|
/**
|
|
421
449
|
* The lanes an entry checks in: at most 8, each once, and each 1 to 64 bytes counted as UTF-8
|
|
422
450
|
* JSON, quotes aside, so a control character counts 6. An answer past that fails the entry
|
|
@@ -436,7 +464,7 @@ export interface MergeQueueOptions {
|
|
|
436
464
|
* merged judged `lane`. A land that conflicts restarts the candidate; at the land-restart limit,
|
|
437
465
|
* 3, its entries are pinned, and one pinned candidate holds every lane until it ends.
|
|
438
466
|
*/
|
|
439
|
-
readonly lanes?: (input: LanesInput) =>
|
|
467
|
+
readonly lanes?: (input: LanesInput) => Effect.Effect<LanesAnswer, GitError>;
|
|
440
468
|
/** By default, halves the failed candidate. */
|
|
441
469
|
readonly bisect?: Bisect;
|
|
442
470
|
/**
|
package/dist/contracts/queue.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { Actor, ActorId } from "./actors.mjs";
|
|
|
2
2
|
import { CommitMessage } from "./commits.mjs";
|
|
3
3
|
import { Commit } from "./engine.mjs";
|
|
4
4
|
import { Oid, RefName, RepoName } from "./ids.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { EffectValue } from "./opaque.mjs";
|
|
6
6
|
import "./repos.mjs";
|
|
7
7
|
import { Verdict, decisionAnswer } from "./result.mjs";
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
@@ -188,10 +188,9 @@ Schema.Array(Commit);
|
|
|
188
188
|
const JoinInput = /* @__PURE__ */ Schema.Struct({
|
|
189
189
|
actor: Actor,
|
|
190
190
|
repo: RepoName,
|
|
191
|
-
entry: EntryFields
|
|
192
|
-
signal: AbortSignalValue
|
|
191
|
+
entry: EntryFields
|
|
193
192
|
});
|
|
194
|
-
({ ...JoinInput.fields }),
|
|
193
|
+
({ ...JoinInput.fields }), EffectValue();
|
|
195
194
|
/** One bisect group: at least one entry, none named twice. */
|
|
196
195
|
const EntryGroup = /* @__PURE__ */ Schema.Array(EntryId).check(Schema.isMinLength(1), Schema.makeFilter((group) => new Set(group).size === group.length || "a bisect group names no entry twice"));
|
|
197
196
|
/**
|