claude-devloop 1.0.0
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 +340 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +90 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/config.d.ts +9 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +80 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/continue.d.ts +11 -0
- package/dist/commands/continue.d.ts.map +1 -0
- package/dist/commands/continue.js +167 -0
- package/dist/commands/continue.js.map +1 -0
- package/dist/commands/feature.d.ts +7 -0
- package/dist/commands/feature.d.ts.map +1 -0
- package/dist/commands/feature.js +123 -0
- package/dist/commands/feature.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +401 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/run.d.ts +12 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +82 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/shared.d.ts +22 -0
- package/dist/commands/shared.d.ts.map +1 -0
- package/dist/commands/shared.js +32 -0
- package/dist/commands/shared.js.map +1 -0
- package/dist/commands/status.d.ts +8 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +305 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/workspace.d.ts +2 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +19 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/constants.d.ts +21 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +21 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/claude.d.ts +20 -0
- package/dist/core/claude.d.ts.map +1 -0
- package/dist/core/claude.js +401 -0
- package/dist/core/claude.js.map +1 -0
- package/dist/core/commit-format.d.ts +22 -0
- package/dist/core/commit-format.d.ts.map +1 -0
- package/dist/core/commit-format.js +148 -0
- package/dist/core/commit-format.js.map +1 -0
- package/dist/core/config.d.ts +30 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +130 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/feature-session.d.ts +8 -0
- package/dist/core/feature-session.d.ts.map +1 -0
- package/dist/core/feature-session.js +58 -0
- package/dist/core/feature-session.js.map +1 -0
- package/dist/core/git.d.ts +81 -0
- package/dist/core/git.d.ts.map +1 -0
- package/dist/core/git.js +475 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/loop.d.ts +3 -0
- package/dist/core/loop.d.ts.map +1 -0
- package/dist/core/loop.js +469 -0
- package/dist/core/loop.js.map +1 -0
- package/dist/core/session.d.ts +7 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +57 -0
- package/dist/core/session.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/progress.d.ts +7 -0
- package/dist/parser/progress.d.ts.map +1 -0
- package/dist/parser/progress.js +132 -0
- package/dist/parser/progress.js.map +1 -0
- package/dist/parser/requirements.d.ts +6 -0
- package/dist/parser/requirements.d.ts.map +1 -0
- package/dist/parser/requirements.js +126 -0
- package/dist/parser/requirements.js.map +1 -0
- package/dist/types/feature.d.ts +15 -0
- package/dist/types/feature.d.ts.map +1 -0
- package/dist/types/feature.js +2 -0
- package/dist/types/feature.js.map +1 -0
- package/dist/types/index.d.ts +78 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +40 -0
package/dist/core/git.js
ADDED
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as fs from 'fs/promises';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { readWorkspaceConfig, writeWorkspaceConfig } from './config.js';
|
|
6
|
+
/**
|
|
7
|
+
* Format a DevLoop internal commit message using the configured format
|
|
8
|
+
* @param action - What DevLoop is doing (e.g., "Initialize workspace", "Start run")
|
|
9
|
+
*/
|
|
10
|
+
export function formatDevloopCommit(format, action) {
|
|
11
|
+
if (format) {
|
|
12
|
+
return format.replace(/\{action\}/g, action).trim();
|
|
13
|
+
}
|
|
14
|
+
return `DevLoop: ${action}`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get the DevLoop commit message for an action, using workspace config if available
|
|
18
|
+
*/
|
|
19
|
+
export async function getDevloopCommitMessage(workspace, action) {
|
|
20
|
+
const config = await readWorkspaceConfig(workspace);
|
|
21
|
+
return formatDevloopCommit(config.devloopCommitFormat, action);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Save a DevLoop commit format to workspace config, extracting {action} placeholder if possible
|
|
25
|
+
*/
|
|
26
|
+
export async function saveDevloopCommitFormat(workspace, userMessage, defaultAction) {
|
|
27
|
+
// Try to detect if the user's message contains the default action text
|
|
28
|
+
// If so, replace it with {action} placeholder for reuse
|
|
29
|
+
let format;
|
|
30
|
+
if (userMessage.includes(defaultAction)) {
|
|
31
|
+
format = userMessage.replace(defaultAction, '{action}');
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// User provided a completely custom message, save as-is with {action} appended
|
|
35
|
+
// unless it already looks like it has a placeholder pattern
|
|
36
|
+
if (userMessage.includes('{action}')) {
|
|
37
|
+
format = userMessage;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Can't infer a pattern, just save the literal message
|
|
41
|
+
// Future commits will use default format
|
|
42
|
+
format = userMessage;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const config = await readWorkspaceConfig(workspace);
|
|
46
|
+
config.devloopCommitFormat = format;
|
|
47
|
+
await writeWorkspaceConfig(workspace, config);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Execute a git command and return the result
|
|
51
|
+
*/
|
|
52
|
+
async function execGit(args, cwd) {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
const child = spawn('git', args, { cwd });
|
|
55
|
+
let stdout = '';
|
|
56
|
+
let stderr = '';
|
|
57
|
+
child.stdout.on('data', (data) => {
|
|
58
|
+
stdout += data.toString();
|
|
59
|
+
});
|
|
60
|
+
child.stderr.on('data', (data) => {
|
|
61
|
+
stderr += data.toString();
|
|
62
|
+
});
|
|
63
|
+
child.on('close', (code) => {
|
|
64
|
+
resolve({
|
|
65
|
+
success: code === 0,
|
|
66
|
+
output: stdout.trim(),
|
|
67
|
+
error: stderr.trim() || undefined
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
child.on('error', (err) => {
|
|
71
|
+
resolve({
|
|
72
|
+
success: false,
|
|
73
|
+
output: '',
|
|
74
|
+
error: err.message
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Check if git is available on the system
|
|
81
|
+
*/
|
|
82
|
+
export async function isGitAvailable() {
|
|
83
|
+
const result = await execGit(['--version'], process.cwd());
|
|
84
|
+
return result.success;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Check if the workspace is inside a git repository
|
|
88
|
+
* Uses git rev-parse to properly detect repos (handles nested dirs, submodules, etc.)
|
|
89
|
+
*/
|
|
90
|
+
export async function isGitRepo(workspace) {
|
|
91
|
+
const result = await execGit(['rev-parse', '--is-inside-work-tree'], workspace);
|
|
92
|
+
return result.success && result.output.trim() === 'true';
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get the root directory of the git repository containing the workspace
|
|
96
|
+
*/
|
|
97
|
+
export async function getGitRoot(workspace) {
|
|
98
|
+
const result = await execGit(['rev-parse', '--show-toplevel'], workspace);
|
|
99
|
+
if (result.success && result.output.trim()) {
|
|
100
|
+
return result.output.trim();
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Initialize a new git repository in the workspace
|
|
106
|
+
*/
|
|
107
|
+
export async function initGitRepo(workspace) {
|
|
108
|
+
const result = await execGit(['init'], workspace);
|
|
109
|
+
return result.success;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Default .gitignore patterns for common development files
|
|
113
|
+
*/
|
|
114
|
+
const DEFAULT_GITIGNORE_PATTERNS = `# Dependencies
|
|
115
|
+
node_modules/
|
|
116
|
+
vendor/
|
|
117
|
+
.pnp/
|
|
118
|
+
.pnp.js
|
|
119
|
+
|
|
120
|
+
# Build outputs
|
|
121
|
+
dist/
|
|
122
|
+
build/
|
|
123
|
+
out/
|
|
124
|
+
*.tsbuildinfo
|
|
125
|
+
|
|
126
|
+
# Environment files
|
|
127
|
+
.env
|
|
128
|
+
.env.local
|
|
129
|
+
.env.*.local
|
|
130
|
+
|
|
131
|
+
# IDE and editor files
|
|
132
|
+
.idea/
|
|
133
|
+
.vscode/
|
|
134
|
+
*.swp
|
|
135
|
+
*.swo
|
|
136
|
+
*~
|
|
137
|
+
|
|
138
|
+
# OS files
|
|
139
|
+
.DS_Store
|
|
140
|
+
Thumbs.db
|
|
141
|
+
|
|
142
|
+
# Logs
|
|
143
|
+
*.log
|
|
144
|
+
npm-debug.log*
|
|
145
|
+
yarn-debug.log*
|
|
146
|
+
yarn-error.log*
|
|
147
|
+
|
|
148
|
+
# Test coverage
|
|
149
|
+
coverage/
|
|
150
|
+
.nyc_output/
|
|
151
|
+
|
|
152
|
+
# Misc
|
|
153
|
+
*.bak
|
|
154
|
+
*.tmp
|
|
155
|
+
`;
|
|
156
|
+
/**
|
|
157
|
+
* Ensure .gitignore exists with sensible defaults.
|
|
158
|
+
* If .gitignore doesn't exist, creates one.
|
|
159
|
+
* If it exists but is missing critical patterns, appends them.
|
|
160
|
+
* Creates .gitignore at the git root, not necessarily the workspace.
|
|
161
|
+
*/
|
|
162
|
+
export async function ensureGitignore(workspace, verbose = false) {
|
|
163
|
+
// Find the git root - .gitignore should be there
|
|
164
|
+
const gitRoot = await getGitRoot(workspace);
|
|
165
|
+
const targetDir = gitRoot || workspace;
|
|
166
|
+
const gitignorePath = path.join(targetDir, '.gitignore');
|
|
167
|
+
try {
|
|
168
|
+
// Check if .gitignore exists
|
|
169
|
+
let existingContent = '';
|
|
170
|
+
try {
|
|
171
|
+
existingContent = await fs.readFile(gitignorePath, 'utf-8');
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
// File doesn't exist, will create it
|
|
175
|
+
}
|
|
176
|
+
// Critical patterns that should always be present
|
|
177
|
+
const criticalPatterns = ['node_modules/', '.env'];
|
|
178
|
+
const missingPatterns = [];
|
|
179
|
+
for (const pattern of criticalPatterns) {
|
|
180
|
+
// Check if pattern exists (accounting for variations like "node_modules" vs "node_modules/")
|
|
181
|
+
const patternBase = pattern.replace(/\/$/, '');
|
|
182
|
+
const hasPattern = existingContent.split('\n').some(line => {
|
|
183
|
+
const trimmed = line.trim().replace(/\/$/, '');
|
|
184
|
+
return trimmed === patternBase || trimmed === pattern;
|
|
185
|
+
});
|
|
186
|
+
if (!hasPattern) {
|
|
187
|
+
missingPatterns.push(pattern);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (!existingContent) {
|
|
191
|
+
// No .gitignore, create with defaults
|
|
192
|
+
await fs.writeFile(gitignorePath, DEFAULT_GITIGNORE_PATTERNS, 'utf-8');
|
|
193
|
+
console.log(chalk.green(`Created .gitignore at ${gitignorePath}`));
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
else if (missingPatterns.length > 0) {
|
|
197
|
+
// .gitignore exists but missing critical patterns
|
|
198
|
+
const additions = `\n# Added by DevLoop\n${missingPatterns.join('\n')}\n`;
|
|
199
|
+
await fs.appendFile(gitignorePath, additions, 'utf-8');
|
|
200
|
+
console.log(chalk.green(`Added to .gitignore: ${missingPatterns.join(', ')}`));
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
if (verbose) {
|
|
204
|
+
console.log(chalk.gray('.gitignore already has required patterns'));
|
|
205
|
+
}
|
|
206
|
+
return false; // No changes needed
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
console.log(chalk.yellow(`Warning: Failed to ensure .gitignore: ${error}`));
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Detect if a git error is related to a pre-commit or commit-msg hook
|
|
215
|
+
*/
|
|
216
|
+
function isHookError(error) {
|
|
217
|
+
const hookIndicators = [
|
|
218
|
+
'hook',
|
|
219
|
+
'pre-commit',
|
|
220
|
+
'commit-msg',
|
|
221
|
+
'husky',
|
|
222
|
+
'commitlint',
|
|
223
|
+
'conventional commit',
|
|
224
|
+
'commit message',
|
|
225
|
+
'does not match'
|
|
226
|
+
];
|
|
227
|
+
const lowerError = error.toLowerCase();
|
|
228
|
+
return hookIndicators.some(indicator => lowerError.includes(indicator));
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Remove any 'nul' file that may have been created (Windows artifact).
|
|
232
|
+
* These files can block git commits and are never needed.
|
|
233
|
+
*/
|
|
234
|
+
async function removeNulFile(workspace) {
|
|
235
|
+
const nulPath = path.join(workspace, 'nul');
|
|
236
|
+
try {
|
|
237
|
+
await fs.unlink(nulPath);
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
// File doesn't exist or couldn't be deleted - that's fine
|
|
241
|
+
}
|
|
242
|
+
// Also try to unstage it from git if it was added
|
|
243
|
+
await execGit(['rm', '--cached', '--ignore-unmatch', 'nul'], workspace);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Stage all changes and commit with the given message
|
|
247
|
+
* Returns true if commit was made, false if nothing to commit or error
|
|
248
|
+
*/
|
|
249
|
+
export async function gitCommit(workspace, message, verbose = false) {
|
|
250
|
+
// Remove any 'nul' file (Windows artifact that blocks commits)
|
|
251
|
+
await removeNulFile(workspace);
|
|
252
|
+
// Stage all changes (including .devloop and .claude)
|
|
253
|
+
const addResult = await execGit(['add', '-A'], workspace);
|
|
254
|
+
if (!addResult.success) {
|
|
255
|
+
console.log(chalk.yellow(`Git add failed: ${addResult.error}`));
|
|
256
|
+
return { committed: false, error: addResult.error };
|
|
257
|
+
}
|
|
258
|
+
// Check if there are changes to commit
|
|
259
|
+
const statusResult = await execGit(['status', '--porcelain'], workspace);
|
|
260
|
+
if (!statusResult.success) {
|
|
261
|
+
console.log(chalk.yellow(`Git status failed: ${statusResult.error}`));
|
|
262
|
+
return { committed: false, error: statusResult.error };
|
|
263
|
+
}
|
|
264
|
+
// If nothing staged, nothing to commit
|
|
265
|
+
if (!statusResult.output.trim()) {
|
|
266
|
+
if (verbose) {
|
|
267
|
+
console.log(chalk.gray('Git status shows no changes after staging'));
|
|
268
|
+
}
|
|
269
|
+
return { committed: false };
|
|
270
|
+
}
|
|
271
|
+
if (verbose) {
|
|
272
|
+
console.log(chalk.gray(`Staged changes:\n${statusResult.output}`));
|
|
273
|
+
}
|
|
274
|
+
// Commit the changes
|
|
275
|
+
const commitResult = await execGit(['commit', '-m', message], workspace);
|
|
276
|
+
if (!commitResult.success) {
|
|
277
|
+
const errorText = commitResult.error || '';
|
|
278
|
+
const hookFailure = isHookError(errorText);
|
|
279
|
+
if (hookFailure) {
|
|
280
|
+
console.log(chalk.yellow(`\nGit commit failed due to a hook:`));
|
|
281
|
+
console.log(chalk.gray(errorText));
|
|
282
|
+
console.log(chalk.cyan(`\nThe commit message was: "${message}"`));
|
|
283
|
+
console.log(chalk.yellow(`\nTo fix this, set a custom commit message format:`));
|
|
284
|
+
console.log(chalk.white(` devloop config set devloopCommitFormat "<your-format>"`));
|
|
285
|
+
console.log(chalk.gray(`\nUse {action} placeholder for the action description.`));
|
|
286
|
+
console.log(chalk.gray(`Example: "chore(devloop): {action}"`));
|
|
287
|
+
return { committed: false, error: errorText, isHookFailure: true };
|
|
288
|
+
}
|
|
289
|
+
console.log(chalk.yellow(`Git commit failed: ${commitResult.error}`));
|
|
290
|
+
return { committed: false, error: commitResult.error };
|
|
291
|
+
}
|
|
292
|
+
return { committed: true };
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Ensure the workspace has a git repository.
|
|
296
|
+
* If git is available and no repo exists, initialize one and commit initial files.
|
|
297
|
+
* Returns info about what was done.
|
|
298
|
+
*/
|
|
299
|
+
export async function ensureGitRepo(workspace, verbose = false) {
|
|
300
|
+
const gitAvailable = await isGitAvailable();
|
|
301
|
+
if (!gitAvailable) {
|
|
302
|
+
if (verbose) {
|
|
303
|
+
console.log(chalk.gray('Git not available - skipping version control'));
|
|
304
|
+
}
|
|
305
|
+
return { gitAvailable: false, wasInitialized: false, initialCommit: false };
|
|
306
|
+
}
|
|
307
|
+
const isRepo = await isGitRepo(workspace);
|
|
308
|
+
if (isRepo) {
|
|
309
|
+
if (verbose) {
|
|
310
|
+
console.log(chalk.gray('Git repository already exists'));
|
|
311
|
+
}
|
|
312
|
+
// Ensure .gitignore exists even for existing repos
|
|
313
|
+
await ensureGitignore(workspace, verbose);
|
|
314
|
+
return { gitAvailable: true, wasInitialized: false, initialCommit: false };
|
|
315
|
+
}
|
|
316
|
+
// Initialize new repo
|
|
317
|
+
if (verbose) {
|
|
318
|
+
console.log(chalk.cyan('Initializing git repository...'));
|
|
319
|
+
}
|
|
320
|
+
const initSuccess = await initGitRepo(workspace);
|
|
321
|
+
if (!initSuccess) {
|
|
322
|
+
if (verbose) {
|
|
323
|
+
console.log(chalk.yellow('Failed to initialize git repository'));
|
|
324
|
+
}
|
|
325
|
+
return { gitAvailable: true, wasInitialized: false, initialCommit: false };
|
|
326
|
+
}
|
|
327
|
+
// Ensure .gitignore exists before initial commit
|
|
328
|
+
await ensureGitignore(workspace, verbose);
|
|
329
|
+
// Make initial commit with all existing files
|
|
330
|
+
const commitResult = await gitCommit(workspace, 'DevLoop: Initial commit', verbose);
|
|
331
|
+
if (verbose) {
|
|
332
|
+
if (commitResult.committed) {
|
|
333
|
+
console.log(chalk.green('Git repository initialized with initial commit'));
|
|
334
|
+
}
|
|
335
|
+
else if (commitResult.error) {
|
|
336
|
+
console.log(chalk.yellow(`Git init succeeded but initial commit failed: ${commitResult.error}`));
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
console.log(chalk.green('Git repository initialized (no files to commit)'));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
gitAvailable: true,
|
|
344
|
+
wasInitialized: true,
|
|
345
|
+
initialCommit: commitResult.committed
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Check if there are uncommitted changes in the workspace
|
|
350
|
+
* Returns the list of changed files if any
|
|
351
|
+
*/
|
|
352
|
+
export async function getUncommittedChanges(workspace, ignorePaths) {
|
|
353
|
+
const gitAvailable = await isGitAvailable();
|
|
354
|
+
if (!gitAvailable) {
|
|
355
|
+
return { hasChanges: false, files: [] };
|
|
356
|
+
}
|
|
357
|
+
const isRepo = await isGitRepo(workspace);
|
|
358
|
+
if (!isRepo) {
|
|
359
|
+
return { hasChanges: false, files: [] };
|
|
360
|
+
}
|
|
361
|
+
const statusResult = await execGit(['status', '--porcelain'], workspace);
|
|
362
|
+
if (!statusResult.success || !statusResult.output.trim()) {
|
|
363
|
+
return { hasChanges: false, files: [] };
|
|
364
|
+
}
|
|
365
|
+
// Parse the porcelain output to get file names
|
|
366
|
+
let files = statusResult.output
|
|
367
|
+
.split('\n')
|
|
368
|
+
.filter(line => line.trim())
|
|
369
|
+
.map(line => line.substring(3).trim()); // Remove status prefix (e.g., " M ", "?? ")
|
|
370
|
+
// Filter out ignored paths
|
|
371
|
+
if (ignorePaths && ignorePaths.length > 0) {
|
|
372
|
+
files = files.filter(file => {
|
|
373
|
+
// Normalize path separators for cross-platform matching
|
|
374
|
+
const normalizedFile = file.replace(/\\/g, '/');
|
|
375
|
+
// Check if any ignored path appears anywhere in the file path
|
|
376
|
+
return !ignorePaths.some(ignorePath => normalizedFile.includes(ignorePath));
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
return { hasChanges: files.length > 0, files };
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Get a diff summary of uncommitted changes
|
|
383
|
+
*/
|
|
384
|
+
export async function getUncommittedDiff(workspace) {
|
|
385
|
+
const gitAvailable = await isGitAvailable();
|
|
386
|
+
if (!gitAvailable) {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
const isRepo = await isGitRepo(workspace);
|
|
390
|
+
if (!isRepo) {
|
|
391
|
+
return null;
|
|
392
|
+
}
|
|
393
|
+
// Get diff of tracked files (staged and unstaged)
|
|
394
|
+
const diffResult = await execGit(['diff', 'HEAD', '--stat'], workspace);
|
|
395
|
+
if (!diffResult.success || !diffResult.output.trim()) {
|
|
396
|
+
// Try just unstaged changes if HEAD doesn't exist yet
|
|
397
|
+
const diffUnstagedResult = await execGit(['diff', '--stat'], workspace);
|
|
398
|
+
if (diffUnstagedResult.success && diffUnstagedResult.output.trim()) {
|
|
399
|
+
return diffUnstagedResult.output;
|
|
400
|
+
}
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
return diffResult.output;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Commit uncommitted changes from a previous interrupted session
|
|
407
|
+
* This preserves the partial work in git history before starting fresh
|
|
408
|
+
*/
|
|
409
|
+
export async function commitInterruptedWork(workspace, taskId, taskTitle, verbose = false) {
|
|
410
|
+
const gitAvailable = await isGitAvailable();
|
|
411
|
+
if (!gitAvailable) {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
const isRepo = await isGitRepo(workspace);
|
|
415
|
+
if (!isRepo) {
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
// Build action description
|
|
419
|
+
let action;
|
|
420
|
+
if (taskId && taskTitle) {
|
|
421
|
+
action = `Interrupted work on ${taskId} - ${taskTitle}`;
|
|
422
|
+
}
|
|
423
|
+
else if (taskId) {
|
|
424
|
+
action = `Interrupted work on ${taskId}`;
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
action = 'Interrupted work from previous session';
|
|
428
|
+
}
|
|
429
|
+
// Use devloopCommitFormat if configured
|
|
430
|
+
const workspaceConfig = await readWorkspaceConfig(workspace);
|
|
431
|
+
const message = formatDevloopCommit(workspaceConfig.devloopCommitFormat, action);
|
|
432
|
+
const result = await gitCommit(workspace, message, verbose);
|
|
433
|
+
if (verbose && result.committed) {
|
|
434
|
+
console.log(chalk.gray(` Git: Committed interrupted work`));
|
|
435
|
+
}
|
|
436
|
+
else if (result.error) {
|
|
437
|
+
console.log(chalk.yellow(` Git: Failed to commit interrupted work - ${result.error}`));
|
|
438
|
+
}
|
|
439
|
+
return result.committed;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Commit changes after an iteration
|
|
443
|
+
*/
|
|
444
|
+
export async function commitIteration(workspace, iteration, taskId, taskTitle, success, verbose = false, featureName) {
|
|
445
|
+
const gitAvailable = await isGitAvailable();
|
|
446
|
+
if (!gitAvailable) {
|
|
447
|
+
return { committed: false };
|
|
448
|
+
}
|
|
449
|
+
const isRepo = await isGitRepo(workspace);
|
|
450
|
+
if (!isRepo) {
|
|
451
|
+
return { committed: false };
|
|
452
|
+
}
|
|
453
|
+
// Load workspace config for commit format
|
|
454
|
+
const workspaceConfig = await readWorkspaceConfig(workspace);
|
|
455
|
+
// Build the action description
|
|
456
|
+
const featurePrefix = featureName ? `[${featureName}] ` : '';
|
|
457
|
+
const actionDescription = taskId && taskTitle
|
|
458
|
+
? `${featurePrefix}${success ? 'Complete' : 'Attempted'} ${taskId} - ${taskTitle}`
|
|
459
|
+
: `${featurePrefix}Iteration ${iteration}`;
|
|
460
|
+
// Use devloopCommitFormat if configured, otherwise default
|
|
461
|
+
const message = formatDevloopCommit(workspaceConfig.devloopCommitFormat, actionDescription);
|
|
462
|
+
const result = await gitCommit(workspace, message, verbose);
|
|
463
|
+
if (verbose && result.committed) {
|
|
464
|
+
console.log(chalk.gray(` Git: Committed iteration ${iteration}`));
|
|
465
|
+
}
|
|
466
|
+
else if (result.isHookFailure) {
|
|
467
|
+
// Hook failure message already printed by gitCommit
|
|
468
|
+
return { committed: false, hookFailure: true };
|
|
469
|
+
}
|
|
470
|
+
else if (result.error) {
|
|
471
|
+
console.log(chalk.yellow(` Git: Commit failed - ${result.error}`));
|
|
472
|
+
}
|
|
473
|
+
return { committed: result.committed };
|
|
474
|
+
}
|
|
475
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/core/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAA0B,EAAE,MAAc;IAC5E,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACtD,CAAC;IACD,OAAO,YAAY,MAAM,EAAE,CAAC;AAC9B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,SAAiB,EAAE,MAAc;IAC7E,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACpD,OAAO,mBAAmB,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,U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