@rely-ai/caliber 1.18.4 → 1.18.6
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 +29 -13
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1201,6 +1201,7 @@ var OpenAICompatProvider = class {
|
|
|
1201
1201
|
import { spawn, execSync as execSync3 } from "child_process";
|
|
1202
1202
|
import readline from "readline";
|
|
1203
1203
|
var ACP_AGENT_BIN = "agent";
|
|
1204
|
+
var IS_WINDOWS = process.platform === "win32";
|
|
1204
1205
|
var CursorAcpProvider = class {
|
|
1205
1206
|
defaultModel;
|
|
1206
1207
|
cursorApiKey;
|
|
@@ -1231,7 +1232,8 @@ var CursorAcpProvider = class {
|
|
|
1231
1232
|
const agent = spawn(ACP_AGENT_BIN, args, {
|
|
1232
1233
|
stdio: ["pipe", "pipe", "inherit"],
|
|
1233
1234
|
cwd: process.cwd(),
|
|
1234
|
-
env: { ...process.env, ...this.cursorApiKey && { CURSOR_API_KEY: this.cursorApiKey } }
|
|
1235
|
+
env: { ...process.env, ...this.cursorApiKey && { CURSOR_API_KEY: this.cursorApiKey } },
|
|
1236
|
+
...IS_WINDOWS && { shell: true }
|
|
1235
1237
|
});
|
|
1236
1238
|
const pending = /* @__PURE__ */ new Map();
|
|
1237
1239
|
let nextId = 1;
|
|
@@ -1348,7 +1350,8 @@ ${msg.content}
|
|
|
1348
1350
|
};
|
|
1349
1351
|
function isCursorAgentAvailable() {
|
|
1350
1352
|
try {
|
|
1351
|
-
|
|
1353
|
+
const cmd = process.platform === "win32" ? `where ${ACP_AGENT_BIN}` : `which ${ACP_AGENT_BIN}`;
|
|
1354
|
+
execSync3(cmd, { stdio: "ignore" });
|
|
1352
1355
|
return true;
|
|
1353
1356
|
} catch {
|
|
1354
1357
|
return false;
|
|
@@ -1359,6 +1362,7 @@ function isCursorAgentAvailable() {
|
|
|
1359
1362
|
import { spawn as spawn2, execSync as execSync4 } from "child_process";
|
|
1360
1363
|
var CLAUDE_CLI_BIN = "claude";
|
|
1361
1364
|
var DEFAULT_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
1365
|
+
var IS_WINDOWS2 = process.platform === "win32";
|
|
1362
1366
|
var ClaudeCliProvider = class {
|
|
1363
1367
|
defaultModel;
|
|
1364
1368
|
timeoutMs;
|
|
@@ -1376,13 +1380,15 @@ var ClaudeCliProvider = class {
|
|
|
1376
1380
|
}
|
|
1377
1381
|
async stream(options, callbacks) {
|
|
1378
1382
|
const combined = this.buildCombinedPrompt(options);
|
|
1379
|
-
const args = ["-p"
|
|
1383
|
+
const args = ["-p"];
|
|
1380
1384
|
if (options.model) args.push("--model", options.model);
|
|
1381
1385
|
const child = spawn2(CLAUDE_CLI_BIN, args, {
|
|
1382
1386
|
cwd: process.cwd(),
|
|
1383
|
-
stdio: ["
|
|
1384
|
-
env: process.env
|
|
1387
|
+
stdio: ["pipe", "pipe", "inherit"],
|
|
1388
|
+
env: process.env,
|
|
1389
|
+
...IS_WINDOWS2 && { shell: true }
|
|
1385
1390
|
});
|
|
1391
|
+
child.stdin.end(combined);
|
|
1386
1392
|
let settled = false;
|
|
1387
1393
|
const chunks = [];
|
|
1388
1394
|
child.stdout.on("data", (chunk) => {
|
|
@@ -1438,13 +1444,15 @@ ${msg.content}
|
|
|
1438
1444
|
}
|
|
1439
1445
|
runClaudePrint(combinedPrompt, model) {
|
|
1440
1446
|
return new Promise((resolve2, reject) => {
|
|
1441
|
-
const args = ["-p"
|
|
1447
|
+
const args = ["-p"];
|
|
1442
1448
|
if (model) args.push("--model", model);
|
|
1443
1449
|
const child = spawn2(CLAUDE_CLI_BIN, args, {
|
|
1444
1450
|
cwd: process.cwd(),
|
|
1445
|
-
stdio: ["
|
|
1446
|
-
env: process.env
|
|
1451
|
+
stdio: ["pipe", "pipe", "inherit"],
|
|
1452
|
+
env: process.env,
|
|
1453
|
+
...IS_WINDOWS2 && { shell: true }
|
|
1447
1454
|
});
|
|
1455
|
+
child.stdin.end(combinedPrompt);
|
|
1448
1456
|
const chunks = [];
|
|
1449
1457
|
child.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
1450
1458
|
child.on("error", (err) => {
|
|
@@ -3164,9 +3172,11 @@ import { createTwoFilesPatch } from "diff";
|
|
|
3164
3172
|
|
|
3165
3173
|
// src/utils/editor.ts
|
|
3166
3174
|
import { execSync as execSync5, spawn as spawn3 } from "child_process";
|
|
3175
|
+
var IS_WINDOWS3 = process.platform === "win32";
|
|
3167
3176
|
function commandExists(cmd) {
|
|
3168
3177
|
try {
|
|
3169
|
-
|
|
3178
|
+
const check = process.platform === "win32" ? `where ${cmd}` : `which ${cmd}`;
|
|
3179
|
+
execSync5(check, { stdio: "ignore" });
|
|
3170
3180
|
return true;
|
|
3171
3181
|
} catch {
|
|
3172
3182
|
return false;
|
|
@@ -3186,12 +3196,14 @@ function openDiffsInEditor(editor, files) {
|
|
|
3186
3196
|
if (file.originalPath) {
|
|
3187
3197
|
spawn3(cmd, ["--diff", file.originalPath, file.proposedPath], {
|
|
3188
3198
|
stdio: "ignore",
|
|
3189
|
-
detached: true
|
|
3199
|
+
detached: true,
|
|
3200
|
+
...IS_WINDOWS3 && { shell: true }
|
|
3190
3201
|
}).unref();
|
|
3191
3202
|
} else {
|
|
3192
3203
|
spawn3(cmd, [file.proposedPath], {
|
|
3193
3204
|
stdio: "ignore",
|
|
3194
|
-
detached: true
|
|
3205
|
+
detached: true,
|
|
3206
|
+
...IS_WINDOWS3 && { shell: true }
|
|
3195
3207
|
}).unref();
|
|
3196
3208
|
}
|
|
3197
3209
|
} catch {
|
|
@@ -3481,7 +3493,8 @@ function resolveCaliber() {
|
|
|
3481
3493
|
return _resolved;
|
|
3482
3494
|
}
|
|
3483
3495
|
try {
|
|
3484
|
-
const
|
|
3496
|
+
const whichCmd = process.platform === "win32" ? "where caliber" : "which caliber";
|
|
3497
|
+
const found = execSync6(whichCmd, {
|
|
3485
3498
|
encoding: "utf-8",
|
|
3486
3499
|
stdio: ["pipe", "pipe", "pipe"]
|
|
3487
3500
|
}).trim();
|
|
@@ -8346,7 +8359,10 @@ acquireLock();
|
|
|
8346
8359
|
if (process.env.CALIBER_LOCAL) {
|
|
8347
8360
|
process.env.CALIBER_SKIP_UPDATE_CHECK = "1";
|
|
8348
8361
|
}
|
|
8349
|
-
|
|
8362
|
+
var isQuickExit = ["--version", "-V", "--help", "-h"].some((f) => process.argv.includes(f));
|
|
8363
|
+
if (!isQuickExit) {
|
|
8364
|
+
await checkForUpdates();
|
|
8365
|
+
}
|
|
8350
8366
|
program.parseAsync().catch((err) => {
|
|
8351
8367
|
const msg = err instanceof Error ? err.message : "Unexpected error";
|
|
8352
8368
|
if (msg !== "__exit__") {
|
package/package.json
CHANGED