claudekit-cli 3.42.2-dev.10 → 3.42.2-dev.12
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 +63 -53
- package/package.json +1 -1
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -45102,6 +45102,12 @@ function repairClaudeNodeCommandPath(cmd, root) {
|
|
|
45102
45102
|
if (!cmd || !isNodeClaudeCommand(cmd)) {
|
|
45103
45103
|
return { command: cmd ?? "", changed: false, issue: null };
|
|
45104
45104
|
}
|
|
45105
|
+
if (root === "$HOME" && /^node\s+"\$HOME\/\.claude\/[^"]+"/.test(cmd)) {
|
|
45106
|
+
return { command: cmd, changed: false, issue: null };
|
|
45107
|
+
}
|
|
45108
|
+
if (root === "$CLAUDE_PROJECT_DIR" && /^node\s+"\$CLAUDE_PROJECT_DIR"\/\.claude\/\S+/.test(cmd)) {
|
|
45109
|
+
return { command: cmd, changed: false, issue: null };
|
|
45110
|
+
}
|
|
45105
45111
|
const bareRelativeMatch = cmd.match(/^(node\s+)(?:\.\/)?(\.claude[/\\][^\s"]+)(.*)$/);
|
|
45106
45112
|
if (bareRelativeMatch) {
|
|
45107
45113
|
const [, nodePrefix, relativePath, suffix] = bareRelativeMatch;
|
|
@@ -62343,7 +62349,7 @@ var package_default;
|
|
|
62343
62349
|
var init_package = __esm(() => {
|
|
62344
62350
|
package_default = {
|
|
62345
62351
|
name: "claudekit-cli",
|
|
62346
|
-
version: "3.42.2-dev.
|
|
62352
|
+
version: "3.42.2-dev.12",
|
|
62347
62353
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
62348
62354
|
type: "module",
|
|
62349
62355
|
repository: {
|
|
@@ -73499,7 +73505,7 @@ __export(exports_worktree_manager, {
|
|
|
73499
73505
|
cleanupAllWorktrees: () => cleanupAllWorktrees
|
|
73500
73506
|
});
|
|
73501
73507
|
import { existsSync as existsSync68 } from "node:fs";
|
|
73502
|
-
import { readFile as
|
|
73508
|
+
import { readFile as readFile63, writeFile as writeFile37 } from "node:fs/promises";
|
|
73503
73509
|
import { join as join149 } from "node:path";
|
|
73504
73510
|
async function createWorktree(projectDir, issueNumber, baseBranch) {
|
|
73505
73511
|
const worktreePath = join149(projectDir, WORKTREE_DIR, `issue-${issueNumber}`);
|
|
@@ -73564,7 +73570,7 @@ async function cleanupAllWorktrees(projectDir) {
|
|
|
73564
73570
|
async function ensureGitignore(projectDir) {
|
|
73565
73571
|
const gitignorePath = join149(projectDir, ".gitignore");
|
|
73566
73572
|
try {
|
|
73567
|
-
const content = existsSync68(gitignorePath) ? await
|
|
73573
|
+
const content = existsSync68(gitignorePath) ? await readFile63(gitignorePath, "utf-8") : "";
|
|
73568
73574
|
if (!content.includes(".worktrees")) {
|
|
73569
73575
|
const newContent = content.endsWith(`
|
|
73570
73576
|
`) ? `${content}.worktrees/
|
|
@@ -75486,12 +75492,12 @@ var init_types6 = __esm(() => {
|
|
|
75486
75492
|
});
|
|
75487
75493
|
|
|
75488
75494
|
// src/commands/content/phases/state-manager.ts
|
|
75489
|
-
import { readFile as
|
|
75495
|
+
import { readFile as readFile65, rename as rename15, writeFile as writeFile40 } from "node:fs/promises";
|
|
75490
75496
|
import { join as join162 } from "node:path";
|
|
75491
75497
|
async function loadContentConfig(projectDir) {
|
|
75492
75498
|
const configPath = join162(projectDir, CK_CONFIG_FILE2);
|
|
75493
75499
|
try {
|
|
75494
|
-
const raw2 = await
|
|
75500
|
+
const raw2 = await readFile65(configPath, "utf-8");
|
|
75495
75501
|
const json = JSON.parse(raw2);
|
|
75496
75502
|
return ContentConfigSchema.parse(json.content ?? {});
|
|
75497
75503
|
} catch {
|
|
@@ -75507,7 +75513,7 @@ async function saveContentConfig(projectDir, config) {
|
|
|
75507
75513
|
async function loadContentState(projectDir) {
|
|
75508
75514
|
const configPath = join162(projectDir, CK_CONFIG_FILE2);
|
|
75509
75515
|
try {
|
|
75510
|
-
const raw2 = await
|
|
75516
|
+
const raw2 = await readFile65(configPath, "utf-8");
|
|
75511
75517
|
const json = JSON.parse(raw2);
|
|
75512
75518
|
const contentBlock = json.content ?? {};
|
|
75513
75519
|
return ContentStateSchema.parse(contentBlock.state ?? {});
|
|
@@ -75534,7 +75540,7 @@ async function saveContentState(projectDir, state) {
|
|
|
75534
75540
|
}
|
|
75535
75541
|
async function readJsonSafe(filePath) {
|
|
75536
75542
|
try {
|
|
75537
|
-
const raw2 = await
|
|
75543
|
+
const raw2 = await readFile65(filePath, "utf-8");
|
|
75538
75544
|
return JSON.parse(raw2);
|
|
75539
75545
|
} catch {
|
|
75540
75546
|
return {};
|
|
@@ -85136,6 +85142,9 @@ function getClaudeSettingsFiles(projectDir) {
|
|
|
85136
85142
|
];
|
|
85137
85143
|
return candidates.filter((candidate) => existsSync54(candidate.path));
|
|
85138
85144
|
}
|
|
85145
|
+
function isAlreadyCanonical(cmd) {
|
|
85146
|
+
return /^node\s+"\$HOME\/\.claude\/[^"]+"/.test(cmd) || /^node\s+"\$CLAUDE_PROJECT_DIR"\/\.claude\/\S+/.test(cmd);
|
|
85147
|
+
}
|
|
85139
85148
|
function collectHookCommandFindings(settings, settingsFile) {
|
|
85140
85149
|
if (!settings.hooks) {
|
|
85141
85150
|
return [];
|
|
@@ -85144,6 +85153,8 @@ function collectHookCommandFindings(settings, settingsFile) {
|
|
|
85144
85153
|
for (const [eventName, entries] of Object.entries(settings.hooks)) {
|
|
85145
85154
|
for (const entry of entries) {
|
|
85146
85155
|
if ("command" in entry && typeof entry.command === "string") {
|
|
85156
|
+
if (isAlreadyCanonical(entry.command))
|
|
85157
|
+
continue;
|
|
85147
85158
|
const repair = repairClaudeNodeCommandPath(entry.command, settingsFile.root);
|
|
85148
85159
|
if (repair.changed && repair.issue) {
|
|
85149
85160
|
findings.push({
|
|
@@ -85163,6 +85174,8 @@ function collectHookCommandFindings(settings, settingsFile) {
|
|
|
85163
85174
|
if (!hook.command) {
|
|
85164
85175
|
continue;
|
|
85165
85176
|
}
|
|
85177
|
+
if (isAlreadyCanonical(hook.command))
|
|
85178
|
+
continue;
|
|
85166
85179
|
const repair = repairClaudeNodeCommandPath(hook.command, settingsFile.root);
|
|
85167
85180
|
if (!repair.changed || !repair.issue) {
|
|
85168
85181
|
continue;
|
|
@@ -104627,6 +104640,7 @@ import { basename as basename23, dirname as dirname36, join as join130, resolve
|
|
|
104627
104640
|
init_logger();
|
|
104628
104641
|
init_safe_spinner();
|
|
104629
104642
|
var import_fs_extra34 = __toESM(require_lib(), 1);
|
|
104643
|
+
var KIT_MANIFEST_FILE = "metadata.json";
|
|
104630
104644
|
var CLAUDEKIT_SUBDIRECTORIES = ["commands", "agents", "skills", "rules", "hooks"];
|
|
104631
104645
|
async function analyzeFreshInstallation(claudeDir3) {
|
|
104632
104646
|
const metadata = await readManifest(claudeDir3);
|
|
@@ -104635,7 +104649,8 @@ async function analyzeFreshInstallation(claudeDir3) {
|
|
|
104635
104649
|
ckFiles: [],
|
|
104636
104650
|
ckModifiedFiles: [],
|
|
104637
104651
|
userFiles: [],
|
|
104638
|
-
hasMetadata: false
|
|
104652
|
+
hasMetadata: false,
|
|
104653
|
+
metadata: null
|
|
104639
104654
|
};
|
|
104640
104655
|
}
|
|
104641
104656
|
const allFiles = getAllTrackedFiles(metadata);
|
|
@@ -104644,7 +104659,8 @@ async function analyzeFreshInstallation(claudeDir3) {
|
|
|
104644
104659
|
ckFiles: [],
|
|
104645
104660
|
ckModifiedFiles: [],
|
|
104646
104661
|
userFiles: [],
|
|
104647
|
-
hasMetadata: false
|
|
104662
|
+
hasMetadata: false,
|
|
104663
|
+
metadata: null
|
|
104648
104664
|
};
|
|
104649
104665
|
}
|
|
104650
104666
|
const ckFiles = [];
|
|
@@ -104667,7 +104683,8 @@ async function analyzeFreshInstallation(claudeDir3) {
|
|
|
104667
104683
|
ckFiles,
|
|
104668
104684
|
ckModifiedFiles,
|
|
104669
104685
|
userFiles,
|
|
104670
|
-
hasMetadata: true
|
|
104686
|
+
hasMetadata: true,
|
|
104687
|
+
metadata
|
|
104671
104688
|
};
|
|
104672
104689
|
}
|
|
104673
104690
|
function cleanupEmptyDirectories2(filePath, claudeDir3) {
|
|
@@ -104693,8 +104710,13 @@ function cleanupEmptyDirectories2(filePath, claudeDir3) {
|
|
|
104693
104710
|
async function removeFilesByOwnership(claudeDir3, analysis, includeModified) {
|
|
104694
104711
|
const removedFiles = [];
|
|
104695
104712
|
const preservedFiles = [];
|
|
104696
|
-
const
|
|
104713
|
+
const allFilesToRemove = includeModified ? [...analysis.ckFiles, ...analysis.ckModifiedFiles] : analysis.ckFiles;
|
|
104697
104714
|
const filesToPreserve = includeModified ? analysis.userFiles : [...analysis.ckModifiedFiles, ...analysis.userFiles];
|
|
104715
|
+
const filesToRemove = allFilesToRemove.filter((f3) => f3.path !== KIT_MANIFEST_FILE);
|
|
104716
|
+
const selfTrackedManifest = allFilesToRemove.some((f3) => f3.path === KIT_MANIFEST_FILE);
|
|
104717
|
+
if (selfTrackedManifest) {
|
|
104718
|
+
logger.debug(`${KIT_MANIFEST_FILE} was self-tracked; skipping from delete loop — will be rewritten by updateMetadataAfterFresh`);
|
|
104719
|
+
}
|
|
104698
104720
|
for (const file of filesToRemove) {
|
|
104699
104721
|
const fullPath = join130(claudeDir3, file.path);
|
|
104700
104722
|
if (!existsSync62(fullPath)) {
|
|
@@ -104712,8 +104734,8 @@ async function removeFilesByOwnership(claudeDir3, analysis, includeModified) {
|
|
|
104712
104734
|
for (const file of filesToPreserve) {
|
|
104713
104735
|
preservedFiles.push(file.path);
|
|
104714
104736
|
}
|
|
104715
|
-
if (
|
|
104716
|
-
await updateMetadataAfterFresh(claudeDir3, removedFiles);
|
|
104737
|
+
if (analysis.metadata) {
|
|
104738
|
+
await updateMetadataAfterFresh(claudeDir3, removedFiles, analysis.metadata);
|
|
104717
104739
|
}
|
|
104718
104740
|
return {
|
|
104719
104741
|
success: true,
|
|
@@ -104723,23 +104745,8 @@ async function removeFilesByOwnership(claudeDir3, analysis, includeModified) {
|
|
|
104723
104745
|
preservedFiles
|
|
104724
104746
|
};
|
|
104725
104747
|
}
|
|
104726
|
-
async function updateMetadataAfterFresh(claudeDir3, removedFiles) {
|
|
104727
|
-
const metadataPath = join130(claudeDir3,
|
|
104728
|
-
if (!await import_fs_extra34.pathExists(metadataPath)) {
|
|
104729
|
-
throw new Error("metadata.json is missing during fresh install cleanup");
|
|
104730
|
-
}
|
|
104731
|
-
let content;
|
|
104732
|
-
try {
|
|
104733
|
-
content = await import_fs_extra34.readFile(metadataPath, "utf-8");
|
|
104734
|
-
} catch (readError) {
|
|
104735
|
-
throw new Error(`Failed to read metadata.json: ${readError instanceof Error ? readError.message : String(readError)}`);
|
|
104736
|
-
}
|
|
104737
|
-
let metadata;
|
|
104738
|
-
try {
|
|
104739
|
-
metadata = JSON.parse(content);
|
|
104740
|
-
} catch (parseError) {
|
|
104741
|
-
throw new Error(`Failed to parse metadata.json: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
|
|
104742
|
-
}
|
|
104748
|
+
async function updateMetadataAfterFresh(claudeDir3, removedFiles, metadata) {
|
|
104749
|
+
const metadataPath = join130(claudeDir3, KIT_MANIFEST_FILE);
|
|
104743
104750
|
const removedSet = new Set(removedFiles);
|
|
104744
104751
|
if (metadata.kits) {
|
|
104745
104752
|
for (const kitName of Object.keys(metadata.kits)) {
|
|
@@ -104752,11 +104759,14 @@ async function updateMetadataAfterFresh(claudeDir3, removedFiles) {
|
|
|
104752
104759
|
if (metadata.files) {
|
|
104753
104760
|
metadata.files = metadata.files.filter((f3) => !removedSet.has(f3.path));
|
|
104754
104761
|
}
|
|
104762
|
+
if (!await import_fs_extra34.pathExists(metadataPath)) {
|
|
104763
|
+
logger.warning(`${KIT_MANIFEST_FILE} was absent at write time (self-tracked or race condition) — recreating from in-memory snapshot`);
|
|
104764
|
+
}
|
|
104755
104765
|
try {
|
|
104756
104766
|
await import_fs_extra34.writeFile(metadataPath, JSON.stringify(metadata, null, 2));
|
|
104757
|
-
logger.debug(`Updated
|
|
104767
|
+
logger.debug(`Updated ${KIT_MANIFEST_FILE}, removed ${removedFiles.length} file entries`);
|
|
104758
104768
|
} catch (writeError) {
|
|
104759
|
-
throw new Error(`Failed to write
|
|
104769
|
+
throw new Error(`Failed to write ${KIT_MANIFEST_FILE}: ${writeError instanceof Error ? writeError.message : String(writeError)}`);
|
|
104760
104770
|
}
|
|
104761
104771
|
}
|
|
104762
104772
|
function getFreshBackupTargets(claudeDir3, analysis, includeModified) {
|
|
@@ -105232,7 +105242,7 @@ async function handleSelection(ctx) {
|
|
|
105232
105242
|
};
|
|
105233
105243
|
}
|
|
105234
105244
|
// src/commands/init/phases/sync-handler.ts
|
|
105235
|
-
import { copyFile as copyFile8, mkdir as mkdir35, open as open5, readFile as
|
|
105245
|
+
import { copyFile as copyFile8, mkdir as mkdir35, open as open5, readFile as readFile55, rename as rename10, stat as stat22, unlink as unlink12, writeFile as writeFile32 } from "node:fs/promises";
|
|
105236
105246
|
import { dirname as dirname37, join as join132, resolve as resolve39 } from "node:path";
|
|
105237
105247
|
init_logger();
|
|
105238
105248
|
init_path_resolver();
|
|
@@ -105400,7 +105410,7 @@ async function executeSyncMerge(ctx) {
|
|
|
105400
105410
|
try {
|
|
105401
105411
|
const sourceMetadataPath = join132(upstreamDir, "metadata.json");
|
|
105402
105412
|
if (await import_fs_extra36.pathExists(sourceMetadataPath)) {
|
|
105403
|
-
const content = await
|
|
105413
|
+
const content = await readFile55(sourceMetadataPath, "utf-8");
|
|
105404
105414
|
const sourceMetadata = JSON.parse(content);
|
|
105405
105415
|
deletions = sourceMetadata.deletions || [];
|
|
105406
105416
|
}
|
|
@@ -105698,7 +105708,7 @@ async function renameFolders(dirsToRename, extractDir, options2) {
|
|
|
105698
105708
|
// src/services/transformers/folder-transform/path-replacer.ts
|
|
105699
105709
|
init_logger();
|
|
105700
105710
|
init_types3();
|
|
105701
|
-
import { readFile as
|
|
105711
|
+
import { readFile as readFile56, readdir as readdir40, writeFile as writeFile33 } from "node:fs/promises";
|
|
105702
105712
|
import { join as join134, relative as relative26 } from "node:path";
|
|
105703
105713
|
var TRANSFORMABLE_FILE_PATTERNS = [
|
|
105704
105714
|
".md",
|
|
@@ -105765,7 +105775,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
|
|
|
105765
105775
|
if (!shouldTransform)
|
|
105766
105776
|
continue;
|
|
105767
105777
|
try {
|
|
105768
|
-
const content = await
|
|
105778
|
+
const content = await readFile56(fullPath, "utf-8");
|
|
105769
105779
|
let newContent = content;
|
|
105770
105780
|
let changeCount = 0;
|
|
105771
105781
|
for (const { regex: regex2, replacement } of compiledReplacements) {
|
|
@@ -105887,7 +105897,7 @@ async function transformFolderPaths(extractDir, folders, options2 = {}) {
|
|
|
105887
105897
|
|
|
105888
105898
|
// src/services/transformers/global-path-transformer.ts
|
|
105889
105899
|
init_logger();
|
|
105890
|
-
import { readFile as
|
|
105900
|
+
import { readFile as readFile57, readdir as readdir41, writeFile as writeFile34 } from "node:fs/promises";
|
|
105891
105901
|
import { homedir as homedir46, platform as platform15 } from "node:os";
|
|
105892
105902
|
import { extname as extname6, join as join135 } from "node:path";
|
|
105893
105903
|
var IS_WINDOWS3 = platform15() === "win32";
|
|
@@ -106038,7 +106048,7 @@ async function transformPathsForGlobalInstall(directory, options2 = {}) {
|
|
|
106038
106048
|
await processDirectory2(fullPath);
|
|
106039
106049
|
} else if (entry.isFile() && shouldTransformFile3(entry.name)) {
|
|
106040
106050
|
try {
|
|
106041
|
-
const content = await
|
|
106051
|
+
const content = await readFile57(fullPath, "utf-8");
|
|
106042
106052
|
const { transformed, changes } = transformContent(content, {
|
|
106043
106053
|
targetClaudeDir: options2.targetClaudeDir
|
|
106044
106054
|
});
|
|
@@ -106299,7 +106309,7 @@ async function initCommand(options2) {
|
|
|
106299
106309
|
init_dist2();
|
|
106300
106310
|
var import_picocolors30 = __toESM(require_picocolors(), 1);
|
|
106301
106311
|
import { existsSync as existsSync63 } from "node:fs";
|
|
106302
|
-
import { readFile as
|
|
106312
|
+
import { readFile as readFile61, rm as rm16, unlink as unlink13 } from "node:fs/promises";
|
|
106303
106313
|
import { homedir as homedir51 } from "node:os";
|
|
106304
106314
|
import { basename as basename25, join as join140, resolve as resolve41 } from "node:path";
|
|
106305
106315
|
init_logger();
|
|
@@ -106773,13 +106783,13 @@ init_model_taxonomy();
|
|
|
106773
106783
|
init_logger();
|
|
106774
106784
|
init_dist2();
|
|
106775
106785
|
init_model_taxonomy();
|
|
106776
|
-
import { mkdir as mkdir37, readFile as
|
|
106786
|
+
import { mkdir as mkdir37, readFile as readFile60, writeFile as writeFile36 } from "node:fs/promises";
|
|
106777
106787
|
import { homedir as homedir50 } from "node:os";
|
|
106778
106788
|
import { dirname as dirname38, join as join139 } from "node:path";
|
|
106779
106789
|
|
|
106780
106790
|
// src/commands/portable/models-dev-cache.ts
|
|
106781
106791
|
init_logger();
|
|
106782
|
-
import { mkdir as mkdir36, readFile as
|
|
106792
|
+
import { mkdir as mkdir36, readFile as readFile58, rename as rename12, writeFile as writeFile35 } from "node:fs/promises";
|
|
106783
106793
|
import { homedir as homedir48 } from "node:os";
|
|
106784
106794
|
import { join as join137 } from "node:path";
|
|
106785
106795
|
|
|
@@ -106804,7 +106814,7 @@ function tmpFilePath(cacheDir) {
|
|
|
106804
106814
|
async function readCacheEntry(cacheDir) {
|
|
106805
106815
|
const filePath = cacheFilePath(cacheDir);
|
|
106806
106816
|
try {
|
|
106807
|
-
const raw2 = await
|
|
106817
|
+
const raw2 = await readFile58(filePath, "utf-8");
|
|
106808
106818
|
const parsed = JSON.parse(raw2);
|
|
106809
106819
|
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) && "fetchedAt" in parsed && typeof parsed.fetchedAt === "string" && "payload" in parsed && typeof parsed.payload === "object" && parsed.payload !== null) {
|
|
106810
106820
|
return parsed;
|
|
@@ -106872,7 +106882,7 @@ async function getModelsDevCatalog(opts = {}) {
|
|
|
106872
106882
|
|
|
106873
106883
|
// src/commands/portable/opencode-model-discovery.ts
|
|
106874
106884
|
init_logger();
|
|
106875
|
-
import { readFile as
|
|
106885
|
+
import { readFile as readFile59 } from "node:fs/promises";
|
|
106876
106886
|
import { homedir as homedir49, platform as platform17 } from "node:os";
|
|
106877
106887
|
import { join as join138 } from "node:path";
|
|
106878
106888
|
function resolveOpenCodeAuthPath(homeDir) {
|
|
@@ -106886,7 +106896,7 @@ function resolveOpenCodeAuthPath(homeDir) {
|
|
|
106886
106896
|
async function readAuthedProviders(homeDir) {
|
|
106887
106897
|
const authPath = resolveOpenCodeAuthPath(homeDir);
|
|
106888
106898
|
try {
|
|
106889
|
-
const raw2 = await
|
|
106899
|
+
const raw2 = await readFile59(authPath, "utf-8");
|
|
106890
106900
|
const parsed = JSON.parse(raw2);
|
|
106891
106901
|
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
106892
106902
|
return Object.keys(parsed);
|
|
@@ -107088,7 +107098,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
107088
107098
|
const configPath = getOpenCodeConfigPath(options2);
|
|
107089
107099
|
let existing = null;
|
|
107090
107100
|
try {
|
|
107091
|
-
const raw2 = await
|
|
107101
|
+
const raw2 = await readFile60(configPath, "utf-8");
|
|
107092
107102
|
const parsed = JSON.parse(raw2);
|
|
107093
107103
|
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
107094
107104
|
existing = parsed;
|
|
@@ -107948,7 +107958,7 @@ async function processMetadataDeletions(skillSourcePath, installGlobally) {
|
|
|
107948
107958
|
return;
|
|
107949
107959
|
let sourceMetadata;
|
|
107950
107960
|
try {
|
|
107951
|
-
const content = await
|
|
107961
|
+
const content = await readFile61(sourceMetadataPath, "utf-8");
|
|
107952
107962
|
sourceMetadata = JSON.parse(content);
|
|
107953
107963
|
} catch (error) {
|
|
107954
107964
|
logger.debug(`[migrate] Failed to parse source metadata.json: ${error}`);
|
|
@@ -108242,7 +108252,7 @@ async function migrateCommand(options2) {
|
|
|
108242
108252
|
for (const action of conflictActions) {
|
|
108243
108253
|
if (!action.diff && action.targetPath && existsSync63(action.targetPath)) {
|
|
108244
108254
|
try {
|
|
108245
|
-
const targetContent = await
|
|
108255
|
+
const targetContent = await readFile61(action.targetPath, "utf-8");
|
|
108246
108256
|
const sourceItem = effectiveAgents.find((a3) => a3.name === action.item) || effectiveCommands.find((c2) => c2.name === action.item) || (effectiveConfigItem?.name === action.item ? effectiveConfigItem : null) || effectiveRuleItems.find((r2) => r2.name === action.item) || effectiveHookItems.find((h2) => h2.name === action.item);
|
|
108247
108257
|
if (sourceItem) {
|
|
108248
108258
|
const providerConfig = providers[action.provider];
|
|
@@ -110220,7 +110230,7 @@ init_skills_registry();
|
|
|
110220
110230
|
init_skills_uninstaller();
|
|
110221
110231
|
var import_gray_matter11 = __toESM(require_gray_matter(), 1);
|
|
110222
110232
|
var import_picocolors37 = __toESM(require_picocolors(), 1);
|
|
110223
|
-
import { readFile as
|
|
110233
|
+
import { readFile as readFile62 } from "node:fs/promises";
|
|
110224
110234
|
import { join as join146 } from "node:path";
|
|
110225
110235
|
|
|
110226
110236
|
// src/commands/skills/types.ts
|
|
@@ -110345,7 +110355,7 @@ async function handleValidate2(sourcePath) {
|
|
|
110345
110355
|
for (const skill of skills) {
|
|
110346
110356
|
const skillMdPath = join146(skill.path, "SKILL.md");
|
|
110347
110357
|
try {
|
|
110348
|
-
const content = await
|
|
110358
|
+
const content = await readFile62(skillMdPath, "utf-8");
|
|
110349
110359
|
const { data } = import_gray_matter11.default(content, {
|
|
110350
110360
|
engines: { javascript: { parse: () => ({}) } }
|
|
110351
110361
|
});
|
|
@@ -112783,7 +112793,7 @@ init_ck_config_manager();
|
|
|
112783
112793
|
init_file_io();
|
|
112784
112794
|
init_logger();
|
|
112785
112795
|
import { existsSync as existsSync69 } from "node:fs";
|
|
112786
|
-
import { mkdir as mkdir39, readFile as
|
|
112796
|
+
import { mkdir as mkdir39, readFile as readFile64 } from "node:fs/promises";
|
|
112787
112797
|
import { dirname as dirname45 } from "node:path";
|
|
112788
112798
|
var PROCESSED_ISSUES_CAP = 500;
|
|
112789
112799
|
async function readCkJson(projectDir) {
|
|
@@ -112791,7 +112801,7 @@ async function readCkJson(projectDir) {
|
|
|
112791
112801
|
try {
|
|
112792
112802
|
if (!existsSync69(configPath))
|
|
112793
112803
|
return {};
|
|
112794
|
-
const content = await
|
|
112804
|
+
const content = await readFile64(configPath, "utf-8");
|
|
112795
112805
|
return JSON.parse(content);
|
|
112796
112806
|
} catch (error) {
|
|
112797
112807
|
logger.warning(`Failed to parse .ck.json: ${error instanceof Error ? error.message : "Unknown"}`);
|
|
@@ -113503,7 +113513,7 @@ init_types3();
|
|
|
113503
113513
|
init_logger();
|
|
113504
113514
|
init_path_resolver();
|
|
113505
113515
|
import { existsSync as existsSync84 } from "node:fs";
|
|
113506
|
-
import { mkdir as mkdir41, readFile as
|
|
113516
|
+
import { mkdir as mkdir41, readFile as readFile66, writeFile as writeFile41 } from "node:fs/promises";
|
|
113507
113517
|
import { join as join166 } from "node:path";
|
|
113508
113518
|
|
|
113509
113519
|
class VersionCacheManager {
|
|
@@ -113520,7 +113530,7 @@ class VersionCacheManager {
|
|
|
113520
113530
|
logger.debug("Version check cache not found");
|
|
113521
113531
|
return null;
|
|
113522
113532
|
}
|
|
113523
|
-
const content = await
|
|
113533
|
+
const content = await readFile66(cacheFile, "utf-8");
|
|
113524
113534
|
const cache5 = JSON.parse(content);
|
|
113525
113535
|
if (!cache5.lastCheck || !cache5.currentVersion || !cache5.latestVersion) {
|
|
113526
113536
|
logger.debug("Invalid cache structure, ignoring");
|