@rely-ai/caliber 1.45.4 → 1.46.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.
Files changed (2) hide show
  1. package/dist/bin.js +58 -16
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -346,6 +346,10 @@ grep -q "caliber" .git/hooks/pre-commit 2>/dev/null && echo "hook-active" || ech
346
346
  2. Run: \`${bin} refresh && git add ${MANAGED_DOC_PATHS} 2>/dev/null\`
347
347
  3. After it completes, briefly tell the user what Caliber updated. Then proceed with the commit.
348
348
 
349
+ **Valid \`${bin} refresh\` options:** \`--quiet\` (suppress output) and \`--dry-run\` (preview without writing). Do not pass any other flags \u2014 options like \`--auto-approve\`, \`--debug\`, or \`--force\` do not exist and will cause errors.
350
+
351
+ **\`${bin} config\`** takes no flags \u2014 it runs an interactive provider setup. Do not pass \`--provider\`, \`--api-key\`, or \`--endpoint\`.
352
+
349
353
  ${getCaliberNotFoundFallback(platform, bin)}
350
354
  ${BLOCK_END}`;
351
355
  }
@@ -361,6 +365,9 @@ Run: \`grep -q "caliber" .git/hooks/pre-commit 2>/dev/null && echo "hook-active"
361
365
  If hook-active: just commit normally \u2014 Caliber syncs automatically via the hook. Tell the user: "Caliber will sync your agent configs automatically."
362
366
  If no-hook: run \`${bin} refresh && git add ${MANAGED_DOC_PATHS} 2>/dev/null\` before committing, and tell the user what was updated.
363
367
 
368
+ Valid \`${bin} refresh\` options: \`--quiet\` and \`--dry-run\` only. Do not pass \`--auto-approve\`, \`--debug\`, \`--force\`, or any other flags.
369
+ \`${bin} config\` takes no flags \u2014 it is interactive. Do not pass \`--provider\`, \`--api-key\`, or \`--endpoint\`.
370
+
364
371
  If \`${bin}\` is not found, read the setup-caliber skill from .cursor/skills/setup-caliber/SKILL.md and follow its instructions to install Caliber.
365
372
  `;
366
373
  }
