claude-code-infinite 1.0.25 → 1.0.27
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/README.md +72 -20
- package/dist/auto-update-runner.d.ts +13 -0
- package/dist/auto-update-runner.d.ts.map +1 -1
- package/dist/auto-update-runner.js +51 -7
- package/dist/auto-update-runner.js.map +1 -1
- package/dist/auto-update-setup.d.ts +19 -3
- package/dist/auto-update-setup.d.ts.map +1 -1
- package/dist/auto-update-setup.js +42 -16
- package/dist/auto-update-setup.js.map +1 -1
- package/dist/auto-update.d.ts +59 -6
- package/dist/auto-update.d.ts.map +1 -1
- package/dist/auto-update.js +207 -40
- package/dist/auto-update.js.map +1 -1
- package/dist/claude-auth.d.ts +55 -0
- package/dist/claude-auth.d.ts.map +1 -0
- package/dist/claude-auth.js +193 -0
- package/dist/claude-auth.js.map +1 -0
- package/dist/claude-env.d.ts +11 -4
- package/dist/claude-env.d.ts.map +1 -1
- package/dist/claude-env.js +11 -4
- package/dist/claude-env.js.map +1 -1
- package/dist/claude-locate.d.ts +80 -0
- package/dist/claude-locate.d.ts.map +1 -0
- package/dist/claude-locate.js +303 -0
- package/dist/claude-locate.js.map +1 -0
- package/dist/claude-plan-warning.d.ts +55 -0
- package/dist/claude-plan-warning.d.ts.map +1 -0
- package/dist/claude-plan-warning.js +95 -0
- package/dist/claude-plan-warning.js.map +1 -0
- package/dist/cli-lifecycle.d.ts +5 -0
- package/dist/cli-lifecycle.d.ts.map +1 -1
- package/dist/cli-lifecycle.js +13 -0
- package/dist/cli-lifecycle.js.map +1 -1
- package/dist/cli-main.js +124 -18
- package/dist/cli-main.js.map +1 -1
- package/dist/cli.js +7 -1
- package/dist/cli.js.map +1 -1
- package/dist/diagnostics-schema.d.ts +11 -1
- package/dist/diagnostics-schema.d.ts.map +1 -1
- package/dist/diagnostics-schema.js +38 -2
- package/dist/diagnostics-schema.js.map +1 -1
- package/dist/diagnostics.d.ts +10 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +26 -1
- package/dist/diagnostics.js.map +1 -1
- package/dist/memtree-mcp.d.ts.map +1 -1
- package/dist/memtree-mcp.js +8 -5
- package/dist/memtree-mcp.js.map +1 -1
- package/dist/notices.d.ts.map +1 -1
- package/dist/notices.js +3 -2
- package/dist/notices.js.map +1 -1
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +7 -0
- package/dist/proxy.js.map +1 -1
- package/dist/reqlog.d.ts +7 -0
- package/dist/reqlog.d.ts.map +1 -1
- package/dist/reqlog.js.map +1 -1
- package/dist/resume-repair.d.ts +2 -0
- package/dist/resume-repair.d.ts.map +1 -1
- package/dist/resume-repair.js +7 -5
- package/dist/resume-repair.js.map +1 -1
- package/dist/update-check.d.ts +2 -0
- package/dist/update-check.d.ts.map +1 -1
- package/dist/update-check.js.map +1 -1
- package/dist/update-lock.js +3 -1
- package/dist/update-lock.js.map +1 -1
- package/dist/update-wait.d.ts +25 -0
- package/dist/update-wait.d.ts.map +1 -0
- package/dist/update-wait.js +63 -0
- package/dist/update-wait.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding Claude Code to launch, however it was installed.
|
|
3
|
+
*
|
|
4
|
+
* ccc launches `claude` through cross-spawn, which finds it on PATH (with
|
|
5
|
+
* PATHEXT on Windows, so npm's `claude.cmd` shim and the native `claude.exe`
|
|
6
|
+
* both run). What it cannot do is find a Claude Code that is installed but not
|
|
7
|
+
* on this terminal's PATH. On Windows that is the common case: the native
|
|
8
|
+
* installer puts `claude.exe` in `%USERPROFILE%\.local\bin` and may only ask
|
|
9
|
+
* the user to add it to PATH, winget links it under
|
|
10
|
+
* `%LOCALAPPDATA%\Microsoft\WinGet\Links`, and any installer that does update
|
|
11
|
+
* the user's PATH (in the registry) leaves terminals already open without it.
|
|
12
|
+
* So after PATH this looks in the user's and machine's registry PATH, then in
|
|
13
|
+
* each installer's own location. On macOS and Linux it checks the native
|
|
14
|
+
* installer's `~/.local/bin`, the legacy `~/.claude/local` and Homebrew.
|
|
15
|
+
*
|
|
16
|
+
* Only paths are probed; nothing is run except `reg query` on Windows, and
|
|
17
|
+
* only when PATH has no `claude`.
|
|
18
|
+
*/
|
|
19
|
+
import { spawnSync } from "node:child_process";
|
|
20
|
+
import * as fs from "node:fs";
|
|
21
|
+
import * as os from "node:os";
|
|
22
|
+
import * as path from "node:path";
|
|
23
|
+
/** Where Claude Code was found, for diagnostics (an enum, never a path). */
|
|
24
|
+
export const CLAUDE_SOURCES = [
|
|
25
|
+
"path", "registry-path", "native", "npm", "winget", "homebrew", "legacy-local",
|
|
26
|
+
];
|
|
27
|
+
/** `claude_found` in diagnostics: a source, or `desktop_only` (only the desktop app is installed). */
|
|
28
|
+
export const CLAUDE_FOUND = [...CLAUDE_SOURCES, "desktop_only"];
|
|
29
|
+
/** Claude Code to launch, or null when it is not installed anywhere known. */
|
|
30
|
+
export function locateClaude(opts = {}) {
|
|
31
|
+
const platform = opts.platform ?? process.platform;
|
|
32
|
+
const env = opts.env ?? process.env;
|
|
33
|
+
const isExecutable = opts.isExecutable ?? defaultIsExecutable(platform);
|
|
34
|
+
const onPath = locateOnPath(pathDirs(env, platform), platform, env, isExecutable);
|
|
35
|
+
if (onPath)
|
|
36
|
+
return onPath;
|
|
37
|
+
const home = opts.homedir ?? os.homedir();
|
|
38
|
+
for (const candidate of candidates(platform, env, home, opts)) {
|
|
39
|
+
const file = candidate.dirs
|
|
40
|
+
.map((dir) => findOnPath("claude", [dir], platform, env, isExecutable))
|
|
41
|
+
.find((f) => f !== null && !isDesktopAppExe(f, platform));
|
|
42
|
+
if (file)
|
|
43
|
+
return { command: file, source: candidate.source, dir: pathFor(platform).dirname(file) };
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
/** The child's environment with `location.dir` first on PATH, when it was not on PATH. */
|
|
48
|
+
export function withClaudeOnPath(env, location, platform = process.platform) {
|
|
49
|
+
if (!location.dir)
|
|
50
|
+
return env;
|
|
51
|
+
const key = pathKey(env, platform);
|
|
52
|
+
const current = env[key];
|
|
53
|
+
const delimiter = platform === "win32" ? ";" : ":";
|
|
54
|
+
return { ...env, [key]: current ? `${location.dir}${delimiter}${current}` : location.dir };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether the Claude desktop app is installed (Windows, macOS). It runs Claude
|
|
58
|
+
* Code inside the app (its own copy, in the app's data folder, kept at the
|
|
59
|
+
* app's version), but puts no `claude` on the terminal's PATH, so ccc cannot
|
|
60
|
+
* use it. Only its own folders count, never `~/.claude`, which the CLI shares.
|
|
61
|
+
*/
|
|
62
|
+
export function claudeDesktopInstalled(opts = {}) {
|
|
63
|
+
const platform = opts.platform ?? process.platform;
|
|
64
|
+
const env = opts.env ?? process.env;
|
|
65
|
+
const home = opts.homedir ?? os.homedir();
|
|
66
|
+
const exists = opts.exists ?? fs.existsSync;
|
|
67
|
+
return desktopAppPaths(platform, env, home).some((p) => exists(p));
|
|
68
|
+
}
|
|
69
|
+
/** Said instead of claudeMissingText when only the desktop app is installed. */
|
|
70
|
+
export function claudeDesktopOnlyText(platform = process.platform) {
|
|
71
|
+
const install = platform === "win32"
|
|
72
|
+
? "`irm https://claude.ai/install.ps1 | iex` (in PowerShell)"
|
|
73
|
+
: "`curl -fsSL https://claude.ai/install.sh | bash`";
|
|
74
|
+
return "Found the Claude desktop app, but ccc needs Claude Code in the terminal: " +
|
|
75
|
+
`install it with ${install}, then open a new terminal and run \`claude\` once to sign in.`;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Said once, instead of launching, when Claude Code is not installed: the
|
|
79
|
+
* official install command for this OS and the sign-in step.
|
|
80
|
+
*/
|
|
81
|
+
export function claudeMissingText(platform = process.platform) {
|
|
82
|
+
const install = platform === "win32"
|
|
83
|
+
? " irm https://claude.ai/install.ps1 | iex (in PowerShell)"
|
|
84
|
+
: " curl -fsSL https://claude.ai/install.sh | bash";
|
|
85
|
+
return [
|
|
86
|
+
"Claude Code isn't installed. ccc runs Claude Code, so install it first:",
|
|
87
|
+
install,
|
|
88
|
+
"then open a new terminal, run `claude` once to sign in, and run ccc again.",
|
|
89
|
+
].join("\n");
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* One line, not blocking, when ccc starts somewhere that is not a project:
|
|
93
|
+
* C:\Windows\System32 (where an admin terminal opens) or the home folder.
|
|
94
|
+
*/
|
|
95
|
+
export function cwdHintText(cwd, opts = {}) {
|
|
96
|
+
const platform = opts.platform ?? process.platform;
|
|
97
|
+
const env = opts.env ?? process.env;
|
|
98
|
+
const p = pathFor(platform);
|
|
99
|
+
const same = (a, b) => {
|
|
100
|
+
const norm = (s) => p.resolve(s).replace(/[\\/]+$/, "");
|
|
101
|
+
return platform === "win32" || platform === "darwin"
|
|
102
|
+
? norm(a).toLowerCase() === norm(b).toLowerCase()
|
|
103
|
+
: norm(a) === norm(b);
|
|
104
|
+
};
|
|
105
|
+
const home = opts.homedir ?? os.homedir();
|
|
106
|
+
let where = null;
|
|
107
|
+
if (platform === "win32") {
|
|
108
|
+
const windows = env.SystemRoot || env.windir || "C:\\Windows";
|
|
109
|
+
if (["System32", "SysWOW64"].some((d) => same(cwd, p.join(windows, d))))
|
|
110
|
+
where = cwd;
|
|
111
|
+
}
|
|
112
|
+
if (where === null && home && same(cwd, home))
|
|
113
|
+
where = "your home folder";
|
|
114
|
+
if (where === null)
|
|
115
|
+
return null;
|
|
116
|
+
return `Tip: ccc is running in ${where}. Run it from your project folder (cd into it, then ccc) ` +
|
|
117
|
+
"so Claude Code works on that project.";
|
|
118
|
+
}
|
|
119
|
+
function candidates(platform, env, home, opts) {
|
|
120
|
+
if (platform === "win32")
|
|
121
|
+
return windowsCandidates(env, home, opts);
|
|
122
|
+
const p = path.posix;
|
|
123
|
+
return [
|
|
124
|
+
{ source: "native", dirs: [p.join(home, ".local", "bin")] },
|
|
125
|
+
{ source: "legacy-local", dirs: [p.join(home, ".claude", "local")] },
|
|
126
|
+
{ source: "homebrew", dirs: ["/opt/homebrew/bin", "/usr/local/bin", "/home/linuxbrew/.linuxbrew/bin"] },
|
|
127
|
+
{ source: "npm", dirs: [p.join(home, ".npm-global", "bin")] },
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
function windowsCandidates(env, home, opts) {
|
|
131
|
+
const w = path.win32;
|
|
132
|
+
const profile = envValue(env, "USERPROFILE") || home;
|
|
133
|
+
const appData = envValue(env, "APPDATA") || w.join(profile, "AppData", "Roaming");
|
|
134
|
+
const localAppData = envValue(env, "LOCALAPPDATA") || w.join(profile, "AppData", "Local");
|
|
135
|
+
const winget = w.join(localAppData, "Microsoft", "WinGet");
|
|
136
|
+
// The installers' own folders first (cheap stats); the registry (two spawns) last.
|
|
137
|
+
return [
|
|
138
|
+
{ source: "native", dirs: [w.join(profile, ".local", "bin")] },
|
|
139
|
+
{ source: "npm", dirs: [w.join(appData, "npm")] },
|
|
140
|
+
{ source: "winget", dirs: [w.join(winget, "Links"), ...wingetPackageDirs(winget, opts)] },
|
|
141
|
+
{ source: "registry-path", get dirs() { return registryDirs(env, opts); } },
|
|
142
|
+
];
|
|
143
|
+
}
|
|
144
|
+
/** The desktop app's install and data folders (Squirrel, Microsoft Store/MSIX, macOS). */
|
|
145
|
+
function desktopAppPaths(platform, env, home) {
|
|
146
|
+
if (platform === "darwin") {
|
|
147
|
+
return ["/Applications/Claude.app", path.posix.join(home, "Applications", "Claude.app")];
|
|
148
|
+
}
|
|
149
|
+
if (platform !== "win32")
|
|
150
|
+
return [];
|
|
151
|
+
const w = path.win32;
|
|
152
|
+
const profile = envValue(env, "USERPROFILE") || home;
|
|
153
|
+
const localAppData = envValue(env, "LOCALAPPDATA") || w.join(profile, "AppData", "Local");
|
|
154
|
+
// Not %APPDATA%\Claude: MCP guides have people create it by hand.
|
|
155
|
+
return [
|
|
156
|
+
w.join(localAppData, "AnthropicClaude"),
|
|
157
|
+
w.join(localAppData, "Packages", DESKTOP_MSIX_FAMILY),
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
/** The Microsoft Store / MSIX package family of the Claude desktop app. */
|
|
161
|
+
const DESKTOP_MSIX_FAMILY = "Claude_pzs8sxrjxfjjc";
|
|
162
|
+
/**
|
|
163
|
+
* The desktop app's own `claude.exe` (Squirrel: %LOCALAPPDATA%\AnthropicClaude
|
|
164
|
+
* and its app-<version> folders; MSIX: WindowsApps\Claude_<version>_<arch>__<id>).
|
|
165
|
+
* Launched as Claude Code it opens the app instead, so it is skipped. So is a
|
|
166
|
+
* Store app execution alias (%LOCALAPPDATA%\Microsoft\WindowsApps): none of the
|
|
167
|
+
* CLI's installers puts claude.exe there.
|
|
168
|
+
*/
|
|
169
|
+
function isDesktopAppExe(file, platform) {
|
|
170
|
+
if (platform !== "win32")
|
|
171
|
+
return false;
|
|
172
|
+
const dir = path.win32.dirname(file).toLowerCase();
|
|
173
|
+
return /\\anthropicclaude(\\app-[^\\]+)?$/.test(dir) ||
|
|
174
|
+
/\\windowsapps\\claude_[^\\]*__pzs8sxrjxfjjc(\\app)?$/.test(dir) ||
|
|
175
|
+
/\\microsoft\\windowsapps(\\claude_pzs8sxrjxfjjc)?$/.test(dir);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* `claude` on PATH, skipping the desktop app's exe. Spawned by name when it is
|
|
179
|
+
* the first `claude` on PATH (as before); by full path when the desktop app's
|
|
180
|
+
* comes first, since spawning by name would start the app.
|
|
181
|
+
*/
|
|
182
|
+
function locateOnPath(dirs, platform, env, isExecutable) {
|
|
183
|
+
let skipped = false;
|
|
184
|
+
for (const dir of dirs) {
|
|
185
|
+
const file = findOnPath("claude", [dir], platform, env, isExecutable);
|
|
186
|
+
if (!file)
|
|
187
|
+
continue;
|
|
188
|
+
if (isDesktopAppExe(file, platform)) {
|
|
189
|
+
skipped = true;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (!skipped)
|
|
193
|
+
return { command: "claude", source: "path" };
|
|
194
|
+
return { command: file, source: "path", dir: pathFor(platform).dirname(file) };
|
|
195
|
+
}
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
function registryDirs(env, opts) {
|
|
199
|
+
return (opts.registryPath ?? (() => readRegistryPath(env)))()
|
|
200
|
+
.flatMap((value) => splitPath(expandWindowsVars(value, env), "win32"));
|
|
201
|
+
}
|
|
202
|
+
/** winget's own folders for Claude Code (Anthropic.ClaudeCode_<source hash>). */
|
|
203
|
+
function wingetPackageDirs(winget, opts) {
|
|
204
|
+
const packages = path.win32.join(winget, "Packages");
|
|
205
|
+
const list = opts.listDir ?? defaultListDir;
|
|
206
|
+
return list(packages)
|
|
207
|
+
.filter((name) => /^Anthropic\.ClaudeCode/i.test(name))
|
|
208
|
+
.map((name) => path.win32.join(packages, name));
|
|
209
|
+
}
|
|
210
|
+
function findOnPath(name, dirs, platform, env, isExecutable) {
|
|
211
|
+
const p = pathFor(platform);
|
|
212
|
+
const exts = platform === "win32"
|
|
213
|
+
? (envValue(env, "PATHEXT") || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean)
|
|
214
|
+
: [""];
|
|
215
|
+
for (const dir of dirs) {
|
|
216
|
+
if (!dir)
|
|
217
|
+
continue;
|
|
218
|
+
for (const ext of exts) {
|
|
219
|
+
const file = p.join(dir, name + ext.toLowerCase());
|
|
220
|
+
if (isExecutable(file))
|
|
221
|
+
return file;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
function pathDirs(env, platform) {
|
|
227
|
+
return splitPath(env[pathKey(env, platform)] ?? "", platform);
|
|
228
|
+
}
|
|
229
|
+
function splitPath(value, platform) {
|
|
230
|
+
return value
|
|
231
|
+
.split(platform === "win32" ? ";" : ":")
|
|
232
|
+
.map((dir) => dir.trim().replace(/^"(.*)"$/, "$1"))
|
|
233
|
+
.filter(Boolean);
|
|
234
|
+
}
|
|
235
|
+
/** Windows env names are case-insensitive, but a copied env object is not. */
|
|
236
|
+
function pathKey(env, platform) {
|
|
237
|
+
if (platform !== "win32")
|
|
238
|
+
return "PATH";
|
|
239
|
+
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") ?? "Path";
|
|
240
|
+
}
|
|
241
|
+
function envValue(env, name) {
|
|
242
|
+
const key = Object.keys(env).find((k) => k.toUpperCase() === name.toUpperCase());
|
|
243
|
+
return key === undefined ? undefined : env[key];
|
|
244
|
+
}
|
|
245
|
+
/** `%USERPROFILE%\.local\bin` → its value; unknown names stay as written. */
|
|
246
|
+
export function expandWindowsVars(value, env) {
|
|
247
|
+
return value.replace(/%([^%;]+)%/g, (whole, name) => envValue(env, name) ?? whole);
|
|
248
|
+
}
|
|
249
|
+
/** The Path values in `reg query` output (REG_SZ or REG_EXPAND_SZ). */
|
|
250
|
+
export function parseRegQueryPath(output) {
|
|
251
|
+
const m = /^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(output);
|
|
252
|
+
return m ? m[1].trim() : null;
|
|
253
|
+
}
|
|
254
|
+
function readRegistryPath(env) {
|
|
255
|
+
// By full path: PATH is what may be broken here.
|
|
256
|
+
const root = envValue(env, "SystemRoot") || envValue(env, "windir") || "C:\\Windows";
|
|
257
|
+
const reg = path.win32.join(root, "System32", "reg.exe");
|
|
258
|
+
const keys = [
|
|
259
|
+
"HKCU\\Environment",
|
|
260
|
+
"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment",
|
|
261
|
+
];
|
|
262
|
+
const out = [];
|
|
263
|
+
for (const key of keys) {
|
|
264
|
+
try {
|
|
265
|
+
const result = spawnSync(reg, ["query", key, "/v", "Path"], {
|
|
266
|
+
encoding: "utf8", timeout: 2000, windowsHide: true,
|
|
267
|
+
});
|
|
268
|
+
const value = result.status === 0 ? parseRegQueryPath(result.stdout ?? "") : null;
|
|
269
|
+
if (value)
|
|
270
|
+
out.push(value);
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
// No reg.exe (or not Windows): nothing more to search.
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return out;
|
|
277
|
+
}
|
|
278
|
+
function pathFor(platform) {
|
|
279
|
+
return platform === "win32" ? path.win32 : path.posix;
|
|
280
|
+
}
|
|
281
|
+
function defaultIsExecutable(platform) {
|
|
282
|
+
return (file) => {
|
|
283
|
+
try {
|
|
284
|
+
if (!fs.statSync(file).isFile())
|
|
285
|
+
return false;
|
|
286
|
+
if (platform !== "win32")
|
|
287
|
+
fs.accessSync(file, fs.constants.X_OK);
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
catch {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
function defaultListDir(dir) {
|
|
296
|
+
try {
|
|
297
|
+
return fs.readdirSync(dir);
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
return [];
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=claude-locate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-locate.js","sourceRoot":"","sources":["../src/claude-locate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc;CACtE,CAAC;AAEX,sGAAsG;AACtG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,cAAc,EAAE,cAAc,CAAU,CAAC;AA8BzE,8EAA8E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,CAAC,CAAC,MAAM,EAAE;gBAAE,OAAO,KAAK,CAAC;YAC9C,IAAI,QAAQ,KAAK,OAAO;gBAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "no Claude plan" line. ccc runs the user's own Claude Code, so it only
|
|
3
|
+
* works well signed in with a Claude Pro or Max plan; on an API key every token
|
|
4
|
+
* is billed by Anthropic, and a key with no credit is refused outright
|
|
5
|
+
* (credit_balance_too_low, the most common first-prompt failure). The line is
|
|
6
|
+
* printed once before Claude Code starts when its sign-in is an API key or
|
|
7
|
+
* missing, and never for a subscription; the credit refusal gets the same text
|
|
8
|
+
* as ccc exits (claude-auth.ts creditNoticeText).
|
|
9
|
+
*
|
|
10
|
+
* Which sign-in Claude Code really used is only known from its requests'
|
|
11
|
+
* auth headers (claude-auth.ts claudeAuthFromHeaders). The last one seen is
|
|
12
|
+
* kept as a type name in ccc's config directory so the next launch decides on
|
|
13
|
+
* fact rather than on the config files' guess.
|
|
14
|
+
*/
|
|
15
|
+
import type { ClaudeAuthType, ClaudePlan } from "./claude-auth.js";
|
|
16
|
+
export declare const NO_PLAN_TEXT: string;
|
|
17
|
+
/** The file in ccc's config directory holding the last sign-in type Claude Code sent. */
|
|
18
|
+
export declare const SEEN_AUTH_FILE = "claude-auth-seen";
|
|
19
|
+
export interface PlanWarningInput {
|
|
20
|
+
/** From env and Claude Code's config files (claudeAuthFromConfig). */
|
|
21
|
+
auth: ClaudeAuthType;
|
|
22
|
+
/** From Claude Code's config files (claudePlanFromConfig). */
|
|
23
|
+
plan: ClaudePlan;
|
|
24
|
+
/** What Claude Code's own requests last showed, when known. */
|
|
25
|
+
seen?: ClaudeAuthType;
|
|
26
|
+
/** A claude.ai login is on file (claudeSubscriptionLogin), whatever else is set. */
|
|
27
|
+
subscriptionLogin?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* True when Claude Code is on an API key or not signed in, and nothing shows a
|
|
31
|
+
* paid plan. Any sign of a subscription wins, a stale API-key sighting
|
|
32
|
+
* included (the user may have run `/login` outside ccc since), so a subscriber
|
|
33
|
+
* is never warned.
|
|
34
|
+
*/
|
|
35
|
+
export declare function needsPlanWarning(input: PlanWarningInput): boolean;
|
|
36
|
+
/** `claude --version`, `claude doctor` and the like: no session, so no line. */
|
|
37
|
+
export declare function isInfoOnlyRun(args: readonly string[]): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether a credit_balance_too_low refusal gets the advice at exit: for an API
|
|
40
|
+
* key, or a request with no auth header ccc could read; not for a subscription
|
|
41
|
+
* token (extra usage spent) or a bearer ccc does not recognise.
|
|
42
|
+
*/
|
|
43
|
+
export declare function creditAdviceApplies(auth: ClaudeAuthType | undefined): boolean;
|
|
44
|
+
export declare function noPlanWarningText(color: boolean): string;
|
|
45
|
+
/**
|
|
46
|
+
* The line on stderr when it applies: stdout stays Claude Code's in print
|
|
47
|
+
* runs, and in a terminal stderr shows above the session just the same.
|
|
48
|
+
* Returns whether it was printed.
|
|
49
|
+
*/
|
|
50
|
+
export declare function printNoPlanWarning(input: PlanWarningInput, color: boolean): boolean;
|
|
51
|
+
/** The last sign-in type Claude Code's requests showed, or undefined. */
|
|
52
|
+
export declare function readSeenClaudeAuth(configDir: string): ClaudeAuthType | undefined;
|
|
53
|
+
/** Keep a subscription or API-key sign-in for the next launch; never throws. */
|
|
54
|
+
export declare function writeSeenClaudeAuth(configDir: string, auth: ClaudeAuthType): void;
|
|
55
|
+
//# sourceMappingURL=claude-plan-warning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-plan-warning.d.ts","sourceRoot":"","sources":["../src/claude-plan-warning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnE,eAAO,MAAM,YAAY,QAE4D,CAAC;AAEtF,yFAAyF;AACzF,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAKjD,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,IAAI,EAAE,cAAc,CAAC;IACrB,8DAA8D;IAC9D,IAAI,EAAE,UAAU,CAAC;IACjB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAOjE;AAQD,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAE7E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAExD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAInF;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAOhF;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAOjF"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "no Claude plan" line. ccc runs the user's own Claude Code, so it only
|
|
3
|
+
* works well signed in with a Claude Pro or Max plan; on an API key every token
|
|
4
|
+
* is billed by Anthropic, and a key with no credit is refused outright
|
|
5
|
+
* (credit_balance_too_low, the most common first-prompt failure). The line is
|
|
6
|
+
* printed once before Claude Code starts when its sign-in is an API key or
|
|
7
|
+
* missing, and never for a subscription; the credit refusal gets the same text
|
|
8
|
+
* as ccc exits (claude-auth.ts creditNoticeText).
|
|
9
|
+
*
|
|
10
|
+
* Which sign-in Claude Code really used is only known from its requests'
|
|
11
|
+
* auth headers (claude-auth.ts claudeAuthFromHeaders). The last one seen is
|
|
12
|
+
* kept as a type name in ccc's config directory so the next launch decides on
|
|
13
|
+
* fact rather than on the config files' guess.
|
|
14
|
+
*/
|
|
15
|
+
import * as fs from "node:fs";
|
|
16
|
+
import * as path from "node:path";
|
|
17
|
+
export const NO_PLAN_TEXT = "ccc needs Claude Code signed in with a Claude Pro or Max plan (run `claude`, then `/login`). " +
|
|
18
|
+
"With an API key you pay Anthropic per token, and a key with no credit won't work.";
|
|
19
|
+
/** The file in ccc's config directory holding the last sign-in type Claude Code sent. */
|
|
20
|
+
export const SEEN_AUTH_FILE = "claude-auth-seen";
|
|
21
|
+
const PAID_PLANS = ["pro", "max", "max_5x", "max_20x", "team", "enterprise"];
|
|
22
|
+
const SEEN_TYPES = ["subscription", "api_key"];
|
|
23
|
+
/**
|
|
24
|
+
* True when Claude Code is on an API key or not signed in, and nothing shows a
|
|
25
|
+
* paid plan. Any sign of a subscription wins, a stale API-key sighting
|
|
26
|
+
* included (the user may have run `/login` outside ccc since), so a subscriber
|
|
27
|
+
* is never warned.
|
|
28
|
+
*/
|
|
29
|
+
export function needsPlanWarning(input) {
|
|
30
|
+
const { auth, plan, seen } = input;
|
|
31
|
+
if (auth === "bedrock" || auth === "vertex" || auth === "foundry")
|
|
32
|
+
return false;
|
|
33
|
+
if (PAID_PLANS.includes(plan))
|
|
34
|
+
return false;
|
|
35
|
+
// Even a "free" plan on record: it may predate an upgrade.
|
|
36
|
+
if (auth === "subscription" || input.subscriptionLogin === true)
|
|
37
|
+
return false;
|
|
38
|
+
return seen !== "subscription";
|
|
39
|
+
}
|
|
40
|
+
const INFO_FLAGS = ["--version", "-v", "--help", "-h"];
|
|
41
|
+
/** Claude Code subcommands that start no session (`setup-token` makes a subscription token). */
|
|
42
|
+
const NO_SESSION_COMMANDS = [
|
|
43
|
+
"setup-token", "doctor", "update", "upgrade", "mcp", "install", "plugin", "plugins",
|
|
44
|
+
];
|
|
45
|
+
/** `claude --version`, `claude doctor` and the like: no session, so no line. */
|
|
46
|
+
export function isInfoOnlyRun(args) {
|
|
47
|
+
if (args.length > 0 && NO_SESSION_COMMANDS.includes(args[0]))
|
|
48
|
+
return true;
|
|
49
|
+
const end = args.indexOf("--");
|
|
50
|
+
return (end === -1 ? args : args.slice(0, end)).some((a) => INFO_FLAGS.includes(a));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Whether a credit_balance_too_low refusal gets the advice at exit: for an API
|
|
54
|
+
* key, or a request with no auth header ccc could read; not for a subscription
|
|
55
|
+
* token (extra usage spent) or a bearer ccc does not recognise.
|
|
56
|
+
*/
|
|
57
|
+
export function creditAdviceApplies(auth) {
|
|
58
|
+
return auth === "api_key" || auth === undefined;
|
|
59
|
+
}
|
|
60
|
+
export function noPlanWarningText(color) {
|
|
61
|
+
return color ? `\x1b[33m${NO_PLAN_TEXT}\x1b[39m` : NO_PLAN_TEXT;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The line on stderr when it applies: stdout stays Claude Code's in print
|
|
65
|
+
* runs, and in a terminal stderr shows above the session just the same.
|
|
66
|
+
* Returns whether it was printed.
|
|
67
|
+
*/
|
|
68
|
+
export function printNoPlanWarning(input, color) {
|
|
69
|
+
if (!needsPlanWarning(input))
|
|
70
|
+
return false;
|
|
71
|
+
process.stderr.write(`${noPlanWarningText(color)}\n`);
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
/** The last sign-in type Claude Code's requests showed, or undefined. */
|
|
75
|
+
export function readSeenClaudeAuth(configDir) {
|
|
76
|
+
try {
|
|
77
|
+
const value = fs.readFileSync(path.join(configDir, SEEN_AUTH_FILE), "utf8").trim();
|
|
78
|
+
return SEEN_TYPES.includes(value) ? value : undefined;
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** Keep a subscription or API-key sign-in for the next launch; never throws. */
|
|
85
|
+
export function writeSeenClaudeAuth(configDir, auth) {
|
|
86
|
+
if (!SEEN_TYPES.includes(auth))
|
|
87
|
+
return;
|
|
88
|
+
try {
|
|
89
|
+
fs.writeFileSync(path.join(configDir, SEEN_AUTH_FILE), `${auth}\n`, { mode: 0o600 });
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// Best effort: the next launch falls back to the config files.
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=claude-plan-warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-plan-warning.js","sourceRoot":"","sources":["../src/claude-plan-warning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,MAAM,CAAC,MAAM,YAAY,GACvB,+FAA+F;IAC/F,mFAAmF,CAAC;AAEtF,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEjD,MAAM,UAAU,GAA0B,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AACpG,MAAM,UAAU,GAA8B,CAAC,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AAM,CAAC;QACP,+DAA+D;IACjE,CAAC;AACH,CAAC"}
|
package/dist/cli-lifecycle.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ export type ShutdownSignal = "SIGINT" | "SIGTERM";
|
|
|
3
3
|
export declare function exitCodeForSignal(signal: NodeJS.Signals): number;
|
|
4
4
|
/** Preserve a child's numeric status or translate its terminating signal. */
|
|
5
5
|
export declare function exitCodeForChild(code: number | null, signal: NodeJS.Signals | null): number;
|
|
6
|
+
/**
|
|
7
|
+
* Claude Code's exit for diagnostics: the status (clamped by the schema as
|
|
8
|
+
* `code`, unclamped as `code_raw`), its signal, and how long it ran.
|
|
9
|
+
*/
|
|
10
|
+
export declare function claudeExitFields(code: number | null, signal: NodeJS.Signals | null, startedAt: number, now?: number): Record<string, number | string | undefined>;
|
|
6
11
|
export interface SignalShutdownActions {
|
|
7
12
|
forward(signal: ShutdownSignal): void;
|
|
8
13
|
shutdown(code: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-lifecycle.d.ts","sourceRoot":"","sources":["../src/cli-lifecycle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-lifecycle.d.ts","sourceRoot":"","sources":["../src/cli-lifecycle.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElD,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,CAGhE;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,GAC5B,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,EAC7B,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAmB,GACvB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAO7C;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,qBAAqB,GAC7B,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CASlC;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAkB,GACzD,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQjF"}
|
package/dist/cli-lifecycle.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { constants as osConstants } from "node:os";
|
|
2
|
+
import { signalName } from "./diagnostics-schema.js";
|
|
2
3
|
/** Conventional shell status for a process terminated by a POSIX signal. */
|
|
3
4
|
export function exitCodeForSignal(signal) {
|
|
4
5
|
const signalNumber = osConstants.signals[signal];
|
|
@@ -10,6 +11,18 @@ export function exitCodeForChild(code, signal) {
|
|
|
10
11
|
return code;
|
|
11
12
|
return signal === null ? 1 : exitCodeForSignal(signal);
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Claude Code's exit for diagnostics: the status (clamped by the schema as
|
|
16
|
+
* `code`, unclamped as `code_raw`), its signal, and how long it ran.
|
|
17
|
+
*/
|
|
18
|
+
export function claudeExitFields(code, signal, startedAt, now = Date.now()) {
|
|
19
|
+
return {
|
|
20
|
+
code: code ?? undefined,
|
|
21
|
+
code_raw: code ?? undefined,
|
|
22
|
+
signal: signalName(signal),
|
|
23
|
+
uptime_ms: Math.max(0, now - startedAt),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
13
26
|
/**
|
|
14
27
|
* First signal forwards to the child and starts graceful shutdown; a second
|
|
15
28
|
* signal forwards again and becomes an immediate conventional-status escape.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-lifecycle.js","sourceRoot":"","sources":["../src/cli-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-lifecycle.js","sourceRoot":"","sources":["../src/cli-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,4EAA4E;AAC5E,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,OAAO,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,gBAAgB,CAC9B,IAAmB,EACnB,MAA6B;IAE7B,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACzD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAmB,EACnB,MAA6B,EAC7B,SAAiB,EACjB,MAAc,IAAI,CAAC,GAAG,EAAE;IAExB,OAAO;QACL,I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