devbonzai 2.0.4 → 2.0.5
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/cli.js +22 -5
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1294,18 +1294,35 @@ app.post('/prompt_agent', (req, res) => {
|
|
|
1294
1294
|
console.log('⚠️ [prompt_agent] Could not get beforeCommit:', e.message);
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
1297
|
-
//
|
|
1297
|
+
// Capture initial state of modified files (files already dirty before job starts)
|
|
1298
|
+
const initiallyModifiedFiles = new Set();
|
|
1299
|
+
try {
|
|
1300
|
+
const initialStatus = execSync('git status --short', { cwd: ROOT }).toString();
|
|
1301
|
+
initialStatus.split('\\n').filter(Boolean).forEach(line => {
|
|
1302
|
+
const filePath = line.substring(3).trim();
|
|
1303
|
+
if (filePath) initiallyModifiedFiles.add(filePath);
|
|
1304
|
+
});
|
|
1305
|
+
console.log('🔵 [prompt_agent] Initially modified files:', Array.from(initiallyModifiedFiles));
|
|
1306
|
+
} catch (e) {
|
|
1307
|
+
console.log('⚠️ [prompt_agent] Could not get initial status:', e.message);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
// Set up file change tracking - only track NEW changes during job
|
|
1298
1311
|
const changedFiles = new Set();
|
|
1299
1312
|
const pollInterval = setInterval(() => {
|
|
1300
1313
|
try {
|
|
1301
1314
|
const status = execSync('git status --short', { cwd: ROOT }).toString();
|
|
1302
1315
|
status.split('\\n').filter(Boolean).forEach(line => {
|
|
1303
1316
|
const filePath = line.substring(3).trim(); // Remove status prefix (XY + space)
|
|
1304
|
-
if
|
|
1317
|
+
// Only add if this file was NOT already modified before the job started
|
|
1318
|
+
if (filePath && !initiallyModifiedFiles.has(filePath)) {
|
|
1319
|
+
const wasNew = !changedFiles.has(filePath);
|
|
1320
|
+
changedFiles.add(filePath);
|
|
1321
|
+
if (wasNew) {
|
|
1322
|
+
console.log('📁 [prompt_agent] New file changed:', filePath);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1305
1325
|
});
|
|
1306
|
-
if (changedFiles.size > 0) {
|
|
1307
|
-
console.log('📁 [prompt_agent] Changed files:', Array.from(changedFiles));
|
|
1308
|
-
}
|
|
1309
1326
|
} catch (e) {
|
|
1310
1327
|
// Ignore git status errors
|
|
1311
1328
|
}
|