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
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview gitx status command
|
|
3
|
+
*
|
|
4
|
+
* This module implements the `gitx status` command which displays the
|
|
5
|
+
* working tree status. It shows:
|
|
6
|
+
* - Untracked files (not yet added to git)
|
|
7
|
+
* - Modified files (changed but not staged)
|
|
8
|
+
* - Staged files (ready to commit)
|
|
9
|
+
* - Deleted files
|
|
10
|
+
* - Renamed files
|
|
11
|
+
* - Current branch and tracking information
|
|
12
|
+
*
|
|
13
|
+
* Supports both long format (default) and short format (--short) output,
|
|
14
|
+
* similar to git's status command.
|
|
15
|
+
*
|
|
16
|
+
* @module cli/commands/status
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Long format output
|
|
20
|
+
* await statusCommand(ctx)
|
|
21
|
+
* // On branch main
|
|
22
|
+
* // Your branch is up to date with 'origin/main'.
|
|
23
|
+
* //
|
|
24
|
+
* // Changes to be committed:
|
|
25
|
+
* // new file: src/new-file.ts
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Short format output
|
|
29
|
+
* ctx.options.short = true
|
|
30
|
+
* await statusCommand(ctx)
|
|
31
|
+
* // A src/new-file.ts
|
|
32
|
+
* // ?? untracked-file.txt
|
|
33
|
+
*/
|
|
34
|
+
import type { CommandContext } from '../index';
|
|
35
|
+
/**
|
|
36
|
+
* Options for the status command.
|
|
37
|
+
*
|
|
38
|
+
* @description Configuration options that control the output format
|
|
39
|
+
* of the status command.
|
|
40
|
+
*
|
|
41
|
+
* @property short - Show output in short format (two-character status codes)
|
|
42
|
+
* @property branch - Show only branch information (with short format)
|
|
43
|
+
*/
|
|
44
|
+
export interface StatusOptions {
|
|
45
|
+
/** Show output in short format */
|
|
46
|
+
short?: boolean;
|
|
47
|
+
/** Show only branch info */
|
|
48
|
+
branch?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Status information for a single file.
|
|
52
|
+
*
|
|
53
|
+
* @description Represents the status of a file in both the index (staging area)
|
|
54
|
+
* and working tree. Uses git-style two-character status codes.
|
|
55
|
+
*
|
|
56
|
+
* @property path - File path relative to repository root
|
|
57
|
+
* @property index - Status in the index (staged changes)
|
|
58
|
+
* @property workingTree - Status in the working tree (unstaged changes)
|
|
59
|
+
* @property origPath - Original path for renamed files
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // A staged new file
|
|
63
|
+
* const status: FileStatus = {
|
|
64
|
+
* path: 'src/new.ts',
|
|
65
|
+
* index: 'A',
|
|
66
|
+
* workingTree: ' '
|
|
67
|
+
* }
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* // A renamed file
|
|
71
|
+
* const status: FileStatus = {
|
|
72
|
+
* path: 'new-name.ts',
|
|
73
|
+
* index: 'R',
|
|
74
|
+
* workingTree: ' ',
|
|
75
|
+
* origPath: 'old-name.ts'
|
|
76
|
+
* }
|
|
77
|
+
*/
|
|
78
|
+
export interface FileStatus {
|
|
79
|
+
/** File path */
|
|
80
|
+
path: string;
|
|
81
|
+
/** Status in index (staged) */
|
|
82
|
+
index: StatusCode;
|
|
83
|
+
/** Status in working tree */
|
|
84
|
+
workingTree: StatusCode;
|
|
85
|
+
/** Original path for renamed files */
|
|
86
|
+
origPath?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Git status codes for files.
|
|
90
|
+
*
|
|
91
|
+
* @description Single-character codes representing file status:
|
|
92
|
+
* - ' ' - Unmodified
|
|
93
|
+
* - 'M' - Modified
|
|
94
|
+
* - 'A' - Added
|
|
95
|
+
* - 'D' - Deleted
|
|
96
|
+
* - 'R' - Renamed
|
|
97
|
+
* - 'C' - Copied
|
|
98
|
+
* - '?' - Untracked
|
|
99
|
+
* - '!' - Ignored
|
|
100
|
+
* - 'U' - Updated but unmerged (conflict)
|
|
101
|
+
*/
|
|
102
|
+
export type StatusCode = ' ' | 'M' | 'A' | 'D' | 'R' | 'C' | '?' | '!' | 'U';
|
|
103
|
+
/**
|
|
104
|
+
* Branch information for status display.
|
|
105
|
+
*
|
|
106
|
+
* @description Contains information about the current branch,
|
|
107
|
+
* its tracking upstream, and ahead/behind counts.
|
|
108
|
+
*
|
|
109
|
+
* @property name - Current branch name (or short SHA if detached)
|
|
110
|
+
* @property upstream - Remote tracking branch (e.g., 'origin/main')
|
|
111
|
+
* @property ahead - Number of commits ahead of upstream
|
|
112
|
+
* @property behind - Number of commits behind upstream
|
|
113
|
+
* @property detached - Whether HEAD is detached (not on a branch)
|
|
114
|
+
*/
|
|
115
|
+
export interface BranchInfo {
|
|
116
|
+
/** Current branch name */
|
|
117
|
+
name: string;
|
|
118
|
+
/** Remote tracking branch */
|
|
119
|
+
upstream?: string;
|
|
120
|
+
/** Number of commits ahead of upstream */
|
|
121
|
+
ahead?: number;
|
|
122
|
+
/** Number of commits behind upstream */
|
|
123
|
+
behind?: number;
|
|
124
|
+
/** Whether HEAD is detached */
|
|
125
|
+
detached?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Complete result of the status command.
|
|
129
|
+
*
|
|
130
|
+
* @description Contains all information needed to display the status:
|
|
131
|
+
* branch info, file statuses, and whether the working tree is clean.
|
|
132
|
+
*
|
|
133
|
+
* @property branch - Branch information
|
|
134
|
+
* @property files - Array of file status objects
|
|
135
|
+
* @property isClean - true if there are no changes to commit
|
|
136
|
+
*/
|
|
137
|
+
export interface StatusResult {
|
|
138
|
+
/** Branch information */
|
|
139
|
+
branch: BranchInfo;
|
|
140
|
+
/** File statuses */
|
|
141
|
+
files: FileStatus[];
|
|
142
|
+
/** Whether the working tree is clean */
|
|
143
|
+
isClean: boolean;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Execute the status command.
|
|
147
|
+
*
|
|
148
|
+
* @description Main entry point for the status command. Displays the working
|
|
149
|
+
* tree status in either long or short format based on options.
|
|
150
|
+
*
|
|
151
|
+
* @param ctx - Command context with cwd, options, and I/O functions
|
|
152
|
+
*
|
|
153
|
+
* @throws {Error} With message starting "fatal:" if not in a git repository
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* // Long format (default)
|
|
157
|
+
* await statusCommand({ cwd: '/repo', options: {}, stdout: console.log, stderr: console.error, args: [], rawArgs: [] })
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* // Short format
|
|
161
|
+
* await statusCommand({ cwd: '/repo', options: { short: true }, stdout: console.log, stderr: console.error, args: [], rawArgs: [] })
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* // Branch only
|
|
165
|
+
* await statusCommand({ cwd: '/repo', options: { branch: true }, stdout: console.log, stderr: console.error, args: [], rawArgs: [] })
|
|
166
|
+
*/
|
|
167
|
+
export declare function statusCommand(ctx: CommandContext): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Get the working tree status.
|
|
170
|
+
*
|
|
171
|
+
* @description Computes the complete status of the working tree by comparing
|
|
172
|
+
* the index (staging area), working directory, and HEAD commit. Returns
|
|
173
|
+
* structured status information for all tracked and untracked files.
|
|
174
|
+
*
|
|
175
|
+
* @param cwd - Working directory (repository root)
|
|
176
|
+
* @returns Promise<StatusResult> with branch info, file statuses, and isClean flag
|
|
177
|
+
*
|
|
178
|
+
* @throws {Error} With message starting "fatal:" if not in a git repository
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* const status = await getStatus('/path/to/repo')
|
|
182
|
+
* if (status.isClean) {
|
|
183
|
+
* console.log('Nothing to commit, working tree clean')
|
|
184
|
+
* } else {
|
|
185
|
+
* console.log(`${status.files.length} files with changes`)
|
|
186
|
+
* }
|
|
187
|
+
*/
|
|
188
|
+
export declare function getStatus(cwd: string): Promise<StatusResult>;
|
|
189
|
+
/**
|
|
190
|
+
* Get branch information for the current repository.
|
|
191
|
+
*
|
|
192
|
+
* @description Retrieves information about the current branch including
|
|
193
|
+
* its name, upstream tracking branch, and ahead/behind counts. Detects
|
|
194
|
+
* detached HEAD state.
|
|
195
|
+
*
|
|
196
|
+
* @param cwd - Working directory (repository root)
|
|
197
|
+
* @returns Promise<BranchInfo> with branch name and tracking information
|
|
198
|
+
*
|
|
199
|
+
* @throws {Error} With message starting "fatal:" if not in a git repository
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* const branch = await getBranchInfo('/path/to/repo')
|
|
203
|
+
* if (branch.detached) {
|
|
204
|
+
* console.log(`Detached at ${branch.name}`)
|
|
205
|
+
* } else {
|
|
206
|
+
* console.log(`On branch ${branch.name}`)
|
|
207
|
+
* if (branch.upstream) {
|
|
208
|
+
* console.log(`Tracking ${branch.upstream}`)
|
|
209
|
+
* }
|
|
210
|
+
* }
|
|
211
|
+
*/
|
|
212
|
+
export declare function getBranchInfo(cwd: string): Promise<BranchInfo>;
|
|
213
|
+
/**
|
|
214
|
+
* Format status output for display (long format).
|
|
215
|
+
*
|
|
216
|
+
* @description Formats the status result in git's long format, showing
|
|
217
|
+
* grouped sections for staged changes, unstaged changes, and untracked files.
|
|
218
|
+
* Includes branch tracking information and helpful hints.
|
|
219
|
+
*
|
|
220
|
+
* @param result - StatusResult object with branch and file information
|
|
221
|
+
* @returns Formatted multi-line string suitable for terminal output
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* const status = await getStatus('/repo')
|
|
225
|
+
* console.log(formatStatusLong(status))
|
|
226
|
+
* // On branch main
|
|
227
|
+
* // Your branch is up to date with 'origin/main'.
|
|
228
|
+
* //
|
|
229
|
+
* // Changes to be committed:
|
|
230
|
+
* // new file: src/feature.ts
|
|
231
|
+
*/
|
|
232
|
+
export declare function formatStatusLong(result: StatusResult): string;
|
|
233
|
+
/**
|
|
234
|
+
* Format status output for display (short format).
|
|
235
|
+
*
|
|
236
|
+
* @description Formats the status result in git's short/porcelain format,
|
|
237
|
+
* showing two-character status codes followed by the file path. Used with
|
|
238
|
+
* the --short flag.
|
|
239
|
+
*
|
|
240
|
+
* @param result - StatusResult object with branch and file information
|
|
241
|
+
* @returns Formatted string with one file per line (empty string if no changes)
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* const status = await getStatus('/repo')
|
|
245
|
+
* console.log(formatStatusShort(status))
|
|
246
|
+
* // A src/new-file.ts
|
|
247
|
+
* // M src/modified.ts
|
|
248
|
+
* // ?? untracked.txt
|
|
249
|
+
*/
|
|
250
|
+
export declare function formatStatusShort(result: StatusResult): string;
|
|
251
|
+
/**
|
|
252
|
+
* Format branch info for --branch flag.
|
|
253
|
+
*
|
|
254
|
+
* @description Formats branch information in the short format used with
|
|
255
|
+
* --branch flag. Shows branch name, tracking upstream, and ahead/behind counts.
|
|
256
|
+
*
|
|
257
|
+
* @param branch - BranchInfo object
|
|
258
|
+
* @returns Single-line string starting with "## " showing branch status
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* console.log(formatBranchOnly({ name: 'main', upstream: 'origin/main', ahead: 2, behind: 0 }))
|
|
262
|
+
* // ## main...origin/main [ahead 2]
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* console.log(formatBranchOnly({ name: 'abc1234', detached: true }))
|
|
266
|
+
* // ## HEAD (no branch)
|
|
267
|
+
*/
|
|
268
|
+
export declare function formatBranchOnly(branch: BranchInfo): string;
|
|
269
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAO9C;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4BAA4B;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,UAAU;IACzB,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,+BAA+B;IAC/B,KAAK,EAAE,UAAU,CAAA;IACjB,6BAA6B;IAC7B,WAAW,EAAE,UAAU,CAAA;IACvB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,UAAU,GAClB,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAA;AAEP;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAU;IACzB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,MAAM,EAAE,UAAU,CAAA;IAClB,oBAAoB;IACpB,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAA;CACjB;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAmCtE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAgElE;AAmDD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAkEpE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA8E7D;AA2BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAe9D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CA2B3D"}
|