gitx.do 0.1.0 → 0.1.2
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/README.md +40 -353
- package/dist/do/logger.d.ts +50 -0
- package/dist/do/logger.d.ts.map +1 -0
- package/dist/do/logger.js +122 -0
- package/dist/do/logger.js.map +1 -0
- package/dist/{durable-object → do}/schema.d.ts +3 -3
- package/dist/do/schema.d.ts.map +1 -0
- package/dist/{durable-object → do}/schema.js +4 -3
- package/dist/do/schema.js.map +1 -0
- package/dist/do/types.d.ts +267 -0
- package/dist/do/types.d.ts.map +1 -0
- package/dist/do/types.js +62 -0
- package/dist/do/types.js.map +1 -0
- package/dist/index.d.ts +15 -415
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -483
- package/dist/index.js.map +1 -1
- package/package.json +13 -21
- package/dist/cli/commands/add.d.ts +0 -174
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -131
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/blame.d.ts +0 -259
- package/dist/cli/commands/blame.d.ts.map +0 -1
- package/dist/cli/commands/blame.js +0 -609
- package/dist/cli/commands/blame.js.map +0 -1
- package/dist/cli/commands/branch.d.ts +0 -249
- package/dist/cli/commands/branch.d.ts.map +0 -1
- package/dist/cli/commands/branch.js +0 -693
- package/dist/cli/commands/branch.js.map +0 -1
- package/dist/cli/commands/commit.d.ts +0 -182
- package/dist/cli/commands/commit.d.ts.map +0 -1
- package/dist/cli/commands/commit.js +0 -437
- package/dist/cli/commands/commit.js.map +0 -1
- package/dist/cli/commands/diff.d.ts +0 -464
- package/dist/cli/commands/diff.d.ts.map +0 -1
- package/dist/cli/commands/diff.js +0 -958
- package/dist/cli/commands/diff.js.map +0 -1
- package/dist/cli/commands/log.d.ts +0 -239
- package/dist/cli/commands/log.d.ts.map +0 -1
- package/dist/cli/commands/log.js +0 -535
- package/dist/cli/commands/log.js.map +0 -1
- package/dist/cli/commands/merge.d.ts +0 -106
- package/dist/cli/commands/merge.d.ts.map +0 -1
- package/dist/cli/commands/merge.js +0 -55
- package/dist/cli/commands/merge.js.map +0 -1
- package/dist/cli/commands/review.d.ts +0 -457
- package/dist/cli/commands/review.d.ts.map +0 -1
- package/dist/cli/commands/review.js +0 -533
- package/dist/cli/commands/review.js.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -269
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js +0 -493
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/web.d.ts +0 -199
- package/dist/cli/commands/web.d.ts.map +0 -1
- package/dist/cli/commands/web.js +0 -696
- package/dist/cli/commands/web.js.map +0 -1
- package/dist/cli/fs-adapter.d.ts +0 -656
- package/dist/cli/fs-adapter.d.ts.map +0 -1
- package/dist/cli/fs-adapter.js +0 -1179
- package/dist/cli/fs-adapter.js.map +0 -1
- package/dist/cli/fsx-cli-adapter.d.ts +0 -359
- package/dist/cli/fsx-cli-adapter.d.ts.map +0 -1
- package/dist/cli/fsx-cli-adapter.js +0 -619
- package/dist/cli/fsx-cli-adapter.js.map +0 -1
- package/dist/cli/index.d.ts +0 -387
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -523
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/ui/components/DiffView.d.ts +0 -7
- package/dist/cli/ui/components/DiffView.d.ts.map +0 -1
- package/dist/cli/ui/components/DiffView.js +0 -11
- package/dist/cli/ui/components/DiffView.js.map +0 -1
- package/dist/cli/ui/components/ErrorDisplay.d.ts +0 -6
- package/dist/cli/ui/components/ErrorDisplay.d.ts.map +0 -1
- package/dist/cli/ui/components/ErrorDisplay.js +0 -11
- package/dist/cli/ui/components/ErrorDisplay.js.map +0 -1
- package/dist/cli/ui/components/FuzzySearch.d.ts +0 -9
- package/dist/cli/ui/components/FuzzySearch.d.ts.map +0 -1
- package/dist/cli/ui/components/FuzzySearch.js +0 -12
- package/dist/cli/ui/components/FuzzySearch.js.map +0 -1
- package/dist/cli/ui/components/LoadingSpinner.d.ts +0 -6
- package/dist/cli/ui/components/LoadingSpinner.d.ts.map +0 -1
- package/dist/cli/ui/components/LoadingSpinner.js +0 -10
- package/dist/cli/ui/components/LoadingSpinner.js.map +0 -1
- package/dist/cli/ui/components/NavigationList.d.ts +0 -9
- package/dist/cli/ui/components/NavigationList.d.ts.map +0 -1
- package/dist/cli/ui/components/NavigationList.js +0 -11
- package/dist/cli/ui/components/NavigationList.js.map +0 -1
- package/dist/cli/ui/components/ScrollableContent.d.ts +0 -8
- package/dist/cli/ui/components/ScrollableContent.d.ts.map +0 -1
- package/dist/cli/ui/components/ScrollableContent.js +0 -11
- package/dist/cli/ui/components/ScrollableContent.js.map +0 -1
- package/dist/cli/ui/components/index.d.ts +0 -7
- package/dist/cli/ui/components/index.d.ts.map +0 -1
- package/dist/cli/ui/components/index.js +0 -9
- package/dist/cli/ui/components/index.js.map +0 -1
- package/dist/cli/ui/terminal-ui.d.ts +0 -52
- package/dist/cli/ui/terminal-ui.d.ts.map +0 -1
- package/dist/cli/ui/terminal-ui.js +0 -121
- package/dist/cli/ui/terminal-ui.js.map +0 -1
- package/dist/do/BashModule.d.ts +0 -871
- package/dist/do/BashModule.d.ts.map +0 -1
- package/dist/do/BashModule.js +0 -1143
- package/dist/do/BashModule.js.map +0 -1
- package/dist/do/FsModule.d.ts +0 -601
- package/dist/do/FsModule.d.ts.map +0 -1
- package/dist/do/FsModule.js +0 -1120
- package/dist/do/FsModule.js.map +0 -1
- package/dist/do/GitModule.d.ts +0 -635
- package/dist/do/GitModule.d.ts.map +0 -1
- package/dist/do/GitModule.js +0 -781
- package/dist/do/GitModule.js.map +0 -1
- package/dist/do/GitRepoDO.d.ts +0 -281
- package/dist/do/GitRepoDO.d.ts.map +0 -1
- package/dist/do/GitRepoDO.js +0 -479
- package/dist/do/GitRepoDO.js.map +0 -1
- package/dist/do/bash-ast.d.ts +0 -246
- package/dist/do/bash-ast.d.ts.map +0 -1
- package/dist/do/bash-ast.js +0 -888
- package/dist/do/bash-ast.js.map +0 -1
- package/dist/do/container-executor.d.ts +0 -491
- package/dist/do/container-executor.d.ts.map +0 -1
- package/dist/do/container-executor.js +0 -730
- package/dist/do/container-executor.js.map +0 -1
- package/dist/do/index.d.ts +0 -53
- package/dist/do/index.d.ts.map +0 -1
- package/dist/do/index.js +0 -91
- package/dist/do/index.js.map +0 -1
- package/dist/do/tiered-storage.d.ts +0 -403
- package/dist/do/tiered-storage.d.ts.map +0 -1
- package/dist/do/tiered-storage.js +0 -689
- package/dist/do/tiered-storage.js.map +0 -1
- package/dist/do/withBash.d.ts +0 -231
- package/dist/do/withBash.d.ts.map +0 -1
- package/dist/do/withBash.js +0 -244
- package/dist/do/withBash.js.map +0 -1
- package/dist/do/withFs.d.ts +0 -237
- package/dist/do/withFs.d.ts.map +0 -1
- package/dist/do/withFs.js +0 -387
- package/dist/do/withFs.js.map +0 -1
- package/dist/do/withGit.d.ts +0 -180
- package/dist/do/withGit.d.ts.map +0 -1
- package/dist/do/withGit.js +0 -271
- package/dist/do/withGit.js.map +0 -1
- package/dist/durable-object/object-store.d.ts +0 -633
- package/dist/durable-object/object-store.d.ts.map +0 -1
- package/dist/durable-object/object-store.js +0 -1161
- package/dist/durable-object/object-store.js.map +0 -1
- package/dist/durable-object/schema.d.ts.map +0 -1
- package/dist/durable-object/schema.js.map +0 -1
- package/dist/durable-object/wal.d.ts +0 -416
- package/dist/durable-object/wal.d.ts.map +0 -1
- package/dist/durable-object/wal.js +0 -445
- package/dist/durable-object/wal.js.map +0 -1
- package/dist/mcp/adapter.d.ts +0 -772
- package/dist/mcp/adapter.d.ts.map +0 -1
- package/dist/mcp/adapter.js +0 -895
- package/dist/mcp/adapter.js.map +0 -1
- package/dist/mcp/sandbox/miniflare-evaluator.d.ts +0 -22
- package/dist/mcp/sandbox/miniflare-evaluator.d.ts.map +0 -1
- package/dist/mcp/sandbox/miniflare-evaluator.js +0 -140
- package/dist/mcp/sandbox/miniflare-evaluator.js.map +0 -1
- package/dist/mcp/sandbox/object-store-proxy.d.ts +0 -32
- package/dist/mcp/sandbox/object-store-proxy.d.ts.map +0 -1
- package/dist/mcp/sandbox/object-store-proxy.js +0 -30
- package/dist/mcp/sandbox/object-store-proxy.js.map +0 -1
- package/dist/mcp/sandbox/template.d.ts +0 -17
- package/dist/mcp/sandbox/template.d.ts.map +0 -1
- package/dist/mcp/sandbox/template.js +0 -71
- package/dist/mcp/sandbox/template.js.map +0 -1
- package/dist/mcp/sandbox.d.ts +0 -764
- package/dist/mcp/sandbox.d.ts.map +0 -1
- package/dist/mcp/sandbox.js +0 -1362
- package/dist/mcp/sandbox.js.map +0 -1
- package/dist/mcp/sdk-adapter.d.ts +0 -835
- package/dist/mcp/sdk-adapter.d.ts.map +0 -1
- package/dist/mcp/sdk-adapter.js +0 -974
- package/dist/mcp/sdk-adapter.js.map +0 -1
- package/dist/mcp/tools/do.d.ts +0 -32
- package/dist/mcp/tools/do.d.ts.map +0 -1
- package/dist/mcp/tools/do.js +0 -115
- package/dist/mcp/tools/do.js.map +0 -1
- package/dist/mcp/tools.d.ts +0 -548
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js +0 -1934
- package/dist/mcp/tools.js.map +0 -1
- package/dist/ops/blame.d.ts +0 -551
- package/dist/ops/blame.d.ts.map +0 -1
- package/dist/ops/blame.js +0 -1037
- package/dist/ops/blame.js.map +0 -1
- package/dist/ops/branch.d.ts +0 -766
- package/dist/ops/branch.d.ts.map +0 -1
- package/dist/ops/branch.js +0 -950
- package/dist/ops/branch.js.map +0 -1
- package/dist/ops/commit-traversal.d.ts +0 -349
- package/dist/ops/commit-traversal.d.ts.map +0 -1
- package/dist/ops/commit-traversal.js +0 -821
- package/dist/ops/commit-traversal.js.map +0 -1
- package/dist/ops/commit.d.ts +0 -555
- package/dist/ops/commit.d.ts.map +0 -1
- package/dist/ops/commit.js +0 -826
- package/dist/ops/commit.js.map +0 -1
- package/dist/ops/merge-base.d.ts +0 -397
- package/dist/ops/merge-base.d.ts.map +0 -1
- package/dist/ops/merge-base.js +0 -691
- package/dist/ops/merge-base.js.map +0 -1
- package/dist/ops/merge.d.ts +0 -855
- package/dist/ops/merge.d.ts.map +0 -1
- package/dist/ops/merge.js +0 -1551
- package/dist/ops/merge.js.map +0 -1
- package/dist/ops/tag.d.ts +0 -247
- package/dist/ops/tag.d.ts.map +0 -1
- package/dist/ops/tag.js +0 -649
- package/dist/ops/tag.js.map +0 -1
- package/dist/ops/tree-builder.d.ts +0 -178
- package/dist/ops/tree-builder.d.ts.map +0 -1
- package/dist/ops/tree-builder.js +0 -271
- package/dist/ops/tree-builder.js.map +0 -1
- package/dist/ops/tree-diff.d.ts +0 -291
- package/dist/ops/tree-diff.d.ts.map +0 -1
- package/dist/ops/tree-diff.js +0 -705
- package/dist/ops/tree-diff.js.map +0 -1
- package/dist/pack/delta.d.ts +0 -248
- package/dist/pack/delta.d.ts.map +0 -1
- package/dist/pack/delta.js +0 -736
- package/dist/pack/delta.js.map +0 -1
- package/dist/pack/format.d.ts +0 -446
- package/dist/pack/format.d.ts.map +0 -1
- package/dist/pack/format.js +0 -572
- package/dist/pack/format.js.map +0 -1
- package/dist/pack/full-generation.d.ts +0 -612
- package/dist/pack/full-generation.d.ts.map +0 -1
- package/dist/pack/full-generation.js +0 -1378
- package/dist/pack/full-generation.js.map +0 -1
- package/dist/pack/generation.d.ts +0 -441
- package/dist/pack/generation.d.ts.map +0 -1
- package/dist/pack/generation.js +0 -707
- package/dist/pack/generation.js.map +0 -1
- package/dist/pack/index.d.ts +0 -502
- package/dist/pack/index.d.ts.map +0 -1
- package/dist/pack/index.js +0 -833
- package/dist/pack/index.js.map +0 -1
- package/dist/refs/branch.d.ts +0 -668
- package/dist/refs/branch.d.ts.map +0 -1
- package/dist/refs/branch.js +0 -897
- package/dist/refs/branch.js.map +0 -1
- package/dist/refs/storage.d.ts +0 -833
- package/dist/refs/storage.d.ts.map +0 -1
- package/dist/refs/storage.js +0 -1023
- package/dist/refs/storage.js.map +0 -1
- package/dist/refs/tag.d.ts +0 -860
- package/dist/refs/tag.d.ts.map +0 -1
- package/dist/refs/tag.js +0 -996
- package/dist/refs/tag.js.map +0 -1
- package/dist/storage/backend.d.ts +0 -425
- package/dist/storage/backend.d.ts.map +0 -1
- package/dist/storage/backend.js +0 -41
- package/dist/storage/backend.js.map +0 -1
- package/dist/storage/fsx-adapter.d.ts +0 -204
- package/dist/storage/fsx-adapter.d.ts.map +0 -1
- package/dist/storage/fsx-adapter.js +0 -470
- package/dist/storage/fsx-adapter.js.map +0 -1
- package/dist/storage/lru-cache.d.ts +0 -691
- package/dist/storage/lru-cache.d.ts.map +0 -1
- package/dist/storage/lru-cache.js +0 -813
- package/dist/storage/lru-cache.js.map +0 -1
- package/dist/storage/object-index.d.ts +0 -585
- package/dist/storage/object-index.d.ts.map +0 -1
- package/dist/storage/object-index.js +0 -532
- package/dist/storage/object-index.js.map +0 -1
- package/dist/storage/r2-pack.d.ts +0 -1257
- package/dist/storage/r2-pack.d.ts.map +0 -1
- package/dist/storage/r2-pack.js +0 -1770
- package/dist/storage/r2-pack.js.map +0 -1
- package/dist/tiered/cdc-pipeline.d.ts +0 -1888
- package/dist/tiered/cdc-pipeline.d.ts.map +0 -1
- package/dist/tiered/cdc-pipeline.js +0 -1880
- package/dist/tiered/cdc-pipeline.js.map +0 -1
- package/dist/tiered/migration.d.ts +0 -1104
- package/dist/tiered/migration.d.ts.map +0 -1
- package/dist/tiered/migration.js +0 -1214
- package/dist/tiered/migration.js.map +0 -1
- package/dist/tiered/parquet-writer.d.ts +0 -1145
- package/dist/tiered/parquet-writer.d.ts.map +0 -1
- package/dist/tiered/parquet-writer.js +0 -1183
- package/dist/tiered/parquet-writer.js.map +0 -1
- package/dist/tiered/read-path.d.ts +0 -835
- package/dist/tiered/read-path.d.ts.map +0 -1
- package/dist/tiered/read-path.js +0 -487
- package/dist/tiered/read-path.js.map +0 -1
- package/dist/types/capability.d.ts +0 -1385
- package/dist/types/capability.d.ts.map +0 -1
- package/dist/types/capability.js +0 -36
- package/dist/types/capability.js.map +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -18
- package/dist/types/index.js.map +0 -1
- package/dist/types/objects.d.ts +0 -692
- package/dist/types/objects.d.ts.map +0 -1
- package/dist/types/objects.js +0 -837
- package/dist/types/objects.js.map +0 -1
- package/dist/types/storage.d.ts +0 -603
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/storage.js +0 -191
- package/dist/types/storage.js.map +0 -1
- package/dist/types/worker-loader.d.ts +0 -60
- package/dist/types/worker-loader.d.ts.map +0 -1
- package/dist/types/worker-loader.js +0 -62
- package/dist/types/worker-loader.js.map +0 -1
- package/dist/utils/hash.d.ts +0 -197
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/hash.js +0 -268
- package/dist/utils/hash.js.map +0 -1
- package/dist/utils/sha1.d.ts +0 -290
- package/dist/utils/sha1.d.ts.map +0 -1
- package/dist/utils/sha1.js +0 -582
- package/dist/utils/sha1.js.map +0 -1
- package/dist/wire/capabilities.d.ts +0 -1044
- package/dist/wire/capabilities.d.ts.map +0 -1
- package/dist/wire/capabilities.js +0 -941
- package/dist/wire/capabilities.js.map +0 -1
- package/dist/wire/path-security.d.ts +0 -157
- package/dist/wire/path-security.d.ts.map +0 -1
- package/dist/wire/path-security.js +0 -307
- package/dist/wire/path-security.js.map +0 -1
- package/dist/wire/pkt-line.d.ts +0 -345
- package/dist/wire/pkt-line.d.ts.map +0 -1
- package/dist/wire/pkt-line.js +0 -381
- package/dist/wire/pkt-line.js.map +0 -1
- package/dist/wire/receive-pack.d.ts +0 -1059
- package/dist/wire/receive-pack.d.ts.map +0 -1
- package/dist/wire/receive-pack.js +0 -1414
- package/dist/wire/receive-pack.js.map +0 -1
- package/dist/wire/smart-http.d.ts +0 -799
- package/dist/wire/smart-http.d.ts.map +0 -1
- package/dist/wire/smart-http.js +0 -945
- package/dist/wire/smart-http.js.map +0 -1
- package/dist/wire/upload-pack.d.ts +0 -727
- package/dist/wire/upload-pack.d.ts.map +0 -1
- package/dist/wire/upload-pack.js +0 -1138
- package/dist/wire/upload-pack.js.map +0 -1
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Tree Builder - builds git tree objects from index entries
|
|
3
|
-
*
|
|
4
|
-
* Provides functionality for creating Git tree objects from a flat list
|
|
5
|
-
* of index entries, handling directory hierarchies, proper sorting,
|
|
6
|
-
* and deduplication.
|
|
7
|
-
*
|
|
8
|
-
* ## Features
|
|
9
|
-
*
|
|
10
|
-
* - File modes (100644 regular, 100755 executable, 040000 directory, 120000 symlink, 160000 submodule)
|
|
11
|
-
* - Proper tree entry format (mode + space + name + null + sha)
|
|
12
|
-
* - Sorted entries (git requires lexicographic ordering)
|
|
13
|
-
* - Nested tree building for directory hierarchies
|
|
14
|
-
* - Tree SHA computation
|
|
15
|
-
* - Tree deduplication for identical subtrees
|
|
16
|
-
*
|
|
17
|
-
* ## Usage Example
|
|
18
|
-
*
|
|
19
|
-
* ```typescript
|
|
20
|
-
* import { buildTreeFromIndex } from './ops/tree-builder'
|
|
21
|
-
*
|
|
22
|
-
* // Build tree from index entries
|
|
23
|
-
* const entries = [
|
|
24
|
-
* { path: 'src/main.ts', sha: 'abc123...', mode: '100644', ... },
|
|
25
|
-
* { path: 'src/utils/helper.ts', sha: 'def456...', mode: '100644', ... },
|
|
26
|
-
* { path: 'README.md', sha: 'ghi789...', mode: '100644', ... }
|
|
27
|
-
* ]
|
|
28
|
-
*
|
|
29
|
-
* const result = await buildTreeFromIndex(store, entries)
|
|
30
|
-
* console.log('Root tree SHA:', result.sha)
|
|
31
|
-
* console.log('Trees created:', result.treeCount)
|
|
32
|
-
* console.log('Deduplicated:', result.deduplicatedCount)
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @module ops/tree-builder
|
|
36
|
-
*/
|
|
37
|
-
import { TreeEntry } from '../types/objects';
|
|
38
|
-
import type { BasicObjectStore as ObjectStore } from '../types/storage';
|
|
39
|
-
/**
|
|
40
|
-
* Index entry from git index file.
|
|
41
|
-
*
|
|
42
|
-
* Represents a single file entry as stored in the Git index (staging area).
|
|
43
|
-
*
|
|
44
|
-
* @interface IndexEntry
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* const entry: IndexEntry = {
|
|
49
|
-
* path: 'src/main.ts',
|
|
50
|
-
* sha: 'abc123def456...',
|
|
51
|
-
* mode: '100644',
|
|
52
|
-
* flags: 0,
|
|
53
|
-
* size: 1234,
|
|
54
|
-
* mtime: Date.now(),
|
|
55
|
-
* ctime: Date.now()
|
|
56
|
-
* }
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export interface IndexEntry {
|
|
60
|
-
/** File path relative to repository root */
|
|
61
|
-
path: string;
|
|
62
|
-
/** SHA of the blob content */
|
|
63
|
-
sha: string;
|
|
64
|
-
/**
|
|
65
|
-
* File mode:
|
|
66
|
-
* - '100644': Regular file
|
|
67
|
-
* - '100755': Executable file
|
|
68
|
-
* - '120000': Symbolic link
|
|
69
|
-
* - '160000': Git submodule
|
|
70
|
-
*/
|
|
71
|
-
mode: string;
|
|
72
|
-
/** Index flags (for merging, assume-unchanged, etc.) */
|
|
73
|
-
flags: number;
|
|
74
|
-
/** File size in bytes */
|
|
75
|
-
size: number;
|
|
76
|
-
/** Modification time (Unix timestamp or milliseconds) */
|
|
77
|
-
mtime: number;
|
|
78
|
-
/** Creation/change time (Unix timestamp or milliseconds) */
|
|
79
|
-
ctime: number;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* ObjectStore interface for tree builder operations.
|
|
83
|
-
* Re-exported from storage types for convenience.
|
|
84
|
-
*/
|
|
85
|
-
export type { ObjectStore };
|
|
86
|
-
/**
|
|
87
|
-
* Tree node for building hierarchy.
|
|
88
|
-
*
|
|
89
|
-
* Represents a node in the intermediate tree structure used
|
|
90
|
-
* during the build process.
|
|
91
|
-
*
|
|
92
|
-
* @interface TreeNode
|
|
93
|
-
* @internal
|
|
94
|
-
*/
|
|
95
|
-
export interface TreeNode {
|
|
96
|
-
/** Name of this node (file or directory name) */
|
|
97
|
-
name: string;
|
|
98
|
-
/** Full path from repository root */
|
|
99
|
-
path: string;
|
|
100
|
-
/** Whether this node represents a directory */
|
|
101
|
-
isDirectory: boolean;
|
|
102
|
-
/** Child nodes (for directories) */
|
|
103
|
-
children: Map<string, TreeNode>;
|
|
104
|
-
/** The index entry (only set for files, not directories) */
|
|
105
|
-
entry?: IndexEntry;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Result of building a tree.
|
|
109
|
-
*
|
|
110
|
-
* Contains the root tree SHA, statistics about the build,
|
|
111
|
-
* and optionally detailed information about subtrees.
|
|
112
|
-
*
|
|
113
|
-
* @interface BuildTreeResult
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```typescript
|
|
117
|
-
* const result = await buildTreeFromIndex(store, entries)
|
|
118
|
-
*
|
|
119
|
-
* console.log(`Root SHA: ${result.sha}`)
|
|
120
|
-
* console.log(`Created ${result.treeCount} tree objects`)
|
|
121
|
-
* console.log(`${result.deduplicatedCount} were deduplicated`)
|
|
122
|
-
*
|
|
123
|
-
* // Access subtree information if available
|
|
124
|
-
* if (result.subtrees) {
|
|
125
|
-
* for (const [name, subtree] of Object.entries(result.subtrees)) {
|
|
126
|
-
* console.log(`${name}/: ${subtree.sha}`)
|
|
127
|
-
* }
|
|
128
|
-
* }
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
export interface BuildTreeResult {
|
|
132
|
-
/** SHA of the root tree object */
|
|
133
|
-
sha: string;
|
|
134
|
-
/** Tree entries at this level */
|
|
135
|
-
entries: TreeEntry[];
|
|
136
|
-
/** Total number of tree objects processed */
|
|
137
|
-
treeCount: number;
|
|
138
|
-
/** Number of unique tree objects created */
|
|
139
|
-
uniqueTreeCount: number;
|
|
140
|
-
/** Number of trees that were deduplicated (reused existing) */
|
|
141
|
-
deduplicatedCount: number;
|
|
142
|
-
/**
|
|
143
|
-
* Nested subtree results.
|
|
144
|
-
* Keys are directory names, values are their BuildTreeResult.
|
|
145
|
-
*/
|
|
146
|
-
subtrees?: Record<string, BuildTreeResult>;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Build a tree hierarchy from index entries
|
|
150
|
-
*/
|
|
151
|
-
export declare function buildTreeHierarchy(entries: IndexEntry[]): TreeNode;
|
|
152
|
-
/**
|
|
153
|
-
* Sort tree entries according to git conventions
|
|
154
|
-
* Directories are sorted as if they have a trailing slash
|
|
155
|
-
*/
|
|
156
|
-
export declare function sortTreeEntries(entries: TreeEntry[]): TreeEntry[];
|
|
157
|
-
/**
|
|
158
|
-
* Create a tree object and store it
|
|
159
|
-
*/
|
|
160
|
-
export declare function createTreeObject(store: ObjectStore, entries: TreeEntry[]): Promise<{
|
|
161
|
-
sha: string;
|
|
162
|
-
type: 'tree';
|
|
163
|
-
data: Uint8Array;
|
|
164
|
-
}>;
|
|
165
|
-
/**
|
|
166
|
-
* Deduplicate trees based on their content hash
|
|
167
|
-
* Returns a map of canonical tree content to path, and mapping of paths to canonical paths
|
|
168
|
-
*/
|
|
169
|
-
export declare function deduplicateTrees(trees: Map<string, TreeEntry[]>): {
|
|
170
|
-
deduplicated: Map<string, TreeEntry[]>;
|
|
171
|
-
mapping: Map<string, string>;
|
|
172
|
-
};
|
|
173
|
-
/**
|
|
174
|
-
* Build tree from index entries
|
|
175
|
-
* This is the main entry point for tree building
|
|
176
|
-
*/
|
|
177
|
-
export declare function buildTreeFromIndex(store: ObjectStore, entries: IndexEntry[]): Promise<BuildTreeResult>;
|
|
178
|
-
//# sourceMappingURL=tree-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree-builder.d.ts","sourceRoot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AA+D;IAC/D,iBAAiB,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CAC3C;AAsCD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,QAAQ,CAsClE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAUjE;AAgCD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,SAAS,EAAE,GACnB,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAI1D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAC9B;IAAE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAsB1E;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,UAAU,EAAE,GACpB,OAAO,CAAC,eAAe,CAAC,CAkG1B"}
|
package/dist/ops/tree-builder.js
DELETED
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Tree Builder - builds git tree objects from index entries
|
|
3
|
-
*
|
|
4
|
-
* Provides functionality for creating Git tree objects from a flat list
|
|
5
|
-
* of index entries, handling directory hierarchies, proper sorting,
|
|
6
|
-
* and deduplication.
|
|
7
|
-
*
|
|
8
|
-
* ## Features
|
|
9
|
-
*
|
|
10
|
-
* - File modes (100644 regular, 100755 executable, 040000 directory, 120000 symlink, 160000 submodule)
|
|
11
|
-
* - Proper tree entry format (mode + space + name + null + sha)
|
|
12
|
-
* - Sorted entries (git requires lexicographic ordering)
|
|
13
|
-
* - Nested tree building for directory hierarchies
|
|
14
|
-
* - Tree SHA computation
|
|
15
|
-
* - Tree deduplication for identical subtrees
|
|
16
|
-
*
|
|
17
|
-
* ## Usage Example
|
|
18
|
-
*
|
|
19
|
-
* ```typescript
|
|
20
|
-
* import { buildTreeFromIndex } from './ops/tree-builder'
|
|
21
|
-
*
|
|
22
|
-
* // Build tree from index entries
|
|
23
|
-
* const entries = [
|
|
24
|
-
* { path: 'src/main.ts', sha: 'abc123...', mode: '100644', ... },
|
|
25
|
-
* { path: 'src/utils/helper.ts', sha: 'def456...', mode: '100644', ... },
|
|
26
|
-
* { path: 'README.md', sha: 'ghi789...', mode: '100644', ... }
|
|
27
|
-
* ]
|
|
28
|
-
*
|
|
29
|
-
* const result = await buildTreeFromIndex(store, entries)
|
|
30
|
-
* console.log('Root tree SHA:', result.sha)
|
|
31
|
-
* console.log('Trees created:', result.treeCount)
|
|
32
|
-
* console.log('Deduplicated:', result.deduplicatedCount)
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @module ops/tree-builder
|
|
36
|
-
*/
|
|
37
|
-
import { hexToBytes } from '../utils/hash';
|
|
38
|
-
/** Valid file modes in git */
|
|
39
|
-
const VALID_MODES = new Set(['100644', '100755', '040000', '120000', '160000']);
|
|
40
|
-
/** Text encoder for creating tree data */
|
|
41
|
-
const encoder = new TextEncoder();
|
|
42
|
-
/**
|
|
43
|
-
* Validate an index entry
|
|
44
|
-
*/
|
|
45
|
-
function validateEntry(entry) {
|
|
46
|
-
// Check mode
|
|
47
|
-
if (!VALID_MODES.has(entry.mode)) {
|
|
48
|
-
throw new Error(`Invalid file mode: ${entry.mode}`);
|
|
49
|
-
}
|
|
50
|
-
// Check SHA format (40 hex characters)
|
|
51
|
-
if (!/^[0-9a-f]{40}$/.test(entry.sha)) {
|
|
52
|
-
throw new Error(`Invalid SHA format: ${entry.sha}`);
|
|
53
|
-
}
|
|
54
|
-
// Check path
|
|
55
|
-
if (!entry.path || entry.path.length === 0) {
|
|
56
|
-
throw new Error('Empty path not allowed');
|
|
57
|
-
}
|
|
58
|
-
if (entry.path.startsWith('/')) {
|
|
59
|
-
throw new Error('Path must not start with /');
|
|
60
|
-
}
|
|
61
|
-
if (entry.path.includes('//')) {
|
|
62
|
-
throw new Error('Path must not contain double slashes');
|
|
63
|
-
}
|
|
64
|
-
// Check for . or .. components
|
|
65
|
-
const parts = entry.path.split('/');
|
|
66
|
-
for (const part of parts) {
|
|
67
|
-
if (part === '.' || part === '..') {
|
|
68
|
-
throw new Error(`Path must not contain . or .. components: ${entry.path}`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Build a tree hierarchy from index entries
|
|
74
|
-
*/
|
|
75
|
-
export function buildTreeHierarchy(entries) {
|
|
76
|
-
const root = {
|
|
77
|
-
name: '',
|
|
78
|
-
path: '',
|
|
79
|
-
isDirectory: true,
|
|
80
|
-
children: new Map()
|
|
81
|
-
};
|
|
82
|
-
for (const entry of entries) {
|
|
83
|
-
const parts = entry.path.split('/');
|
|
84
|
-
let current = root;
|
|
85
|
-
for (let i = 0; i < parts.length; i++) {
|
|
86
|
-
const part = parts[i];
|
|
87
|
-
const isLast = i === parts.length - 1;
|
|
88
|
-
const currentPath = parts.slice(0, i + 1).join('/');
|
|
89
|
-
if (!current.children.has(part)) {
|
|
90
|
-
const node = {
|
|
91
|
-
name: part,
|
|
92
|
-
path: currentPath,
|
|
93
|
-
isDirectory: !isLast,
|
|
94
|
-
children: new Map(),
|
|
95
|
-
entry: isLast ? entry : undefined
|
|
96
|
-
};
|
|
97
|
-
current.children.set(part, node);
|
|
98
|
-
}
|
|
99
|
-
else if (isLast) {
|
|
100
|
-
// Update entry for duplicate paths (last one wins)
|
|
101
|
-
const existing = current.children.get(part);
|
|
102
|
-
existing.entry = entry;
|
|
103
|
-
existing.isDirectory = false;
|
|
104
|
-
}
|
|
105
|
-
current = current.children.get(part);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return root;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Sort tree entries according to git conventions
|
|
112
|
-
* Directories are sorted as if they have a trailing slash
|
|
113
|
-
*/
|
|
114
|
-
export function sortTreeEntries(entries) {
|
|
115
|
-
return [...entries].sort((a, b) => {
|
|
116
|
-
// Directories sort as if they have trailing slash
|
|
117
|
-
const aName = a.mode === '040000' ? a.name + '/' : a.name;
|
|
118
|
-
const bName = b.mode === '040000' ? b.name + '/' : b.name;
|
|
119
|
-
// Use byte-wise comparison (localeCompare with raw mode)
|
|
120
|
-
if (aName < bName)
|
|
121
|
-
return -1;
|
|
122
|
-
if (aName > bName)
|
|
123
|
-
return 1;
|
|
124
|
-
return 0;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Create tree object data from entries
|
|
129
|
-
*/
|
|
130
|
-
function createTreeData(entries) {
|
|
131
|
-
// Sort entries
|
|
132
|
-
const sorted = sortTreeEntries(entries);
|
|
133
|
-
// Build entry content
|
|
134
|
-
const entryParts = [];
|
|
135
|
-
for (const entry of sorted) {
|
|
136
|
-
const modeName = encoder.encode(`${entry.mode} ${entry.name}\0`);
|
|
137
|
-
const sha20 = hexToBytes(entry.sha);
|
|
138
|
-
const entryData = new Uint8Array(modeName.length + 20);
|
|
139
|
-
entryData.set(modeName);
|
|
140
|
-
entryData.set(sha20, modeName.length);
|
|
141
|
-
entryParts.push(entryData);
|
|
142
|
-
}
|
|
143
|
-
// Combine all parts
|
|
144
|
-
const totalLength = entryParts.reduce((sum, part) => sum + part.length, 0);
|
|
145
|
-
const content = new Uint8Array(totalLength);
|
|
146
|
-
let offset = 0;
|
|
147
|
-
for (const part of entryParts) {
|
|
148
|
-
content.set(part, offset);
|
|
149
|
-
offset += part.length;
|
|
150
|
-
}
|
|
151
|
-
return content;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Create a tree object and store it
|
|
155
|
-
*/
|
|
156
|
-
export async function createTreeObject(store, entries) {
|
|
157
|
-
const data = createTreeData(entries);
|
|
158
|
-
const sha = await store.storeObject('tree', data);
|
|
159
|
-
return { sha, type: 'tree', data };
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Deduplicate trees based on their content hash
|
|
163
|
-
* Returns a map of canonical tree content to path, and mapping of paths to canonical paths
|
|
164
|
-
*/
|
|
165
|
-
export function deduplicateTrees(trees) {
|
|
166
|
-
const contentToPath = new Map();
|
|
167
|
-
const deduplicated = new Map();
|
|
168
|
-
const mapping = new Map();
|
|
169
|
-
for (const [path, entries] of trees) {
|
|
170
|
-
// Create a content key from sorted entries
|
|
171
|
-
const sorted = sortTreeEntries(entries);
|
|
172
|
-
const key = sorted.map(e => `${e.mode}:${e.name}:${e.sha}`).join('|');
|
|
173
|
-
if (contentToPath.has(key)) {
|
|
174
|
-
// Duplicate - map to existing path
|
|
175
|
-
mapping.set(path, contentToPath.get(key));
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
// New unique tree
|
|
179
|
-
contentToPath.set(key, path);
|
|
180
|
-
deduplicated.set(path, entries);
|
|
181
|
-
mapping.set(path, path);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return { deduplicated, mapping };
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Build tree from index entries
|
|
188
|
-
* This is the main entry point for tree building
|
|
189
|
-
*/
|
|
190
|
-
export async function buildTreeFromIndex(store, entries) {
|
|
191
|
-
// Validate all entries first
|
|
192
|
-
for (const entry of entries) {
|
|
193
|
-
validateEntry(entry);
|
|
194
|
-
}
|
|
195
|
-
// Build hierarchy
|
|
196
|
-
const hierarchy = buildTreeHierarchy(entries);
|
|
197
|
-
// Track stats
|
|
198
|
-
let treeCount = 0;
|
|
199
|
-
let uniqueTreeCount = 0;
|
|
200
|
-
const treeContentToSha = new Map();
|
|
201
|
-
/**
|
|
202
|
-
* Recursively build tree for a node
|
|
203
|
-
*/
|
|
204
|
-
async function buildNode(node) {
|
|
205
|
-
const treeEntries = [];
|
|
206
|
-
const nodeSubtrees = {};
|
|
207
|
-
// Process children
|
|
208
|
-
const children = Array.from(node.children.values());
|
|
209
|
-
for (const child of children) {
|
|
210
|
-
if (child.isDirectory) {
|
|
211
|
-
// Recursively build subtree
|
|
212
|
-
const subtreeResult = await buildNode(child);
|
|
213
|
-
nodeSubtrees[child.name] = subtreeResult;
|
|
214
|
-
treeEntries.push({
|
|
215
|
-
mode: '040000',
|
|
216
|
-
name: child.name,
|
|
217
|
-
sha: subtreeResult.sha
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
else if (child.entry) {
|
|
221
|
-
// File entry
|
|
222
|
-
treeEntries.push({
|
|
223
|
-
mode: child.entry.mode,
|
|
224
|
-
name: child.name,
|
|
225
|
-
sha: child.entry.sha
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
// Sort entries
|
|
230
|
-
const sortedEntries = sortTreeEntries(treeEntries);
|
|
231
|
-
treeCount++;
|
|
232
|
-
// Check for deduplication
|
|
233
|
-
const contentKey = sortedEntries.map(e => `${e.mode}:${e.name}:${e.sha}`).join('|');
|
|
234
|
-
let sha;
|
|
235
|
-
if (treeContentToSha.has(contentKey)) {
|
|
236
|
-
// Reuse existing tree SHA
|
|
237
|
-
sha = treeContentToSha.get(contentKey);
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
// Create new tree object
|
|
241
|
-
const treeObj = await createTreeObject(store, sortedEntries);
|
|
242
|
-
sha = treeObj.sha;
|
|
243
|
-
treeContentToSha.set(contentKey, sha);
|
|
244
|
-
uniqueTreeCount++;
|
|
245
|
-
}
|
|
246
|
-
return {
|
|
247
|
-
sha,
|
|
248
|
-
entries: sortedEntries,
|
|
249
|
-
subtrees: nodeSubtrees
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
// Build from root
|
|
253
|
-
const result = await buildNode(hierarchy);
|
|
254
|
-
// Convert BuildResult to BuildTreeResult format
|
|
255
|
-
function convertToResult(br) {
|
|
256
|
-
const subtreesConverted = {};
|
|
257
|
-
for (const [name, sub] of Object.entries(br.subtrees)) {
|
|
258
|
-
subtreesConverted[name] = convertToResult(sub);
|
|
259
|
-
}
|
|
260
|
-
return {
|
|
261
|
-
sha: br.sha,
|
|
262
|
-
entries: br.entries,
|
|
263
|
-
treeCount,
|
|
264
|
-
uniqueTreeCount,
|
|
265
|
-
deduplicatedCount: treeCount - uniqueTreeCount,
|
|
266
|
-
subtrees: Object.keys(subtreesConverted).length > 0 ? subtreesConverted : undefined
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
return convertToResult(result);
|
|
270
|
-
}
|
|
271
|
-
//# sourceMappingURL=tree-builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree-builder.js","sourceRoot":"","sources":["../../src/ops/tree-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,8BAA8B;AAC9B,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAA;AAE/E,0CAA0C;AAC1C,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAA;AAkIjC;;GAEG;AACH,SAAS,aAAa,CAAC,KAAiB;IACtC,aAAa;IACb,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;IACrD,CAAC;IAED,uCAAuC;IACvC,IAAI,CAAC,gBAA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