claudekit-cli 3.39.3-dev.3 → 3.39.3-dev.5
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 +74 -52
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57245,7 +57245,7 @@ var package_default;
|
|
|
57245
57245
|
var init_package = __esm(() => {
|
|
57246
57246
|
package_default = {
|
|
57247
57247
|
name: "claudekit-cli",
|
|
57248
|
-
version: "3.39.3-dev.
|
|
57248
|
+
version: "3.39.3-dev.5",
|
|
57249
57249
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
57250
57250
|
type: "module",
|
|
57251
57251
|
repository: {
|
|
@@ -58522,7 +58522,7 @@ var init_github_client = __esm(() => {
|
|
|
58522
58522
|
});
|
|
58523
58523
|
|
|
58524
58524
|
// src/commands/update-cli.ts
|
|
58525
|
-
import { exec as exec2 } from "node:child_process";
|
|
58525
|
+
import { exec as exec2, spawn as spawn2 } from "node:child_process";
|
|
58526
58526
|
import { join as join47 } from "node:path";
|
|
58527
58527
|
import { promisify as promisify8 } from "node:util";
|
|
58528
58528
|
function getDefaultUpdateCliCommandDeps() {
|
|
@@ -58691,35 +58691,57 @@ async function promptKitUpdate(beta, yes, deps) {
|
|
|
58691
58691
|
} else {
|
|
58692
58692
|
logger.verbose("Auto-proceeding with kit update (--yes flag)");
|
|
58693
58693
|
}
|
|
58694
|
-
const
|
|
58695
|
-
|
|
58696
|
-
|
|
58697
|
-
|
|
58698
|
-
|
|
58699
|
-
|
|
58700
|
-
timeout: 300000
|
|
58701
|
-
});
|
|
58702
|
-
let newKitVersion;
|
|
58694
|
+
const useBeta = beta || isBetaInstalled;
|
|
58695
|
+
if (yes) {
|
|
58696
|
+
const initCmd = buildInitCommand(selection.isGlobal, selection.kit, useBeta, true);
|
|
58697
|
+
logger.info(`Running: ${initCmd}`);
|
|
58698
|
+
const s = (deps?.spinnerFn ?? de)();
|
|
58699
|
+
s.start("Updating ClaudeKit content...");
|
|
58703
58700
|
try {
|
|
58704
|
-
|
|
58705
|
-
|
|
58706
|
-
|
|
58707
|
-
|
|
58708
|
-
|
|
58709
|
-
|
|
58710
|
-
|
|
58711
|
-
|
|
58712
|
-
|
|
58713
|
-
|
|
58701
|
+
await execFn(initCmd, { timeout: 300000 });
|
|
58702
|
+
let newKitVersion;
|
|
58703
|
+
try {
|
|
58704
|
+
const claudeDir2 = selection.isGlobal ? setup.global.path : setup.project.path;
|
|
58705
|
+
const updatedMetadata = await readMetadataFile(claudeDir2);
|
|
58706
|
+
newKitVersion = selection.kit ? updatedMetadata?.kits?.[selection.kit]?.version : undefined;
|
|
58707
|
+
} catch {}
|
|
58708
|
+
if (selection.kit && kitVersion && newKitVersion && kitVersion !== newKitVersion) {
|
|
58709
|
+
s.stop(`Kit updated: ${selection.kit}@${kitVersion} -> ${newKitVersion}`);
|
|
58710
|
+
} else if (selection.kit && newKitVersion) {
|
|
58711
|
+
s.stop(`Kit content updated (${selection.kit}@${newKitVersion})`);
|
|
58712
|
+
} else {
|
|
58713
|
+
s.stop("Kit content updated");
|
|
58714
|
+
}
|
|
58715
|
+
} catch (error) {
|
|
58716
|
+
s.stop("Kit update finished");
|
|
58717
|
+
const errorMsg = error instanceof Error ? error.message : "unknown";
|
|
58718
|
+
if (errorMsg.includes("exit code") && !errorMsg.includes("exit code 0")) {
|
|
58719
|
+
logger.warning("Kit content update may have encountered issues");
|
|
58720
|
+
logger.verbose(`Error: ${errorMsg}`);
|
|
58721
|
+
} else {
|
|
58722
|
+
logger.verbose(`Init command completed: ${errorMsg}`);
|
|
58723
|
+
}
|
|
58714
58724
|
}
|
|
58715
|
-
}
|
|
58716
|
-
|
|
58717
|
-
|
|
58718
|
-
|
|
58725
|
+
} else {
|
|
58726
|
+
const args = ["init"];
|
|
58727
|
+
if (selection.isGlobal)
|
|
58728
|
+
args.push("-g");
|
|
58729
|
+
args.push("--install-skills");
|
|
58730
|
+
if (useBeta)
|
|
58731
|
+
args.push("--beta");
|
|
58732
|
+
const displayCmd = `ck ${args.join(" ")}`;
|
|
58733
|
+
logger.info(`Running: ${displayCmd}`);
|
|
58734
|
+
const spawnFn = deps?.spawnInitFn ?? ((spawnArgs) => new Promise((resolve13) => {
|
|
58735
|
+
const child = spawn2("ck", spawnArgs, { stdio: "inherit", shell: true });
|
|
58736
|
+
child.on("close", (code) => resolve13(code ?? 1));
|
|
58737
|
+
child.on("error", (err) => {
|
|
58738
|
+
logger.verbose(`Failed to spawn ck init: ${err.message}`);
|
|
58739
|
+
resolve13(1);
|
|
58740
|
+
});
|
|
58741
|
+
}));
|
|
58742
|
+
const exitCode = await spawnFn(args);
|
|
58743
|
+
if (exitCode !== 0) {
|
|
58719
58744
|
logger.warning("Kit content update may have encountered issues");
|
|
58720
|
-
logger.verbose(`Error: ${errorMsg}`);
|
|
58721
|
-
} else {
|
|
58722
|
-
logger.verbose(`Init command completed: ${errorMsg}`);
|
|
58723
58745
|
}
|
|
58724
58746
|
}
|
|
58725
58747
|
} catch (error) {
|
|
@@ -59280,7 +59302,7 @@ var init_version_checker = __esm(() => {
|
|
|
59280
59302
|
});
|
|
59281
59303
|
|
|
59282
59304
|
// src/domains/web-server/routes/system-routes.ts
|
|
59283
|
-
import { spawn as
|
|
59305
|
+
import { spawn as spawn3 } from "node:child_process";
|
|
59284
59306
|
import { existsSync as existsSync39 } from "node:fs";
|
|
59285
59307
|
import { readFile as readFile29 } from "node:fs/promises";
|
|
59286
59308
|
import { join as join49 } from "node:path";
|
|
@@ -59460,7 +59482,7 @@ function registerSystemRoutes(app) {
|
|
|
59460
59482
|
`);
|
|
59461
59483
|
}
|
|
59462
59484
|
logger.debug(`Spawning update command: ${commandLine}`);
|
|
59463
|
-
const childProcess4 =
|
|
59485
|
+
const childProcess4 = spawn3(commandLine, {
|
|
59464
59486
|
shell: true,
|
|
59465
59487
|
env: { ...process.env }
|
|
59466
59488
|
});
|
|
@@ -64495,11 +64517,11 @@ var require_picomatch2 = __commonJS((exports, module) => {
|
|
|
64495
64517
|
});
|
|
64496
64518
|
|
|
64497
64519
|
// src/services/package-installer/process-executor.ts
|
|
64498
|
-
import { exec as exec7, execFile as execFile7, spawn as
|
|
64520
|
+
import { exec as exec7, execFile as execFile7, spawn as spawn4 } from "node:child_process";
|
|
64499
64521
|
import { promisify as promisify13 } from "node:util";
|
|
64500
64522
|
function executeInteractiveScript(command, args, options2) {
|
|
64501
64523
|
return new Promise((resolve16, reject) => {
|
|
64502
|
-
const child =
|
|
64524
|
+
const child = spawn4(command, args, {
|
|
64503
64525
|
stdio: ["ignore", "inherit", "inherit"],
|
|
64504
64526
|
cwd: options2?.cwd,
|
|
64505
64527
|
env: options2?.env || process.env
|
|
@@ -67661,7 +67683,7 @@ var init_ownership_display = __esm(() => {
|
|
|
67661
67683
|
});
|
|
67662
67684
|
|
|
67663
67685
|
// src/commands/watch/phases/implementation-git-helpers.ts
|
|
67664
|
-
import { spawn as
|
|
67686
|
+
import { spawn as spawn5 } from "node:child_process";
|
|
67665
67687
|
async function getCurrentBranch(cwd2) {
|
|
67666
67688
|
const output2 = await spawnAndCollect("git", ["rev-parse", "--abbrev-ref", "HEAD"], cwd2);
|
|
67667
67689
|
return output2.trim() || "main";
|
|
@@ -67737,7 +67759,7 @@ async function restoreOriginalBranch(branchName, cwd2, issueNumber) {
|
|
|
67737
67759
|
}
|
|
67738
67760
|
function spawnAndCollect(command, args, cwd2) {
|
|
67739
67761
|
return new Promise((resolve32, reject) => {
|
|
67740
|
-
const child =
|
|
67762
|
+
const child = spawn5(command, args, { ...cwd2 && { cwd: cwd2 }, stdio: ["ignore", "pipe", "pipe"] });
|
|
67741
67763
|
const chunks = [];
|
|
67742
67764
|
const stderrChunks = [];
|
|
67743
67765
|
child.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
@@ -70338,8 +70360,8 @@ async function logsContent(options2) {
|
|
|
70338
70360
|
return;
|
|
70339
70361
|
}
|
|
70340
70362
|
if (options2.tail) {
|
|
70341
|
-
const { spawn:
|
|
70342
|
-
const tail =
|
|
70363
|
+
const { spawn: spawn11 } = await import("node:child_process");
|
|
70364
|
+
const tail = spawn11("tail", ["-f", logPath], { stdio: "inherit" });
|
|
70343
70365
|
process.on("SIGINT", () => {
|
|
70344
70366
|
tail.kill();
|
|
70345
70367
|
process.exit(0);
|
|
@@ -71822,7 +71844,7 @@ var init_help_colors = __esm(() => {
|
|
|
71822
71844
|
});
|
|
71823
71845
|
|
|
71824
71846
|
// src/domains/help/help-interactive.ts
|
|
71825
|
-
import { spawn as
|
|
71847
|
+
import { spawn as spawn11 } from "node:child_process";
|
|
71826
71848
|
import * as readline from "node:readline";
|
|
71827
71849
|
function getTerminalHeight() {
|
|
71828
71850
|
return process.stdout.rows || 24;
|
|
@@ -71857,7 +71879,7 @@ async function trySystemPager(content) {
|
|
|
71857
71879
|
const pagerCmd = process.env.PAGER || "less";
|
|
71858
71880
|
const pagerArgs = getPagerArgs(pagerCmd);
|
|
71859
71881
|
try {
|
|
71860
|
-
const pager =
|
|
71882
|
+
const pager = spawn11(pagerCmd, pagerArgs, {
|
|
71861
71883
|
stdio: ["pipe", process.stdout, process.stderr],
|
|
71862
71884
|
shell: false
|
|
71863
71885
|
});
|
|
@@ -96518,7 +96540,6 @@ async function handleFreshInstallation(claudeDir2, prompts) {
|
|
|
96518
96540
|
|
|
96519
96541
|
// src/commands/init/phases/selection-handler.ts
|
|
96520
96542
|
init_version_utils();
|
|
96521
|
-
init_claudekit_scanner();
|
|
96522
96543
|
init_logger();
|
|
96523
96544
|
init_path_resolver();
|
|
96524
96545
|
init_types3();
|
|
@@ -96776,9 +96797,10 @@ async function handleSelection(ctx) {
|
|
|
96776
96797
|
logger.info("Fetching available versions...");
|
|
96777
96798
|
let currentVersion = null;
|
|
96778
96799
|
try {
|
|
96779
|
-
const
|
|
96780
|
-
const
|
|
96781
|
-
|
|
96800
|
+
const prefix = PathResolver.getPathPrefix(ctx.options.global);
|
|
96801
|
+
const claudeDir2 = prefix ? join111(resolvedDir, prefix) : resolvedDir;
|
|
96802
|
+
const existingMetadata = await readManifest(claudeDir2);
|
|
96803
|
+
currentVersion = existingMetadata?.kits?.[kitType]?.version || null;
|
|
96782
96804
|
if (currentVersion) {
|
|
96783
96805
|
logger.debug(`Current installed version: ${currentVersion}`);
|
|
96784
96806
|
}
|
|
@@ -101203,15 +101225,15 @@ var import_picocolors39 = __toESM(require_picocolors(), 1);
|
|
|
101203
101225
|
// src/commands/watch/phases/implementation-runner.ts
|
|
101204
101226
|
init_logger();
|
|
101205
101227
|
init_implementation_git_helpers();
|
|
101206
|
-
import { spawn as
|
|
101228
|
+
import { spawn as spawn8 } from "node:child_process";
|
|
101207
101229
|
|
|
101208
101230
|
// src/commands/watch/phases/response-poster.ts
|
|
101209
101231
|
init_logger();
|
|
101210
|
-
import { spawn as
|
|
101232
|
+
import { spawn as spawn7 } from "node:child_process";
|
|
101211
101233
|
|
|
101212
101234
|
// src/commands/watch/phases/comment-poller.ts
|
|
101213
101235
|
init_logger();
|
|
101214
|
-
import { spawn as
|
|
101236
|
+
import { spawn as spawn6 } from "node:child_process";
|
|
101215
101237
|
var AI_DISCLAIMER = "<!-- ck-watch-bot -->";
|
|
101216
101238
|
async function pollComments(owner, repo, issueNumber, lastCommentId, maintainerLogins) {
|
|
101217
101239
|
const args = [
|
|
@@ -101267,7 +101289,7 @@ function getDisclaimerMarker() {
|
|
|
101267
101289
|
}
|
|
101268
101290
|
function spawnAndCollect2(command, args) {
|
|
101269
101291
|
return new Promise((resolve32, reject) => {
|
|
101270
|
-
const child =
|
|
101292
|
+
const child = spawn6(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
101271
101293
|
const chunks = [];
|
|
101272
101294
|
const stderrChunks = [];
|
|
101273
101295
|
child.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
@@ -101397,7 +101419,7 @@ async function postViaGh(owner, repo, issueNumber, body) {
|
|
|
101397
101419
|
"--body-file",
|
|
101398
101420
|
"-"
|
|
101399
101421
|
];
|
|
101400
|
-
const child =
|
|
101422
|
+
const child = spawn7("gh", args, { stdio: ["pipe", "pipe", "pipe"] });
|
|
101401
101423
|
const stderrChunks = [];
|
|
101402
101424
|
child.stderr.on("data", (chunk) => stderrChunks.push(chunk));
|
|
101403
101425
|
child.stdin.write(body);
|
|
@@ -101528,7 +101550,7 @@ After completing the implementation:
|
|
|
101528
101550
|
tools
|
|
101529
101551
|
];
|
|
101530
101552
|
await new Promise((resolve32, reject) => {
|
|
101531
|
-
const child =
|
|
101553
|
+
const child = spawn8("claude", args, { cwd: cwd2, stdio: ["pipe", "pipe", "pipe"], detached: false });
|
|
101532
101554
|
child.stdin.write(prompt);
|
|
101533
101555
|
child.stdin.end();
|
|
101534
101556
|
const stderrChunks = [];
|
|
@@ -101560,7 +101582,7 @@ After completing the implementation:
|
|
|
101560
101582
|
// src/commands/watch/phases/issue-poller.ts
|
|
101561
101583
|
init_logger();
|
|
101562
101584
|
init_zod();
|
|
101563
|
-
import { spawn as
|
|
101585
|
+
import { spawn as spawn9 } from "node:child_process";
|
|
101564
101586
|
|
|
101565
101587
|
// src/commands/watch/types.ts
|
|
101566
101588
|
init_zod();
|
|
@@ -101697,7 +101719,7 @@ function checkRateLimit2(processedThisHour, maxPerHour) {
|
|
|
101697
101719
|
}
|
|
101698
101720
|
function spawnAndCollect3(command, args) {
|
|
101699
101721
|
return new Promise((resolve32, reject) => {
|
|
101700
|
-
const child =
|
|
101722
|
+
const child = spawn9(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
101701
101723
|
const chunks = [];
|
|
101702
101724
|
const stderrChunks = [];
|
|
101703
101725
|
child.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
@@ -101723,7 +101745,7 @@ init_logger();
|
|
|
101723
101745
|
|
|
101724
101746
|
// src/commands/watch/phases/claude-invoker.ts
|
|
101725
101747
|
init_logger();
|
|
101726
|
-
import { spawn as
|
|
101748
|
+
import { spawn as spawn10 } from "node:child_process";
|
|
101727
101749
|
async function invokeClaude(options2) {
|
|
101728
101750
|
if (options2.dryRun) {
|
|
101729
101751
|
logger.info("[dry-run] Would invoke Claude with prompt");
|
|
@@ -101748,7 +101770,7 @@ async function invokeClaude(options2) {
|
|
|
101748
101770
|
"--allowedTools",
|
|
101749
101771
|
tools
|
|
101750
101772
|
];
|
|
101751
|
-
const child =
|
|
101773
|
+
const child = spawn10("claude", args, {
|
|
101752
101774
|
cwd: options2.cwd,
|
|
101753
101775
|
stdio: ["pipe", "pipe", "pipe"],
|
|
101754
101776
|
detached: false
|