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/delta.js
CHANGED
|
@@ -1,34 +1,102 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Git
|
|
3
|
-
*
|
|
4
|
-
* Git
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Delta
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
2
|
+
* @fileoverview Git Packfile Delta Encoding/Decoding
|
|
3
|
+
*
|
|
4
|
+
* This module implements Git's delta compression algorithm, which is used in packfiles
|
|
5
|
+
* to efficiently store objects by encoding only the differences between similar objects.
|
|
6
|
+
*
|
|
7
|
+
* ## Delta Format Overview
|
|
8
|
+
*
|
|
9
|
+
* A delta consists of:
|
|
10
|
+
* 1. **Source size** - Variable-length integer specifying the base object size
|
|
11
|
+
* 2. **Target size** - Variable-length integer specifying the result size
|
|
12
|
+
* 3. **Instructions** - Sequence of copy or insert commands
|
|
13
|
+
*
|
|
14
|
+
* ## Instruction Types
|
|
15
|
+
*
|
|
16
|
+
* ### Copy Instruction (MSB = 1)
|
|
17
|
+
* Copies a range of bytes from the source (base) object.
|
|
18
|
+
*
|
|
19
|
+
* | Bit | Meaning |
|
|
20
|
+
* |--------|-------------------------------------------|
|
|
21
|
+
* | 7 | Always 1 (copy marker) |
|
|
22
|
+
* | 6-4 | Which size bytes follow (bit mask) |
|
|
23
|
+
* | 3-0 | Which offset bytes follow (bit mask) |
|
|
24
|
+
*
|
|
25
|
+
* Following bytes encode offset (up to 4 bytes) and size (up to 3 bytes).
|
|
26
|
+
* If size is 0 after decoding, it means 0x10000 (65536).
|
|
27
|
+
*
|
|
28
|
+
* ### Insert Instruction (MSB = 0)
|
|
29
|
+
* Inserts literal bytes directly into the output.
|
|
30
|
+
*
|
|
31
|
+
* | Bit | Meaning |
|
|
32
|
+
* |--------|-------------------------------------------|
|
|
33
|
+
* | 7 | Always 0 (insert marker) |
|
|
34
|
+
* | 6-0 | Number of bytes to insert (1-127) |
|
|
35
|
+
*
|
|
36
|
+
* The instruction byte is followed by that many literal bytes.
|
|
37
|
+
*
|
|
38
|
+
* @module pack/delta
|
|
39
|
+
* @see {@link https://git-scm.com/docs/pack-format} Git Pack Format Documentation
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // Apply a delta to reconstruct an object
|
|
43
|
+
* import { applyDelta } from './delta';
|
|
44
|
+
*
|
|
45
|
+
* const baseObject = getBaseObject(); // Uint8Array
|
|
46
|
+
* const deltaData = getDeltaData(); // Uint8Array from packfile
|
|
47
|
+
* const targetObject = applyDelta(baseObject, deltaData);
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Create a delta between two objects
|
|
51
|
+
* import { createDelta } from './delta';
|
|
52
|
+
*
|
|
53
|
+
* const oldVersion = new TextEncoder().encode('Hello, World!');
|
|
54
|
+
* const newVersion = new TextEncoder().encode('Hello, Universe!');
|
|
55
|
+
* const delta = createDelta(oldVersion, newVersion);
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* Marker byte for copy instructions (MSB set).
|
|
59
|
+
* When the MSB is set, the instruction copies bytes from the base object.
|
|
60
|
+
*
|
|
61
|
+
* @constant {number}
|
|
18
62
|
*/
|
|
19
|
-
/** Copy instruction type marker (MSB set) */
|
|
20
63
|
export const COPY_INSTRUCTION = 0x80;
|
|
21
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Marker byte for insert instructions (MSB clear).
|
|
66
|
+
* When the MSB is clear, the lower 7 bits indicate how many literal bytes follow.
|
|
67
|
+
*
|
|
68
|
+
* @constant {number}
|
|
69
|
+
*/
|
|
22
70
|
export const INSERT_INSTRUCTION = 0x00;
|
|
23
71
|
/**
|
|
24
|
-
*
|
|
72
|
+
* Parses a variable-length size value from the delta header.
|
|
73
|
+
*
|
|
74
|
+
* @description Reads the source or target size from a delta's header using
|
|
75
|
+
* Git's variable-length integer encoding. Each byte's MSB indicates whether
|
|
76
|
+
* more bytes follow, and the lower 7 bits contribute to the value.
|
|
77
|
+
*
|
|
78
|
+
* **Encoding Details:**
|
|
79
|
+
* - Bytes are read sequentially
|
|
80
|
+
* - Lower 7 bits of each byte contribute to the result
|
|
81
|
+
* - MSB = 1 means more bytes follow
|
|
82
|
+
* - MSB = 0 means this is the last byte
|
|
83
|
+
* - Maximum of 10 bytes (supports values up to 2^70)
|
|
25
84
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
85
|
+
* @param {Uint8Array} data - The delta data buffer
|
|
86
|
+
* @param {number} offset - Starting byte offset in the buffer
|
|
87
|
+
* @returns {DeltaHeaderResult} Object with parsed size and bytes consumed
|
|
88
|
+
* @throws {Error} If data ends unexpectedly before size is complete
|
|
89
|
+
* @throws {Error} If size encoding exceeds maximum length (corrupted data)
|
|
28
90
|
*
|
|
29
|
-
* @
|
|
30
|
-
*
|
|
31
|
-
*
|
|
91
|
+
* @example
|
|
92
|
+
* // Parse source and target sizes from delta
|
|
93
|
+
* let offset = 0;
|
|
94
|
+
* const source = parseDeltaHeader(delta, offset);
|
|
95
|
+
* offset += source.bytesRead;
|
|
96
|
+
* const target = parseDeltaHeader(delta, offset);
|
|
97
|
+
* offset += target.bytesRead;
|
|
98
|
+
*
|
|
99
|
+
* console.log(`Base size: ${source.size}, Target size: ${target.size}`);
|
|
32
100
|
*/
|
|
33
101
|
export function parseDeltaHeader(data, offset) {
|
|
34
102
|
let size = 0;
|
|
@@ -56,10 +124,14 @@ export function parseDeltaHeader(data, offset) {
|
|
|
56
124
|
return { size, bytesRead };
|
|
57
125
|
}
|
|
58
126
|
/**
|
|
59
|
-
*
|
|
127
|
+
* Encodes a size as a variable-length integer for delta headers.
|
|
128
|
+
*
|
|
129
|
+
* @description Internal function that encodes sizes using Git's varint format.
|
|
130
|
+
* Used when creating delta headers that specify source and target sizes.
|
|
60
131
|
*
|
|
61
|
-
* @param size The size to encode
|
|
62
|
-
* @returns The encoded bytes
|
|
132
|
+
* @param {number} size - The size value to encode
|
|
133
|
+
* @returns {Uint8Array} The encoded bytes
|
|
134
|
+
* @internal
|
|
63
135
|
*/
|
|
64
136
|
function encodeDeltaSize(size) {
|
|
65
137
|
const bytes = [];
|
|
@@ -74,12 +146,48 @@ function encodeDeltaSize(size) {
|
|
|
74
146
|
return new Uint8Array(bytes);
|
|
75
147
|
}
|
|
76
148
|
/**
|
|
77
|
-
*
|
|
149
|
+
* Applies a delta to a base object to produce the target object.
|
|
150
|
+
*
|
|
151
|
+
* @description Reconstructs the target object by executing the delta's copy and
|
|
152
|
+
* insert instructions against the base object. This is the core operation for
|
|
153
|
+
* unpacking delta-compressed objects in packfiles.
|
|
154
|
+
*
|
|
155
|
+
* **Delta Application Process:**
|
|
156
|
+
* 1. Parse source (base) size and verify it matches
|
|
157
|
+
* 2. Parse target size to allocate result buffer
|
|
158
|
+
* 3. Execute instructions sequentially:
|
|
159
|
+
* - Copy: copy bytes from base object to result
|
|
160
|
+
* - Insert: copy literal bytes from delta to result
|
|
161
|
+
* 4. Verify result size matches expected target size
|
|
162
|
+
*
|
|
163
|
+
* **Error Conditions:**
|
|
164
|
+
* - Base object size doesn't match delta's source size
|
|
165
|
+
* - Copy instruction references bytes outside base object
|
|
166
|
+
* - Instructions would overflow the result buffer
|
|
167
|
+
* - Result size doesn't match delta's target size
|
|
168
|
+
* - Invalid instruction byte (0x00)
|
|
169
|
+
*
|
|
170
|
+
* @param {Uint8Array} base - The source/base object to apply delta against
|
|
171
|
+
* @param {Uint8Array} delta - The delta data (decompressed from packfile)
|
|
172
|
+
* @returns {Uint8Array} The reconstructed target object
|
|
173
|
+
* @throws {Error} If base size doesn't match delta's source size
|
|
174
|
+
* @throws {Error} If delta contains invalid instructions
|
|
175
|
+
* @throws {Error} If copy would read beyond base object bounds
|
|
176
|
+
* @throws {Error} If result size doesn't match expected target size
|
|
78
177
|
*
|
|
79
|
-
* @
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
178
|
+
* @example
|
|
179
|
+
* // Reconstruct an object from base + delta
|
|
180
|
+
* const base = await getObject(baseSha);
|
|
181
|
+
* const delta = decompressDeltaData(packData, offset);
|
|
182
|
+
* const target = applyDelta(base, delta);
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* // Error handling
|
|
186
|
+
* try {
|
|
187
|
+
* const target = applyDelta(base, delta);
|
|
188
|
+
* } catch (e) {
|
|
189
|
+
* console.error('Delta application failed:', e.message);
|
|
190
|
+
* }
|
|
83
191
|
*/
|
|
84
192
|
export function applyDelta(base, delta) {
|
|
85
193
|
let offset = 0;
|
|
@@ -155,16 +263,48 @@ export function applyDelta(base, delta) {
|
|
|
155
263
|
return result;
|
|
156
264
|
}
|
|
157
265
|
/**
|
|
158
|
-
*
|
|
266
|
+
* Creates a delta that transforms a base object into a target object.
|
|
267
|
+
*
|
|
268
|
+
* @description Generates delta instructions that can reconstruct the target
|
|
269
|
+
* from the base object. Uses a hash-based algorithm to find matching sequences
|
|
270
|
+
* and emits copy/insert instructions accordingly.
|
|
271
|
+
*
|
|
272
|
+
* **Algorithm:**
|
|
273
|
+
* 1. Build a hash table of 4-byte sequences in the base object
|
|
274
|
+
* 2. Scan through the target looking for matches in the hash table
|
|
275
|
+
* 3. For each match found, verify and extend to maximum length
|
|
276
|
+
* 4. Emit copy instructions for matches (4+ bytes)
|
|
277
|
+
* 5. Emit insert instructions for non-matching data
|
|
278
|
+
*
|
|
279
|
+
* **Optimization Notes:**
|
|
280
|
+
* - Uses 4-byte window for hash matching
|
|
281
|
+
* - Minimum copy size is 4 bytes (smaller copies become inserts)
|
|
282
|
+
* - Insert instructions are limited to 127 bytes each
|
|
283
|
+
* - Empty base results in pure insert delta
|
|
284
|
+
* - Empty target results in headers-only delta
|
|
285
|
+
*
|
|
286
|
+
* **Output Format:**
|
|
287
|
+
* - Source size (varint)
|
|
288
|
+
* - Target size (varint)
|
|
289
|
+
* - Sequence of copy/insert instructions
|
|
290
|
+
*
|
|
291
|
+
* @param {Uint8Array} base - The source/base object
|
|
292
|
+
* @param {Uint8Array} target - The target object to encode as delta
|
|
293
|
+
* @returns {Uint8Array} The delta data (can be applied with {@link applyDelta})
|
|
159
294
|
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
295
|
+
* @example
|
|
296
|
+
* // Create a delta for similar files
|
|
297
|
+
* const v1 = new TextEncoder().encode('Hello, World!');
|
|
298
|
+
* const v2 = new TextEncoder().encode('Hello, Universe!');
|
|
299
|
+
* const delta = createDelta(v1, v2);
|
|
164
300
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
301
|
+
* // Delta should be smaller than v2 if there's good overlap
|
|
302
|
+
* console.log(`Original: ${v2.length}, Delta: ${delta.length}`);
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* // Verify delta correctness
|
|
306
|
+
* const reconstructed = applyDelta(v1, delta);
|
|
307
|
+
* // reconstructed should equal v2
|
|
168
308
|
*/
|
|
169
309
|
export function createDelta(base, target) {
|
|
170
310
|
const instructions = [];
|
|
@@ -240,7 +380,16 @@ export function createDelta(base, target) {
|
|
|
240
380
|
return concatArrays(instructions);
|
|
241
381
|
}
|
|
242
382
|
/**
|
|
243
|
-
*
|
|
383
|
+
* Computes a simple hash of a byte sequence for delta matching.
|
|
384
|
+
*
|
|
385
|
+
* @description Uses a fast multiplicative hash (similar to djb2) for
|
|
386
|
+
* building the hash table used in delta creation.
|
|
387
|
+
*
|
|
388
|
+
* @param {Uint8Array} data - The data buffer
|
|
389
|
+
* @param {number} offset - Starting offset
|
|
390
|
+
* @param {number} length - Number of bytes to hash
|
|
391
|
+
* @returns {number} 32-bit hash value
|
|
392
|
+
* @internal
|
|
244
393
|
*/
|
|
245
394
|
function hashBytes(data, offset, length) {
|
|
246
395
|
let hash = 0;
|
|
@@ -250,7 +399,18 @@ function hashBytes(data, offset, length) {
|
|
|
250
399
|
return hash;
|
|
251
400
|
}
|
|
252
401
|
/**
|
|
253
|
-
*
|
|
402
|
+
* Finds the length of matching bytes between two array regions.
|
|
403
|
+
*
|
|
404
|
+
* @description Compares bytes starting from the given offsets and returns
|
|
405
|
+
* how many consecutive bytes match. Used to extend hash-based matches.
|
|
406
|
+
*
|
|
407
|
+
* @param {Uint8Array} a - First array
|
|
408
|
+
* @param {number} aOffset - Starting offset in first array
|
|
409
|
+
* @param {Uint8Array} b - Second array
|
|
410
|
+
* @param {number} bOffset - Starting offset in second array
|
|
411
|
+
* @param {number} maxLength - Maximum number of bytes to compare
|
|
412
|
+
* @returns {number} Number of matching bytes (0 to maxLength)
|
|
413
|
+
* @internal
|
|
254
414
|
*/
|
|
255
415
|
function getMatchLength(a, aOffset, b, bOffset, maxLength) {
|
|
256
416
|
let length = 0;
|
|
@@ -260,8 +420,16 @@ function getMatchLength(a, aOffset, b, bOffset, maxLength) {
|
|
|
260
420
|
return length;
|
|
261
421
|
}
|
|
262
422
|
/**
|
|
263
|
-
*
|
|
264
|
-
*
|
|
423
|
+
* Emits insert instructions for a range of literal bytes.
|
|
424
|
+
*
|
|
425
|
+
* @description Insert commands can only encode 1-127 bytes each, so this
|
|
426
|
+
* function splits larger ranges into multiple instructions as needed.
|
|
427
|
+
*
|
|
428
|
+
* @param {Uint8Array[]} instructions - Array to append instructions to
|
|
429
|
+
* @param {Uint8Array} data - Source data buffer
|
|
430
|
+
* @param {number} start - Starting offset (inclusive)
|
|
431
|
+
* @param {number} end - Ending offset (exclusive)
|
|
432
|
+
* @internal
|
|
265
433
|
*/
|
|
266
434
|
function emitInserts(instructions, data, start, end) {
|
|
267
435
|
const MAX_INSERT = 127;
|
|
@@ -276,7 +444,21 @@ function emitInserts(instructions, data, start, end) {
|
|
|
276
444
|
}
|
|
277
445
|
}
|
|
278
446
|
/**
|
|
279
|
-
*
|
|
447
|
+
* Emits a copy instruction that copies bytes from the base object.
|
|
448
|
+
*
|
|
449
|
+
* @description Encodes a copy instruction using Git's compact format where
|
|
450
|
+
* only non-zero offset and size bytes are included, indicated by bit flags.
|
|
451
|
+
*
|
|
452
|
+
* **Encoding Details:**
|
|
453
|
+
* - Offset bytes (up to 4) are included based on bits 0-3 of command byte
|
|
454
|
+
* - Size bytes (up to 3) are included based on bits 4-6 of command byte
|
|
455
|
+
* - Size of 0x10000 (65536) is encoded as no size bytes (size=0 means 0x10000)
|
|
456
|
+
* - Offset of 0 means no offset bytes are included
|
|
457
|
+
*
|
|
458
|
+
* @param {Uint8Array[]} instructions - Array to append the instruction to
|
|
459
|
+
* @param {number} offset - Byte offset in base object to copy from
|
|
460
|
+
* @param {number} size - Number of bytes to copy
|
|
461
|
+
* @internal
|
|
280
462
|
*/
|
|
281
463
|
function emitCopy(instructions, offset, size) {
|
|
282
464
|
const bytes = [];
|
|
@@ -325,7 +507,11 @@ function emitCopy(instructions, offset, size) {
|
|
|
325
507
|
instructions.push(instruction);
|
|
326
508
|
}
|
|
327
509
|
/**
|
|
328
|
-
*
|
|
510
|
+
* Concatenates multiple Uint8Arrays into a single array.
|
|
511
|
+
*
|
|
512
|
+
* @param {Uint8Array[]} arrays - Arrays to concatenate
|
|
513
|
+
* @returns {Uint8Array} Combined array
|
|
514
|
+
* @internal
|
|
329
515
|
*/
|
|
330
516
|
function concatArrays(arrays) {
|
|
331
517
|
let totalLength = 0;
|
package/dist/pack/delta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delta.js","sourceRoot":"","sources":["../../src/pack/delta.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"delta.js","sourceRoot":"","sources":["../../src/pack/delta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAA;AAEpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAA;AAoDtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB,EAAE,MAAc;IAC/D,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,SAAS,GAAG,CAAC,CAAA;IAEjB,uDAAuD;IACvD,MAAM,gBAAgB,GAAG,EAAE,CAAA;IAE3B,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,MAAM,GAAG,SAAS,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,iEAAiE,MA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