claudekit-cli 3.11.0 → 3.12.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 +381 -320
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13922,25 +13922,25 @@ class OwnershipDisplay {
|
|
|
13922
13922
|
static formatOwnership(ownership) {
|
|
13923
13923
|
switch (ownership) {
|
|
13924
13924
|
case "ck":
|
|
13925
|
-
return
|
|
13925
|
+
return import_picocolors13.default.blue("CK-owned");
|
|
13926
13926
|
case "user":
|
|
13927
|
-
return
|
|
13927
|
+
return import_picocolors13.default.green("User-created");
|
|
13928
13928
|
case "ck-modified":
|
|
13929
|
-
return
|
|
13929
|
+
return import_picocolors13.default.yellow("CK-modified");
|
|
13930
13930
|
default:
|
|
13931
|
-
return
|
|
13931
|
+
return import_picocolors13.default.gray("Unknown");
|
|
13932
13932
|
}
|
|
13933
13933
|
}
|
|
13934
13934
|
static formatAction(action) {
|
|
13935
13935
|
switch (action) {
|
|
13936
13936
|
case "delete":
|
|
13937
|
-
return
|
|
13937
|
+
return import_picocolors13.default.red("✖ DELETE");
|
|
13938
13938
|
case "preserve":
|
|
13939
|
-
return
|
|
13939
|
+
return import_picocolors13.default.green("✓ PRESERVE");
|
|
13940
13940
|
case "skip":
|
|
13941
|
-
return
|
|
13941
|
+
return import_picocolors13.default.gray("○ SKIP");
|
|
13942
13942
|
default:
|
|
13943
|
-
return
|
|
13943
|
+
return import_picocolors13.default.gray("? UNKNOWN");
|
|
13944
13944
|
}
|
|
13945
13945
|
}
|
|
13946
13946
|
static calculateSummary(results) {
|
|
@@ -13974,78 +13974,78 @@ class OwnershipDisplay {
|
|
|
13974
13974
|
}
|
|
13975
13975
|
static displaySummary(summary, title = "Ownership Summary") {
|
|
13976
13976
|
const lines = [
|
|
13977
|
-
`Total files: ${
|
|
13977
|
+
`Total files: ${import_picocolors13.default.bold(String(summary.totalFiles))}`,
|
|
13978
13978
|
"",
|
|
13979
13979
|
"By ownership:",
|
|
13980
|
-
` ${
|
|
13981
|
-
` ${
|
|
13982
|
-
` ${
|
|
13980
|
+
` ${import_picocolors13.default.blue("●")} CK-owned: ${summary.ckOwned}`,
|
|
13981
|
+
` ${import_picocolors13.default.green("●")} User-created: ${summary.userCreated}`,
|
|
13982
|
+
` ${import_picocolors13.default.yellow("●")} CK-modified: ${summary.ckModified}`,
|
|
13983
13983
|
"",
|
|
13984
13984
|
"Actions:",
|
|
13985
|
-
` ${
|
|
13986
|
-
` ${
|
|
13985
|
+
` ${import_picocolors13.default.red("✖")} To delete: ${summary.toDelete}`,
|
|
13986
|
+
` ${import_picocolors13.default.green("✓")} To preserve: ${summary.toPreserve}`
|
|
13987
13987
|
];
|
|
13988
13988
|
le(lines.join(`
|
|
13989
13989
|
`), title);
|
|
13990
13990
|
}
|
|
13991
13991
|
static displayOperationPreview(results, maxItems = 10) {
|
|
13992
13992
|
const summary = OwnershipDisplay.calculateSummary(results);
|
|
13993
|
-
f2.info(
|
|
13993
|
+
f2.info(import_picocolors13.default.bold("DRY RUN - Preview of changes:"));
|
|
13994
13994
|
console.log("");
|
|
13995
13995
|
const toDelete = results.filter((r2) => r2.action === "delete");
|
|
13996
13996
|
const toPreserve = results.filter((r2) => r2.action === "preserve");
|
|
13997
13997
|
if (toDelete.length > 0) {
|
|
13998
|
-
console.log(
|
|
13998
|
+
console.log(import_picocolors13.default.red(import_picocolors13.default.bold(`Files to DELETE (${toDelete.length}):`)));
|
|
13999
13999
|
const showDelete = toDelete.slice(0, maxItems);
|
|
14000
14000
|
for (const result of showDelete) {
|
|
14001
|
-
console.log(` ${
|
|
14001
|
+
console.log(` ${import_picocolors13.default.red("✖")} ${result.path}`);
|
|
14002
14002
|
}
|
|
14003
14003
|
if (toDelete.length > maxItems) {
|
|
14004
|
-
console.log(
|
|
14004
|
+
console.log(import_picocolors13.default.gray(` ... and ${toDelete.length - maxItems} more`));
|
|
14005
14005
|
}
|
|
14006
14006
|
console.log("");
|
|
14007
14007
|
}
|
|
14008
14008
|
if (toPreserve.length > 0) {
|
|
14009
|
-
console.log(
|
|
14009
|
+
console.log(import_picocolors13.default.green(import_picocolors13.default.bold(`Files to PRESERVE (${toPreserve.length}):`)));
|
|
14010
14010
|
const showPreserve = toPreserve.slice(0, maxItems);
|
|
14011
14011
|
for (const result of showPreserve) {
|
|
14012
|
-
const reason = result.reason ?
|
|
14013
|
-
console.log(` ${
|
|
14012
|
+
const reason = result.reason ? import_picocolors13.default.gray(` (${result.reason})`) : "";
|
|
14013
|
+
console.log(` ${import_picocolors13.default.green("✓")} ${result.path}${reason}`);
|
|
14014
14014
|
}
|
|
14015
14015
|
if (toPreserve.length > maxItems) {
|
|
14016
|
-
console.log(
|
|
14016
|
+
console.log(import_picocolors13.default.gray(` ... and ${toPreserve.length - maxItems} more`));
|
|
14017
14017
|
}
|
|
14018
14018
|
console.log("");
|
|
14019
14019
|
}
|
|
14020
14020
|
OwnershipDisplay.displaySummary(summary, "Preview Summary");
|
|
14021
|
-
f2.warn(
|
|
14021
|
+
f2.warn(import_picocolors13.default.yellow("No changes were made. Run without --dry-run to apply changes."));
|
|
14022
14022
|
}
|
|
14023
14023
|
static displayFile(path9, ownership, action, reason) {
|
|
14024
14024
|
const ownershipStr = OwnershipDisplay.formatOwnership(ownership);
|
|
14025
14025
|
const actionStr = OwnershipDisplay.formatAction(action);
|
|
14026
|
-
const reasonStr = reason ?
|
|
14026
|
+
const reasonStr = reason ? import_picocolors13.default.gray(` - ${reason}`) : "";
|
|
14027
14027
|
console.log(` ${actionStr} ${path9} [${ownershipStr}]${reasonStr}`);
|
|
14028
14028
|
}
|
|
14029
14029
|
static displayForceWarning() {
|
|
14030
|
-
f2.warn(`${
|
|
14031
|
-
${
|
|
14032
|
-
${
|
|
14030
|
+
f2.warn(`${import_picocolors13.default.yellow(import_picocolors13.default.bold("FORCE MODE ENABLED"))}
|
|
14031
|
+
${import_picocolors13.default.yellow("User modifications will be overwritten!")}
|
|
14032
|
+
${import_picocolors13.default.gray("Use --dry-run first to preview changes.")}`);
|
|
14033
14033
|
}
|
|
14034
14034
|
static displayLegacyWarning() {
|
|
14035
|
-
f2.warn(`${
|
|
14036
|
-
${
|
|
14037
|
-
${
|
|
14035
|
+
f2.warn(`${import_picocolors13.default.yellow(import_picocolors13.default.bold("Legacy Installation Detected"))}
|
|
14036
|
+
${import_picocolors13.default.yellow("No ownership metadata found.")}
|
|
14037
|
+
${import_picocolors13.default.gray("Running migration to enable ownership tracking...")}`);
|
|
14038
14038
|
}
|
|
14039
14039
|
static displayCompletionSummary(deleted, preserved) {
|
|
14040
|
-
const message = `${
|
|
14041
|
-
${
|
|
14040
|
+
const message = `${import_picocolors13.default.green(`✓ Deleted ${deleted} CK-owned file(s)`)}
|
|
14041
|
+
${import_picocolors13.default.blue(`✓ Preserved ${preserved} user/modified file(s)`)}`;
|
|
14042
14042
|
f2.success(message);
|
|
14043
14043
|
}
|
|
14044
14044
|
}
|
|
14045
|
-
var
|
|
14045
|
+
var import_picocolors13;
|
|
14046
14046
|
var init_ownership_display = __esm(() => {
|
|
14047
14047
|
init_dist2();
|
|
14048
|
-
|
|
14048
|
+
import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
14049
14049
|
});
|
|
14050
14050
|
|
|
14051
14051
|
// src/domains/help/help-commands.ts
|
|
@@ -14480,22 +14480,22 @@ function padEnd(text, width) {
|
|
|
14480
14480
|
const padding = Math.max(0, width - visibleLength);
|
|
14481
14481
|
return text + " ".repeat(padding);
|
|
14482
14482
|
}
|
|
14483
|
-
var
|
|
14483
|
+
var import_picocolors19, NO_COLOR, isColorSupported, identity = (text) => text, colors, defaultTheme;
|
|
14484
14484
|
var init_help_colors = __esm(() => {
|
|
14485
|
-
|
|
14485
|
+
import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
14486
14486
|
NO_COLOR = process.env.NO_COLOR !== undefined;
|
|
14487
14487
|
isColorSupported = !NO_COLOR && Boolean(process.stdout.isTTY);
|
|
14488
14488
|
colors = {
|
|
14489
|
-
banner: isColorSupported ?
|
|
14490
|
-
command: isColorSupported ?
|
|
14491
|
-
heading: isColorSupported ?
|
|
14492
|
-
flag: isColorSupported ?
|
|
14493
|
-
description: isColorSupported ?
|
|
14494
|
-
example: isColorSupported ?
|
|
14495
|
-
warning: isColorSupported ?
|
|
14496
|
-
error: isColorSupported ?
|
|
14497
|
-
muted: isColorSupported ?
|
|
14498
|
-
success: isColorSupported ?
|
|
14489
|
+
banner: isColorSupported ? import_picocolors19.default.cyan : identity,
|
|
14490
|
+
command: isColorSupported ? import_picocolors19.default.bold : identity,
|
|
14491
|
+
heading: isColorSupported ? import_picocolors19.default.yellow : identity,
|
|
14492
|
+
flag: isColorSupported ? import_picocolors19.default.green : identity,
|
|
14493
|
+
description: isColorSupported ? import_picocolors19.default.gray : identity,
|
|
14494
|
+
example: isColorSupported ? import_picocolors19.default.blue : identity,
|
|
14495
|
+
warning: isColorSupported ? import_picocolors19.default.yellow : identity,
|
|
14496
|
+
error: isColorSupported ? import_picocolors19.default.red : identity,
|
|
14497
|
+
muted: isColorSupported ? import_picocolors19.default.dim : identity,
|
|
14498
|
+
success: isColorSupported ? import_picocolors19.default.green : identity
|
|
14499
14499
|
};
|
|
14500
14500
|
defaultTheme = {
|
|
14501
14501
|
banner: colors.banner,
|
|
@@ -15466,7 +15466,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
15466
15466
|
// package.json
|
|
15467
15467
|
var package_default = {
|
|
15468
15468
|
name: "claudekit-cli",
|
|
15469
|
-
version: "3.
|
|
15469
|
+
version: "3.12.0",
|
|
15470
15470
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
15471
15471
|
type: "module",
|
|
15472
15472
|
repository: {
|
|
@@ -19412,6 +19412,64 @@ async function doctorCommand(options = {}) {
|
|
|
19412
19412
|
}
|
|
19413
19413
|
}
|
|
19414
19414
|
|
|
19415
|
+
// src/commands/easter-egg.ts
|
|
19416
|
+
init_logger();
|
|
19417
|
+
var import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
19418
|
+
var API_URL = "https://claudekit.cc/api/egg";
|
|
19419
|
+
function getRarityColor(rarity) {
|
|
19420
|
+
switch (rarity) {
|
|
19421
|
+
case "Legendary":
|
|
19422
|
+
return import_picocolors8.default.magenta;
|
|
19423
|
+
case "Epic":
|
|
19424
|
+
return import_picocolors8.default.yellow;
|
|
19425
|
+
case "Rare":
|
|
19426
|
+
return import_picocolors8.default.blue;
|
|
19427
|
+
case "Uncommon":
|
|
19428
|
+
return import_picocolors8.default.green;
|
|
19429
|
+
default:
|
|
19430
|
+
return import_picocolors8.default.gray;
|
|
19431
|
+
}
|
|
19432
|
+
}
|
|
19433
|
+
async function easterEggCommand() {
|
|
19434
|
+
intro("\uD83E\uDD5A Code Hunt 2025 - Easter Egg");
|
|
19435
|
+
try {
|
|
19436
|
+
console.log(import_picocolors8.default.dim(`
|
|
19437
|
+
Rolling for a discount code...
|
|
19438
|
+
`));
|
|
19439
|
+
const response = await fetch(API_URL);
|
|
19440
|
+
if (!response.ok) {
|
|
19441
|
+
if (response.status === 429) {
|
|
19442
|
+
console.log(import_picocolors8.default.yellow(" \uD83D\uDC30 Slow down! The eggs aren't going anywhere."));
|
|
19443
|
+
console.log(import_picocolors8.default.dim(` Wait a minute and try again.
|
|
19444
|
+
`));
|
|
19445
|
+
outro("\uD83E\uDD5A Rate limited");
|
|
19446
|
+
return;
|
|
19447
|
+
}
|
|
19448
|
+
throw new Error(`API returned ${response.status}`);
|
|
19449
|
+
}
|
|
19450
|
+
const data = await response.json();
|
|
19451
|
+
const rarityColor = getRarityColor(data.rarity);
|
|
19452
|
+
console.log(` ✨ ${import_picocolors8.default.bold(data.message)}`);
|
|
19453
|
+
console.log();
|
|
19454
|
+
console.log(` ${import_picocolors8.default.bold("Code:")} ${import_picocolors8.default.green(import_picocolors8.default.bold(data.code))}`);
|
|
19455
|
+
console.log(` ${import_picocolors8.default.bold("Discount:")} ${import_picocolors8.default.cyan(data.discount)} off`);
|
|
19456
|
+
console.log(` ${import_picocolors8.default.bold("Rarity:")} ${rarityColor(data.rarity)}`);
|
|
19457
|
+
console.log(` ${import_picocolors8.default.bold("Hint:")} ${import_picocolors8.default.dim(data.hint)}`);
|
|
19458
|
+
console.log();
|
|
19459
|
+
console.log(` ${import_picocolors8.default.dim("Redeem at:")} ${import_picocolors8.default.underline(data.checkout)}`);
|
|
19460
|
+
console.log(` ${import_picocolors8.default.dim("Expires:")} ${data.expires.split("T")[0]}`);
|
|
19461
|
+
console.log();
|
|
19462
|
+
outro("\uD83C\uDF84 Happy Holidays from ClaudeKit!");
|
|
19463
|
+
} catch (error) {
|
|
19464
|
+
logger.error(error instanceof Error ? error.message : "Failed to fetch easter egg");
|
|
19465
|
+
console.log(import_picocolors8.default.red(`
|
|
19466
|
+
Failed to connect to the egg API.`));
|
|
19467
|
+
console.log(import_picocolors8.default.dim(` Make sure you have internet access.
|
|
19468
|
+
`));
|
|
19469
|
+
process.exit(1);
|
|
19470
|
+
}
|
|
19471
|
+
}
|
|
19472
|
+
|
|
19415
19473
|
// src/commands/init.ts
|
|
19416
19474
|
import { join as join32, resolve as resolve6 } from "node:path";
|
|
19417
19475
|
|
|
@@ -19590,7 +19648,7 @@ import { TextDecoder } from "node:util";
|
|
|
19590
19648
|
// src/shared/progress-bar.ts
|
|
19591
19649
|
init_output_manager();
|
|
19592
19650
|
init_terminal_utils();
|
|
19593
|
-
var
|
|
19651
|
+
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
19594
19652
|
var BAR_CHARS = {
|
|
19595
19653
|
unicode: { filled: "█", empty: "░" },
|
|
19596
19654
|
ascii: { filled: "=", empty: "-" }
|
|
@@ -19648,7 +19706,7 @@ class ProgressBar {
|
|
|
19648
19706
|
this.clearLine();
|
|
19649
19707
|
if (message) {
|
|
19650
19708
|
const symbols = output.getSymbols();
|
|
19651
|
-
console.log(`${
|
|
19709
|
+
console.log(`${import_picocolors9.default.green(symbols.success)} ${message}`);
|
|
19652
19710
|
}
|
|
19653
19711
|
}
|
|
19654
19712
|
clearLine() {
|
|
@@ -21045,7 +21103,7 @@ function ora(options) {
|
|
|
21045
21103
|
|
|
21046
21104
|
// src/shared/safe-spinner.ts
|
|
21047
21105
|
init_output_manager();
|
|
21048
|
-
var
|
|
21106
|
+
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
21049
21107
|
var ASCII_SPINNER = {
|
|
21050
21108
|
interval: 100,
|
|
21051
21109
|
frames: ["-", "\\", "|", "/"]
|
|
@@ -21072,7 +21130,7 @@ function createSpinner(options) {
|
|
|
21072
21130
|
return spinner;
|
|
21073
21131
|
}
|
|
21074
21132
|
spinner.stopAndPersist({
|
|
21075
|
-
symbol:
|
|
21133
|
+
symbol: import_picocolors10.default.green(symbols.success),
|
|
21076
21134
|
text: text || spinner.text
|
|
21077
21135
|
});
|
|
21078
21136
|
return spinner;
|
|
@@ -21084,7 +21142,7 @@ function createSpinner(options) {
|
|
|
21084
21142
|
return spinner;
|
|
21085
21143
|
}
|
|
21086
21144
|
spinner.stopAndPersist({
|
|
21087
|
-
symbol:
|
|
21145
|
+
symbol: import_picocolors10.default.red(symbols.error),
|
|
21088
21146
|
text: text || spinner.text
|
|
21089
21147
|
});
|
|
21090
21148
|
return spinner;
|
|
@@ -28410,7 +28468,7 @@ Solutions:
|
|
|
28410
28468
|
}
|
|
28411
28469
|
|
|
28412
28470
|
// src/domains/installation/file-merger.ts
|
|
28413
|
-
import { dirname as dirname5, join as
|
|
28471
|
+
import { dirname as dirname5, join as join13, relative as relative3 } from "node:path";
|
|
28414
28472
|
|
|
28415
28473
|
// src/domains/config/settings-merger.ts
|
|
28416
28474
|
init_logger();
|
|
@@ -28619,7 +28677,7 @@ class SettingsMerger {
|
|
|
28619
28677
|
init_logger();
|
|
28620
28678
|
init_types2();
|
|
28621
28679
|
init_dist2();
|
|
28622
|
-
var
|
|
28680
|
+
var import_fs_extra4 = __toESM(require_lib(), 1);
|
|
28623
28681
|
var import_ignore2 = __toESM(require_ignore(), 1);
|
|
28624
28682
|
|
|
28625
28683
|
// node_modules/@isaacs/balanced-match/dist/esm/index.js
|
|
@@ -30065,6 +30123,156 @@ import { createReadStream } from "node:fs";
|
|
|
30065
30123
|
import { stat } from "node:fs/promises";
|
|
30066
30124
|
import { relative as relative2 } from "node:path";
|
|
30067
30125
|
|
|
30126
|
+
// src/domains/migration/metadata-migration.ts
|
|
30127
|
+
init_logger();
|
|
30128
|
+
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
30129
|
+
import { join as join12 } from "node:path";
|
|
30130
|
+
async function detectMetadataFormat(claudeDir) {
|
|
30131
|
+
const metadataPath = join12(claudeDir, "metadata.json");
|
|
30132
|
+
if (!await import_fs_extra3.pathExists(metadataPath)) {
|
|
30133
|
+
return { format: "none", metadata: null, detectedKit: null };
|
|
30134
|
+
}
|
|
30135
|
+
try {
|
|
30136
|
+
const content = await import_fs_extra3.readFile(metadataPath, "utf-8");
|
|
30137
|
+
const parsed = JSON.parse(content);
|
|
30138
|
+
if (parsed.kits && Object.keys(parsed.kits).length > 0) {
|
|
30139
|
+
const installedKits = Object.keys(parsed.kits);
|
|
30140
|
+
return {
|
|
30141
|
+
format: "multi-kit",
|
|
30142
|
+
metadata: parsed,
|
|
30143
|
+
detectedKit: installedKits[0] || null
|
|
30144
|
+
};
|
|
30145
|
+
}
|
|
30146
|
+
if (parsed.name || parsed.version || parsed.files) {
|
|
30147
|
+
let detectedKit = null;
|
|
30148
|
+
const nameToCheck = parsed.name || "";
|
|
30149
|
+
if (/\bengineer\b/i.test(nameToCheck)) {
|
|
30150
|
+
detectedKit = "engineer";
|
|
30151
|
+
} else if (/\bmarketing\b/i.test(nameToCheck)) {
|
|
30152
|
+
detectedKit = "marketing";
|
|
30153
|
+
} else {
|
|
30154
|
+
detectedKit = "engineer";
|
|
30155
|
+
}
|
|
30156
|
+
return { format: "legacy", metadata: parsed, detectedKit };
|
|
30157
|
+
}
|
|
30158
|
+
logger.warning("Metadata file exists but has unrecognized format (missing kits, name, version, or files)");
|
|
30159
|
+
return { format: "none", metadata: null, detectedKit: null };
|
|
30160
|
+
} catch (error) {
|
|
30161
|
+
logger.warning(`Failed to read metadata file (may be corrupted): ${error}`);
|
|
30162
|
+
return { format: "none", metadata: null, detectedKit: null };
|
|
30163
|
+
}
|
|
30164
|
+
}
|
|
30165
|
+
async function migrateToMultiKit(claudeDir) {
|
|
30166
|
+
const detection = await detectMetadataFormat(claudeDir);
|
|
30167
|
+
if (detection.format === "multi-kit") {
|
|
30168
|
+
return {
|
|
30169
|
+
success: true,
|
|
30170
|
+
migrated: false,
|
|
30171
|
+
fromFormat: "multi-kit",
|
|
30172
|
+
toFormat: "multi-kit"
|
|
30173
|
+
};
|
|
30174
|
+
}
|
|
30175
|
+
if (detection.format === "none") {
|
|
30176
|
+
return {
|
|
30177
|
+
success: true,
|
|
30178
|
+
migrated: false,
|
|
30179
|
+
fromFormat: "none",
|
|
30180
|
+
toFormat: "multi-kit"
|
|
30181
|
+
};
|
|
30182
|
+
}
|
|
30183
|
+
const metadataPath = join12(claudeDir, "metadata.json");
|
|
30184
|
+
const legacy = detection.metadata;
|
|
30185
|
+
if (!legacy) {
|
|
30186
|
+
return {
|
|
30187
|
+
success: false,
|
|
30188
|
+
migrated: false,
|
|
30189
|
+
fromFormat: "legacy",
|
|
30190
|
+
toFormat: "multi-kit",
|
|
30191
|
+
error: "Metadata exists but could not be read"
|
|
30192
|
+
};
|
|
30193
|
+
}
|
|
30194
|
+
const legacyKit = detection.detectedKit || "engineer";
|
|
30195
|
+
try {
|
|
30196
|
+
const kitMetadata = {
|
|
30197
|
+
version: legacy.version || "unknown",
|
|
30198
|
+
installedAt: legacy.installedAt || new Date().toISOString(),
|
|
30199
|
+
files: legacy.files || []
|
|
30200
|
+
};
|
|
30201
|
+
const multiKit = {
|
|
30202
|
+
kits: {
|
|
30203
|
+
[legacyKit]: kitMetadata
|
|
30204
|
+
},
|
|
30205
|
+
scope: legacy.scope,
|
|
30206
|
+
name: legacy.name,
|
|
30207
|
+
version: legacy.version,
|
|
30208
|
+
installedAt: legacy.installedAt,
|
|
30209
|
+
installedFiles: legacy.installedFiles,
|
|
30210
|
+
userConfigFiles: legacy.userConfigFiles,
|
|
30211
|
+
files: legacy.files
|
|
30212
|
+
};
|
|
30213
|
+
await import_fs_extra3.writeFile(metadataPath, JSON.stringify(multiKit, null, 2), "utf-8");
|
|
30214
|
+
logger.info(`Migrated metadata from legacy format to multi-kit (detected: ${legacyKit})`);
|
|
30215
|
+
return {
|
|
30216
|
+
success: true,
|
|
30217
|
+
migrated: true,
|
|
30218
|
+
fromFormat: "legacy",
|
|
30219
|
+
toFormat: "multi-kit"
|
|
30220
|
+
};
|
|
30221
|
+
} catch (error) {
|
|
30222
|
+
const errorMsg = error instanceof Error ? error.message : "Unknown error";
|
|
30223
|
+
logger.error(`Metadata migration failed: ${errorMsg}`);
|
|
30224
|
+
return {
|
|
30225
|
+
success: false,
|
|
30226
|
+
migrated: false,
|
|
30227
|
+
fromFormat: "legacy",
|
|
30228
|
+
toFormat: "multi-kit",
|
|
30229
|
+
error: errorMsg
|
|
30230
|
+
};
|
|
30231
|
+
}
|
|
30232
|
+
}
|
|
30233
|
+
function getKitMetadata(metadata, kit) {
|
|
30234
|
+
if (metadata.kits?.[kit]) {
|
|
30235
|
+
return metadata.kits[kit];
|
|
30236
|
+
}
|
|
30237
|
+
if (!metadata.kits && metadata.version) {
|
|
30238
|
+
return {
|
|
30239
|
+
version: metadata.version,
|
|
30240
|
+
installedAt: metadata.installedAt || "",
|
|
30241
|
+
files: metadata.files
|
|
30242
|
+
};
|
|
30243
|
+
}
|
|
30244
|
+
return null;
|
|
30245
|
+
}
|
|
30246
|
+
function getAllTrackedFiles(metadata) {
|
|
30247
|
+
if (metadata.kits) {
|
|
30248
|
+
const allFiles = [];
|
|
30249
|
+
for (const kit of Object.values(metadata.kits)) {
|
|
30250
|
+
if (kit.files) {
|
|
30251
|
+
allFiles.push(...kit.files);
|
|
30252
|
+
}
|
|
30253
|
+
}
|
|
30254
|
+
return allFiles;
|
|
30255
|
+
}
|
|
30256
|
+
return metadata.files || [];
|
|
30257
|
+
}
|
|
30258
|
+
function getInstalledKits(metadata) {
|
|
30259
|
+
if (metadata.kits) {
|
|
30260
|
+
return Object.keys(metadata.kits);
|
|
30261
|
+
}
|
|
30262
|
+
const nameToCheck = metadata.name || "";
|
|
30263
|
+
if (/\bengineer\b/i.test(nameToCheck)) {
|
|
30264
|
+
return ["engineer"];
|
|
30265
|
+
}
|
|
30266
|
+
if (/\bmarketing\b/i.test(nameToCheck)) {
|
|
30267
|
+
return ["marketing"];
|
|
30268
|
+
}
|
|
30269
|
+
if (metadata.version) {
|
|
30270
|
+
return ["engineer"];
|
|
30271
|
+
}
|
|
30272
|
+
return [];
|
|
30273
|
+
}
|
|
30274
|
+
|
|
30275
|
+
// src/services/file-operations/ownership-checker.ts
|
|
30068
30276
|
class OwnershipChecker {
|
|
30069
30277
|
static async calculateChecksum(filePath) {
|
|
30070
30278
|
return new Promise((resolve3, reject) => {
|
|
@@ -30086,11 +30294,12 @@ class OwnershipChecker {
|
|
|
30086
30294
|
} catch {
|
|
30087
30295
|
return { path: filePath, ownership: "user", exists: false };
|
|
30088
30296
|
}
|
|
30089
|
-
|
|
30297
|
+
const allTrackedFiles = metadata ? getAllTrackedFiles(metadata) : [];
|
|
30298
|
+
if (!metadata || allTrackedFiles.length === 0) {
|
|
30090
30299
|
return { path: filePath, ownership: "user", exists: true };
|
|
30091
30300
|
}
|
|
30092
30301
|
const relativePath = relative2(claudeDir, filePath).replace(/\\/g, "/");
|
|
30093
|
-
const tracked =
|
|
30302
|
+
const tracked = allTrackedFiles.find((f3) => f3.path === relativePath);
|
|
30094
30303
|
if (!tracked) {
|
|
30095
30304
|
return { path: filePath, ownership: "user", exists: true };
|
|
30096
30305
|
}
|
|
@@ -30228,8 +30437,8 @@ class FileMerger {
|
|
|
30228
30437
|
for (const file of files) {
|
|
30229
30438
|
const relativePath = relative3(sourceDir, file);
|
|
30230
30439
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
30231
|
-
const destPath =
|
|
30232
|
-
if (await
|
|
30440
|
+
const destPath = join13(destDir, relativePath);
|
|
30441
|
+
if (await import_fs_extra4.pathExists(destPath)) {
|
|
30233
30442
|
if (this.neverCopyChecker.ignores(normalizedRelativePath)) {
|
|
30234
30443
|
logger.debug(`Security-sensitive file exists but won't be overwritten: ${normalizedRelativePath}`);
|
|
30235
30444
|
continue;
|
|
@@ -30250,14 +30459,14 @@ class FileMerger {
|
|
|
30250
30459
|
for (const file of files) {
|
|
30251
30460
|
const relativePath = relative3(sourceDir, file);
|
|
30252
30461
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
30253
|
-
const destPath =
|
|
30462
|
+
const destPath = join13(destDir, relativePath);
|
|
30254
30463
|
if (this.neverCopyChecker.ignores(normalizedRelativePath)) {
|
|
30255
30464
|
logger.debug(`Skipping security-sensitive file: ${normalizedRelativePath}`);
|
|
30256
30465
|
skippedCount++;
|
|
30257
30466
|
continue;
|
|
30258
30467
|
}
|
|
30259
30468
|
if (this.userConfigChecker.ignores(normalizedRelativePath)) {
|
|
30260
|
-
const fileExists = await
|
|
30469
|
+
const fileExists = await import_fs_extra4.pathExists(destPath);
|
|
30261
30470
|
if (fileExists) {
|
|
30262
30471
|
logger.debug(`Preserving user config: ${normalizedRelativePath}`);
|
|
30263
30472
|
skippedCount++;
|
|
@@ -30280,7 +30489,7 @@ class FileMerger {
|
|
|
30280
30489
|
continue;
|
|
30281
30490
|
}
|
|
30282
30491
|
}
|
|
30283
|
-
await
|
|
30492
|
+
await import_fs_extra4.copy(file, destPath, { overwrite: true });
|
|
30284
30493
|
this.trackInstalledFile(normalizedRelativePath);
|
|
30285
30494
|
copiedCount++;
|
|
30286
30495
|
}
|
|
@@ -30292,7 +30501,7 @@ class FileMerger {
|
|
|
30292
30501
|
}
|
|
30293
30502
|
async processSettingsJson(sourceFile, destFile) {
|
|
30294
30503
|
try {
|
|
30295
|
-
const sourceContent = await
|
|
30504
|
+
const sourceContent = await import_fs_extra4.readFile(sourceFile, "utf-8");
|
|
30296
30505
|
const isWindows5 = process.platform === "win32";
|
|
30297
30506
|
let transformedSource = sourceContent;
|
|
30298
30507
|
if (this.isGlobal) {
|
|
@@ -30308,19 +30517,19 @@ class FileMerger {
|
|
|
30308
30517
|
logger.debug(`Transformed .claude/ paths to ${projectDirVar}/.claude/ in settings.json for local installation`);
|
|
30309
30518
|
}
|
|
30310
30519
|
}
|
|
30311
|
-
const destExists = await
|
|
30520
|
+
const destExists = await import_fs_extra4.pathExists(destFile);
|
|
30312
30521
|
if (destExists && !this.forceOverwriteSettings) {
|
|
30313
30522
|
await this.selectiveMergeSettings(transformedSource, destFile);
|
|
30314
30523
|
} else {
|
|
30315
30524
|
const formattedContent = this.formatJsonContent(transformedSource);
|
|
30316
|
-
await
|
|
30525
|
+
await import_fs_extra4.writeFile(destFile, formattedContent, "utf-8");
|
|
30317
30526
|
if (this.forceOverwriteSettings && destExists) {
|
|
30318
30527
|
logger.debug("Force overwrite enabled, replaced settings.json completely");
|
|
30319
30528
|
}
|
|
30320
30529
|
}
|
|
30321
30530
|
} catch (error) {
|
|
30322
30531
|
logger.error(`Failed to process settings.json: ${error}`);
|
|
30323
|
-
await
|
|
30532
|
+
await import_fs_extra4.copy(sourceFile, destFile, { overwrite: true });
|
|
30324
30533
|
}
|
|
30325
30534
|
}
|
|
30326
30535
|
async selectiveMergeSettings(transformedSourceContent, destFile) {
|
|
@@ -30330,7 +30539,7 @@ class FileMerger {
|
|
|
30330
30539
|
} catch {
|
|
30331
30540
|
logger.warning("Failed to parse source settings.json, falling back to overwrite");
|
|
30332
30541
|
const formattedContent = this.formatJsonContent(transformedSourceContent);
|
|
30333
|
-
await
|
|
30542
|
+
await import_fs_extra4.writeFile(destFile, formattedContent, "utf-8");
|
|
30334
30543
|
return;
|
|
30335
30544
|
}
|
|
30336
30545
|
const destSettings = await SettingsMerger.readSettingsFile(destFile);
|
|
@@ -30376,12 +30585,12 @@ class FileMerger {
|
|
|
30376
30585
|
}
|
|
30377
30586
|
async getFiles(dir, baseDir = dir) {
|
|
30378
30587
|
const files = [];
|
|
30379
|
-
const entries = await
|
|
30588
|
+
const entries = await import_fs_extra4.readdir(dir, { encoding: "utf8" });
|
|
30380
30589
|
for (const entry of entries) {
|
|
30381
|
-
const fullPath =
|
|
30590
|
+
const fullPath = join13(dir, entry);
|
|
30382
30591
|
const relativePath = relative3(baseDir, fullPath);
|
|
30383
30592
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
30384
|
-
const stats = await
|
|
30593
|
+
const stats = await import_fs_extra4.lstat(fullPath);
|
|
30385
30594
|
if (stats.isSymbolicLink()) {
|
|
30386
30595
|
logger.warning(`Skipping symbolic link: ${normalizedRelativePath}`);
|
|
30387
30596
|
continue;
|
|
@@ -30439,11 +30648,11 @@ class FileMerger {
|
|
|
30439
30648
|
|
|
30440
30649
|
// src/domains/installation/fresh-installer.ts
|
|
30441
30650
|
init_logger();
|
|
30442
|
-
import { join as
|
|
30443
|
-
var
|
|
30651
|
+
import { join as join14 } from "node:path";
|
|
30652
|
+
var import_fs_extra5 = __toESM(require_lib(), 1);
|
|
30444
30653
|
var CLAUDEKIT_SUBDIRECTORIES = ["commands", "agents", "skills", "workflows", "hooks"];
|
|
30445
30654
|
async function handleFreshInstallation(claudeDir, prompts) {
|
|
30446
|
-
if (!await
|
|
30655
|
+
if (!await import_fs_extra5.pathExists(claudeDir)) {
|
|
30447
30656
|
logger.info(".claude directory does not exist, proceeding with fresh installation");
|
|
30448
30657
|
return true;
|
|
30449
30658
|
}
|
|
@@ -30458,8 +30667,8 @@ async function handleFreshInstallation(claudeDir, prompts) {
|
|
|
30458
30667
|
const { rmSync } = await import("node:fs");
|
|
30459
30668
|
let removedCount = 0;
|
|
30460
30669
|
for (const subdir of CLAUDEKIT_SUBDIRECTORIES) {
|
|
30461
|
-
const subdirPath =
|
|
30462
|
-
if (await
|
|
30670
|
+
const subdirPath = join14(claudeDir, subdir);
|
|
30671
|
+
if (await import_fs_extra5.pathExists(subdirPath)) {
|
|
30463
30672
|
rmSync(subdirPath, { recursive: true, force: true });
|
|
30464
30673
|
removedCount++;
|
|
30465
30674
|
logger.debug(`Removed subdirectory: ${subdir}/`);
|
|
@@ -30474,11 +30683,11 @@ async function handleFreshInstallation(claudeDir, prompts) {
|
|
|
30474
30683
|
}
|
|
30475
30684
|
|
|
30476
30685
|
// src/domains/installation/setup-wizard.ts
|
|
30477
|
-
import { join as
|
|
30686
|
+
import { join as join16 } from "node:path";
|
|
30478
30687
|
|
|
30479
30688
|
// src/domains/config/config-generator.ts
|
|
30480
|
-
var
|
|
30481
|
-
import { join as
|
|
30689
|
+
var import_fs_extra6 = __toESM(require_lib(), 1);
|
|
30690
|
+
import { join as join15 } from "node:path";
|
|
30482
30691
|
async function generateEnvFile(targetDir, values) {
|
|
30483
30692
|
const lines = [
|
|
30484
30693
|
"# Generated by ClaudeKit CLI setup wizard",
|
|
@@ -30490,8 +30699,8 @@ async function generateEnvFile(targetDir, values) {
|
|
|
30490
30699
|
lines.push(`${key}=${value}`);
|
|
30491
30700
|
}
|
|
30492
30701
|
}
|
|
30493
|
-
const envPath =
|
|
30494
|
-
await
|
|
30702
|
+
const envPath = join15(targetDir, ".env");
|
|
30703
|
+
await import_fs_extra6.writeFile(envPath, `${lines.join(`
|
|
30495
30704
|
`)}
|
|
30496
30705
|
`, { mode: 384 });
|
|
30497
30706
|
}
|
|
@@ -30509,7 +30718,7 @@ function validateApiKey(value, pattern) {
|
|
|
30509
30718
|
// src/domains/installation/setup-wizard.ts
|
|
30510
30719
|
init_logger();
|
|
30511
30720
|
init_dist2();
|
|
30512
|
-
var
|
|
30721
|
+
var import_fs_extra7 = __toESM(require_lib(), 1);
|
|
30513
30722
|
var ESSENTIAL_CONFIGS = [
|
|
30514
30723
|
{
|
|
30515
30724
|
key: "GEMINI_API_KEY",
|
|
@@ -30538,7 +30747,7 @@ var ESSENTIAL_CONFIGS = [
|
|
|
30538
30747
|
];
|
|
30539
30748
|
async function parseEnvFile(path9) {
|
|
30540
30749
|
try {
|
|
30541
|
-
const content = await
|
|
30750
|
+
const content = await import_fs_extra7.readFile(path9, "utf-8");
|
|
30542
30751
|
const env2 = {};
|
|
30543
30752
|
for (const line of content.split(`
|
|
30544
30753
|
`)) {
|
|
@@ -30564,8 +30773,8 @@ async function parseEnvFile(path9) {
|
|
|
30564
30773
|
}
|
|
30565
30774
|
}
|
|
30566
30775
|
async function checkGlobalConfig() {
|
|
30567
|
-
const globalEnvPath =
|
|
30568
|
-
if (!await
|
|
30776
|
+
const globalEnvPath = join16(PathResolver.getGlobalKitDir(), ".env");
|
|
30777
|
+
if (!await import_fs_extra7.pathExists(globalEnvPath))
|
|
30569
30778
|
return false;
|
|
30570
30779
|
const env2 = await parseEnvFile(globalEnvPath);
|
|
30571
30780
|
return Object.keys(env2).length > 0;
|
|
@@ -30580,8 +30789,8 @@ async function runSetupWizard(options) {
|
|
|
30580
30789
|
let globalEnv = {};
|
|
30581
30790
|
const hasGlobalConfig = !isGlobal && await checkGlobalConfig();
|
|
30582
30791
|
if (!isGlobal) {
|
|
30583
|
-
const globalEnvPath =
|
|
30584
|
-
if (await
|
|
30792
|
+
const globalEnvPath = join16(PathResolver.getGlobalKitDir(), ".env");
|
|
30793
|
+
if (await import_fs_extra7.pathExists(globalEnvPath)) {
|
|
30585
30794
|
globalEnv = await parseEnvFile(globalEnvPath);
|
|
30586
30795
|
}
|
|
30587
30796
|
}
|
|
@@ -30633,7 +30842,7 @@ async function runSetupWizard(options) {
|
|
|
30633
30842
|
}
|
|
30634
30843
|
}
|
|
30635
30844
|
await generateEnvFile(targetDir, values);
|
|
30636
|
-
f2.success(`Configuration saved to ${
|
|
30845
|
+
f2.success(`Configuration saved to ${join16(targetDir, ".env")}`);
|
|
30637
30846
|
return true;
|
|
30638
30847
|
}
|
|
30639
30848
|
|
|
@@ -30643,157 +30852,6 @@ import { join as join19, relative as relative4 } from "node:path";
|
|
|
30643
30852
|
|
|
30644
30853
|
// src/services/file-operations/manifest-writer.ts
|
|
30645
30854
|
import { join as join17 } from "node:path";
|
|
30646
|
-
|
|
30647
|
-
// src/domains/migration/metadata-migration.ts
|
|
30648
|
-
init_logger();
|
|
30649
|
-
var import_fs_extra7 = __toESM(require_lib(), 1);
|
|
30650
|
-
import { join as join16 } from "node:path";
|
|
30651
|
-
async function detectMetadataFormat(claudeDir) {
|
|
30652
|
-
const metadataPath = join16(claudeDir, "metadata.json");
|
|
30653
|
-
if (!await import_fs_extra7.pathExists(metadataPath)) {
|
|
30654
|
-
return { format: "none", metadata: null, detectedKit: null };
|
|
30655
|
-
}
|
|
30656
|
-
try {
|
|
30657
|
-
const content = await import_fs_extra7.readFile(metadataPath, "utf-8");
|
|
30658
|
-
const parsed = JSON.parse(content);
|
|
30659
|
-
if (parsed.kits && Object.keys(parsed.kits).length > 0) {
|
|
30660
|
-
const installedKits = Object.keys(parsed.kits);
|
|
30661
|
-
return {
|
|
30662
|
-
format: "multi-kit",
|
|
30663
|
-
metadata: parsed,
|
|
30664
|
-
detectedKit: installedKits[0] || null
|
|
30665
|
-
};
|
|
30666
|
-
}
|
|
30667
|
-
if (parsed.name || parsed.version || parsed.files) {
|
|
30668
|
-
let detectedKit = null;
|
|
30669
|
-
const nameToCheck = parsed.name || "";
|
|
30670
|
-
if (/\bengineer\b/i.test(nameToCheck)) {
|
|
30671
|
-
detectedKit = "engineer";
|
|
30672
|
-
} else if (/\bmarketing\b/i.test(nameToCheck)) {
|
|
30673
|
-
detectedKit = "marketing";
|
|
30674
|
-
} else {
|
|
30675
|
-
detectedKit = "engineer";
|
|
30676
|
-
}
|
|
30677
|
-
return { format: "legacy", metadata: parsed, detectedKit };
|
|
30678
|
-
}
|
|
30679
|
-
logger.warning("Metadata file exists but has unrecognized format (missing kits, name, version, or files)");
|
|
30680
|
-
return { format: "none", metadata: null, detectedKit: null };
|
|
30681
|
-
} catch (error) {
|
|
30682
|
-
logger.warning(`Failed to read metadata file (may be corrupted): ${error}`);
|
|
30683
|
-
return { format: "none", metadata: null, detectedKit: null };
|
|
30684
|
-
}
|
|
30685
|
-
}
|
|
30686
|
-
async function migrateToMultiKit(claudeDir) {
|
|
30687
|
-
const detection = await detectMetadataFormat(claudeDir);
|
|
30688
|
-
if (detection.format === "multi-kit") {
|
|
30689
|
-
return {
|
|
30690
|
-
success: true,
|
|
30691
|
-
migrated: false,
|
|
30692
|
-
fromFormat: "multi-kit",
|
|
30693
|
-
toFormat: "multi-kit"
|
|
30694
|
-
};
|
|
30695
|
-
}
|
|
30696
|
-
if (detection.format === "none") {
|
|
30697
|
-
return {
|
|
30698
|
-
success: true,
|
|
30699
|
-
migrated: false,
|
|
30700
|
-
fromFormat: "none",
|
|
30701
|
-
toFormat: "multi-kit"
|
|
30702
|
-
};
|
|
30703
|
-
}
|
|
30704
|
-
const metadataPath = join16(claudeDir, "metadata.json");
|
|
30705
|
-
const legacy = detection.metadata;
|
|
30706
|
-
if (!legacy) {
|
|
30707
|
-
return {
|
|
30708
|
-
success: false,
|
|
30709
|
-
migrated: false,
|
|
30710
|
-
fromFormat: "legacy",
|
|
30711
|
-
toFormat: "multi-kit",
|
|
30712
|
-
error: "Metadata exists but could not be read"
|
|
30713
|
-
};
|
|
30714
|
-
}
|
|
30715
|
-
const legacyKit = detection.detectedKit || "engineer";
|
|
30716
|
-
try {
|
|
30717
|
-
const kitMetadata = {
|
|
30718
|
-
version: legacy.version || "unknown",
|
|
30719
|
-
installedAt: legacy.installedAt || new Date().toISOString(),
|
|
30720
|
-
files: legacy.files || []
|
|
30721
|
-
};
|
|
30722
|
-
const multiKit = {
|
|
30723
|
-
kits: {
|
|
30724
|
-
[legacyKit]: kitMetadata
|
|
30725
|
-
},
|
|
30726
|
-
scope: legacy.scope,
|
|
30727
|
-
name: legacy.name,
|
|
30728
|
-
version: legacy.version,
|
|
30729
|
-
installedAt: legacy.installedAt,
|
|
30730
|
-
installedFiles: legacy.installedFiles,
|
|
30731
|
-
userConfigFiles: legacy.userConfigFiles,
|
|
30732
|
-
files: legacy.files
|
|
30733
|
-
};
|
|
30734
|
-
await import_fs_extra7.writeFile(metadataPath, JSON.stringify(multiKit, null, 2), "utf-8");
|
|
30735
|
-
logger.info(`Migrated metadata from legacy format to multi-kit (detected: ${legacyKit})`);
|
|
30736
|
-
return {
|
|
30737
|
-
success: true,
|
|
30738
|
-
migrated: true,
|
|
30739
|
-
fromFormat: "legacy",
|
|
30740
|
-
toFormat: "multi-kit"
|
|
30741
|
-
};
|
|
30742
|
-
} catch (error) {
|
|
30743
|
-
const errorMsg = error instanceof Error ? error.message : "Unknown error";
|
|
30744
|
-
logger.error(`Metadata migration failed: ${errorMsg}`);
|
|
30745
|
-
return {
|
|
30746
|
-
success: false,
|
|
30747
|
-
migrated: false,
|
|
30748
|
-
fromFormat: "legacy",
|
|
30749
|
-
toFormat: "multi-kit",
|
|
30750
|
-
error: errorMsg
|
|
30751
|
-
};
|
|
30752
|
-
}
|
|
30753
|
-
}
|
|
30754
|
-
function getKitMetadata(metadata, kit) {
|
|
30755
|
-
if (metadata.kits?.[kit]) {
|
|
30756
|
-
return metadata.kits[kit];
|
|
30757
|
-
}
|
|
30758
|
-
if (!metadata.kits && metadata.version) {
|
|
30759
|
-
return {
|
|
30760
|
-
version: metadata.version,
|
|
30761
|
-
installedAt: metadata.installedAt || "",
|
|
30762
|
-
files: metadata.files
|
|
30763
|
-
};
|
|
30764
|
-
}
|
|
30765
|
-
return null;
|
|
30766
|
-
}
|
|
30767
|
-
function getAllTrackedFiles(metadata) {
|
|
30768
|
-
if (metadata.kits) {
|
|
30769
|
-
const allFiles = [];
|
|
30770
|
-
for (const kit of Object.values(metadata.kits)) {
|
|
30771
|
-
if (kit.files) {
|
|
30772
|
-
allFiles.push(...kit.files);
|
|
30773
|
-
}
|
|
30774
|
-
}
|
|
30775
|
-
return allFiles;
|
|
30776
|
-
}
|
|
30777
|
-
return metadata.files || [];
|
|
30778
|
-
}
|
|
30779
|
-
function getInstalledKits(metadata) {
|
|
30780
|
-
if (metadata.kits) {
|
|
30781
|
-
return Object.keys(metadata.kits);
|
|
30782
|
-
}
|
|
30783
|
-
const nameToCheck = metadata.name || "";
|
|
30784
|
-
if (/\bengineer\b/i.test(nameToCheck)) {
|
|
30785
|
-
return ["engineer"];
|
|
30786
|
-
}
|
|
30787
|
-
if (/\bmarketing\b/i.test(nameToCheck)) {
|
|
30788
|
-
return ["marketing"];
|
|
30789
|
-
}
|
|
30790
|
-
if (metadata.version) {
|
|
30791
|
-
return ["engineer"];
|
|
30792
|
-
}
|
|
30793
|
-
return [];
|
|
30794
|
-
}
|
|
30795
|
-
|
|
30796
|
-
// src/services/file-operations/manifest-writer.ts
|
|
30797
30855
|
init_logger();
|
|
30798
30856
|
init_types2();
|
|
30799
30857
|
var import_fs_extra8 = __toESM(require_lib(), 1);
|
|
@@ -31054,16 +31112,14 @@ class ManifestWriter {
|
|
|
31054
31112
|
};
|
|
31055
31113
|
const metadata = {
|
|
31056
31114
|
kits: {
|
|
31057
|
-
...existingMetadata.kits,
|
|
31115
|
+
...existingMetadata.kits || {},
|
|
31058
31116
|
[kit]: kitMetadata
|
|
31059
31117
|
},
|
|
31060
31118
|
scope,
|
|
31061
31119
|
name: kitName,
|
|
31062
31120
|
version,
|
|
31063
31121
|
installedAt,
|
|
31064
|
-
|
|
31065
|
-
userConfigFiles: [...USER_CONFIG_PATTERNS, ...this.getUserConfigFiles()],
|
|
31066
|
-
files: trackedFiles.length > 0 ? trackedFiles : undefined
|
|
31122
|
+
userConfigFiles: [...USER_CONFIG_PATTERNS, ...this.getUserConfigFiles()]
|
|
31067
31123
|
};
|
|
31068
31124
|
const validated = MetadataSchema.parse(metadata);
|
|
31069
31125
|
await import_fs_extra8.writeFile(metadataPath, JSON.stringify(validated, null, 2), "utf-8");
|
|
@@ -32547,36 +32603,36 @@ class SkillsMigrator {
|
|
|
32547
32603
|
// src/domains/versioning/version-selector.ts
|
|
32548
32604
|
init_logger();
|
|
32549
32605
|
init_dist2();
|
|
32550
|
-
var
|
|
32606
|
+
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
32551
32607
|
|
|
32552
32608
|
// src/domains/versioning/version-display.ts
|
|
32553
|
-
var
|
|
32609
|
+
var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
32554
32610
|
|
|
32555
32611
|
class VersionDisplayFormatter {
|
|
32556
32612
|
static createBadges(release) {
|
|
32557
32613
|
const badges = [];
|
|
32558
32614
|
if (release.isLatestStable) {
|
|
32559
|
-
badges.push(
|
|
32615
|
+
badges.push(import_picocolors11.default.bold(import_picocolors11.default.yellow("[latest]")));
|
|
32560
32616
|
}
|
|
32561
32617
|
if (release.prerelease || release.isLatestBeta) {
|
|
32562
32618
|
if (release.isLatestBeta) {
|
|
32563
|
-
badges.push(
|
|
32619
|
+
badges.push(import_picocolors11.default.bold(import_picocolors11.default.magenta("[beta]")));
|
|
32564
32620
|
} else {
|
|
32565
|
-
badges.push(
|
|
32621
|
+
badges.push(import_picocolors11.default.magenta("[prerelease]"));
|
|
32566
32622
|
}
|
|
32567
32623
|
} else if (!release.draft) {
|
|
32568
|
-
badges.push(
|
|
32624
|
+
badges.push(import_picocolors11.default.blue("[stable]"));
|
|
32569
32625
|
}
|
|
32570
32626
|
if (release.draft) {
|
|
32571
|
-
badges.push(
|
|
32627
|
+
badges.push(import_picocolors11.default.gray("[draft]"));
|
|
32572
32628
|
}
|
|
32573
32629
|
return badges.length > 0 ? ` ${badges.join(" ")}` : "";
|
|
32574
32630
|
}
|
|
32575
32631
|
static formatChoiceLabel(release) {
|
|
32576
|
-
const version =
|
|
32632
|
+
const version = import_picocolors11.default.green(release.displayVersion);
|
|
32577
32633
|
const badges = VersionDisplayFormatter.createBadges(release);
|
|
32578
32634
|
const name2 = release.name || "Release";
|
|
32579
|
-
return `${version}${badges} ${
|
|
32635
|
+
return `${version}${badges} ${import_picocolors11.default.dim(name2)}`;
|
|
32580
32636
|
}
|
|
32581
32637
|
static formatChoiceHint(release) {
|
|
32582
32638
|
const parts = [];
|
|
@@ -32598,7 +32654,7 @@ class VersionDisplayFormatter {
|
|
|
32598
32654
|
if (latestStable) {
|
|
32599
32655
|
options.push({
|
|
32600
32656
|
value: latestStable.tag_name,
|
|
32601
|
-
label: `${
|
|
32657
|
+
label: `${import_picocolors11.default.bold(import_picocolors11.default.green("Latest Stable"))} (${latestStable.displayVersion})`,
|
|
32602
32658
|
hint: "recommended version",
|
|
32603
32659
|
isLatest: true,
|
|
32604
32660
|
isPrerelease: false
|
|
@@ -32608,7 +32664,7 @@ class VersionDisplayFormatter {
|
|
|
32608
32664
|
if (latestBeta) {
|
|
32609
32665
|
options.push({
|
|
32610
32666
|
value: latestBeta.tag_name,
|
|
32611
|
-
label: `${
|
|
32667
|
+
label: `${import_picocolors11.default.bold(import_picocolors11.default.magenta("Latest Beta"))} (${latestBeta.displayVersion})`,
|
|
32612
32668
|
hint: "latest features, may be unstable",
|
|
32613
32669
|
isLatest: false,
|
|
32614
32670
|
isPrerelease: true
|
|
@@ -32619,7 +32675,7 @@ class VersionDisplayFormatter {
|
|
|
32619
32675
|
static createSeparator() {
|
|
32620
32676
|
return {
|
|
32621
32677
|
value: "separator",
|
|
32622
|
-
label:
|
|
32678
|
+
label: import_picocolors11.default.dim("─".repeat(50)),
|
|
32623
32679
|
hint: undefined,
|
|
32624
32680
|
isLatest: false,
|
|
32625
32681
|
isPrerelease: false
|
|
@@ -32628,7 +32684,7 @@ class VersionDisplayFormatter {
|
|
|
32628
32684
|
static createCancelOption() {
|
|
32629
32685
|
return {
|
|
32630
32686
|
value: "cancel",
|
|
32631
|
-
label:
|
|
32687
|
+
label: import_picocolors11.default.red("Cancel"),
|
|
32632
32688
|
hint: "exit version selection",
|
|
32633
32689
|
isLatest: false,
|
|
32634
32690
|
isPrerelease: false
|
|
@@ -32680,15 +32736,15 @@ class VersionDisplayFormatter {
|
|
|
32680
32736
|
return value !== "separator" && value !== "cancel" && value.trim().length > 0;
|
|
32681
32737
|
}
|
|
32682
32738
|
static formatError(message, suggestion) {
|
|
32683
|
-
let output2 =
|
|
32739
|
+
let output2 = import_picocolors11.default.red(`Error: ${message}`);
|
|
32684
32740
|
if (suggestion) {
|
|
32685
32741
|
output2 += `
|
|
32686
|
-
${
|
|
32742
|
+
${import_picocolors11.default.dim(suggestion)}`;
|
|
32687
32743
|
}
|
|
32688
32744
|
return output2;
|
|
32689
32745
|
}
|
|
32690
32746
|
static formatSuccess(version, kitName) {
|
|
32691
|
-
return `${
|
|
32747
|
+
return `${import_picocolors11.default.green("✓")} Selected ${import_picocolors11.default.bold(version)} for ${import_picocolors11.default.bold(kitName)}`;
|
|
32692
32748
|
}
|
|
32693
32749
|
}
|
|
32694
32750
|
|
|
@@ -32712,7 +32768,7 @@ class VersionSelector {
|
|
|
32712
32768
|
} = options;
|
|
32713
32769
|
try {
|
|
32714
32770
|
const loadingSpinner = de();
|
|
32715
|
-
loadingSpinner.start(`Fetching versions for ${
|
|
32771
|
+
loadingSpinner.start(`Fetching versions for ${import_picocolors12.default.bold(kit.name)}...`);
|
|
32716
32772
|
const releases = await this.githubClient.listReleasesWithCache(kit, {
|
|
32717
32773
|
limit: limit * 2,
|
|
32718
32774
|
includePrereleases,
|
|
@@ -32735,7 +32791,7 @@ class VersionSelector {
|
|
|
32735
32791
|
This could be due to:
|
|
32736
32792
|
• No releases published yet
|
|
32737
32793
|
• Network connectivity issues
|
|
32738
|
-
• Repository access permissions`,
|
|
32794
|
+
• Repository access permissions`, import_picocolors12.default.yellow("No Releases Available"));
|
|
32739
32795
|
if (!allowManualEntry) {
|
|
32740
32796
|
throw new Error(`No releases available for ${kit.name}`);
|
|
32741
32797
|
}
|
|
@@ -32773,34 +32829,34 @@ This could be due to:
|
|
|
32773
32829
|
if (latestStable) {
|
|
32774
32830
|
clackChoices.push({
|
|
32775
32831
|
value: latestStable.tag_name,
|
|
32776
|
-
label: `${
|
|
32832
|
+
label: `${import_picocolors12.default.bold(import_picocolors12.default.green("Latest Stable"))} (${latestStable.displayVersion})`,
|
|
32777
32833
|
hint: "recommended"
|
|
32778
32834
|
});
|
|
32779
32835
|
}
|
|
32780
32836
|
if (allowManualEntry) {
|
|
32781
32837
|
clackChoices.push({
|
|
32782
32838
|
value: "manual-entry",
|
|
32783
|
-
label:
|
|
32839
|
+
label: import_picocolors12.default.cyan("↳ Enter Version Manually"),
|
|
32784
32840
|
hint: "for older versions"
|
|
32785
32841
|
});
|
|
32786
32842
|
}
|
|
32787
32843
|
clackChoices.push({
|
|
32788
32844
|
value: "cancel",
|
|
32789
|
-
label:
|
|
32845
|
+
label: import_picocolors12.default.red("✕ Cancel")
|
|
32790
32846
|
});
|
|
32791
32847
|
const versionChoices = choices.filter((choice) => choice.value !== "separator" && choice.value !== "cancel");
|
|
32792
32848
|
for (const choice of versionChoices) {
|
|
32793
32849
|
const isCurrentlyInstalled = currentVersion && (choice.value === currentVersion || choice.value === `v${currentVersion}`);
|
|
32794
|
-
const installedMarker = isCurrentlyInstalled ?
|
|
32850
|
+
const installedMarker = isCurrentlyInstalled ? import_picocolors12.default.cyan(" (installed)") : "";
|
|
32795
32851
|
clackChoices.push({
|
|
32796
32852
|
value: choice.value,
|
|
32797
32853
|
label: `${choice.label}${installedMarker}`,
|
|
32798
32854
|
hint: choice.hint
|
|
32799
32855
|
});
|
|
32800
32856
|
}
|
|
32801
|
-
const currentVersionHint = currentVersion ?
|
|
32857
|
+
const currentVersionHint = currentVersion ? import_picocolors12.default.dim(` (current: ${currentVersion})`) : "";
|
|
32802
32858
|
const selected = await ie({
|
|
32803
|
-
message: `Select version for ${
|
|
32859
|
+
message: `Select version for ${import_picocolors12.default.bold(kit.name)}${currentVersionHint}:`,
|
|
32804
32860
|
options: clackChoices,
|
|
32805
32861
|
initialValue: latestStable?.tag_name
|
|
32806
32862
|
});
|
|
@@ -32834,15 +32890,15 @@ This could be due to:
|
|
|
32834
32890
|
async handleError(error, kit, allowManualEntry) {
|
|
32835
32891
|
logger.error(`Version selection error: ${error.message}`);
|
|
32836
32892
|
if (error.message.includes("401") || error.message.includes("403")) {
|
|
32837
|
-
le(VersionDisplayFormatter.formatError("Authentication failed", "Please check your GitHub token with: ck auth"),
|
|
32893
|
+
le(VersionDisplayFormatter.formatError("Authentication failed", "Please check your GitHub token with: ck auth"), import_picocolors12.default.red("Authentication Error"));
|
|
32838
32894
|
} else if (error.message.includes("404")) {
|
|
32839
|
-
le(VersionDisplayFormatter.formatError("Repository access denied", "Make sure you have access to the repository"),
|
|
32895
|
+
le(VersionDisplayFormatter.formatError("Repository access denied", "Make sure you have access to the repository"), import_picocolors12.default.red("Access Error"));
|
|
32840
32896
|
} else if (error.message.includes("rate limit") || error.message.includes("403")) {
|
|
32841
|
-
le(VersionDisplayFormatter.formatError("GitHub API rate limit exceeded", "Please wait a moment and try again"),
|
|
32897
|
+
le(VersionDisplayFormatter.formatError("GitHub API rate limit exceeded", "Please wait a moment and try again"), import_picocolors12.default.yellow("Rate Limited"));
|
|
32842
32898
|
} else if (error.message.includes("network") || error.message.includes("ENOTFOUND")) {
|
|
32843
|
-
le(VersionDisplayFormatter.formatError("Network connection failed", "Please check your internet connection"),
|
|
32899
|
+
le(VersionDisplayFormatter.formatError("Network connection failed", "Please check your internet connection"), import_picocolors12.default.yellow("Network Error"));
|
|
32844
32900
|
} else {
|
|
32845
|
-
le(VersionDisplayFormatter.formatError(error.message || "Unknown error occurred", "Please try again or contact support"),
|
|
32901
|
+
le(VersionDisplayFormatter.formatError(error.message || "Unknown error occurred", "Please try again or contact support"), import_picocolors12.default.red("Error"));
|
|
32846
32902
|
}
|
|
32847
32903
|
if (allowManualEntry) {
|
|
32848
32904
|
const retry2 = await se({
|
|
@@ -33353,7 +33409,8 @@ class CommandsPrefix {
|
|
|
33353
33409
|
logger.info("Checking ownership before cleanup...");
|
|
33354
33410
|
}
|
|
33355
33411
|
const metadata = await ManifestWriter.readManifest(claudeDir);
|
|
33356
|
-
|
|
33412
|
+
const allTrackedFiles = metadata ? getAllTrackedFiles(metadata) : [];
|
|
33413
|
+
if (!metadata || allTrackedFiles.length === 0) {
|
|
33357
33414
|
logger.verbose("No ownership metadata found - skipping cleanup (legacy/fresh install)");
|
|
33358
33415
|
logger.verbose("All existing files will be preserved as user-owned");
|
|
33359
33416
|
return result;
|
|
@@ -34584,7 +34641,7 @@ import { dirname as dirname7, join as join34 } from "node:path";
|
|
|
34584
34641
|
init_logger();
|
|
34585
34642
|
init_types2();
|
|
34586
34643
|
var import_fs_extra21 = __toESM(require_lib(), 1);
|
|
34587
|
-
var
|
|
34644
|
+
var import_picocolors14 = __toESM(require_picocolors(), 1);
|
|
34588
34645
|
async function detectInstallations() {
|
|
34589
34646
|
const installations = [];
|
|
34590
34647
|
const setup = await getClaudeKitSetup(process.cwd());
|
|
@@ -34704,7 +34761,8 @@ async function analyzeInstallation(installation, forceOverwrite, kit) {
|
|
|
34704
34761
|
}
|
|
34705
34762
|
return result;
|
|
34706
34763
|
}
|
|
34707
|
-
|
|
34764
|
+
const allTrackedFiles = metadata ? getAllTrackedFiles(metadata) : [];
|
|
34765
|
+
if (!metadata || allTrackedFiles.length === 0) {
|
|
34708
34766
|
for (const item of uninstallManifest.filesToRemove) {
|
|
34709
34767
|
if (!uninstallManifest.filesToPreserve.includes(item)) {
|
|
34710
34768
|
result.toDelete.push({ path: item, reason: "legacy installation" });
|
|
@@ -34712,7 +34770,7 @@ async function analyzeInstallation(installation, forceOverwrite, kit) {
|
|
|
34712
34770
|
}
|
|
34713
34771
|
return result;
|
|
34714
34772
|
}
|
|
34715
|
-
for (const trackedFile of
|
|
34773
|
+
for (const trackedFile of allTrackedFiles) {
|
|
34716
34774
|
const filePath = join34(installation.path, trackedFile.path);
|
|
34717
34775
|
const ownershipResult = await OwnershipChecker.checkOwnership(filePath, metadata, installation.path);
|
|
34718
34776
|
if (!ownershipResult.exists)
|
|
@@ -34729,27 +34787,27 @@ async function analyzeInstallation(installation, forceOverwrite, kit) {
|
|
|
34729
34787
|
}
|
|
34730
34788
|
function displayDryRunPreview(analysis, installationType) {
|
|
34731
34789
|
console.log("");
|
|
34732
|
-
log.info(
|
|
34790
|
+
log.info(import_picocolors14.default.bold(`DRY RUN - Preview for ${installationType} installation:`));
|
|
34733
34791
|
console.log("");
|
|
34734
34792
|
if (analysis.toDelete.length > 0) {
|
|
34735
|
-
console.log(
|
|
34793
|
+
console.log(import_picocolors14.default.red(import_picocolors14.default.bold(`Files to DELETE (${analysis.toDelete.length}):`)));
|
|
34736
34794
|
const showDelete = analysis.toDelete.slice(0, 10);
|
|
34737
34795
|
for (const item of showDelete) {
|
|
34738
|
-
console.log(` ${
|
|
34796
|
+
console.log(` ${import_picocolors14.default.red("✖")} ${item.path}`);
|
|
34739
34797
|
}
|
|
34740
34798
|
if (analysis.toDelete.length > 10) {
|
|
34741
|
-
console.log(
|
|
34799
|
+
console.log(import_picocolors14.default.gray(` ... and ${analysis.toDelete.length - 10} more`));
|
|
34742
34800
|
}
|
|
34743
34801
|
console.log("");
|
|
34744
34802
|
}
|
|
34745
34803
|
if (analysis.toPreserve.length > 0) {
|
|
34746
|
-
console.log(
|
|
34804
|
+
console.log(import_picocolors14.default.green(import_picocolors14.default.bold(`Files to PRESERVE (${analysis.toPreserve.length}):`)));
|
|
34747
34805
|
const showPreserve = analysis.toPreserve.slice(0, 10);
|
|
34748
34806
|
for (const item of showPreserve) {
|
|
34749
|
-
console.log(` ${
|
|
34807
|
+
console.log(` ${import_picocolors14.default.green("✓")} ${item.path} ${import_picocolors14.default.gray(`(${item.reason})`)}`);
|
|
34750
34808
|
}
|
|
34751
34809
|
if (analysis.toPreserve.length > 10) {
|
|
34752
|
-
console.log(
|
|
34810
|
+
console.log(import_picocolors14.default.gray(` ... and ${analysis.toPreserve.length - 10} more`));
|
|
34753
34811
|
}
|
|
34754
34812
|
console.log("");
|
|
34755
34813
|
}
|
|
@@ -34856,10 +34914,10 @@ async function uninstallCommand(options) {
|
|
|
34856
34914
|
}
|
|
34857
34915
|
displayInstallations(installations, scope);
|
|
34858
34916
|
if (validOptions.kit) {
|
|
34859
|
-
log.info(
|
|
34917
|
+
log.info(import_picocolors14.default.cyan(`Kit-scoped uninstall: ${validOptions.kit} kit only`));
|
|
34860
34918
|
}
|
|
34861
34919
|
if (validOptions.dryRun) {
|
|
34862
|
-
log.info(
|
|
34920
|
+
log.info(import_picocolors14.default.yellow("DRY RUN MODE - No files will be deleted"));
|
|
34863
34921
|
await removeInstallations(installations, {
|
|
34864
34922
|
dryRun: true,
|
|
34865
34923
|
forceOverwrite: validOptions.forceOverwrite,
|
|
@@ -34869,8 +34927,8 @@ async function uninstallCommand(options) {
|
|
|
34869
34927
|
return;
|
|
34870
34928
|
}
|
|
34871
34929
|
if (validOptions.forceOverwrite) {
|
|
34872
|
-
log.warn(`${
|
|
34873
|
-
${
|
|
34930
|
+
log.warn(`${import_picocolors14.default.yellow(import_picocolors14.default.bold("FORCE MODE ENABLED"))}
|
|
34931
|
+
${import_picocolors14.default.yellow("User modifications will be permanently deleted!")}`);
|
|
34874
34932
|
}
|
|
34875
34933
|
if (!validOptions.yes) {
|
|
34876
34934
|
const kitLabel = validOptions.kit ? ` (${validOptions.kit} kit only)` : "";
|
|
@@ -35040,7 +35098,7 @@ var import_compare_versions2 = __toESM(require_umd(), 1);
|
|
|
35040
35098
|
// package.json
|
|
35041
35099
|
var package_default2 = {
|
|
35042
35100
|
name: "claudekit-cli",
|
|
35043
|
-
version: "3.
|
|
35101
|
+
version: "3.12.0",
|
|
35044
35102
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
35045
35103
|
type: "module",
|
|
35046
35104
|
repository: {
|
|
@@ -35247,7 +35305,7 @@ Manual update: ${updateCmd}`);
|
|
|
35247
35305
|
// src/commands/version.ts
|
|
35248
35306
|
init_logger();
|
|
35249
35307
|
init_types2();
|
|
35250
|
-
var
|
|
35308
|
+
var import_picocolors15 = __toESM(require_picocolors(), 1);
|
|
35251
35309
|
function formatRelativeTime(dateString) {
|
|
35252
35310
|
if (!dateString)
|
|
35253
35311
|
return "Unknown";
|
|
@@ -35269,30 +35327,30 @@ function formatRelativeTime(dateString) {
|
|
|
35269
35327
|
}
|
|
35270
35328
|
function displayKitReleases(kitName, releases) {
|
|
35271
35329
|
console.log(`
|
|
35272
|
-
${
|
|
35330
|
+
${import_picocolors15.default.bold(import_picocolors15.default.cyan(kitName))} - Available Versions:
|
|
35273
35331
|
`);
|
|
35274
35332
|
if (releases.length === 0) {
|
|
35275
|
-
console.log(
|
|
35333
|
+
console.log(import_picocolors15.default.dim(" No releases found"));
|
|
35276
35334
|
return;
|
|
35277
35335
|
}
|
|
35278
35336
|
for (const release of releases) {
|
|
35279
|
-
const version =
|
|
35337
|
+
const version = import_picocolors15.default.green(release.tag_name);
|
|
35280
35338
|
const name2 = release.name || "No title";
|
|
35281
35339
|
const publishedAt = formatRelativeTime(release.published_at);
|
|
35282
35340
|
const assetCount = release.assets.length;
|
|
35283
35341
|
const badges = [];
|
|
35284
35342
|
if (release.prerelease)
|
|
35285
|
-
badges.push(
|
|
35343
|
+
badges.push(import_picocolors15.default.yellow("[prerelease]"));
|
|
35286
35344
|
if (release.draft)
|
|
35287
|
-
badges.push(
|
|
35345
|
+
badges.push(import_picocolors15.default.gray("[draft]"));
|
|
35288
35346
|
const badgeStr = badges.length > 0 ? ` ${badges.join(" ")}` : "";
|
|
35289
35347
|
const versionPart = version.padEnd(20);
|
|
35290
35348
|
const namePart = name2.length > 40 ? `${name2.slice(0, 37)}...` : name2.padEnd(40);
|
|
35291
|
-
const timePart =
|
|
35292
|
-
const assetPart =
|
|
35349
|
+
const timePart = import_picocolors15.default.dim(publishedAt.padEnd(20));
|
|
35350
|
+
const assetPart = import_picocolors15.default.dim(`(${assetCount} ${assetCount === 1 ? "asset" : "assets"})`);
|
|
35293
35351
|
console.log(` ${versionPart} ${namePart} ${timePart} ${assetPart}${badgeStr}`);
|
|
35294
35352
|
}
|
|
35295
|
-
console.log(
|
|
35353
|
+
console.log(import_picocolors15.default.dim(`
|
|
35296
35354
|
Showing ${releases.length} ${releases.length === 1 ? "release" : "releases"}`));
|
|
35297
35355
|
}
|
|
35298
35356
|
async function versionCommand(options) {
|
|
@@ -35327,8 +35385,8 @@ async function versionCommand(options) {
|
|
|
35327
35385
|
for (const result of results) {
|
|
35328
35386
|
if (result.error) {
|
|
35329
35387
|
console.log(`
|
|
35330
|
-
${
|
|
35331
|
-
console.log(
|
|
35388
|
+
${import_picocolors15.default.bold(import_picocolors15.default.cyan(result.kitConfig.name))} - ${import_picocolors15.default.red("Error")}`);
|
|
35389
|
+
console.log(import_picocolors15.default.dim(` ${result.error}`));
|
|
35332
35390
|
} else {
|
|
35333
35391
|
displayKitReleases(result.kitConfig.name, result.releases);
|
|
35334
35392
|
}
|
|
@@ -35344,7 +35402,7 @@ ${import_picocolors14.default.bold(import_picocolors14.default.cyan(result.kitCo
|
|
|
35344
35402
|
init_logger();
|
|
35345
35403
|
init_types2();
|
|
35346
35404
|
var import_compare_versions3 = __toESM(require_umd(), 1);
|
|
35347
|
-
var
|
|
35405
|
+
var import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
35348
35406
|
|
|
35349
35407
|
// src/domains/versioning/version-cache.ts
|
|
35350
35408
|
init_logger();
|
|
@@ -35493,7 +35551,7 @@ class VersionChecker {
|
|
|
35493
35551
|
const displayLatest = normalizeVersion(latestVersion);
|
|
35494
35552
|
const boxWidth = 52;
|
|
35495
35553
|
const contentWidth = boxWidth - 2;
|
|
35496
|
-
const border =
|
|
35554
|
+
const border = import_picocolors16.default.cyan;
|
|
35497
35555
|
const topBorder = border(`╭${"─".repeat(contentWidth)}╮`);
|
|
35498
35556
|
const bottomBorder = border(`╰${"─".repeat(contentWidth)}╯`);
|
|
35499
35557
|
const emptyLine = border("│") + " ".repeat(contentWidth) + border("│");
|
|
@@ -35506,12 +35564,12 @@ class VersionChecker {
|
|
|
35506
35564
|
const rightPadding = Math.max(0, totalPadding - leftPadding);
|
|
35507
35565
|
return border("│") + " ".repeat(leftPadding) + displayText + " ".repeat(rightPadding) + border("│");
|
|
35508
35566
|
};
|
|
35509
|
-
const headerText =
|
|
35567
|
+
const headerText = import_picocolors16.default.bold(import_picocolors16.default.yellow("⬆ Kit Update Available"));
|
|
35510
35568
|
const headerLen = "⬆ Kit Update Available".length;
|
|
35511
|
-
const versionText = `${
|
|
35569
|
+
const versionText = `${import_picocolors16.default.dim(displayCurrent)} ${import_picocolors16.default.white("→")} ${import_picocolors16.default.green(import_picocolors16.default.bold(displayLatest))}`;
|
|
35512
35570
|
const versionLen = displayCurrent.length + 3 + displayLatest.length;
|
|
35513
35571
|
const updateCmd = isGlobal ? "ck init -g" : "ck init";
|
|
35514
|
-
const commandText = `Run: ${
|
|
35572
|
+
const commandText = `Run: ${import_picocolors16.default.cyan(import_picocolors16.default.bold(updateCmd))}`;
|
|
35515
35573
|
const commandLen = `Run: ${updateCmd}`.length;
|
|
35516
35574
|
console.log("");
|
|
35517
35575
|
console.log(topBorder);
|
|
@@ -35560,7 +35618,7 @@ class CliVersionChecker {
|
|
|
35560
35618
|
const { currentVersion, latestVersion } = result;
|
|
35561
35619
|
const boxWidth = 52;
|
|
35562
35620
|
const contentWidth = boxWidth - 2;
|
|
35563
|
-
const border =
|
|
35621
|
+
const border = import_picocolors16.default.magenta;
|
|
35564
35622
|
const topBorder = border(`╭${"─".repeat(contentWidth)}╮`);
|
|
35565
35623
|
const bottomBorder = border(`╰${"─".repeat(contentWidth)}╯`);
|
|
35566
35624
|
const emptyLine = border("│") + " ".repeat(contentWidth) + border("│");
|
|
@@ -35573,11 +35631,11 @@ class CliVersionChecker {
|
|
|
35573
35631
|
const rightPadding = Math.max(0, totalPadding - leftPadding);
|
|
35574
35632
|
return border("│") + " ".repeat(leftPadding) + displayText + " ".repeat(rightPadding) + border("│");
|
|
35575
35633
|
};
|
|
35576
|
-
const headerText =
|
|
35634
|
+
const headerText = import_picocolors16.default.bold(import_picocolors16.default.yellow("⬆ CLI Update Available"));
|
|
35577
35635
|
const headerLen = "⬆ CLI Update Available".length;
|
|
35578
|
-
const versionText = `${
|
|
35636
|
+
const versionText = `${import_picocolors16.default.dim(currentVersion)} ${import_picocolors16.default.white("→")} ${import_picocolors16.default.green(import_picocolors16.default.bold(latestVersion))}`;
|
|
35579
35637
|
const versionLen = currentVersion.length + 3 + latestVersion.length;
|
|
35580
|
-
const commandText = `Run: ${
|
|
35638
|
+
const commandText = `Run: ${import_picocolors16.default.magenta(import_picocolors16.default.bold("ck update"))}`;
|
|
35581
35639
|
const commandLen = "Run: ck update".length;
|
|
35582
35640
|
console.log("");
|
|
35583
35641
|
console.log(topBorder);
|
|
@@ -35594,7 +35652,7 @@ class CliVersionChecker {
|
|
|
35594
35652
|
|
|
35595
35653
|
// src/shared/logger.ts
|
|
35596
35654
|
init_output_manager();
|
|
35597
|
-
var
|
|
35655
|
+
var import_picocolors17 = __toESM(require_picocolors(), 1);
|
|
35598
35656
|
import { createWriteStream as createWriteStream3 } from "node:fs";
|
|
35599
35657
|
|
|
35600
35658
|
class Logger2 {
|
|
@@ -35602,23 +35660,23 @@ class Logger2 {
|
|
|
35602
35660
|
logFileStream;
|
|
35603
35661
|
info(message) {
|
|
35604
35662
|
const symbols = output.getSymbols();
|
|
35605
|
-
console.log(
|
|
35663
|
+
console.log(import_picocolors17.default.blue(symbols.info), message);
|
|
35606
35664
|
}
|
|
35607
35665
|
success(message) {
|
|
35608
35666
|
const symbols = output.getSymbols();
|
|
35609
|
-
console.log(
|
|
35667
|
+
console.log(import_picocolors17.default.green(symbols.success), message);
|
|
35610
35668
|
}
|
|
35611
35669
|
warning(message) {
|
|
35612
35670
|
const symbols = output.getSymbols();
|
|
35613
|
-
console.log(
|
|
35671
|
+
console.log(import_picocolors17.default.yellow(symbols.warning), message);
|
|
35614
35672
|
}
|
|
35615
35673
|
error(message) {
|
|
35616
35674
|
const symbols = output.getSymbols();
|
|
35617
|
-
console.error(
|
|
35675
|
+
console.error(import_picocolors17.default.red(symbols.error), message);
|
|
35618
35676
|
}
|
|
35619
35677
|
debug(message) {
|
|
35620
35678
|
if (process.env.DEBUG) {
|
|
35621
|
-
console.log(
|
|
35679
|
+
console.log(import_picocolors17.default.gray("[DEBUG]"), message);
|
|
35622
35680
|
}
|
|
35623
35681
|
}
|
|
35624
35682
|
verbose(message, context) {
|
|
@@ -35627,7 +35685,7 @@ class Logger2 {
|
|
|
35627
35685
|
const timestamp = this.getTimestamp();
|
|
35628
35686
|
const sanitizedMessage = this.sanitize(message);
|
|
35629
35687
|
const formattedContext = context ? this.formatContext(context) : "";
|
|
35630
|
-
const logLine = `${timestamp} ${
|
|
35688
|
+
const logLine = `${timestamp} ${import_picocolors17.default.gray("[VERBOSE]")} ${sanitizedMessage}${formattedContext}`;
|
|
35631
35689
|
console.error(logLine);
|
|
35632
35690
|
if (this.logFileStream) {
|
|
35633
35691
|
const plainLogLine = `${timestamp} [VERBOSE] ${sanitizedMessage}${formattedContext}`;
|
|
@@ -35690,7 +35748,7 @@ var logger2 = new Logger2;
|
|
|
35690
35748
|
|
|
35691
35749
|
// src/shared/output-manager.ts
|
|
35692
35750
|
init_terminal_utils();
|
|
35693
|
-
var
|
|
35751
|
+
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
35694
35752
|
var SYMBOLS2 = {
|
|
35695
35753
|
unicode: {
|
|
35696
35754
|
prompt: "◇",
|
|
@@ -35761,7 +35819,7 @@ class OutputManager2 {
|
|
|
35761
35819
|
if (this.config.quiet)
|
|
35762
35820
|
return;
|
|
35763
35821
|
const symbol = this.getSymbols().success;
|
|
35764
|
-
console.log(
|
|
35822
|
+
console.log(import_picocolors18.default.green(`${symbol} ${message}`));
|
|
35765
35823
|
}
|
|
35766
35824
|
error(message, data) {
|
|
35767
35825
|
if (this.config.json) {
|
|
@@ -35769,7 +35827,7 @@ class OutputManager2 {
|
|
|
35769
35827
|
return;
|
|
35770
35828
|
}
|
|
35771
35829
|
const symbol = this.getSymbols().error;
|
|
35772
|
-
console.error(
|
|
35830
|
+
console.error(import_picocolors18.default.red(`${symbol} ${message}`));
|
|
35773
35831
|
}
|
|
35774
35832
|
warning(message, data) {
|
|
35775
35833
|
if (this.config.json) {
|
|
@@ -35779,7 +35837,7 @@ class OutputManager2 {
|
|
|
35779
35837
|
if (this.config.quiet)
|
|
35780
35838
|
return;
|
|
35781
35839
|
const symbol = this.getSymbols().warning;
|
|
35782
|
-
console.log(
|
|
35840
|
+
console.log(import_picocolors18.default.yellow(`${symbol} ${message}`));
|
|
35783
35841
|
}
|
|
35784
35842
|
info(message, data) {
|
|
35785
35843
|
if (this.config.json) {
|
|
@@ -35789,7 +35847,7 @@ class OutputManager2 {
|
|
|
35789
35847
|
if (this.config.quiet)
|
|
35790
35848
|
return;
|
|
35791
35849
|
const symbol = this.getSymbols().info;
|
|
35792
|
-
console.log(
|
|
35850
|
+
console.log(import_picocolors18.default.blue(`${symbol} ${message}`));
|
|
35793
35851
|
}
|
|
35794
35852
|
verbose(message, data) {
|
|
35795
35853
|
if (!this.config.verbose)
|
|
@@ -35798,7 +35856,7 @@ class OutputManager2 {
|
|
|
35798
35856
|
this.addJsonEntry({ type: "info", message, data });
|
|
35799
35857
|
return;
|
|
35800
35858
|
}
|
|
35801
|
-
console.log(
|
|
35859
|
+
console.log(import_picocolors18.default.dim(` ${message}`));
|
|
35802
35860
|
}
|
|
35803
35861
|
indent(message) {
|
|
35804
35862
|
if (this.config.json)
|
|
@@ -35823,7 +35881,7 @@ class OutputManager2 {
|
|
|
35823
35881
|
return;
|
|
35824
35882
|
const symbols = this.getSymbols();
|
|
35825
35883
|
console.log();
|
|
35826
|
-
console.log(
|
|
35884
|
+
console.log(import_picocolors18.default.bold(import_picocolors18.default.cyan(`${symbols.line} ${title}`)));
|
|
35827
35885
|
}
|
|
35828
35886
|
addJsonEntry(entry) {
|
|
35829
35887
|
this.jsonBuffer.push({
|
|
@@ -36105,6 +36163,9 @@ cli.command("doctor", "Comprehensive health check for ClaudeKit").option("--repo
|
|
|
36105
36163
|
cli.command("uninstall", "Remove ClaudeKit installations").option("-y, --yes", "Skip confirmation prompt").option("-l, --local", "Uninstall only local installation (current project)").option("-g, --global", "Uninstall only global installation (~/.claude/)").option("-A, --all", "Uninstall from both local and global locations").option("-k, --kit <type>", "Uninstall specific kit only (engineer, marketing)").option("--dry-run", "Preview what would be removed without deleting").option("--force-overwrite", "Delete even user-modified files (requires confirmation)").action(async (options) => {
|
|
36106
36164
|
await uninstallCommand(options);
|
|
36107
36165
|
});
|
|
36166
|
+
cli.command("easter-egg", "\uD83E\uDD5A Roll for a random discount code (Code Hunt 2025)").action(async () => {
|
|
36167
|
+
await easterEggCommand();
|
|
36168
|
+
});
|
|
36108
36169
|
cli.option("-V, --version", "Display version number");
|
|
36109
36170
|
cli.option("-h, --help", "Display help information");
|
|
36110
36171
|
var parsed = cli.parse(process.argv, { run: false });
|