codecane 1.0.203 → 1.0.205
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/checkpoints/checkpoint-manager.d.ts +1 -1
- package/dist/checkpoints/checkpoint-manager.js +6 -6
- package/dist/checkpoints/checkpoint-manager.js.map +1 -1
- package/dist/checkpoints/file-manager.d.ts +41 -10
- package/dist/checkpoints/file-manager.js +127 -58
- package/dist/checkpoints/file-manager.js.map +1 -1
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +65 -29
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +94 -5
- package/dist/client.js +29 -45
- package/dist/client.js.map +1 -1
- package/dist/code-map/languages.d.ts +1 -0
- package/dist/code-map/languages.js +224 -23
- package/dist/code-map/languages.js.map +1 -1
- package/dist/code-map/parse.js +0 -1
- package/dist/code-map/parse.js.map +1 -1
- package/dist/code-map/tsconfig.tsbuildinfo +1 -1
- package/dist/common/actions.d.ts +68 -88
- package/dist/common/actions.js +0 -1
- package/dist/common/actions.js.map +1 -1
- package/dist/common/browser-actions.d.ts +44 -44
- package/dist/common/types/agent-state.d.ts +28 -28
- package/dist/common/types/message.d.ts +8 -8
- package/dist/common/util/saxy.js +1 -1
- package/dist/common/util/saxy.js.map +1 -1
- package/dist/common/util/string.d.ts +4 -0
- package/dist/common/util/string.js +8 -1
- package/dist/common/util/string.js.map +1 -1
- package/dist/common/websockets/websocket-schema.d.ts +132 -164
- package/dist/menu.js +1 -1
- package/dist/menu.js.map +1 -1
- package/dist/project-files.js +2 -0
- package/dist/project-files.js.map +1 -1
- package/dist/utils/logger.d.ts +2 -0
- package/dist/utils/logger.js +33 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/terminal.js +1 -1
- package/dist/utils/terminal.js.map +1 -1
- package/package.json +31 -13
- package/dist/common/advanced-analyzer.d.ts +0 -19
- package/dist/common/advanced-analyzer.js +0 -140
- package/dist/common/advanced-analyzer.js.map +0 -1
- package/dist/common/message-image-handling.d.ts +0 -41
- package/dist/common/message-image-handling.js +0 -57
- package/dist/common/message-image-handling.js.map +0 -1
- package/dist/common/util/process-stream.d.ts +0 -8
- package/dist/common/util/process-stream.js +0 -102
- package/dist/common/util/process-stream.js.map +0 -1
|
@@ -15,7 +15,7 @@ const project_files_1 = require("../project-files");
|
|
|
15
15
|
class CheckpointManager {
|
|
16
16
|
checkpoints = [];
|
|
17
17
|
bareRepoPath = null;
|
|
18
|
-
|
|
18
|
+
disabledReason = null;
|
|
19
19
|
/** Worker thread for git operations */
|
|
20
20
|
worker = null;
|
|
21
21
|
/**
|
|
@@ -78,7 +78,7 @@ class CheckpointManager {
|
|
|
78
78
|
* @returns The created checkpoint, or null if checkpointing is disabled
|
|
79
79
|
*/
|
|
80
80
|
async addCheckpoint(agentState, userInput) {
|
|
81
|
-
if (
|
|
81
|
+
if (this.disabledReason !== null) {
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
const id = this.checkpoints.length + 1;
|
|
@@ -86,7 +86,7 @@ class CheckpointManager {
|
|
|
86
86
|
const bareRepoPath = this.getBareRepoPath();
|
|
87
87
|
const relativeFilepaths = (0, project_file_tree_1.getAllFilePaths)(agentState.fileContext.fileTree);
|
|
88
88
|
if (relativeFilepaths.length >= project_file_tree_1.DEFAULT_MAX_FILES) {
|
|
89
|
-
this.
|
|
89
|
+
this.disabledReason = 'Project too large';
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
92
|
const needToStage = await (0, file_manager_1.hasUnsavedChanges)({
|
|
@@ -122,7 +122,7 @@ class CheckpointManager {
|
|
|
122
122
|
* @returns The most recent checkpoint or null if none exist
|
|
123
123
|
*/
|
|
124
124
|
getLatestCheckpoint() {
|
|
125
|
-
if (
|
|
125
|
+
if (this.disabledReason !== null) {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
return this.checkpoints.length === 0
|
|
@@ -162,8 +162,8 @@ class CheckpointManager {
|
|
|
162
162
|
* @returns A formatted string representation of all checkpoints
|
|
163
163
|
*/
|
|
164
164
|
getCheckpointsAsString(detailed = false) {
|
|
165
|
-
if (
|
|
166
|
-
return (0, picocolors_1.red)(
|
|
165
|
+
if (this.disabledReason !== null) {
|
|
166
|
+
return (0, picocolors_1.red)(`Checkpoints not enabled: ${this.disabledReason}`);
|
|
167
167
|
}
|
|
168
168
|
if (this.checkpoints.length === 0) {
|
|
169
169
|
return (0, picocolors_1.yellow)('No checkpoints available.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint-manager.js","sourceRoot":"","sources":["../../src/checkpoints/checkpoint-manager.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,2CAA2E;AAC3E,mDAAuC;AAEvC,gEAA6E;AAE7E,iDAIuB;AACvB,oDAAiD;AA6CjD;;;;GAIG;AACH,MAAa,iBAAiB;IAC5B,WAAW,GAAsB,EAAE,CAAA;IAC3B,YAAY,GAAkB,IAAI,CAAA;IAC1C,
|
|
1
|
+
{"version":3,"file":"checkpoint-manager.js","sourceRoot":"","sources":["../../src/checkpoints/checkpoint-manager.ts"],"names":[],"mappings":";;;AAAA,+BAA2B;AAC3B,2CAA2E;AAC3E,mDAAuC;AAEvC,gEAA6E;AAE7E,iDAIuB;AACvB,oDAAiD;AA6CjD;;;;GAIG;AACH,MAAa,iBAAiB;IAC5B,WAAW,GAAsB,EAAE,CAAA;IAC3B,YAAY,GAAkB,IAAI,CAAA;IAC1C,cAAc,GAAkB,IAAI,CAAA;IACpC,uCAAuC;IAC/B,MAAM,GAAkB,IAAI,CAAA;IAEpC;;;OAGG;IACK,UAAU;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,qEAAqE;YACrE,6DAA6D;YAC7D,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAC3C,CAAC,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,YAAY,EAAE,8BAA8B,CAAC;gBAC/D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AC,KAAK,IAAA,iBAAI,EAAC,UAAU,CAAC,KAAK,YAAY,EAAE,CAAC,CAAA;YACtD,CAAC;YAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA,CAAC,iCAAiC;QAClD,CAAC,CAAC,CAAA;QAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;CACF;AAlND,8CAkNC;AAED,iEAAiE;AACpD,QAAA,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,22 +1,52 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
+
/**
|
|
3
|
+
* Generates a unique path for storing the bare git repository based on the project directory.
|
|
4
|
+
* Uses SHA-256 hashing to create a unique identifier.
|
|
5
|
+
* @param dir - The project directory path to hash
|
|
6
|
+
* @returns The full path where the bare repo should be stored
|
|
7
|
+
*/
|
|
2
8
|
export declare function getBareRepoPath(dir: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if there are any uncommitted changes in the working directory.
|
|
11
|
+
* First attempts to use native git commands, falling back to isomorphic-git if unavailable.
|
|
12
|
+
* @param projectDir - The working tree directory path
|
|
13
|
+
* @param bareRepoPath - The bare git repository path
|
|
14
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to check
|
|
15
|
+
* @returns Promise resolving to true if there are uncommitted changes, false otherwise
|
|
16
|
+
*/
|
|
3
17
|
export declare function hasUnsavedChanges({ projectDir, bareRepoPath, relativeFilepaths, }: {
|
|
4
18
|
projectDir: string;
|
|
5
19
|
bareRepoPath: string;
|
|
6
20
|
relativeFilepaths: Array<string>;
|
|
7
21
|
}): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the hash of the latest commit in the repository.
|
|
24
|
+
* First attempts to use native git commands, falling back to isomorphic-git if unavailable.
|
|
25
|
+
* @param bareRepoPath - The bare git repository path
|
|
26
|
+
* @returns Promise resolving to the commit hash
|
|
27
|
+
*/
|
|
8
28
|
export declare function getLatestCommit({ bareRepoPath, }: {
|
|
9
29
|
bareRepoPath: string;
|
|
10
30
|
}): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Initializes a bare git repository for tracking file changes.
|
|
33
|
+
* Creates the repository if it doesn't exist, otherwise uses the existing one.
|
|
34
|
+
* Makes an initial commit of the current file state.
|
|
35
|
+
* @param projectDir - The working tree directory path
|
|
36
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to track
|
|
37
|
+
*/
|
|
11
38
|
export declare function initializeCheckpointFileManager({ projectDir, relativeFilepaths, }: {
|
|
12
39
|
projectDir: string;
|
|
13
40
|
relativeFilepaths: Array<string>;
|
|
14
41
|
}): Promise<void>;
|
|
15
42
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @param
|
|
19
|
-
* @
|
|
43
|
+
* Creates a new commit with the current state of all tracked files.
|
|
44
|
+
* Stages all changes and creates a commit with the specified message.
|
|
45
|
+
* @param projectDir - The working tree directory path
|
|
46
|
+
* @param bareRepoPath - The bare git repository path
|
|
47
|
+
* @param message - The commit message
|
|
48
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to commit
|
|
49
|
+
* @returns Promise resolving to the new commit's hash
|
|
20
50
|
*/
|
|
21
51
|
export declare function storeFileState({ projectDir, bareRepoPath, message, relativeFilepaths: relativeFilepaths, }: {
|
|
22
52
|
projectDir: string;
|
|
@@ -25,12 +55,13 @@ export declare function storeFileState({ projectDir, bareRepoPath, message, rela
|
|
|
25
55
|
relativeFilepaths: Array<string>;
|
|
26
56
|
}): Promise<string>;
|
|
27
57
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param commit - The commit hash to
|
|
58
|
+
* Restores the working directory and index to match the specified commit.
|
|
59
|
+
* Equivalent to `git reset --hard`
|
|
60
|
+
* First attempts to use native git commands, falling back to isomorphic-git if unavailable.
|
|
61
|
+
* @param projectDir - The working tree directory path
|
|
62
|
+
* @param bareRepoPath - The bare git repository path
|
|
63
|
+
* @param commit - The commit hash to restore to
|
|
64
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to restore
|
|
34
65
|
*/
|
|
35
66
|
export declare function restoreFileState({ projectDir, bareRepoPath, commit, relativeFilepaths, }: {
|
|
36
67
|
projectDir: string;
|
|
@@ -17,11 +17,16 @@ const isomorphic_git_1 = require("isomorphic-git");
|
|
|
17
17
|
const path_1 = require("path");
|
|
18
18
|
const child_process_1 = require("child_process");
|
|
19
19
|
const project_files_1 = require("../project-files");
|
|
20
|
+
/**
|
|
21
|
+
* Checks if the native git command is available on the system.
|
|
22
|
+
* Caches the result to avoid repeated checks.
|
|
23
|
+
* @returns boolean indicating if git command is available
|
|
24
|
+
*/
|
|
20
25
|
let cachedGitAvailable = null;
|
|
21
26
|
function gitCommandIsAvailable() {
|
|
22
27
|
if (cachedGitAvailable === null) {
|
|
23
28
|
try {
|
|
24
|
-
(0, child_process_1.execFileSync)('git', ['--version']);
|
|
29
|
+
(0, child_process_1.execFileSync)('git', ['--version'], { stdio: 'ignore' });
|
|
25
30
|
cachedGitAvailable = true;
|
|
26
31
|
}
|
|
27
32
|
catch (error) {
|
|
@@ -30,10 +35,24 @@ function gitCommandIsAvailable() {
|
|
|
30
35
|
}
|
|
31
36
|
return cachedGitAvailable;
|
|
32
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Generates a unique path for storing the bare git repository based on the project directory.
|
|
40
|
+
* Uses SHA-256 hashing to create a unique identifier.
|
|
41
|
+
* @param dir - The project directory path to hash
|
|
42
|
+
* @returns The full path where the bare repo should be stored
|
|
43
|
+
*/
|
|
33
44
|
function getBareRepoPath(dir) {
|
|
34
45
|
const bareRepoName = (0, crypto_1.createHash)('sha256').update(dir).digest('hex');
|
|
35
46
|
return (0, path_1.join)((0, project_files_1.getProjectDataDir)(), bareRepoName);
|
|
36
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Checks if there are any uncommitted changes in the working directory.
|
|
50
|
+
* First attempts to use native git commands, falling back to isomorphic-git if unavailable.
|
|
51
|
+
* @param projectDir - The working tree directory path
|
|
52
|
+
* @param bareRepoPath - The bare git repository path
|
|
53
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to check
|
|
54
|
+
* @returns Promise resolving to true if there are uncommitted changes, false otherwise
|
|
55
|
+
*/
|
|
37
56
|
async function hasUnsavedChanges({ projectDir, bareRepoPath, relativeFilepaths, }) {
|
|
38
57
|
if (gitCommandIsAvailable()) {
|
|
39
58
|
try {
|
|
@@ -63,15 +82,16 @@ async function hasUnsavedChanges({ projectDir, bareRepoPath, relativeFilepaths,
|
|
|
63
82
|
}
|
|
64
83
|
return false;
|
|
65
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Gets the hash of the latest commit in the repository.
|
|
87
|
+
* First attempts to use native git commands, falling back to isomorphic-git if unavailable.
|
|
88
|
+
* @param bareRepoPath - The bare git repository path
|
|
89
|
+
* @returns Promise resolving to the commit hash
|
|
90
|
+
*/
|
|
66
91
|
async function getLatestCommit({ bareRepoPath, }) {
|
|
67
92
|
if (gitCommandIsAvailable()) {
|
|
68
93
|
try {
|
|
69
|
-
return (0, child_process_1.execFileSync)('git', [
|
|
70
|
-
'--git-dir',
|
|
71
|
-
bareRepoPath,
|
|
72
|
-
'rev-parse',
|
|
73
|
-
'HEAD',
|
|
74
|
-
])
|
|
94
|
+
return (0, child_process_1.execFileSync)('git', ['--git-dir', bareRepoPath, 'rev-parse', 'HEAD'], { stdio: ['ignore', 'pipe', 'ignore'] })
|
|
75
95
|
.toString()
|
|
76
96
|
.trim();
|
|
77
97
|
}
|
|
@@ -81,21 +101,34 @@ async function getLatestCommit({ bareRepoPath, }) {
|
|
|
81
101
|
}
|
|
82
102
|
return await (0, isomorphic_git_1.resolveRef)({
|
|
83
103
|
fs: fs_1.default,
|
|
84
|
-
|
|
104
|
+
gitdir: bareRepoPath,
|
|
85
105
|
ref: 'HEAD',
|
|
86
106
|
});
|
|
87
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Initializes a bare git repository for tracking file changes.
|
|
110
|
+
* Creates the repository if it doesn't exist, otherwise uses the existing one.
|
|
111
|
+
* Makes an initial commit of the current file state.
|
|
112
|
+
* @param projectDir - The working tree directory path
|
|
113
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to track
|
|
114
|
+
*/
|
|
88
115
|
async function initializeCheckpointFileManager({ projectDir, relativeFilepaths, }) {
|
|
89
116
|
const bareRepoPath = getBareRepoPath(projectDir);
|
|
90
117
|
// Create the bare repo directory if it doesn't exist
|
|
91
118
|
fs_1.default.mkdirSync(bareRepoPath, { recursive: true });
|
|
92
119
|
try {
|
|
93
120
|
// Check if it's already a valid Git repo
|
|
94
|
-
await (0, isomorphic_git_1.resolveRef)({ fs: fs_1.default,
|
|
121
|
+
await (0, isomorphic_git_1.resolveRef)({ fs: fs_1.default, gitdir: bareRepoPath, ref: 'HEAD' });
|
|
95
122
|
}
|
|
96
123
|
catch (error) {
|
|
97
124
|
// Bare repo doesn't exist yet
|
|
98
|
-
await (0, isomorphic_git_1.init)({
|
|
125
|
+
await (0, isomorphic_git_1.init)({
|
|
126
|
+
fs: fs_1.default,
|
|
127
|
+
dir: projectDir,
|
|
128
|
+
gitdir: bareRepoPath,
|
|
129
|
+
bare: true,
|
|
130
|
+
defaultBranch: 'master',
|
|
131
|
+
});
|
|
99
132
|
}
|
|
100
133
|
// Commit the files in the bare repo
|
|
101
134
|
await storeFileState({
|
|
@@ -105,7 +138,14 @@ async function initializeCheckpointFileManager({ projectDir, relativeFilepaths,
|
|
|
105
138
|
relativeFilepaths,
|
|
106
139
|
});
|
|
107
140
|
}
|
|
108
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Stages all changes in the working directory.
|
|
143
|
+
* First attempts to use native git commands, falling back to isomorphic-git if unavailable.
|
|
144
|
+
* @param projectDir - The working tree directory path
|
|
145
|
+
* @param bareRepoPath - The bare git repository path
|
|
146
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to stage
|
|
147
|
+
*/
|
|
148
|
+
async function gitAddAll({ projectDir, bareRepoPath, relativeFilepaths, }) {
|
|
109
149
|
if (gitCommandIsAvailable()) {
|
|
110
150
|
try {
|
|
111
151
|
(0, child_process_1.execFileSync)('git', [
|
|
@@ -117,11 +157,11 @@ async function stageFiles({ projectDir, bareRepoPath, relativeFilepaths, }) {
|
|
|
117
157
|
projectDir,
|
|
118
158
|
'add',
|
|
119
159
|
'.',
|
|
120
|
-
]);
|
|
160
|
+
], { stdio: 'ignore' });
|
|
121
161
|
return;
|
|
122
162
|
}
|
|
123
163
|
catch (error) {
|
|
124
|
-
// Failed to add
|
|
164
|
+
// Failed to `git add .`
|
|
125
165
|
}
|
|
126
166
|
}
|
|
127
167
|
// Stage files with isomorphic-git
|
|
@@ -156,41 +196,72 @@ async function stageFiles({ projectDir, bareRepoPath, relativeFilepaths, }) {
|
|
|
156
196
|
}
|
|
157
197
|
}
|
|
158
198
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
199
|
+
async function gitCommit({ projectDir, bareRepoPath, message, }) {
|
|
200
|
+
if (gitCommandIsAvailable()) {
|
|
201
|
+
try {
|
|
202
|
+
(0, child_process_1.execFileSync)('git', [
|
|
203
|
+
'--git-dir',
|
|
204
|
+
bareRepoPath,
|
|
205
|
+
'--work-tree',
|
|
206
|
+
projectDir,
|
|
207
|
+
'commit',
|
|
208
|
+
'-m',
|
|
209
|
+
message,
|
|
210
|
+
], { stdio: 'ignore' });
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
// Failed to commit, continue to isomorphic-git implementation
|
|
214
|
+
}
|
|
215
|
+
}
|
|
171
216
|
const commitHash = await (0, isomorphic_git_1.commit)({
|
|
172
217
|
fs: fs_1.default,
|
|
173
218
|
dir: projectDir,
|
|
174
219
|
gitdir: bareRepoPath,
|
|
175
220
|
author: { name: 'codebuff' },
|
|
176
|
-
ref: 'refs/heads/master',
|
|
177
221
|
message,
|
|
222
|
+
ref: '/refs/heads/master',
|
|
178
223
|
});
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
224
|
+
if (gitCommandIsAvailable()) {
|
|
225
|
+
try {
|
|
226
|
+
(0, child_process_1.execFileSync)('git', [
|
|
227
|
+
'--git-dir',
|
|
228
|
+
bareRepoPath,
|
|
229
|
+
'--work-tree',
|
|
230
|
+
projectDir,
|
|
231
|
+
'checkout',
|
|
232
|
+
'master',
|
|
233
|
+
], { stdio: 'ignore' });
|
|
234
|
+
}
|
|
235
|
+
catch (error) { }
|
|
236
|
+
}
|
|
237
|
+
await (0, isomorphic_git_1.checkout)({ fs: fs_1.default, dir: projectDir, gitdir: bareRepoPath, ref: 'master' });
|
|
185
238
|
return commitHash;
|
|
186
239
|
}
|
|
187
240
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* @param
|
|
192
|
-
* @param
|
|
193
|
-
* @param
|
|
241
|
+
* Creates a new commit with the current state of all tracked files.
|
|
242
|
+
* Stages all changes and creates a commit with the specified message.
|
|
243
|
+
* @param projectDir - The working tree directory path
|
|
244
|
+
* @param bareRepoPath - The bare git repository path
|
|
245
|
+
* @param message - The commit message
|
|
246
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to commit
|
|
247
|
+
* @returns Promise resolving to the new commit's hash
|
|
248
|
+
*/
|
|
249
|
+
async function storeFileState({ projectDir, bareRepoPath, message, relativeFilepaths: relativeFilepaths, }) {
|
|
250
|
+
await gitAddAll({
|
|
251
|
+
projectDir,
|
|
252
|
+
bareRepoPath,
|
|
253
|
+
relativeFilepaths,
|
|
254
|
+
});
|
|
255
|
+
return await gitCommit({ projectDir, bareRepoPath, message });
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Restores the working directory and index to match the specified commit.
|
|
259
|
+
* Equivalent to `git reset --hard`
|
|
260
|
+
* First attempts to use native git commands, falling back to isomorphic-git if unavailable.
|
|
261
|
+
* @param projectDir - The working tree directory path
|
|
262
|
+
* @param bareRepoPath - The bare git repository path
|
|
263
|
+
* @param commit - The commit hash to restore to
|
|
264
|
+
* @param relativeFilepaths - Array of file paths relative to projectDir to restore
|
|
194
265
|
*/
|
|
195
266
|
async function restoreFileState({ projectDir, bareRepoPath, commit, relativeFilepaths, }) {
|
|
196
267
|
let resetDone = false;
|
|
@@ -205,30 +276,28 @@ async function restoreFileState({ projectDir, bareRepoPath, commit, relativeFile
|
|
|
205
276
|
'--hard',
|
|
206
277
|
commit,
|
|
207
278
|
]);
|
|
208
|
-
|
|
279
|
+
return;
|
|
209
280
|
}
|
|
210
281
|
catch (error) {
|
|
211
282
|
// Failed to use git, continue to isomorphic-git implementation
|
|
212
283
|
}
|
|
213
284
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
})));
|
|
232
|
-
}
|
|
285
|
+
// Update the working directory to reflect the specified commit
|
|
286
|
+
await (0, isomorphic_git_1.checkout)({
|
|
287
|
+
fs: fs_1.default,
|
|
288
|
+
dir: projectDir,
|
|
289
|
+
gitdir: bareRepoPath,
|
|
290
|
+
ref: commit,
|
|
291
|
+
filepaths: relativeFilepaths,
|
|
292
|
+
force: true,
|
|
293
|
+
});
|
|
294
|
+
// Reset the index to match the specified commit
|
|
295
|
+
await Promise.all(relativeFilepaths.map((filepath) => (0, isomorphic_git_1.resetIndex)({
|
|
296
|
+
fs: fs_1.default,
|
|
297
|
+
dir: projectDir,
|
|
298
|
+
gitdir: bareRepoPath,
|
|
299
|
+
filepath,
|
|
300
|
+
ref: commit,
|
|
301
|
+
})));
|
|
233
302
|
}
|
|
234
303
|
//# sourceMappingURL=file-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-manager.js","sourceRoot":"","sources":["../../src/checkpoints/file-manager.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"file-manager.js","sourceRoot":"","sources":["../../src/checkpoints/file-manager.ts"],"names":[],"mappings":";;;;;;AA0CA,0CAGC;AAUD,8CAoCC;AAQD,0CAuBC;AASD,0EAiCC;AA8ID,wCAkBC;AAWD,4CAmDC;AAlYD,mCAAmC;AACnC,4CAAmB;AAoYV,aApYF,YAAE,CAoYE;AAnYX,mDASuB;AACvB,+BAA2B;AAC3B,iDAA4C;AAE5C,oDAAoD;AAEpD;;;;GAIG;AACH,IAAI,kBAAkB,GAAmB,IAAI,CAAA;AAC7C,SAAS,qBAAqB;IAC5B,IAAI,kBAAkB,KAAK,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,IAAA,4BAAY,EAAC,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;YACvD,kBAAkB,GAAG,IAAI,CAAA;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,kBAAkB,GAAG,KAAK,CAAA;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,kBAAkB,CAAA;AAC3B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,YAAY,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACnE,OAAO,IAAA,WAAI,EAAC,IAAA,iCAAiB,GAAE,EAAE,YAAY,CAAC,CAAA;AAChD,CAAC;AAED;;;;;;;GAOG;AACI,KAAK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,IAAI,SAAS,GAAG,KAAK,CAAA;IACrB,IAAI,qBAAqB,EAAE,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,IAAA,4BAAY,EAAC,KAAK,EAAE;gBAClB,WAAW;gBACX,YAAY;gBACZ,aAAa;gBACb,UAAU;gBACV,OAAO;gBACP,QAAQ;gBACR,MAAM;aACP,CAAC,CAAA;YACF,OAAM;QACR,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,+DAA+D;QACjE,CAAC;IACH,CAAC;IAED,+DAA+D;IAC/D,MAAM,IAAA,yBAAQ,EAAC;QACb,EAAE,EAAF,YAAE;QACF,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,YAAY;QACpB,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,iBAAiB;QAC5B,KAAK,EAAE,IAAI;KACZ,CAAC,CAAA;IAEF,gDAAgD;IAChD,MAAM,OAAO,CAAC,GAAG,CACf,iBAAiB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjC,IAAA,2BAAU,EAAC;QACT,EAAE,EAAF,YAAE;QACF,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,YAAY;QACpB,QAAQ;QACR,GAAG,EAAE,MAAM;KACZ,CAAC,CACH,CACF,CAAA;AACH,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -18,11 +18,15 @@ export declare class CLI {
|
|
|
18
18
|
private initReadlineInterface;
|
|
19
19
|
private completer;
|
|
20
20
|
private setPrompt;
|
|
21
|
+
/**
|
|
22
|
+
* Prompts the user with a clean prompt state
|
|
23
|
+
*/
|
|
24
|
+
private freshPrompt;
|
|
21
25
|
printInitialPrompt(initialInput?: string): Promise<void>;
|
|
22
26
|
printDiff(): Promise<void>;
|
|
23
27
|
private handleLine;
|
|
24
28
|
private handleUserInput;
|
|
25
|
-
private
|
|
29
|
+
private saveCheckpoint;
|
|
26
30
|
private processCommand;
|
|
27
31
|
private forwardUserInput;
|
|
28
32
|
private returnControlToUser;
|