@rely-ai/caliber 1.47.0 → 1.47.1
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 +30 -16
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -2622,6 +2622,13 @@ function estimateTokens(text) {
|
|
|
2622
2622
|
return Math.ceil(text.length / 4);
|
|
2623
2623
|
}
|
|
2624
2624
|
|
|
2625
|
+
// src/utils/windows.ts
|
|
2626
|
+
function quoteForWindows(arg) {
|
|
2627
|
+
if (!arg) return '""';
|
|
2628
|
+
if (!/[ \t\n\v"]/.test(arg)) return arg;
|
|
2629
|
+
return '"' + arg.replace(/(\\*)"/g, '$1$1\\"').replace(/(\\+)$/, "$1$1") + '"';
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2625
2632
|
// src/llm/cursor-acp.ts
|
|
2626
2633
|
var IS_WINDOWS = process.platform === "win32";
|
|
2627
2634
|
var _agentBin = null;
|
|
@@ -2697,10 +2704,14 @@ var CursorAcpProvider = class {
|
|
|
2697
2704
|
const targetModel = model || this.defaultModel;
|
|
2698
2705
|
if (this.warmProcess && !this.warmProcess.killed && this.warmModel === targetModel) return;
|
|
2699
2706
|
const args = this.buildArgs(targetModel, false);
|
|
2700
|
-
|
|
2707
|
+
const env = { ...process.env, ...this.cursorApiKey && { CURSOR_API_KEY: this.cursorApiKey } };
|
|
2708
|
+
this.warmProcess = IS_WINDOWS ? spawn([quoteForWindows(resolveAgentBin()), ...args.map(quoteForWindows)].join(" "), {
|
|
2701
2709
|
stdio: ["pipe", "pipe", "pipe"],
|
|
2702
|
-
env
|
|
2703
|
-
|
|
2710
|
+
env,
|
|
2711
|
+
shell: true
|
|
2712
|
+
}) : spawn(resolveAgentBin(), args, {
|
|
2713
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
2714
|
+
env
|
|
2704
2715
|
});
|
|
2705
2716
|
this.warmModel = targetModel;
|
|
2706
2717
|
this.warmProcess.on("error", () => {
|
|
@@ -2744,10 +2755,14 @@ var CursorAcpProvider = class {
|
|
|
2744
2755
|
return { child: warm, stderrChunks: stderrChunks2 };
|
|
2745
2756
|
}
|
|
2746
2757
|
const args = this.buildArgs(model, streaming);
|
|
2747
|
-
const
|
|
2758
|
+
const env = { ...process.env, ...this.cursorApiKey && { CURSOR_API_KEY: this.cursorApiKey } };
|
|
2759
|
+
const child = IS_WINDOWS ? spawn([quoteForWindows(resolveAgentBin()), ...args.map(quoteForWindows)].join(" "), {
|
|
2760
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
2761
|
+
env,
|
|
2762
|
+
shell: true
|
|
2763
|
+
}) : spawn(resolveAgentBin(), args, {
|
|
2748
2764
|
stdio: ["pipe", "pipe", "pipe"],
|
|
2749
|
-
env
|
|
2750
|
-
...IS_WINDOWS && { shell: true }
|
|
2765
|
+
env
|
|
2751
2766
|
});
|
|
2752
2767
|
const stderrChunks = [];
|
|
2753
2768
|
child.stderr.on("data", (chunk) => {
|
|
@@ -14117,16 +14132,15 @@ async function learnObserveCommand(options) {
|
|
|
14117
14132
|
const NPX_SUFFIX = " --yes @rely-ai/caliber";
|
|
14118
14133
|
const [exe, binArgs] = isNpxResolution2() ? [bin.slice(0, -NPX_SUFFIX.length) || "npx", ["--yes", "@rely-ai/caliber"]] : [bin, []];
|
|
14119
14134
|
const isWin = process.platform === "win32";
|
|
14120
|
-
const
|
|
14121
|
-
const child = spawn5(
|
|
14122
|
-
|
|
14123
|
-
[
|
|
14124
|
-
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
|
|
14129
|
-
);
|
|
14135
|
+
const argsArray = [...binArgs, "learn", "finalize", "--auto", "--incremental"];
|
|
14136
|
+
const child = isWin ? spawn5([`"${exe}"`, ...argsArray.map(quoteForWindows)].join(" "), {
|
|
14137
|
+
detached: true,
|
|
14138
|
+
stdio: ["ignore", logFd, logFd],
|
|
14139
|
+
shell: true
|
|
14140
|
+
}) : spawn5(exe, argsArray, {
|
|
14141
|
+
detached: true,
|
|
14142
|
+
stdio: ["ignore", logFd, logFd]
|
|
14143
|
+
});
|
|
14130
14144
|
child.on("error", () => {
|
|
14131
14145
|
try {
|
|
14132
14146
|
const s = readState2();
|
package/package.json
CHANGED