@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.
- package/dist/access/private-refs.mjs +1 -1
- package/dist/auth/access-jwt.mjs +3 -3
- package/dist/auth/auth-namespace.d.mts +3 -3
- package/dist/auth/auth-namespace.mjs +3 -2
- package/dist/auth/auth.d.mts +3 -3
- package/dist/auth/auth.mjs +9 -8
- package/dist/auth/authorize.mjs +1 -1
- package/dist/auth/fences.d.mts +1 -1
- package/dist/auth/host-function.mjs +1 -1
- package/dist/auth/host-services.mjs +4 -6
- package/dist/auth/identify.d.mts +1 -1
- package/dist/auth/identify.mjs +6 -0
- package/dist/auth/token-cleanup.mjs +2 -2
- package/dist/auth/token-rows.mjs +6 -1
- package/dist/auth/token-text.mjs +1 -1
- package/dist/auth/tokens-base.d.mts +1 -1
- package/dist/auth/tokens.d.mts +1 -1
- package/dist/auth/tokens.mjs +1 -1
- package/dist/client/client.d.mts +15 -7
- package/dist/client/client.mjs +21 -12
- package/dist/client/git-http.mjs +1 -1
- package/dist/client/local.mjs +60 -24
- package/dist/client/negotiate.mjs +3 -3
- package/dist/client/push-upload.mjs +26 -10
- package/dist/client/remote.mjs +4 -3
- package/dist/client/run-remote-helper.d.mts +2 -2
- package/dist/client/run-remote-helper.mjs +6 -6
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/client/transport.mjs +3 -3
- package/dist/contracts/blobs.d.mts +3 -3
- package/dist/contracts/blobs.mjs +1 -1
- package/dist/contracts/calls-spent.mjs +5 -33
- package/dist/contracts/client.d.mts +15 -14
- package/dist/contracts/commits.d.mts +4 -4
- package/dist/contracts/commits.mjs +1 -1
- package/dist/contracts/engine.d.mts +2 -2
- package/dist/contracts/events.d.mts +1 -1
- package/dist/contracts/events.mjs +1 -1
- package/dist/contracts/files.d.mts +4 -4
- package/dist/contracts/files.mjs +1 -1
- package/dist/contracts/forks.d.mts +4 -4
- package/dist/contracts/forks.mjs +1 -1
- package/dist/contracts/git-hooks.d.mts +1 -1
- package/dist/contracts/git.d.mts +9 -5
- package/dist/contracts/grants.d.mts +1 -1
- package/dist/contracts/merges.d.mts +1 -1
- package/dist/contracts/object-values.d.mts +1 -0
- package/dist/contracts/object-values.mjs +16 -1
- package/dist/contracts/objects.d.mts +30 -18
- package/dist/contracts/opaque.mjs +1 -1
- package/dist/contracts/operations.mjs +1 -1
- package/dist/contracts/queue.d.mts +208 -44
- package/dist/contracts/queue.mjs +5 -5
- package/dist/contracts/refs.d.mts +5 -5
- package/dist/contracts/refs.mjs +1 -1
- package/dist/contracts/remote.d.mts +3 -6
- package/dist/contracts/repos.d.mts +3 -3
- package/dist/contracts/repos.mjs +1 -1
- package/dist/contracts/result.d.mts +10 -7
- package/dist/contracts/result.mjs +8 -3
- package/dist/contracts/rules.d.mts +13 -12
- package/dist/contracts/server.d.mts +8 -10
- package/dist/contracts/services.d.mts +6 -9
- package/dist/contracts/services.mjs +1 -2
- package/dist/contracts/signin.d.mts +1 -1
- package/dist/contracts/store.d.mts +2 -2
- package/dist/contracts/sync.d.mts +63 -6
- package/dist/contracts/sync.mjs +3 -2
- package/dist/contracts/tags.d.mts +3 -3
- package/dist/contracts/tags.mjs +1 -1
- package/dist/contracts/tokens.d.mts +2 -2
- package/dist/contracts/tokens.mjs +1 -1
- package/dist/contracts/topics.d.mts +9 -9
- package/dist/contracts/trees.d.mts +4 -4
- package/dist/contracts/trees.mjs +1 -1
- package/dist/contracts/work.d.mts +4 -4
- package/dist/contracts/work.mjs +2 -2
- package/dist/core/access.d.mts +1 -1
- package/dist/core/ancestry.mjs +30 -34
- package/dist/core/{promise.mjs → call-groups.mjs} +7 -30
- package/dist/core/call-services.mjs +1 -1
- package/dist/core/events/deliver.d.mts +2 -2
- package/dist/core/events/deliver.mjs +3 -3
- package/dist/core/events/retired.mjs +1 -1
- package/dist/core/forks.mjs +5 -5
- package/dist/core/hooks/groups.mjs +2 -2
- package/dist/core/imports.mjs +101 -21
- package/dist/core/index-job.mjs +14 -9
- package/dist/core/index-lost.d.mts +1 -1
- package/dist/core/loose-tally.mjs +38 -15
- package/dist/core/merge-parts.d.mts +17 -4
- package/dist/core/merge-parts.mjs +7 -2
- package/dist/core/mirror-rows.mjs +31 -1
- package/dist/core/objects/blobs.mjs +8 -10
- package/dist/core/objects/files.mjs +20 -17
- package/dist/core/objects/objects-layer.mjs +1 -1
- package/dist/core/objects/peel.mjs +1 -7
- package/dist/core/objects/reading.mjs +19 -18
- package/dist/core/objects/tree-edits.mjs +1 -1
- package/dist/core/objects/trees.mjs +257 -58
- package/dist/core/objects/writing.mjs +3 -9
- package/dist/core/own-writes.mjs +1 -1
- package/dist/core/parts.d.mts +8 -1
- package/dist/core/parts.mjs +8 -4
- package/dist/core/purge.mjs +31 -18
- package/dist/core/push.d.mts +2 -2
- package/dist/core/push.mjs +145 -98
- package/dist/core/receipts.d.mts +2 -2
- package/dist/core/receipts.mjs +9 -2
- package/dist/core/ref-index-job.mjs +4 -4
- package/dist/core/ref-view.mjs +74 -31
- package/dist/core/refs.mjs +3 -3
- package/dist/core/repack.mjs +25 -30
- package/dist/core/repo-info.mjs +1 -1
- package/dist/core/repos.mjs +1 -1
- package/dist/core/rules/changes.mjs +18 -40
- package/dist/core/rules/check.mjs +6 -5
- package/dist/core/rules/commit-changes.mjs +114 -58
- package/dist/core/rules/context.d.mts +3 -3
- package/dist/core/rules/context.mjs +18 -14
- package/dist/core/rules/fetch.mjs +1 -1
- package/dist/core/rules/protect.mjs +30 -17
- package/dist/core/saved-caller-views.d.mts +1 -1
- package/dist/core/saved-caller-views.mjs +3 -3
- package/dist/core/saved-callers.d.mts +1 -1
- package/dist/core/saved-callers.mjs +1 -1
- package/dist/core/seam.d.mts +1 -2
- package/dist/core/view.d.mts +6 -3
- package/dist/core/view.mjs +11 -10
- package/dist/core/work.mjs +2 -2
- package/dist/engine/allotted-xdiff.mjs +3 -16
- package/dist/engine/combined.d.mts +3 -0
- package/dist/engine/combined.mjs +200 -185
- package/dist/engine/content.d.mts +2 -2
- package/dist/engine/content.mjs +1 -1
- package/dist/engine/merge.mjs +7 -9
- package/dist/engine/reads.d.mts +2 -2
- package/dist/engine/reads.mjs +22 -14
- package/dist/engine/xdiff.d.mts +1 -1
- package/dist/engine/xdiff.mjs +1 -1
- 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 +2 -2
- package/dist/event-streams/stream.mjs +3 -3
- package/dist/extend.d.mts +2 -6
- package/dist/extend.mjs +1 -5
- package/dist/http/core-parts.mjs +83 -26
- package/dist/http/handler.mjs +54 -9
- package/dist/http/parts.d.mts +1 -0
- package/dist/http/push-upload-job.mjs +138 -24
- package/dist/http/push-uploads.mjs +2 -2
- package/dist/http/receive-pack.mjs +14 -53
- package/dist/http/request-snapshot.mjs +258 -0
- package/dist/http/upload-pack.mjs +23 -18
- package/dist/index.d.mts +29 -21
- package/dist/index.mjs +11 -2
- package/dist/lfs/base.d.mts +1 -1
- package/dist/lfs/copy.d.mts +49 -1
- package/dist/lfs/copy.mjs +135 -22
- package/dist/lfs/layer.d.mts +4 -3
- package/dist/lfs/layer.mjs +4 -5
- package/dist/lfs/locks.mjs +2 -2
- package/dist/lfs/objects.d.mts +1 -1
- package/dist/lfs/objects.mjs +3 -3
- package/dist/lfs/pointers.mjs +1 -1
- package/dist/lfs/rows.d.mts +1 -1
- package/dist/lfs/rows.mjs +11 -4
- package/dist/lfs/upkeep.mjs +40 -9
- package/dist/lfs/uploaded.mjs +1 -1
- package/dist/lfs/wire.mjs +1 -1
- package/dist/merges/merges.mjs +17 -2
- package/dist/protocol/bytes/buffers.d.mts +1 -1
- package/dist/protocol/bytes/buffers.mjs +1 -1
- package/dist/protocol/bytes/deflate.d.mts +1 -1
- package/dist/protocol/bytes/deflate.mjs +1 -1
- package/dist/protocol/bytes/inflate.d.mts +1 -1
- package/dist/protocol/bytes/inflate.mjs +1 -1
- package/dist/protocol/bytes/sha1.d.mts +1 -1
- package/dist/protocol/bytes/sha1.mjs +1 -1
- package/dist/protocol/diff/read.d.mts +2 -1
- package/dist/protocol/diff/read.mjs +102 -8
- package/dist/protocol/packs/graph.mjs +1 -1
- package/dist/protocol/packs/idx.d.mts +1 -1
- package/dist/protocol/packs/idx.mjs +1 -1
- package/dist/protocol/packs/parts.mjs +1 -1
- package/dist/protocol/packs/reader.d.mts +1 -1
- package/dist/protocol/packs/reader.mjs +1 -1
- package/dist/protocol/packs/write-error.d.mts +1 -1
- package/dist/protocol/packs/write-error.mjs +1 -1
- package/dist/protocol/packs/writer.mjs +3 -3
- package/dist/protocol/wire/advertisement.d.mts +1 -1
- package/dist/protocol/wire/advertisement.mjs +3 -2
- package/dist/protocol/wire/fetch.d.mts +1 -1
- package/dist/protocol/wire/fetch.mjs +1 -1
- package/dist/protocol/wire/lines.d.mts +9 -1
- package/dist/protocol/wire/lines.mjs +28 -1
- package/dist/protocol/wire/push-uploads.mjs +10 -7
- package/dist/protocol/wire/receive-pack.d.mts +1 -1
- package/dist/protocol/wire/receive-pack.mjs +1 -1
- package/dist/protocol/wire/report-status.d.mts +1 -1
- package/dist/protocol/wire/report-status.mjs +1 -1
- package/dist/protocol/wire/v2.d.mts +1 -1
- package/dist/protocol/wire/v2.mjs +1 -1
- package/dist/queue/advance.mjs +31 -24
- package/dist/queue/base.d.mts +5 -3
- package/dist/queue/calls.mjs +5 -5
- package/dist/queue/commit.mjs +1 -1
- package/dist/queue/host.d.mts +1 -1
- package/dist/queue/layer.d.mts +0 -1
- package/dist/queue/layer.mjs +9 -5
- package/dist/queue/schedule.mjs +1 -1
- package/dist/queue/search.mjs +1 -1
- package/dist/queue/state.mjs +1 -1
- package/dist/queue/trim.mjs +2 -2
- package/dist/rest/client.d.mts +1 -1
- package/dist/rest/client.mjs +6 -6
- package/dist/rest/errors.mjs +1 -1
- package/dist/rest/handler.mjs +2 -2
- package/dist/rest/handlers.mjs +16 -6
- package/dist/rest/layer.mjs +1 -1
- package/dist/rest/listen.mjs +2 -2
- package/dist/rest/refs.mjs +1 -1
- package/dist/server/edge.mjs +27 -3
- package/dist/server/git-layer.d.mts +1 -2
- package/dist/server/git-layer.mjs +4 -5
- package/dist/server/lifecycle.mjs +1 -1
- package/dist/server/registry.mjs +2 -8
- package/dist/server/server.mjs +62 -43
- package/dist/signin/context.d.mts +1 -1
- package/dist/signin/context.mjs +1 -1
- package/dist/signin/forms.mjs +1 -1
- package/dist/signin/grants.d.mts +2 -2
- package/dist/signin/grants.mjs +1 -1
- package/dist/signin/wire.mjs +1 -1
- package/dist/storage/allotted.mjs +4 -9
- package/dist/storage/batch-upkeep.mjs +31 -12
- package/dist/storage/batches.d.mts +2 -3
- package/dist/storage/batches.mjs +52 -49
- package/dist/storage/budget.mjs +23 -1
- package/dist/storage/calls.d.mts +1 -1
- package/dist/storage/calls.mjs +41 -43
- package/dist/storage/charged-cache.mjs +180 -0
- package/dist/storage/chunks.d.mts +3 -3
- package/dist/storage/chunks.mjs +121 -8
- package/dist/storage/counted-bucket.mjs +32 -10
- package/dist/storage/fetch-row-cache.d.mts +6 -0
- package/dist/storage/fetch-row-cache.mjs +211 -0
- package/dist/storage/fetch.d.mts +1 -0
- package/dist/storage/fetch.mjs +54 -242
- package/dist/storage/held-types.d.mts +0 -1
- package/dist/storage/held-types.mjs +13 -4
- package/dist/storage/host-bucket.mjs +9 -4
- package/dist/storage/index-bitmaps.mjs +340 -65
- package/dist/storage/index-build.d.mts +2 -3
- package/dist/storage/index-build.mjs +274 -56
- package/dist/storage/index-fetch.d.mts +3 -1
- package/dist/storage/index-fetch.mjs +60 -21
- package/dist/storage/index-graph.mjs +1 -1
- package/dist/storage/index-layers.mjs +55 -25
- package/dist/storage/index-reach.mjs +15 -22
- package/dist/storage/index-whole.d.mts +7 -0
- package/dist/storage/index-whole.mjs +145 -37
- package/dist/storage/largest-files.mjs +1 -7
- package/dist/storage/layout.mjs +17 -1
- package/dist/storage/lfs-pointers.mjs +1 -6
- package/dist/storage/link-join.mjs +55 -16
- package/dist/storage/list-source.d.mts +7 -0
- package/dist/storage/list-source.mjs +288 -0
- package/dist/storage/loose.d.mts +8 -8
- package/dist/storage/loose.mjs +157 -91
- package/dist/storage/memory-budget.mjs +226 -22
- package/dist/storage/merge-cut.mjs +9 -6
- package/dist/storage/merge-fence.mjs +1 -1
- package/dist/storage/merge-row.mjs +1 -1
- package/dist/storage/merge.d.mts +2 -3
- package/dist/storage/merge.mjs +2 -2
- package/dist/storage/object-rows.d.mts +3 -3
- package/dist/storage/object-rows.mjs +179 -38
- package/dist/storage/pack-order.mjs +97 -44
- package/dist/storage/pack-ranges.mjs +44 -16
- package/dist/storage/pack-reads.d.mts +5 -3
- package/dist/storage/pack-reads.mjs +236 -72
- package/dist/storage/pack-receive.d.mts +1 -2
- package/dist/storage/pack-receive.mjs +24 -18
- package/dist/storage/packs.d.mts +1 -1
- package/dist/storage/packs.mjs +477 -116
- package/dist/storage/placed-reads.mjs +33 -16
- package/dist/storage/prune-seen.mjs +1 -1
- package/dist/storage/prune-walk.mjs +1 -1
- package/dist/storage/prune.mjs +4 -31
- package/dist/storage/push-allotment.mjs +26 -14
- package/dist/storage/push-uploads.mjs +195 -57
- package/dist/storage/pushed-commits.mjs +20 -1
- package/dist/storage/quarantine.d.mts +2 -3
- package/dist/storage/range-cache.mjs +175 -40
- package/dist/storage/raw-ids.mjs +39 -10
- package/dist/storage/ready.d.mts +2 -3
- package/dist/storage/ready.mjs +114 -38
- package/dist/storage/receive-bounds.mjs +31 -9
- package/dist/storage/receive-cache.d.mts +7 -0
- package/dist/storage/receive-cache.mjs +147 -0
- package/dist/storage/receive-files.mjs +1 -1
- package/dist/storage/receive-links.mjs +1 -1
- package/dist/storage/receive-state.d.mts +2 -2
- package/dist/storage/receive-state.mjs +6 -8
- package/dist/storage/receive-steps.d.mts +20 -0
- package/dist/storage/receive-steps.mjs +298 -13
- package/dist/storage/repack-backlog.mjs +1 -6
- package/dist/storage/repack-contained.mjs +2 -2
- package/dist/storage/repack-job.mjs +1 -1
- package/dist/storage/repack.d.mts +2 -3
- package/dist/storage/repack.mjs +54 -9
- package/dist/storage/request-cache.mjs +57 -0
- package/dist/storage/roots.mjs +1 -24
- package/dist/storage/rows.d.mts +2 -2
- package/dist/storage/rows.mjs +1 -1
- package/dist/storage/runs.d.mts +2 -2
- package/dist/storage/runs.mjs +1 -1
- package/dist/storage/send-list.mjs +62 -25
- package/dist/storage/stream-whole.mjs +84 -63
- package/dist/storage/swap-walk.mjs +1 -1
- package/dist/storage/unpack.mjs +878 -450
- package/dist/storage/visible.mjs +110 -32
- package/dist/storage/walk.mjs +1 -0
- package/dist/storage/wants.mjs +22 -58
- package/dist/store/call-count.d.mts +2 -2
- package/dist/store/call-count.mjs +24 -11
- package/dist/store/catalogue.d.mts +1 -1
- package/dist/store/catalogue.mjs +19 -7
- package/dist/store/crossing.mjs +1 -7
- package/dist/store/cursor-seal.d.mts +1 -1
- package/dist/store/cursor-seal.mjs +1 -1
- package/dist/store/door.mjs +9 -4
- package/dist/store/errors.d.mts +2 -2
- package/dist/store/errors.mjs +107 -19
- package/dist/store/git-store.mjs +7 -2
- package/dist/store/job-try.mjs +90 -9
- package/dist/store/list-job.mjs +10 -34
- package/dist/store/outbox.d.mts +2 -2
- package/dist/store/outbox.mjs +2 -2
- package/dist/store/queue-jobs.mjs +6 -12
- package/dist/store/records.d.mts +2 -2
- package/dist/store/records.mjs +2 -2
- package/dist/store/ref-rows.d.mts +2 -2
- package/dist/store/ref-rows.mjs +2 -2
- package/dist/store/repo-record.d.mts +2 -2
- package/dist/store/repo-record.mjs +3 -3
- package/dist/store/request-snapshot.mjs +5 -0
- package/dist/store/reservations.mjs +2 -2
- package/dist/store/topic-jobs.mjs +5 -11
- package/dist/sync/bound.d.mts +3 -3
- package/dist/sync/bound.mjs +10 -7
- package/dist/sync/github.mjs +65 -67
- package/dist/sync/http.mjs +1 -1
- package/dist/sync/import.mjs +201 -66
- package/dist/sync/layer.d.mts +1 -1
- package/dist/sync/layer.mjs +6 -6
- package/dist/sync/lfs-batch.mjs +1 -1
- package/dist/sync/lfs-copy.mjs +175 -15
- package/dist/sync/mirror.mjs +5 -10
- package/dist/sync/said.mjs +1 -1
- package/dist/sync/step.mjs +268 -86
- package/dist/sync/tries.mjs +25 -6
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/topics/advance.mjs +3 -3
- package/dist/topics/calls.mjs +1 -1
- package/dist/topics/layer.d.mts +15 -14
- package/dist/topics/members.mjs +1 -1
- package/dist/topics/topic.mjs +1 -1
- package/package.json +3 -13
- package/dist/auth/helpers.mjs +0 -17
- package/dist/auth.d.mts +0 -5
- package/dist/auth.mjs +0 -5
- package/dist/core/rules/commit-changes.d.mts +0 -12
- package/dist/effect.d.mts +0 -9
- package/dist/effect.mjs +0 -7
- package/dist/server/joined.d.mts +0 -70
- package/dist/server/joined.mjs +0 -41
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "effect/Effect";
|
|
2
1
|
import * as Schema from "effect/Schema";
|
|
2
|
+
import "effect/Effect";
|
|
3
3
|
/** What every call answers: its value, or the expected failure as data. A defect throws. */
|
|
4
4
|
export type Result<A> = Success<A> | FailureResult;
|
|
5
5
|
export interface Success<A> {
|
|
@@ -135,8 +135,12 @@ export type PreconditionContext = typeof PreconditionContext.Type;
|
|
|
135
135
|
* `fork-chunks-past-budget` is a fork's create, sync or fetch whose source holds chunked objects
|
|
136
136
|
* that need more store calls (`needed`) than the request's call budget has left (`allowed`),
|
|
137
137
|
* refused up front before any chunk is copied so no partial chunks are staged.
|
|
138
|
+
*
|
|
139
|
+
* `delta-chain-too-deep` is a `loose()` push whose spilled pending deltas need more resolution
|
|
140
|
+
* rounds than `most` (`4,095`, Git's `pack.depth` ceiling) to resolve; its staged batch is
|
|
141
|
+
* abandoned and no ref moves.
|
|
138
142
|
*/
|
|
139
|
-
export declare const ResourceReason: Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget"]>;
|
|
143
|
+
export declare const ResourceReason: Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget", "delta-chain-too-deep"]>;
|
|
140
144
|
/**
|
|
141
145
|
* A push refused `too-large` by the repo's pack indexes it reads: those indexes' bytes in
|
|
142
146
|
* `indexBytes`, the push's own beside them in `pushBytes`, and the most the server's memory could
|
|
@@ -144,7 +148,7 @@ export declare const ResourceReason: Schema.Literals<readonly ["too-large", "rat
|
|
|
144
148
|
* `needed` and the `allowed` calls left in the request's budget.
|
|
145
149
|
*/
|
|
146
150
|
export declare const ResourceContext: Schema.StructWithRest<Schema.Struct<{
|
|
147
|
-
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
151
|
+
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget", "delta-chain-too-deep"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
148
152
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
149
153
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
150
154
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -234,7 +238,7 @@ export declare const gitErrorContexts: {
|
|
|
234
238
|
tip: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
235
239
|
}>, readonly [Schema.$Record<Schema.String, Schema.Union<readonly [Schema.decodeTo<Schema.String, Schema.String, never, never>, Schema.Number, Schema.Boolean, Schema.$Array<Schema.decodeTo<Schema.String, Schema.String, never, never>>, Schema.Undefined]>>]>;
|
|
236
240
|
readonly RESOURCE_EXHAUSTED: Schema.StructWithRest<Schema.Struct<{
|
|
237
|
-
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
241
|
+
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget", "delta-chain-too-deep"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
238
242
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
239
243
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
240
244
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -332,7 +336,7 @@ export declare const GitErrorBody: Schema.Union<(Schema.Struct<{
|
|
|
332
336
|
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
333
337
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
334
338
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
335
|
-
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
339
|
+
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget", "delta-chain-too-deep"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
336
340
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
337
341
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
338
342
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -359,7 +363,7 @@ export declare const GitErrorBody: Schema.Union<(Schema.Struct<{
|
|
|
359
363
|
}>)[]>;
|
|
360
364
|
export type GitErrorBody = typeof GitErrorBody.Type;
|
|
361
365
|
/** Every reason a refusal names, each once, by code: what `ref0-push-reasons` tells. */
|
|
362
|
-
declare const refusalReasonLists: readonly [Schema.Literals<readonly ["ofs-delta", "fsck", "provider-unknown", "body-ended", "link-wrong-type", "tag-target-missing", "object-missing", "boundary-not-in-pack", "too-many-short-ids", "too-many-parents"]>, Schema.Literals<readonly ["files-refused", "entry-unpublishable", "fetch-depth-unsupported"]>, Schema.Literals<readonly ["key-reused"]>, Schema.Literals<readonly ["no-queue", "no-sync", "no-topics", "ambiguous", "past-roots"]>, Schema.Literals<readonly ["cursor-expired", "diverged", "merge-conflict", "candidate-superseded", "candidate-cancelled", "entry-gone", "ref-conflict", "newer-format", "changed-while-checked", "unsupported-attribute", "unrelated-histories", "unsupported-virtual-base", "own-repo", "not-a-fork", "no-copy-rows", "shallow-root", "shallow-upload", "import-cancelled", "importing", "history-not-imported", "stage-gone", "remote-refused", "atomic-partner", "merges-off", "no-releases"]>, Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget"]>, Schema.Literals<readonly ["busy", "packs-awaiting-repack", "batches-awaiting-upkeep", "awaiting-index", "may-have-saved", "too-many-writes", "starting"]>, Schema.Literals<readonly ["event-version", "graph-length", "merge-incomplete"]>];
|
|
366
|
+
declare const refusalReasonLists: readonly [Schema.Literals<readonly ["ofs-delta", "fsck", "provider-unknown", "body-ended", "link-wrong-type", "tag-target-missing", "object-missing", "boundary-not-in-pack", "too-many-short-ids", "too-many-parents"]>, Schema.Literals<readonly ["files-refused", "entry-unpublishable", "fetch-depth-unsupported"]>, Schema.Literals<readonly ["key-reused"]>, Schema.Literals<readonly ["no-queue", "no-sync", "no-topics", "ambiguous", "past-roots"]>, Schema.Literals<readonly ["cursor-expired", "diverged", "merge-conflict", "candidate-superseded", "candidate-cancelled", "entry-gone", "ref-conflict", "newer-format", "changed-while-checked", "unsupported-attribute", "unrelated-histories", "unsupported-virtual-base", "own-repo", "not-a-fork", "no-copy-rows", "shallow-root", "shallow-upload", "import-cancelled", "importing", "history-not-imported", "stage-gone", "remote-refused", "atomic-partner", "merges-off", "no-releases"]>, Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget", "delta-chain-too-deep"]>, Schema.Literals<readonly ["busy", "packs-awaiting-repack", "batches-awaiting-upkeep", "awaiting-index", "may-have-saved", "too-many-writes", "starting"]>, Schema.Literals<readonly ["event-version", "graph-length", "merge-incomplete"]>];
|
|
363
367
|
/** A refusal's reason, of every code whose context names one. */
|
|
364
368
|
export type RefusalReason = (typeof refusalReasonLists)[number]['Type'];
|
|
365
369
|
export interface GitErrorFields {
|
|
@@ -457,5 +461,4 @@ export type DecisionAnswer<Data = undefined> = Accepted<Data> | Rejected;
|
|
|
457
461
|
*/
|
|
458
462
|
export declare const HostFunctionName: Schema.Literals<readonly ["auth", "authorize", "approvalPage", "grants", "rules.push", "rules.fetch", "hooks", "join", "queue.merge", "queue.lanes", "queue.bisect", "queue.schedule", "topics.prepare", "topics.required"]>;
|
|
459
463
|
export type HostFunctionName = typeof HostFunctionName.Type;
|
|
460
|
-
export type Awaitable<T> = T | Promise<T>;
|
|
461
464
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Option from "effect/Option";
|
|
3
1
|
import * as Schema from "effect/Schema";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
4
3
|
import * as Predicate from "effect/Predicate";
|
|
4
|
+
import * as Option from "effect/Option";
|
|
5
5
|
import * as SchemaTransformation from "effect/SchemaTransformation";
|
|
6
6
|
// src/contracts/result.ts
|
|
7
7
|
/** What a refusal's body puts in place of a secret it would carry. */
|
|
@@ -217,6 +217,10 @@ const PreconditionContext = contextOf({
|
|
|
217
217
|
* `fork-chunks-past-budget` is a fork's create, sync or fetch whose source holds chunked objects
|
|
218
218
|
* that need more store calls (`needed`) than the request's call budget has left (`allowed`),
|
|
219
219
|
* refused up front before any chunk is copied so no partial chunks are staged.
|
|
220
|
+
*
|
|
221
|
+
* `delta-chain-too-deep` is a `loose()` push whose spilled pending deltas need more resolution
|
|
222
|
+
* rounds than `most` (`4,095`, Git's `pack.depth` ceiling) to resolve; its staged batch is
|
|
223
|
+
* abandoned and no ref moves.
|
|
220
224
|
*/
|
|
221
225
|
const ResourceReason = /* @__PURE__ */ Schema.Literals([
|
|
222
226
|
"too-large",
|
|
@@ -240,7 +244,8 @@ const ResourceReason = /* @__PURE__ */ Schema.Literals([
|
|
|
240
244
|
"prune-walk-too-large",
|
|
241
245
|
"job-step-calls",
|
|
242
246
|
"job-step-yielded",
|
|
243
|
-
"fork-chunks-past-budget"
|
|
247
|
+
"fork-chunks-past-budget",
|
|
248
|
+
"delta-chain-too-deep"
|
|
244
249
|
]);
|
|
245
250
|
/**
|
|
246
251
|
* A push refused `too-large` by the repo's pack indexes it reads: those indexes' bytes in
|
|
@@ -4,10 +4,10 @@ import { RefName, RepoName } from "./ids.mjs";
|
|
|
4
4
|
import { RefSource, RefUpdate } from "./refs.mjs";
|
|
5
5
|
import { RepoStats } from "./repos.mjs";
|
|
6
6
|
import { DecisionAnswer, GitError } from "./result.mjs";
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
7
|
import * as Schema from "effect/Schema";
|
|
9
|
-
import * as
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
10
9
|
import * as Stream from "effect/Stream";
|
|
10
|
+
import * as Context from "effect/Context";
|
|
11
11
|
export declare const PushFacts: Schema.Struct<{
|
|
12
12
|
readonly bytes: Schema.Number;
|
|
13
13
|
readonly objects: Schema.Number;
|
|
@@ -68,16 +68,17 @@ export type PushContext = Acting & {
|
|
|
68
68
|
*/
|
|
69
69
|
readonly changes: Effect.Effect<readonly TreeChange[], GitError>;
|
|
70
70
|
/**
|
|
71
|
-
* The push's changes commit by commit, read only as it's pulled, in the push's call scope: each
|
|
72
|
-
* in each the paths whose entry differs from every parent's that the
|
|
73
|
-
* ref's old tip, names only, one commit at a time, a commit with none
|
|
74
|
-
* moved onto a commit the push doesn't bring, and a write through the
|
|
75
|
-
*
|
|
76
|
-
* as a merge commit's other parent, is listed as its own. `Rules.files` also
|
|
77
|
-
* the tip of a ref it covers, and, on a refusal, one on the first-parent chain
|
|
78
|
-
* tip or of a default branch it covers, 1,000 commits back (Q732, Q734). A push
|
|
79
|
-
* lists its commits once, for each ref. A walk past its allotment fails with the
|
|
80
|
-
* refusal,
|
|
71
|
+
* The push's changes commit by commit, read only as it's pulled, in the push's call scope: each
|
|
72
|
+
* commit the push brings, and in each the paths whose entry differs from every parent's that the
|
|
73
|
+
* push brings or that's the ref's old tip, names only, one commit at a time, a commit with none
|
|
74
|
+
* counted as a root. A ref moved onto a commit the push doesn't bring, and a write through the
|
|
75
|
+
* API, list each commit the move adds to the ref the same way, so what one takes from a commit no
|
|
76
|
+
* rule saw, such as a merge commit's other parent, is listed as its own. `Rules.files` also
|
|
77
|
+
* counts a parent at the tip of a ref it covers, and, on a refusal, one on the first-parent chain
|
|
78
|
+
* of the ref's old tip or of a default branch it covers, 1,000 commits back (Q732, Q734). A push
|
|
79
|
+
* of several refs lists its commits once, for each ref. A walk past its allotment fails with the
|
|
80
|
+
* allotment's refusal, and a move's past 10,000 commits it adds, a merge counted once for each
|
|
81
|
+
* parent, with `walk-limit`: `Rules.files` answers each as its own.
|
|
81
82
|
*/
|
|
82
83
|
readonly commitChanges: Stream.Stream<CommitChange, GitError>;
|
|
83
84
|
};
|
|
@@ -12,14 +12,14 @@ import { PushOptions } from "./push-uploads.mjs";
|
|
|
12
12
|
import { MergeQueueCalls } from "./queue.mjs";
|
|
13
13
|
import { RefCalls } from "./refs.mjs";
|
|
14
14
|
import { Repos } from "./repos.mjs";
|
|
15
|
-
import { GitError
|
|
15
|
+
import { GitError } from "./result.mjs";
|
|
16
16
|
import { TagCalls, Tags } from "./tags.mjs";
|
|
17
17
|
import { TreeCalls, Trees } from "./trees.mjs";
|
|
18
18
|
import { Tokens } from "./tokens.mjs";
|
|
19
19
|
import { Work, WorkCalls } from "./work.mjs";
|
|
20
20
|
import { TopicCalls } from "./topics.mjs";
|
|
21
|
-
import * as Effect from "effect/Effect";
|
|
22
21
|
import { CallLimits, JobQueue, Records } from "@ref0/infra";
|
|
22
|
+
import * as Effect from "effect/Effect";
|
|
23
23
|
/** The call modules' services, which a server's runtime holds, each deciding for its `by`. */
|
|
24
24
|
export type CallServices = Repos | Forks | Work | Blobs | Trees | Commits | Tags | Files;
|
|
25
25
|
/**
|
|
@@ -61,13 +61,11 @@ export interface GitOptions {
|
|
|
61
61
|
*/
|
|
62
62
|
readonly pushes?: Pick<PushOptions, 'files' | 'repo'>;
|
|
63
63
|
}
|
|
64
|
-
/**
|
|
65
|
-
type
|
|
66
|
-
/** The Promise twin of a `by?: Caller` Effect service on `ServerCalls`, dropping the trailing `by`. */
|
|
67
|
-
type WithoutByPromise<T> = { readonly [K in keyof T]: T[K] extends ((a: infer A, by?: Caller) => Effect.Effect<infer R, GitError>) ? (a: A) => Promise<Result<R>> : T[K] extends ((a: infer A, b: infer B, by?: Caller) => Effect.Effect<infer R, GitError>) ? (a: A, b: B) => Promise<Result<R>> : never; };
|
|
64
|
+
/** A `by?: Caller` Effect service on `ServerCalls`, its trailing `by` dropped. */
|
|
65
|
+
type WithoutBy<T> = { readonly [K in keyof T]: T[K] extends ((a: infer A, by?: Caller) => Effect.Effect<infer R, GitError>) ? (a: A) => Effect.Effect<R, GitError> : T[K] extends ((a: infer A, b: infer B, by?: Caller) => Effect.Effect<infer R, GitError>) ? (a: A, b: B) => Effect.Effect<R, GitError> : never; };
|
|
68
66
|
/** Each piece adds its own groups: C's, RD's objects, Q's `queue` and TP's `topics`. */
|
|
69
|
-
export
|
|
70
|
-
readonly repos:
|
|
67
|
+
export type ServerCalls = {
|
|
68
|
+
readonly repos: WithoutBy<Repos['Service']>;
|
|
71
69
|
readonly forks: ForkCalls;
|
|
72
70
|
readonly work: WorkCalls;
|
|
73
71
|
readonly refs: RefCalls;
|
|
@@ -78,8 +76,8 @@ export interface ServerCalls {
|
|
|
78
76
|
readonly files: FileCalls;
|
|
79
77
|
readonly merges: MergeCalls;
|
|
80
78
|
readonly lfs: LfsCalls;
|
|
81
|
-
readonly tokens?:
|
|
79
|
+
readonly tokens?: Tokens['Service'];
|
|
82
80
|
readonly queue?: MergeQueueCalls;
|
|
83
81
|
readonly topics?: TopicCalls;
|
|
84
|
-
}
|
|
82
|
+
};
|
|
85
83
|
export {};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { Caller } from "./actors.mjs";
|
|
2
|
-
import
|
|
3
|
-
import { GitStore as GitStore$1 } from "./store.mjs";
|
|
2
|
+
import "./store.mjs";
|
|
4
3
|
import * as Effect from "effect/Effect";
|
|
5
|
-
import
|
|
4
|
+
import "effect/Context";
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* `T`'s Effect calls, each needing `R`: core's services inside the server, where a host's face
|
|
7
|
+
* needs none.
|
|
9
8
|
*/
|
|
10
|
-
export type
|
|
9
|
+
export type Needing<T, R = never> = { readonly [K in keyof T]: NonNullable<T[K]> extends ((...args: infer Args) => Effect.Effect<infer A, infer E, unknown>) ? (...args: Args) => Effect.Effect<A, E, R> : Needing<NonNullable<T[K]>, R>; };
|
|
11
10
|
/**
|
|
12
11
|
* `T`'s calls as Effects, each deciding for `by`: a caller `identify` answered, its token or grant
|
|
13
12
|
* with it, or `Git.host`. With none, a call decides for the actor its input names, as the server's
|
|
14
13
|
* direct calls do. A call module's service holds these, and its accessors pass `by` on.
|
|
15
14
|
*/
|
|
16
|
-
export type ByCalls<T, R = never> =
|
|
17
|
-
export declare const GitStore: Context.Service<EffectCalls<GitStore$1, never>, EffectCalls<GitStore$1, never>>;
|
|
18
|
-
export declare const GitCaller: Context.Service<Caller<unknown>, Caller<unknown>>;
|
|
15
|
+
export type ByCalls<T, R = never> = Needing<{ readonly [K in keyof T]: T[K] extends ((...args: infer Args) => infer Answer) ? (...args: [...Args, by?: Caller]) => Answer : never; }, R>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as Context from "effect/Context";
|
|
2
2
|
// src/contracts/services.ts
|
|
3
|
-
const GitStore = /* @__PURE__ */ Context.Service("@ref0/git/GitStore");
|
|
4
3
|
const GitCaller = /* @__PURE__ */ Context.Service("@ref0/git/GitCaller");
|
|
5
|
-
export { GitCaller
|
|
4
|
+
export { GitCaller };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GitError } from "./result.mjs";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
2
|
import * as Schema from "effect/Schema";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
4
|
/**
|
|
5
5
|
* The GitHub scope a device asks for so its token can push, as gh does: Git's refusal of a push
|
|
6
6
|
* by a narrower token names it, and a host's sign-in maps it to `write`. It isn't a list of the
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InternalRepoId } from "./ids.mjs";
|
|
2
2
|
import { CallInput } from "./actors.mjs";
|
|
3
3
|
import { GitError } from "./result.mjs";
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import * as Schema from "effect/Schema";
|
|
6
4
|
import { Addition, Change, Committed, Read, Scope, Snapshot } from "@ref0/infra";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
7
|
/** A pack another pack holds whole, by its ID, with its size (Q903). */
|
|
8
8
|
export declare const HeldPack: Schema.Struct<{
|
|
9
9
|
readonly id: Schema.String;
|
|
@@ -2,9 +2,9 @@ import { ClientCredential } from "./remote.mjs";
|
|
|
2
2
|
import { ActorInput, WriteInput } from "./actors.mjs";
|
|
3
3
|
import { RefName, RepoName } from "./ids.mjs";
|
|
4
4
|
import { RepoInfo, RepoInput } from "./repos.mjs";
|
|
5
|
-
import { GitError
|
|
6
|
-
import * as Effect from "effect/Effect";
|
|
5
|
+
import { GitError } from "./result.mjs";
|
|
7
6
|
import * as Schema from "effect/Schema";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
8
|
import * as Context from "effect/Context";
|
|
9
9
|
/**
|
|
10
10
|
* A sync remote's sender of one request, in place of Git's own client: an Effect, run in the try's
|
|
@@ -65,7 +65,7 @@ export interface SyncProvider {
|
|
|
65
65
|
* send or no push, and `RESOURCE_EXHAUSTED` for a body longer than the remote sends. It reads the
|
|
66
66
|
* request's body itself, so the host doesn't read it after: a second read fails.
|
|
67
67
|
*/
|
|
68
|
-
readonly verify?: (request: Request) =>
|
|
68
|
+
readonly verify?: (request: Request) => Effect.Effect<SyncTrigger | undefined, GitError>;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* A remote repo by its provider's `name` and the provider's own name for it, such as
|
|
@@ -99,7 +99,11 @@ export declare const ImportProgress: Schema.Struct<{
|
|
|
99
99
|
}>>;
|
|
100
100
|
}>;
|
|
101
101
|
export type ImportProgress = typeof ImportProgress.Type;
|
|
102
|
-
|
|
102
|
+
/**
|
|
103
|
+
* The host's progress callback: each new sample of an import's running try. A defect in it is
|
|
104
|
+
* dropped, and the import goes on.
|
|
105
|
+
*/
|
|
106
|
+
export type ReportImportProgress = (progress: ImportProgress) => Effect.Effect<void>;
|
|
103
107
|
/**
|
|
104
108
|
* `repo` is created by the import. `source` names a provider `Sync.layer` was given, or the import
|
|
105
109
|
* is refused `INVALID_ARGUMENT`, reason `provider-unknown`, and nothing is written. `depth` copies
|
|
@@ -115,6 +119,30 @@ export interface SyncImportInput extends Omit<WriteInput, 'signal'> {
|
|
|
115
119
|
readonly depth?: number;
|
|
116
120
|
readonly onProgress?: ReportImportProgress;
|
|
117
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* How much deeper `deepen` fetches behind the repo's shallow roots: `deepen` more commits behind
|
|
124
|
+
* each root, a whole number from 1 to `importDepthMost`, or `unshallow: true` for the rest of the
|
|
125
|
+
* history behind them.
|
|
126
|
+
*/
|
|
127
|
+
export type SyncDeepenMode = {
|
|
128
|
+
readonly deepen: number;
|
|
129
|
+
readonly unshallow?: never;
|
|
130
|
+
} | {
|
|
131
|
+
readonly unshallow: true;
|
|
132
|
+
readonly deepen?: never;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Fetches older history behind a shallow repo's roots, moving its roots in one write only after
|
|
136
|
+
* the older commits and every parent of every unshallowed root have landed. `source` defaults to
|
|
137
|
+
* the repo's recorded import source; pass one for a shallow repo with no recorded import source or
|
|
138
|
+
* whose upstream moved. Refused `FAILED_PRECONDITION` when the repo is not shallow or an import or
|
|
139
|
+
* deepen is already running. `key` is a write's: sent again, the deepen answers as it first did.
|
|
140
|
+
* Interrupting ends the wait, not the deepen: `cancelImport` stops it without moving any root.
|
|
141
|
+
*/
|
|
142
|
+
export type SyncDeepenInput = Omit<WriteInput, 'signal'> & RepoInput & {
|
|
143
|
+
readonly source?: SyncSource;
|
|
144
|
+
readonly onProgress?: ReportImportProgress;
|
|
145
|
+
} & SyncDeepenMode;
|
|
118
146
|
/**
|
|
119
147
|
* Pushes `ref`, the repo's default branch when left out, to `destination` after each move. Sent
|
|
120
148
|
* for a paused mirror, it resumes it. A `destination` naming a provider `Sync.layer` wasn't given is
|
|
@@ -235,7 +263,7 @@ export declare const MirrorJobData: Schema.Struct<{
|
|
|
235
263
|
}>;
|
|
236
264
|
export type MirrorJobData = typeof MirrorJobData.Type;
|
|
237
265
|
/**
|
|
238
|
-
* Where a repo's `sync.import` stands, as `
|
|
266
|
+
* Where a repo's `sync.import` stands, as `Repos.importState` reads it: `running` while
|
|
239
267
|
* its tries run or wait, `cancelled` once `cancelImport` stopped it, `failed` once its last try
|
|
240
268
|
* failed, and `done` once its history is published. Only `done` holds the source's history.
|
|
241
269
|
*/
|
|
@@ -256,7 +284,7 @@ export interface ImportLfsMissed {
|
|
|
256
284
|
readonly reason: ImportLfsReason;
|
|
257
285
|
}
|
|
258
286
|
/**
|
|
259
|
-
* A repo's import as `
|
|
287
|
+
* A repo's import as `Repos.importState` reads it: its `state`, and, on a server with
|
|
260
288
|
* `Lfs.layer`, the Git LFS objects its history points at that it has copied, `copied` of them
|
|
261
289
|
* and `bytes`, and those it couldn't, `missing`, the first `importLfsMissedMost` of them by oid in
|
|
262
290
|
* `missed`. An import whose source misses an object still completes: the pointer is published,
|
|
@@ -274,6 +302,7 @@ export interface ImportStatus {
|
|
|
274
302
|
/** The feature's calls, bound to the server that built its Layer. */
|
|
275
303
|
export interface SyncCalls {
|
|
276
304
|
readonly import: (input: SyncImportInput) => Effect.Effect<RepoInfo, GitError>;
|
|
305
|
+
readonly deepen: (input: SyncDeepenInput) => Effect.Effect<RepoInfo, GitError>;
|
|
277
306
|
readonly cancelImport: (input: SyncCancelInput) => Effect.Effect<void, GitError>;
|
|
278
307
|
readonly mirror: (input: SyncMirrorInput) => Effect.Effect<MirrorState, GitError>;
|
|
279
308
|
readonly mirrors: (input: SyncMirrorsInput) => Effect.Effect<readonly MirrorState[], GitError>;
|
|
@@ -311,6 +340,34 @@ export declare const importRepo: (input: SyncImportInput) => Effect.Effect<{
|
|
|
311
340
|
};
|
|
312
341
|
};
|
|
313
342
|
}, GitError, Sync>;
|
|
343
|
+
export declare const deepen: (input: SyncDeepenInput) => Effect.Effect<{
|
|
344
|
+
readonly name: string;
|
|
345
|
+
readonly defaultBranch?: string;
|
|
346
|
+
readonly public: boolean;
|
|
347
|
+
readonly upstream?: string;
|
|
348
|
+
readonly shallow: boolean;
|
|
349
|
+
readonly stats: {
|
|
350
|
+
readonly repo: string;
|
|
351
|
+
readonly refs: number;
|
|
352
|
+
readonly packs?: number;
|
|
353
|
+
readonly packBytes?: number;
|
|
354
|
+
readonly ownBytes?: number;
|
|
355
|
+
readonly pushedAt?: number;
|
|
356
|
+
readonly maintainedAt?: number;
|
|
357
|
+
};
|
|
358
|
+
readonly work?: {
|
|
359
|
+
readonly waiting: number;
|
|
360
|
+
readonly oldestDue?: number;
|
|
361
|
+
readonly failed: number;
|
|
362
|
+
readonly oldestFailed?: number;
|
|
363
|
+
readonly index?: {
|
|
364
|
+
readonly state: "refused";
|
|
365
|
+
readonly retryAt: number;
|
|
366
|
+
} | {
|
|
367
|
+
readonly state: "too-large";
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
}, GitError, Sync>;
|
|
314
371
|
export declare const cancelImport: (input: SyncCancelInput) => Effect.Effect<void, GitError, Sync>;
|
|
315
372
|
export declare const mirror: (input: SyncMirrorInput) => Effect.Effect<{
|
|
316
373
|
readonly repo: string;
|
package/dist/contracts/sync.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { Oid, RefName } from "./ids.mjs";
|
|
|
2
2
|
import { FunctionValue } from "./opaque.mjs";
|
|
3
3
|
import { ClientCredentials } from "./remote.mjs";
|
|
4
4
|
import { WorkMeasure } from "./work.mjs";
|
|
5
|
-
import * as Effect from "effect/Effect";
|
|
6
5
|
import * as Schema from "effect/Schema";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
7
|
import * as Context from "effect/Context";
|
|
8
8
|
// src/contracts/sync.ts
|
|
9
9
|
/**
|
|
@@ -100,9 +100,10 @@ const ImportLfsReason = /* @__PURE__ */ Schema.Literals([
|
|
|
100
100
|
/** Import and mirroring, present only when the host composes Sync.layer. */
|
|
101
101
|
var Sync = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/Sync")) {};
|
|
102
102
|
const importRepo = (input) => Effect.flatMap(Sync, (sync) => sync.import(input));
|
|
103
|
+
const deepen = (input) => Effect.flatMap(Sync, (sync) => sync.deepen(input));
|
|
103
104
|
const cancelImport = (input) => Effect.flatMap(Sync, (sync) => sync.cancelImport(input));
|
|
104
105
|
const mirror = (input) => Effect.flatMap(Sync, (sync) => sync.mirror(input));
|
|
105
106
|
const mirrors = (input) => Effect.flatMap(Sync, (sync) => sync.mirrors(input));
|
|
106
107
|
const removeMirror = (input) => Effect.flatMap(Sync, (sync) => sync.removeMirror(input));
|
|
107
108
|
const publishImported = (input) => Effect.flatMap(Sync, (sync) => sync.publishImported(input));
|
|
108
|
-
export { ImportDepth, ImportJobData, ImportLfsReason, ImportPhase, MirrorJobData, MirrorPause, MirrorPush, Sync, SyncSource, SyncTransport, cancelImport, importDepthMost, importRepo, importedPullRefs, mirror, mirrors, publishImported, removeMirror };
|
|
109
|
+
export { ImportDepth, ImportJobData, ImportLfsReason, ImportPhase, MirrorJobData, MirrorPause, MirrorPush, Sync, SyncSource, SyncTransport, cancelImport, deepen, importDepthMost, importRepo, importedPullRefs, mirror, mirrors, publishImported, removeMirror };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Needing } from "./services.mjs";
|
|
2
2
|
import { Caller, WriteInput } from "./actors.mjs";
|
|
3
3
|
import { Acting, ObjectInput } from "./blobs.mjs";
|
|
4
4
|
import { ReadOptions, Tag, TagFields } from "./engine.mjs";
|
|
5
5
|
import { RepoName } from "./ids.mjs";
|
|
6
6
|
import { RepoInput } from "./repos.mjs";
|
|
7
7
|
import { GitError } from "./result.mjs";
|
|
8
|
-
import * as Effect from "effect/Effect";
|
|
9
8
|
import * as Schema from "effect/Schema";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
10
|
import * as Context from "effect/Context";
|
|
11
11
|
declare namespace tags_d_exports {
|
|
12
12
|
export { Peel, PeelInput, Peeled, TagCalls, TagCreateInput, Tags, create, get, peel, peelMost, peelTagsMost };
|
|
@@ -88,7 +88,7 @@ export interface TagCalls {
|
|
|
88
88
|
/** An annotated tag, written as its own commit; `refs.update` points `refs/tags/<tag>` at it. */
|
|
89
89
|
readonly create: (repo: RepoName, input: TagCreateInput) => Effect.Effect<Tag, GitError>;
|
|
90
90
|
}
|
|
91
|
-
declare const Tags_base: Context.ServiceClass<Tags, "@ref0/git/Tags",
|
|
91
|
+
declare const Tags_base: Context.ServiceClass<Tags, "@ref0/git/Tags", Needing<{
|
|
92
92
|
readonly get: (repo: string, input: Acting<ObjectInput>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
93
93
|
readonly oid: string;
|
|
94
94
|
readonly object: string;
|
package/dist/contracts/tags.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
2
2
|
import { Commit, Tag } from "./engine.mjs";
|
|
3
3
|
import { Oid } from "./ids.mjs";
|
|
4
4
|
import { ObjectType } from "./object-values.mjs";
|
|
5
|
-
import * as Effect from "effect/Effect";
|
|
6
5
|
import * as Schema from "effect/Schema";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
7
|
import * as Context from "effect/Context";
|
|
8
8
|
// src/contracts/tags.ts
|
|
9
9
|
var tags_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CallInput, NamedActor } from "./actors.mjs";
|
|
2
2
|
import { GitError } from "./result.mjs";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
3
|
import { Listing } from "@ref0/infra";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Context from "effect/Context";
|
|
7
7
|
export declare const TokenId: Schema.String;
|
|
8
8
|
export type TokenId = typeof TokenId.Type;
|
|
@@ -2,8 +2,8 @@ import { ActorId, NamedActor } from "./actors.mjs";
|
|
|
2
2
|
import { Page } from "./engine.mjs";
|
|
3
3
|
import { RepoName } from "./ids.mjs";
|
|
4
4
|
import { Moment } from "./repos.mjs";
|
|
5
|
-
import * as Effect from "effect/Effect";
|
|
6
5
|
import * as Schema from "effect/Schema";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
7
|
import * as Context from "effect/Context";
|
|
8
8
|
// src/contracts/tokens.ts
|
|
9
9
|
const TokenId = Schema.String;
|
|
@@ -2,11 +2,11 @@ import { Duration } from "./time.mjs";
|
|
|
2
2
|
import { ActorInput, WriteInput } from "./actors.mjs";
|
|
3
3
|
import { HandlerOptions } from "./handlers.mjs";
|
|
4
4
|
import { TopicId } from "./ids.mjs";
|
|
5
|
-
import { CandidateId, Report, ReportOptions,
|
|
6
|
-
import { DecisionAnswer, GitError
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import * as Schema from "effect/Schema";
|
|
5
|
+
import { CandidateId, Report, ReportOptions, Reported } from "./queue.mjs";
|
|
6
|
+
import { DecisionAnswer, GitError } from "./result.mjs";
|
|
9
7
|
import { Listing, Page } from "@ref0/infra";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
10
|
/** One repo's target in a topic: at most one entry a repo and target. */
|
|
11
11
|
export declare const TopicTarget: Schema.Struct<{
|
|
12
12
|
readonly repo: Schema.String;
|
|
@@ -175,16 +175,16 @@ export interface TopicReportInput extends ActorInput, Report {
|
|
|
175
175
|
readonly candidates: readonly CandidateId[];
|
|
176
176
|
}
|
|
177
177
|
export interface TopicCalls {
|
|
178
|
-
add(input: TopicAddInput):
|
|
179
|
-
get(topic: TopicId, input: ActorInput):
|
|
180
|
-
list(input: TopicListInput):
|
|
178
|
+
add(input: TopicAddInput): Effect.Effect<Topic, GitError>;
|
|
179
|
+
get(topic: TopicId, input: ActorInput): Effect.Effect<Topic, GitError>;
|
|
180
|
+
list(input: TopicListInput): Effect.Effect<Listing<Topic>, GitError>;
|
|
181
181
|
/**
|
|
182
182
|
* Removes the topic before its publish decision, which always works, and lets go of what it
|
|
183
183
|
* holds. It takes no `key`, since a topic keeps no receipts: sent again, it answers the removed
|
|
184
184
|
* topic, and of a failed topic, which is final, it answers that topic unchanged.
|
|
185
185
|
*/
|
|
186
|
-
remove(topic: TopicId, input: ActorInput):
|
|
187
|
-
report(topic: TopicId, input: TopicReportInput):
|
|
186
|
+
remove(topic: TopicId, input: ActorInput): Effect.Effect<Topic, GitError>;
|
|
187
|
+
report(topic: TopicId, input: TopicReportInput): Effect.Effect<Reported, GitError>;
|
|
188
188
|
}
|
|
189
189
|
/** What the topic report and `prepare` are asked about. */
|
|
190
190
|
export declare const TopicReportQuestion: Schema.Struct<{
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Needing } from "./services.mjs";
|
|
2
2
|
import { Caller, WriteInput } from "./actors.mjs";
|
|
3
3
|
import { Acting, CreatedObject } from "./blobs.mjs";
|
|
4
4
|
import { ReadOptions, ReadPage, TreeChanges, TreeDiffInput } from "./engine.mjs";
|
|
5
5
|
import { Oid, RepoName } from "./ids.mjs";
|
|
6
6
|
import { RepoInput } from "./repos.mjs";
|
|
7
7
|
import { GitError } from "./result.mjs";
|
|
8
|
-
import * as Effect from "effect/Effect";
|
|
9
|
-
import * as Schema from "effect/Schema";
|
|
10
8
|
import { Listing } from "@ref0/infra";
|
|
9
|
+
import * as Schema from "effect/Schema";
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
11
|
import * as Context from "effect/Context";
|
|
12
12
|
declare namespace trees_d_exports {
|
|
13
13
|
export { MergedTree, PublicTreeMerge, PublicTreeMergeInput, TreeCalls, TreeContentEdit, TreeCreateInput, TreeDeletion, TreeEdit, TreeEntry, TreeInput, TreeObjectEdit, Trees, create, diff, get, merge };
|
|
@@ -120,7 +120,7 @@ export interface TreeCalls {
|
|
|
120
120
|
*/
|
|
121
121
|
readonly merge: (repo: RepoName, input: PublicTreeMergeInput) => Effect.Effect<MergedTree, GitError>;
|
|
122
122
|
}
|
|
123
|
-
declare const Trees_base: Context.ServiceClass<Trees, "@ref0/git/Trees",
|
|
123
|
+
declare const Trees_base: Context.ServiceClass<Trees, "@ref0/git/Trees", Needing<{
|
|
124
124
|
readonly get: (repo: string, input: Acting<TreeInput>, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
|
|
125
125
|
readonly name: string;
|
|
126
126
|
readonly path: string;
|
package/dist/contracts/trees.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { PathBytes, RenamesSkipped } from "./engine.mjs";
|
|
3
3
|
import { Oid } from "./ids.mjs";
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
4
|
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Context from "effect/Context";
|
|
7
7
|
// src/contracts/trees.ts
|
|
8
8
|
var trees_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Needing } from "./services.mjs";
|
|
2
2
|
import { ActorInput, Caller } from "./actors.mjs";
|
|
3
3
|
import { InternalRepoId, RepoName } from "./ids.mjs";
|
|
4
4
|
import { RepoInput } from "./repos.mjs";
|
|
5
5
|
import { GitError } from "./result.mjs";
|
|
6
|
-
import * as Effect from "effect/Effect";
|
|
7
|
-
import * as Schema from "effect/Schema";
|
|
8
6
|
import { JobListRequest, JobRef, Listing } from "@ref0/infra";
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
9
|
import * as Context from "effect/Context";
|
|
10
10
|
declare namespace work_d_exports {
|
|
11
11
|
export { JobState, ProgressSample, Work, WorkByIdInput, WorkCalls, WorkItem, WorkListInput, WorkMeasure, WorkWrite, WorkWriteInput, discard, list, listById, retry };
|
|
@@ -98,7 +98,7 @@ export interface WorkCalls {
|
|
|
98
98
|
readonly retry: (repo: RepoName, input: WorkWriteInput) => Effect.Effect<void, GitError>;
|
|
99
99
|
readonly discard: (repo: RepoName, input: WorkWriteInput) => Effect.Effect<void, GitError>;
|
|
100
100
|
}
|
|
101
|
-
declare const Work_base: Context.ServiceClass<Work, "@ref0/git/Work",
|
|
101
|
+
declare const Work_base: Context.ServiceClass<Work, "@ref0/git/Work", Needing<{
|
|
102
102
|
readonly list: (repo: string, input: WorkListInput, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
|
|
103
103
|
readonly scope: string;
|
|
104
104
|
readonly name: string;
|
package/dist/contracts/work.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { Moment as Moment$1 } from "./repos.mjs";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
3
|
import { jobStates } from "@ref0/infra";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Context from "effect/Context";
|
|
7
7
|
// src/contracts/work.ts
|
|
8
8
|
var work_exports = /* @__PURE__ */ __exportAll({
|
package/dist/core/access.d.mts
CHANGED
|
@@ -13,8 +13,8 @@ import "../store/catalogue.mjs";
|
|
|
13
13
|
import "../store/records.mjs";
|
|
14
14
|
import "./receipts.mjs";
|
|
15
15
|
import "./parts.mjs";
|
|
16
|
-
import "effect/Effect";
|
|
17
16
|
import { JobInput, Moment, Read, Records } from "@ref0/infra";
|
|
17
|
+
import "effect/Effect";
|
|
18
18
|
/**
|
|
19
19
|
* What a push checks and saves beyond its refs: the push rules extensions add, after the host's
|
|
20
20
|
* `Rules`, and the host's hook groups, where their refusals and failures are told.
|