claudekit-cli 4.2.1-dev.1 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-manifest.json +2 -2
- package/dist/index.js +148 -6
- package/package.json +1 -1
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -45544,6 +45544,45 @@ function formatCanonicalClaudeCommand(nodePrefix, root, relativePath, suffix = "
|
|
|
45544
45544
|
}
|
|
45545
45545
|
return normalizedRoot === "$CLAUDE_PROJECT_DIR" ? `${nodePrefix}"${normalizedRoot}"/${normalizedRelativePath}${suffix}` : `${nodePrefix}"${normalizedRoot}/${normalizedRelativePath}"${suffix}`;
|
|
45546
45546
|
}
|
|
45547
|
+
function resolveClaudePathArg(arg, root) {
|
|
45548
|
+
const normalizedArg = arg.replace(/\\/g, "/");
|
|
45549
|
+
const bareRelativeMatch = normalizedArg.match(/^(?:\.\/)?(\.claude\/.+)$/);
|
|
45550
|
+
if (bareRelativeMatch) {
|
|
45551
|
+
return { root, relativePath: bareRelativeMatch[1] };
|
|
45552
|
+
}
|
|
45553
|
+
const variableMatch = normalizedArg.match(/^(?:\$HOME|\$\{HOME\}|\$CLAUDE_PROJECT_DIR|\$\{CLAUDE_PROJECT_DIR\}|%USERPROFILE%|%CLAUDE_PROJECT_DIR%)\/(\.claude\/.+)$/);
|
|
45554
|
+
if (variableMatch) {
|
|
45555
|
+
return { root, relativePath: variableMatch[1] };
|
|
45556
|
+
}
|
|
45557
|
+
const tildeMatch = normalizedArg.match(/^~\/(\.claude\/.+)$/);
|
|
45558
|
+
if (tildeMatch) {
|
|
45559
|
+
return { root, relativePath: tildeMatch[1] };
|
|
45560
|
+
}
|
|
45561
|
+
const absoluteMatch = normalizedArg.match(/^((?:[A-Za-z]:\/|\/).*?\/\.claude\/.+)$/);
|
|
45562
|
+
if (absoluteMatch) {
|
|
45563
|
+
const absolutePath = absoluteMatch[1];
|
|
45564
|
+
const dotClaudeIdx = absolutePath.indexOf("/.claude/");
|
|
45565
|
+
if (dotClaudeIdx === -1) {
|
|
45566
|
+
return null;
|
|
45567
|
+
}
|
|
45568
|
+
const isWin2 = process.platform === "win32";
|
|
45569
|
+
const cmp = (s) => isWin2 ? s.toLowerCase() : s;
|
|
45570
|
+
const globalRoots = [
|
|
45571
|
+
`${homedir12().replace(/\\/g, "/").replace(/\/+$/, "")}/.claude/`,
|
|
45572
|
+
`${PathResolver.getGlobalKitDir().replace(/\\/g, "/").replace(/\/+$/, "")}/`
|
|
45573
|
+
];
|
|
45574
|
+
const isUnderGlobal = globalRoots.some((g2) => cmp(absolutePath).startsWith(cmp(g2)));
|
|
45575
|
+
const resolvedRoot = isUnderGlobal ? "$HOME" : root;
|
|
45576
|
+
return {
|
|
45577
|
+
root: resolvedRoot,
|
|
45578
|
+
relativePath: absolutePath.slice(dotClaudeIdx + 1)
|
|
45579
|
+
};
|
|
45580
|
+
}
|
|
45581
|
+
return null;
|
|
45582
|
+
}
|
|
45583
|
+
function formatCanonicalClaudeArg(pathArg) {
|
|
45584
|
+
return formatCanonicalClaudeCommand("", pathArg.root, pathArg.relativePath);
|
|
45585
|
+
}
|
|
45547
45586
|
function isNodeClaudeCommand(cmd) {
|
|
45548
45587
|
if (!cmd)
|
|
45549
45588
|
return false;
|
|
@@ -45611,6 +45650,39 @@ function repairClaudeNodeCommandPath(cmd, root) {
|
|
|
45611
45650
|
}
|
|
45612
45651
|
return { command: cmd, changed: false, issue: null };
|
|
45613
45652
|
}
|
|
45653
|
+
function repairClaudeHookRunnerCommandPath(cmd, root) {
|
|
45654
|
+
if (!cmd) {
|
|
45655
|
+
return { command: cmd ?? "", changed: false, issue: null };
|
|
45656
|
+
}
|
|
45657
|
+
const runnerMatch = cmd.match(/^(\s*bash\s+)(?:"([^"]+)"|([^\s"]+))\s+(?:"([^"]+)"|([^\s"]+))(.*)$/);
|
|
45658
|
+
if (!runnerMatch) {
|
|
45659
|
+
return { command: cmd, changed: false, issue: null };
|
|
45660
|
+
}
|
|
45661
|
+
const [, bashPrefix, quotedRunner, unquotedRunner, quotedTarget, unquotedTarget, suffix] = runnerMatch;
|
|
45662
|
+
const runnerArg = quotedRunner ?? unquotedRunner;
|
|
45663
|
+
const targetArg = quotedTarget ?? unquotedTarget;
|
|
45664
|
+
const runnerPath = resolveClaudePathArg(runnerArg, root);
|
|
45665
|
+
if (!runnerPath || runnerPath.relativePath.replace(/\\/g, "/") !== ".claude/hooks/node-hook-runner.sh") {
|
|
45666
|
+
return { command: cmd, changed: false, issue: null };
|
|
45667
|
+
}
|
|
45668
|
+
const targetPath = resolveClaudePathArg(targetArg, root);
|
|
45669
|
+
if (!targetPath) {
|
|
45670
|
+
return { command: cmd, changed: false, issue: null };
|
|
45671
|
+
}
|
|
45672
|
+
const command = `${bashPrefix}${formatCanonicalClaudeArg(runnerPath)} ${formatCanonicalClaudeArg(targetPath)}${suffix}`;
|
|
45673
|
+
return {
|
|
45674
|
+
command,
|
|
45675
|
+
changed: command !== cmd,
|
|
45676
|
+
issue: command !== cmd ? "invalid-format" : null
|
|
45677
|
+
};
|
|
45678
|
+
}
|
|
45679
|
+
function repairClaudeHookCommandPath(cmd, root) {
|
|
45680
|
+
const nodeRepair = repairClaudeNodeCommandPath(cmd, root);
|
|
45681
|
+
if (nodeRepair.changed || nodeRepair.issue || isNodeClaudeCommand(cmd)) {
|
|
45682
|
+
return nodeRepair;
|
|
45683
|
+
}
|
|
45684
|
+
return repairClaudeHookRunnerCommandPath(cmd, root);
|
|
45685
|
+
}
|
|
45614
45686
|
function normalizeCommand(cmd) {
|
|
45615
45687
|
if (!cmd)
|
|
45616
45688
|
return "";
|
|
@@ -62890,7 +62962,7 @@ var package_default;
|
|
|
62890
62962
|
var init_package = __esm(() => {
|
|
62891
62963
|
package_default = {
|
|
62892
62964
|
name: "claudekit-cli",
|
|
62893
|
-
version: "4.2.
|
|
62965
|
+
version: "4.2.2",
|
|
62894
62966
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
62895
62967
|
type: "module",
|
|
62896
62968
|
repository: {
|
|
@@ -74006,6 +74078,76 @@ var init_ownership_display = __esm(() => {
|
|
|
74006
74078
|
import_picocolors25 = __toESM(require_picocolors(), 1);
|
|
74007
74079
|
});
|
|
74008
74080
|
|
|
74081
|
+
// src/ui/node_modules/picocolors/picocolors.js
|
|
74082
|
+
var require_picocolors2 = __commonJS((exports, module) => {
|
|
74083
|
+
var p = process || {};
|
|
74084
|
+
var argv = p.argv || [];
|
|
74085
|
+
var env2 = p.env || {};
|
|
74086
|
+
var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
|
|
74087
|
+
var formatter = (open6, close, replace3 = open6) => (input) => {
|
|
74088
|
+
let string = "" + input, index = string.indexOf(close, open6.length);
|
|
74089
|
+
return ~index ? open6 + replaceClose(string, close, replace3, index) + close : open6 + string + close;
|
|
74090
|
+
};
|
|
74091
|
+
var replaceClose = (string, close, replace3, index) => {
|
|
74092
|
+
let result = "", cursor = 0;
|
|
74093
|
+
do {
|
|
74094
|
+
result += string.substring(cursor, index) + replace3;
|
|
74095
|
+
cursor = index + close.length;
|
|
74096
|
+
index = string.indexOf(close, cursor);
|
|
74097
|
+
} while (~index);
|
|
74098
|
+
return result + string.substring(cursor);
|
|
74099
|
+
};
|
|
74100
|
+
var createColors = (enabled = isColorSupported) => {
|
|
74101
|
+
let f3 = enabled ? formatter : () => String;
|
|
74102
|
+
return {
|
|
74103
|
+
isColorSupported: enabled,
|
|
74104
|
+
reset: f3("\x1B[0m", "\x1B[0m"),
|
|
74105
|
+
bold: f3("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
74106
|
+
dim: f3("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
74107
|
+
italic: f3("\x1B[3m", "\x1B[23m"),
|
|
74108
|
+
underline: f3("\x1B[4m", "\x1B[24m"),
|
|
74109
|
+
inverse: f3("\x1B[7m", "\x1B[27m"),
|
|
74110
|
+
hidden: f3("\x1B[8m", "\x1B[28m"),
|
|
74111
|
+
strikethrough: f3("\x1B[9m", "\x1B[29m"),
|
|
74112
|
+
black: f3("\x1B[30m", "\x1B[39m"),
|
|
74113
|
+
red: f3("\x1B[31m", "\x1B[39m"),
|
|
74114
|
+
green: f3("\x1B[32m", "\x1B[39m"),
|
|
74115
|
+
yellow: f3("\x1B[33m", "\x1B[39m"),
|
|
74116
|
+
blue: f3("\x1B[34m", "\x1B[39m"),
|
|
74117
|
+
magenta: f3("\x1B[35m", "\x1B[39m"),
|
|
74118
|
+
cyan: f3("\x1B[36m", "\x1B[39m"),
|
|
74119
|
+
white: f3("\x1B[37m", "\x1B[39m"),
|
|
74120
|
+
gray: f3("\x1B[90m", "\x1B[39m"),
|
|
74121
|
+
bgBlack: f3("\x1B[40m", "\x1B[49m"),
|
|
74122
|
+
bgRed: f3("\x1B[41m", "\x1B[49m"),
|
|
74123
|
+
bgGreen: f3("\x1B[42m", "\x1B[49m"),
|
|
74124
|
+
bgYellow: f3("\x1B[43m", "\x1B[49m"),
|
|
74125
|
+
bgBlue: f3("\x1B[44m", "\x1B[49m"),
|
|
74126
|
+
bgMagenta: f3("\x1B[45m", "\x1B[49m"),
|
|
74127
|
+
bgCyan: f3("\x1B[46m", "\x1B[49m"),
|
|
74128
|
+
bgWhite: f3("\x1B[47m", "\x1B[49m"),
|
|
74129
|
+
blackBright: f3("\x1B[90m", "\x1B[39m"),
|
|
74130
|
+
redBright: f3("\x1B[91m", "\x1B[39m"),
|
|
74131
|
+
greenBright: f3("\x1B[92m", "\x1B[39m"),
|
|
74132
|
+
yellowBright: f3("\x1B[93m", "\x1B[39m"),
|
|
74133
|
+
blueBright: f3("\x1B[94m", "\x1B[39m"),
|
|
74134
|
+
magentaBright: f3("\x1B[95m", "\x1B[39m"),
|
|
74135
|
+
cyanBright: f3("\x1B[96m", "\x1B[39m"),
|
|
74136
|
+
whiteBright: f3("\x1B[97m", "\x1B[39m"),
|
|
74137
|
+
bgBlackBright: f3("\x1B[100m", "\x1B[49m"),
|
|
74138
|
+
bgRedBright: f3("\x1B[101m", "\x1B[49m"),
|
|
74139
|
+
bgGreenBright: f3("\x1B[102m", "\x1B[49m"),
|
|
74140
|
+
bgYellowBright: f3("\x1B[103m", "\x1B[49m"),
|
|
74141
|
+
bgBlueBright: f3("\x1B[104m", "\x1B[49m"),
|
|
74142
|
+
bgMagentaBright: f3("\x1B[105m", "\x1B[49m"),
|
|
74143
|
+
bgCyanBright: f3("\x1B[106m", "\x1B[49m"),
|
|
74144
|
+
bgWhiteBright: f3("\x1B[107m", "\x1B[49m")
|
|
74145
|
+
};
|
|
74146
|
+
};
|
|
74147
|
+
module.exports = createColors();
|
|
74148
|
+
module.exports.createColors = createColors;
|
|
74149
|
+
});
|
|
74150
|
+
|
|
74009
74151
|
// src/commands/watch/phases/implementation-git-helpers.ts
|
|
74010
74152
|
import { spawn as spawn5 } from "node:child_process";
|
|
74011
74153
|
async function getCurrentBranch2(cwd2) {
|
|
@@ -86210,7 +86352,7 @@ function getClaudeSettingsFiles(projectDir) {
|
|
|
86210
86352
|
return candidates.filter((candidate) => existsSync56(candidate.path));
|
|
86211
86353
|
}
|
|
86212
86354
|
function isAlreadyCanonical(cmd) {
|
|
86213
|
-
return /^node\s+"\$HOME\/\.claude\/[^"]+"/.test(cmd) || /^node\s+"\$CLAUDE_PROJECT_DIR"\/\.claude\/\S+/.test(cmd);
|
|
86355
|
+
return /^node\s+"\$HOME\/\.claude\/[^"]+"/.test(cmd) || /^node\s+"\$CLAUDE_PROJECT_DIR"\/\.claude\/\S+/.test(cmd) || /^bash\s+"\$HOME\/\.claude\/hooks\/node-hook-runner\.sh"\s+"\$HOME\/\.claude\/[^"]+"/.test(cmd) || /^bash\s+"\$CLAUDE_PROJECT_DIR"\/\.claude\/hooks\/node-hook-runner\.sh\s+"\$CLAUDE_PROJECT_DIR"\/\.claude\/\S+/.test(cmd);
|
|
86214
86356
|
}
|
|
86215
86357
|
function collectHookCommandFindings(settings, settingsFile) {
|
|
86216
86358
|
if (!settings.hooks) {
|
|
@@ -86222,7 +86364,7 @@ function collectHookCommandFindings(settings, settingsFile) {
|
|
|
86222
86364
|
if ("command" in entry && typeof entry.command === "string") {
|
|
86223
86365
|
if (isAlreadyCanonical(entry.command))
|
|
86224
86366
|
continue;
|
|
86225
|
-
const repair =
|
|
86367
|
+
const repair = repairClaudeHookCommandPath(entry.command, settingsFile.root);
|
|
86226
86368
|
if (repair.changed && repair.issue) {
|
|
86227
86369
|
findings.push({
|
|
86228
86370
|
path: settingsFile.path,
|
|
@@ -86243,7 +86385,7 @@ function collectHookCommandFindings(settings, settingsFile) {
|
|
|
86243
86385
|
}
|
|
86244
86386
|
if (isAlreadyCanonical(hook.command))
|
|
86245
86387
|
continue;
|
|
86246
|
-
const repair =
|
|
86388
|
+
const repair = repairClaudeHookCommandPath(hook.command, settingsFile.root);
|
|
86247
86389
|
if (!repair.changed || !repair.issue) {
|
|
86248
86390
|
continue;
|
|
86249
86391
|
}
|
|
@@ -102269,7 +102411,7 @@ class SettingsProcessor {
|
|
|
102269
102411
|
return fixed;
|
|
102270
102412
|
}
|
|
102271
102413
|
fixSingleCommandPath(cmd) {
|
|
102272
|
-
return
|
|
102414
|
+
return repairClaudeHookCommandPath(cmd, this.getClaudeCommandRoot()).command;
|
|
102273
102415
|
}
|
|
102274
102416
|
formatCommandPath(nodePrefix, capturedVar, relativePath, suffix = "") {
|
|
102275
102417
|
const canonicalRoot = this.canonicalizePathRoot(capturedVar);
|
|
@@ -107442,7 +107584,7 @@ import { basename as basename27, join as join142, resolve as resolve46 } from "n
|
|
|
107442
107584
|
init_logger();
|
|
107443
107585
|
|
|
107444
107586
|
// src/ui/ck-cli-design/tokens.ts
|
|
107445
|
-
var import_picocolors27 = __toESM(
|
|
107587
|
+
var import_picocolors27 = __toESM(require_picocolors2(), 1);
|
|
107446
107588
|
import { homedir as homedir47, platform as platform16 } from "node:os";
|
|
107447
107589
|
import { resolve as resolve45, win32 as win322 } from "node:path";
|
|
107448
107590
|
var PANEL_MIN_WIDTH = 60;
|