claudekit-cli 3.25.0 → 3.26.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.
- package/dist/index.js +222 -58
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6297,7 +6297,7 @@ var require_jsonfile = __commonJS((exports, module) => {
|
|
|
6297
6297
|
return obj;
|
|
6298
6298
|
}
|
|
6299
6299
|
var readFile = universalify.fromPromise(_readFile);
|
|
6300
|
-
function
|
|
6300
|
+
function readFileSync4(file, options = {}) {
|
|
6301
6301
|
if (typeof options === "string") {
|
|
6302
6302
|
options = { encoding: options };
|
|
6303
6303
|
}
|
|
@@ -6329,7 +6329,7 @@ var require_jsonfile = __commonJS((exports, module) => {
|
|
|
6329
6329
|
}
|
|
6330
6330
|
module.exports = {
|
|
6331
6331
|
readFile,
|
|
6332
|
-
readFileSync:
|
|
6332
|
+
readFileSync: readFileSync4,
|
|
6333
6333
|
writeFile,
|
|
6334
6334
|
writeFileSync
|
|
6335
6335
|
};
|
|
@@ -8208,7 +8208,7 @@ var init_opencode_installer = __esm(() => {
|
|
|
8208
8208
|
var PARTIAL_INSTALL_VERSION = "partial", EXIT_CODE_CRITICAL_FAILURE = 1, EXIT_CODE_PARTIAL_SUCCESS = 2;
|
|
8209
8209
|
|
|
8210
8210
|
// src/services/package-installer/install-error-handler.ts
|
|
8211
|
-
import { existsSync as existsSync13, readFileSync as
|
|
8211
|
+
import { existsSync as existsSync13, readFileSync as readFileSync6, unlinkSync as unlinkSync2 } from "node:fs";
|
|
8212
8212
|
import { join as join21 } from "node:path";
|
|
8213
8213
|
function parseNameReason(str) {
|
|
8214
8214
|
const colonIndex = str.indexOf(":");
|
|
@@ -8225,7 +8225,7 @@ function displayInstallErrors(skillsDir) {
|
|
|
8225
8225
|
}
|
|
8226
8226
|
let summary;
|
|
8227
8227
|
try {
|
|
8228
|
-
summary = JSON.parse(
|
|
8228
|
+
summary = JSON.parse(readFileSync6(summaryPath, "utf-8"));
|
|
8229
8229
|
} catch (parseError) {
|
|
8230
8230
|
logger.error("Failed to parse error summary. File may be corrupted.");
|
|
8231
8231
|
logger.debug(`Parse error: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
|
|
@@ -17682,6 +17682,70 @@ class CheckRunner {
|
|
|
17682
17682
|
import { exec as exec4 } from "node:child_process";
|
|
17683
17683
|
import { promisify as promisify4 } from "node:util";
|
|
17684
17684
|
|
|
17685
|
+
// src/domains/github/gh-cli-utils.ts
|
|
17686
|
+
init_logger();
|
|
17687
|
+
import { readFileSync } from "node:fs";
|
|
17688
|
+
var MIN_GH_CLI_VERSION = "2.20.0";
|
|
17689
|
+
var GH_COMMAND_TIMEOUT_MS = 1e4;
|
|
17690
|
+
function compareVersions(a, b) {
|
|
17691
|
+
const partsA = a.split(".").map(Number);
|
|
17692
|
+
const partsB = b.split(".").map(Number);
|
|
17693
|
+
const maxLen = Math.max(partsA.length, partsB.length);
|
|
17694
|
+
for (let i = 0;i < maxLen; i++) {
|
|
17695
|
+
const numA = partsA[i] ?? 0;
|
|
17696
|
+
const numB = partsB[i] ?? 0;
|
|
17697
|
+
if (numA < numB)
|
|
17698
|
+
return -1;
|
|
17699
|
+
if (numA > numB)
|
|
17700
|
+
return 1;
|
|
17701
|
+
}
|
|
17702
|
+
return 0;
|
|
17703
|
+
}
|
|
17704
|
+
function isWSL() {
|
|
17705
|
+
if (process.platform !== "linux")
|
|
17706
|
+
return false;
|
|
17707
|
+
try {
|
|
17708
|
+
const release = readFileSync("/proc/version", "utf-8").toLowerCase();
|
|
17709
|
+
return release.includes("microsoft") || release.includes("wsl");
|
|
17710
|
+
} catch (error) {
|
|
17711
|
+
logger.debug(`WSL detection skipped: ${error instanceof Error ? error.message : "unknown error"}`);
|
|
17712
|
+
return false;
|
|
17713
|
+
}
|
|
17714
|
+
}
|
|
17715
|
+
function shouldSkipExpensiveOperations() {
|
|
17716
|
+
if (process.env.CK_TEST_HOME) {
|
|
17717
|
+
return false;
|
|
17718
|
+
}
|
|
17719
|
+
return process.env.CI === "true" || process.env.CI_SAFE_MODE === "true";
|
|
17720
|
+
}
|
|
17721
|
+
function getGhUpgradeInstructions(currentVersion) {
|
|
17722
|
+
const platform = process.platform;
|
|
17723
|
+
const wsl = isWSL();
|
|
17724
|
+
const lines = [];
|
|
17725
|
+
lines.push(`✗ GitHub CLI v${currentVersion} is outdated`);
|
|
17726
|
+
lines.push(` Minimum required: v${MIN_GH_CLI_VERSION}`);
|
|
17727
|
+
lines.push("");
|
|
17728
|
+
if (wsl) {
|
|
17729
|
+
lines.push("Upgrade GitHub CLI (WSL/Ubuntu):");
|
|
17730
|
+
lines.push(" curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg");
|
|
17731
|
+
lines.push(' echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null');
|
|
17732
|
+
lines.push(" sudo apt update && sudo apt install gh");
|
|
17733
|
+
} else if (platform === "darwin") {
|
|
17734
|
+
lines.push("Upgrade GitHub CLI:");
|
|
17735
|
+
lines.push(" brew upgrade gh");
|
|
17736
|
+
} else if (platform === "win32") {
|
|
17737
|
+
lines.push("Upgrade GitHub CLI:");
|
|
17738
|
+
lines.push(" winget upgrade GitHub.cli");
|
|
17739
|
+
} else {
|
|
17740
|
+
lines.push("Upgrade GitHub CLI:");
|
|
17741
|
+
lines.push(" sudo apt update && sudo apt upgrade gh");
|
|
17742
|
+
lines.push(" Or visit: https://cli.github.com");
|
|
17743
|
+
}
|
|
17744
|
+
lines.push("");
|
|
17745
|
+
lines.push("After upgrade: gh auth login -h github.com");
|
|
17746
|
+
return lines;
|
|
17747
|
+
}
|
|
17748
|
+
|
|
17685
17749
|
// src/services/package-installer/dependency-checker.ts
|
|
17686
17750
|
import { exec } from "node:child_process";
|
|
17687
17751
|
import { promisify } from "node:util";
|
|
@@ -17697,7 +17761,7 @@ function notFoundError(type, name, hint) {
|
|
|
17697
17761
|
// src/services/package-installer/dependency-checker.ts
|
|
17698
17762
|
init_logger();
|
|
17699
17763
|
var execAsync = promisify(exec);
|
|
17700
|
-
function
|
|
17764
|
+
function shouldSkipExpensiveOperations2() {
|
|
17701
17765
|
if (process.env.CK_TEST_HOME) {
|
|
17702
17766
|
return false;
|
|
17703
17767
|
}
|
|
@@ -17709,9 +17773,9 @@ function getOSInfo() {
|
|
|
17709
17773
|
const isWindows = platform === "win32";
|
|
17710
17774
|
const isMacOS = platform === "darwin";
|
|
17711
17775
|
const isLinux = platform === "linux";
|
|
17712
|
-
const
|
|
17776
|
+
const isWSL2 = isLinux && process.env.WSL_DISTRO_NAME !== undefined;
|
|
17713
17777
|
let details = `${platform}-${arch}`;
|
|
17714
|
-
if (
|
|
17778
|
+
if (isWSL2) {
|
|
17715
17779
|
details += ` (WSL: ${process.env.WSL_DISTRO_NAME})`;
|
|
17716
17780
|
}
|
|
17717
17781
|
return {
|
|
@@ -17720,7 +17784,7 @@ function getOSInfo() {
|
|
|
17720
17784
|
isWindows,
|
|
17721
17785
|
isMacOS,
|
|
17722
17786
|
isLinux,
|
|
17723
|
-
isWSL,
|
|
17787
|
+
isWSL: isWSL2,
|
|
17724
17788
|
details
|
|
17725
17789
|
};
|
|
17726
17790
|
}
|
|
@@ -17791,7 +17855,7 @@ var DEPENDENCIES = {
|
|
|
17791
17855
|
}
|
|
17792
17856
|
};
|
|
17793
17857
|
async function commandExists(command) {
|
|
17794
|
-
if (
|
|
17858
|
+
if (shouldSkipExpensiveOperations2()) {
|
|
17795
17859
|
const supportedCommands = ["node", "python", "python3", "pip", "pip3", "claude"];
|
|
17796
17860
|
return supportedCommands.includes(command);
|
|
17797
17861
|
}
|
|
@@ -17807,7 +17871,7 @@ async function commandExists(command) {
|
|
|
17807
17871
|
}
|
|
17808
17872
|
}
|
|
17809
17873
|
async function getCommandPath(command) {
|
|
17810
|
-
if (
|
|
17874
|
+
if (shouldSkipExpensiveOperations2()) {
|
|
17811
17875
|
const ciPath = getCICommandPath(command);
|
|
17812
17876
|
if (ciPath)
|
|
17813
17877
|
return ciPath;
|
|
@@ -17826,7 +17890,7 @@ async function getCommandPath(command) {
|
|
|
17826
17890
|
}
|
|
17827
17891
|
}
|
|
17828
17892
|
async function getCommandVersion(command, versionFlag, versionRegex) {
|
|
17829
|
-
if (
|
|
17893
|
+
if (shouldSkipExpensiveOperations2()) {
|
|
17830
17894
|
const mockVersions = {
|
|
17831
17895
|
npm: "10.0.0",
|
|
17832
17896
|
node: "20.0.0",
|
|
@@ -17852,7 +17916,7 @@ async function getCommandVersion(command, versionFlag, versionRegex) {
|
|
|
17852
17916
|
return null;
|
|
17853
17917
|
}
|
|
17854
17918
|
}
|
|
17855
|
-
function
|
|
17919
|
+
function compareVersions2(current, required) {
|
|
17856
17920
|
const parseCurrent = current.split(".").map((n) => Number.parseInt(n, 10));
|
|
17857
17921
|
const parseRequired = required.split(".").map((n) => Number.parseInt(n, 10));
|
|
17858
17922
|
for (let i = 0;i < 3; i++) {
|
|
@@ -17876,7 +17940,7 @@ async function checkDependency(config) {
|
|
|
17876
17940
|
let meetsRequirements = true;
|
|
17877
17941
|
let message;
|
|
17878
17942
|
if (config.minVersion && version) {
|
|
17879
|
-
meetsRequirements =
|
|
17943
|
+
meetsRequirements = compareVersions2(version, config.minVersion);
|
|
17880
17944
|
if (!meetsRequirements) {
|
|
17881
17945
|
message = `Version ${version} is below minimum ${config.minVersion}`;
|
|
17882
17946
|
}
|
|
@@ -18135,27 +18199,6 @@ async function installDependency(dependency, method) {
|
|
|
18135
18199
|
// src/domains/health-checks/system-checker.ts
|
|
18136
18200
|
init_logger();
|
|
18137
18201
|
var execAsync4 = promisify4(exec4);
|
|
18138
|
-
var MIN_GH_CLI_VERSION = "2.20.0";
|
|
18139
|
-
function compareVersions2(a, b) {
|
|
18140
|
-
const partsA = a.split(".").map(Number);
|
|
18141
|
-
const partsB = b.split(".").map(Number);
|
|
18142
|
-
const maxLen = Math.max(partsA.length, partsB.length);
|
|
18143
|
-
for (let i = 0;i < maxLen; i++) {
|
|
18144
|
-
const numA = partsA[i] ?? 0;
|
|
18145
|
-
const numB = partsB[i] ?? 0;
|
|
18146
|
-
if (numA < numB)
|
|
18147
|
-
return -1;
|
|
18148
|
-
if (numA > numB)
|
|
18149
|
-
return 1;
|
|
18150
|
-
}
|
|
18151
|
-
return 0;
|
|
18152
|
-
}
|
|
18153
|
-
function shouldSkipExpensiveOperations2() {
|
|
18154
|
-
if (process.env.CK_TEST_HOME) {
|
|
18155
|
-
return false;
|
|
18156
|
-
}
|
|
18157
|
-
return process.env.CI === "true" || process.env.CI_SAFE_MODE === "true";
|
|
18158
|
-
}
|
|
18159
18202
|
|
|
18160
18203
|
class SystemChecker {
|
|
18161
18204
|
group = "system";
|
|
@@ -18170,7 +18213,7 @@ class SystemChecker {
|
|
|
18170
18213
|
logger.verbose(`SystemChecker: Processing ${dep.name}`);
|
|
18171
18214
|
results.push(await this.mapDependencyToCheck(dep));
|
|
18172
18215
|
}
|
|
18173
|
-
if (!
|
|
18216
|
+
if (!shouldSkipExpensiveOperations()) {
|
|
18174
18217
|
logger.verbose("SystemChecker: Checking git");
|
|
18175
18218
|
results.push(await this.checkGit());
|
|
18176
18219
|
logger.verbose("SystemChecker: Checking GitHub CLI");
|
|
@@ -18292,7 +18335,7 @@ class SystemChecker {
|
|
|
18292
18335
|
const { stdout } = await execAsync4("gh --version");
|
|
18293
18336
|
const match = stdout.match(/(\d+\.\d+\.\d+)/);
|
|
18294
18337
|
const version = match?.[1];
|
|
18295
|
-
if (version &&
|
|
18338
|
+
if (version && compareVersions(version, MIN_GH_CLI_VERSION) < 0) {
|
|
18296
18339
|
return {
|
|
18297
18340
|
id: "gh-cli-version",
|
|
18298
18341
|
name: "GitHub CLI",
|
|
@@ -18370,18 +18413,18 @@ class SystemChecker {
|
|
|
18370
18413
|
import { join as join2 } from "node:path";
|
|
18371
18414
|
|
|
18372
18415
|
// src/shared/path-resolver.ts
|
|
18373
|
-
import { existsSync as existsSync2, readFileSync as
|
|
18416
|
+
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
18374
18417
|
import { homedir, platform } from "node:os";
|
|
18375
18418
|
import { join, normalize } from "node:path";
|
|
18376
|
-
function
|
|
18419
|
+
function isWSL2() {
|
|
18377
18420
|
try {
|
|
18378
|
-
return process.platform === "linux" && existsSync2("/proc/version") &&
|
|
18421
|
+
return process.platform === "linux" && existsSync2("/proc/version") && readFileSync3("/proc/version", "utf8").toLowerCase().includes("microsoft");
|
|
18379
18422
|
} catch {
|
|
18380
18423
|
return false;
|
|
18381
18424
|
}
|
|
18382
18425
|
}
|
|
18383
18426
|
function normalizeWSLPath(p) {
|
|
18384
|
-
if (!
|
|
18427
|
+
if (!isWSL2())
|
|
18385
18428
|
return p;
|
|
18386
18429
|
const windowsMatch = p.match(/^([A-Za-z]):(.*)/);
|
|
18387
18430
|
if (windowsMatch) {
|
|
@@ -18524,7 +18567,7 @@ class PathResolver {
|
|
|
18524
18567
|
return normalizeWSLPath(p);
|
|
18525
18568
|
}
|
|
18526
18569
|
static isWSL() {
|
|
18527
|
-
return
|
|
18570
|
+
return isWSL2();
|
|
18528
18571
|
}
|
|
18529
18572
|
static isAtHomeDirectory(cwd) {
|
|
18530
18573
|
const currentDir = normalize(cwd || process.cwd());
|
|
@@ -19170,7 +19213,7 @@ function checkClaudeMdFile(path, name, id) {
|
|
|
19170
19213
|
}
|
|
19171
19214
|
}
|
|
19172
19215
|
// src/domains/health-checks/checkers/active-plan-checker.ts
|
|
19173
|
-
import { existsSync as existsSync5, readFileSync as
|
|
19216
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
|
|
19174
19217
|
import { join as join5 } from "node:path";
|
|
19175
19218
|
function checkActivePlan(projectDir) {
|
|
19176
19219
|
const activePlanPath = join5(projectDir, ".claude", "active-plan");
|
|
@@ -19186,7 +19229,7 @@ function checkActivePlan(projectDir) {
|
|
|
19186
19229
|
};
|
|
19187
19230
|
}
|
|
19188
19231
|
try {
|
|
19189
|
-
const targetPath =
|
|
19232
|
+
const targetPath = readFileSync4(activePlanPath, "utf-8").trim();
|
|
19190
19233
|
const fullPath = join5(projectDir, targetPath);
|
|
19191
19234
|
if (!existsSync5(fullPath)) {
|
|
19192
19235
|
return {
|
|
@@ -21547,7 +21590,7 @@ class AutoHealer {
|
|
|
21547
21590
|
}
|
|
21548
21591
|
// src/domains/health-checks/report-generator.ts
|
|
21549
21592
|
import { execSync as execSync4, spawnSync } from "node:child_process";
|
|
21550
|
-
import { readFileSync as
|
|
21593
|
+
import { readFileSync as readFileSync5, unlinkSync, writeFileSync } from "node:fs";
|
|
21551
21594
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
21552
21595
|
import { dirname as dirname2, join as join16 } from "node:path";
|
|
21553
21596
|
import { fileURLToPath } from "node:url";
|
|
@@ -21558,7 +21601,7 @@ function getCliVersion() {
|
|
|
21558
21601
|
try {
|
|
21559
21602
|
const __dirname2 = dirname2(fileURLToPath(import.meta.url));
|
|
21560
21603
|
const pkgPath = join16(__dirname2, "../../../package.json");
|
|
21561
|
-
const pkg = JSON.parse(
|
|
21604
|
+
const pkg = JSON.parse(readFileSync5(pkgPath, "utf-8"));
|
|
21562
21605
|
return pkg.version || "unknown";
|
|
21563
21606
|
} catch (err) {
|
|
21564
21607
|
logger.debug(`Failed to read CLI version: ${err}`);
|
|
@@ -40314,6 +40357,105 @@ async function detectAccessibleKits() {
|
|
|
40314
40357
|
return accessible;
|
|
40315
40358
|
}
|
|
40316
40359
|
|
|
40360
|
+
// src/domains/github/preflight-checker.ts
|
|
40361
|
+
init_logger();
|
|
40362
|
+
import { exec as exec7 } from "node:child_process";
|
|
40363
|
+
import { promisify as promisify7 } from "node:util";
|
|
40364
|
+
var execAsync7 = promisify7(exec7);
|
|
40365
|
+
function createSuccessfulPreflightResult() {
|
|
40366
|
+
return {
|
|
40367
|
+
success: true,
|
|
40368
|
+
ghInstalled: true,
|
|
40369
|
+
ghVersion: MIN_GH_CLI_VERSION,
|
|
40370
|
+
ghVersionOk: true,
|
|
40371
|
+
ghAuthenticated: true,
|
|
40372
|
+
errorLines: []
|
|
40373
|
+
};
|
|
40374
|
+
}
|
|
40375
|
+
function isTimeoutError(error) {
|
|
40376
|
+
if (error instanceof Error) {
|
|
40377
|
+
const msg = error.message.toLowerCase();
|
|
40378
|
+
return msg.includes("timeout") || msg.includes("timed out") || msg.includes("etimedout");
|
|
40379
|
+
}
|
|
40380
|
+
return false;
|
|
40381
|
+
}
|
|
40382
|
+
async function runPreflightChecks() {
|
|
40383
|
+
logger.debug("Running GitHub CLI pre-flight checks");
|
|
40384
|
+
if (shouldSkipExpensiveOperations()) {
|
|
40385
|
+
logger.debug("Skipping preflight checks in test/CI environment");
|
|
40386
|
+
return createSuccessfulPreflightResult();
|
|
40387
|
+
}
|
|
40388
|
+
const result = {
|
|
40389
|
+
success: false,
|
|
40390
|
+
ghInstalled: false,
|
|
40391
|
+
ghVersion: null,
|
|
40392
|
+
ghVersionOk: false,
|
|
40393
|
+
ghAuthenticated: false,
|
|
40394
|
+
errorLines: []
|
|
40395
|
+
};
|
|
40396
|
+
try {
|
|
40397
|
+
const { stdout: stdout2 } = await execAsync7("gh --version", { timeout: GH_COMMAND_TIMEOUT_MS });
|
|
40398
|
+
const match2 = stdout2.match(/(\d+\.\d+\.\d+)/);
|
|
40399
|
+
if (!match2) {
|
|
40400
|
+
logger.debug(`GitHub CLI version not detected from output: ${stdout2.trim()}`);
|
|
40401
|
+
result.ghInstalled = true;
|
|
40402
|
+
result.errorLines.push("✗ GitHub CLI installed but version could not be detected");
|
|
40403
|
+
result.errorLines.push(` Output: ${stdout2.trim().slice(0, 100)}`);
|
|
40404
|
+
result.errorLines.push(" Try running: gh --version");
|
|
40405
|
+
return result;
|
|
40406
|
+
}
|
|
40407
|
+
result.ghVersion = match2[1];
|
|
40408
|
+
result.ghInstalled = true;
|
|
40409
|
+
logger.debug(`GitHub CLI detected: v${result.ghVersion}`);
|
|
40410
|
+
} catch (error) {
|
|
40411
|
+
if (isTimeoutError(error)) {
|
|
40412
|
+
logger.debug("GitHub CLI check timed out");
|
|
40413
|
+
result.errorLines.push("✗ GitHub CLI check timed out");
|
|
40414
|
+
result.errorLines.push(" This may indicate a slow system or network issue");
|
|
40415
|
+
result.errorLines.push(" Try running: gh --version");
|
|
40416
|
+
} else {
|
|
40417
|
+
logger.debug(`GitHub CLI not found: ${error instanceof Error ? error.message : "unknown error"}`);
|
|
40418
|
+
result.errorLines.push("✗ GitHub CLI not installed");
|
|
40419
|
+
result.errorLines.push(" Install from: https://cli.github.com");
|
|
40420
|
+
result.errorLines.push("");
|
|
40421
|
+
result.errorLines.push("After install: gh auth login -h github.com");
|
|
40422
|
+
}
|
|
40423
|
+
return result;
|
|
40424
|
+
}
|
|
40425
|
+
if (result.ghVersion) {
|
|
40426
|
+
const comparison = compareVersions(result.ghVersion, MIN_GH_CLI_VERSION);
|
|
40427
|
+
result.ghVersionOk = comparison >= 0;
|
|
40428
|
+
if (!result.ghVersionOk) {
|
|
40429
|
+
logger.debug(`GitHub CLI version ${result.ghVersion} is below minimum ${MIN_GH_CLI_VERSION}`);
|
|
40430
|
+
result.errorLines.push(...getGhUpgradeInstructions(result.ghVersion));
|
|
40431
|
+
return result;
|
|
40432
|
+
}
|
|
40433
|
+
}
|
|
40434
|
+
try {
|
|
40435
|
+
await execAsync7("gh auth status -h github.com", {
|
|
40436
|
+
timeout: GH_COMMAND_TIMEOUT_MS,
|
|
40437
|
+
env: { ...process.env, GH_NO_UPDATE_NOTIFIER: "1" }
|
|
40438
|
+
});
|
|
40439
|
+
result.ghAuthenticated = true;
|
|
40440
|
+
logger.debug("GitHub CLI authenticated for github.com");
|
|
40441
|
+
} catch (error) {
|
|
40442
|
+
if (isTimeoutError(error)) {
|
|
40443
|
+
logger.debug("GitHub CLI auth check timed out");
|
|
40444
|
+
result.errorLines.push("✗ GitHub CLI auth check timed out");
|
|
40445
|
+
result.errorLines.push(" This may indicate a network issue");
|
|
40446
|
+
result.errorLines.push(" Try running: gh auth status -h github.com");
|
|
40447
|
+
} else {
|
|
40448
|
+
logger.debug(`GitHub CLI not authenticated: ${error instanceof Error ? error.message : "unknown error"}`);
|
|
40449
|
+
result.errorLines.push("✗ GitHub CLI not authenticated");
|
|
40450
|
+
result.errorLines.push(" Run: gh auth login -h github.com");
|
|
40451
|
+
}
|
|
40452
|
+
return result;
|
|
40453
|
+
}
|
|
40454
|
+
result.success = true;
|
|
40455
|
+
logger.debug("All GitHub CLI pre-flight checks passed");
|
|
40456
|
+
return result;
|
|
40457
|
+
}
|
|
40458
|
+
|
|
40317
40459
|
// src/domains/installation/fresh-installer.ts
|
|
40318
40460
|
init_logger();
|
|
40319
40461
|
import { join as join65 } from "node:path";
|
|
@@ -40378,10 +40520,25 @@ async function handleSelection(ctx) {
|
|
|
40378
40520
|
const config = await ConfigManager.get();
|
|
40379
40521
|
let accessibleKits;
|
|
40380
40522
|
if (!ctx.options.useGit && !ctx.options.kitPath && !ctx.options.archive) {
|
|
40523
|
+
const preflight = await runPreflightChecks();
|
|
40524
|
+
if (!preflight.success) {
|
|
40525
|
+
for (const line of preflight.errorLines) {
|
|
40526
|
+
if (line.startsWith("✗")) {
|
|
40527
|
+
logger.error(line);
|
|
40528
|
+
} else {
|
|
40529
|
+
logger.info(line);
|
|
40530
|
+
}
|
|
40531
|
+
}
|
|
40532
|
+
logger.info("");
|
|
40533
|
+
logger.info("Full diagnostics: ck doctor");
|
|
40534
|
+
return { ...ctx, cancelled: true };
|
|
40535
|
+
}
|
|
40381
40536
|
accessibleKits = await detectAccessibleKits();
|
|
40382
40537
|
if (accessibleKits.length === 0) {
|
|
40383
|
-
logger.error("No ClaudeKit access found.");
|
|
40384
|
-
logger.info("
|
|
40538
|
+
logger.error("No ClaudeKit repository access found.");
|
|
40539
|
+
logger.info("Check email for GitHub invitation, or purchase at https://claudekit.cc");
|
|
40540
|
+
logger.info("");
|
|
40541
|
+
logger.info("Full diagnostics: ck doctor");
|
|
40385
40542
|
return { ...ctx, cancelled: true };
|
|
40386
40543
|
}
|
|
40387
40544
|
}
|
|
@@ -42401,9 +42558,9 @@ ${import_picocolors22.default.yellow("User modifications will be permanently del
|
|
|
42401
42558
|
}
|
|
42402
42559
|
}
|
|
42403
42560
|
// src/commands/update-cli.ts
|
|
42404
|
-
import { exec as
|
|
42561
|
+
import { exec as exec8 } from "node:child_process";
|
|
42405
42562
|
import { join as join75 } from "node:path";
|
|
42406
|
-
import { promisify as
|
|
42563
|
+
import { promisify as promisify8 } from "node:util";
|
|
42407
42564
|
|
|
42408
42565
|
// src/domains/github/npm-registry.ts
|
|
42409
42566
|
init_logger();
|
|
@@ -42549,7 +42706,7 @@ var import_fs_extra36 = __toESM(require_lib(), 1);
|
|
|
42549
42706
|
// package.json
|
|
42550
42707
|
var package_default = {
|
|
42551
42708
|
name: "claudekit-cli",
|
|
42552
|
-
version: "3.
|
|
42709
|
+
version: "3.26.0",
|
|
42553
42710
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
42554
42711
|
type: "module",
|
|
42555
42712
|
repository: {
|
|
@@ -42640,7 +42797,7 @@ var package_default = {
|
|
|
42640
42797
|
};
|
|
42641
42798
|
|
|
42642
42799
|
// src/commands/update-cli.ts
|
|
42643
|
-
var
|
|
42800
|
+
var execAsync8 = promisify8(exec8);
|
|
42644
42801
|
|
|
42645
42802
|
class CliUpdateError extends ClaudeKitError {
|
|
42646
42803
|
constructor(message) {
|
|
@@ -42660,6 +42817,11 @@ function buildInitCommand(isGlobal, kit, beta) {
|
|
|
42660
42817
|
parts.push("--beta");
|
|
42661
42818
|
return parts.join(" ");
|
|
42662
42819
|
}
|
|
42820
|
+
function isBetaVersion(version) {
|
|
42821
|
+
if (!version)
|
|
42822
|
+
return false;
|
|
42823
|
+
return /-(beta|alpha|rc)[.\d]/i.test(version);
|
|
42824
|
+
}
|
|
42663
42825
|
function selectKitForUpdate(params) {
|
|
42664
42826
|
const { hasLocal, hasGlobal, localKits, globalKits } = params;
|
|
42665
42827
|
const hasLocalKit = localKits.length > 0 || hasLocal;
|
|
@@ -42723,7 +42885,9 @@ async function promptKitUpdate(beta) {
|
|
|
42723
42885
|
logger.verbose("No ClaudeKit installations detected, skipping kit update prompt");
|
|
42724
42886
|
return;
|
|
42725
42887
|
}
|
|
42726
|
-
const
|
|
42888
|
+
const kitVersion = selection.kit ? selection.isGlobal ? globalMetadata?.kits?.[selection.kit]?.version : localMetadata?.kits?.[selection.kit]?.version : undefined;
|
|
42889
|
+
const isBetaInstalled = isBetaVersion(kitVersion);
|
|
42890
|
+
const initCmd = buildInitCommand(selection.isGlobal, selection.kit, beta || isBetaInstalled);
|
|
42727
42891
|
const promptMessage = selection.promptMessage;
|
|
42728
42892
|
logger.info("");
|
|
42729
42893
|
const shouldUpdate = await se({
|
|
@@ -42737,7 +42901,7 @@ async function promptKitUpdate(beta) {
|
|
|
42737
42901
|
const s = de();
|
|
42738
42902
|
s.start("Updating ClaudeKit content...");
|
|
42739
42903
|
try {
|
|
42740
|
-
await
|
|
42904
|
+
await execAsync8(initCmd, {
|
|
42741
42905
|
timeout: 300000
|
|
42742
42906
|
});
|
|
42743
42907
|
s.stop("Kit content updated");
|
|
@@ -42827,7 +42991,7 @@ Run 'ck update' to install`, "Update Check");
|
|
|
42827
42991
|
logger.info(`Running: ${updateCmd}`);
|
|
42828
42992
|
s.start("Updating CLI...");
|
|
42829
42993
|
try {
|
|
42830
|
-
await
|
|
42994
|
+
await execAsync8(updateCmd, {
|
|
42831
42995
|
timeout: 120000
|
|
42832
42996
|
});
|
|
42833
42997
|
s.stop("Update completed");
|
|
@@ -42845,7 +43009,7 @@ Manual update: ${updateCmd}`);
|
|
|
42845
43009
|
}
|
|
42846
43010
|
s.start("Verifying installation...");
|
|
42847
43011
|
try {
|
|
42848
|
-
const { stdout: stdout2 } = await
|
|
43012
|
+
const { stdout: stdout2 } = await execAsync8("ck --version", { timeout: 5000 });
|
|
42849
43013
|
const newVersionMatch = stdout2.match(/CLI Version:\s*(\S+)/);
|
|
42850
43014
|
const newVersion = newVersionMatch ? newVersionMatch[1] : targetVersion;
|
|
42851
43015
|
s.stop(`Installed version: ${newVersion}`);
|
|
@@ -43020,7 +43184,7 @@ function registerCommands(cli) {
|
|
|
43020
43184
|
}
|
|
43021
43185
|
|
|
43022
43186
|
// src/cli/version-display.ts
|
|
43023
|
-
import { existsSync as existsSync20, readFileSync as
|
|
43187
|
+
import { existsSync as existsSync20, readFileSync as readFileSync7 } from "node:fs";
|
|
43024
43188
|
import { join as join77 } from "node:path";
|
|
43025
43189
|
|
|
43026
43190
|
// src/domains/versioning/checking/version-utils.ts
|
|
@@ -43327,7 +43491,7 @@ async function displayVersion() {
|
|
|
43327
43491
|
const isLocalSameAsGlobal = localMetadataPath === globalMetadataPath;
|
|
43328
43492
|
if (!isLocalSameAsGlobal && existsSync20(localMetadataPath)) {
|
|
43329
43493
|
try {
|
|
43330
|
-
const rawMetadata = JSON.parse(
|
|
43494
|
+
const rawMetadata = JSON.parse(readFileSync7(localMetadataPath, "utf-8"));
|
|
43331
43495
|
const metadata = MetadataSchema.parse(rawMetadata);
|
|
43332
43496
|
const kitsDisplay = formatInstalledKits(metadata);
|
|
43333
43497
|
if (kitsDisplay) {
|
|
@@ -43341,7 +43505,7 @@ async function displayVersion() {
|
|
|
43341
43505
|
}
|
|
43342
43506
|
if (existsSync20(globalMetadataPath)) {
|
|
43343
43507
|
try {
|
|
43344
|
-
const rawMetadata = JSON.parse(
|
|
43508
|
+
const rawMetadata = JSON.parse(readFileSync7(globalMetadataPath, "utf-8"));
|
|
43345
43509
|
const metadata = MetadataSchema.parse(rawMetadata);
|
|
43346
43510
|
const kitsDisplay = formatInstalledKits(metadata);
|
|
43347
43511
|
if (kitsDisplay) {
|