gitx.do 0.0.1
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/LICENSE +21 -0
- package/README.md +156 -0
- package/dist/durable-object/object-store.d.ts +113 -0
- package/dist/durable-object/object-store.d.ts.map +1 -0
- package/dist/durable-object/object-store.js +387 -0
- package/dist/durable-object/object-store.js.map +1 -0
- package/dist/durable-object/schema.d.ts +17 -0
- package/dist/durable-object/schema.d.ts.map +1 -0
- package/dist/durable-object/schema.js +43 -0
- package/dist/durable-object/schema.js.map +1 -0
- package/dist/durable-object/wal.d.ts +111 -0
- package/dist/durable-object/wal.d.ts.map +1 -0
- package/dist/durable-object/wal.js +200 -0
- package/dist/durable-object/wal.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +101 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/adapter.d.ts +231 -0
- package/dist/mcp/adapter.d.ts.map +1 -0
- package/dist/mcp/adapter.js +502 -0
- package/dist/mcp/adapter.js.map +1 -0
- package/dist/mcp/sandbox.d.ts +261 -0
- package/dist/mcp/sandbox.d.ts.map +1 -0
- package/dist/mcp/sandbox.js +983 -0
- package/dist/mcp/sandbox.js.map +1 -0
- package/dist/mcp/sdk-adapter.d.ts +413 -0
- package/dist/mcp/sdk-adapter.d.ts.map +1 -0
- package/dist/mcp/sdk-adapter.js +672 -0
- package/dist/mcp/sdk-adapter.js.map +1 -0
- package/dist/mcp/tools.d.ts +133 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +1604 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/ops/blame.d.ts +148 -0
- package/dist/ops/blame.d.ts.map +1 -0
- package/dist/ops/blame.js +754 -0
- package/dist/ops/blame.js.map +1 -0
- package/dist/ops/branch.d.ts +215 -0
- package/dist/ops/branch.d.ts.map +1 -0
- package/dist/ops/branch.js +608 -0
- package/dist/ops/branch.js.map +1 -0
- package/dist/ops/commit-traversal.d.ts +209 -0
- package/dist/ops/commit-traversal.d.ts.map +1 -0
- package/dist/ops/commit-traversal.js +755 -0
- package/dist/ops/commit-traversal.js.map +1 -0
- package/dist/ops/commit.d.ts +221 -0
- package/dist/ops/commit.d.ts.map +1 -0
- package/dist/ops/commit.js +606 -0
- package/dist/ops/commit.js.map +1 -0
- package/dist/ops/merge-base.d.ts +223 -0
- package/dist/ops/merge-base.d.ts.map +1 -0
- package/dist/ops/merge-base.js +581 -0
- package/dist/ops/merge-base.js.map +1 -0
- package/dist/ops/merge.d.ts +385 -0
- package/dist/ops/merge.d.ts.map +1 -0
- package/dist/ops/merge.js +1203 -0
- package/dist/ops/merge.js.map +1 -0
- package/dist/ops/tag.d.ts +182 -0
- package/dist/ops/tag.d.ts.map +1 -0
- package/dist/ops/tag.js +608 -0
- package/dist/ops/tag.js.map +1 -0
- package/dist/ops/tree-builder.d.ts +82 -0
- package/dist/ops/tree-builder.d.ts.map +1 -0
- package/dist/ops/tree-builder.js +246 -0
- package/dist/ops/tree-builder.js.map +1 -0
- package/dist/ops/tree-diff.d.ts +243 -0
- package/dist/ops/tree-diff.d.ts.map +1 -0
- package/dist/ops/tree-diff.js +657 -0
- package/dist/ops/tree-diff.js.map +1 -0
- package/dist/pack/delta.d.ts +68 -0
- package/dist/pack/delta.d.ts.map +1 -0
- package/dist/pack/delta.js +343 -0
- package/dist/pack/delta.js.map +1 -0
- package/dist/pack/format.d.ts +84 -0
- package/dist/pack/format.d.ts.map +1 -0
- package/dist/pack/format.js +261 -0
- package/dist/pack/format.js.map +1 -0
- package/dist/pack/full-generation.d.ts +327 -0
- package/dist/pack/full-generation.d.ts.map +1 -0
- package/dist/pack/full-generation.js +1159 -0
- package/dist/pack/full-generation.js.map +1 -0
- package/dist/pack/generation.d.ts +118 -0
- package/dist/pack/generation.d.ts.map +1 -0
- package/dist/pack/generation.js +459 -0
- package/dist/pack/generation.js.map +1 -0
- package/dist/pack/index.d.ts +181 -0
- package/dist/pack/index.d.ts.map +1 -0
- package/dist/pack/index.js +552 -0
- package/dist/pack/index.js.map +1 -0
- package/dist/refs/branch.d.ts +224 -0
- package/dist/refs/branch.d.ts.map +1 -0
- package/dist/refs/branch.js +170 -0
- package/dist/refs/branch.js.map +1 -0
- package/dist/refs/storage.d.ts +208 -0
- package/dist/refs/storage.d.ts.map +1 -0
- package/dist/refs/storage.js +421 -0
- package/dist/refs/storage.js.map +1 -0
- package/dist/refs/tag.d.ts +230 -0
- package/dist/refs/tag.d.ts.map +1 -0
- package/dist/refs/tag.js +188 -0
- package/dist/refs/tag.js.map +1 -0
- package/dist/storage/lru-cache.d.ts +188 -0
- package/dist/storage/lru-cache.d.ts.map +1 -0
- package/dist/storage/lru-cache.js +410 -0
- package/dist/storage/lru-cache.js.map +1 -0
- package/dist/storage/object-index.d.ts +140 -0
- package/dist/storage/object-index.d.ts.map +1 -0
- package/dist/storage/object-index.js +166 -0
- package/dist/storage/object-index.js.map +1 -0
- package/dist/storage/r2-pack.d.ts +394 -0
- package/dist/storage/r2-pack.d.ts.map +1 -0
- package/dist/storage/r2-pack.js +1062 -0
- package/dist/storage/r2-pack.js.map +1 -0
- package/dist/tiered/cdc-pipeline.d.ts +316 -0
- package/dist/tiered/cdc-pipeline.d.ts.map +1 -0
- package/dist/tiered/cdc-pipeline.js +771 -0
- package/dist/tiered/cdc-pipeline.js.map +1 -0
- package/dist/tiered/migration.d.ts +242 -0
- package/dist/tiered/migration.d.ts.map +1 -0
- package/dist/tiered/migration.js +592 -0
- package/dist/tiered/migration.js.map +1 -0
- package/dist/tiered/parquet-writer.d.ts +248 -0
- package/dist/tiered/parquet-writer.d.ts.map +1 -0
- package/dist/tiered/parquet-writer.js +555 -0
- package/dist/tiered/parquet-writer.js.map +1 -0
- package/dist/tiered/read-path.d.ts +141 -0
- package/dist/tiered/read-path.d.ts.map +1 -0
- package/dist/tiered/read-path.js +204 -0
- package/dist/tiered/read-path.js.map +1 -0
- package/dist/types/objects.d.ts +53 -0
- package/dist/types/objects.d.ts.map +1 -0
- package/dist/types/objects.js +291 -0
- package/dist/types/objects.js.map +1 -0
- package/dist/types/storage.d.ts +117 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/storage.js +8 -0
- package/dist/types/storage.js.map +1 -0
- package/dist/utils/hash.d.ts +31 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +60 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/sha1.d.ts +26 -0
- package/dist/utils/sha1.d.ts.map +1 -0
- package/dist/utils/sha1.js +127 -0
- package/dist/utils/sha1.js.map +1 -0
- package/dist/wire/capabilities.d.ts +236 -0
- package/dist/wire/capabilities.d.ts.map +1 -0
- package/dist/wire/capabilities.js +437 -0
- package/dist/wire/capabilities.js.map +1 -0
- package/dist/wire/pkt-line.d.ts +67 -0
- package/dist/wire/pkt-line.d.ts.map +1 -0
- package/dist/wire/pkt-line.js +145 -0
- package/dist/wire/pkt-line.js.map +1 -0
- package/dist/wire/receive-pack.d.ts +302 -0
- package/dist/wire/receive-pack.d.ts.map +1 -0
- package/dist/wire/receive-pack.js +885 -0
- package/dist/wire/receive-pack.js.map +1 -0
- package/dist/wire/smart-http.d.ts +321 -0
- package/dist/wire/smart-http.d.ts.map +1 -0
- package/dist/wire/smart-http.js +654 -0
- package/dist/wire/smart-http.js.map +1 -0
- package/dist/wire/upload-pack.d.ts +333 -0
- package/dist/wire/upload-pack.d.ts.map +1 -0
- package/dist/wire/upload-pack.js +850 -0
- package/dist/wire/upload-pack.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git upload-pack protocol implementation
|
|
3
|
+
*
|
|
4
|
+
* The upload-pack service is used by git-fetch and git-clone to retrieve
|
|
5
|
+
* objects from a remote repository.
|
|
6
|
+
*
|
|
7
|
+
* Protocol flow:
|
|
8
|
+
* 1. Server advertises refs (ref advertisement)
|
|
9
|
+
* 2. Client sends "want" lines for desired objects
|
|
10
|
+
* 3. Client sends "have" lines for objects it already has
|
|
11
|
+
* 4. Server responds with ACK/NAK
|
|
12
|
+
* 5. Server sends packfile with requested objects
|
|
13
|
+
*
|
|
14
|
+
* Reference: https://git-scm.com/docs/protocol-v2
|
|
15
|
+
* https://git-scm.com/docs/pack-protocol
|
|
16
|
+
*/
|
|
17
|
+
import type { ObjectType } from '../types/objects';
|
|
18
|
+
/**
|
|
19
|
+
* A reference (branch, tag, etc.) with its SHA and optional peeled value
|
|
20
|
+
*/
|
|
21
|
+
export interface Ref {
|
|
22
|
+
name: string;
|
|
23
|
+
sha: string;
|
|
24
|
+
peeled?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Capabilities supported by the upload-pack service
|
|
28
|
+
*/
|
|
29
|
+
export interface UploadPackCapabilities {
|
|
30
|
+
/** Side-band multiplexing for progress reporting */
|
|
31
|
+
sideBand?: boolean;
|
|
32
|
+
sideBand64k?: boolean;
|
|
33
|
+
/** Thin pack support - allows deltas against objects client has */
|
|
34
|
+
thinPack?: boolean;
|
|
35
|
+
/** Include tags that point to fetched objects */
|
|
36
|
+
includeTag?: boolean;
|
|
37
|
+
/** Shallow clone support */
|
|
38
|
+
shallow?: boolean;
|
|
39
|
+
/** Deepen relative to current shallow boundary */
|
|
40
|
+
deepenRelative?: boolean;
|
|
41
|
+
/** Don't send objects in common */
|
|
42
|
+
noProgress?: boolean;
|
|
43
|
+
/** Object filtering (partial clone) */
|
|
44
|
+
filter?: boolean;
|
|
45
|
+
/** Allow fetching reachable SHA-1 not advertised */
|
|
46
|
+
allowReachableSha1InWant?: boolean;
|
|
47
|
+
/** Allow fetching any SHA-1 */
|
|
48
|
+
allowAnySha1InWant?: boolean;
|
|
49
|
+
/** Multi-ack for better negotiation */
|
|
50
|
+
multiAck?: boolean;
|
|
51
|
+
multiAckDetailed?: boolean;
|
|
52
|
+
/** Object format (sha1 or sha256) */
|
|
53
|
+
objectFormat?: 'sha1' | 'sha256';
|
|
54
|
+
/** Protocol version */
|
|
55
|
+
agent?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Session state for an upload-pack operation
|
|
59
|
+
*/
|
|
60
|
+
export interface UploadPackSession {
|
|
61
|
+
/** Repository identifier */
|
|
62
|
+
repoId: string;
|
|
63
|
+
/** Advertised references */
|
|
64
|
+
refs: Ref[];
|
|
65
|
+
/** Capabilities negotiated with client */
|
|
66
|
+
capabilities: UploadPackCapabilities;
|
|
67
|
+
/** Objects the client wants */
|
|
68
|
+
wants: string[];
|
|
69
|
+
/** Objects the client already has */
|
|
70
|
+
haves: string[];
|
|
71
|
+
/** Common ancestors found during negotiation */
|
|
72
|
+
commonAncestors: string[];
|
|
73
|
+
/** Shallow boundary commits (for shallow clones) */
|
|
74
|
+
shallowCommits: string[];
|
|
75
|
+
/** Depth limit for shallow clone */
|
|
76
|
+
depth?: number;
|
|
77
|
+
/** Deepen-since timestamp */
|
|
78
|
+
deepenSince?: number;
|
|
79
|
+
/** Deepen-not refs */
|
|
80
|
+
deepenNot?: string[];
|
|
81
|
+
/** Whether negotiation is complete */
|
|
82
|
+
negotiationComplete: boolean;
|
|
83
|
+
/** Whether this is a stateless request (HTTP) */
|
|
84
|
+
stateless: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Result of want/have negotiation
|
|
88
|
+
*/
|
|
89
|
+
export interface WantHaveNegotiation {
|
|
90
|
+
/** ACK responses for common objects */
|
|
91
|
+
acks: Array<{
|
|
92
|
+
sha: string;
|
|
93
|
+
status: 'common' | 'ready' | 'continue';
|
|
94
|
+
}>;
|
|
95
|
+
/** Whether server has nothing in common (NAK) */
|
|
96
|
+
nak: boolean;
|
|
97
|
+
/** Common ancestor commits found */
|
|
98
|
+
commonAncestors: string[];
|
|
99
|
+
/** Objects the server needs to send */
|
|
100
|
+
objectsToSend: string[];
|
|
101
|
+
/** Whether negotiation is complete and packfile should be sent */
|
|
102
|
+
ready: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Side-band channel types
|
|
106
|
+
*/
|
|
107
|
+
export declare enum SideBandChannel {
|
|
108
|
+
/** Packfile data */
|
|
109
|
+
PACK_DATA = 1,
|
|
110
|
+
/** Progress messages */
|
|
111
|
+
PROGRESS = 2,
|
|
112
|
+
/** Error messages */
|
|
113
|
+
ERROR = 3
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Progress callback for packfile generation
|
|
117
|
+
*/
|
|
118
|
+
export type ProgressCallback = (message: string) => void;
|
|
119
|
+
/**
|
|
120
|
+
* Options for packfile generation
|
|
121
|
+
*/
|
|
122
|
+
export interface PackfileOptions {
|
|
123
|
+
/** Generate thin pack (use deltas against client's objects) */
|
|
124
|
+
thinPack?: boolean;
|
|
125
|
+
/** Include tags pointing to requested objects */
|
|
126
|
+
includeTag?: boolean;
|
|
127
|
+
/** Progress callback */
|
|
128
|
+
onProgress?: ProgressCallback;
|
|
129
|
+
/** Objects client already has (for thin pack) */
|
|
130
|
+
clientHasObjects?: string[];
|
|
131
|
+
/** Maximum delta depth */
|
|
132
|
+
maxDeltaDepth?: number;
|
|
133
|
+
/** Window size for delta compression */
|
|
134
|
+
deltaWindowSize?: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Result of packfile generation
|
|
138
|
+
*/
|
|
139
|
+
export interface PackfileResult {
|
|
140
|
+
/** The packfile data */
|
|
141
|
+
packfile: Uint8Array;
|
|
142
|
+
/** Number of objects in the pack */
|
|
143
|
+
objectCount: number;
|
|
144
|
+
/** Objects included in the pack */
|
|
145
|
+
includedObjects: string[];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Object storage interface for retrieving git objects
|
|
149
|
+
*/
|
|
150
|
+
export interface ObjectStore {
|
|
151
|
+
/** Get an object by SHA */
|
|
152
|
+
getObject(sha: string): Promise<{
|
|
153
|
+
type: ObjectType;
|
|
154
|
+
data: Uint8Array;
|
|
155
|
+
} | null>;
|
|
156
|
+
/** Check if object exists */
|
|
157
|
+
hasObject(sha: string): Promise<boolean>;
|
|
158
|
+
/** Get commit parents */
|
|
159
|
+
getCommitParents(sha: string): Promise<string[]>;
|
|
160
|
+
/** Get all refs */
|
|
161
|
+
getRefs(): Promise<Ref[]>;
|
|
162
|
+
/** Get objects reachable from a commit */
|
|
163
|
+
getReachableObjects(sha: string, depth?: number): Promise<string[]>;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Shallow clone info
|
|
167
|
+
*/
|
|
168
|
+
export interface ShallowInfo {
|
|
169
|
+
/** Commits at the shallow boundary */
|
|
170
|
+
shallowCommits: string[];
|
|
171
|
+
/** Commits that are no longer shallow */
|
|
172
|
+
unshallowCommits: string[];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Build capability string for ref advertisement
|
|
176
|
+
*
|
|
177
|
+
* @param capabilities - Capabilities to advertise
|
|
178
|
+
* @returns Space-separated capability string
|
|
179
|
+
*/
|
|
180
|
+
export declare function buildCapabilityString(capabilities: UploadPackCapabilities): string;
|
|
181
|
+
/**
|
|
182
|
+
* Parse capabilities from first want line
|
|
183
|
+
*
|
|
184
|
+
* @param capsString - Space-separated capabilities
|
|
185
|
+
* @returns Parsed capabilities
|
|
186
|
+
*/
|
|
187
|
+
export declare function parseCapabilities(capsString: string): UploadPackCapabilities;
|
|
188
|
+
/**
|
|
189
|
+
* Create a new upload-pack session
|
|
190
|
+
*
|
|
191
|
+
* @param repoId - Repository identifier
|
|
192
|
+
* @param refs - Available refs
|
|
193
|
+
* @param stateless - Whether this is a stateless (HTTP) request
|
|
194
|
+
* @returns New session object
|
|
195
|
+
*/
|
|
196
|
+
export declare function createSession(repoId: string, refs: Ref[], stateless?: boolean): UploadPackSession;
|
|
197
|
+
/**
|
|
198
|
+
* Parse a want line from the client
|
|
199
|
+
*
|
|
200
|
+
* @param line - The want line (e.g., "want <sha> [capabilities]")
|
|
201
|
+
* @returns Parsed SHA and capabilities
|
|
202
|
+
*/
|
|
203
|
+
export declare function parseWantLine(line: string): {
|
|
204
|
+
sha: string;
|
|
205
|
+
capabilities: UploadPackCapabilities;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Parse a have line from the client
|
|
209
|
+
*
|
|
210
|
+
* @param line - The have line (e.g., "have <sha>")
|
|
211
|
+
* @returns Parsed SHA
|
|
212
|
+
*/
|
|
213
|
+
export declare function parseHaveLine(line: string): string;
|
|
214
|
+
/**
|
|
215
|
+
* Advertise refs to the client
|
|
216
|
+
*
|
|
217
|
+
* @param store - Object store to get refs from
|
|
218
|
+
* @param capabilities - Server capabilities to advertise
|
|
219
|
+
* @returns Pkt-line formatted ref advertisement
|
|
220
|
+
*/
|
|
221
|
+
export declare function advertiseRefs(store: ObjectStore, capabilities?: Partial<UploadPackCapabilities>): Promise<string>;
|
|
222
|
+
/**
|
|
223
|
+
* Format an ACK response
|
|
224
|
+
*
|
|
225
|
+
* @param sha - The SHA being acknowledged
|
|
226
|
+
* @param status - ACK status (common, ready, continue, or none for simple ACK)
|
|
227
|
+
* @returns Pkt-line formatted ACK
|
|
228
|
+
*/
|
|
229
|
+
export declare function formatAck(sha: string, status?: 'common' | 'ready' | 'continue'): string;
|
|
230
|
+
/**
|
|
231
|
+
* Format a NAK response
|
|
232
|
+
*
|
|
233
|
+
* @returns Pkt-line formatted NAK
|
|
234
|
+
*/
|
|
235
|
+
export declare function formatNak(): string;
|
|
236
|
+
/**
|
|
237
|
+
* Process client wants and update session
|
|
238
|
+
*
|
|
239
|
+
* @param session - Current session state
|
|
240
|
+
* @param wants - Array of want SHAs
|
|
241
|
+
* @param store - Object store to verify objects exist
|
|
242
|
+
* @returns Updated session
|
|
243
|
+
*/
|
|
244
|
+
export declare function processWants(session: UploadPackSession, wants: string[], store: ObjectStore): Promise<UploadPackSession>;
|
|
245
|
+
/**
|
|
246
|
+
* Process client haves and perform negotiation
|
|
247
|
+
*
|
|
248
|
+
* @param session - Current session state
|
|
249
|
+
* @param haves - Array of have SHAs
|
|
250
|
+
* @param store - Object store to check for common objects
|
|
251
|
+
* @param done - Whether client is done sending haves
|
|
252
|
+
* @returns Negotiation result
|
|
253
|
+
*/
|
|
254
|
+
export declare function processHaves(session: UploadPackSession, haves: string[], store: ObjectStore, done: boolean): Promise<WantHaveNegotiation>;
|
|
255
|
+
/**
|
|
256
|
+
* Calculate objects needed by client
|
|
257
|
+
*
|
|
258
|
+
* Given wants and haves, determine minimal set of objects to send.
|
|
259
|
+
*
|
|
260
|
+
* @param store - Object store
|
|
261
|
+
* @param wants - Objects client wants
|
|
262
|
+
* @param haves - Objects client has
|
|
263
|
+
* @returns Set of object SHAs to include in packfile
|
|
264
|
+
*/
|
|
265
|
+
export declare function calculateMissingObjects(store: ObjectStore, wants: string[], haves: string[]): Promise<Set<string>>;
|
|
266
|
+
/**
|
|
267
|
+
* Process shallow/deepen commands
|
|
268
|
+
*
|
|
269
|
+
* @param session - Current session
|
|
270
|
+
* @param shallowLines - Shallow commit lines from client
|
|
271
|
+
* @param depth - Requested depth
|
|
272
|
+
* @param deepenSince - Timestamp to deepen since
|
|
273
|
+
* @param deepenNot - Refs to not deepen past
|
|
274
|
+
* @param store - Object store
|
|
275
|
+
* @returns Shallow info with boundary commits
|
|
276
|
+
*/
|
|
277
|
+
export declare function processShallow(session: UploadPackSession, shallowLines: string[], depth?: number, deepenSince?: number, deepenNot?: string[], store?: ObjectStore): Promise<ShallowInfo>;
|
|
278
|
+
/**
|
|
279
|
+
* Format shallow/unshallow lines for response
|
|
280
|
+
*
|
|
281
|
+
* @param shallowInfo - Shallow info to format
|
|
282
|
+
* @returns Pkt-line formatted shallow response
|
|
283
|
+
*/
|
|
284
|
+
export declare function formatShallowResponse(shallowInfo: ShallowInfo): string;
|
|
285
|
+
/**
|
|
286
|
+
* Wrap data in side-band format
|
|
287
|
+
*
|
|
288
|
+
* @param channel - Side-band channel (1=data, 2=progress, 3=error)
|
|
289
|
+
* @param data - Data to wrap
|
|
290
|
+
* @returns Pkt-line formatted side-band data
|
|
291
|
+
*/
|
|
292
|
+
export declare function wrapSideBand(channel: SideBandChannel, data: Uint8Array): Uint8Array;
|
|
293
|
+
/**
|
|
294
|
+
* Send progress message via side-band
|
|
295
|
+
*
|
|
296
|
+
* @param message - Progress message
|
|
297
|
+
* @returns Pkt-line formatted progress message
|
|
298
|
+
*/
|
|
299
|
+
export declare function formatProgress(message: string): Uint8Array;
|
|
300
|
+
/**
|
|
301
|
+
* Generate a packfile containing the requested objects
|
|
302
|
+
*
|
|
303
|
+
* @param store - Object store to get objects from
|
|
304
|
+
* @param wants - Objects the client wants
|
|
305
|
+
* @param haves - Objects the client already has
|
|
306
|
+
* @param options - Packfile generation options
|
|
307
|
+
* @returns Packfile result
|
|
308
|
+
*/
|
|
309
|
+
export declare function generatePackfile(store: ObjectStore, wants: string[], haves: string[], options?: PackfileOptions): Promise<PackfileResult>;
|
|
310
|
+
/**
|
|
311
|
+
* Generate thin pack with deltas against client's objects
|
|
312
|
+
*
|
|
313
|
+
* @param store - Object store
|
|
314
|
+
* @param objects - Objects to include
|
|
315
|
+
* @param clientHasObjects - Objects client already has (for delta bases)
|
|
316
|
+
* @returns Thin packfile
|
|
317
|
+
*/
|
|
318
|
+
export declare function generateThinPack(store: ObjectStore, objects: string[], clientHasObjects: string[]): Promise<PackfileResult>;
|
|
319
|
+
/**
|
|
320
|
+
* Handle a complete fetch request
|
|
321
|
+
*
|
|
322
|
+
* This is the main entry point that handles the full protocol flow:
|
|
323
|
+
* 1. Parse client request (wants, haves, capabilities)
|
|
324
|
+
* 2. Negotiate common ancestors
|
|
325
|
+
* 3. Generate and send packfile
|
|
326
|
+
*
|
|
327
|
+
* @param session - Upload pack session
|
|
328
|
+
* @param request - Raw request data
|
|
329
|
+
* @param store - Object store
|
|
330
|
+
* @returns Response data (ACKs/NAKs + packfile)
|
|
331
|
+
*/
|
|
332
|
+
export declare function handleFetch(session: UploadPackSession, request: string, store: ObjectStore): Promise<Uint8Array>;
|
|
333
|
+
//# sourceMappingURL=upload-pack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-pack.d.ts","sourceRoot":"","sources":["../../src/wire/upload-pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAQlD;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kDAAkD;IAClD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,mCAAmC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,oDAAoD;IACpD,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,+BAA+B;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAChC,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B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