@rely-ai/caliber 1.40.1 → 1.40.2
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 +38 -3
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -2363,7 +2363,7 @@ import os3 from "os";
|
|
|
2363
2363
|
// src/llm/seat-based-errors.ts
|
|
2364
2364
|
init_resolve_caliber();
|
|
2365
2365
|
var ERROR_PATTERNS = [
|
|
2366
|
-
{ pattern: /not logged in|not authenticated|login required|unauthorized/i, message: "
|
|
2366
|
+
{ pattern: /not logged in|not authenticated|login required|unauthorized/i, message: "Not logged in. Run the login command for your provider to re-authenticate." },
|
|
2367
2367
|
{ pattern: /rate limit|too many requests|429/i, message: "Rate limit exceeded. Retrying..." },
|
|
2368
2368
|
{ pattern: /usage limit|out of usage|budget.*limit|limit.*reached/i, message: () => `Usage limit reached. Run \`${resolveCaliber()} config\` to switch models (e.g. auto or composer-1.5).` },
|
|
2369
2369
|
{ pattern: /model.*not found|invalid model|model.*unavailable/i, message: () => `The requested model is not available. Run \`${resolveCaliber()} config\` to select a different model.` }
|
|
@@ -2886,6 +2886,26 @@ function isClaudeCliAvailable() {
|
|
|
2886
2886
|
return false;
|
|
2887
2887
|
}
|
|
2888
2888
|
}
|
|
2889
|
+
var cachedLoggedIn = null;
|
|
2890
|
+
function isClaudeCliLoggedIn() {
|
|
2891
|
+
if (cachedLoggedIn !== null) return cachedLoggedIn;
|
|
2892
|
+
try {
|
|
2893
|
+
const result = execSync6(`${CLAUDE_CLI_BIN} auth status`, {
|
|
2894
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
2895
|
+
timeout: 5e3
|
|
2896
|
+
});
|
|
2897
|
+
const output = result.toString().trim();
|
|
2898
|
+
try {
|
|
2899
|
+
const status = JSON.parse(output);
|
|
2900
|
+
cachedLoggedIn = status.loggedIn === true;
|
|
2901
|
+
} catch {
|
|
2902
|
+
cachedLoggedIn = !output.toLowerCase().includes("not logged in");
|
|
2903
|
+
}
|
|
2904
|
+
} catch {
|
|
2905
|
+
cachedLoggedIn = false;
|
|
2906
|
+
}
|
|
2907
|
+
return cachedLoggedIn;
|
|
2908
|
+
}
|
|
2889
2909
|
|
|
2890
2910
|
// src/llm/model-recovery.ts
|
|
2891
2911
|
init_config();
|
|
@@ -3017,6 +3037,11 @@ function createProvider(config) {
|
|
|
3017
3037
|
"Cursor provider requires the Cursor Agent CLI. Install it from https://cursor.com/install then run `agent login`. Alternatively set ANTHROPIC_API_KEY or another provider."
|
|
3018
3038
|
);
|
|
3019
3039
|
}
|
|
3040
|
+
if (!isCursorLoggedIn()) {
|
|
3041
|
+
throw new Error(
|
|
3042
|
+
"Cursor Agent CLI is installed but not logged in. Run `agent login` in your terminal to authenticate, then retry."
|
|
3043
|
+
);
|
|
3044
|
+
}
|
|
3020
3045
|
return new CursorAcpProvider(config);
|
|
3021
3046
|
}
|
|
3022
3047
|
case "claude-cli": {
|
|
@@ -3025,6 +3050,11 @@ function createProvider(config) {
|
|
|
3025
3050
|
"Claude Code provider requires the Claude Code CLI. Install it from https://claude.ai/install (or run `claude` once and log in). Alternatively set ANTHROPIC_API_KEY or choose another provider."
|
|
3026
3051
|
);
|
|
3027
3052
|
}
|
|
3053
|
+
if (!isClaudeCliLoggedIn()) {
|
|
3054
|
+
throw new Error(
|
|
3055
|
+
"Claude Code CLI is installed but not logged in. Run `claude` in your terminal to log in, then retry."
|
|
3056
|
+
);
|
|
3057
|
+
}
|
|
3028
3058
|
return new ClaudeCliProvider(config);
|
|
3029
3059
|
}
|
|
3030
3060
|
default:
|
|
@@ -6302,6 +6332,11 @@ async function runInteractiveProviderSetup(options) {
|
|
|
6302
6332
|
console.log(chalk3.dim(" Then run ") + chalk3.hex("#83D1EB")("claude") + chalk3.dim(" once to log in.\n"));
|
|
6303
6333
|
const proceed = await confirm({ message: "Continue anyway?" });
|
|
6304
6334
|
if (!proceed) throw new Error("__exit__");
|
|
6335
|
+
} else if (!isClaudeCliLoggedIn()) {
|
|
6336
|
+
console.log(chalk3.yellow("\n Claude Code CLI found but not logged in."));
|
|
6337
|
+
console.log(chalk3.dim(" Run ") + chalk3.hex("#83D1EB")("claude") + chalk3.dim(" once to log in.\n"));
|
|
6338
|
+
const proceed = await confirm({ message: "Continue anyway?" });
|
|
6339
|
+
if (!proceed) throw new Error("__exit__");
|
|
6305
6340
|
} else {
|
|
6306
6341
|
console.log(chalk3.dim(" Run `claude` once and log in with your Pro/Max/Team account if you haven't."));
|
|
6307
6342
|
}
|
|
@@ -10155,7 +10190,7 @@ async function initCommand(options) {
|
|
|
10155
10190
|
console.log(title.bold(" Step 1/3 \u2014 Connect\n"));
|
|
10156
10191
|
let config = loadConfig();
|
|
10157
10192
|
if (!config && !options.autoApprove) {
|
|
10158
|
-
if (isClaudeCliAvailable()) {
|
|
10193
|
+
if (isClaudeCliAvailable() && isClaudeCliLoggedIn()) {
|
|
10159
10194
|
console.log(chalk14.dim(" Detected: Claude Code CLI (uses your Pro/Max/Team subscription)\n"));
|
|
10160
10195
|
const useIt = await confirm2({ message: "Use Claude Code as your LLM provider?" });
|
|
10161
10196
|
if (useIt) {
|
|
@@ -10175,7 +10210,7 @@ async function initCommand(options) {
|
|
|
10175
10210
|
}
|
|
10176
10211
|
if (!config) {
|
|
10177
10212
|
if (options.autoApprove) {
|
|
10178
|
-
if (isClaudeCliAvailable()) {
|
|
10213
|
+
if (isClaudeCliAvailable() && isClaudeCliLoggedIn()) {
|
|
10179
10214
|
const autoConfig = { provider: "claude-cli", model: "default" };
|
|
10180
10215
|
writeConfigFile(autoConfig);
|
|
10181
10216
|
config = autoConfig;
|
package/package.json
CHANGED