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
package/dist/refs/tag.d.ts
DELETED
|
@@ -1,860 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Git Tag Operations
|
|
3
|
-
*
|
|
4
|
-
* This module provides comprehensive tag management functionality including
|
|
5
|
-
* creation (lightweight and annotated), deletion, listing, and verification.
|
|
6
|
-
*
|
|
7
|
-
* **Tag Types in Git**:
|
|
8
|
-
* - **Lightweight tags**: Simple refs under refs/tags/ pointing to commits
|
|
9
|
-
* - **Annotated tags**: Refs pointing to tag objects containing metadata
|
|
10
|
-
* (tagger, date, message, and optional GPG signature)
|
|
11
|
-
*
|
|
12
|
-
* Annotated tags are recommended for releases as they include metadata
|
|
13
|
-
* and can be cryptographically signed.
|
|
14
|
-
*
|
|
15
|
-
* @module refs/tag
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import { TagManager, createTag, listTags } from './refs/tag'
|
|
20
|
-
*
|
|
21
|
-
* // Create manager
|
|
22
|
-
* const manager = new TagManager(refStorage, objectStorage, gpgSigner)
|
|
23
|
-
*
|
|
24
|
-
* // Create annotated tag
|
|
25
|
-
* const tag = await manager.createTag('v1.0.0', commitSha, {
|
|
26
|
-
* annotated: true,
|
|
27
|
-
* message: 'Release 1.0.0',
|
|
28
|
-
* tagger: { name: 'Alice', email: 'alice@example.com', timestamp: Date.now()/1000, timezone: '+0000' }
|
|
29
|
-
* })
|
|
30
|
-
*
|
|
31
|
-
* // List version tags
|
|
32
|
-
* const versions = await listTags(manager, { pattern: 'v*' })
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
import { Author, TagObject, ObjectType } from '../types/objects';
|
|
36
|
-
import { RefErrorCode } from './storage';
|
|
37
|
-
/**
|
|
38
|
-
* Simplified ref storage interface for TagManager.
|
|
39
|
-
*
|
|
40
|
-
* This interface is a subset of RefStorage that TagManager needs.
|
|
41
|
-
* It allows for simpler mocking in tests.
|
|
42
|
-
*/
|
|
43
|
-
export interface TagRefStorage {
|
|
44
|
-
getRef(name: string): Promise<string | null>;
|
|
45
|
-
setRef(name: string, sha: string): Promise<void>;
|
|
46
|
-
deleteRef(name: string): Promise<boolean>;
|
|
47
|
-
listRefs(prefix: string): Promise<Array<{
|
|
48
|
-
name: string;
|
|
49
|
-
sha: string;
|
|
50
|
-
}>>;
|
|
51
|
-
}
|
|
52
|
-
export { RefStorage } from './storage';
|
|
53
|
-
/**
|
|
54
|
-
* Tag type discriminator.
|
|
55
|
-
*
|
|
56
|
-
* @description
|
|
57
|
-
* - `lightweight`: Simple ref pointing directly to a commit
|
|
58
|
-
* - `annotated`: Ref pointing to a tag object containing metadata
|
|
59
|
-
*/
|
|
60
|
-
export type TagType = 'lightweight' | 'annotated';
|
|
61
|
-
/**
|
|
62
|
-
* Represents a Git tag (either lightweight or annotated).
|
|
63
|
-
*
|
|
64
|
-
* @description
|
|
65
|
-
* Unified interface for both lightweight and annotated tags.
|
|
66
|
-
* For annotated tags, includes additional metadata from the tag object.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```typescript
|
|
70
|
-
* // Lightweight tag
|
|
71
|
-
* const light: Tag = {
|
|
72
|
-
* name: 'v0.1.0',
|
|
73
|
-
* type: 'lightweight',
|
|
74
|
-
* sha: 'commitsha...'
|
|
75
|
-
* }
|
|
76
|
-
*
|
|
77
|
-
* // Annotated tag
|
|
78
|
-
* const annotated: Tag = {
|
|
79
|
-
* name: 'v1.0.0',
|
|
80
|
-
* type: 'annotated',
|
|
81
|
-
* sha: 'tagobjectsha...',
|
|
82
|
-
* targetSha: 'commitsha...',
|
|
83
|
-
* targetType: 'commit',
|
|
84
|
-
* tagger: { name: 'Alice', email: 'alice@example.com', timestamp: 1704067200, timezone: '+0000' },
|
|
85
|
-
* message: 'Release 1.0.0'
|
|
86
|
-
* }
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
export interface Tag {
|
|
90
|
-
/** Tag name (e.g., 'v1.0.0') without refs/tags/ prefix */
|
|
91
|
-
name: string;
|
|
92
|
-
/** Tag type: 'lightweight' or 'annotated' */
|
|
93
|
-
type: TagType;
|
|
94
|
-
/**
|
|
95
|
-
* SHA this ref points to.
|
|
96
|
-
* For lightweight tags: commit SHA
|
|
97
|
-
* For annotated tags: tag object SHA
|
|
98
|
-
*/
|
|
99
|
-
sha: string;
|
|
100
|
-
/**
|
|
101
|
-
* For annotated tags: the commit/object the tag points to.
|
|
102
|
-
* Undefined for lightweight tags.
|
|
103
|
-
*/
|
|
104
|
-
targetSha?: string;
|
|
105
|
-
/**
|
|
106
|
-
* For annotated tags: the type of object being tagged.
|
|
107
|
-
* Usually 'commit', but could be 'blob', 'tree', or even 'tag'.
|
|
108
|
-
*/
|
|
109
|
-
targetType?: ObjectType;
|
|
110
|
-
/**
|
|
111
|
-
* For annotated tags: the tagger information.
|
|
112
|
-
* Contains name, email, timestamp, and timezone.
|
|
113
|
-
*/
|
|
114
|
-
tagger?: Author;
|
|
115
|
-
/**
|
|
116
|
-
* For annotated tags: the tag message.
|
|
117
|
-
* Can be multi-line with a subject and body.
|
|
118
|
-
*/
|
|
119
|
-
message?: string;
|
|
120
|
-
/**
|
|
121
|
-
* For signed annotated tags: the GPG signature.
|
|
122
|
-
* ASCII-armored GPG signature block.
|
|
123
|
-
*/
|
|
124
|
-
signature?: string;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Options for creating a tag.
|
|
128
|
-
*
|
|
129
|
-
* @description
|
|
130
|
-
* Controls tag creation behavior including whether to create
|
|
131
|
-
* an annotated tag, message content, and signing options.
|
|
132
|
-
*/
|
|
133
|
-
export interface CreateTagOptions {
|
|
134
|
-
/**
|
|
135
|
-
* Create an annotated tag (default: false for lightweight).
|
|
136
|
-
* If message is provided, defaults to true.
|
|
137
|
-
*/
|
|
138
|
-
annotated?: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Tag message (required for annotated tags unless using empty message).
|
|
141
|
-
* Can be multi-line with subject and body separated by blank line.
|
|
142
|
-
*/
|
|
143
|
-
message?: string;
|
|
144
|
-
/**
|
|
145
|
-
* Tagger information (defaults to configured user).
|
|
146
|
-
* Required for annotated tags if no global config is set.
|
|
147
|
-
*/
|
|
148
|
-
tagger?: Author;
|
|
149
|
-
/**
|
|
150
|
-
* Sign the tag with GPG.
|
|
151
|
-
* Requires GPGSigner to be provided to TagManager.
|
|
152
|
-
*/
|
|
153
|
-
sign?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* GPG key ID to use for signing.
|
|
156
|
-
* Defaults to the user's default signing key.
|
|
157
|
-
*/
|
|
158
|
-
keyId?: string;
|
|
159
|
-
/**
|
|
160
|
-
* Force overwrite if tag exists.
|
|
161
|
-
* Without force, creating an existing tag throws TagError.
|
|
162
|
-
*/
|
|
163
|
-
force?: boolean;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Options for listing tags.
|
|
167
|
-
*
|
|
168
|
-
* @description
|
|
169
|
-
* Provides filtering, sorting, and inclusion options for tag listing.
|
|
170
|
-
*/
|
|
171
|
-
export interface ListTagsOptions {
|
|
172
|
-
/**
|
|
173
|
-
* Pattern to filter tags (glob-like, e.g., 'v1.*', 'release-*').
|
|
174
|
-
* Supports * and ? wildcards.
|
|
175
|
-
*/
|
|
176
|
-
pattern?: string;
|
|
177
|
-
/**
|
|
178
|
-
* Sort order: 'name', 'version', or 'date'.
|
|
179
|
-
* 'version' uses semantic versioning comparison.
|
|
180
|
-
* 'date' requires includeMetadata=true for annotated tags.
|
|
181
|
-
*/
|
|
182
|
-
sort?: 'name' | 'version' | 'date';
|
|
183
|
-
/** Sort direction: 'asc' or 'desc' */
|
|
184
|
-
sortDirection?: 'asc' | 'desc';
|
|
185
|
-
/** Maximum number of tags to return */
|
|
186
|
-
limit?: number;
|
|
187
|
-
/**
|
|
188
|
-
* Include annotated tag metadata (tagger, message).
|
|
189
|
-
* Slower as it requires reading tag objects.
|
|
190
|
-
*/
|
|
191
|
-
includeMetadata?: boolean;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Options for deleting a tag.
|
|
195
|
-
*/
|
|
196
|
-
export interface DeleteTagOptions {
|
|
197
|
-
/**
|
|
198
|
-
* Delete even if tag doesn't exist locally.
|
|
199
|
-
* Without force, deleting non-existent tag throws TagError.
|
|
200
|
-
*/
|
|
201
|
-
force?: boolean;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Options for getting a tag.
|
|
205
|
-
*/
|
|
206
|
-
export interface GetTagOptions {
|
|
207
|
-
/**
|
|
208
|
-
* Resolve to get full annotated tag info.
|
|
209
|
-
* Reads the tag object to populate tagger, message, etc.
|
|
210
|
-
*/
|
|
211
|
-
resolve?: boolean;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Result of tag signature verification.
|
|
215
|
-
*
|
|
216
|
-
* @description
|
|
217
|
-
* Contains verification status and signer information
|
|
218
|
-
* for signed annotated tags.
|
|
219
|
-
*
|
|
220
|
-
* @example
|
|
221
|
-
* ```typescript
|
|
222
|
-
* const result = await manager.verifyTag('v1.0.0')
|
|
223
|
-
* if (result.valid) {
|
|
224
|
-
* console.log(`Signed by: ${result.signer} (${result.keyId})`)
|
|
225
|
-
* console.log(`Trust: ${result.trustLevel}`)
|
|
226
|
-
* } else {
|
|
227
|
-
* console.log(`Verification failed: ${result.error}`)
|
|
228
|
-
* }
|
|
229
|
-
* ```
|
|
230
|
-
*/
|
|
231
|
-
export interface TagSignatureVerification {
|
|
232
|
-
/** Whether the signature is valid */
|
|
233
|
-
valid: boolean;
|
|
234
|
-
/** GPG key ID used for signing (e.g., '0x1234ABCD') */
|
|
235
|
-
keyId?: string;
|
|
236
|
-
/** Signer identity from the key */
|
|
237
|
-
signer?: string;
|
|
238
|
-
/**
|
|
239
|
-
* Trust level of the signing key.
|
|
240
|
-
* Based on GPG web of trust model.
|
|
241
|
-
*/
|
|
242
|
-
trustLevel?: 'ultimate' | 'full' | 'marginal' | 'never' | 'undefined' | 'expired' | 'unknown';
|
|
243
|
-
/** Error message if verification failed */
|
|
244
|
-
error?: string;
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Error codes specific to tag operations.
|
|
248
|
-
*
|
|
249
|
-
* @description
|
|
250
|
-
* Extends RefErrorCode with tag-specific errors:
|
|
251
|
-
* - `TAG_EXISTS`: Tag already exists (when creating without force)
|
|
252
|
-
* - `TAG_NOT_FOUND`: Tag doesn't exist
|
|
253
|
-
* - `INVALID_TAG_NAME`: Tag name fails validation
|
|
254
|
-
* - `MESSAGE_REQUIRED`: Annotated tag requires a message
|
|
255
|
-
* - `GPG_ERROR`: GPG signing or verification failed
|
|
256
|
-
*/
|
|
257
|
-
export type TagErrorCode = RefErrorCode | 'TAG_EXISTS' | 'TAG_NOT_FOUND' | 'INVALID_TAG_NAME' | 'MESSAGE_REQUIRED' | 'GPG_ERROR';
|
|
258
|
-
/**
|
|
259
|
-
* Error thrown when a tag operation fails.
|
|
260
|
-
*
|
|
261
|
-
* @description
|
|
262
|
-
* Provides structured error information with error code
|
|
263
|
-
* for programmatic error handling.
|
|
264
|
-
*
|
|
265
|
-
* @example
|
|
266
|
-
* ```typescript
|
|
267
|
-
* try {
|
|
268
|
-
* await manager.createTag('v1.0.0', 'abc123')
|
|
269
|
-
* } catch (e) {
|
|
270
|
-
* if (e instanceof TagError) {
|
|
271
|
-
* switch (e.code) {
|
|
272
|
-
* case 'TAG_EXISTS':
|
|
273
|
-
* console.log('Tag already exists, use force=true to overwrite')
|
|
274
|
-
* break
|
|
275
|
-
* case 'MESSAGE_REQUIRED':
|
|
276
|
-
* console.log('Annotated tags require a message')
|
|
277
|
-
* break
|
|
278
|
-
* }
|
|
279
|
-
* }
|
|
280
|
-
* }
|
|
281
|
-
* ```
|
|
282
|
-
*/
|
|
283
|
-
export declare class TagError extends Error {
|
|
284
|
-
readonly code: TagErrorCode;
|
|
285
|
-
readonly tagName?: string | undefined;
|
|
286
|
-
/**
|
|
287
|
-
* Create a new TagError.
|
|
288
|
-
*
|
|
289
|
-
* @param message - Human-readable error description
|
|
290
|
-
* @param code - Error code for programmatic handling
|
|
291
|
-
* @param tagName - The tag that caused the error (optional)
|
|
292
|
-
*/
|
|
293
|
-
constructor(message: string, code: TagErrorCode, tagName?: string | undefined);
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Storage backend interface for tag objects.
|
|
297
|
-
*
|
|
298
|
-
* @description
|
|
299
|
-
* Interface for reading and writing tag objects.
|
|
300
|
-
* Used by TagManager for annotated tag operations.
|
|
301
|
-
*/
|
|
302
|
-
export interface TagObjectStorage {
|
|
303
|
-
/**
|
|
304
|
-
* Read a tag object by SHA.
|
|
305
|
-
*
|
|
306
|
-
* @param sha - 40-character SHA-1 of the tag object
|
|
307
|
-
* @returns Parsed TagObject or null if not found
|
|
308
|
-
*/
|
|
309
|
-
readTagObject(sha: string): Promise<TagObject | null>;
|
|
310
|
-
/**
|
|
311
|
-
* Write a tag object and return its SHA.
|
|
312
|
-
*
|
|
313
|
-
* @param tag - Tag object data (without type and data fields)
|
|
314
|
-
* @returns 40-character SHA-1 of the stored tag object
|
|
315
|
-
*/
|
|
316
|
-
writeTagObject(tag: Omit<TagObject, 'type' | 'data'>): Promise<string>;
|
|
317
|
-
/**
|
|
318
|
-
* Read any object to determine its type.
|
|
319
|
-
*
|
|
320
|
-
* @param sha - 40-character SHA-1 of the object
|
|
321
|
-
* @returns Object type or null if not found
|
|
322
|
-
*/
|
|
323
|
-
readObjectType(sha: string): Promise<ObjectType | null>;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* GPG signing interface.
|
|
327
|
-
*
|
|
328
|
-
* @description
|
|
329
|
-
* Interface for GPG signing and verification operations.
|
|
330
|
-
* Used for signed tag creation and verification.
|
|
331
|
-
*/
|
|
332
|
-
export interface GPGSigner {
|
|
333
|
-
/**
|
|
334
|
-
* Sign data and return the signature.
|
|
335
|
-
*
|
|
336
|
-
* @param data - Binary data to sign
|
|
337
|
-
* @param keyId - Optional specific key ID to use
|
|
338
|
-
* @returns ASCII-armored GPG signature
|
|
339
|
-
* @throws Error if signing fails
|
|
340
|
-
*/
|
|
341
|
-
sign(data: Uint8Array, keyId?: string): Promise<string>;
|
|
342
|
-
/**
|
|
343
|
-
* Verify a signature.
|
|
344
|
-
*
|
|
345
|
-
* @param data - Binary data that was signed
|
|
346
|
-
* @param signature - ASCII-armored GPG signature to verify
|
|
347
|
-
* @returns Verification result with validity and signer info
|
|
348
|
-
*/
|
|
349
|
-
verify(data: Uint8Array, signature: string): Promise<TagSignatureVerification>;
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* Tag manager for handling Git tag operations.
|
|
353
|
-
*
|
|
354
|
-
* @description
|
|
355
|
-
* Provides a comprehensive API for tag management including both
|
|
356
|
-
* lightweight and annotated tags. Uses RefStorage for refs and
|
|
357
|
-
* TagObjectStorage for tag objects.
|
|
358
|
-
*
|
|
359
|
-
* Note: Most methods are currently stubs (TODO) and will throw 'Not implemented'.
|
|
360
|
-
* These will be implemented in the GREEN phase of TDD development.
|
|
361
|
-
*
|
|
362
|
-
* @example
|
|
363
|
-
* ```typescript
|
|
364
|
-
* const manager = new TagManager(refStorage, objectStorage, gpgSigner)
|
|
365
|
-
*
|
|
366
|
-
* // Create a release tag
|
|
367
|
-
* const tag = await manager.createTag('v1.0.0', commitSha, {
|
|
368
|
-
* annotated: true,
|
|
369
|
-
* message: 'Version 1.0.0 release',
|
|
370
|
-
* tagger: { name: 'Alice', email: 'alice@example.com', timestamp: 1704067200, timezone: '+0000' }
|
|
371
|
-
* })
|
|
372
|
-
*
|
|
373
|
-
* // List version tags
|
|
374
|
-
* const versions = await manager.listTags({ pattern: 'v*' })
|
|
375
|
-
*
|
|
376
|
-
* // Verify signed tag
|
|
377
|
-
* const verification = await manager.verifyTag('v1.0.0')
|
|
378
|
-
* ```
|
|
379
|
-
*/
|
|
380
|
-
export declare class TagManager {
|
|
381
|
-
private refStorage;
|
|
382
|
-
private objectStorage;
|
|
383
|
-
private gpgSigner?;
|
|
384
|
-
private pendingCreations;
|
|
385
|
-
/**
|
|
386
|
-
* Create a new TagManager.
|
|
387
|
-
*
|
|
388
|
-
* @param refStorage - RefStorage instance for managing tag refs
|
|
389
|
-
* @param objectStorage - Storage for reading/writing tag objects
|
|
390
|
-
* @param gpgSigner - Optional GPG signer for signed tags
|
|
391
|
-
*/
|
|
392
|
-
constructor(refStorage: TagRefStorage, objectStorage: TagObjectStorage, gpgSigner?: GPGSigner);
|
|
393
|
-
/**
|
|
394
|
-
* Create a new tag.
|
|
395
|
-
*
|
|
396
|
-
* @description
|
|
397
|
-
* Creates either a lightweight or annotated tag pointing to the
|
|
398
|
-
* specified target. For annotated tags, creates a tag object with
|
|
399
|
-
* metadata and optionally signs it.
|
|
400
|
-
*
|
|
401
|
-
* @param name - Tag name (without refs/tags/ prefix)
|
|
402
|
-
* @param target - Target SHA to tag (usually a commit)
|
|
403
|
-
* @param options - Creation options
|
|
404
|
-
* @returns The created tag
|
|
405
|
-
* @throws TagError with code 'INVALID_TAG_NAME' if name is invalid
|
|
406
|
-
* @throws TagError with code 'TAG_EXISTS' if tag exists and not forcing
|
|
407
|
-
* @throws TagError with code 'MESSAGE_REQUIRED' for annotated tag without message
|
|
408
|
-
* @throws TagError with code 'GPG_ERROR' if signing fails
|
|
409
|
-
*
|
|
410
|
-
* @example
|
|
411
|
-
* ```typescript
|
|
412
|
-
* // Create lightweight tag
|
|
413
|
-
* const light = await manager.createTag('v0.1.0', commitSha)
|
|
414
|
-
*
|
|
415
|
-
* // Create annotated tag
|
|
416
|
-
* const annotated = await manager.createTag('v1.0.0', commitSha, {
|
|
417
|
-
* annotated: true,
|
|
418
|
-
* message: 'Release 1.0.0',
|
|
419
|
-
* tagger: { name: 'Alice', email: 'alice@example.com', timestamp: 1704067200, timezone: '+0000' }
|
|
420
|
-
* })
|
|
421
|
-
*
|
|
422
|
-
* // Create signed tag
|
|
423
|
-
* const signed = await manager.createTag('v1.0.0', commitSha, {
|
|
424
|
-
* annotated: true,
|
|
425
|
-
* message: 'Release 1.0.0',
|
|
426
|
-
* sign: true
|
|
427
|
-
* })
|
|
428
|
-
* ```
|
|
429
|
-
*/
|
|
430
|
-
createTag(name: string, target: string, options?: CreateTagOptions): Promise<Tag>;
|
|
431
|
-
/**
|
|
432
|
-
* Delete a tag.
|
|
433
|
-
*
|
|
434
|
-
* @description
|
|
435
|
-
* Removes a tag ref. Does not delete the tag object (if annotated)
|
|
436
|
-
* as it may be referenced elsewhere (reflog, etc.).
|
|
437
|
-
*
|
|
438
|
-
* @param name - Tag name to delete
|
|
439
|
-
* @param options - Deletion options
|
|
440
|
-
* @returns True if tag was deleted, false if it didn't exist (with force)
|
|
441
|
-
* @throws TagError with code 'TAG_NOT_FOUND' if tag doesn't exist (without force)
|
|
442
|
-
*
|
|
443
|
-
* @example
|
|
444
|
-
* ```typescript
|
|
445
|
-
* await manager.deleteTag('v0.9.0-beta')
|
|
446
|
-
*
|
|
447
|
-
* // Delete even if doesn't exist
|
|
448
|
-
* await manager.deleteTag('maybe-exists', { force: true })
|
|
449
|
-
* ```
|
|
450
|
-
*/
|
|
451
|
-
deleteTag(name: string, options?: DeleteTagOptions): Promise<boolean>;
|
|
452
|
-
/**
|
|
453
|
-
* List all tags.
|
|
454
|
-
*
|
|
455
|
-
* @description
|
|
456
|
-
* Returns tags matching the specified criteria.
|
|
457
|
-
* By default returns all tags sorted by name.
|
|
458
|
-
*
|
|
459
|
-
* @param options - Listing options
|
|
460
|
-
* @returns Array of tags matching criteria
|
|
461
|
-
*
|
|
462
|
-
* @example
|
|
463
|
-
* ```typescript
|
|
464
|
-
* // List all tags
|
|
465
|
-
* const all = await manager.listTags()
|
|
466
|
-
*
|
|
467
|
-
* // List version tags with metadata
|
|
468
|
-
* const versions = await manager.listTags({
|
|
469
|
-
* pattern: 'v*',
|
|
470
|
-
* sort: 'version',
|
|
471
|
-
* includeMetadata: true
|
|
472
|
-
* })
|
|
473
|
-
*
|
|
474
|
-
* // Get latest 5 tags
|
|
475
|
-
* const latest = await manager.listTags({
|
|
476
|
-
* sort: 'date',
|
|
477
|
-
* sortDirection: 'desc',
|
|
478
|
-
* limit: 5,
|
|
479
|
-
* includeMetadata: true
|
|
480
|
-
* })
|
|
481
|
-
* ```
|
|
482
|
-
*/
|
|
483
|
-
listTags(options?: ListTagsOptions): Promise<Tag[]>;
|
|
484
|
-
/**
|
|
485
|
-
* Get a tag by name.
|
|
486
|
-
*
|
|
487
|
-
* @description
|
|
488
|
-
* Retrieves tag information. Use resolve=true to get full
|
|
489
|
-
* annotated tag metadata.
|
|
490
|
-
*
|
|
491
|
-
* @param name - Tag name
|
|
492
|
-
* @param options - Get options
|
|
493
|
-
* @returns Tag info or null if not found
|
|
494
|
-
*
|
|
495
|
-
* @example
|
|
496
|
-
* ```typescript
|
|
497
|
-
* // Quick lookup
|
|
498
|
-
* const tag = await manager.getTag('v1.0.0')
|
|
499
|
-
*
|
|
500
|
-
* // Get full metadata
|
|
501
|
-
* const full = await manager.getTag('v1.0.0', { resolve: true })
|
|
502
|
-
* if (full?.type === 'annotated') {
|
|
503
|
-
* console.log(`Tagged by: ${full.tagger?.name}`)
|
|
504
|
-
* console.log(`Message: ${full.message}`)
|
|
505
|
-
* }
|
|
506
|
-
* ```
|
|
507
|
-
*/
|
|
508
|
-
getTag(name: string, options?: GetTagOptions): Promise<Tag | null>;
|
|
509
|
-
/**
|
|
510
|
-
* Check if a tag exists.
|
|
511
|
-
*
|
|
512
|
-
* @description
|
|
513
|
-
* Quick check for tag existence without fetching full info.
|
|
514
|
-
*
|
|
515
|
-
* @param name - Tag name
|
|
516
|
-
* @returns True if tag exists
|
|
517
|
-
*
|
|
518
|
-
* @example
|
|
519
|
-
* ```typescript
|
|
520
|
-
* if (await manager.tagExists('v1.0.0')) {
|
|
521
|
-
* console.log('Tag already exists')
|
|
522
|
-
* }
|
|
523
|
-
* ```
|
|
524
|
-
*/
|
|
525
|
-
tagExists(name: string): Promise<boolean>;
|
|
526
|
-
/**
|
|
527
|
-
* Get the target (commit SHA) that a tag points to.
|
|
528
|
-
*
|
|
529
|
-
* @description
|
|
530
|
-
* Resolves through annotated tags to get the final target.
|
|
531
|
-
* For lightweight tags, returns the sha directly.
|
|
532
|
-
* For annotated tags, returns the targetSha.
|
|
533
|
-
*
|
|
534
|
-
* @param name - Tag name
|
|
535
|
-
* @returns Target commit SHA
|
|
536
|
-
* @throws TagError with code 'TAG_NOT_FOUND' if tag doesn't exist
|
|
537
|
-
*
|
|
538
|
-
* @example
|
|
539
|
-
* ```typescript
|
|
540
|
-
* const commitSha = await manager.getTagTarget('v1.0.0')
|
|
541
|
-
* ```
|
|
542
|
-
*/
|
|
543
|
-
getTagTarget(name: string): Promise<string>;
|
|
544
|
-
/**
|
|
545
|
-
* Verify a tag's GPG signature.
|
|
546
|
-
*
|
|
547
|
-
* @description
|
|
548
|
-
* Verifies the GPG signature on a signed annotated tag.
|
|
549
|
-
* Returns verification result with signer info.
|
|
550
|
-
*
|
|
551
|
-
* @param name - Tag name to verify
|
|
552
|
-
* @returns Verification result
|
|
553
|
-
* @throws TagError with code 'TAG_NOT_FOUND' if tag doesn't exist
|
|
554
|
-
*
|
|
555
|
-
* @example
|
|
556
|
-
* ```typescript
|
|
557
|
-
* const result = await manager.verifyTag('v1.0.0')
|
|
558
|
-
* if (result.valid) {
|
|
559
|
-
* console.log(`Signed by: ${result.signer}`)
|
|
560
|
-
* console.log(`Trust: ${result.trustLevel}`)
|
|
561
|
-
* } else {
|
|
562
|
-
* console.log(`Verification failed: ${result.error}`)
|
|
563
|
-
* }
|
|
564
|
-
* ```
|
|
565
|
-
*/
|
|
566
|
-
verifyTag(name: string): Promise<TagSignatureVerification>;
|
|
567
|
-
/**
|
|
568
|
-
* Check if a tag is annotated.
|
|
569
|
-
*
|
|
570
|
-
* @description
|
|
571
|
-
* Determines if a tag is annotated (has a tag object) or lightweight.
|
|
572
|
-
*
|
|
573
|
-
* @param name - Tag name
|
|
574
|
-
* @returns True if the tag is annotated
|
|
575
|
-
* @throws TagError with code 'TAG_NOT_FOUND' if tag doesn't exist
|
|
576
|
-
*
|
|
577
|
-
* @example
|
|
578
|
-
* ```typescript
|
|
579
|
-
* if (await manager.isAnnotatedTag('v1.0.0')) {
|
|
580
|
-
* console.log('This is an annotated tag')
|
|
581
|
-
* }
|
|
582
|
-
* ```
|
|
583
|
-
*/
|
|
584
|
-
isAnnotatedTag(name: string): Promise<boolean>;
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* Validate a tag name according to Git rules.
|
|
588
|
-
*
|
|
589
|
-
* @description
|
|
590
|
-
* Tags follow the same rules as refs but under refs/tags/.
|
|
591
|
-
* This validates against the full git-check-ref-format rules.
|
|
592
|
-
*
|
|
593
|
-
* **Rules**:
|
|
594
|
-
* - Cannot be empty
|
|
595
|
-
* - Cannot end with '/' or '.lock'
|
|
596
|
-
* - Cannot contain '..', '@{', control chars, space, ~, ^, :, ?, *, [, \
|
|
597
|
-
* - Components cannot start or end with '.'
|
|
598
|
-
*
|
|
599
|
-
* Note: This is a stub implementation. Full validation will be added in GREEN phase.
|
|
600
|
-
*
|
|
601
|
-
* @param name - Tag name to validate
|
|
602
|
-
* @returns True if valid
|
|
603
|
-
*
|
|
604
|
-
* @see https://git-scm.com/docs/git-check-ref-format
|
|
605
|
-
*
|
|
606
|
-
* @example
|
|
607
|
-
* ```typescript
|
|
608
|
-
* isValidTagName('v1.0.0') // true
|
|
609
|
-
* isValidTagName('release/1.0') // true
|
|
610
|
-
* isValidTagName('v1.0.0.lock') // false (ends with .lock)
|
|
611
|
-
* isValidTagName('v1..0') // false (contains ..)
|
|
612
|
-
* isValidTagName('') // false (empty)
|
|
613
|
-
* ```
|
|
614
|
-
*/
|
|
615
|
-
export declare function isValidTagName(name: string): boolean;
|
|
616
|
-
/**
|
|
617
|
-
* Type guard for annotated tags.
|
|
618
|
-
*
|
|
619
|
-
* @description
|
|
620
|
-
* Checks if a tag is annotated with full metadata.
|
|
621
|
-
* Narrows the type to include tagger and message.
|
|
622
|
-
*
|
|
623
|
-
* @param tag - Tag to check
|
|
624
|
-
* @returns True if the tag is annotated with full metadata
|
|
625
|
-
*
|
|
626
|
-
* @example
|
|
627
|
-
* ```typescript
|
|
628
|
-
* if (isAnnotatedTag(tag)) {
|
|
629
|
-
* // tag.tagger and tag.message are now guaranteed
|
|
630
|
-
* console.log(`Tagged by: ${tag.tagger.name}`)
|
|
631
|
-
* }
|
|
632
|
-
* ```
|
|
633
|
-
*/
|
|
634
|
-
export declare function isAnnotatedTag(tag: Tag): tag is Tag & {
|
|
635
|
-
type: 'annotated';
|
|
636
|
-
tagger: Author;
|
|
637
|
-
message: string;
|
|
638
|
-
};
|
|
639
|
-
/**
|
|
640
|
-
* Format a tag message.
|
|
641
|
-
*
|
|
642
|
-
* @description
|
|
643
|
-
* Normalizes a tag message: handles line endings, trims whitespace,
|
|
644
|
-
* ensures proper formatting.
|
|
645
|
-
*
|
|
646
|
-
* @param message - Raw message input
|
|
647
|
-
* @returns Formatted message
|
|
648
|
-
*
|
|
649
|
-
* @example
|
|
650
|
-
* ```typescript
|
|
651
|
-
* formatTagMessage(' Hello World \r\n') // 'Hello World\n'
|
|
652
|
-
* ```
|
|
653
|
-
*/
|
|
654
|
-
export declare function formatTagMessage(message: string): string;
|
|
655
|
-
/**
|
|
656
|
-
* Parse a tag message from raw content.
|
|
657
|
-
*
|
|
658
|
-
* @description
|
|
659
|
-
* Separates the message from any GPG signature.
|
|
660
|
-
* GPG signatures start with '-----BEGIN PGP SIGNATURE-----'.
|
|
661
|
-
*
|
|
662
|
-
* @param content - Raw tag content
|
|
663
|
-
* @returns Parsed message and optional signature
|
|
664
|
-
*
|
|
665
|
-
* @example
|
|
666
|
-
* ```typescript
|
|
667
|
-
* const { message, signature } = parseTagMessage(content)
|
|
668
|
-
* if (signature) {
|
|
669
|
-
* console.log('Tag is signed')
|
|
670
|
-
* }
|
|
671
|
-
* ```
|
|
672
|
-
*/
|
|
673
|
-
export declare function parseTagMessage(content: string): {
|
|
674
|
-
message: string;
|
|
675
|
-
signature?: string;
|
|
676
|
-
};
|
|
677
|
-
/**
|
|
678
|
-
* Create a tag (lightweight or annotated).
|
|
679
|
-
*
|
|
680
|
-
* @description
|
|
681
|
-
* Convenience function that wraps TagManager.createTag.
|
|
682
|
-
*
|
|
683
|
-
* @param manager - TagManager instance
|
|
684
|
-
* @param name - Tag name
|
|
685
|
-
* @param target - Target SHA to tag
|
|
686
|
-
* @param options - Creation options
|
|
687
|
-
* @returns Created tag
|
|
688
|
-
*
|
|
689
|
-
* @example
|
|
690
|
-
* ```typescript
|
|
691
|
-
* const tag = await createTag(manager, 'v1.0.0', commitSha, {
|
|
692
|
-
* annotated: true,
|
|
693
|
-
* message: 'Release 1.0.0'
|
|
694
|
-
* })
|
|
695
|
-
* ```
|
|
696
|
-
*/
|
|
697
|
-
export declare function createTag(manager: TagManager, name: string, target: string, options?: CreateTagOptions): Promise<Tag>;
|
|
698
|
-
/**
|
|
699
|
-
* Create an annotated tag with message.
|
|
700
|
-
*
|
|
701
|
-
* @description
|
|
702
|
-
* Convenience function for creating annotated tags.
|
|
703
|
-
* Automatically sets annotated=true.
|
|
704
|
-
*
|
|
705
|
-
* @param manager - TagManager instance
|
|
706
|
-
* @param name - Tag name
|
|
707
|
-
* @param target - Target SHA to tag
|
|
708
|
-
* @param message - Tag message
|
|
709
|
-
* @param tagger - Tagger information
|
|
710
|
-
* @param options - Additional options (excluding annotated, message, tagger)
|
|
711
|
-
* @returns Created annotated tag
|
|
712
|
-
*
|
|
713
|
-
* @example
|
|
714
|
-
* ```typescript
|
|
715
|
-
* const tag = await createAnnotatedTag(
|
|
716
|
-
* manager,
|
|
717
|
-
* 'v1.0.0',
|
|
718
|
-
* commitSha,
|
|
719
|
-
* 'Release 1.0.0',
|
|
720
|
-
* { name: 'Alice', email: 'alice@example.com', timestamp: Date.now()/1000, timezone: '+0000' }
|
|
721
|
-
* )
|
|
722
|
-
* ```
|
|
723
|
-
*/
|
|
724
|
-
export declare function createAnnotatedTag(manager: TagManager, name: string, target: string, message: string, tagger: Author, options?: Omit<CreateTagOptions, 'annotated' | 'message' | 'tagger'>): Promise<Tag>;
|
|
725
|
-
/**
|
|
726
|
-
* Delete a tag.
|
|
727
|
-
*
|
|
728
|
-
* @description
|
|
729
|
-
* Convenience function that wraps TagManager.deleteTag.
|
|
730
|
-
*
|
|
731
|
-
* @param manager - TagManager instance
|
|
732
|
-
* @param name - Tag name to delete
|
|
733
|
-
* @param options - Deletion options
|
|
734
|
-
* @returns True if deleted
|
|
735
|
-
*
|
|
736
|
-
* @example
|
|
737
|
-
* ```typescript
|
|
738
|
-
* await deleteTag(manager, 'v0.9.0-beta')
|
|
739
|
-
* ```
|
|
740
|
-
*/
|
|
741
|
-
export declare function deleteTag(manager: TagManager, name: string, options?: DeleteTagOptions): Promise<boolean>;
|
|
742
|
-
/**
|
|
743
|
-
* List all tags.
|
|
744
|
-
*
|
|
745
|
-
* @description
|
|
746
|
-
* Convenience function that wraps TagManager.listTags.
|
|
747
|
-
*
|
|
748
|
-
* @param manager - TagManager instance
|
|
749
|
-
* @param options - Listing options
|
|
750
|
-
* @returns Array of tags
|
|
751
|
-
*
|
|
752
|
-
* @example
|
|
753
|
-
* ```typescript
|
|
754
|
-
* const tags = await listTags(manager, { pattern: 'v1.*' })
|
|
755
|
-
* ```
|
|
756
|
-
*/
|
|
757
|
-
export declare function listTags(manager: TagManager, options?: ListTagsOptions): Promise<Tag[]>;
|
|
758
|
-
/**
|
|
759
|
-
* Get a tag by name.
|
|
760
|
-
*
|
|
761
|
-
* @description
|
|
762
|
-
* Convenience function that wraps TagManager.getTag.
|
|
763
|
-
*
|
|
764
|
-
* @param manager - TagManager instance
|
|
765
|
-
* @param name - Tag name
|
|
766
|
-
* @param options - Get options
|
|
767
|
-
* @returns Tag info or null
|
|
768
|
-
*
|
|
769
|
-
* @example
|
|
770
|
-
* ```typescript
|
|
771
|
-
* const tag = await getTag(manager, 'v1.0.0', { resolve: true })
|
|
772
|
-
* ```
|
|
773
|
-
*/
|
|
774
|
-
export declare function getTag(manager: TagManager, name: string, options?: GetTagOptions): Promise<Tag | null>;
|
|
775
|
-
/**
|
|
776
|
-
* Check if a tag is annotated.
|
|
777
|
-
*
|
|
778
|
-
* @description
|
|
779
|
-
* Convenience function that wraps TagManager.isAnnotatedTag.
|
|
780
|
-
*
|
|
781
|
-
* @param manager - TagManager instance
|
|
782
|
-
* @param name - Tag name
|
|
783
|
-
* @returns True if annotated
|
|
784
|
-
*
|
|
785
|
-
* @example
|
|
786
|
-
* ```typescript
|
|
787
|
-
* if (await checkIsAnnotatedTag(manager, 'v1.0.0')) {
|
|
788
|
-
* console.log('Annotated tag')
|
|
789
|
-
* }
|
|
790
|
-
* ```
|
|
791
|
-
*/
|
|
792
|
-
export declare function checkIsAnnotatedTag(manager: TagManager, name: string): Promise<boolean>;
|
|
793
|
-
/**
|
|
794
|
-
* Verify a tag's signature.
|
|
795
|
-
*
|
|
796
|
-
* @description
|
|
797
|
-
* Convenience function that wraps TagManager.verifyTag.
|
|
798
|
-
*
|
|
799
|
-
* @param manager - TagManager instance
|
|
800
|
-
* @param name - Tag name
|
|
801
|
-
* @returns Verification result
|
|
802
|
-
*
|
|
803
|
-
* @example
|
|
804
|
-
* ```typescript
|
|
805
|
-
* const result = await verifyTagSignature(manager, 'v1.0.0')
|
|
806
|
-
* ```
|
|
807
|
-
*/
|
|
808
|
-
export declare function verifyTagSignature(manager: TagManager, name: string): Promise<TagSignatureVerification>;
|
|
809
|
-
/**
|
|
810
|
-
* Get the target commit SHA for a tag.
|
|
811
|
-
*
|
|
812
|
-
* @description
|
|
813
|
-
* Convenience function that wraps TagManager.getTagTarget.
|
|
814
|
-
*
|
|
815
|
-
* @param manager - TagManager instance
|
|
816
|
-
* @param name - Tag name
|
|
817
|
-
* @returns Target commit SHA
|
|
818
|
-
*
|
|
819
|
-
* @example
|
|
820
|
-
* ```typescript
|
|
821
|
-
* const sha = await getTagTarget(manager, 'v1.0.0')
|
|
822
|
-
* ```
|
|
823
|
-
*/
|
|
824
|
-
export declare function getTagTarget(manager: TagManager, name: string): Promise<string>;
|
|
825
|
-
/**
|
|
826
|
-
* Sort tags by semantic version.
|
|
827
|
-
*
|
|
828
|
-
* @description
|
|
829
|
-
* Sorts tags that look like semantic versions (v1.2.3).
|
|
830
|
-
* Non-semver tags are sorted lexicographically at the end.
|
|
831
|
-
*
|
|
832
|
-
* @param tags - Array of tags to sort
|
|
833
|
-
* @param direction - Sort direction ('asc' or 'desc')
|
|
834
|
-
* @returns Sorted array of tags
|
|
835
|
-
*
|
|
836
|
-
* @example
|
|
837
|
-
* ```typescript
|
|
838
|
-
* const sorted = sortTagsByVersion(tags, 'desc')
|
|
839
|
-
* // ['v2.0.0', 'v1.10.0', 'v1.9.0', 'v1.0.0', ...]
|
|
840
|
-
* ```
|
|
841
|
-
*/
|
|
842
|
-
export declare function sortTagsByVersion(tags: Tag[], direction?: 'asc' | 'desc'): Tag[];
|
|
843
|
-
/**
|
|
844
|
-
* Filter tags by glob pattern.
|
|
845
|
-
*
|
|
846
|
-
* @description
|
|
847
|
-
* Filters tags matching a glob pattern.
|
|
848
|
-
* Supports * (any chars) and ? (single char) wildcards.
|
|
849
|
-
*
|
|
850
|
-
* @param tags - Array of tags to filter
|
|
851
|
-
* @param pattern - Glob pattern (e.g., 'v1.*', 'release-*')
|
|
852
|
-
* @returns Filtered array of tags
|
|
853
|
-
*
|
|
854
|
-
* @example
|
|
855
|
-
* ```typescript
|
|
856
|
-
* const v1Tags = filterTagsByPattern(tags, 'v1.*')
|
|
857
|
-
* ```
|
|
858
|
-
*/
|
|
859
|
-
export declare function filterTagsByPattern(tags: Tag[], pattern: string): Tag[];
|
|
860
|
-
//# sourceMappingURL=tag.d.ts.map
|