@cjvana/claude-auto 0.2.0 → 0.3.2
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/.claude-plugin/plugin.json +1 -1
- package/dist/{chunk-3VNP3RVY.js → chunk-5RGKLL5S.js} +2 -2
- package/dist/{chunk-2CLZERVS.js → chunk-7QMU26RE.js} +93 -14
- package/dist/chunk-7QMU26RE.js.map +1 -0
- package/dist/{chunk-LW7XOWL2.js → chunk-7WBOMWGX.js} +3 -3
- package/dist/{chunk-GLW7T4QE.js → chunk-AQMJSOKP.js} +3 -3
- package/dist/{chunk-DE5AVSQ4.js → chunk-CDLRNIJ2.js} +3 -3
- package/dist/{chunk-FXPJY6FJ.js → chunk-CY2RLEHC.js} +4 -4
- package/dist/{chunk-5LGOK52J.js → chunk-DJ25VI7Q.js} +2 -2
- package/dist/{chunk-ETRY7XUT.js → chunk-F5ZAKXGU.js} +3 -3
- package/dist/{chunk-PDL7SDI3.js → chunk-FC5A7WIX.js} +3 -3
- package/dist/{chunk-XCXFSLSS.js → chunk-IAIVZ6DI.js} +3 -3
- package/dist/{chunk-QRYCNVLT.js → chunk-LYWZRGJR.js} +3 -3
- package/dist/{chunk-4VUPUHND.js → chunk-MGOTE5UN.js} +3 -3
- package/dist/{chunk-Y7ACM23C.js → chunk-MKKXWEAJ.js} +2 -2
- package/dist/{chunk-76PDFLLR.js → chunk-N5FPDXSJ.js} +93 -14
- package/dist/chunk-N5FPDXSJ.js.map +1 -0
- package/dist/{chunk-CFD6OA3U.js → chunk-QFPHB7UP.js} +2 -2
- package/dist/{chunk-H2MUDYMW.js → chunk-SRBR6LEH.js} +2 -1
- package/dist/chunk-SRBR6LEH.js.map +1 -0
- package/dist/{chunk-JKZUC53H.js → chunk-VCMT7VYH.js} +3 -3
- package/dist/{chunk-TKUHYD6T.js → chunk-VRRDTDFU.js} +2 -2
- package/dist/{chunk-SZA5UZBI.js → chunk-VXY6ZLTA.js} +3 -3
- package/dist/{chunk-I4RM5O56.js → chunk-W7PREJFY.js} +2 -2
- package/dist/{chunk-S6E67XMR.js → chunk-WD4XNFNG.js} +2 -2
- package/dist/{chunk-QJIXXBMI.js → chunk-WMF2RTBI.js} +3 -3
- package/dist/{chunk-RWA7YWPE.js → chunk-XIT33W6W.js} +6 -6
- package/dist/{chunk-4I5UIASZ.js → chunk-YF7F7AXH.js} +2 -2
- package/dist/{chunk-SMZYA6CY.js → chunk-YUULUW5Q.js} +3 -3
- package/dist/claude-auto-run.js +5 -5
- package/dist/claude-auto.js +11 -11
- package/dist/{cost-QGM3D4QW.js → cost-DIEL6X7Y.js} +4 -4
- package/dist/cost-WLBDKGRO.js +11 -0
- package/dist/{create-Z2OVC5JK.js → create-F2TZM2L3.js} +5 -5
- package/dist/{create-DC63FYWP.js → create-OCKJJFJ3.js} +4 -4
- package/dist/{crontab-ZZHAZ5OJ.js → crontab-G4S5N4ZU.js} +3 -3
- package/dist/{crontab-YKFQ3AQA.js → crontab-I7F5QWWP.js} +2 -2
- package/dist/{crontab-OMTYKJC7.js → crontab-WYKWDJZA.js} +2 -2
- package/dist/{edit-O5T3UXM4.js → edit-VJTGESSH.js} +4 -4
- package/dist/{edit-ZGUTPFHQ.js → edit-WIXE3UGC.js} +5 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +30 -30
- package/dist/{launchd-5COTJSRK.js → launchd-7YACEL5D.js} +2 -2
- package/dist/{launchd-6NKJDIYC.js → launchd-ENBS6KCA.js} +2 -2
- package/dist/{launchd-MZNYUY3Y.js → launchd-MINT7AHT.js} +3 -3
- package/dist/{list-55ABTJVW.js → list-LTPGPOIW.js} +6 -6
- package/dist/{list-AS7F4LFU.js → list-N5B7DY2G.js} +5 -5
- package/dist/logs-E2V3TVZS.js +12 -0
- package/dist/{logs-YVSFXBSB.js → logs-WA46MIUY.js} +4 -4
- package/dist/pause-4F5DHHDH.js +13 -0
- package/dist/{pause-72P4ERIU.js → pause-7ALFP7IW.js} +4 -4
- package/dist/{pause-JCPZFBVZ.js → pause-DPMRAYQH.js} +4 -4
- package/dist/remove-BEFJXL5W.js +13 -0
- package/dist/{remove-RMTSKUYN.js → remove-WD7QHQXP.js} +4 -4
- package/dist/report-DNNTF3UY.js +15 -0
- package/dist/{report-6O43ICNG.js → report-FNIA26A3.js} +5 -5
- package/dist/{resume-A2PWKRLE.js → resume-DAN6ZC3R.js} +4 -4
- package/dist/{resume-3TB76AUU.js → resume-E2UFDC4V.js} +5 -5
- package/dist/{resume-4XSHJ4SN.js → resume-GOUUQ2QI.js} +4 -4
- package/dist/{run-H3IF4QXQ.js → run-2ORE3F7D.js} +6 -6
- package/dist/{run-CXRPDX2S.js → run-FSNXAHCH.js} +6 -6
- package/dist/{tui-NVOPC5SD.js → tui-7PR7OPVQ.js} +8 -8
- package/dist/tui-SO6O7CTZ.js +16 -0
- package/package.json +1 -1
- package/dist/chunk-2CLZERVS.js.map +0 -1
- package/dist/chunk-76PDFLLR.js.map +0 -1
- package/dist/chunk-H2MUDYMW.js.map +0 -1
- package/dist/cost-QKN3U7AG.js +0 -11
- package/dist/logs-D5FNSCXE.js +0 -12
- package/dist/pause-TAS6BCYR.js +0 -13
- package/dist/remove-VBIVYREY.js +0 -13
- package/dist/report-53DC5DL2.js +0 -15
- package/dist/tui-VKT4UBXQ.js +0 -16
- /package/dist/{chunk-3VNP3RVY.js.map → chunk-5RGKLL5S.js.map} +0 -0
- /package/dist/{chunk-LW7XOWL2.js.map → chunk-7WBOMWGX.js.map} +0 -0
- /package/dist/{chunk-GLW7T4QE.js.map → chunk-AQMJSOKP.js.map} +0 -0
- /package/dist/{chunk-DE5AVSQ4.js.map → chunk-CDLRNIJ2.js.map} +0 -0
- /package/dist/{chunk-FXPJY6FJ.js.map → chunk-CY2RLEHC.js.map} +0 -0
- /package/dist/{chunk-5LGOK52J.js.map → chunk-DJ25VI7Q.js.map} +0 -0
- /package/dist/{chunk-ETRY7XUT.js.map → chunk-F5ZAKXGU.js.map} +0 -0
- /package/dist/{chunk-PDL7SDI3.js.map → chunk-FC5A7WIX.js.map} +0 -0
- /package/dist/{chunk-JKZUC53H.js.map → chunk-IAIVZ6DI.js.map} +0 -0
- /package/dist/{chunk-QRYCNVLT.js.map → chunk-LYWZRGJR.js.map} +0 -0
- /package/dist/{chunk-4VUPUHND.js.map → chunk-MGOTE5UN.js.map} +0 -0
- /package/dist/{chunk-Y7ACM23C.js.map → chunk-MKKXWEAJ.js.map} +0 -0
- /package/dist/{chunk-CFD6OA3U.js.map → chunk-QFPHB7UP.js.map} +0 -0
- /package/dist/{chunk-XCXFSLSS.js.map → chunk-VCMT7VYH.js.map} +0 -0
- /package/dist/{chunk-TKUHYD6T.js.map → chunk-VRRDTDFU.js.map} +0 -0
- /package/dist/{chunk-SZA5UZBI.js.map → chunk-VXY6ZLTA.js.map} +0 -0
- /package/dist/{chunk-I4RM5O56.js.map → chunk-W7PREJFY.js.map} +0 -0
- /package/dist/{chunk-S6E67XMR.js.map → chunk-WD4XNFNG.js.map} +0 -0
- /package/dist/{chunk-QJIXXBMI.js.map → chunk-WMF2RTBI.js.map} +0 -0
- /package/dist/{chunk-RWA7YWPE.js.map → chunk-XIT33W6W.js.map} +0 -0
- /package/dist/{chunk-4I5UIASZ.js.map → chunk-YF7F7AXH.js.map} +0 -0
- /package/dist/{chunk-SMZYA6CY.js.map → chunk-YUULUW5Q.js.map} +0 -0
- /package/dist/{cost-QGM3D4QW.js.map → cost-DIEL6X7Y.js.map} +0 -0
- /package/dist/{cost-QKN3U7AG.js.map → cost-WLBDKGRO.js.map} +0 -0
- /package/dist/{create-Z2OVC5JK.js.map → create-F2TZM2L3.js.map} +0 -0
- /package/dist/{create-DC63FYWP.js.map → create-OCKJJFJ3.js.map} +0 -0
- /package/dist/{crontab-ZZHAZ5OJ.js.map → crontab-G4S5N4ZU.js.map} +0 -0
- /package/dist/{crontab-OMTYKJC7.js.map → crontab-I7F5QWWP.js.map} +0 -0
- /package/dist/{crontab-YKFQ3AQA.js.map → crontab-WYKWDJZA.js.map} +0 -0
- /package/dist/{edit-O5T3UXM4.js.map → edit-VJTGESSH.js.map} +0 -0
- /package/dist/{edit-ZGUTPFHQ.js.map → edit-WIXE3UGC.js.map} +0 -0
- /package/dist/{launchd-5COTJSRK.js.map → launchd-7YACEL5D.js.map} +0 -0
- /package/dist/{launchd-6NKJDIYC.js.map → launchd-ENBS6KCA.js.map} +0 -0
- /package/dist/{launchd-MZNYUY3Y.js.map → launchd-MINT7AHT.js.map} +0 -0
- /package/dist/{list-55ABTJVW.js.map → list-LTPGPOIW.js.map} +0 -0
- /package/dist/{list-AS7F4LFU.js.map → list-N5B7DY2G.js.map} +0 -0
- /package/dist/{logs-D5FNSCXE.js.map → logs-E2V3TVZS.js.map} +0 -0
- /package/dist/{logs-YVSFXBSB.js.map → logs-WA46MIUY.js.map} +0 -0
- /package/dist/{pause-TAS6BCYR.js.map → pause-4F5DHHDH.js.map} +0 -0
- /package/dist/{pause-72P4ERIU.js.map → pause-7ALFP7IW.js.map} +0 -0
- /package/dist/{pause-JCPZFBVZ.js.map → pause-DPMRAYQH.js.map} +0 -0
- /package/dist/{remove-VBIVYREY.js.map → remove-BEFJXL5W.js.map} +0 -0
- /package/dist/{remove-RMTSKUYN.js.map → remove-WD7QHQXP.js.map} +0 -0
- /package/dist/{report-53DC5DL2.js.map → report-DNNTF3UY.js.map} +0 -0
- /package/dist/{report-6O43ICNG.js.map → report-FNIA26A3.js.map} +0 -0
- /package/dist/{resume-A2PWKRLE.js.map → resume-DAN6ZC3R.js.map} +0 -0
- /package/dist/{resume-3TB76AUU.js.map → resume-E2UFDC4V.js.map} +0 -0
- /package/dist/{resume-4XSHJ4SN.js.map → resume-GOUUQ2QI.js.map} +0 -0
- /package/dist/{run-CXRPDX2S.js.map → run-2ORE3F7D.js.map} +0 -0
- /package/dist/{run-H3IF4QXQ.js.map → run-FSNXAHCH.js.map} +0 -0
- /package/dist/{tui-NVOPC5SD.js.map → tui-7PR7OPVQ.js.map} +0 -0
- /package/dist/{tui-VKT4UBXQ.js.map → tui-SO6O7CTZ.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listRunLogs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YUULUW5Q.js";
|
|
4
4
|
import {
|
|
5
5
|
formatDuration,
|
|
6
6
|
formatRelativeTime,
|
|
@@ -35,4 +35,4 @@ async function logsCommand(args) {
|
|
|
35
35
|
export {
|
|
36
36
|
logsCommand
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-DJ25VI7Q.js.map
|
|
@@ -16,18 +16,18 @@ function detectPlatform() {
|
|
|
16
16
|
async function createScheduler() {
|
|
17
17
|
const platform = detectPlatform();
|
|
18
18
|
if (platform === "linux") {
|
|
19
|
-
const { CrontabScheduler } = await import("./crontab-
|
|
19
|
+
const { CrontabScheduler } = await import("./crontab-I7F5QWWP.js");
|
|
20
20
|
return new CrontabScheduler();
|
|
21
21
|
}
|
|
22
22
|
if (platform === "win32") {
|
|
23
23
|
const { SchtasksScheduler } = await import("./schtasks-5IZCEIPB.js");
|
|
24
24
|
return new SchtasksScheduler();
|
|
25
25
|
}
|
|
26
|
-
const { LaunchdScheduler } = await import("./launchd-
|
|
26
|
+
const { LaunchdScheduler } = await import("./launchd-ENBS6KCA.js");
|
|
27
27
|
return new LaunchdScheduler();
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export {
|
|
31
31
|
createScheduler
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-F5ZAKXGU.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listRunLogs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YUULUW5Q.js";
|
|
4
4
|
import {
|
|
5
5
|
formatDuration
|
|
6
6
|
} from "./chunk-ORBF5IW3.js";
|
|
7
7
|
import {
|
|
8
8
|
listJobs,
|
|
9
9
|
readJob
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5RGKLL5S.js";
|
|
11
11
|
|
|
12
12
|
// src/cli/commands/report.ts
|
|
13
13
|
function aggregateLogs(logs) {
|
|
@@ -143,4 +143,4 @@ async function reportCommand(args) {
|
|
|
143
143
|
export {
|
|
144
144
|
reportCommand
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-FC5A7WIX.js.map
|
|
@@ -16,18 +16,18 @@ function detectPlatform() {
|
|
|
16
16
|
async function createScheduler() {
|
|
17
17
|
const platform = detectPlatform();
|
|
18
18
|
if (platform === "linux") {
|
|
19
|
-
const { CrontabScheduler } = await import("./crontab-
|
|
19
|
+
const { CrontabScheduler } = await import("./crontab-WYKWDJZA.js");
|
|
20
20
|
return new CrontabScheduler();
|
|
21
21
|
}
|
|
22
22
|
if (platform === "win32") {
|
|
23
23
|
const { SchtasksScheduler } = await import("./schtasks-6GQ27GI2.js");
|
|
24
24
|
return new SchtasksScheduler();
|
|
25
25
|
}
|
|
26
|
-
const { LaunchdScheduler } = await import("./launchd-
|
|
26
|
+
const { LaunchdScheduler } = await import("./launchd-7YACEL5D.js");
|
|
27
27
|
return new LaunchdScheduler();
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export {
|
|
31
31
|
createScheduler
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-IAIVZ6DI.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-ORBF5IW3.js";
|
|
4
4
|
import {
|
|
5
5
|
getCostSummary
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WD4XNFNG.js";
|
|
7
7
|
import {
|
|
8
8
|
closeDatabase
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YF7F7AXH.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/commands/cost.ts
|
|
12
12
|
async function costCommand(args) {
|
|
@@ -69,4 +69,4 @@ Grand Total: $${grandTotal.toFixed(4)}`);
|
|
|
69
69
|
export {
|
|
70
70
|
costCommand
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
72
|
+
//# sourceMappingURL=chunk-LYWZRGJR.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-3NEANSUS.js";
|
|
4
4
|
import {
|
|
5
5
|
createScheduler
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VCMT7VYH.js";
|
|
7
7
|
import {
|
|
8
8
|
describeSchedule,
|
|
9
9
|
getNextRuns,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-D4MBOIYQ.js";
|
|
12
12
|
import {
|
|
13
13
|
createJob
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5RGKLL5S.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/commands/create.ts
|
|
17
17
|
import { readFile, stat } from "fs/promises";
|
|
@@ -112,4 +112,4 @@ async function createCommand(args) {
|
|
|
112
112
|
export {
|
|
113
113
|
createCommand
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-MGOTE5UN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paths
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SRBR6LEH.js";
|
|
4
4
|
import {
|
|
5
5
|
ConfigParseError,
|
|
6
6
|
ConfigValidationError
|
|
@@ -174,4 +174,4 @@ export {
|
|
|
174
174
|
updateJob,
|
|
175
175
|
listJobs
|
|
176
176
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
177
|
+
//# sourceMappingURL=chunk-MKKXWEAJ.js.map
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
formatContextWindow,
|
|
3
3
|
loadRunContext,
|
|
4
4
|
writeRunLog
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YUULUW5Q.js";
|
|
6
6
|
import {
|
|
7
7
|
checkBudget
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WD4XNFNG.js";
|
|
9
9
|
import {
|
|
10
10
|
getDatabase
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YF7F7AXH.js";
|
|
12
12
|
import {
|
|
13
13
|
execCommand
|
|
14
14
|
} from "./chunk-3NEANSUS.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-27NCPABY.js";
|
|
18
18
|
import {
|
|
19
19
|
paths
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SRBR6LEH.js";
|
|
21
21
|
import {
|
|
22
22
|
GitOpsError,
|
|
23
23
|
SpawnError
|
|
@@ -294,7 +294,7 @@ async function postIssueComment(options) {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
function buildCommentBody(status, context) {
|
|
297
|
-
const footer = "\n\n---\n*Automated by [claude-auto](https://github.com/
|
|
297
|
+
const footer = "\n\n---\n*Automated by [claude-auto](https://github.com/cj-vana/claude-auto)*";
|
|
298
298
|
switch (status) {
|
|
299
299
|
case "success": {
|
|
300
300
|
const parts = ["Claude Auto completed work on this issue."];
|
|
@@ -501,6 +501,22 @@ async function attemptRebase(repoPath, baseBranch, remote) {
|
|
|
501
501
|
return { diverged: true, rebased: false, conflicts };
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
+
async function getFirstCommitSubject(repoPath, baseBranch) {
|
|
505
|
+
try {
|
|
506
|
+
const { stdout } = await execCommand("git", [
|
|
507
|
+
"-C",
|
|
508
|
+
repoPath,
|
|
509
|
+
"log",
|
|
510
|
+
"--reverse",
|
|
511
|
+
"--format=%s",
|
|
512
|
+
`${baseBranch}..HEAD`
|
|
513
|
+
]);
|
|
514
|
+
const firstLine = stdout.trim().split("\n")[0] ?? "";
|
|
515
|
+
return firstLine;
|
|
516
|
+
} catch {
|
|
517
|
+
return "";
|
|
518
|
+
}
|
|
519
|
+
}
|
|
504
520
|
async function getDiffFromBase(repoPath, baseBranch) {
|
|
505
521
|
try {
|
|
506
522
|
const { stdout } = await execCommand("git", ["-C", repoPath, "diff", `${baseBranch}...HEAD`]);
|
|
@@ -585,7 +601,7 @@ async function triageIssues(repoPath, previousIssues) {
|
|
|
585
601
|
}
|
|
586
602
|
|
|
587
603
|
// src/runner/lock.ts
|
|
588
|
-
import { mkdir } from "fs/promises";
|
|
604
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
589
605
|
import lockfile from "proper-lockfile";
|
|
590
606
|
var STALE_THRESHOLD = 45 * 60 * 1e3;
|
|
591
607
|
async function acquireLock(jobId) {
|
|
@@ -600,10 +616,26 @@ async function acquireLock(jobId) {
|
|
|
600
616
|
return null;
|
|
601
617
|
}
|
|
602
618
|
}
|
|
619
|
+
async function acquireRepoLock(repoPath) {
|
|
620
|
+
const lockPath = paths.repoLock(repoPath);
|
|
621
|
+
try {
|
|
622
|
+
await writeFile(lockPath, "", { flag: "wx" });
|
|
623
|
+
} catch {
|
|
624
|
+
}
|
|
625
|
+
try {
|
|
626
|
+
const release = await lockfile.lock(lockPath, {
|
|
627
|
+
stale: STALE_THRESHOLD,
|
|
628
|
+
retries: 0
|
|
629
|
+
});
|
|
630
|
+
return release;
|
|
631
|
+
} catch {
|
|
632
|
+
return null;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
603
635
|
|
|
604
636
|
// src/runner/prompt-builder.ts
|
|
605
637
|
function buildSystemPrompt(config) {
|
|
606
|
-
let prompt = "You are an autonomous coding agent working on this repository. Before starting any work, thoroughly research and understand the current codebase implementation, project structure, and recent changes.";
|
|
638
|
+
let prompt = "You are an autonomous coding agent working on this repository. You have FULL permission to read, edit, and write ANY file in this repository \u2014 including files under .claude/, .github/, and any other directory. Do NOT ask for permission; you already have it. Just make the changes directly. Before starting any work, thoroughly research and understand the current codebase implementation, project structure, and recent changes.";
|
|
607
639
|
if (config.systemPrompt) {
|
|
608
640
|
prompt += `
|
|
609
641
|
|
|
@@ -986,7 +1018,30 @@ function parseReviewVerdict(reviewResult) {
|
|
|
986
1018
|
}
|
|
987
1019
|
|
|
988
1020
|
// src/runner/spawner.ts
|
|
989
|
-
import { spawn } from "child_process";
|
|
1021
|
+
import { execFileSync, spawn } from "child_process";
|
|
1022
|
+
import { existsSync } from "fs";
|
|
1023
|
+
import { homedir } from "os";
|
|
1024
|
+
import { join } from "path";
|
|
1025
|
+
function resolveClaudeBin() {
|
|
1026
|
+
if (process.env.CLAUDE_BIN && existsSync(process.env.CLAUDE_BIN)) {
|
|
1027
|
+
return process.env.CLAUDE_BIN;
|
|
1028
|
+
}
|
|
1029
|
+
const candidates = [
|
|
1030
|
+
join(homedir(), ".local", "bin", "claude"),
|
|
1031
|
+
"/usr/local/bin/claude",
|
|
1032
|
+
"/usr/bin/claude"
|
|
1033
|
+
];
|
|
1034
|
+
for (const candidate of candidates) {
|
|
1035
|
+
if (existsSync(candidate)) {
|
|
1036
|
+
return candidate;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
try {
|
|
1040
|
+
return execFileSync("which", ["claude"], { encoding: "utf-8" }).trim();
|
|
1041
|
+
} catch {
|
|
1042
|
+
return "claude";
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
990
1045
|
function buildAllowedTools(config) {
|
|
991
1046
|
const tools = [
|
|
992
1047
|
"Read",
|
|
@@ -1043,7 +1098,8 @@ function spawnClaude(options) {
|
|
|
1043
1098
|
if (options.allowedTools.length > 0) {
|
|
1044
1099
|
args.push("--allowedTools", options.allowedTools.join(","));
|
|
1045
1100
|
}
|
|
1046
|
-
const
|
|
1101
|
+
const claudeBin = resolveClaudeBin();
|
|
1102
|
+
const child = spawn(claudeBin, args, {
|
|
1047
1103
|
cwd: options.cwd,
|
|
1048
1104
|
env: { ...process.env, ...options.env },
|
|
1049
1105
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -1279,7 +1335,7 @@ ${spawnResult.summary}`,
|
|
|
1279
1335
|
- **Turns used:** ${spawnResult.numTurns}
|
|
1280
1336
|
- **Cost:** $${spawnResult.costUsd.toFixed(4)}
|
|
1281
1337
|
- **Duration:** ${formatDuration2(spawnResult.durationMs)}`,
|
|
1282
|
-
"---\n*Generated by [claude-auto](https://github.com/
|
|
1338
|
+
"---\n*Generated by [claude-auto](https://github.com/cj-vana/claude-auto)*"
|
|
1283
1339
|
].join("\n\n");
|
|
1284
1340
|
}
|
|
1285
1341
|
function buildPipelinePRBody(pipelineResult, config) {
|
|
@@ -1299,7 +1355,7 @@ ${stageLines.join("\n")}`,
|
|
|
1299
1355
|
- **Review verdict:** ${pipelineResult.reviewVerdict}
|
|
1300
1356
|
- **Total cost:** $${pipelineResult.totalCostUsd.toFixed(4)}
|
|
1301
1357
|
- **Total duration:** ${formatDuration2(pipelineResult.totalDurationMs)}`,
|
|
1302
|
-
"---\n*Generated by [claude-auto](https://github.com/
|
|
1358
|
+
"---\n*Generated by [claude-auto](https://github.com/cj-vana/claude-auto) (pipeline mode)*"
|
|
1303
1359
|
].join("\n\n");
|
|
1304
1360
|
}
|
|
1305
1361
|
async function handlePrePushRebase(repoPath, baseBranch, remote) {
|
|
@@ -1333,8 +1389,23 @@ async function executeRun(jobId) {
|
|
|
1333
1389
|
let branchName;
|
|
1334
1390
|
let isFeedbackBranch = false;
|
|
1335
1391
|
let config;
|
|
1392
|
+
let releaseRepoLock = null;
|
|
1336
1393
|
try {
|
|
1337
1394
|
config = await loadJobConfig(paths.jobConfig(jobId));
|
|
1395
|
+
releaseRepoLock = await acquireRepoLock(config.repo.path);
|
|
1396
|
+
if (!releaseRepoLock) {
|
|
1397
|
+
const result2 = {
|
|
1398
|
+
status: "locked",
|
|
1399
|
+
jobId,
|
|
1400
|
+
runId,
|
|
1401
|
+
startedAt,
|
|
1402
|
+
completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1403
|
+
durationMs: Date.now() - startTime,
|
|
1404
|
+
error: "Another job is currently running on this repository"
|
|
1405
|
+
};
|
|
1406
|
+
await writeRunLog(jobId, result2);
|
|
1407
|
+
return result2;
|
|
1408
|
+
}
|
|
1338
1409
|
if (!config.enabled) {
|
|
1339
1410
|
const result2 = {
|
|
1340
1411
|
status: "paused",
|
|
@@ -1535,7 +1606,9 @@ ${spawnResult2.summary}
|
|
|
1535
1606
|
return result3;
|
|
1536
1607
|
}
|
|
1537
1608
|
await pushBranch(config.repo.path, branchName);
|
|
1538
|
-
const
|
|
1609
|
+
const commitSubject = await getFirstCommitSubject(config.repo.path, config.repo.branch);
|
|
1610
|
+
const titleText = commitSubject || pipelineResult.summary.slice(0, 72);
|
|
1611
|
+
const prTitle = `[claude-auto] ${titleText}`;
|
|
1539
1612
|
const prBody = buildPipelinePRBody(pipelineResult, config);
|
|
1540
1613
|
prUrl2 = await createPR(config.repo.path, branchName, config.repo.branch, prTitle, prBody);
|
|
1541
1614
|
}
|
|
@@ -1617,7 +1690,9 @@ ${spawnResult2.summary}
|
|
|
1617
1690
|
return result2;
|
|
1618
1691
|
}
|
|
1619
1692
|
await pushBranch(config.repo.path, branchName);
|
|
1620
|
-
const
|
|
1693
|
+
const commitSubject = await getFirstCommitSubject(config.repo.path, config.repo.branch);
|
|
1694
|
+
const titleText = commitSubject || spawnResult.summary.slice(0, 72);
|
|
1695
|
+
const prTitle = `[claude-auto] ${titleText}`;
|
|
1621
1696
|
const prBody = buildPRBody(spawnResult, config);
|
|
1622
1697
|
prUrl = await createPR(config.repo.path, branchName, config.repo.branch, prTitle, prBody);
|
|
1623
1698
|
}
|
|
@@ -1691,6 +1766,10 @@ ${spawnResult2.summary}
|
|
|
1691
1766
|
}
|
|
1692
1767
|
return result;
|
|
1693
1768
|
} finally {
|
|
1769
|
+
if (releaseRepoLock) {
|
|
1770
|
+
await releaseRepoLock().catch(() => {
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1694
1773
|
await releaseLock();
|
|
1695
1774
|
}
|
|
1696
1775
|
}
|
|
@@ -1741,4 +1820,4 @@ export {
|
|
|
1741
1820
|
checkPendingPRFeedback,
|
|
1742
1821
|
executeRun
|
|
1743
1822
|
};
|
|
1744
|
-
//# sourceMappingURL=chunk-
|
|
1823
|
+
//# sourceMappingURL=chunk-N5FPDXSJ.js.map
|