@rely-ai/caliber 1.41.1 → 1.41.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/bin.js +19 -9
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1118,6 +1118,7 @@ function isCaliberRunning() {
|
|
|
1118
1118
|
if (!fs40.existsSync(lockFile)) return false;
|
|
1119
1119
|
const raw = fs40.readFileSync(lockFile, "utf-8").trim();
|
|
1120
1120
|
const { pid, ts } = JSON.parse(raw);
|
|
1121
|
+
if (pid === process.pid) return false;
|
|
1121
1122
|
if (Date.now() - ts > STALE_MS) return false;
|
|
1122
1123
|
try {
|
|
1123
1124
|
process.kill(pid, 0);
|
|
@@ -2846,16 +2847,33 @@ var ClaudeCliProvider = class {
|
|
|
2846
2847
|
if (model) args.push("--model", model);
|
|
2847
2848
|
const child = spawnClaude(args);
|
|
2848
2849
|
child.stdin.end(combinedPrompt);
|
|
2850
|
+
let settled = false;
|
|
2849
2851
|
const chunks = [];
|
|
2850
2852
|
const stderrChunks = [];
|
|
2851
2853
|
child.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
2852
2854
|
child.stderr.on("data", (chunk) => stderrChunks.push(chunk));
|
|
2855
|
+
const timer = setTimeout(() => {
|
|
2856
|
+
child.kill("SIGTERM");
|
|
2857
|
+
if (!settled) {
|
|
2858
|
+
settled = true;
|
|
2859
|
+
reject(
|
|
2860
|
+
new Error(
|
|
2861
|
+
`Claude CLI timed out after ${this.timeoutMs / 1e3}s. Set CALIBER_CLAUDE_CLI_TIMEOUT_MS to increase.`
|
|
2862
|
+
)
|
|
2863
|
+
);
|
|
2864
|
+
}
|
|
2865
|
+
}, this.timeoutMs);
|
|
2853
2866
|
child.on("error", (err) => {
|
|
2854
2867
|
clearTimeout(timer);
|
|
2855
|
-
|
|
2868
|
+
if (!settled) {
|
|
2869
|
+
settled = true;
|
|
2870
|
+
reject(err);
|
|
2871
|
+
}
|
|
2856
2872
|
});
|
|
2857
2873
|
child.on("close", (code, signal) => {
|
|
2858
2874
|
clearTimeout(timer);
|
|
2875
|
+
if (settled) return;
|
|
2876
|
+
settled = true;
|
|
2859
2877
|
const stdout = Buffer.concat(chunks).toString("utf-8").trim();
|
|
2860
2878
|
if (code === 0) {
|
|
2861
2879
|
resolve3(stdout);
|
|
@@ -2867,14 +2885,6 @@ var ClaudeCliProvider = class {
|
|
|
2867
2885
|
reject(new Error(detail ? `${base}. ${detail}` : base));
|
|
2868
2886
|
}
|
|
2869
2887
|
});
|
|
2870
|
-
const timer = setTimeout(() => {
|
|
2871
|
-
child.kill("SIGTERM");
|
|
2872
|
-
reject(
|
|
2873
|
-
new Error(
|
|
2874
|
-
`Claude CLI timed out after ${this.timeoutMs / 1e3}s. Set CALIBER_CLAUDE_CLI_TIMEOUT_MS to increase.`
|
|
2875
|
-
)
|
|
2876
|
-
);
|
|
2877
|
-
}, this.timeoutMs);
|
|
2878
2888
|
});
|
|
2879
2889
|
}
|
|
2880
2890
|
};
|
package/package.json
CHANGED