gitx.do 0.0.1 → 0.0.3
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/cli/commands/blame.d.ts +259 -0
- package/dist/cli/commands/blame.d.ts.map +1 -0
- package/dist/cli/commands/blame.js +609 -0
- package/dist/cli/commands/blame.js.map +1 -0
- package/dist/cli/commands/branch.d.ts +249 -0
- package/dist/cli/commands/branch.d.ts.map +1 -0
- package/dist/cli/commands/branch.js +693 -0
- package/dist/cli/commands/branch.js.map +1 -0
- package/dist/cli/commands/commit.d.ts +182 -0
- package/dist/cli/commands/commit.d.ts.map +1 -0
- package/dist/cli/commands/commit.js +437 -0
- package/dist/cli/commands/commit.js.map +1 -0
- package/dist/cli/commands/diff.d.ts +464 -0
- package/dist/cli/commands/diff.d.ts.map +1 -0
- package/dist/cli/commands/diff.js +958 -0
- package/dist/cli/commands/diff.js.map +1 -0
- package/dist/cli/commands/log.d.ts +239 -0
- package/dist/cli/commands/log.d.ts.map +1 -0
- package/dist/cli/commands/log.js +535 -0
- package/dist/cli/commands/log.js.map +1 -0
- package/dist/cli/commands/review.d.ts +457 -0
- package/dist/cli/commands/review.d.ts.map +1 -0
- package/dist/cli/commands/review.js +533 -0
- package/dist/cli/commands/review.js.map +1 -0
- package/dist/cli/commands/status.d.ts +269 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +493 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/web.d.ts +199 -0
- package/dist/cli/commands/web.d.ts.map +1 -0
- package/dist/cli/commands/web.js +696 -0
- package/dist/cli/commands/web.js.map +1 -0
- package/dist/cli/fs-adapter.d.ts +656 -0
- package/dist/cli/fs-adapter.d.ts.map +1 -0
- package/dist/cli/fs-adapter.js +1179 -0
- package/dist/cli/fs-adapter.js.map +1 -0
- package/dist/cli/index.d.ts +387 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +523 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/ui/components/DiffView.d.ts +7 -0
- package/dist/cli/ui/components/DiffView.d.ts.map +1 -0
- package/dist/cli/ui/components/DiffView.js +11 -0
- package/dist/cli/ui/components/DiffView.js.map +1 -0
- package/dist/cli/ui/components/ErrorDisplay.d.ts +6 -0
- package/dist/cli/ui/components/ErrorDisplay.d.ts.map +1 -0
- package/dist/cli/ui/components/ErrorDisplay.js +11 -0
- package/dist/cli/ui/components/ErrorDisplay.js.map +1 -0
- package/dist/cli/ui/components/FuzzySearch.d.ts +9 -0
- package/dist/cli/ui/components/FuzzySearch.d.ts.map +1 -0
- package/dist/cli/ui/components/FuzzySearch.js +12 -0
- package/dist/cli/ui/components/FuzzySearch.js.map +1 -0
- package/dist/cli/ui/components/LoadingSpinner.d.ts +6 -0
- package/dist/cli/ui/components/LoadingSpinner.d.ts.map +1 -0
- package/dist/cli/ui/components/LoadingSpinner.js +10 -0
- package/dist/cli/ui/components/LoadingSpinner.js.map +1 -0
- package/dist/cli/ui/components/NavigationList.d.ts +9 -0
- package/dist/cli/ui/components/NavigationList.d.ts.map +1 -0
- package/dist/cli/ui/components/NavigationList.js +11 -0
- package/dist/cli/ui/components/NavigationList.js.map +1 -0
- package/dist/cli/ui/components/ScrollableContent.d.ts +8 -0
- package/dist/cli/ui/components/ScrollableContent.d.ts.map +1 -0
- package/dist/cli/ui/components/ScrollableContent.js +11 -0
- package/dist/cli/ui/components/ScrollableContent.js.map +1 -0
- package/dist/cli/ui/components/index.d.ts +7 -0
- package/dist/cli/ui/components/index.d.ts.map +1 -0
- package/dist/cli/ui/components/index.js +9 -0
- package/dist/cli/ui/components/index.js.map +1 -0
- package/dist/cli/ui/terminal-ui.d.ts +52 -0
- package/dist/cli/ui/terminal-ui.d.ts.map +1 -0
- package/dist/cli/ui/terminal-ui.js +121 -0
- package/dist/cli/ui/terminal-ui.js.map +1 -0
- package/dist/durable-object/object-store.d.ts +401 -23
- package/dist/durable-object/object-store.d.ts.map +1 -1
- package/dist/durable-object/object-store.js +414 -25
- package/dist/durable-object/object-store.js.map +1 -1
- package/dist/durable-object/schema.d.ts +188 -0
- package/dist/durable-object/schema.d.ts.map +1 -1
- package/dist/durable-object/schema.js +160 -0
- package/dist/durable-object/schema.js.map +1 -1
- package/dist/durable-object/wal.d.ts +336 -31
- package/dist/durable-object/wal.d.ts.map +1 -1
- package/dist/durable-object/wal.js +272 -27
- package/dist/durable-object/wal.js.map +1 -1
- package/dist/index.d.ts +379 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +379 -7
- package/dist/index.js.map +1 -1
- package/dist/mcp/adapter.d.ts +579 -38
- package/dist/mcp/adapter.d.ts.map +1 -1
- package/dist/mcp/adapter.js +426 -33
- package/dist/mcp/adapter.js.map +1 -1
- package/dist/mcp/sandbox.d.ts +532 -29
- package/dist/mcp/sandbox.d.ts.map +1 -1
- package/dist/mcp/sandbox.js +389 -22
- package/dist/mcp/sandbox.js.map +1 -1
- package/dist/mcp/sdk-adapter.d.ts +478 -56
- package/dist/mcp/sdk-adapter.d.ts.map +1 -1
- package/dist/mcp/sdk-adapter.js +346 -44
- package/dist/mcp/sdk-adapter.js.map +1 -1
- package/dist/mcp/tools.d.ts +445 -30
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +363 -33
- package/dist/mcp/tools.js.map +1 -1
- package/dist/ops/blame.d.ts +424 -21
- package/dist/ops/blame.d.ts.map +1 -1
- package/dist/ops/blame.js +303 -20
- package/dist/ops/blame.js.map +1 -1
- package/dist/ops/branch.d.ts +583 -32
- package/dist/ops/branch.d.ts.map +1 -1
- package/dist/ops/branch.js +365 -23
- package/dist/ops/branch.js.map +1 -1
- package/dist/ops/commit-traversal.d.ts +164 -24
- package/dist/ops/commit-traversal.d.ts.map +1 -1
- package/dist/ops/commit-traversal.js +68 -2
- package/dist/ops/commit-traversal.js.map +1 -1
- package/dist/ops/commit.d.ts +387 -53
- package/dist/ops/commit.d.ts.map +1 -1
- package/dist/ops/commit.js +249 -29
- package/dist/ops/commit.js.map +1 -1
- package/dist/ops/merge-base.d.ts +195 -21
- package/dist/ops/merge-base.d.ts.map +1 -1
- package/dist/ops/merge-base.js +122 -12
- package/dist/ops/merge-base.js.map +1 -1
- package/dist/ops/merge.d.ts +600 -130
- package/dist/ops/merge.d.ts.map +1 -1
- package/dist/ops/merge.js +408 -60
- package/dist/ops/merge.js.map +1 -1
- package/dist/ops/tag.d.ts +67 -2
- package/dist/ops/tag.d.ts.map +1 -1
- package/dist/ops/tag.js +42 -1
- package/dist/ops/tag.js.map +1 -1
- package/dist/ops/tree-builder.d.ts +102 -6
- package/dist/ops/tree-builder.d.ts.map +1 -1
- package/dist/ops/tree-builder.js +30 -5
- package/dist/ops/tree-builder.js.map +1 -1
- package/dist/ops/tree-diff.d.ts +50 -2
- package/dist/ops/tree-diff.d.ts.map +1 -1
- package/dist/ops/tree-diff.js +50 -2
- package/dist/ops/tree-diff.js.map +1 -1
- package/dist/pack/delta.d.ts +211 -39
- package/dist/pack/delta.d.ts.map +1 -1
- package/dist/pack/delta.js +232 -46
- package/dist/pack/delta.js.map +1 -1
- package/dist/pack/format.d.ts +390 -28
- package/dist/pack/format.d.ts.map +1 -1
- package/dist/pack/format.js +344 -33
- package/dist/pack/format.js.map +1 -1
- package/dist/pack/full-generation.d.ts +313 -28
- package/dist/pack/full-generation.d.ts.map +1 -1
- package/dist/pack/full-generation.js +238 -19
- package/dist/pack/full-generation.js.map +1 -1
- package/dist/pack/generation.d.ts +346 -23
- package/dist/pack/generation.d.ts.map +1 -1
- package/dist/pack/generation.js +269 -21
- package/dist/pack/generation.js.map +1 -1
- package/dist/pack/index.d.ts +407 -86
- package/dist/pack/index.d.ts.map +1 -1
- package/dist/pack/index.js +351 -70
- package/dist/pack/index.js.map +1 -1
- package/dist/refs/branch.d.ts +517 -71
- package/dist/refs/branch.d.ts.map +1 -1
- package/dist/refs/branch.js +410 -26
- package/dist/refs/branch.js.map +1 -1
- package/dist/refs/storage.d.ts +610 -57
- package/dist/refs/storage.d.ts.map +1 -1
- package/dist/refs/storage.js +481 -29
- package/dist/refs/storage.js.map +1 -1
- package/dist/refs/tag.d.ts +677 -67
- package/dist/refs/tag.d.ts.map +1 -1
- package/dist/refs/tag.js +497 -30
- package/dist/refs/tag.js.map +1 -1
- package/dist/storage/lru-cache.d.ts +556 -53
- package/dist/storage/lru-cache.d.ts.map +1 -1
- package/dist/storage/lru-cache.js +439 -36
- package/dist/storage/lru-cache.js.map +1 -1
- package/dist/storage/object-index.d.ts +483 -38
- package/dist/storage/object-index.d.ts.map +1 -1
- package/dist/storage/object-index.js +388 -22
- package/dist/storage/object-index.js.map +1 -1
- package/dist/storage/r2-pack.d.ts +957 -94
- package/dist/storage/r2-pack.d.ts.map +1 -1
- package/dist/storage/r2-pack.js +756 -48
- package/dist/storage/r2-pack.js.map +1 -1
- package/dist/tiered/cdc-pipeline.d.ts +1610 -38
- package/dist/tiered/cdc-pipeline.d.ts.map +1 -1
- package/dist/tiered/cdc-pipeline.js +1131 -22
- package/dist/tiered/cdc-pipeline.js.map +1 -1
- package/dist/tiered/migration.d.ts +903 -41
- package/dist/tiered/migration.d.ts.map +1 -1
- package/dist/tiered/migration.js +646 -24
- package/dist/tiered/migration.js.map +1 -1
- package/dist/tiered/parquet-writer.d.ts +944 -47
- package/dist/tiered/parquet-writer.d.ts.map +1 -1
- package/dist/tiered/parquet-writer.js +667 -39
- package/dist/tiered/parquet-writer.js.map +1 -1
- package/dist/tiered/read-path.d.ts +728 -34
- package/dist/tiered/read-path.d.ts.map +1 -1
- package/dist/tiered/read-path.js +310 -27
- package/dist/tiered/read-path.js.map +1 -1
- package/dist/types/objects.d.ts +457 -0
- package/dist/types/objects.d.ts.map +1 -1
- package/dist/types/objects.js +305 -4
- package/dist/types/objects.js.map +1 -1
- package/dist/types/storage.d.ts +407 -35
- package/dist/types/storage.d.ts.map +1 -1
- package/dist/types/storage.js +27 -3
- package/dist/types/storage.js.map +1 -1
- package/dist/utils/hash.d.ts +133 -12
- package/dist/utils/hash.d.ts.map +1 -1
- package/dist/utils/hash.js +133 -12
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/sha1.d.ts +102 -9
- package/dist/utils/sha1.d.ts.map +1 -1
- package/dist/utils/sha1.js +114 -11
- package/dist/utils/sha1.js.map +1 -1
- package/dist/wire/capabilities.d.ts +896 -88
- package/dist/wire/capabilities.d.ts.map +1 -1
- package/dist/wire/capabilities.js +566 -62
- package/dist/wire/capabilities.js.map +1 -1
- package/dist/wire/pkt-line.d.ts +293 -15
- package/dist/wire/pkt-line.d.ts.map +1 -1
- package/dist/wire/pkt-line.js +251 -15
- package/dist/wire/pkt-line.js.map +1 -1
- package/dist/wire/receive-pack.d.ts +814 -64
- package/dist/wire/receive-pack.d.ts.map +1 -1
- package/dist/wire/receive-pack.js +542 -41
- package/dist/wire/receive-pack.js.map +1 -1
- package/dist/wire/smart-http.d.ts +575 -97
- package/dist/wire/smart-http.d.ts.map +1 -1
- package/dist/wire/smart-http.js +337 -46
- package/dist/wire/smart-http.js.map +1 -1
- package/dist/wire/upload-pack.d.ts +492 -98
- package/dist/wire/upload-pack.d.ts.map +1 -1
- package/dist/wire/upload-pack.js +347 -59
- package/dist/wire/upload-pack.js.map +1 -1
- package/package.json +10 -2
package/dist/pack/format.js
CHANGED
|
@@ -1,42 +1,131 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Git Packfile Format Implementation
|
|
2
|
+
* @fileoverview Git Packfile Format Implementation
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* - 4 bytes: version number (network byte order, big-endian)
|
|
8
|
-
* - 4 bytes: number of objects (network byte order)
|
|
9
|
-
* - N objects: each object has header + compressed data
|
|
10
|
-
* - 20 bytes: SHA-1 checksum of all preceding content
|
|
4
|
+
* This module implements the Git packfile format specification, providing utilities
|
|
5
|
+
* for creating, parsing, and manipulating Git packfiles. Packfiles are Git's primary
|
|
6
|
+
* mechanism for efficient storage and network transfer of repository objects.
|
|
11
7
|
*
|
|
12
|
-
*
|
|
8
|
+
* ## Packfile Structure
|
|
9
|
+
*
|
|
10
|
+
* A packfile consists of:
|
|
11
|
+
* - **Header (12 bytes)**:
|
|
12
|
+
* - 4 bytes: "PACK" signature
|
|
13
|
+
* - 4 bytes: version number (network byte order, big-endian) - currently version 2
|
|
14
|
+
* - 4 bytes: number of objects (network byte order)
|
|
15
|
+
* - **Object entries (variable length)**:
|
|
16
|
+
* - Each object has a variable-length header followed by zlib-compressed data
|
|
17
|
+
* - **Trailer (20 bytes)**:
|
|
18
|
+
* - SHA-1 checksum of all preceding content
|
|
19
|
+
*
|
|
20
|
+
* ## Object Header Encoding
|
|
21
|
+
*
|
|
22
|
+
* The object header uses a variable-length encoding:
|
|
13
23
|
* - First byte: (MSB) continuation bit | 3-bit type | 4-bit size LSB
|
|
14
|
-
* - Subsequent bytes: (MSB) continuation bit | 7-bit size
|
|
15
|
-
*
|
|
16
|
-
* Object
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
24
|
+
* - Subsequent bytes: (MSB) continuation bit | 7-bit size continuation
|
|
25
|
+
*
|
|
26
|
+
* ## Supported Object Types
|
|
27
|
+
*
|
|
28
|
+
* | Type Code | Name | Description |
|
|
29
|
+
* |-----------|-----------|------------------------------------------------|
|
|
30
|
+
* | 1 | commit | A commit object |
|
|
31
|
+
* | 2 | tree | A tree object (directory listing) |
|
|
32
|
+
* | 3 | blob | A blob object (file content) |
|
|
33
|
+
* | 4 | tag | An annotated tag object |
|
|
34
|
+
* | 6 | ofs_delta | Delta referencing base by offset |
|
|
35
|
+
* | 7 | ref_delta | Delta referencing base by SHA-1 |
|
|
36
|
+
*
|
|
37
|
+
* @module pack/format
|
|
38
|
+
* @see {@link https://git-scm.com/docs/pack-format} Git Pack Format Documentation
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Creating a simple packfile
|
|
42
|
+
* import { createPackfile, PackableObject } from './format';
|
|
43
|
+
*
|
|
44
|
+
* const objects: PackableObject[] = [
|
|
45
|
+
* { type: 'blob', data: new TextEncoder().encode('Hello, World!') }
|
|
46
|
+
* ];
|
|
47
|
+
*
|
|
48
|
+
* const packfile = createPackfile(objects);
|
|
49
|
+
* // packfile is now a Uint8Array containing the complete packfile
|
|
23
50
|
*/
|
|
24
51
|
import pako from 'pako';
|
|
25
52
|
import { sha1 } from '../utils/sha1';
|
|
26
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The 4-byte ASCII signature that identifies a valid packfile.
|
|
55
|
+
* Every packfile must begin with these bytes: 0x50 0x41 0x43 0x4b ("PACK").
|
|
56
|
+
*
|
|
57
|
+
* @constant {string}
|
|
58
|
+
* @example
|
|
59
|
+
* // Validate packfile signature
|
|
60
|
+
* const signature = String.fromCharCode(...packData.slice(0, 4));
|
|
61
|
+
* if (signature !== PACK_SIGNATURE) {
|
|
62
|
+
* throw new Error('Invalid packfile');
|
|
63
|
+
* }
|
|
64
|
+
*/
|
|
27
65
|
export const PACK_SIGNATURE = 'PACK';
|
|
66
|
+
/**
|
|
67
|
+
* The packfile version number supported by this implementation.
|
|
68
|
+
* Currently, only version 2 is widely used and supported.
|
|
69
|
+
*
|
|
70
|
+
* @constant {number}
|
|
71
|
+
*/
|
|
28
72
|
export const PACK_VERSION = 2;
|
|
29
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Enumeration of Git pack object types.
|
|
75
|
+
*
|
|
76
|
+
* These values are used in the packfile header to identify the type of each object.
|
|
77
|
+
* Note that types 0 and 5 are reserved/unused in the Git pack format.
|
|
78
|
+
*
|
|
79
|
+
* @description Represents the different types of objects that can be stored in a Git packfile.
|
|
80
|
+
* Delta types (OFS_DELTA and REF_DELTA) are used for efficient storage by referencing
|
|
81
|
+
* a base object and storing only the differences.
|
|
82
|
+
*
|
|
83
|
+
* @enum {number}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* // Check if an object is a delta type
|
|
87
|
+
* function isDelta(type: PackObjectType): boolean {
|
|
88
|
+
* return type === PackObjectType.OBJ_OFS_DELTA || type === PackObjectType.OBJ_REF_DELTA;
|
|
89
|
+
* }
|
|
90
|
+
*/
|
|
30
91
|
export var PackObjectType;
|
|
31
92
|
(function (PackObjectType) {
|
|
93
|
+
/** A commit object containing tree reference, parent commits, author, and message */
|
|
32
94
|
PackObjectType[PackObjectType["OBJ_COMMIT"] = 1] = "OBJ_COMMIT";
|
|
95
|
+
/** A tree object representing a directory structure */
|
|
33
96
|
PackObjectType[PackObjectType["OBJ_TREE"] = 2] = "OBJ_TREE";
|
|
97
|
+
/** A blob object containing file content */
|
|
34
98
|
PackObjectType[PackObjectType["OBJ_BLOB"] = 3] = "OBJ_BLOB";
|
|
99
|
+
/** An annotated tag object */
|
|
35
100
|
PackObjectType[PackObjectType["OBJ_TAG"] = 4] = "OBJ_TAG";
|
|
101
|
+
/** An offset delta - references base object by byte offset within the packfile */
|
|
36
102
|
PackObjectType[PackObjectType["OBJ_OFS_DELTA"] = 6] = "OBJ_OFS_DELTA";
|
|
103
|
+
/** A reference delta - references base object by its SHA-1 hash */
|
|
37
104
|
PackObjectType[PackObjectType["OBJ_REF_DELTA"] = 7] = "OBJ_REF_DELTA";
|
|
38
105
|
})(PackObjectType || (PackObjectType = {}));
|
|
39
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Converts a PackObjectType enum value to its string representation.
|
|
108
|
+
*
|
|
109
|
+
* @description Converts numeric pack object types to their human-readable string names.
|
|
110
|
+
* This is useful for logging, debugging, and when interfacing with Git's loose object format.
|
|
111
|
+
*
|
|
112
|
+
* @param {PackObjectType} type - The numeric pack object type to convert
|
|
113
|
+
* @returns {string} The string name of the object type ('commit', 'tree', 'blob', 'tag', 'ofs_delta', or 'ref_delta')
|
|
114
|
+
* @throws {Error} If the type is not a valid PackObjectType value
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* // Convert type for display
|
|
118
|
+
* const type = PackObjectType.OBJ_BLOB;
|
|
119
|
+
* console.log(`Object type: ${packObjectTypeToString(type)}`); // "Object type: blob"
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* // Use in error messages
|
|
123
|
+
* function validateObject(type: PackObjectType, data: Uint8Array) {
|
|
124
|
+
* if (data.length === 0) {
|
|
125
|
+
* throw new Error(`Empty ${packObjectTypeToString(type)} object`);
|
|
126
|
+
* }
|
|
127
|
+
* }
|
|
128
|
+
*/
|
|
40
129
|
export function packObjectTypeToString(type) {
|
|
41
130
|
switch (type) {
|
|
42
131
|
case PackObjectType.OBJ_COMMIT:
|
|
@@ -55,6 +144,32 @@ export function packObjectTypeToString(type) {
|
|
|
55
144
|
throw new Error(`Invalid pack object type: ${type}`);
|
|
56
145
|
}
|
|
57
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Converts a string object type name to its PackObjectType enum value.
|
|
149
|
+
*
|
|
150
|
+
* @description Parses a string object type name and returns the corresponding enum value.
|
|
151
|
+
* This is useful when reading Git loose objects or configuration files that use string type names.
|
|
152
|
+
* Note: Delta types ('ofs_delta', 'ref_delta') are not supported as they are not valid
|
|
153
|
+
* standalone object types.
|
|
154
|
+
*
|
|
155
|
+
* @param {string} str - The string type name ('commit', 'tree', 'blob', or 'tag')
|
|
156
|
+
* @returns {PackObjectType} The corresponding PackObjectType enum value
|
|
157
|
+
* @throws {Error} If the string does not match a valid base object type
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* // Parse type from Git object
|
|
161
|
+
* const typeStr = 'blob';
|
|
162
|
+
* const type = stringToPackObjectType(typeStr);
|
|
163
|
+
* // type === PackObjectType.OBJ_BLOB
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* // Error handling for invalid types
|
|
167
|
+
* try {
|
|
168
|
+
* const type = stringToPackObjectType('invalid');
|
|
169
|
+
* } catch (e) {
|
|
170
|
+
* console.error('Unknown object type');
|
|
171
|
+
* }
|
|
172
|
+
*/
|
|
58
173
|
export function stringToPackObjectType(str) {
|
|
59
174
|
switch (str) {
|
|
60
175
|
case 'commit':
|
|
@@ -69,7 +184,30 @@ export function stringToPackObjectType(str) {
|
|
|
69
184
|
throw new Error(`Invalid object type string: ${str}`);
|
|
70
185
|
}
|
|
71
186
|
}
|
|
72
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Encodes a non-negative integer using variable-length integer encoding.
|
|
189
|
+
*
|
|
190
|
+
* @description Uses Git's varint encoding scheme where each byte encodes 7 bits of the value,
|
|
191
|
+
* with the MSB (most significant bit) serving as a continuation flag. If the MSB is set (1),
|
|
192
|
+
* more bytes follow; if clear (0), this is the last byte.
|
|
193
|
+
*
|
|
194
|
+
* The encoding is little-endian: least significant bits come first. This allows efficient
|
|
195
|
+
* encoding of small values (1 byte for values 0-127) while supporting arbitrarily large values.
|
|
196
|
+
*
|
|
197
|
+
* @param {number} value - A non-negative integer to encode (must be >= 0)
|
|
198
|
+
* @returns {Uint8Array} The variable-length encoded bytes
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* // Encode small value (fits in 1 byte)
|
|
202
|
+
* const encoded = encodeVarint(100);
|
|
203
|
+
* // encoded = Uint8Array [100] (0x64, no continuation bit)
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* // Encode larger value (requires multiple bytes)
|
|
207
|
+
* const encoded = encodeVarint(300);
|
|
208
|
+
* // encoded = Uint8Array [172, 2] (0xAC with continuation, 0x02)
|
|
209
|
+
* // 300 = 0b100101100 = (0101100 | continuation) + (10)
|
|
210
|
+
*/
|
|
73
211
|
export function encodeVarint(value) {
|
|
74
212
|
const bytes = [];
|
|
75
213
|
// Encode value in 7-bit chunks with continuation bit
|
|
@@ -83,6 +221,37 @@ export function encodeVarint(value) {
|
|
|
83
221
|
} while (value > 0);
|
|
84
222
|
return new Uint8Array(bytes);
|
|
85
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* Decodes a variable-length integer from a byte buffer.
|
|
226
|
+
*
|
|
227
|
+
* @description Reads and decodes a varint starting at the specified offset. The encoding uses
|
|
228
|
+
* 7 bits per byte for the value, with the MSB as a continuation flag. This is the inverse
|
|
229
|
+
* operation of {@link encodeVarint}.
|
|
230
|
+
*
|
|
231
|
+
* **Important Notes:**
|
|
232
|
+
* - Maximum supported varint length is 10 bytes (enough for 64-bit values)
|
|
233
|
+
* - Throws if data ends unexpectedly before varint is complete
|
|
234
|
+
* - Throws if varint exceeds maximum length (likely corrupted data)
|
|
235
|
+
*
|
|
236
|
+
* @param {Uint8Array} data - The byte buffer containing the encoded varint
|
|
237
|
+
* @param {number} offset - The starting position in the buffer
|
|
238
|
+
* @returns {{ value: number; bytesRead: number }} Object containing the decoded value and number of bytes consumed
|
|
239
|
+
* @throws {Error} If unexpected end of data or varint exceeds maximum length
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* // Decode a varint from a buffer
|
|
243
|
+
* const buffer = new Uint8Array([172, 2, 0, 0]); // 300 encoded + extra bytes
|
|
244
|
+
* const { value, bytesRead } = decodeVarint(buffer, 0);
|
|
245
|
+
* // value === 300, bytesRead === 2
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* // Decode multiple varints
|
|
249
|
+
* const buffer = new Uint8Array([100, 172, 2]);
|
|
250
|
+
* let offset = 0;
|
|
251
|
+
* const first = decodeVarint(buffer, offset); // value: 100, bytesRead: 1
|
|
252
|
+
* offset += first.bytesRead;
|
|
253
|
+
* const second = decodeVarint(buffer, offset); // value: 300, bytesRead: 2
|
|
254
|
+
*/
|
|
86
255
|
export function decodeVarint(data, offset) {
|
|
87
256
|
let value = 0;
|
|
88
257
|
let shift = 0;
|
|
@@ -108,10 +277,34 @@ export function decodeVarint(data, offset) {
|
|
|
108
277
|
return { value, bytesRead };
|
|
109
278
|
}
|
|
110
279
|
/**
|
|
111
|
-
*
|
|
280
|
+
* Encodes object type and uncompressed size into a pack object header.
|
|
281
|
+
*
|
|
282
|
+
* @description Creates the variable-length header that precedes each object in a packfile.
|
|
283
|
+
* The header encodes both the object type (3 bits) and the uncompressed data size.
|
|
284
|
+
*
|
|
285
|
+
* **Header Format:**
|
|
286
|
+
* - First byte: `[continuation][type:3][size:4]` - MSB is continuation flag, then 3-bit type, then 4 LSBs of size
|
|
287
|
+
* - Subsequent bytes: `[continuation][size:7]` - MSB is continuation flag, then 7 bits of size
|
|
112
288
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
289
|
+
* This encoding allows:
|
|
290
|
+
* - Sizes 0-15: 1 byte
|
|
291
|
+
* - Sizes 16-2047: 2 bytes
|
|
292
|
+
* - Larger sizes: additional bytes as needed
|
|
293
|
+
*
|
|
294
|
+
* @param {PackObjectType} type - The object type (1-4 for base types, 6-7 for deltas)
|
|
295
|
+
* @param {number} size - The uncompressed object size in bytes
|
|
296
|
+
* @returns {Uint8Array} The encoded header bytes
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* // Encode a small blob object
|
|
300
|
+
* const header = encodeTypeAndSize(PackObjectType.OBJ_BLOB, 10);
|
|
301
|
+
* // header[0] = (3 << 4) | 10 = 0x3A (type=blob, size=10, no continuation)
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* // Encode a larger object (size requires continuation)
|
|
305
|
+
* const header = encodeTypeAndSize(PackObjectType.OBJ_COMMIT, 256);
|
|
306
|
+
* // First byte has type and low 4 bits of size, with continuation
|
|
307
|
+
* // Second byte has remaining size bits
|
|
115
308
|
*/
|
|
116
309
|
export function encodeTypeAndSize(type, size) {
|
|
117
310
|
const bytes = [];
|
|
@@ -133,6 +326,36 @@ export function encodeTypeAndSize(type, size) {
|
|
|
133
326
|
}
|
|
134
327
|
return new Uint8Array(bytes);
|
|
135
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* Decodes object type and size from a pack object header.
|
|
331
|
+
*
|
|
332
|
+
* @description Parses the variable-length header at the beginning of each packed object.
|
|
333
|
+
* This is the inverse operation of {@link encodeTypeAndSize}.
|
|
334
|
+
*
|
|
335
|
+
* **Decoding Process:**
|
|
336
|
+
* 1. Read first byte to get type (bits 4-6) and initial size (bits 0-3)
|
|
337
|
+
* 2. If MSB is set, read continuation bytes (7 bits each) for remaining size
|
|
338
|
+
* 3. Return the decoded type, size, and total bytes consumed
|
|
339
|
+
*
|
|
340
|
+
* **Important Notes:**
|
|
341
|
+
* - Maximum header length is 10 bytes (prevents infinite loops on corrupted data)
|
|
342
|
+
* - Throws if offset is beyond data bounds
|
|
343
|
+
* - Throws if data ends before header is complete
|
|
344
|
+
*
|
|
345
|
+
* @param {Uint8Array} data - The packfile data buffer
|
|
346
|
+
* @param {number} offset - Starting offset of the object header
|
|
347
|
+
* @returns {{ type: PackObjectType; size: number; bytesRead: number }} Decoded type, uncompressed size, and bytes consumed
|
|
348
|
+
* @throws {Error} If offset is out of bounds or header data is truncated/corrupted
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
* // Decode an object header
|
|
352
|
+
* const packData = getPackfileData();
|
|
353
|
+
* let offset = 12; // Skip 12-byte pack header
|
|
354
|
+
*
|
|
355
|
+
* const { type, size, bytesRead } = decodeTypeAndSize(packData, offset);
|
|
356
|
+
* console.log(`Object type: ${packObjectTypeToString(type)}, size: ${size}`);
|
|
357
|
+
* offset += bytesRead; // Move to start of compressed data
|
|
358
|
+
*/
|
|
136
359
|
export function decodeTypeAndSize(data, offset) {
|
|
137
360
|
// Maximum bytes for type+size header (first byte + continuation bytes)
|
|
138
361
|
// Similar to varint, limit to prevent infinite loops
|
|
@@ -169,9 +392,37 @@ export function decodeTypeAndSize(data, offset) {
|
|
|
169
392
|
return { type, size, bytesRead };
|
|
170
393
|
}
|
|
171
394
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* @
|
|
395
|
+
* Parses and validates the 12-byte header of a Git packfile.
|
|
396
|
+
*
|
|
397
|
+
* @description Reads the first 12 bytes of a packfile and validates:
|
|
398
|
+
* 1. The signature is "PACK"
|
|
399
|
+
* 2. The version is 2 (only supported version)
|
|
400
|
+
* 3. Extracts the object count
|
|
401
|
+
*
|
|
402
|
+
* This should be called first when processing a packfile to understand
|
|
403
|
+
* its structure and validate basic integrity.
|
|
404
|
+
*
|
|
405
|
+
* @param {Uint8Array} data - The packfile data (at least 12 bytes)
|
|
406
|
+
* @returns {PackHeader} Parsed header with signature, version, and object count
|
|
407
|
+
* @throws {Error} If data is too short (< 12 bytes)
|
|
408
|
+
* @throws {Error} If signature is not "PACK"
|
|
409
|
+
* @throws {Error} If version is not 2
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* // Parse a packfile header
|
|
413
|
+
* const packData = await readPackfile('objects/pack/pack-abc123.pack');
|
|
414
|
+
* const header = parsePackHeader(packData);
|
|
415
|
+
*
|
|
416
|
+
* console.log(`Packfile version: ${header.version}`);
|
|
417
|
+
* console.log(`Contains ${header.objectCount} objects`);
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* // Error handling for invalid packfile
|
|
421
|
+
* try {
|
|
422
|
+
* const header = parsePackHeader(suspectData);
|
|
423
|
+
* } catch (e) {
|
|
424
|
+
* console.error('Not a valid packfile:', e.message);
|
|
425
|
+
* }
|
|
175
426
|
*/
|
|
176
427
|
export function parsePackHeader(data) {
|
|
177
428
|
if (data.length < 12) {
|
|
@@ -192,8 +443,33 @@ export function parsePackHeader(data) {
|
|
|
192
443
|
return { signature, version, objectCount };
|
|
193
444
|
}
|
|
194
445
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
446
|
+
* Parses an individual pack object header at the specified offset.
|
|
447
|
+
*
|
|
448
|
+
* @description Extracts the object type and uncompressed size from the header
|
|
449
|
+
* at the given offset. This is useful for scanning/indexing packfiles.
|
|
450
|
+
*
|
|
451
|
+
* **Important Notes:**
|
|
452
|
+
* - This only parses the header, not the compressed data following it
|
|
453
|
+
* - For delta objects, you'll need additional parsing (base offset/SHA)
|
|
454
|
+
* - Use `headerSize` to calculate where the compressed data begins
|
|
455
|
+
*
|
|
456
|
+
* @param {Uint8Array} data - The packfile data buffer
|
|
457
|
+
* @param {number} offset - Byte offset where the object header starts
|
|
458
|
+
* @returns {ParsedPackObject} Object containing type, size, and header size
|
|
459
|
+
* @throws {Error} If offset is out of bounds or header is malformed
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* // Scan through all objects in a packfile
|
|
463
|
+
* const header = parsePackHeader(packData);
|
|
464
|
+
* let offset = 12; // After pack header
|
|
465
|
+
*
|
|
466
|
+
* for (let i = 0; i < header.objectCount; i++) {
|
|
467
|
+
* const obj = parsePackObject(packData, offset);
|
|
468
|
+
* console.log(`Object ${i}: type=${obj.type}, size=${obj.size}`);
|
|
469
|
+
* // Skip header + compressed data (need to decompress to find boundary)
|
|
470
|
+
* offset += obj.headerSize;
|
|
471
|
+
* // ... decompress and skip compressed data ...
|
|
472
|
+
* }
|
|
197
473
|
*/
|
|
198
474
|
export function parsePackObject(data, offset) {
|
|
199
475
|
const { type, size, bytesRead } = decodeTypeAndSize(data, offset);
|
|
@@ -204,9 +480,44 @@ export function parsePackObject(data, offset) {
|
|
|
204
480
|
};
|
|
205
481
|
}
|
|
206
482
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* @
|
|
483
|
+
* Creates a complete packfile from an array of objects.
|
|
484
|
+
*
|
|
485
|
+
* @description Generates a valid Git packfile containing the specified objects.
|
|
486
|
+
* The resulting packfile includes:
|
|
487
|
+
* - 12-byte header (signature, version, object count)
|
|
488
|
+
* - Each object (header + zlib-compressed data)
|
|
489
|
+
* - 20-byte SHA-1 checksum trailer
|
|
490
|
+
*
|
|
491
|
+
* **Process:**
|
|
492
|
+
* 1. Creates the pack header with signature "PACK", version 2, and object count
|
|
493
|
+
* 2. For each object, encodes type/size header and compresses data with zlib
|
|
494
|
+
* 3. Appends SHA-1 checksum of the entire pack content
|
|
495
|
+
*
|
|
496
|
+
* **Important Notes:**
|
|
497
|
+
* - Objects are packed in the order provided (no reordering for delta compression)
|
|
498
|
+
* - This function creates full objects only (no delta compression)
|
|
499
|
+
* - For delta compression, use the generation module functions
|
|
500
|
+
*
|
|
501
|
+
* @param {PackableObject[]} objects - Array of objects to include in the packfile
|
|
502
|
+
* @returns {Uint8Array} Complete packfile as binary data
|
|
503
|
+
*
|
|
504
|
+
* @example
|
|
505
|
+
* // Create a packfile with a single blob
|
|
506
|
+
* const objects: PackableObject[] = [
|
|
507
|
+
* { type: 'blob', data: new TextEncoder().encode('Hello, World!') }
|
|
508
|
+
* ];
|
|
509
|
+
* const packfile = createPackfile(objects);
|
|
510
|
+
* // Write packfile to disk or send over network
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* // Create a packfile with multiple objects
|
|
514
|
+
* const objects: PackableObject[] = [
|
|
515
|
+
* { type: 'blob', data: fileContent1 },
|
|
516
|
+
* { type: 'blob', data: fileContent2 },
|
|
517
|
+
* { type: 'tree', data: treeData },
|
|
518
|
+
* { type: 'commit', data: commitData }
|
|
519
|
+
* ];
|
|
520
|
+
* const packfile = createPackfile(objects);
|
|
210
521
|
*/
|
|
211
522
|
export function createPackfile(objects) {
|
|
212
523
|
const parts = [];
|
package/dist/pack/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/pack/format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/pack/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEpC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAA;AAEpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,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