@rely-ai/caliber 1.43.0 → 1.44.0

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 +98 -16
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -64,6 +64,14 @@ function resolveFromEnv() {
64
64
  baseUrl: process.env.OPENAI_BASE_URL
65
65
  };
66
66
  }
67
+ if (process.env.MINIMAX_API_KEY) {
68
+ return {
69
+ provider: "minimax",
70
+ apiKey: process.env.MINIMAX_API_KEY,
71
+ model: process.env.CALIBER_MODEL || DEFAULT_MODELS.minimax,
72
+ baseUrl: process.env.MINIMAX_BASE_URL
73
+ };
74
+ }
67
75
  if (process.env.CALIBER_USE_CURSOR_SEAT === "1" || process.env.CALIBER_USE_CURSOR_SEAT === "true") {
68
76
  return {
69
77
  provider: "cursor",
@@ -83,7 +91,9 @@ function readConfigFile() {
83
91
  if (!fs4.existsSync(CONFIG_FILE)) return null;
84
92
  const raw = fs4.readFileSync(CONFIG_FILE, "utf-8");
85
93
  const parsed = JSON.parse(raw);
86
- if (!parsed.provider || !["anthropic", "vertex", "openai", "cursor", "claude-cli"].includes(parsed.provider)) {
94
+ if (!parsed.provider || !["anthropic", "vertex", "openai", "minimax", "cursor", "claude-cli"].includes(
95
+ parsed.provider
96
+ )) {
87
97
  return null;
88
98
  }
89
99
  return parsed;
@@ -131,6 +141,7 @@ var init_config = __esm({
131
141
  anthropic: "claude-sonnet-4-6",
132
142
  vertex: "claude-sonnet-4-6",
133
143
  openai: "gpt-5.4-mini",
144
+ minimax: "MiniMax-M2.7",
134
145
  cursor: "sonnet-4.6",
135
146
  "claude-cli": "default"
136
147
  };
@@ -142,7 +153,9 @@ var init_config = __esm({
142
153
  "gpt-5.4-mini": 1e6,
143
154
  "gpt-4o": 128e3,
144
155
  "gpt-4o-mini": 128e3,
145
- "sonnet-4.6": 2e5
156
+ "sonnet-4.6": 2e5,
157
+ "MiniMax-M2.7": 1e6,
158
+ "MiniMax-M2.7-highspeed": 1e6
146
159
  };
147
160
  DEFAULT_CONTEXT_WINDOW = 2e5;
148
161
  INPUT_BUDGET_FRACTION = 0.6;
@@ -152,6 +165,7 @@ var init_config = __esm({
152
165
  anthropic: "claude-haiku-4-5-20251001",
153
166
  vertex: "claude-haiku-4-5-20251001",
154
167
  openai: "gpt-5.4-mini",
168
+ minimax: "MiniMax-M2.7-highspeed",
155
169
  cursor: "gpt-5.3-codex-fast"
156
170
  };
157
171
  }
@@ -2345,17 +2359,20 @@ import OpenAI from "openai";
2345
2359
  var OpenAICompatProvider = class {
2346
2360
  client;
2347
2361
  defaultModel;
2348
- constructor(config) {
2362
+ temperature;
2363
+ constructor(config, options) {
2349
2364
  this.client = new OpenAI({
2350
2365
  apiKey: config.apiKey,
2351
2366
  ...config.baseUrl && { baseURL: config.baseUrl }
2352
2367
  });
2353
2368
  this.defaultModel = config.model;
2369
+ this.temperature = options?.temperature;
2354
2370
  }
2355
2371
  async call(options) {
2356
2372
  const response = await this.client.chat.completions.create({
2357
2373
  model: options.model || this.defaultModel,
2358
2374
  max_tokens: options.maxTokens || 4096,
2375
+ ...this.temperature !== void 0 && { temperature: this.temperature },
2359
2376
  messages: [
2360
2377
  { role: "system", content: options.system },
2361
2378
  { role: "user", content: options.prompt }
@@ -2390,6 +2407,7 @@ var OpenAICompatProvider = class {
2390
2407
  const stream = await this.client.chat.completions.create({
2391
2408
  model: options.model || this.defaultModel,
2392
2409
  max_tokens: options.maxTokens || 10240,
2410
+ ...this.temperature !== void 0 && { temperature: this.temperature },
2393
2411
  messages,
2394
2412
  stream: true
2395
2413
  });
@@ -2418,6 +2436,26 @@ var OpenAICompatProvider = class {
2418
2436
  }
2419
2437
  };
2420
2438
 
2439
+ // src/llm/minimax.ts
2440
+ var MINIMAX_DEFAULT_BASE_URL = "https://api.minimax.io/v1";
2441
+ var MiniMaxProvider = class extends OpenAICompatProvider {
2442
+ constructor(config) {
2443
+ super(
2444
+ {
2445
+ ...config,
2446
+ apiKey: config.apiKey ?? process.env.MINIMAX_API_KEY,
2447
+ baseUrl: config.baseUrl ?? process.env.MINIMAX_BASE_URL ?? MINIMAX_DEFAULT_BASE_URL
2448
+ },
2449
+ // MiniMax requires temperature in (0.0, 1.0] — 1.0 is the only safe default.
2450
+ { temperature: 1 }
2451
+ );
2452
+ }
2453
+ // MiniMax API doesn't support model listing; return known models statically.
2454
+ async listModels() {
2455
+ return ["MiniMax-M2.7", "MiniMax-M2.7-highspeed"];
2456
+ }
2457
+ };
2458
+
2421
2459
  // src/llm/cursor-acp.ts
2422
2460
  import { spawn, execSync as execSync5, execFileSync } from "child_process";
2423
2461
  import os3 from "os";
@@ -3054,6 +3092,7 @@ var KNOWN_MODELS = {
3054
3092
  "claude-opus-4-1-20250620"
3055
3093
  ],
3056
3094
  openai: ["gpt-5.4-mini", "gpt-4o", "gpt-4o-mini", "o3-mini"],
3095
+ minimax: ["MiniMax-M2.7", "MiniMax-M2.7-highspeed"],
3057
3096
  cursor: ["auto", "composer-1.5"],
3058
3097
  "claude-cli": []
3059
3098
  };
@@ -3157,6 +3196,8 @@ function createProvider(config) {
3157
3196
  return new VertexProvider(config);
3158
3197
  case "openai":
3159
3198
  return new OpenAICompatProvider(config);
3199
+ case "minimax":
3200
+ return new MiniMaxProvider(config);
3160
3201
  case "cursor": {
3161
3202
  if (!isCursorAgentAvailable()) {
3162
3203
  throw new Error(
@@ -3192,7 +3233,7 @@ function getProvider() {
3192
3233
  const config = loadConfig();
3193
3234
  if (!config) {
3194
3235
  throw new Error(
3195
- `No LLM provider configured. Set ANTHROPIC_API_KEY, OPENAI_API_KEY, or VERTEX_PROJECT_ID; or run \`${resolveCaliber()} config\` and choose Cursor or Claude Code; or set CALIBER_USE_CURSOR_SEAT=1 / CALIBER_USE_CLAUDE_CLI=1.`
3236
+ `No LLM provider configured. Set ANTHROPIC_API_KEY, OPENAI_API_KEY, MINIMAX_API_KEY, or VERTEX_PROJECT_ID; or run \`${resolveCaliber()} config\` and choose Cursor or Claude Code; or set CALIBER_USE_CURSOR_SEAT=1 / CALIBER_USE_CLAUDE_CLI=1.`
3196
3237
  );
3197
3238
  }
3198
3239
  cachedConfig = config;
@@ -3203,7 +3244,13 @@ function resetProvider() {
3203
3244
  cachedProvider = null;
3204
3245
  cachedConfig = null;
3205
3246
  }
3206
- var TRANSIENT_ERRORS = ["terminated", "ECONNRESET", "ETIMEDOUT", "socket hang up", "other side closed"];
3247
+ var TRANSIENT_ERRORS = [
3248
+ "terminated",
3249
+ "ECONNRESET",
3250
+ "ETIMEDOUT",
3251
+ "socket hang up",
3252
+ "other side closed"
3253
+ ];
3207
3254
  var MAX_RETRIES = 3;
3208
3255
  function isTransientError(error) {
3209
3256
  const msg = error.message.toLowerCase();
@@ -6578,7 +6625,8 @@ var PROVIDER_CHOICES = [
6578
6625
  { name: "Cursor \u2014 use your existing subscription (no API key)", value: "cursor" },
6579
6626
  { name: "Anthropic \u2014 API key from console.anthropic.com", value: "anthropic" },
6580
6627
  { name: "Google Vertex AI \u2014 Claude models via GCP", value: "vertex" },
6581
- { name: "OpenAI \u2014 or any OpenAI-compatible endpoint", value: "openai" }
6628
+ { name: "OpenAI \u2014 or any OpenAI-compatible endpoint", value: "openai" },
6629
+ { name: "MiniMax \u2014 API key from platform.minimax.io", value: "minimax" }
6582
6630
  ];
6583
6631
  async function runInteractiveProviderSetup(options) {
6584
6632
  const message = options?.selectMessage ?? "Select LLM provider";
@@ -6592,17 +6640,27 @@ async function runInteractiveProviderSetup(options) {
6592
6640
  config.model = "default";
6593
6641
  if (!isClaudeCliAvailable()) {
6594
6642
  console.log(chalk3.yellow("\n Claude Code CLI not found."));
6595
- console.log(chalk3.dim(" Install it: ") + chalk3.hex("#83D1EB")("npm install -g @anthropic-ai/claude-code"));
6596
- console.log(chalk3.dim(" Then run ") + chalk3.hex("#83D1EB")("claude") + chalk3.dim(" once to log in.\n"));
6643
+ console.log(
6644
+ chalk3.dim(" Install it: ") + chalk3.hex("#83D1EB")("npm install -g @anthropic-ai/claude-code")
6645
+ );
6646
+ console.log(
6647
+ chalk3.dim(" Then run ") + chalk3.hex("#83D1EB")("claude") + chalk3.dim(" once to log in.\n")
6648
+ );
6597
6649
  const proceed = await confirm({ message: "Continue anyway?" });
6598
6650
  if (!proceed) throw new Error("__exit__");
6599
6651
  } else if (!isClaudeCliLoggedIn()) {
6600
6652
  console.log(chalk3.yellow("\n Claude Code CLI found but not logged in."));
6601
- console.log(chalk3.dim(" Run ") + chalk3.hex("#83D1EB")("claude") + chalk3.dim(" once to log in.\n"));
6653
+ console.log(
6654
+ chalk3.dim(" Run ") + chalk3.hex("#83D1EB")("claude") + chalk3.dim(" once to log in.\n")
6655
+ );
6602
6656
  const proceed = await confirm({ message: "Continue anyway?" });
6603
6657
  if (!proceed) throw new Error("__exit__");
6604
6658
  } else {
6605
- console.log(chalk3.dim(" Run `claude` once and log in with your Pro/Max/Team account if you haven't."));
6659
+ console.log(
6660
+ chalk3.dim(
6661
+ " Run `claude` once and log in with your Pro/Max/Team account if you haven't."
6662
+ )
6663
+ );
6606
6664
  }
6607
6665
  break;
6608
6666
  }
@@ -6610,17 +6668,27 @@ async function runInteractiveProviderSetup(options) {
6610
6668
  if (!isCursorAgentAvailable()) {
6611
6669
  console.log(chalk3.yellow("\n Cursor Agent CLI not found."));
6612
6670
  if (IS_WINDOWS3) {
6613
- console.log(chalk3.dim(" Install it from: ") + chalk3.hex("#83D1EB")("https://www.cursor.com/downloads"));
6614
- console.log(chalk3.dim(" Then run ") + chalk3.hex("#83D1EB")("agent login") + chalk3.dim(" in PowerShell to authenticate.\n"));
6671
+ console.log(
6672
+ chalk3.dim(" Install it from: ") + chalk3.hex("#83D1EB")("https://www.cursor.com/downloads")
6673
+ );
6674
+ console.log(
6675
+ chalk3.dim(" Then run ") + chalk3.hex("#83D1EB")("agent login") + chalk3.dim(" in PowerShell to authenticate.\n")
6676
+ );
6615
6677
  } else {
6616
- console.log(chalk3.dim(" Install it: ") + chalk3.hex("#83D1EB")("curl https://cursor.com/install -fsS | bash"));
6617
- console.log(chalk3.dim(" Then run ") + chalk3.hex("#83D1EB")("agent login") + chalk3.dim(" to authenticate.\n"));
6678
+ console.log(
6679
+ chalk3.dim(" Install it: ") + chalk3.hex("#83D1EB")("curl https://cursor.com/install -fsS | bash")
6680
+ );
6681
+ console.log(
6682
+ chalk3.dim(" Then run ") + chalk3.hex("#83D1EB")("agent login") + chalk3.dim(" to authenticate.\n")
6683
+ );
6618
6684
  }
6619
6685
  const proceed = await confirm({ message: "Continue anyway?" });
6620
6686
  if (!proceed) throw new Error("__exit__");
6621
6687
  } else if (!isCursorLoggedIn()) {
6622
6688
  console.log(chalk3.yellow("\n Cursor Agent CLI found but not logged in."));
6623
- console.log(chalk3.dim(" Run ") + chalk3.hex("#83D1EB")("agent login") + chalk3.dim(" to authenticate.\n"));
6689
+ console.log(
6690
+ chalk3.dim(" Run ") + chalk3.hex("#83D1EB")("agent login") + chalk3.dim(" to authenticate.\n")
6691
+ );
6624
6692
  const proceed = await confirm({ message: "Continue anyway?" });
6625
6693
  if (!proceed) throw new Error("__exit__");
6626
6694
  }
@@ -6628,7 +6696,11 @@ async function runInteractiveProviderSetup(options) {
6628
6696
  break;
6629
6697
  }
6630
6698
  case "anthropic": {
6631
- console.log(chalk3.dim(" Get a key at https://console.anthropic.com (same account as Claude Pro/Team/Max)."));
6699
+ console.log(
6700
+ chalk3.dim(
6701
+ " Get a key at https://console.anthropic.com (same account as Claude Pro/Team/Max)."
6702
+ )
6703
+ );
6632
6704
  config.apiKey = await promptInput("Anthropic API key:");
6633
6705
  if (!config.apiKey) {
6634
6706
  console.log(chalk3.red("API key is required."));
@@ -6658,6 +6730,16 @@ async function runInteractiveProviderSetup(options) {
6658
6730
  config.model = await promptInput(`Model (default: ${DEFAULT_MODELS.openai}):`) || DEFAULT_MODELS.openai;
6659
6731
  break;
6660
6732
  }
6733
+ case "minimax": {
6734
+ console.log(chalk3.dim(" Get a key at https://platform.minimax.io"));
6735
+ config.apiKey = await promptInput("MiniMax API key:");
6736
+ if (!config.apiKey) {
6737
+ console.log(chalk3.red("API key is required."));
6738
+ throw new Error("__exit__");
6739
+ }
6740
+ config.model = await promptInput(`Model (default: ${DEFAULT_MODELS.minimax}):`) || DEFAULT_MODELS.minimax;
6741
+ break;
6742
+ }
6661
6743
  }
6662
6744
  writeConfigFile(config);
6663
6745
  return config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.43.0",
3
+ "version": "1.44.0",
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": {