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,457 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Git Review Command - PR-style Diff Review
|
|
3
|
+
*
|
|
4
|
+
* This module implements the `gitx review` command which provides an interactive
|
|
5
|
+
* PR-style review experience for comparing branches or commits. Features include:
|
|
6
|
+
* - File-by-file navigation with keyboard shortcuts
|
|
7
|
+
* - Collapsible diff sections
|
|
8
|
+
* - Split (side-by-side) and unified view modes
|
|
9
|
+
* - Summary statistics (files changed, insertions, deletions)
|
|
10
|
+
* - Vim-style navigation (j/k) and arrow key support
|
|
11
|
+
*
|
|
12
|
+
* @module cli/commands/review
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Get review diff between branches
|
|
16
|
+
* const result = await getReviewDiff(repoPath, 'main', 'feature/auth')
|
|
17
|
+
* console.log(formatSummary(result.summary))
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Create interactive UI state
|
|
21
|
+
* const state = createReviewUIState(result.files)
|
|
22
|
+
* // Navigate down
|
|
23
|
+
* const newState = handleArrowNavigation(state, 'down', result.files.length)
|
|
24
|
+
*/
|
|
25
|
+
import type { CommandContext } from '../index';
|
|
26
|
+
/**
|
|
27
|
+
* Options for the review command.
|
|
28
|
+
*
|
|
29
|
+
* @description Configuration options controlling the review behavior
|
|
30
|
+
* including which branches/commits to compare and display options.
|
|
31
|
+
*
|
|
32
|
+
* @property base - Base branch or commit SHA to compare from
|
|
33
|
+
* @property head - Head branch or commit SHA to compare to
|
|
34
|
+
* @property interactive - Enable interactive terminal UI
|
|
35
|
+
* @property split - Use side-by-side split view instead of unified diff
|
|
36
|
+
*/
|
|
37
|
+
export interface ReviewOptions {
|
|
38
|
+
/** Base branch/commit to compare from */
|
|
39
|
+
base?: string;
|
|
40
|
+
/** Head branch/commit to compare to */
|
|
41
|
+
head?: string;
|
|
42
|
+
/** Enable interactive mode */
|
|
43
|
+
interactive?: boolean;
|
|
44
|
+
/** Split view for side-by-side comparison */
|
|
45
|
+
split?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Complete result of a review diff operation.
|
|
49
|
+
*
|
|
50
|
+
* @description Contains all information needed to display a PR-style review
|
|
51
|
+
* including file changes, summary statistics, and commit range info.
|
|
52
|
+
*
|
|
53
|
+
* @property files - Array of changed files with their diffs
|
|
54
|
+
* @property summary - Aggregated statistics across all files
|
|
55
|
+
* @property commitRange - Information about the compared commits/branches
|
|
56
|
+
*/
|
|
57
|
+
export interface ReviewResult {
|
|
58
|
+
/** Changed files with stats */
|
|
59
|
+
files: ReviewFile[];
|
|
60
|
+
/** Summary statistics */
|
|
61
|
+
summary: ReviewSummary;
|
|
62
|
+
/** Commit range information */
|
|
63
|
+
commitRange: CommitRange;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Information about a single changed file in the review.
|
|
67
|
+
*
|
|
68
|
+
* @description Contains the file's change status, line statistics,
|
|
69
|
+
* UI state (collapsed/expanded), and the actual diff content.
|
|
70
|
+
*
|
|
71
|
+
* @property path - File path relative to repository root
|
|
72
|
+
* @property status - Type of change (added, modified, deleted, renamed)
|
|
73
|
+
* @property additions - Number of lines added
|
|
74
|
+
* @property deletions - Number of lines deleted
|
|
75
|
+
* @property collapsed - Whether the file's diff is collapsed in the UI
|
|
76
|
+
* @property diff - Raw diff content for the file
|
|
77
|
+
*/
|
|
78
|
+
export interface ReviewFile {
|
|
79
|
+
/** File path */
|
|
80
|
+
path: string;
|
|
81
|
+
/** Change status */
|
|
82
|
+
status: 'added' | 'modified' | 'deleted' | 'renamed';
|
|
83
|
+
/** Lines added */
|
|
84
|
+
additions: number;
|
|
85
|
+
/** Lines deleted */
|
|
86
|
+
deletions: number;
|
|
87
|
+
/** Is file collapsed in UI */
|
|
88
|
+
collapsed: boolean;
|
|
89
|
+
/** Diff content */
|
|
90
|
+
diff: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Summary statistics for a review.
|
|
94
|
+
*
|
|
95
|
+
* @description Aggregated statistics across all files in the review,
|
|
96
|
+
* similar to the summary line in `git diff --stat`.
|
|
97
|
+
*
|
|
98
|
+
* @property filesChanged - Total number of files with changes
|
|
99
|
+
* @property insertions - Total lines added across all files
|
|
100
|
+
* @property deletions - Total lines deleted across all files
|
|
101
|
+
*/
|
|
102
|
+
export interface ReviewSummary {
|
|
103
|
+
/** Total files changed */
|
|
104
|
+
filesChanged: number;
|
|
105
|
+
/** Total insertions */
|
|
106
|
+
insertions: number;
|
|
107
|
+
/** Total deletions */
|
|
108
|
+
deletions: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Information about the commit range being reviewed.
|
|
112
|
+
*
|
|
113
|
+
* @description Contains the resolved commit SHAs and optional branch names
|
|
114
|
+
* for the base and head of the comparison.
|
|
115
|
+
*
|
|
116
|
+
* @property baseCommit - Full SHA of the base commit
|
|
117
|
+
* @property headCommit - Full SHA of the head commit
|
|
118
|
+
* @property baseBranch - Branch name if base was a branch (undefined if SHA)
|
|
119
|
+
* @property headBranch - Branch name if head was a branch (undefined if SHA)
|
|
120
|
+
* @property commitCount - Number of commits between base and head
|
|
121
|
+
*/
|
|
122
|
+
export interface CommitRange {
|
|
123
|
+
/** Base commit SHA */
|
|
124
|
+
baseCommit: string;
|
|
125
|
+
/** Head commit SHA */
|
|
126
|
+
headCommit: string;
|
|
127
|
+
/** Base branch name (if applicable) */
|
|
128
|
+
baseBranch?: string;
|
|
129
|
+
/** Head branch name (if applicable) */
|
|
130
|
+
headBranch?: string;
|
|
131
|
+
/** Number of commits in range */
|
|
132
|
+
commitCount: number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* State for the interactive review UI.
|
|
136
|
+
*
|
|
137
|
+
* @description Tracks the current UI state including selection, collapsed
|
|
138
|
+
* files, view mode, and scroll position. Used for keyboard navigation.
|
|
139
|
+
*
|
|
140
|
+
* @property selectedIndex - Index of the currently selected file (0-based)
|
|
141
|
+
* @property collapsedFiles - Set of file indices that are collapsed
|
|
142
|
+
* @property viewMode - Current view mode (unified or split)
|
|
143
|
+
* @property scrollPosition - Current scroll offset for the view
|
|
144
|
+
*/
|
|
145
|
+
export interface ReviewUIState {
|
|
146
|
+
/** Currently selected file index */
|
|
147
|
+
selectedIndex: number;
|
|
148
|
+
/** Collapsed file indices */
|
|
149
|
+
collapsedFiles: Set<number>;
|
|
150
|
+
/** View mode */
|
|
151
|
+
viewMode: 'unified' | 'split';
|
|
152
|
+
/** Scroll position */
|
|
153
|
+
scrollPosition: number;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Definition of a keyboard shortcut for the interactive UI.
|
|
157
|
+
*
|
|
158
|
+
* @description Maps a key to an action description and handler function.
|
|
159
|
+
* Used for help display and key event handling.
|
|
160
|
+
*
|
|
161
|
+
* @property key - Key name (e.g., 'j', 'k', 'enter', 'up', 'down')
|
|
162
|
+
* @property action - Human-readable description of the action
|
|
163
|
+
* @property handler - Function to call when key is pressed
|
|
164
|
+
*/
|
|
165
|
+
export interface KeyboardShortcut {
|
|
166
|
+
/** Key name */
|
|
167
|
+
key: string;
|
|
168
|
+
/** Action description */
|
|
169
|
+
action: string;
|
|
170
|
+
/** Handler function */
|
|
171
|
+
handler: () => void;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Execute the review command from the CLI.
|
|
175
|
+
*
|
|
176
|
+
* @description Main entry point for the `gitx review` command. Parses
|
|
177
|
+
* command-line options and displays an interactive PR-style diff review.
|
|
178
|
+
*
|
|
179
|
+
* @param _ctx - Command context (unused in current implementation)
|
|
180
|
+
* @returns Promise that resolves when review is complete
|
|
181
|
+
* @throws {Error} Always throws "Not implemented" - command not yet implemented
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* // CLI usage
|
|
185
|
+
* // gitx review main..feature/auth
|
|
186
|
+
* // gitx review --split main feature/auth
|
|
187
|
+
* // gitx review --interactive
|
|
188
|
+
*/
|
|
189
|
+
export declare function reviewCommand(_ctx: CommandContext): Promise<void>;
|
|
190
|
+
/**
|
|
191
|
+
* Get review diff between two branches.
|
|
192
|
+
*
|
|
193
|
+
* @description Computes a complete PR-style diff between two branches or commits.
|
|
194
|
+
* Returns all changed files with their diffs, summary statistics, and commit range.
|
|
195
|
+
*
|
|
196
|
+
* @param repoPath - Path to the git repository
|
|
197
|
+
* @param baseBranch - Base branch or commit SHA (the "before" state)
|
|
198
|
+
* @param headBranch - Head branch or commit SHA (the "after" state)
|
|
199
|
+
* @returns Promise resolving to complete review result
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* const result = await getReviewDiff('/path/to/repo', 'main', 'feature/auth')
|
|
203
|
+
* console.log(`${result.summary.filesChanged} files changed`)
|
|
204
|
+
* console.log(`+${result.summary.insertions} -${result.summary.deletions}`)
|
|
205
|
+
*/
|
|
206
|
+
export declare function getReviewDiff(repoPath: string, baseBranch: string, headBranch: string): Promise<ReviewResult>;
|
|
207
|
+
/**
|
|
208
|
+
* List changed files with statistics.
|
|
209
|
+
*
|
|
210
|
+
* @description Gets a list of all files that differ between two branches/commits
|
|
211
|
+
* with their change status and line statistics.
|
|
212
|
+
*
|
|
213
|
+
* @param _repoPath - Path to the git repository (unused in current impl)
|
|
214
|
+
* @param baseBranch - Base branch or commit SHA
|
|
215
|
+
* @param headBranch - Head branch or commit SHA
|
|
216
|
+
* @returns Promise resolving to array of changed files, sorted by path
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* const files = await listChangedFiles(repoPath, 'main', 'feature')
|
|
220
|
+
* for (const file of files) {
|
|
221
|
+
* console.log(`${file.status}: ${file.path} (+${file.additions}, -${file.deletions})`)
|
|
222
|
+
* }
|
|
223
|
+
*/
|
|
224
|
+
export declare function listChangedFiles(_repoPath: string, baseBranch: string, headBranch: string): Promise<ReviewFile[]>;
|
|
225
|
+
/**
|
|
226
|
+
* Get commit range information.
|
|
227
|
+
*
|
|
228
|
+
* @description Resolves branch names to commit SHAs and returns information
|
|
229
|
+
* about the commit range being compared.
|
|
230
|
+
*
|
|
231
|
+
* @param repoPath - Path to the git repository
|
|
232
|
+
* @param baseBranch - Base branch name or commit SHA
|
|
233
|
+
* @param headBranch - Head branch name or commit SHA
|
|
234
|
+
* @returns Promise resolving to commit range information
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* const range = await getCommitRange(repoPath, 'main', 'feature')
|
|
238
|
+
* console.log(`Comparing ${range.baseCommit}..${range.headCommit}`)
|
|
239
|
+
* console.log(`${range.commitCount} commits`)
|
|
240
|
+
*/
|
|
241
|
+
export declare function getCommitRange(repoPath: string, baseBranch: string, headBranch: string): Promise<CommitRange>;
|
|
242
|
+
/**
|
|
243
|
+
* Calculate review summary from changed files.
|
|
244
|
+
*
|
|
245
|
+
* @description Aggregates statistics from all changed files into a summary.
|
|
246
|
+
*
|
|
247
|
+
* @param files - Array of changed files
|
|
248
|
+
* @returns Summary with total files, insertions, and deletions
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* const summary = calculateSummary(files)
|
|
252
|
+
* console.log(`${summary.filesChanged} files, +${summary.insertions}, -${summary.deletions}`)
|
|
253
|
+
*/
|
|
254
|
+
export declare function calculateSummary(files: ReviewFile[]): ReviewSummary;
|
|
255
|
+
/**
|
|
256
|
+
* Create initial interactive review UI state.
|
|
257
|
+
*
|
|
258
|
+
* @description Initializes UI state with first file selected, all files expanded,
|
|
259
|
+
* unified view mode, and scroll position at top.
|
|
260
|
+
*
|
|
261
|
+
* @param _files - Array of files (used for validation, currently unused)
|
|
262
|
+
* @returns Initial UI state ready for interaction
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* const state = createReviewUIState(result.files)
|
|
266
|
+
* // state.selectedIndex === 0
|
|
267
|
+
* // state.viewMode === 'unified'
|
|
268
|
+
*/
|
|
269
|
+
export declare function createReviewUIState(_files: ReviewFile[]): ReviewUIState;
|
|
270
|
+
/**
|
|
271
|
+
* Handle arrow key navigation.
|
|
272
|
+
*
|
|
273
|
+
* @description Updates the selected file index based on arrow key input.
|
|
274
|
+
* Clamps the index to valid bounds (0 to fileCount-1).
|
|
275
|
+
*
|
|
276
|
+
* @param state - Current UI state
|
|
277
|
+
* @param direction - Navigation direction ('up' or 'down')
|
|
278
|
+
* @param fileCount - Total number of files (for bounds checking)
|
|
279
|
+
* @returns New UI state with updated selectedIndex
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* let state = createReviewUIState(files)
|
|
283
|
+
* state = handleArrowNavigation(state, 'down', files.length) // selectedIndex: 1
|
|
284
|
+
* state = handleArrowNavigation(state, 'up', files.length) // selectedIndex: 0
|
|
285
|
+
*/
|
|
286
|
+
export declare function handleArrowNavigation(state: ReviewUIState, direction: 'up' | 'down', fileCount: number): ReviewUIState;
|
|
287
|
+
/**
|
|
288
|
+
* Toggle file collapse/expand state.
|
|
289
|
+
*
|
|
290
|
+
* @description Toggles whether a file's diff is collapsed or expanded.
|
|
291
|
+
* Collapsed files show only the header, expanded files show the full diff.
|
|
292
|
+
*
|
|
293
|
+
* @param state - Current UI state
|
|
294
|
+
* @param fileIndex - Index of file to toggle
|
|
295
|
+
* @returns New UI state with updated collapsedFiles set
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* let state = createReviewUIState(files)
|
|
299
|
+
* state = toggleFileCollapse(state, 0) // File 0 is now collapsed
|
|
300
|
+
* state = toggleFileCollapse(state, 0) // File 0 is now expanded
|
|
301
|
+
*/
|
|
302
|
+
export declare function toggleFileCollapse(state: ReviewUIState, fileIndex: number): ReviewUIState;
|
|
303
|
+
/**
|
|
304
|
+
* Handle vim-style navigation (j/k keys).
|
|
305
|
+
*
|
|
306
|
+
* @description Provides vim-style navigation where 'j' moves down and 'k' moves up.
|
|
307
|
+
* Delegates to handleArrowNavigation for actual implementation.
|
|
308
|
+
*
|
|
309
|
+
* @param state - Current UI state
|
|
310
|
+
* @param key - Vim navigation key ('j' for down, 'k' for up)
|
|
311
|
+
* @param fileCount - Total number of files
|
|
312
|
+
* @returns New UI state with updated selectedIndex
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* let state = createReviewUIState(files)
|
|
316
|
+
* state = handleVimNavigation(state, 'j', files.length) // Move down
|
|
317
|
+
* state = handleVimNavigation(state, 'k', files.length) // Move up
|
|
318
|
+
*/
|
|
319
|
+
export declare function handleVimNavigation(state: ReviewUIState, key: 'j' | 'k', fileCount: number): ReviewUIState;
|
|
320
|
+
/**
|
|
321
|
+
* Handle quit shortcut (q key).
|
|
322
|
+
*
|
|
323
|
+
* @description Exits the interactive review mode. In the current implementation,
|
|
324
|
+
* this is a no-op placeholder for the quit functionality.
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* // When 'q' is pressed in interactive mode
|
|
328
|
+
* handleQuit()
|
|
329
|
+
*/
|
|
330
|
+
export declare function handleQuit(): void;
|
|
331
|
+
/**
|
|
332
|
+
* Get list of available keyboard shortcuts.
|
|
333
|
+
*
|
|
334
|
+
* @description Returns all keyboard shortcuts available in the interactive
|
|
335
|
+
* review mode for display in help or key handling.
|
|
336
|
+
*
|
|
337
|
+
* @returns Array of keyboard shortcut definitions
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* const shortcuts = getKeyboardShortcuts()
|
|
341
|
+
* for (const shortcut of shortcuts) {
|
|
342
|
+
* console.log(`${shortcut.key}: ${shortcut.action}`)
|
|
343
|
+
* }
|
|
344
|
+
*/
|
|
345
|
+
export declare function getKeyboardShortcuts(): KeyboardShortcut[];
|
|
346
|
+
/**
|
|
347
|
+
* Render split view (side-by-side comparison).
|
|
348
|
+
*
|
|
349
|
+
* @description Renders a file diff in split view mode with old content on
|
|
350
|
+
* the left and new content on the right, separated by a vertical bar.
|
|
351
|
+
*
|
|
352
|
+
* @param file - File with diff content to render
|
|
353
|
+
* @param terminalWidth - Terminal width in characters for column sizing
|
|
354
|
+
* @returns Array of formatted lines for display
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* const lines = renderSplitView(file, 120)
|
|
358
|
+
* for (const line of lines) {
|
|
359
|
+
* console.log(line) // "old content | new content"
|
|
360
|
+
* }
|
|
361
|
+
*/
|
|
362
|
+
export declare function renderSplitView(file: ReviewFile, terminalWidth: number): string[];
|
|
363
|
+
/**
|
|
364
|
+
* Render unified view.
|
|
365
|
+
*
|
|
366
|
+
* @description Renders a file diff in unified view mode with additions and
|
|
367
|
+
* deletions interspersed (like standard `git diff` output).
|
|
368
|
+
*
|
|
369
|
+
* @param file - File with diff content to render
|
|
370
|
+
* @returns Array of non-empty diff lines
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* const lines = renderUnifiedView(file)
|
|
374
|
+
* for (const line of lines) {
|
|
375
|
+
* console.log(line) // "+added line" or "-removed line" or " context"
|
|
376
|
+
* }
|
|
377
|
+
*/
|
|
378
|
+
export declare function renderUnifiedView(file: ReviewFile): string[];
|
|
379
|
+
/**
|
|
380
|
+
* Toggle between split and unified view modes.
|
|
381
|
+
*
|
|
382
|
+
* @description Switches the view mode between 'unified' (interleaved) and
|
|
383
|
+
* 'split' (side-by-side) diff display.
|
|
384
|
+
*
|
|
385
|
+
* @param state - Current UI state
|
|
386
|
+
* @returns New UI state with toggled viewMode
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* let state = createReviewUIState(files) // viewMode: 'unified'
|
|
390
|
+
* state = toggleViewMode(state) // viewMode: 'split'
|
|
391
|
+
* state = toggleViewMode(state) // viewMode: 'unified'
|
|
392
|
+
*/
|
|
393
|
+
export declare function toggleViewMode(state: ReviewUIState): ReviewUIState;
|
|
394
|
+
/**
|
|
395
|
+
* Format summary for display.
|
|
396
|
+
*
|
|
397
|
+
* @description Formats the review summary as a human-readable string similar
|
|
398
|
+
* to the summary line in GitHub PR diffs.
|
|
399
|
+
*
|
|
400
|
+
* @param summary - Review summary with statistics
|
|
401
|
+
* @returns Formatted string like "3 files changed, +150, -42"
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* const formatted = formatSummary({ filesChanged: 3, insertions: 150, deletions: 42 })
|
|
405
|
+
* // "3 files changed, +150, -42"
|
|
406
|
+
*/
|
|
407
|
+
export declare function formatSummary(summary: ReviewSummary): string;
|
|
408
|
+
/**
|
|
409
|
+
* Format file statistics line.
|
|
410
|
+
*
|
|
411
|
+
* @description Formats a single file's change statistics as a human-readable
|
|
412
|
+
* string showing path and line counts.
|
|
413
|
+
*
|
|
414
|
+
* @param file - File with change statistics
|
|
415
|
+
* @returns Formatted string like "src/index.ts | +25 -10"
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* const formatted = formatFileStats(file)
|
|
419
|
+
* // "src/index.ts | +25 -10"
|
|
420
|
+
*/
|
|
421
|
+
export declare function formatFileStats(file: ReviewFile): string;
|
|
422
|
+
/**
|
|
423
|
+
* Handle no changes between branches.
|
|
424
|
+
*
|
|
425
|
+
* @description Returns a message indicating there are no differences between
|
|
426
|
+
* the specified branches.
|
|
427
|
+
*
|
|
428
|
+
* @param baseBranch - Base branch name
|
|
429
|
+
* @param headBranch - Head branch name
|
|
430
|
+
* @returns Message string indicating no changes
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* const message = handleNoChanges('main', 'feature')
|
|
434
|
+
* // "No changes between main and feature"
|
|
435
|
+
*/
|
|
436
|
+
export declare function handleNoChanges(baseBranch: string, headBranch: string): string;
|
|
437
|
+
/**
|
|
438
|
+
* Check if branches have changes between them.
|
|
439
|
+
*
|
|
440
|
+
* @description Determines whether there are any differences between two
|
|
441
|
+
* branches by comparing their resolved commit SHAs.
|
|
442
|
+
*
|
|
443
|
+
* @param repoPath - Path to the git repository
|
|
444
|
+
* @param baseBranch - Base branch or commit SHA
|
|
445
|
+
* @param headBranch - Head branch or commit SHA
|
|
446
|
+
* @returns Promise resolving to true if branches differ, false if identical
|
|
447
|
+
*
|
|
448
|
+
* @example
|
|
449
|
+
* if (await hasChanges(repoPath, 'main', 'feature')) {
|
|
450
|
+
* const result = await getReviewDiff(repoPath, 'main', 'feature')
|
|
451
|
+
* // Display diff...
|
|
452
|
+
* } else {
|
|
453
|
+
* console.log('Branches are identical')
|
|
454
|
+
* }
|
|
455
|
+
*/
|
|
456
|
+
export declare function hasChanges(repoPath: string, baseBranch: string, headBranch: string): Promise<boolean>;
|
|
457
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MA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