@@ -2433,6 +2440,15 @@ var VertexProvider = class {
2433
2440
 
2434
2441
  // src/llm/openai-compat.ts
2435
2442
  import OpenAI from "openai";
2443
+ var DEFAULT_TIMEOUT_MS = 10 * 60 * 1e3;
2444
+ function resolveTimeoutMs() {
2445
+ const raw = process.env.CALIBER_OPENAI_TIMEOUT_MS;
2446
+ if (raw) {
2447
+ const parsed = parseInt(raw, 10);
2448
+ if (Number.isFinite(parsed) && parsed >= 1e3) return parsed;
2449
+ }
2450
+ return DEFAULT_TIMEOUT_MS;
2451
+ }
2436
2452
  var OpenAICompatProvider = class {
2437
2453
  client;
2438
2454
  defaultModel;
@@ -2440,7 +2456,8 @@ var OpenAICompatProvider = class {
2440
2456
  constructor(config, options) {
2441
2457
  this.client = new OpenAI({
2442
2458
  apiKey: config.apiKey,
2443
- ...config.baseUrl && { baseURL: config.baseUrl }
2459
+ ...config.baseUrl && { baseURL: config.baseUrl },
2460
+ timeout: resolveTimeoutMs()
2444
2461
  });
2445
2462
  this.defaultModel = config.model;
2446
2463
  this.temperature = options?.temperature;
@@ -2623,7 +2640,7 @@ function resolveAgentBin() {
2623
2640
  _agentBin = "agent";
2624
2641
  return _agentBin;
2625
2642
  }
2626
- var DEFAULT_TIMEOUT_MS = 10 * 60 * 1e3;
2643
+ var DEFAULT_TIMEOUT_MS2 = 10 * 60 * 1e3;
2627
2644
  var SIGKILL_DELAY_MS = 5e3;
2628
2645
  var STDERR_MAX_BYTES = 10 * 1024;
2629
2646
  var CursorAcpProvider = class {
@@ -2636,9 +2653,9 @@ var CursorAcpProvider = class {
2636
2653
  this.defaultModel = config.model || "sonnet-4.6";
2637
2654
  this.cursorApiKey = process.env.CURSOR_API_KEY ?? process.env.CURSOR_AUTH_TOKEN;
2638
2655
  const envTimeout = process.env.CALIBER_CURSOR_TIMEOUT_MS;
2639
- this.timeoutMs = envTimeout ? parseInt(envTimeout, 10) : DEFAULT_TIMEOUT_MS;
2656
+ this.timeoutMs = envTimeout ? parseInt(envTimeout, 10) : DEFAULT_TIMEOUT_MS2;
2640
2657
  if (!Number.isFinite(this.timeoutMs) || this.timeoutMs < 1e3) {
2641
- this.timeoutMs = DEFAULT_TIMEOUT_MS;
2658
+ this.timeoutMs = DEFAULT_TIMEOUT_MS2;
2642
2659
  }
2643
2660
  }
2644
2661
  async call(options) {
@@ -2925,7 +2942,7 @@ function isCursorLoggedIn() {
2925
2942
  // src/llm/claude-cli.ts
2926
2943
  import fs7 from "fs";
2927
2944
  import { spawn as spawn2, execSync as execSync7, execFileSync as execFileSync2 } from "child_process";
2928
- var DEFAULT_TIMEOUT_MS2 = 10 * 60 * 1e3;
2945
+ var DEFAULT_TIMEOUT_MS3 = 10 * 60 * 1e3;
2929
2946
  var IS_WINDOWS2 = process.platform === "win32";
2930
2947
  function candidateClaudePaths() {
2931
2948
  if (IS_WINDOWS2) return [];
@@ -2992,9 +3009,9 @@ var ClaudeCliProvider = class {
2992
3009
  constructor(config) {
2993
3010
  this.defaultModel = config.model || "default";
2994
3011
  const envTimeout = process.env.CALIBER_CLAUDE_CLI_TIMEOUT_MS;
2995
- this.timeoutMs = envTimeout ? parseInt(envTimeout, 10) : DEFAULT_TIMEOUT_MS2;
3012
+ this.timeoutMs = envTimeout ? parseInt(envTimeout, 10) : DEFAULT_TIMEOUT_MS3;
2996
3013
  if (!Number.isFinite(this.timeoutMs) || this.timeoutMs < 1e3) {
2997
- this.timeoutMs = DEFAULT_TIMEOUT_MS2;
3014
+ this.timeoutMs = DEFAULT_TIMEOUT_MS3;
2998
3015
  }
2999
3016
  }
3000
3017
  async call(options) {
@@ -3160,7 +3177,7 @@ function isClaudeCliLoggedIn() {
3160
3177
  // src/llm/opencode.ts
3161
3178
  import { spawn as spawn3, execSync as execSync8 } from "child_process";
3162
3179
  var OPENCODE_BIN = "opencode";
3163
- var DEFAULT_TIMEOUT_MS3 = 10 * 60 * 1e3;
3180
+ var DEFAULT_TIMEOUT_MS4 = 10 * 60 * 1e3;
3164
3181
  var IS_WINDOWS3 = process.platform === "win32";
3165
3182
  var cachedLoggedIn2 = null;
3166
3183
  function isOpenCodeAvailable() {
@@ -3322,9 +3339,9 @@ var OpenCodeProvider = class {
3322
3339
  constructor(config) {
3323
3340
  this.defaultModel = config.model || "default";
3324
3341
  const envTimeout = process.env.CALIBER_OPENCODE_TIMEOUT_MS;
3325
- this.timeoutMs = envTimeout ? parseInt(envTimeout, 10) : DEFAULT_TIMEOUT_MS3;
3342
+ this.timeoutMs = envTimeout ? parseInt(envTimeout, 10) : DEFAULT_TIMEOUT_MS4;
3326
3343
  if (!Number.isFinite(this.timeoutMs) || this.timeoutMs < 1e3) {
3327
- this.timeoutMs = DEFAULT_TIMEOUT_MS3;
3344
+ this.timeoutMs = DEFAULT_TIMEOUT_MS4;
3328
3345
  }
3329
3346
  }
3330
3347
  async call(options) {
@@ -10404,11 +10421,27 @@ function detectAgents(dir) {
10404
10421
  }
10405
10422
  async function promptAgent(detected) {
10406
10423
  const choices = [
10407
- { name: "Claude Code", value: "claude", checked: detected?.includes("claude") ?? false },
10424
+ {
10425
+ name: "Claude Code",
10426
+ value: "claude",
10427
+ checked: detected?.includes("claude") ?? false
10428
+ },
10408
10429
  { name: "Cursor", value: "cursor", checked: detected?.includes("cursor") ?? false },
10409
- { name: "Codex (OpenAI)", value: "codex", checked: detected?.includes("codex") ?? false },
10410
- { name: "OpenCode", value: "opencode", checked: detected?.includes("opencode") ?? false },
10411
- { name: "GitHub Copilot", value: "github-copilot", checked: detected?.includes("github-copilot") ?? false }
10430
+ {
10431
+ name: "Codex (OpenAI)",
10432
+ value: "codex",
10433
+ checked: detected?.includes("codex") ?? false
10434
+ },
10435
+ {
10436
+ name: "OpenCode",
10437
+ value: "opencode",
10438
+ checked: detected?.includes("opencode") ?? false
10439
+ },
10440
+ {
10441
+ name: "GitHub Copilot (sync target \u2014 writes copilot-instructions.md)",
10442
+ value: "github-copilot",
10443
+ checked: detected?.includes("github-copilot") ?? false
10444
+ }
10412
10445
  ];
10413
10446
  const hasDefaults = detected && detected.length > 0;
10414
10447
  const message = hasDefaults ? "Detected agents (press Enter to confirm, or toggle with space)" : "Which coding agents do you use? (toggle with space)";
@@ -10496,7 +10529,9 @@ async function refineLoop(currentSetup, sessionHistory, summarizeSetup2, printSu
10496
10529
  console.log(chalk10.dim('Type "done" to accept, or describe more changes.'));
10497
10530
  } else {
10498
10531
  refineSpinner.fail("Refinement failed \u2014 could not parse AI response.");
10499
- console.log(chalk10.dim('Try rephrasing your request, or type "done" to keep the current config.'));
10532
+ console.log(
10533
+ chalk10.dim('Try rephrasing your request, or type "done" to keep the current config.')
10534
+ );
10500
10535
  }
10501
10536
  }
10502
10537
  }
@@ -11055,6 +11090,13 @@ async function initCommand(options) {
11055
11090
  console.log(chalk13.dim(` Target: ${targetAgent.join(", ")}
11056
11091
  `));
11057
11092
  trackInitAgentSelected(targetAgent, agentAutoDetected);
11093
+ if (targetAgent.length === 1 && targetAgent[0] === "github-copilot") {
11094
+ console.log(
11095
+ chalk13.yellow(
11096
+ " Note: GitHub Copilot is a sync target \u2014 Caliber writes .github/copilot-instructions.md\n but needs an LLM provider (configured above) to power generation.\n For the best experience, also select claude or cursor as a target agent.\n"
11097
+ )
11098
+ );
11099
+ }
11058
11100
  console.log(title.bold(" Step 2/4 \u2014 Setup\n"));
11059
11101
  console.log(chalk13.dim(" Installing sync infrastructure...\n"));
11060
11102
  const hookResult = installPreCommitHook();
@@ -15073,7 +15115,7 @@ function parseAgentOption(value) {
15073
15115
  }
15074
15116
  program.command("init").description("Initialize your project for AI-assisted development").option(
15075
15117
  "--agent <type>",
15076
- "Target agents (comma-separated): claude, cursor, codex, opencode, github-copilot",
15118
+ "Target agents (comma-separated): claude, cursor, codex, opencode, github-copilot. Note: github-copilot is a sync target only \u2014 requires another provider for generation",
15077
15119
  parseAgentOption
15078
15120
  ).option("--source <paths...>", "Related source paths to include as context").option("--dry-run", "Preview changes without writing files").option("--force", "Overwrite existing config without prompting").option("--debug-report", void 0, false).option("--show-tokens", "Show token usage summary at the end").option("--auto-approve", "Run without interactive prompts (auto-accept all)").option("--verbose", "Show detailed logs of each step").option("--thorough", "Deep analysis \u2014 more refinement passes for maximum quality").action(tracked("init", initCommand));
15079
15121
  program.command("bootstrap").description(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.45.4",
3
+ "version": "1.46.1",
4
4
  "description": "AI context infrastructure for coding agents — keeps CLAUDE.md, Cursor rules, and skills in sync as your codebase evolves",
5
5
  "type": "module",
6
6
  "bin": {