@ref0/git 0.0.0 → 0.2.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/LICENSE +202 -0
- package/dist/access/private-refs.d.mts +27 -0
- package/dist/access/private-refs.mjs +173 -0
- package/dist/access.d.mts +2 -0
- package/dist/access.mjs +1 -0
- package/dist/auth/access-jwt.d.mts +21 -0
- package/dist/auth/access-jwt.mjs +102 -0
- package/dist/auth/acting.mjs +15 -0
- package/dist/auth/authorize.d.mts +5 -0
- package/dist/auth/authorize.mjs +292 -0
- package/dist/auth/credentials.mjs +57 -0
- package/dist/auth/fences.d.mts +5 -0
- package/dist/auth/fences.mjs +65 -0
- package/dist/auth/grants.mjs +61 -0
- package/dist/auth/helpers.d.mts +17 -0
- package/dist/auth/helpers.mjs +25 -0
- package/dist/auth/host-function.d.mts +4 -0
- package/dist/auth/host-function.mjs +69 -0
- package/dist/auth/identify.d.mts +6 -0
- package/dist/auth/identify.mjs +97 -0
- package/dist/auth/token-rows.mjs +100 -0
- package/dist/auth/token-text.mjs +66 -0
- package/dist/auth/tokens.d.mts +10 -0
- package/dist/auth/tokens.mjs +347 -0
- package/dist/auth.d.mts +7 -0
- package/dist/auth.mjs +6 -0
- package/dist/client/answer.mjs +141 -0
- package/dist/client/client.d.mts +23 -0
- package/dist/client/client.mjs +51 -0
- package/dist/client/git-http.mjs +201 -0
- package/dist/client/helper-node.mjs +19 -0
- package/dist/client/local.mjs +160 -0
- package/dist/client/negotiate.mjs +170 -0
- package/dist/client/push-upload.mjs +53 -0
- package/dist/client/remote-helper.mjs +129 -0
- package/dist/client/remote.mjs +398 -0
- package/dist/client/run-remote-helper.d.mts +35 -0
- package/dist/client/run-remote-helper.mjs +259 -0
- package/dist/client/scrub.d.mts +18 -0
- package/dist/client/scrub.mjs +38 -0
- package/dist/client/transport.d.mts +2 -0
- package/dist/client/transport.mjs +211 -0
- package/dist/contracts/access.d.mts +87 -0
- package/dist/contracts/actors.d.mts +144 -0
- package/dist/contracts/blobs.d.mts +38 -0
- package/dist/contracts/calls-spent.d.mts +11 -0
- package/dist/contracts/calls-spent.mjs +150 -0
- package/dist/contracts/client.d.mts +90 -0
- package/dist/contracts/commits.d.mts +126 -0
- package/dist/contracts/engine.d.mts +134 -0
- package/dist/contracts/events.d.mts +276 -0
- package/dist/contracts/files.d.mts +75 -0
- package/dist/contracts/forks.d.mts +78 -0
- package/dist/contracts/grants.d.mts +60 -0
- package/dist/contracts/handlers.d.mts +10 -0
- package/dist/contracts/ids.d.mts +15 -0
- package/dist/contracts/ids.mjs +15 -0
- package/dist/contracts/lfs.d.mts +27 -0
- package/dist/contracts/merges.d.mts +33 -0
- package/dist/contracts/objects.d.mts +645 -0
- package/dist/contracts/objects.mjs +54 -0
- package/dist/contracts/operations.d.mts +133 -0
- package/dist/contracts/promises.d.mts +63 -0
- package/dist/contracts/push-uploads.d.mts +44 -0
- package/dist/contracts/queue.d.mts +401 -0
- package/dist/contracts/refs.d.mts +95 -0
- package/dist/contracts/remote.d.mts +50 -0
- package/dist/contracts/repos.d.mts +153 -0
- package/dist/contracts/result.d.mts +126 -0
- package/dist/contracts/result.mjs +34 -0
- package/dist/contracts/rules.d.mts +159 -0
- package/dist/contracts/server.d.mts +245 -0
- package/dist/contracts/services.d.mts +36 -0
- package/dist/contracts/services.mjs +13 -0
- package/dist/contracts/signin.d.mts +126 -0
- package/dist/contracts/store.d.mts +41 -0
- package/dist/contracts/sync.d.mts +210 -0
- package/dist/contracts/sync.mjs +8 -0
- package/dist/contracts/tags.d.mts +50 -0
- package/dist/contracts/tags.mjs +6 -0
- package/dist/contracts/tokens.d.mts +87 -0
- package/dist/contracts/tokens.mjs +15 -0
- package/dist/contracts/topics.d.mts +174 -0
- package/dist/contracts/trees.d.mts +84 -0
- package/dist/contracts/work.d.mts +31 -0
- package/dist/core/access.d.mts +22 -0
- package/dist/core/access.mjs +262 -0
- package/dist/core/ancestry.mjs +235 -0
- package/dist/core/clock.mjs +18 -0
- package/dist/core/events/deliver.mjs +468 -0
- package/dist/core/events/stream.d.mts +19 -0
- package/dist/core/events/stream.mjs +290 -0
- package/dist/core/forks.mjs +1027 -0
- package/dist/core/hooks/post-receive.mjs +204 -0
- package/dist/core/hooks/pre-receive.d.mts +5 -0
- package/dist/core/hooks/pre-receive.mjs +34 -0
- package/dist/core/index-job.mjs +198 -0
- package/dist/core/names.mjs +30 -0
- package/dist/core/objects/blobs.mjs +60 -0
- package/dist/core/objects/commit-writes.mjs +185 -0
- package/dist/core/objects/commits.mjs +172 -0
- package/dist/core/objects/files.mjs +211 -0
- package/dist/core/objects/lines.mjs +42 -0
- package/dist/core/objects/merges.mjs +83 -0
- package/dist/core/objects/peel.mjs +166 -0
- package/dist/core/objects/reading.mjs +284 -0
- package/dist/core/objects/tags.mjs +96 -0
- package/dist/core/objects/tree-edits.mjs +266 -0
- package/dist/core/objects/trees.mjs +229 -0
- package/dist/core/objects/writing.mjs +266 -0
- package/dist/core/own-writes.mjs +94 -0
- package/dist/core/promise.mjs +46 -0
- package/dist/core/publish.mjs +142 -0
- package/dist/core/push-decide.mjs +206 -0
- package/dist/core/push.mjs +1069 -0
- package/dist/core/receipts.d.mts +7 -0
- package/dist/core/receipts.mjs +234 -0
- package/dist/core/ref-conflicts.mjs +27 -0
- package/dist/core/refs.mjs +359 -0
- package/dist/core/repack.mjs +521 -0
- package/dist/core/repos.mjs +752 -0
- package/dist/core/rules/changes.mjs +57 -0
- package/dist/core/rules/check.mjs +101 -0
- package/dist/core/rules/commit-changes.mjs +216 -0
- package/dist/core/rules/context.d.mts +9 -0
- package/dist/core/rules/context.mjs +120 -0
- package/dist/core/rules/define.d.mts +5 -0
- package/dist/core/rules/define.mjs +13 -0
- package/dist/core/rules/facts.mjs +13 -0
- package/dist/core/rules/fetch.d.mts +5 -0
- package/dist/core/rules/fetch.mjs +59 -0
- package/dist/core/rules/file-globs.mjs +55 -0
- package/dist/core/rules/files.mjs +142 -0
- package/dist/core/rules/patterns.mjs +23 -0
- package/dist/core/rules/protect.d.mts +9 -0
- package/dist/core/rules/protect.mjs +116 -0
- package/dist/core/seam.d.mts +24 -0
- package/dist/core/seam.mjs +41 -0
- package/dist/core/sight.mjs +99 -0
- package/dist/core/tokens.mjs +95 -0
- package/dist/core/view.d.mts +9 -0
- package/dist/core/view.mjs +221 -0
- package/dist/core/work.mjs +92 -0
- package/dist/effect.d.mts +20 -0
- package/dist/effect.mjs +18 -0
- package/dist/engine/allotted-xdiff.d.mts +4 -0
- package/dist/engine/allotted-xdiff.mjs +80 -0
- package/dist/engine/attribute-patterns.mjs +163 -0
- package/dist/engine/attributes.mjs +226 -0
- package/dist/engine/combined.mjs +653 -0
- package/dist/engine/commits.mjs +90 -0
- package/dist/engine/content.d.mts +4 -0
- package/dist/engine/content.mjs +221 -0
- package/dist/engine/diff.mjs +49 -0
- package/dist/engine/engine.d.mts +25 -0
- package/dist/engine/engine.mjs +49 -0
- package/dist/engine/failures.d.mts +4 -0
- package/dist/engine/failures.mjs +23 -0
- package/dist/engine/line-count.mjs +23 -0
- package/dist/engine/merge-base-walk.d.mts +2 -0
- package/dist/engine/merge-base-walk.mjs +265 -0
- package/dist/engine/merge-bases.mjs +27 -0
- package/dist/engine/merge-renames.mjs +165 -0
- package/dist/engine/merge.mjs +1125 -0
- package/dist/engine/parts.d.mts +8 -0
- package/dist/engine/parts.mjs +9 -0
- package/dist/engine/reads.d.mts +5 -0
- package/dist/engine/reads.mjs +105 -0
- package/dist/engine/walk.mjs +328 -0
- package/dist/engine/xdiff/NOTICE.md +63 -0
- package/dist/engine/xdiff/compiled.d.mts +7 -0
- package/dist/engine/xdiff/compiled.mjs +9 -0
- package/dist/engine/xdiff/embedded.mjs +4 -0
- package/dist/engine/xdiff/node.d.mts +7 -0
- package/dist/engine/xdiff/node.mjs +10 -0
- package/dist/engine/xdiff/upstream/LGPL-2.1 +511 -0
- package/dist/engine/xdiff/xdiff.wasm +0 -0
- package/dist/engine/xdiff.d.mts +34 -0
- package/dist/engine/xdiff.mjs +380 -0
- package/dist/engine.d.mts +3 -0
- package/dist/engine.mjs +3 -0
- package/dist/extend.d.mts +3 -0
- package/dist/extend.mjs +1 -0
- package/dist/http/answers.mjs +74 -0
- package/dist/http/bodies.mjs +143 -0
- package/dist/http/core-parts.mjs +252 -0
- package/dist/http/fetch-depth.mjs +26 -0
- package/dist/http/handler.mjs +94 -0
- package/dist/http/node.d.mts +70 -0
- package/dist/http/node.mjs +178 -0
- package/dist/http/paths.d.mts +9 -0
- package/dist/http/paths.mjs +118 -0
- package/dist/http/push-uploads.mjs +286 -0
- package/dist/http/receive-pack.mjs +235 -0
- package/dist/http/upload-pack.mjs +229 -0
- package/dist/index.d.mts +46 -0
- package/dist/index.mjs +16 -0
- package/dist/lfs/calls.mjs +16 -0
- package/dist/lfs/locks.mjs +161 -0
- package/dist/lfs/objects.mjs +370 -0
- package/dist/lfs/pointers.mjs +141 -0
- package/dist/lfs/repo.mjs +42 -0
- package/dist/lfs/rows.mjs +108 -0
- package/dist/lfs/service.mjs +34 -0
- package/dist/lfs/upkeep.mjs +162 -0
- package/dist/lfs/wire.mjs +102 -0
- package/dist/node.d.mts +3 -0
- package/dist/node.mjs +3 -0
- package/dist/protocol/bytes/buffers.d.mts +38 -0
- package/dist/protocol/bytes/buffers.mjs +62 -0
- package/dist/protocol/bytes/crc32.d.mts +4 -0
- package/dist/protocol/bytes/crc32.mjs +14 -0
- package/dist/protocol/bytes/deflate.d.mts +78 -0
- package/dist/protocol/bytes/deflate.mjs +175 -0
- package/dist/protocol/bytes/errors.d.mts +20 -0
- package/dist/protocol/bytes/errors.mjs +19 -0
- package/dist/protocol/bytes/hex.mjs +16 -0
- package/dist/protocol/bytes/hmac-sha256.mjs +91 -0
- package/dist/protocol/bytes/inflate.d.mts +40 -0
- package/dist/protocol/bytes/inflate.mjs +109 -0
- package/dist/protocol/bytes/joined.d.mts +2 -0
- package/dist/protocol/bytes/joined.mjs +25 -0
- package/dist/protocol/bytes/sha1-hasher.d.mts +20 -0
- package/dist/protocol/bytes/sha1-hasher.mjs +72 -0
- package/dist/protocol/bytes/sha1.d.mts +35 -0
- package/dist/protocol/bytes/sha1.mjs +409 -0
- package/dist/protocol/bytes/sha256.mjs +156 -0
- package/dist/protocol/bytes/streams.mjs +11 -0
- package/dist/protocol/bytes/text.mjs +19 -0
- package/dist/protocol/diff/diff-raw.d.mts +29 -0
- package/dist/protocol/diff/diff-raw.mjs +73 -0
- package/dist/protocol/diff/patch.mjs +92 -0
- package/dist/protocol/diff/paths.mjs +67 -0
- package/dist/protocol/diff/read.d.mts +62 -0
- package/dist/protocol/diff/read.mjs +342 -0
- package/dist/protocol/diff/rename-similarity.mjs +428 -0
- package/dist/protocol/diff/text.mjs +12 -0
- package/dist/protocol/diff/tree-diff.d.mts +41 -0
- package/dist/protocol/diff/tree-diff.mjs +607 -0
- package/dist/protocol/framing/band.d.mts +10 -0
- package/dist/protocol/framing/band.mjs +16 -0
- package/dist/protocol/framing/pkt-line.d.mts +48 -0
- package/dist/protocol/framing/pkt-line.mjs +92 -0
- package/dist/protocol/objects/checked-blobs.mjs +127 -0
- package/dist/protocol/objects/commit.d.mts +25 -0
- package/dist/protocol/objects/commit.mjs +138 -0
- package/dist/protocol/objects/fsck-gitmodules.mjs +296 -0
- package/dist/protocol/objects/fsck-names.mjs +189 -0
- package/dist/protocol/objects/fsck.mjs +297 -0
- package/dist/protocol/objects/headers.mjs +109 -0
- package/dist/protocol/objects/held.mjs +56 -0
- package/dist/protocol/objects/iconv.mjs +145 -0
- package/dist/protocol/objects/ident.mjs +111 -0
- package/dist/protocol/objects/lfs-pointer.d.mts +8 -0
- package/dist/protocol/objects/lfs-pointer.mjs +63 -0
- package/dist/protocol/objects/links-raw.mjs +89 -0
- package/dist/protocol/objects/object-rules.mjs +75 -0
- package/dist/protocol/objects/object.d.mts +16 -0
- package/dist/protocol/objects/object.mjs +29 -0
- package/dist/protocol/objects/tag.d.mts +21 -0
- package/dist/protocol/objects/tag.mjs +96 -0
- package/dist/protocol/objects/tree.d.mts +43 -0
- package/dist/protocol/objects/tree.mjs +162 -0
- package/dist/protocol/objects/utf8-verify.mjs +71 -0
- package/dist/protocol/packs/delta.d.mts +57 -0
- package/dist/protocol/packs/delta.mjs +229 -0
- package/dist/protocol/packs/graph.mjs +78 -0
- package/dist/protocol/packs/idx.d.mts +54 -0
- package/dist/protocol/packs/idx.mjs +274 -0
- package/dist/protocol/packs/indexer.d.mts +167 -0
- package/dist/protocol/packs/indexer.mjs +507 -0
- package/dist/protocol/packs/parts.d.mts +40 -0
- package/dist/protocol/packs/parts.mjs +89 -0
- package/dist/protocol/packs/pos.mjs +51 -0
- package/dist/protocol/packs/reader.d.mts +180 -0
- package/dist/protocol/packs/reader.mjs +414 -0
- package/dist/protocol/packs/rev.d.mts +32 -0
- package/dist/protocol/packs/rev.mjs +99 -0
- package/dist/protocol/packs/step.d.mts +10 -0
- package/dist/protocol/packs/step.mjs +12 -0
- package/dist/protocol/packs/write-error.d.mts +12 -0
- package/dist/protocol/packs/write-error.mjs +27 -0
- package/dist/protocol/packs/writer.d.mts +157 -0
- package/dist/protocol/packs/writer.mjs +353 -0
- package/dist/protocol/wire/advertisement.d.mts +72 -0
- package/dist/protocol/wire/advertisement.mjs +161 -0
- package/dist/protocol/wire/fetch.d.mts +155 -0
- package/dist/protocol/wire/fetch.mjs +458 -0
- package/dist/protocol/wire/lines.mjs +107 -0
- package/dist/protocol/wire/push-uploads.mjs +43 -0
- package/dist/protocol/wire/receive-pack.d.mts +71 -0
- package/dist/protocol/wire/receive-pack.mjs +157 -0
- package/dist/protocol/wire/report-status.d.mts +47 -0
- package/dist/protocol/wire/report-status.mjs +119 -0
- package/dist/protocol/wire/v2.d.mts +90 -0
- package/dist/protocol/wire/v2.mjs +185 -0
- package/dist/protocol.d.mts +31 -0
- package/dist/protocol.mjs +31 -0
- package/dist/queue/advance.mjs +1036 -0
- package/dist/queue/callers.mjs +134 -0
- package/dist/queue/calls.mjs +1154 -0
- package/dist/queue/commit.mjs +85 -0
- package/dist/queue/host.d.mts +15 -0
- package/dist/queue/host.mjs +88 -0
- package/dist/queue/ids.d.mts +5 -0
- package/dist/queue/ids.mjs +21 -0
- package/dist/queue/lanes.mjs +86 -0
- package/dist/queue/limits.mjs +99 -0
- package/dist/queue/pages.mjs +76 -0
- package/dist/queue/push-option.mjs +62 -0
- package/dist/queue/rows.mjs +206 -0
- package/dist/queue/schedule.mjs +132 -0
- package/dist/queue/search.mjs +315 -0
- package/dist/queue/state.mjs +325 -0
- package/dist/queue/steps.mjs +317 -0
- package/dist/remote-helper.d.mts +3 -0
- package/dist/remote-helper.mjs +3 -0
- package/dist/rest/api.d.mts +23 -0
- package/dist/rest/api.mjs +27 -0
- package/dist/rest/blobs.d.mts +58 -0
- package/dist/rest/blobs.mjs +41 -0
- package/dist/rest/caller.d.mts +102 -0
- package/dist/rest/caller.mjs +18 -0
- package/dist/rest/client.d.mts +18 -0
- package/dist/rest/client.mjs +587 -0
- package/dist/rest/commits.d.mts +435 -0
- package/dist/rest/commits.mjs +140 -0
- package/dist/rest/errors.d.mts +44 -0
- package/dist/rest/errors.mjs +186 -0
- package/dist/rest/events.d.mts +38 -0
- package/dist/rest/events.mjs +74 -0
- package/dist/rest/files.d.mts +179 -0
- package/dist/rest/files.mjs +92 -0
- package/dist/rest/forks.d.mts +205 -0
- package/dist/rest/forks.mjs +51 -0
- package/dist/rest/handler.d.mts +17 -0
- package/dist/rest/handler.mjs +106 -0
- package/dist/rest/handlers.d.mts +8 -0
- package/dist/rest/handlers.mjs +592 -0
- package/dist/rest/listen.d.mts +24 -0
- package/dist/rest/listen.mjs +142 -0
- package/dist/rest/me.d.mts +55 -0
- package/dist/rest/me.mjs +21 -0
- package/dist/rest/merges.d.mts +90 -0
- package/dist/rest/merges.mjs +39 -0
- package/dist/rest/paths.mjs +86 -0
- package/dist/rest/queue.d.mts +486 -0
- package/dist/rest/queue.mjs +228 -0
- package/dist/rest/refs.d.mts +232 -0
- package/dist/rest/refs.mjs +86 -0
- package/dist/rest/repos.d.mts +223 -0
- package/dist/rest/repos.mjs +93 -0
- package/dist/rest/tags.d.mts +153 -0
- package/dist/rest/tags.mjs +72 -0
- package/dist/rest/tokens.d.mts +297 -0
- package/dist/rest/tokens.mjs +88 -0
- package/dist/rest/topics.d.mts +257 -0
- package/dist/rest/topics.mjs +116 -0
- package/dist/rest/trees.d.mts +158 -0
- package/dist/rest/trees.mjs +118 -0
- package/dist/rest/wire.mjs +57 -0
- package/dist/rest/work.d.mts +107 -0
- package/dist/rest/work.mjs +77 -0
- package/dist/rest.d.mts +8 -0
- package/dist/rest.mjs +5 -0
- package/dist/server/extension.d.mts +14 -0
- package/dist/server/extension.mjs +85 -0
- package/dist/server/routes.d.mts +25 -0
- package/dist/server/routes.mjs +67 -0
- package/dist/server/server.d.mts +2 -0
- package/dist/server/server.mjs +439 -0
- package/dist/signin/codes.mjs +47 -0
- package/dist/signin/context.d.mts +9 -0
- package/dist/signin/context.mjs +121 -0
- package/dist/signin/device.mjs +122 -0
- package/dist/signin/forms.mjs +157 -0
- package/dist/signin/grants.d.mts +5 -0
- package/dist/signin/grants.mjs +257 -0
- package/dist/signin/route.mjs +68 -0
- package/dist/signin/web.mjs +125 -0
- package/dist/signin/wire.d.mts +42 -0
- package/dist/signin/wire.mjs +43 -0
- package/dist/storage/allotted.mjs +102 -0
- package/dist/storage/budget.mjs +96 -0
- package/dist/storage/calls.d.mts +18 -0
- package/dist/storage/calls.mjs +273 -0
- package/dist/storage/clean-up.mjs +124 -0
- package/dist/storage/distinct-ids.mjs +39 -0
- package/dist/storage/ewah.mjs +97 -0
- package/dist/storage/fetch.d.mts +13 -0
- package/dist/storage/fetch.mjs +792 -0
- package/dist/storage/fsck.mjs +77 -0
- package/dist/storage/held-memo.mjs +188 -0
- package/dist/storage/index-bitmaps.d.mts +4 -0
- package/dist/storage/index-bitmaps.mjs +654 -0
- package/dist/storage/index-build.d.mts +15 -0
- package/dist/storage/index-build.mjs +1433 -0
- package/dist/storage/index-fetch.d.mts +9 -0
- package/dist/storage/index-fetch.mjs +756 -0
- package/dist/storage/index-files.mjs +232 -0
- package/dist/storage/index-graph.d.mts +3 -0
- package/dist/storage/index-graph.mjs +1049 -0
- package/dist/storage/index-layers.mjs +317 -0
- package/dist/storage/index-reach.mjs +216 -0
- package/dist/storage/index-remap.d.mts +8 -0
- package/dist/storage/index-remap.mjs +592 -0
- package/dist/storage/layout.mjs +69 -0
- package/dist/storage/lfs-pointers.d.mts +21 -0
- package/dist/storage/lfs-pointers.mjs +175 -0
- package/dist/storage/link-join.mjs +106 -0
- package/dist/storage/links.mjs +105 -0
- package/dist/storage/loose.d.mts +15 -0
- package/dist/storage/loose.mjs +120 -0
- package/dist/storage/memory-budget.d.mts +8 -0
- package/dist/storage/memory-budget.mjs +546 -0
- package/dist/storage/merge.mjs +416 -0
- package/dist/storage/object-rows.d.mts +6 -0
- package/dist/storage/object-rows.mjs +211 -0
- package/dist/storage/pack-order.d.mts +8 -0
- package/dist/storage/pack-order.mjs +779 -0
- package/dist/storage/pack-ranges.d.mts +5 -0
- package/dist/storage/pack-ranges.mjs +284 -0
- package/dist/storage/pack-reads.d.mts +11 -0
- package/dist/storage/pack-reads.mjs +990 -0
- package/dist/storage/pack-receive.d.mts +11 -0
- package/dist/storage/pack-receive.mjs +449 -0
- package/dist/storage/packs.d.mts +56 -0
- package/dist/storage/packs.mjs +600 -0
- package/dist/storage/prune.mjs +506 -0
- package/dist/storage/push-allotment.mjs +109 -0
- package/dist/storage/push-uploads.mjs +151 -0
- package/dist/storage/pushed-commits.mjs +136 -0
- package/dist/storage/quarantine.mjs +98 -0
- package/dist/storage/raw-ids.mjs +44 -0
- package/dist/storage/ready.d.mts +19 -0
- package/dist/storage/ready.mjs +328 -0
- package/dist/storage/receive-links.mjs +297 -0
- package/dist/storage/repack-job.mjs +48 -0
- package/dist/storage/repack.d.mts +31 -0
- package/dist/storage/repack.mjs +182 -0
- package/dist/storage/roots.mjs +42 -0
- package/dist/storage/rows.d.mts +3 -0
- package/dist/storage/rows.mjs +71 -0
- package/dist/storage/shallow.d.mts +5 -0
- package/dist/storage/shallow.mjs +128 -0
- package/dist/storage/stream-whole.mjs +236 -0
- package/dist/storage/unpack.mjs +236 -0
- package/dist/storage/visible.mjs +137 -0
- package/dist/storage/walk.d.mts +7 -0
- package/dist/storage/walk.mjs +170 -0
- package/dist/storage/wants.mjs +362 -0
- package/dist/store/call-count.d.mts +47 -0
- package/dist/store/call-count.mjs +207 -0
- package/dist/store/catalogue.d.mts +7 -0
- package/dist/store/catalogue.mjs +643 -0
- package/dist/store/crossing.mjs +66 -0
- package/dist/store/cursor-seal.d.mts +2 -0
- package/dist/store/cursor-seal.mjs +85 -0
- package/dist/store/errors.d.mts +12 -0
- package/dist/store/errors.mjs +129 -0
- package/dist/store/git-store.mjs +75 -0
- package/dist/store/list-job.mjs +35 -0
- package/dist/store/outbox.d.mts +7 -0
- package/dist/store/outbox.mjs +295 -0
- package/dist/store/queue-jobs.mjs +43 -0
- package/dist/store/random.mjs +28 -0
- package/dist/store/records.d.mts +4 -0
- package/dist/store/records.mjs +192 -0
- package/dist/store/ref-rows.d.mts +4 -0
- package/dist/store/ref-rows.mjs +30 -0
- package/dist/store/repo-record.mjs +100 -0
- package/dist/store/reservations.mjs +82 -0
- package/dist/store/scopes.mjs +170 -0
- package/dist/store/settle.mjs +63 -0
- package/dist/store/topic-jobs.mjs +62 -0
- package/dist/sync/bound.d.mts +7 -0
- package/dist/sync/bound.mjs +29 -0
- package/dist/sync/github.d.mts +12 -0
- package/dist/sync/github.mjs +297 -0
- package/dist/sync/import.d.mts +8 -0
- package/dist/sync/import.mjs +154 -0
- package/dist/sync/jobs.d.mts +9 -0
- package/dist/sync/jobs.mjs +80 -0
- package/dist/sync/mirror.d.mts +9 -0
- package/dist/sync/mirror.mjs +227 -0
- package/dist/sync/publish.d.mts +5 -0
- package/dist/sync/publish.mjs +117 -0
- package/dist/sync/records.mjs +73 -0
- package/dist/sync/smart-http.d.mts +8 -0
- package/dist/sync/smart-http.mjs +23 -0
- package/dist/sync/step.mjs +334 -0
- package/dist/sync/tries.mjs +126 -0
- package/dist/sync.d.mts +8 -0
- package/dist/sync.mjs +8 -0
- package/dist/topics/advance.mjs +554 -0
- package/dist/topics/calls.mjs +346 -0
- package/dist/topics/directory.mjs +107 -0
- package/dist/topics/host.d.mts +11 -0
- package/dist/topics/host.mjs +71 -0
- package/dist/topics/members.mjs +177 -0
- package/dist/topics/rows.mjs +99 -0
- package/dist/topics/topic.mjs +126 -0
- package/package.json +86 -5
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Oid } from "../../contracts/ids.mjs";
|
|
2
|
+
import { WireDecodeError, WireEncodeError } from "../bytes/errors.mjs";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
/** The two services smart HTTP serves. */
|
|
5
|
+
export type GitService = 'git-upload-pack' | 'git-receive-pack';
|
|
6
|
+
/** A ref a server lists: its name, its object, and an annotated tag's object through every tag. */
|
|
7
|
+
export interface AdvertisedRef {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly oid: Oid;
|
|
10
|
+
readonly peeled?: Oid;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The refs a server lists for a reader: `head`, the branch `HEAD` names, the one symref, which
|
|
14
|
+
* resolves when `refs` holds it; and every ref the reader may see, in any order. `head` is left
|
|
15
|
+
* out when the reader may not see that branch, a private one: then no `HEAD` is listed, not even
|
|
16
|
+
* an unborn one, so its name isn't told.
|
|
17
|
+
*/
|
|
18
|
+
export interface ServedRefs {
|
|
19
|
+
readonly head?: string;
|
|
20
|
+
readonly refs: ReadonlyArray<AdvertisedRef>;
|
|
21
|
+
}
|
|
22
|
+
/** `HEAD`'s ref, when the branch it names has a commit. */
|
|
23
|
+
export declare const headOf: (served: ServedRefs) => AdvertisedRef | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* What `git-upload-pack` advertises in v0, in Git 2.53's order, less what this server doesn't
|
|
26
|
+
* do: `thin-pack`, since it sends whole packs; `no-done`, since it never says `ready`; and
|
|
27
|
+
* `deepen-since` and `deepen-not`, shallow clones by date and by ref. A want may name any object
|
|
28
|
+
* a readable ref reaches, as `allow-reachable-sha1-in-want` says, and `symref` names `HEAD`'s
|
|
29
|
+
* branch once it has a commit, as Git's does.
|
|
30
|
+
*/
|
|
31
|
+
export declare const uploadPackCapabilities: (served: ServedRefs, agent: string) => string[];
|
|
32
|
+
/**
|
|
33
|
+
* What `git-receive-pack` advertises, in Git 2.53's order, with `push-options`, which Git lists
|
|
34
|
+
* only when configured, and `no-thin`, since a push's pack must hold every object it needs. Not
|
|
35
|
+
* `ofs-delta`: a client then names each delta's base by ID, as `packs()` stores it. Last, ref0's
|
|
36
|
+
* own `push-upload=<above>`, when the server takes a large push's pack through the bucket.
|
|
37
|
+
*/
|
|
38
|
+
export declare const receivePackCapabilities: (agent: string, uploadAbove?: number) => string[];
|
|
39
|
+
/**
|
|
40
|
+
* `info/refs` for `service` in v0, as `git http-backend` answers it: the service line and a
|
|
41
|
+
* flush, then `served`'s refs with `capabilities` on the first. A ref or a capability that would
|
|
42
|
+
* break its line is refused.
|
|
43
|
+
*/
|
|
44
|
+
export declare const encodeAdvertisement: (service: GitService, served: ServedRefs, capabilities: ReadonlyArray<string>) => Effect.Effect<Uint8Array<ArrayBuffer>, WireEncodeError>;
|
|
45
|
+
/** What a client reads of a source's advertisement: the refs it keeps, and the branch `HEAD` names. */
|
|
46
|
+
export type SourceRefs = {
|
|
47
|
+
readonly kind: 'read';
|
|
48
|
+
/** Each kept ref at its own object, an annotated tag's at the tag; peeled `^{}` lines left out. */
|
|
49
|
+
readonly refs: ReadonlyMap<string, Oid>;
|
|
50
|
+
/** From the `symref` capability, such as `refs/heads/main`, or `undefined`. */
|
|
51
|
+
readonly headRef: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Whether it takes a want of a commit by its ID alone, as `allow-tip-sha1-in-want` or
|
|
54
|
+
* `allow-reachable-sha1-in-want` says: Git's own client sends one only then.
|
|
55
|
+
*/
|
|
56
|
+
readonly wantsById: boolean;
|
|
57
|
+
/** Every capability its first line lists, such as `side-band-64k` or `atomic`. */
|
|
58
|
+
readonly capabilities: ReadonlyArray<string>;
|
|
59
|
+
/** The commits a shallow source's history stops at, from its `shallow` lines. */
|
|
60
|
+
readonly shallows: ReadonlyArray<Oid>;
|
|
61
|
+
} | {
|
|
62
|
+
readonly kind: 'too many refs';
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* A source's refs, in one pass that keeps only those `keep` takes, at most `maxRefs` of them:
|
|
66
|
+
* a host may advertise far more, such as GitHub's pull requests' refs, which are never kept.
|
|
67
|
+
*/
|
|
68
|
+
export declare const advertisedSource: (bytes: Uint8Array, keep: (name: string) => boolean, maxRefs: number) => Effect.Effect<SourceRefs, WireDecodeError>;
|
|
69
|
+
/** The commit `HEAD` points at, as advertised, or `undefined` when the repository has none. */
|
|
70
|
+
export declare const advertisedHead: (bytes: Uint8Array) => Effect.Effect<Oid | undefined, WireDecodeError>;
|
|
71
|
+
/** Every ref advertised, by name, each at its own object: an annotated tag's is the tag's. */
|
|
72
|
+
export declare const advertisedRefs: (bytes: Uint8Array) => Effect.Effect<ReadonlyMap<string, Oid>, WireDecodeError>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { joinedBytes } from "../bytes/joined.mjs";
|
|
2
|
+
import { isOid, quoted } from "../bytes/text.mjs";
|
|
3
|
+
import { pktText, readPkt } from "../framing/pkt-line.mjs";
|
|
4
|
+
import { byName, decoded, isWord, listsRef, textLines, unwritable } from "./lines.mjs";
|
|
5
|
+
import { pushUploadOffer } from "./push-uploads.mjs";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Result from "effect/Result";
|
|
8
|
+
// src/protocol/wire/advertisement.ts
|
|
9
|
+
/**
|
|
10
|
+
* A ref advertisement, as smart HTTP's `info/refs` sends it in protocol v0: a service line and a
|
|
11
|
+
* flush, then one ref a line, `<oid> <ref>`, the first carrying capabilities after a NUL, then a
|
|
12
|
+
* flush. An empty repository advertises no refs, only `capabilities^{}` against the all-zero ID.
|
|
13
|
+
* `git-upload-pack` lists `HEAD` first and each annotated tag's peeled `<ref>^{}` after it;
|
|
14
|
+
* `git-receive-pack` lists neither.
|
|
15
|
+
*/
|
|
16
|
+
const zero = "0".repeat(40);
|
|
17
|
+
/** `HEAD`'s ref, when the branch it names has a commit. */
|
|
18
|
+
const headOf = (served) => served.refs.find((ref) => ref.name === served.head);
|
|
19
|
+
/**
|
|
20
|
+
* What `git-upload-pack` advertises in v0, in Git 2.53's order, less what this server doesn't
|
|
21
|
+
* do: `thin-pack`, since it sends whole packs; `no-done`, since it never says `ready`; and
|
|
22
|
+
* `deepen-since` and `deepen-not`, shallow clones by date and by ref. A want may name any object
|
|
23
|
+
* a readable ref reaches, as `allow-reachable-sha1-in-want` says, and `symref` names `HEAD`'s
|
|
24
|
+
* branch once it has a commit, as Git's does.
|
|
25
|
+
*/
|
|
26
|
+
const uploadPackCapabilities = (served, agent) => [
|
|
27
|
+
"multi_ack",
|
|
28
|
+
"side-band",
|
|
29
|
+
"side-band-64k",
|
|
30
|
+
"ofs-delta",
|
|
31
|
+
"shallow",
|
|
32
|
+
"deepen-relative",
|
|
33
|
+
"no-progress",
|
|
34
|
+
"include-tag",
|
|
35
|
+
"multi_ack_detailed",
|
|
36
|
+
"allow-reachable-sha1-in-want",
|
|
37
|
+
...headOf(served) === void 0 ? [] : [`symref=HEAD:${served.head}`],
|
|
38
|
+
"filter",
|
|
39
|
+
"object-format=sha1",
|
|
40
|
+
`agent=${agent}`
|
|
41
|
+
];
|
|
42
|
+
/**
|
|
43
|
+
* What `git-receive-pack` advertises, in Git 2.53's order, with `push-options`, which Git lists
|
|
44
|
+
* only when configured, and `no-thin`, since a push's pack must hold every object it needs. Not
|
|
45
|
+
* `ofs-delta`: a client then names each delta's base by ID, as `packs()` stores it. Last, ref0's
|
|
46
|
+
* own `push-upload=<above>`, when the server takes a large push's pack through the bucket.
|
|
47
|
+
*/
|
|
48
|
+
const receivePackCapabilities = (agent, uploadAbove) => [
|
|
49
|
+
"report-status",
|
|
50
|
+
"report-status-v2",
|
|
51
|
+
"delete-refs",
|
|
52
|
+
"side-band-64k",
|
|
53
|
+
"quiet",
|
|
54
|
+
"atomic",
|
|
55
|
+
"push-options",
|
|
56
|
+
"no-thin",
|
|
57
|
+
"object-format=sha1",
|
|
58
|
+
`agent=${agent}`,
|
|
59
|
+
...uploadAbove === void 0 ? [] : [pushUploadOffer(uploadAbove)]
|
|
60
|
+
];
|
|
61
|
+
/** The refs v0 lists, by Git's order: never one under a `hiddenRefs` prefix. */
|
|
62
|
+
const listed = (served) => served.refs.filter((ref) => listsRef(ref.name, [])).toSorted((a, b) => byName(a.name, b.name));
|
|
63
|
+
/**
|
|
64
|
+
* `info/refs` for `service` in v0, as `git http-backend` answers it: the service line and a
|
|
65
|
+
* flush, then `served`'s refs with `capabilities` on the first. A ref or a capability that would
|
|
66
|
+
* break its line is refused.
|
|
67
|
+
*/
|
|
68
|
+
const encodeAdvertisement = (service, served, capabilities) => Effect.gen(function* () {
|
|
69
|
+
const uploading = service === "git-upload-pack";
|
|
70
|
+
const head = uploading ? headOf(served) : void 0;
|
|
71
|
+
const refs = [...head === void 0 ? [] : [{
|
|
72
|
+
...head,
|
|
73
|
+
name: "HEAD"
|
|
74
|
+
}], ...listed(served)];
|
|
75
|
+
const broken = [...refs.map((ref) => ref.name), ...capabilities].find((text) => !isWord(text));
|
|
76
|
+
if (broken !== void 0) return yield* unwritable("advertisement", `${quoted(broken)} can't go on a line`);
|
|
77
|
+
const lines = [`# service=${service}\n`];
|
|
78
|
+
const caps = capabilities.join(" ");
|
|
79
|
+
const [first, ...rest] = refs;
|
|
80
|
+
const advertised = first === void 0 ? [`${zero} capabilities^{}\0${caps}\n`] : [first, ...rest].flatMap((ref, at) => [`${ref.oid} ${ref.name}${at === 0 ? `\0${caps}` : ""}\n`, ...uploading && ref.peeled !== void 0 ? [`${ref.peeled} ${ref.name}^{}\n`] : []]);
|
|
81
|
+
return joinedBytes([yield* textLines(lines, true), yield* textLines(advertised, true)]);
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* Reads an advertisement once, handing each line, `<oid> <name>`, to `visit`, which says
|
|
85
|
+
* whether to go on, and each `shallow <oid>` a shallow server lists to `shallow`; answers the
|
|
86
|
+
* first line's capabilities, or `'stopped'` once `visit` said stop. Nothing is kept of a line
|
|
87
|
+
* `visit` doesn't keep.
|
|
88
|
+
*/
|
|
89
|
+
function eachAdvertised(bytes, visit, shallow = () => void 0) {
|
|
90
|
+
let capabilities = [];
|
|
91
|
+
let offset = 0;
|
|
92
|
+
let flushes = 0;
|
|
93
|
+
let first = true;
|
|
94
|
+
while (flushes < 2) {
|
|
95
|
+
const read = readPkt(bytes, offset);
|
|
96
|
+
if (read.kind === "incomplete") return Result.fail("it ends before its last flush");
|
|
97
|
+
if (read.kind === "invalid") return Result.fail(read.reason);
|
|
98
|
+
offset = read.next;
|
|
99
|
+
if (read.pkt.kind === "flush") {
|
|
100
|
+
flushes += 1;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (read.pkt.kind !== "data" || flushes === 0) continue;
|
|
104
|
+
const text = pktText(read.pkt.data);
|
|
105
|
+
if (text === void 0) return Result.fail("a line isn't UTF-8");
|
|
106
|
+
const [line = "", listed] = text.split("\0");
|
|
107
|
+
if (first && listed !== void 0) capabilities = listed.split(" ").filter((capability) => capability.length > 0);
|
|
108
|
+
first = false;
|
|
109
|
+
const [id = "", name = ""] = line.split(" ");
|
|
110
|
+
if (id === "shallow" && isOid(name)) {
|
|
111
|
+
shallow(name);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (isOid(id) && id !== zero && !visit(id, name)) return Result.succeed("stopped");
|
|
115
|
+
}
|
|
116
|
+
return Result.succeed(capabilities);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A source's refs, in one pass that keeps only those `keep` takes, at most `maxRefs` of them:
|
|
120
|
+
* a host may advertise far more, such as GitHub's pull requests' refs, which are never kept.
|
|
121
|
+
*/
|
|
122
|
+
const advertisedSource = (bytes, keep, maxRefs) => decoded("advertisement", () => {
|
|
123
|
+
const refs = /* @__PURE__ */ new Map();
|
|
124
|
+
const shallows = [];
|
|
125
|
+
const read = eachAdvertised(bytes, (id, name) => {
|
|
126
|
+
if (!keep(name) || name.endsWith("^{}")) return true;
|
|
127
|
+
refs.set(name, id);
|
|
128
|
+
return refs.size <= maxRefs;
|
|
129
|
+
}, (oid) => {
|
|
130
|
+
if (shallows.length <= maxRefs) shallows.push(oid);
|
|
131
|
+
});
|
|
132
|
+
if (Result.isFailure(read)) return Result.fail(read.failure);
|
|
133
|
+
const capabilities = read.success;
|
|
134
|
+
if (capabilities === "stopped") return Result.succeed({ kind: "too many refs" });
|
|
135
|
+
const symref = capabilities.find((capability) => capability.startsWith("symref=HEAD:"));
|
|
136
|
+
return Result.succeed({
|
|
137
|
+
kind: "read",
|
|
138
|
+
refs,
|
|
139
|
+
headRef: symref?.slice(12),
|
|
140
|
+
wantsById: capabilities.some((capability) => capability === "allow-tip-sha1-in-want" || capability === "allow-reachable-sha1-in-want"),
|
|
141
|
+
capabilities,
|
|
142
|
+
shallows
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
/** Each advertised line, `<oid> <name>`. */
|
|
146
|
+
const advertisedLines = (bytes) => decoded("advertisement", () => {
|
|
147
|
+
const lines = [];
|
|
148
|
+
const read = eachAdvertised(bytes, (id, name) => {
|
|
149
|
+
lines.push({
|
|
150
|
+
id,
|
|
151
|
+
name
|
|
152
|
+
});
|
|
153
|
+
return true;
|
|
154
|
+
});
|
|
155
|
+
return Result.map(read, () => lines);
|
|
156
|
+
});
|
|
157
|
+
/** The commit `HEAD` points at, as advertised, or `undefined` when the repository has none. */
|
|
158
|
+
const advertisedHead = (bytes) => Effect.map(advertisedLines(bytes), (lines) => lines.find((line) => line.name === "HEAD")?.id);
|
|
159
|
+
/** Every ref advertised, by name, each at its own object: an annotated tag's is the tag's. */
|
|
160
|
+
const advertisedRefs = (bytes) => Effect.map(advertisedLines(bytes), (lines) => new Map(lines.filter((line) => line.name.startsWith("refs/") && !line.name.endsWith("^{}")).map((line) => [line.name, line.id])));
|
|
161
|
+
export { advertisedHead, advertisedRefs, advertisedSource, encodeAdvertisement, headOf, receivePackCapabilities, uploadPackCapabilities };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { FetchRequest, Filter } from "../../contracts/objects.mjs";
|
|
2
|
+
import { Oid } from "../../contracts/ids.mjs";
|
|
3
|
+
import { WireDecodeError, WireEncodeError } from "../bytes/errors.mjs";
|
|
4
|
+
import { Band } from "../framing/band.mjs";
|
|
5
|
+
import { V2Request } from "./v2.mjs";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Result from "effect/Result";
|
|
8
|
+
/**
|
|
9
|
+
* A fetch, one round at a time, as `git-upload-pack` negotiates it over stateless smart HTTP:
|
|
10
|
+
* each request holds the wants, any shallow, deepen and filter lines, then the haves, and ends in
|
|
11
|
+
* a flush, asking which haves the server holds, or `done`, asking for the pack. v0 sends the
|
|
12
|
+
* wants' capabilities on the want lines and answers with `ACK` and `NAK` lines; v2 sends them as
|
|
13
|
+
* `fetch`'s arguments and answers with an `acknowledgments` section, then a `packfile` one.
|
|
14
|
+
*/
|
|
15
|
+
/** How v0 answers a have: `ACK <oid>` once, `ACK <oid> continue`, or `ACK <oid> common`. */
|
|
16
|
+
export type AckMode = 'plain' | 'multi_ack' | 'multi_ack_detailed';
|
|
17
|
+
/** What a round asks of its answer, besides its `FetchRequest`. */
|
|
18
|
+
export interface FetchRound {
|
|
19
|
+
readonly request: FetchRequest;
|
|
20
|
+
/** Whether it said `done`, so the answer holds the pack, or ended in a flush. */
|
|
21
|
+
readonly done: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Set when a v0 body ends at its wants' flush, with no haves after, as Git's client sends its
|
|
24
|
+
* first round of a shallow fetch: the answer holds its shallow lines alone.
|
|
25
|
+
*/
|
|
26
|
+
readonly wantsOnly?: true;
|
|
27
|
+
/** v0's way of answering haves; v2 has one. */
|
|
28
|
+
readonly acks: AckMode;
|
|
29
|
+
/** The side-band the pack goes on, which v2 always takes, or none for a bare pack. */
|
|
30
|
+
readonly sideBand: 'side-band' | 'side-band-64k' | undefined;
|
|
31
|
+
/** Whether progress goes on band 2: not after `no-progress`. */
|
|
32
|
+
readonly progress: boolean;
|
|
33
|
+
readonly thinPack: boolean;
|
|
34
|
+
readonly ofsDelta: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** A `filter` line's spec, of the three Git filters this server takes: any other is refused. */
|
|
37
|
+
export declare function parseFilter(spec: string): Result.Result<Filter, string>;
|
|
38
|
+
/**
|
|
39
|
+
* Reads a whole v0 request to `git-upload-pack`, as `gitprotocol-pack` defines it: want, shallow,
|
|
40
|
+
* deepen and filter lines and a flush, then haves, ended by a flush or `done`, and nothing after.
|
|
41
|
+
* Each want line may carry capabilities after its ID, which set how the round is answered. A body
|
|
42
|
+
* of one flush wants nothing, and one that ends at its wants' flush is `wantsOnly`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const readFetchRound: (bytes: Uint8Array) => Effect.Effect<FetchRound, WireDecodeError>;
|
|
45
|
+
/**
|
|
46
|
+
* Reads v2 `fetch`'s arguments into a round, as `gitprotocol-v2` defines them: want, have,
|
|
47
|
+
* shallow, deepen and filter lines, and its flags. One that rides on a feature this server didn't
|
|
48
|
+
* advertise, such as `wait-for-done`, `want-ref`, `sideband-all` or `packfile-uris`, is refused.
|
|
49
|
+
*/
|
|
50
|
+
export declare const readFetch: (request: V2Request) => Effect.Effect<FetchRound, WireDecodeError>;
|
|
51
|
+
/**
|
|
52
|
+
* v0's answer to a round's haves, as `gitprotocol-pack`'s negotiation section says it, given
|
|
53
|
+
* `held`, the haves the server holds, in the order they came. With `multi_ack_detailed` each is `ACK <oid> common`,
|
|
54
|
+
* with `multi_ack` `ACK <oid> continue`, and plainly the first alone is `ACK <oid>`. A round ended
|
|
55
|
+
* by a flush then says `NAK` when none was held or it asked for `multi_ack`; one ended by `done`
|
|
56
|
+
* says `ACK <last held>` with `multi_ack`, nothing more plainly, or `NAK` when none was held.
|
|
57
|
+
* Never `ready` or `continue` for a have it lacks: the server doesn't judge when to give up.
|
|
58
|
+
*/
|
|
59
|
+
export declare const encodeV0Acks: (round: FetchRound, held: ReadonlyArray<Oid>) => Effect.Effect<Uint8Array<ArrayBuffer>, WireEncodeError>;
|
|
60
|
+
/**
|
|
61
|
+
* v2's `acknowledgments` section, for a round without `done`, as `gitprotocol-v2` defines it:
|
|
62
|
+
* `NAK` when none of its haves is held, else `ACK <oid>` for each in `held`, then a flush. Never
|
|
63
|
+
* `ready`, so the client goes on to its next round, or to `done`.
|
|
64
|
+
*/
|
|
65
|
+
export declare const encodeAcknowledgments: (held: ReadonlyArray<Oid>) => Effect.Effect<Uint8Array<ArrayBuffer>, WireEncodeError>;
|
|
66
|
+
/** v2's line that opens the pack, which then comes on side-band-64k and ends in a flush. */
|
|
67
|
+
export declare const packfileLine: Uint8Array;
|
|
68
|
+
/** The most a line of the old `side-band` holds past its band's byte: 1,000 bytes in all. */
|
|
69
|
+
export declare const maxSmallBandData: number;
|
|
70
|
+
/**
|
|
71
|
+
* `payload` as a round's answer carries it on `band`: in lines of `side-band` or `side-band-64k`,
|
|
72
|
+
* as it asked; band 1 bare and the others dropped when it asked for neither; and band 2 dropped
|
|
73
|
+
* after `no-progress`.
|
|
74
|
+
*/
|
|
75
|
+
export declare function onRoundBand(round: FetchRound, band: Band, payload: Uint8Array): Uint8Array;
|
|
76
|
+
/** What ends a round's pack: a flush after a side-band, nothing after a bare pack. */
|
|
77
|
+
export declare const fetchAnswerEnd: (round: FetchRound) => Uint8Array;
|
|
78
|
+
/**
|
|
79
|
+
* An `ERR` line, which Git's client prints as `remote error: <message>` and stops at, in v0 and v2
|
|
80
|
+
* alike. It ends without a newline, as `gitprotocol-pack`'s `error-line` does and Git writes it. A
|
|
81
|
+
* message holding a newline is refused, since the line would end early.
|
|
82
|
+
*/
|
|
83
|
+
export declare const encodeErr: (message: string) => Effect.Effect<Uint8Array<ArrayBuffer>, WireEncodeError>;
|
|
84
|
+
/** What Git says of a want it won't serve, which `fetchAnswerStart` reads as `missing`. */
|
|
85
|
+
export declare const notOurRef: (oid: Oid) => string;
|
|
86
|
+
/**
|
|
87
|
+
* Where a fetch's answer stands, read from its start: `missing` for a refusal of a commit it
|
|
88
|
+
* wants that the repo doesn't hold, which upload-pack answers first, as `ERR upload-pack: not our
|
|
89
|
+
* ref <oid>`; `refused` for any other `ERR` it answers first; `pack` at its first side-band line,
|
|
90
|
+
* which opens the pack in a v2 answer's `packfile` section and in a v0 answer past its
|
|
91
|
+
* acknowledgments, where a band-2 line goes before it; `other` for an answer with no side-band
|
|
92
|
+
* pack, or when `pack` isn't looked for; or `incomplete`, until more of it is read.
|
|
93
|
+
*/
|
|
94
|
+
export type FetchAnswerStart = {
|
|
95
|
+
readonly kind: 'missing';
|
|
96
|
+
} | {
|
|
97
|
+
readonly kind: 'refused';
|
|
98
|
+
} | {
|
|
99
|
+
readonly kind: 'pack';
|
|
100
|
+
readonly offset: number;
|
|
101
|
+
} | {
|
|
102
|
+
readonly kind: 'other';
|
|
103
|
+
} | {
|
|
104
|
+
readonly kind: 'incomplete';
|
|
105
|
+
};
|
|
106
|
+
/** Reads where a fetch's answer stands, which any bytes have: it never fails. */
|
|
107
|
+
export declare function fetchAnswerStart(bytes: Uint8Array, findPack: boolean): FetchAnswerStart;
|
|
108
|
+
/** A filter as its `filter` line spells it, which `parseFilter` reads back. */
|
|
109
|
+
export declare function filterSpec(filter: Filter): string;
|
|
110
|
+
/**
|
|
111
|
+
* One round of a fetch as a client sends it, which `readFetchRound` reads in v0 and `readFetch`
|
|
112
|
+
* in v2: its wants, shallows, depth and filter, its haves, then `done` or a flush. v0 puts the
|
|
113
|
+
* round's capabilities and `capabilities` on the first want line; v2 sends `capabilities` before
|
|
114
|
+
* the arguments, and the round's as flags. A round with no wants is refused, as v0 can't say one.
|
|
115
|
+
*/
|
|
116
|
+
export declare const encodeFetchRound: (version: 'v0' | 'v2', round: FetchRound, capabilities: ReadonlyArray<string>) => Effect.Effect<Uint8Array<ArrayBuffer>, WireEncodeError>;
|
|
117
|
+
/**
|
|
118
|
+
* What a client reads of a round's answer before its pack: `acks`, a whole answer to a round that
|
|
119
|
+
* negotiates, the haves the server holds and whether it said `ready`; `pack`, once the pack's first
|
|
120
|
+
* side-band line is at `offset`, with what came before it; `refused`, an `ERR` line's text; or
|
|
121
|
+
* `incomplete`, until more of it is read.
|
|
122
|
+
*/
|
|
123
|
+
export type FetchAnswerHead = {
|
|
124
|
+
readonly kind: 'incomplete';
|
|
125
|
+
} | {
|
|
126
|
+
readonly kind: 'refused';
|
|
127
|
+
readonly message: string;
|
|
128
|
+
} | {
|
|
129
|
+
readonly kind: 'acks';
|
|
130
|
+
readonly acks: ReadonlyArray<Oid>;
|
|
131
|
+
readonly ready: boolean;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: 'pack';
|
|
134
|
+
readonly acks: ReadonlyArray<Oid>;
|
|
135
|
+
readonly shallow: ReadonlyArray<Oid>;
|
|
136
|
+
readonly unshallow: ReadonlyArray<Oid>;
|
|
137
|
+
readonly offset: number;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Reads a v2 `fetch` answer's start, as `gitprotocol-v2` defines it: an `acknowledgments`
|
|
141
|
+
* section, ended by a flush, or by a delim after `ready`; then `shallow-info`, and `wanted-refs`
|
|
142
|
+
* and `packfile-uris`, which are skipped, each ended by a delim; then `packfile`, whose next line
|
|
143
|
+
* is the pack's first.
|
|
144
|
+
*/
|
|
145
|
+
export declare const readV2FetchAnswer: (bytes: Uint8Array) => Effect.Effect<FetchAnswerHead, WireDecodeError>;
|
|
146
|
+
/**
|
|
147
|
+
* Reads a v0 answer's start, as `gitprotocol-pack` defines it over stateless HTTP: `shallow` and
|
|
148
|
+
* `unshallow` lines and a flush first when the round deepened, then `ACK` and `NAK` lines. A round
|
|
149
|
+
* that said `done` goes on to its pack's first side-band line; one that didn't ends with the body,
|
|
150
|
+
* so `bytes` must hold it whole.
|
|
151
|
+
*/
|
|
152
|
+
export declare const readV0FetchAnswer: (bytes: Uint8Array, round: {
|
|
153
|
+
readonly deepened: boolean;
|
|
154
|
+
readonly done: boolean;
|
|
155
|
+
}) => Effect.Effect<FetchAnswerHead, WireDecodeError>;
|