@rely-ai/caliber 1.22.0-dev.1773767470 → 1.22.0-dev.1773769041

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.
Files changed (2) hide show
  1. package/dist/bin.js +23 -16
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -159,12 +159,12 @@ __export(constants_exports, {
159
159
  MANIFEST_FILE: () => MANIFEST_FILE
160
160
  });
161
161
  import path9 from "path";
162
- import os2 from "os";
162
+ import os3 from "os";
163
163
  var AUTH_DIR, CALIBER_DIR, MANIFEST_FILE, BACKUPS_DIR, LEARNING_DIR, LEARNING_SESSION_FILE, LEARNING_STATE_FILE, LEARNING_MAX_EVENTS, LEARNING_ROI_FILE;
164
164
  var init_constants = __esm({
165
165
  "src/constants.ts"() {
166
166
  "use strict";
167
- AUTH_DIR = path9.join(os2.homedir(), ".caliber");
167
+ AUTH_DIR = path9.join(os3.homedir(), ".caliber");
168
168
  CALIBER_DIR = ".caliber";
169
169
  MANIFEST_FILE = path9.join(CALIBER_DIR, "manifest.json");
170
170
  BACKUPS_DIR = path9.join(CALIBER_DIR, "backups");
@@ -185,7 +185,7 @@ __export(lock_exports, {
185
185
  });
186
186
  import fs29 from "fs";
187
187
  import path23 from "path";
188
- import os5 from "os";
188
+ import os6 from "os";
189
189
  function isCaliberRunning() {
190
190
  try {
191
191
  if (!fs29.existsSync(LOCK_FILE)) return false;
@@ -218,7 +218,7 @@ var LOCK_FILE, STALE_MS;
218
218
  var init_lock = __esm({
219
219
  "src/lib/lock.ts"() {
220
220
  "use strict";
221
- LOCK_FILE = path23.join(os5.tmpdir(), ".caliber.lock");
221
+ LOCK_FILE = path23.join(os6.tmpdir(), ".caliber.lock");
222
222
  STALE_MS = 10 * 60 * 1e3;
223
223
  }
224
224
  });
@@ -1205,6 +1205,7 @@ var OpenAICompatProvider = class {
1205
1205
 
1206
1206
  // src/llm/cursor-acp.ts
1207
1207
  import { spawn, execSync as execSync3 } from "child_process";
1208
+ import os2 from "os";
1208
1209
  var AGENT_BIN = "agent";
1209
1210
  var IS_WINDOWS = process.platform === "win32";
1210
1211
  var CursorAcpProvider = class {
@@ -1225,7 +1226,7 @@ var CursorAcpProvider = class {
1225
1226
  return this.runPrintStream(model, prompt, callbacks);
1226
1227
  }
1227
1228
  buildArgs(model, streaming) {
1228
- const args = ["--print", "--trust"];
1229
+ const args = ["--print", "--trust", "--workspace", os2.tmpdir()];
1229
1230
  if (model && model !== "auto" && model !== "default") {
1230
1231
  args.push("--model", model);
1231
1232
  }
@@ -1271,6 +1272,7 @@ var CursorAcpProvider = class {
1271
1272
  ...IS_WINDOWS && { shell: true }
1272
1273
  });
1273
1274
  let buffer = "";
1275
+ let endCalled = false;
1274
1276
  child.stdout.on("data", (data) => {
1275
1277
  buffer += data.toString("utf-8");
1276
1278
  const lines = buffer.split("\n");
@@ -1283,7 +1285,9 @@ var CursorAcpProvider = class {
1283
1285
  const text = event.message?.content?.[0]?.text || event.content;
1284
1286
  if (text) callbacks.onText(text);
1285
1287
  } else if (event.type === "result") {
1286
- callbacks.onEnd({ stopReason: "end_turn" });
1288
+ endCalled = true;
1289
+ const stopReason = event.is_error ? "error" : "end_turn";
1290
+ callbacks.onEnd({ stopReason });
1287
1291
  }
1288
1292
  } catch {
1289
1293
  callbacks.onText(line);
@@ -1302,12 +1306,16 @@ var CursorAcpProvider = class {
1302
1306
  const text = event.message?.content?.[0]?.text || event.content;
1303
1307
  if (text) callbacks.onText(text);
1304
1308
  } else if (event.type === "result") {
1305
- callbacks.onEnd({ stopReason: "end_turn" });
1309
+ endCalled = true;
1310
+ callbacks.onEnd({ stopReason: event.is_error ? "error" : "end_turn" });
1306
1311
  }
1307
1312
  } catch {
1308
1313
  callbacks.onText(buffer);
1309
1314
  }
1310
1315
  }
1316
+ if (!endCalled) {
1317
+ callbacks.onEnd({ stopReason: code === 0 ? "end_turn" : "error" });
1318
+ }
1311
1319
  if (code !== 0 && code !== null) {
1312
1320
  const err = new Error(`Cursor agent exited with code ${code}`);
1313
1321
  callbacks.onError(err);
@@ -1323,17 +1331,16 @@ var CursorAcpProvider = class {
1323
1331
  buildPrompt(options) {
1324
1332
  const streamOpts = options;
1325
1333
  const hasHistory = streamOpts.messages && streamOpts.messages.length > 0;
1326
- let combined = "";
1327
- combined += "[[System]]\n" + options.system + "\n\n";
1334
+ let combined = options.system + "\n\n";
1328
1335
  if (hasHistory) {
1329
1336
  for (const msg of streamOpts.messages) {
1330
- combined += `[[${msg.role === "user" ? "User" : "Assistant"}]]
1331
- ${msg.content}
1337
+ const label = msg.role === "user" ? "User" : "Assistant";
1338
+ combined += `${label}: ${msg.content}
1332
1339
 
1333
1340
  `;
1334
1341
  }
1335
1342
  }
1336
- combined += "[[User]]\n" + options.prompt;
1343
+ combined += options.prompt;
1337
1344
  return combined;
1338
1345
  }
1339
1346
  };
@@ -3218,9 +3225,9 @@ import { createTwoFilesPatch } from "diff";
3218
3225
  import { execSync as execSync5, spawn as spawn3 } from "child_process";
3219
3226
  import fs14 from "fs";
3220
3227
  import path12 from "path";
3221
- import os3 from "os";
3228
+ import os4 from "os";
3222
3229
  var IS_WINDOWS3 = process.platform === "win32";
3223
- var DIFF_TEMP_DIR = path12.join(os3.tmpdir(), "caliber-diff");
3230
+ var DIFF_TEMP_DIR = path12.join(os4.tmpdir(), "caliber-diff");
3224
3231
  function getEmptyFilePath(proposedPath) {
3225
3232
  fs14.mkdirSync(DIFF_TEMP_DIR, { recursive: true });
3226
3233
  const tempPath = path12.join(DIFF_TEMP_DIR, path12.basename(proposedPath));
@@ -5646,10 +5653,10 @@ import chalk7 from "chalk";
5646
5653
  // src/telemetry/config.ts
5647
5654
  import fs23 from "fs";
5648
5655
  import path18 from "path";
5649
- import os4 from "os";
5656
+ import os5 from "os";
5650
5657
  import crypto3 from "crypto";
5651
5658
  import { execSync as execSync12 } from "child_process";
5652
- var CONFIG_DIR2 = path18.join(os4.homedir(), ".caliber");
5659
+ var CONFIG_DIR2 = path18.join(os5.homedir(), ".caliber");
5653
5660
  var CONFIG_FILE2 = path18.join(CONFIG_DIR2, "config.json");
5654
5661
  var runtimeDisabled = false;
5655
5662
  function readConfig() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.22.0-dev.1773767470",
3
+ "version": "1.22.0-dev.1773769041",
4
4
  "description": "Analyze your codebase and generate optimized AI agent configs (CLAUDE.md, .cursorrules, skills) — no API key needed",
5
5
  "type": "module",
6
6
  "bin": {