claudekit-cli 4.3.1-dev.15 → 4.3.1-dev.16
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 +97 -65
- package/package.json +1 -1
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -63806,7 +63806,7 @@ var package_default;
|
|
|
63806
63806
|
var init_package = __esm(() => {
|
|
63807
63807
|
package_default = {
|
|
63808
63808
|
name: "claudekit-cli",
|
|
63809
|
-
version: "4.3.1-dev.
|
|
63809
|
+
version: "4.3.1-dev.16",
|
|
63810
63810
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
63811
63811
|
type: "module",
|
|
63812
63812
|
repository: {
|
|
@@ -65368,6 +65368,17 @@ async function checkHookFileReferences(projectDir) {
|
|
|
65368
65368
|
}
|
|
65369
65369
|
};
|
|
65370
65370
|
}
|
|
65371
|
+
async function countMissingHookFileReferences(projectDir = process.cwd()) {
|
|
65372
|
+
const settingsFiles = getClaudeSettingsFiles(projectDir);
|
|
65373
|
+
let count = 0;
|
|
65374
|
+
for (const settingsFile of settingsFiles) {
|
|
65375
|
+
const settings = await SettingsMerger.readSettingsFile(settingsFile.path);
|
|
65376
|
+
if (!settings)
|
|
65377
|
+
continue;
|
|
65378
|
+
count += collectMissingHookReferences(settings, settingsFile, projectDir).length;
|
|
65379
|
+
}
|
|
65380
|
+
return count;
|
|
65381
|
+
}
|
|
65371
65382
|
async function repairMissingHookFileReferences(projectDir = process.cwd()) {
|
|
65372
65383
|
const result = await checkHookFileReferences(projectDir);
|
|
65373
65384
|
if (result.status !== "fail" || !result.fix) {
|
|
@@ -67331,7 +67342,7 @@ import { exec as exec2, spawn as spawn2 } from "node:child_process";
|
|
|
67331
67342
|
import { existsSync as existsSync47 } from "node:fs";
|
|
67332
67343
|
import { readdir as readdir19 } from "node:fs/promises";
|
|
67333
67344
|
import { builtinModules } from "node:module";
|
|
67334
|
-
import { join as join68 } from "node:path";
|
|
67345
|
+
import { dirname as dirname29, join as join68 } from "node:path";
|
|
67335
67346
|
import { promisify as promisify9 } from "node:util";
|
|
67336
67347
|
function selectKitForUpdate(params) {
|
|
67337
67348
|
const { hasLocal, hasGlobal, localKits, globalKits } = params;
|
|
@@ -67464,12 +67475,12 @@ async function promptKitUpdate(beta, yes, deps) {
|
|
|
67464
67475
|
const globalMetadata = hasGlobal ? await readMetadataFile(setup.global.path) : null;
|
|
67465
67476
|
const localKits = localMetadata ? getInstalledKits(localMetadata) : [];
|
|
67466
67477
|
const globalKits = globalMetadata ? getInstalledKits(globalMetadata) : [];
|
|
67467
|
-
|
|
67478
|
+
let selection = selectKitForUpdate({ hasLocal, hasGlobal, localKits, globalKits });
|
|
67468
67479
|
if (!selection) {
|
|
67469
67480
|
logger.verbose("No ClaudeKit installations detected, skipping kit update prompt");
|
|
67470
67481
|
return;
|
|
67471
67482
|
}
|
|
67472
|
-
|
|
67483
|
+
let kitVersion = selection.kit ? selection.isGlobal ? globalMetadata?.kits?.[selection.kit]?.version : localMetadata?.kits?.[selection.kit]?.version : undefined;
|
|
67473
67484
|
const isBetaInstalled = isBetaVersion(kitVersion);
|
|
67474
67485
|
const promptMessage = selection.promptMessage;
|
|
67475
67486
|
if (selection.kit && kitVersion) {
|
|
@@ -67497,6 +67508,27 @@ async function promptKitUpdate(beta, yes, deps) {
|
|
|
67497
67508
|
logger.verbose(`Hook dependency self-heal check skipped: ${error instanceof Error ? error.message : "unknown"}`);
|
|
67498
67509
|
}
|
|
67499
67510
|
}
|
|
67511
|
+
if (alreadyAtLatest) {
|
|
67512
|
+
try {
|
|
67513
|
+
const countMissingHookRefsFn = deps?.countMissingHookFileReferencesFn ?? countMissingHookFileReferences;
|
|
67514
|
+
const projectDir = setup.project.path ? dirname29(setup.project.path) : process.cwd();
|
|
67515
|
+
const missingHookRefs = await countMissingHookRefsFn(projectDir);
|
|
67516
|
+
if (missingHookRefs > 0) {
|
|
67517
|
+
logger.warning(`Detected ${missingHookRefs} broken hook registration(s); reinstalling kit content`);
|
|
67518
|
+
alreadyAtLatest = false;
|
|
67519
|
+
if (setup.project.path && selection.isGlobal) {
|
|
67520
|
+
selection = {
|
|
67521
|
+
isGlobal: false,
|
|
67522
|
+
kit: localKits[0] || selection.kit,
|
|
67523
|
+
promptMessage: `Update local project ClaudeKit content${localKits[0] || selection.kit ? ` (${localKits[0] || selection.kit})` : ""}?`
|
|
67524
|
+
};
|
|
67525
|
+
kitVersion = selection.kit ? localMetadata?.kits?.[selection.kit]?.version : undefined;
|
|
67526
|
+
}
|
|
67527
|
+
}
|
|
67528
|
+
} catch (error) {
|
|
67529
|
+
logger.verbose(`Hook registration self-heal check skipped: ${error instanceof Error ? error.message : "unknown"}`);
|
|
67530
|
+
}
|
|
67531
|
+
}
|
|
67500
67532
|
let autoInit = false;
|
|
67501
67533
|
try {
|
|
67502
67534
|
const ckConfig = await loadFullConfigFn(null);
|
|
@@ -68560,7 +68592,7 @@ var init_routes = __esm(() => {
|
|
|
68560
68592
|
|
|
68561
68593
|
// src/domains/web-server/static-server.ts
|
|
68562
68594
|
import { existsSync as existsSync49 } from "node:fs";
|
|
68563
|
-
import { basename as basename24, dirname as
|
|
68595
|
+
import { basename as basename24, dirname as dirname30, join as join71, resolve as resolve34 } from "node:path";
|
|
68564
68596
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
68565
68597
|
function addRuntimeUiCandidate(candidates, runtimePath) {
|
|
68566
68598
|
if (!runtimePath) {
|
|
@@ -68570,7 +68602,7 @@ function addRuntimeUiCandidate(candidates, runtimePath) {
|
|
|
68570
68602
|
if (!looksLikePath) {
|
|
68571
68603
|
return;
|
|
68572
68604
|
}
|
|
68573
|
-
const entryDir =
|
|
68605
|
+
const entryDir = dirname30(resolve34(runtimePath));
|
|
68574
68606
|
if (basename24(entryDir) === "dist") {
|
|
68575
68607
|
candidates.add(join71(entryDir, "ui"));
|
|
68576
68608
|
}
|
|
@@ -68631,7 +68663,7 @@ var import_express, __dirname3;
|
|
|
68631
68663
|
var init_static_server = __esm(() => {
|
|
68632
68664
|
init_logger();
|
|
68633
68665
|
import_express = __toESM(require_express2(), 1);
|
|
68634
|
-
__dirname3 =
|
|
68666
|
+
__dirname3 = dirname30(fileURLToPath2(import.meta.url));
|
|
68635
68667
|
});
|
|
68636
68668
|
|
|
68637
68669
|
// node_modules/ws/lib/constants.js
|
|
@@ -74141,7 +74173,7 @@ var init_skills_installer2 = __esm(() => {
|
|
|
74141
74173
|
// src/services/package-installer/gemini-mcp/config-manager.ts
|
|
74142
74174
|
import { existsSync as existsSync62 } from "node:fs";
|
|
74143
74175
|
import { mkdir as mkdir23, readFile as readFile47, writeFile as writeFile23 } from "node:fs/promises";
|
|
74144
|
-
import { dirname as
|
|
74176
|
+
import { dirname as dirname33, join as join92 } from "node:path";
|
|
74145
74177
|
async function readJsonFile(filePath) {
|
|
74146
74178
|
try {
|
|
74147
74179
|
const content = await readFile47(filePath, "utf-8");
|
|
@@ -74181,7 +74213,7 @@ ${geminiPattern}
|
|
|
74181
74213
|
}
|
|
74182
74214
|
}
|
|
74183
74215
|
async function createNewSettingsWithMerge(geminiSettingsPath, mcpConfigPath) {
|
|
74184
|
-
const linkDir =
|
|
74216
|
+
const linkDir = dirname33(geminiSettingsPath);
|
|
74185
74217
|
if (!existsSync62(linkDir)) {
|
|
74186
74218
|
await mkdir23(linkDir, { recursive: true });
|
|
74187
74219
|
logger.debug(`Created directory: ${linkDir}`);
|
|
@@ -74300,9 +74332,9 @@ var init_validation = __esm(() => {
|
|
|
74300
74332
|
// src/services/package-installer/gemini-mcp/linker-core.ts
|
|
74301
74333
|
import { existsSync as existsSync64 } from "node:fs";
|
|
74302
74334
|
import { mkdir as mkdir24, symlink as symlink3 } from "node:fs/promises";
|
|
74303
|
-
import { dirname as
|
|
74335
|
+
import { dirname as dirname34, join as join94 } from "node:path";
|
|
74304
74336
|
async function createSymlink(targetPath, linkPath, projectDir, isGlobal) {
|
|
74305
|
-
const linkDir =
|
|
74337
|
+
const linkDir = dirname34(linkPath);
|
|
74306
74338
|
if (!existsSync64(linkDir)) {
|
|
74307
74339
|
await mkdir24(linkDir, { recursive: true });
|
|
74308
74340
|
logger.debug(`Created directory: ${linkDir}`);
|
|
@@ -77649,7 +77681,7 @@ var init_sqlite_client = () => {};
|
|
|
77649
77681
|
|
|
77650
77682
|
// src/commands/content/phases/db-manager.ts
|
|
77651
77683
|
import { existsSync as existsSync83, mkdirSync as mkdirSync8 } from "node:fs";
|
|
77652
|
-
import { dirname as
|
|
77684
|
+
import { dirname as dirname52 } from "node:path";
|
|
77653
77685
|
function initDatabase(dbPath) {
|
|
77654
77686
|
ensureParentDir(dbPath);
|
|
77655
77687
|
const db = openDatabase(dbPath);
|
|
@@ -77670,7 +77702,7 @@ function runRetentionCleanup(db, retentionDays = 90) {
|
|
|
77670
77702
|
db.prepare("DELETE FROM git_events WHERE processed = 1 AND created_at < ?").run(cutoff);
|
|
77671
77703
|
}
|
|
77672
77704
|
function ensureParentDir(dbPath) {
|
|
77673
|
-
const dir =
|
|
77705
|
+
const dir = dirname52(dbPath);
|
|
77674
77706
|
if (dir && !existsSync83(dir)) {
|
|
77675
77707
|
mkdirSync8(dir, { recursive: true });
|
|
77676
77708
|
}
|
|
@@ -88165,7 +88197,7 @@ init_path_resolver();
|
|
|
88165
88197
|
import { existsSync as existsSync58 } from "node:fs";
|
|
88166
88198
|
import { readFile as readFile42 } from "node:fs/promises";
|
|
88167
88199
|
import { homedir as homedir43 } from "node:os";
|
|
88168
|
-
import { dirname as
|
|
88200
|
+
import { dirname as dirname31, join as join80, normalize as normalize6, resolve as resolve36 } from "node:path";
|
|
88169
88201
|
async function checkPathRefsValid(projectDir) {
|
|
88170
88202
|
const globalClaudeMd = join80(PathResolver.getGlobalKitDir(), "CLAUDE.md");
|
|
88171
88203
|
const projectClaudeMd = join80(projectDir, ".claude", "CLAUDE.md");
|
|
@@ -88196,7 +88228,7 @@ async function checkPathRefsValid(projectDir) {
|
|
|
88196
88228
|
autoFixable: false
|
|
88197
88229
|
};
|
|
88198
88230
|
}
|
|
88199
|
-
const baseDir =
|
|
88231
|
+
const baseDir = dirname31(claudeMdPath);
|
|
88200
88232
|
const home5 = homedir43();
|
|
88201
88233
|
const broken = [];
|
|
88202
88234
|
for (const ref of refs) {
|
|
@@ -90028,14 +90060,14 @@ class AutoHealer {
|
|
|
90028
90060
|
import { execSync as execSync4, spawnSync as spawnSync6 } from "node:child_process";
|
|
90029
90061
|
import { readFileSync as readFileSync17, unlinkSync as unlinkSync2, writeFileSync as writeFileSync6 } from "node:fs";
|
|
90030
90062
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
90031
|
-
import { dirname as
|
|
90063
|
+
import { dirname as dirname32, join as join87 } from "node:path";
|
|
90032
90064
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
90033
90065
|
init_environment();
|
|
90034
90066
|
init_logger();
|
|
90035
90067
|
init_dist2();
|
|
90036
90068
|
function getCliVersion4() {
|
|
90037
90069
|
try {
|
|
90038
|
-
const __dirname4 =
|
|
90070
|
+
const __dirname4 = dirname32(fileURLToPath4(import.meta.url));
|
|
90039
90071
|
const pkgPath = join87(__dirname4, "../../../package.json");
|
|
90040
90072
|
const pkg = JSON.parse(readFileSync17(pkgPath, "utf-8"));
|
|
90041
90073
|
return pkg.version || "unknown";
|
|
@@ -94638,7 +94670,7 @@ import path10 from "node:path";
|
|
|
94638
94670
|
|
|
94639
94671
|
// node_modules/tar/dist/esm/list.js
|
|
94640
94672
|
import fs10 from "node:fs";
|
|
94641
|
-
import { dirname as
|
|
94673
|
+
import { dirname as dirname35, parse as parse4 } from "path";
|
|
94642
94674
|
|
|
94643
94675
|
// node_modules/tar/dist/esm/options.js
|
|
94644
94676
|
var argmap = new Map([
|
|
@@ -97538,7 +97570,7 @@ var filesFilter = (opt, files) => {
|
|
|
97538
97570
|
if (m2 !== undefined) {
|
|
97539
97571
|
ret = m2;
|
|
97540
97572
|
} else {
|
|
97541
|
-
ret = mapHas(
|
|
97573
|
+
ret = mapHas(dirname35(file), root);
|
|
97542
97574
|
}
|
|
97543
97575
|
}
|
|
97544
97576
|
map.set(file, ret);
|
|
@@ -100597,7 +100629,7 @@ import { promisify as promisify15 } from "node:util";
|
|
|
100597
100629
|
// src/domains/installation/extraction/native-zip-commands.ts
|
|
100598
100630
|
var NATIVE_EXTRACT_TIMEOUT_MS = 120000;
|
|
100599
100631
|
function getNativeZipCommands(archivePath, destDir, platformName = process.platform) {
|
|
100600
|
-
if (platformName === "darwin") {
|
|
100632
|
+
if (platformName === "darwin" || platformName === "linux") {
|
|
100601
100633
|
return [
|
|
100602
100634
|
{
|
|
100603
100635
|
label: "native unzip",
|
|
@@ -101281,7 +101313,7 @@ import { join as join120 } from "node:path";
|
|
|
101281
101313
|
|
|
101282
101314
|
// src/domains/installation/deletion-handler.ts
|
|
101283
101315
|
import { existsSync as existsSync65, lstatSync as lstatSync3, readdirSync as readdirSync9, rmSync as rmSync2, rmdirSync, unlinkSync as unlinkSync4 } from "node:fs";
|
|
101284
|
-
import { dirname as
|
|
101316
|
+
import { dirname as dirname37, join as join106, relative as relative21, resolve as resolve41, sep as sep12 } from "node:path";
|
|
101285
101317
|
|
|
101286
101318
|
// src/services/file-operations/manifest/manifest-reader.ts
|
|
101287
101319
|
init_metadata_migration();
|
|
@@ -101507,7 +101539,7 @@ function expandGlobPatterns(patterns, claudeDir3) {
|
|
|
101507
101539
|
var MAX_CLEANUP_ITERATIONS = 50;
|
|
101508
101540
|
function cleanupEmptyDirectories(filePath, claudeDir3) {
|
|
101509
101541
|
const normalizedClaudeDir = resolve41(claudeDir3);
|
|
101510
|
-
let currentDir = resolve41(
|
|
101542
|
+
let currentDir = resolve41(dirname37(filePath));
|
|
101511
101543
|
let iterations = 0;
|
|
101512
101544
|
while (currentDir !== normalizedClaudeDir && currentDir.startsWith(normalizedClaudeDir) && iterations < MAX_CLEANUP_ITERATIONS) {
|
|
101513
101545
|
iterations++;
|
|
@@ -101516,7 +101548,7 @@ function cleanupEmptyDirectories(filePath, claudeDir3) {
|
|
|
101516
101548
|
if (entries.length === 0) {
|
|
101517
101549
|
rmdirSync(currentDir);
|
|
101518
101550
|
logger.debug(`Removed empty directory: ${currentDir}`);
|
|
101519
|
-
currentDir = resolve41(
|
|
101551
|
+
currentDir = resolve41(dirname37(currentDir));
|
|
101520
101552
|
} else {
|
|
101521
101553
|
break;
|
|
101522
101554
|
}
|
|
@@ -101639,7 +101671,7 @@ init_logger();
|
|
|
101639
101671
|
init_types3();
|
|
101640
101672
|
var import_fs_extra15 = __toESM(require_lib(), 1);
|
|
101641
101673
|
var import_ignore3 = __toESM(require_ignore(), 1);
|
|
101642
|
-
import { dirname as
|
|
101674
|
+
import { dirname as dirname40, join as join110, relative as relative23 } from "node:path";
|
|
101643
101675
|
|
|
101644
101676
|
// src/domains/installation/selective-merger.ts
|
|
101645
101677
|
import { stat as stat18 } from "node:fs/promises";
|
|
@@ -103310,13 +103342,13 @@ class FileScanner {
|
|
|
103310
103342
|
// src/domains/installation/merger/settings-processor.ts
|
|
103311
103343
|
import { execSync as execSync5 } from "node:child_process";
|
|
103312
103344
|
import { homedir as homedir46 } from "node:os";
|
|
103313
|
-
import { dirname as
|
|
103345
|
+
import { dirname as dirname39, join as join109 } from "node:path";
|
|
103314
103346
|
|
|
103315
103347
|
// src/domains/config/installed-settings-tracker.ts
|
|
103316
103348
|
init_shared();
|
|
103317
103349
|
import { existsSync as existsSync66 } from "node:fs";
|
|
103318
103350
|
import { mkdir as mkdir31, readFile as readFile50, writeFile as writeFile25 } from "node:fs/promises";
|
|
103319
|
-
import { dirname as
|
|
103351
|
+
import { dirname as dirname38, join as join108 } from "node:path";
|
|
103320
103352
|
var CK_JSON_FILE = ".ck.json";
|
|
103321
103353
|
|
|
103322
103354
|
class InstalledSettingsTracker {
|
|
@@ -103367,7 +103399,7 @@ class InstalledSettingsTracker {
|
|
|
103367
103399
|
data.kits[this.kitName] = {};
|
|
103368
103400
|
}
|
|
103369
103401
|
data.kits[this.kitName].installedSettings = settings;
|
|
103370
|
-
await mkdir31(
|
|
103402
|
+
await mkdir31(dirname38(ckJsonPath), { recursive: true });
|
|
103371
103403
|
await writeFile25(ckJsonPath, JSON.stringify(data, null, 2), "utf-8");
|
|
103372
103404
|
logger.debug(`Saved installed settings to ${ckJsonPath}`);
|
|
103373
103405
|
} catch (error) {
|
|
@@ -103829,7 +103861,7 @@ class SettingsProcessor {
|
|
|
103829
103861
|
return true;
|
|
103830
103862
|
}
|
|
103831
103863
|
async repairSiblingSettingsLocal(destFile) {
|
|
103832
|
-
const settingsLocalPath = join109(
|
|
103864
|
+
const settingsLocalPath = join109(dirname39(destFile), "settings.local.json");
|
|
103833
103865
|
if (settingsLocalPath === destFile || !await import_fs_extra14.pathExists(settingsLocalPath)) {
|
|
103834
103866
|
return;
|
|
103835
103867
|
}
|
|
@@ -104092,10 +104124,10 @@ class CopyExecutor {
|
|
|
104092
104124
|
}
|
|
104093
104125
|
trackInstalledFile(relativePath) {
|
|
104094
104126
|
this.installedFiles.add(relativePath);
|
|
104095
|
-
let dir =
|
|
104127
|
+
let dir = dirname40(relativePath);
|
|
104096
104128
|
while (dir && dir !== "." && dir !== "/") {
|
|
104097
104129
|
this.installedDirectories.add(`${dir}/`);
|
|
104098
|
-
dir =
|
|
104130
|
+
dir = dirname40(dir);
|
|
104099
104131
|
}
|
|
104100
104132
|
}
|
|
104101
104133
|
}
|
|
@@ -107249,7 +107281,7 @@ async function runPreflightChecks() {
|
|
|
107249
107281
|
// src/domains/installation/fresh-installer.ts
|
|
107250
107282
|
init_metadata_migration();
|
|
107251
107283
|
import { existsSync as existsSync67, readdirSync as readdirSync10, rmSync as rmSync3, rmdirSync as rmdirSync2, unlinkSync as unlinkSync5 } from "node:fs";
|
|
107252
|
-
import { basename as basename28, dirname as
|
|
107284
|
+
import { basename as basename28, dirname as dirname41, join as join132, resolve as resolve45 } from "node:path";
|
|
107253
107285
|
init_logger();
|
|
107254
107286
|
init_safe_spinner();
|
|
107255
107287
|
var import_fs_extra34 = __toESM(require_lib(), 1);
|
|
@@ -107302,14 +107334,14 @@ async function analyzeFreshInstallation(claudeDir3) {
|
|
|
107302
107334
|
}
|
|
107303
107335
|
function cleanupEmptyDirectories2(filePath, claudeDir3) {
|
|
107304
107336
|
const normalizedClaudeDir = resolve45(claudeDir3);
|
|
107305
|
-
let currentDir = resolve45(
|
|
107337
|
+
let currentDir = resolve45(dirname41(filePath));
|
|
107306
107338
|
while (currentDir !== normalizedClaudeDir && currentDir.startsWith(normalizedClaudeDir)) {
|
|
107307
107339
|
try {
|
|
107308
107340
|
const entries = readdirSync10(currentDir);
|
|
107309
107341
|
if (entries.length === 0) {
|
|
107310
107342
|
rmdirSync2(currentDir);
|
|
107311
107343
|
logger.debug(`Removed empty directory: ${currentDir}`);
|
|
107312
|
-
currentDir = resolve45(
|
|
107344
|
+
currentDir = resolve45(dirname41(currentDir));
|
|
107313
107345
|
} else {
|
|
107314
107346
|
break;
|
|
107315
107347
|
}
|
|
@@ -107499,7 +107531,7 @@ async function handleFreshInstallation(claudeDir3, prompts) {
|
|
|
107499
107531
|
var import_fs_extra35 = __toESM(require_lib(), 1);
|
|
107500
107532
|
import { cp as cp5, mkdir as mkdir35, readdir as readdir42, rename as rename11, rm as rm16, stat as stat22 } from "node:fs/promises";
|
|
107501
107533
|
import { homedir as homedir47 } from "node:os";
|
|
107502
|
-
import { dirname as
|
|
107534
|
+
import { dirname as dirname42, join as join133, normalize as normalize11, resolve as resolve46 } from "node:path";
|
|
107503
107535
|
var LEGACY_KIT_MARKERS = [
|
|
107504
107536
|
"metadata.json",
|
|
107505
107537
|
".ck.json",
|
|
@@ -107612,7 +107644,7 @@ async function repairLegacyWindowsGlobalKitDir(options2) {
|
|
|
107612
107644
|
if (targetExists) {
|
|
107613
107645
|
await rm16(targetDir, { recursive: true, force: true });
|
|
107614
107646
|
}
|
|
107615
|
-
await mkdir35(
|
|
107647
|
+
await mkdir35(dirname42(targetDir), { recursive: true });
|
|
107616
107648
|
await moveDirectory(legacyDir, targetDir);
|
|
107617
107649
|
return { status: "repaired", reason: "repaired", legacyDir, candidateDirs };
|
|
107618
107650
|
}
|
|
@@ -108011,7 +108043,7 @@ async function handleSelection(ctx) {
|
|
|
108011
108043
|
}
|
|
108012
108044
|
// src/commands/init/phases/sync-handler.ts
|
|
108013
108045
|
import { copyFile as copyFile8, mkdir as mkdir37, open as open5, readFile as readFile59, rename as rename12, stat as stat23, unlink as unlink13, writeFile as writeFile33 } from "node:fs/promises";
|
|
108014
|
-
import { dirname as
|
|
108046
|
+
import { dirname as dirname43, join as join135, resolve as resolve48 } from "node:path";
|
|
108015
108047
|
init_logger();
|
|
108016
108048
|
init_path_resolver();
|
|
108017
108049
|
var import_fs_extra37 = __toESM(require_lib(), 1);
|
|
@@ -108130,7 +108162,7 @@ async function acquireSyncLock(global3) {
|
|
|
108130
108162
|
const lockPath = join135(cacheDir, ".sync-lock");
|
|
108131
108163
|
const startTime = Date.now();
|
|
108132
108164
|
const lockTimeout = getLockTimeout();
|
|
108133
|
-
await mkdir37(
|
|
108165
|
+
await mkdir37(dirname43(lockPath), { recursive: true });
|
|
108134
108166
|
while (Date.now() - startTime < lockTimeout) {
|
|
108135
108167
|
try {
|
|
108136
108168
|
const handle = await open5(lockPath, "wx");
|
|
@@ -109587,7 +109619,7 @@ init_dist2();
|
|
|
109587
109619
|
init_model_taxonomy();
|
|
109588
109620
|
import { mkdir as mkdir39, readFile as readFile64, writeFile as writeFile37 } from "node:fs/promises";
|
|
109589
109621
|
import { homedir as homedir52 } from "node:os";
|
|
109590
|
-
import { dirname as
|
|
109622
|
+
import { dirname as dirname44, join as join142 } from "node:path";
|
|
109591
109623
|
|
|
109592
109624
|
// src/commands/portable/models-dev-cache.ts
|
|
109593
109625
|
init_logger();
|
|
@@ -109940,7 +109972,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
109940
109972
|
}
|
|
109941
109973
|
const chosenModel2 = response2.action === "custom" ? response2.value : suggestion2.model;
|
|
109942
109974
|
const next2 = { ...existing, model: chosenModel2 };
|
|
109943
|
-
await mkdir39(
|
|
109975
|
+
await mkdir39(dirname44(configPath), { recursive: true });
|
|
109944
109976
|
await writeFile37(configPath, `${JSON.stringify(next2, null, 2)}
|
|
109945
109977
|
`, "utf-8");
|
|
109946
109978
|
return { path: configPath, action: "added", model: chosenModel2, reason: suggestion2.reason };
|
|
@@ -109951,7 +109983,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
109951
109983
|
throw new OpenCodeAuthRequiredError(suggestion.failure);
|
|
109952
109984
|
}
|
|
109953
109985
|
const next2 = { ...existing ?? {}, model: suggestion.model };
|
|
109954
|
-
await mkdir39(
|
|
109986
|
+
await mkdir39(dirname44(configPath), { recursive: true });
|
|
109955
109987
|
await writeFile37(configPath, `${JSON.stringify(next2, null, 2)}
|
|
109956
109988
|
`, "utf-8");
|
|
109957
109989
|
return {
|
|
@@ -109973,7 +110005,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
109973
110005
|
}
|
|
109974
110006
|
const chosenModel = response.action === "custom" ? response.value : suggestion.ok ? suggestion.model : "";
|
|
109975
110007
|
const next = { ...existing ?? {}, model: chosenModel };
|
|
109976
|
-
await mkdir39(
|
|
110008
|
+
await mkdir39(dirname44(configPath), { recursive: true });
|
|
109977
110009
|
await writeFile37(configPath, `${JSON.stringify(next, null, 2)}
|
|
109978
110010
|
`, "utf-8");
|
|
109979
110011
|
return {
|
|
@@ -109986,7 +110018,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
109986
110018
|
|
|
109987
110019
|
// src/commands/portable/plan-display.ts
|
|
109988
110020
|
var import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
109989
|
-
import { basename as basename29, dirname as
|
|
110021
|
+
import { basename as basename29, dirname as dirname45, extname as extname8 } from "node:path";
|
|
109990
110022
|
var DEFAULT_MAX_PLAN_GROUP_ITEMS = 20;
|
|
109991
110023
|
var TYPE_ORDER = [
|
|
109992
110024
|
"agent",
|
|
@@ -110212,21 +110244,21 @@ function collectPlannedWhereLines(plan) {
|
|
|
110212
110244
|
return destinations.map((destination) => `${formatDisplayPath(destination)} -> ${formatCdHint(resolveCdTarget(destination))}`);
|
|
110213
110245
|
}
|
|
110214
110246
|
function resolveCdTarget(destination) {
|
|
110215
|
-
return extname8(destination).length > 0 ?
|
|
110247
|
+
return extname8(destination).length > 0 ? dirname45(destination) : destination;
|
|
110216
110248
|
}
|
|
110217
110249
|
function normalizeWhereDestination(path17, portableType) {
|
|
110218
110250
|
if (portableType === "agent" || portableType === "command" || portableType === "skill") {
|
|
110219
|
-
return
|
|
110251
|
+
return dirname45(path17);
|
|
110220
110252
|
}
|
|
110221
110253
|
if (portableType === "hooks") {
|
|
110222
|
-
return
|
|
110254
|
+
return dirname45(path17);
|
|
110223
110255
|
}
|
|
110224
110256
|
if (portableType === "rules") {
|
|
110225
110257
|
const fileName = basename29(path17).toLowerCase();
|
|
110226
110258
|
if (fileName === "agents.md" || fileName === "gemini.md" || fileName === ".goosehints" || fileName === "custom_modes.yaml" || fileName === "custom_modes.yml") {
|
|
110227
110259
|
return path17;
|
|
110228
110260
|
}
|
|
110229
|
-
return
|
|
110261
|
+
return dirname45(path17);
|
|
110230
110262
|
}
|
|
110231
110263
|
return path17;
|
|
110232
110264
|
}
|
|
@@ -111980,7 +112012,7 @@ Please use only one download method.`);
|
|
|
111980
112012
|
// src/commands/plan/plan-command.ts
|
|
111981
112013
|
init_output_manager();
|
|
111982
112014
|
import { existsSync as existsSync71, statSync as statSync12 } from "node:fs";
|
|
111983
|
-
import { dirname as
|
|
112015
|
+
import { dirname as dirname49, isAbsolute as isAbsolute14, join as join148, parse as parse7, resolve as resolve55 } from "node:path";
|
|
111984
112016
|
|
|
111985
112017
|
// src/commands/plan/plan-read-handlers.ts
|
|
111986
112018
|
init_config();
|
|
@@ -111990,18 +112022,18 @@ init_logger();
|
|
|
111990
112022
|
init_output_manager();
|
|
111991
112023
|
var import_picocolors32 = __toESM(require_picocolors(), 1);
|
|
111992
112024
|
import { existsSync as existsSync70, statSync as statSync11 } from "node:fs";
|
|
111993
|
-
import { basename as basename31, dirname as
|
|
112025
|
+
import { basename as basename31, dirname as dirname47, join as join147, relative as relative31, resolve as resolve53 } from "node:path";
|
|
111994
112026
|
|
|
111995
112027
|
// src/commands/plan/plan-dependencies.ts
|
|
111996
112028
|
init_config();
|
|
111997
112029
|
init_plan_parser();
|
|
111998
112030
|
init_plans_registry();
|
|
111999
112031
|
import { existsSync as existsSync69 } from "node:fs";
|
|
112000
|
-
import { dirname as
|
|
112032
|
+
import { dirname as dirname46, join as join146 } from "node:path";
|
|
112001
112033
|
async function resolvePlanDependencies(references, currentPlanFile, options2 = {}) {
|
|
112002
112034
|
if (references.length === 0)
|
|
112003
112035
|
return [];
|
|
112004
|
-
const currentPlanDir =
|
|
112036
|
+
const currentPlanDir = dirname46(currentPlanFile);
|
|
112005
112037
|
const projectRoot = findProjectRoot(currentPlanDir);
|
|
112006
112038
|
const config = options2.preloadedConfig ?? (await CkConfigManager.loadFull(projectRoot)).config;
|
|
112007
112039
|
const defaultScope = inferPlanScopeForDir(currentPlanDir, config);
|
|
@@ -112088,7 +112120,7 @@ async function handleParse(target, options2) {
|
|
|
112088
112120
|
console.log(JSON.stringify({ file: relative31(process.cwd(), planFile), frontmatter, phases }, null, 2));
|
|
112089
112121
|
return;
|
|
112090
112122
|
}
|
|
112091
|
-
const title = typeof frontmatter.title === "string" ? frontmatter.title : basename31(
|
|
112123
|
+
const title = typeof frontmatter.title === "string" ? frontmatter.title : basename31(dirname47(planFile));
|
|
112092
112124
|
console.log();
|
|
112093
112125
|
console.log(import_picocolors32.default.bold(` Plan: ${title}`));
|
|
112094
112126
|
console.log(` File: ${planFile}`);
|
|
@@ -112199,7 +112231,7 @@ async function handleStatus(target, options2) {
|
|
|
112199
112231
|
const blockedBy2 = await resolvePlanDependencies(s.blockedBy, pf, { preloadedConfig });
|
|
112200
112232
|
const blocks2 = await resolvePlanDependencies(s.blocks, pf, { preloadedConfig });
|
|
112201
112233
|
const bar = progressBar(s.completed, s.totalPhases);
|
|
112202
|
-
const title2 = s.title ?? basename31(
|
|
112234
|
+
const title2 = s.title ?? basename31(dirname47(pf));
|
|
112203
112235
|
console.log(` ${import_picocolors32.default.bold(title2)}`);
|
|
112204
112236
|
console.log(` ${bar}`);
|
|
112205
112237
|
if (s.inProgress > 0)
|
|
@@ -112218,7 +112250,7 @@ async function handleStatus(target, options2) {
|
|
|
112218
112250
|
}
|
|
112219
112251
|
console.log();
|
|
112220
112252
|
} catch {
|
|
112221
|
-
console.log(` [X] Failed to read: ${basename31(
|
|
112253
|
+
console.log(` [X] Failed to read: ${basename31(dirname47(pf))}`);
|
|
112222
112254
|
console.log();
|
|
112223
112255
|
}
|
|
112224
112256
|
}
|
|
@@ -112245,7 +112277,7 @@ async function handleStatus(target, options2) {
|
|
|
112245
112277
|
console.log(JSON.stringify({ ...summary, dependencyStatus: { blockedBy, blocks } }, null, 2));
|
|
112246
112278
|
return;
|
|
112247
112279
|
}
|
|
112248
|
-
const title = summary.title ?? basename31(
|
|
112280
|
+
const title = summary.title ?? basename31(dirname47(planFile));
|
|
112249
112281
|
console.log();
|
|
112250
112282
|
console.log(import_picocolors32.default.bold(` ${title}`));
|
|
112251
112283
|
if (summary.status)
|
|
@@ -112308,7 +112340,7 @@ async function handleKanban(target, options2) {
|
|
|
112308
112340
|
process.exitCode = 1;
|
|
112309
112341
|
return;
|
|
112310
112342
|
}
|
|
112311
|
-
const route = `/plans?dir=${encodeURIComponent(
|
|
112343
|
+
const route = `/plans?dir=${encodeURIComponent(dirname47(dirname47(planFile)))}&view=kanban`;
|
|
112312
112344
|
const url = `http://localhost:${server.port}${route}`;
|
|
112313
112345
|
console.log();
|
|
112314
112346
|
console.log(import_picocolors32.default.bold(" ClaudeKit Dashboard — Plans"));
|
|
@@ -112343,7 +112375,7 @@ init_plan_parser();
|
|
|
112343
112375
|
init_plans_registry();
|
|
112344
112376
|
init_output_manager();
|
|
112345
112377
|
var import_picocolors33 = __toESM(require_picocolors(), 1);
|
|
112346
|
-
import { basename as basename32, dirname as
|
|
112378
|
+
import { basename as basename32, dirname as dirname48, relative as relative32, resolve as resolve54 } from "node:path";
|
|
112347
112379
|
function quoteReadTarget(filePath) {
|
|
112348
112380
|
return `"${filePath.replace(/\\/g, "/").replace(/"/g, "\\\"")}"`;
|
|
112349
112381
|
}
|
|
@@ -112457,7 +112489,7 @@ async function handleCheck(target, options2) {
|
|
|
112457
112489
|
process.exitCode = 1;
|
|
112458
112490
|
return;
|
|
112459
112491
|
}
|
|
112460
|
-
const planDir =
|
|
112492
|
+
const planDir = dirname48(planFile);
|
|
112461
112493
|
let planStatus = "pending";
|
|
112462
112494
|
try {
|
|
112463
112495
|
const projectRoot = findProjectRoot(planDir);
|
|
@@ -112506,7 +112538,7 @@ async function handleUncheck(target, options2) {
|
|
|
112506
112538
|
process.exitCode = 1;
|
|
112507
112539
|
return;
|
|
112508
112540
|
}
|
|
112509
|
-
const planDir =
|
|
112541
|
+
const planDir = dirname48(planFile);
|
|
112510
112542
|
try {
|
|
112511
112543
|
const projectRoot = findProjectRoot(planDir);
|
|
112512
112544
|
const summary = buildPlanSummary(planFile);
|
|
@@ -112545,7 +112577,7 @@ async function handleAddPhase(target, options2) {
|
|
|
112545
112577
|
try {
|
|
112546
112578
|
const result = addPhase(planFile, target, options2.after);
|
|
112547
112579
|
try {
|
|
112548
|
-
const planDir =
|
|
112580
|
+
const planDir = dirname48(planFile);
|
|
112549
112581
|
const projectRoot = findProjectRoot(planDir);
|
|
112550
112582
|
updateRegistryAddPhase({
|
|
112551
112583
|
planDir,
|
|
@@ -112599,7 +112631,7 @@ function resolvePlanFile(target, baseDir) {
|
|
|
112599
112631
|
const candidate = join148(dir, "plan.md");
|
|
112600
112632
|
if (existsSync71(candidate))
|
|
112601
112633
|
return candidate;
|
|
112602
|
-
dir =
|
|
112634
|
+
dir = dirname49(dir);
|
|
112603
112635
|
}
|
|
112604
112636
|
}
|
|
112605
112637
|
return null;
|
|
@@ -113883,7 +113915,7 @@ var import_fs_extra42 = __toESM(require_lib(), 1);
|
|
|
113883
113915
|
// src/commands/uninstall/analysis-handler.ts
|
|
113884
113916
|
init_metadata_migration();
|
|
113885
113917
|
import { readdirSync as readdirSync11, rmSync as rmSync4 } from "node:fs";
|
|
113886
|
-
import { dirname as
|
|
113918
|
+
import { dirname as dirname50, join as join151 } from "node:path";
|
|
113887
113919
|
init_logger();
|
|
113888
113920
|
init_safe_prompts();
|
|
113889
113921
|
var import_fs_extra41 = __toESM(require_lib(), 1);
|
|
@@ -113905,7 +113937,7 @@ function classifyFileByOwnership(ownership, forceOverwrite, deleteReason) {
|
|
|
113905
113937
|
}
|
|
113906
113938
|
async function cleanupEmptyDirectories3(filePath, installationRoot) {
|
|
113907
113939
|
let cleaned = 0;
|
|
113908
|
-
let currentDir =
|
|
113940
|
+
let currentDir = dirname50(filePath);
|
|
113909
113941
|
while (currentDir !== installationRoot && currentDir.startsWith(installationRoot)) {
|
|
113910
113942
|
try {
|
|
113911
113943
|
const entries = readdirSync11(currentDir);
|
|
@@ -113913,7 +113945,7 @@ async function cleanupEmptyDirectories3(filePath, installationRoot) {
|
|
|
113913
113945
|
rmSync4(currentDir, { recursive: true });
|
|
113914
113946
|
cleaned++;
|
|
113915
113947
|
logger.debug(`Removed empty directory: ${currentDir}`);
|
|
113916
|
-
currentDir =
|
|
113948
|
+
currentDir = dirname50(currentDir);
|
|
113917
113949
|
} else {
|
|
113918
113950
|
break;
|
|
113919
113951
|
}
|
|
@@ -115835,7 +115867,7 @@ init_file_io();
|
|
|
115835
115867
|
init_logger();
|
|
115836
115868
|
import { existsSync as existsSync74 } from "node:fs";
|
|
115837
115869
|
import { mkdir as mkdir41, readFile as readFile68 } from "node:fs/promises";
|
|
115838
|
-
import { dirname as
|
|
115870
|
+
import { dirname as dirname51 } from "node:path";
|
|
115839
115871
|
var PROCESSED_ISSUES_CAP = 500;
|
|
115840
115872
|
async function readCkJson(projectDir) {
|
|
115841
115873
|
const configPath = CkConfigManager.getProjectConfigPath(projectDir);
|
|
@@ -115865,7 +115897,7 @@ async function loadWatchState(projectDir) {
|
|
|
115865
115897
|
}
|
|
115866
115898
|
async function saveWatchState(projectDir, state) {
|
|
115867
115899
|
const configPath = CkConfigManager.getProjectConfigPath(projectDir);
|
|
115868
|
-
const configDir =
|
|
115900
|
+
const configDir = dirname51(configPath);
|
|
115869
115901
|
if (!existsSync74(configDir)) {
|
|
115870
115902
|
await mkdir41(configDir, { recursive: true });
|
|
115871
115903
|
}
|