claudekit-cli 3.42.2-dev.11 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.42.2-dev.11",
3
- "generatedAt": "2026-05-05T16:35:17.350Z",
2
+ "version": "3.42.2-dev.12",
3
+ "generatedAt": "2026-05-05T17:01:50.472Z",
4
4
  "commands": {
5
5
  "agents": {
6
6
  "name": "agents",
package/dist/index.js CHANGED
@@ -62349,7 +62349,7 @@ var package_default;
62349
62349
  var init_package = __esm(() => {
62350
62350
  package_default = {
62351
62351
  name: "claudekit-cli",
62352
- version: "3.42.2-dev.11",
62352
+ version: "3.42.2-dev.12",
62353
62353
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
62354
62354
  type: "module",
62355
62355
  repository: {
@@ -73505,7 +73505,7 @@ __export(exports_worktree_manager, {
73505
73505
  cleanupAllWorktrees: () => cleanupAllWorktrees
73506
73506
  });
73507
73507
  import { existsSync as existsSync68 } from "node:fs";
73508
- import { readFile as readFile64, writeFile as writeFile37 } from "node:fs/promises";
73508
+ import { readFile as readFile63, writeFile as writeFile37 } from "node:fs/promises";
73509
73509
  import { join as join149 } from "node:path";
73510
73510
  async function createWorktree(projectDir, issueNumber, baseBranch) {
73511
73511
  const worktreePath = join149(projectDir, WORKTREE_DIR, `issue-${issueNumber}`);
@@ -73570,7 +73570,7 @@ async function cleanupAllWorktrees(projectDir) {
73570
73570
  async function ensureGitignore(projectDir) {
73571
73571
  const gitignorePath = join149(projectDir, ".gitignore");
73572
73572
  try {
73573
- const content = existsSync68(gitignorePath) ? await readFile64(gitignorePath, "utf-8") : "";
73573
+ const content = existsSync68(gitignorePath) ? await readFile63(gitignorePath, "utf-8") : "";
73574
73574
  if (!content.includes(".worktrees")) {
73575
73575
  const newContent = content.endsWith(`
73576
73576
  `) ? `${content}.worktrees/
@@ -75492,12 +75492,12 @@ var init_types6 = __esm(() => {
75492
75492
  });
75493
75493
 
75494
75494
  // src/commands/content/phases/state-manager.ts
75495
- import { readFile as readFile66, rename as rename15, writeFile as writeFile40 } from "node:fs/promises";
75495
+ import { readFile as readFile65, rename as rename15, writeFile as writeFile40 } from "node:fs/promises";
75496
75496
  import { join as join162 } from "node:path";
75497
75497
  async function loadContentConfig(projectDir) {
75498
75498
  const configPath = join162(projectDir, CK_CONFIG_FILE2);
75499
75499
  try {
75500
- const raw2 = await readFile66(configPath, "utf-8");
75500
+ const raw2 = await readFile65(configPath, "utf-8");
75501
75501
  const json = JSON.parse(raw2);
75502
75502
  return ContentConfigSchema.parse(json.content ?? {});
75503
75503
  } catch {
@@ -75513,7 +75513,7 @@ async function saveContentConfig(projectDir, config) {
75513
75513
  async function loadContentState(projectDir) {
75514
75514
  const configPath = join162(projectDir, CK_CONFIG_FILE2);
75515
75515
  try {
75516
- const raw2 = await readFile66(configPath, "utf-8");
75516
+ const raw2 = await readFile65(configPath, "utf-8");
75517
75517
  const json = JSON.parse(raw2);
75518
75518
  const contentBlock = json.content ?? {};
75519
75519
  return ContentStateSchema.parse(contentBlock.state ?? {});
@@ -75540,7 +75540,7 @@ async function saveContentState(projectDir, state) {
75540
75540
  }
75541
75541
  async function readJsonSafe(filePath) {
75542
75542
  try {
75543
- const raw2 = await readFile66(filePath, "utf-8");
75543
+ const raw2 = await readFile65(filePath, "utf-8");
75544
75544
  return JSON.parse(raw2);
75545
75545
  } catch {
75546
75546
  return {};
@@ -104640,6 +104640,7 @@ import { basename as basename23, dirname as dirname36, join as join130, resolve
104640
104640
  init_logger();
104641
104641
  init_safe_spinner();
104642
104642
  var import_fs_extra34 = __toESM(require_lib(), 1);
104643
+ var KIT_MANIFEST_FILE = "metadata.json";
104643
104644
  var CLAUDEKIT_SUBDIRECTORIES = ["commands", "agents", "skills", "rules", "hooks"];
104644
104645
  async function analyzeFreshInstallation(claudeDir3) {
104645
104646
  const metadata = await readManifest(claudeDir3);
@@ -104648,7 +104649,8 @@ async function analyzeFreshInstallation(claudeDir3) {
104648
104649
  ckFiles: [],
104649
104650
  ckModifiedFiles: [],
104650
104651
  userFiles: [],
104651
- hasMetadata: false
104652
+ hasMetadata: false,
104653
+ metadata: null
104652
104654
  };
104653
104655
  }
104654
104656
  const allFiles = getAllTrackedFiles(metadata);
@@ -104657,7 +104659,8 @@ async function analyzeFreshInstallation(claudeDir3) {
104657
104659
  ckFiles: [],
104658
104660
  ckModifiedFiles: [],
104659
104661
  userFiles: [],
104660
- hasMetadata: false
104662
+ hasMetadata: false,
104663
+ metadata: null
104661
104664
  };
104662
104665
  }
104663
104666
  const ckFiles = [];
@@ -104680,7 +104683,8 @@ async function analyzeFreshInstallation(claudeDir3) {
104680
104683
  ckFiles,
104681
104684
  ckModifiedFiles,
104682
104685
  userFiles,
104683
- hasMetadata: true
104686
+ hasMetadata: true,
104687
+ metadata
104684
104688
  };
104685
104689
  }
104686
104690
  function cleanupEmptyDirectories2(filePath, claudeDir3) {
@@ -104706,8 +104710,13 @@ function cleanupEmptyDirectories2(filePath, claudeDir3) {
104706
104710
  async function removeFilesByOwnership(claudeDir3, analysis, includeModified) {
104707
104711
  const removedFiles = [];
104708
104712
  const preservedFiles = [];
104709
- const filesToRemove = includeModified ? [...analysis.ckFiles, ...analysis.ckModifiedFiles] : analysis.ckFiles;
104713
+ const allFilesToRemove = includeModified ? [...analysis.ckFiles, ...analysis.ckModifiedFiles] : analysis.ckFiles;
104710
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
+ }
104711
104720
  for (const file of filesToRemove) {
104712
104721
  const fullPath = join130(claudeDir3, file.path);
104713
104722
  if (!existsSync62(fullPath)) {
@@ -104725,8 +104734,8 @@ async function removeFilesByOwnership(claudeDir3, analysis, includeModified) {
104725
104734
  for (const file of filesToPreserve) {
104726
104735
  preservedFiles.push(file.path);
104727
104736
  }
104728
- if (removedFiles.length > 0) {
104729
- await updateMetadataAfterFresh(claudeDir3, removedFiles);
104737
+ if (analysis.metadata) {
104738
+ await updateMetadataAfterFresh(claudeDir3, removedFiles, analysis.metadata);
104730
104739
  }
104731
104740
  return {
104732
104741
  success: true,
@@ -104736,23 +104745,8 @@ async function removeFilesByOwnership(claudeDir3, analysis, includeModified) {
104736
104745
  preservedFiles
104737
104746
  };
104738
104747
  }
104739
- async function updateMetadataAfterFresh(claudeDir3, removedFiles) {
104740
- const metadataPath = join130(claudeDir3, "metadata.json");
104741
- if (!await import_fs_extra34.pathExists(metadataPath)) {
104742
- throw new Error("metadata.json is missing during fresh install cleanup");
104743
- }
104744
- let content;
104745
- try {
104746
- content = await import_fs_extra34.readFile(metadataPath, "utf-8");
104747
- } catch (readError) {
104748
- throw new Error(`Failed to read metadata.json: ${readError instanceof Error ? readError.message : String(readError)}`);
104749
- }
104750
- let metadata;
104751
- try {
104752
- metadata = JSON.parse(content);
104753
- } catch (parseError) {
104754
- throw new Error(`Failed to parse metadata.json: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
104755
- }
104748
+ async function updateMetadataAfterFresh(claudeDir3, removedFiles, metadata) {
104749
+ const metadataPath = join130(claudeDir3, KIT_MANIFEST_FILE);
104756
104750
  const removedSet = new Set(removedFiles);
104757
104751
  if (metadata.kits) {
104758
104752
  for (const kitName of Object.keys(metadata.kits)) {
@@ -104765,11 +104759,14 @@ async function updateMetadataAfterFresh(claudeDir3, removedFiles) {
104765
104759
  if (metadata.files) {
104766
104760
  metadata.files = metadata.files.filter((f3) => !removedSet.has(f3.path));
104767
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
+ }
104768
104765
  try {
104769
104766
  await import_fs_extra34.writeFile(metadataPath, JSON.stringify(metadata, null, 2));
104770
- logger.debug(`Updated metadata.json, removed ${removedFiles.length} file entries`);
104767
+ logger.debug(`Updated ${KIT_MANIFEST_FILE}, removed ${removedFiles.length} file entries`);
104771
104768
  } catch (writeError) {
104772
- throw new Error(`Failed to write metadata.json: ${writeError instanceof Error ? writeError.message : String(writeError)}`);
104769
+ throw new Error(`Failed to write ${KIT_MANIFEST_FILE}: ${writeError instanceof Error ? writeError.message : String(writeError)}`);
104773
104770
  }
104774
104771
  }
104775
104772
  function getFreshBackupTargets(claudeDir3, analysis, includeModified) {
@@ -105245,7 +105242,7 @@ async function handleSelection(ctx) {
105245
105242
  };
105246
105243
  }
105247
105244
  // src/commands/init/phases/sync-handler.ts
105248
- import { copyFile as copyFile8, mkdir as mkdir35, open as open5, readFile as readFile56, rename as rename10, stat as stat22, unlink as unlink12, writeFile as writeFile32 } from "node:fs/promises";
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";
105249
105246
  import { dirname as dirname37, join as join132, resolve as resolve39 } from "node:path";
105250
105247
  init_logger();
105251
105248
  init_path_resolver();
@@ -105413,7 +105410,7 @@ async function executeSyncMerge(ctx) {
105413
105410
  try {
105414
105411
  const sourceMetadataPath = join132(upstreamDir, "metadata.json");
105415
105412
  if (await import_fs_extra36.pathExists(sourceMetadataPath)) {
105416
- const content = await readFile56(sourceMetadataPath, "utf-8");
105413
+ const content = await readFile55(sourceMetadataPath, "utf-8");
105417
105414
  const sourceMetadata = JSON.parse(content);
105418
105415
  deletions = sourceMetadata.deletions || [];
105419
105416
  }
@@ -105711,7 +105708,7 @@ async function renameFolders(dirsToRename, extractDir, options2) {
105711
105708
  // src/services/transformers/folder-transform/path-replacer.ts
105712
105709
  init_logger();
105713
105710
  init_types3();
105714
- import { readFile as readFile57, readdir as readdir40, writeFile as writeFile33 } from "node:fs/promises";
105711
+ import { readFile as readFile56, readdir as readdir40, writeFile as writeFile33 } from "node:fs/promises";
105715
105712
  import { join as join134, relative as relative26 } from "node:path";
105716
105713
  var TRANSFORMABLE_FILE_PATTERNS = [
105717
105714
  ".md",
@@ -105778,7 +105775,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
105778
105775
  if (!shouldTransform)
105779
105776
  continue;
105780
105777
  try {
105781
- const content = await readFile57(fullPath, "utf-8");
105778
+ const content = await readFile56(fullPath, "utf-8");
105782
105779
  let newContent = content;
105783
105780
  let changeCount = 0;
105784
105781
  for (const { regex: regex2, replacement } of compiledReplacements) {
@@ -105900,7 +105897,7 @@ async function transformFolderPaths(extractDir, folders, options2 = {}) {
105900
105897
 
105901
105898
  // src/services/transformers/global-path-transformer.ts
105902
105899
  init_logger();
105903
- import { readFile as readFile58, readdir as readdir41, writeFile as writeFile34 } from "node:fs/promises";
105900
+ import { readFile as readFile57, readdir as readdir41, writeFile as writeFile34 } from "node:fs/promises";
105904
105901
  import { homedir as homedir46, platform as platform15 } from "node:os";
105905
105902
  import { extname as extname6, join as join135 } from "node:path";
105906
105903
  var IS_WINDOWS3 = platform15() === "win32";
@@ -106051,7 +106048,7 @@ async function transformPathsForGlobalInstall(directory, options2 = {}) {
106051
106048
  await processDirectory2(fullPath);
106052
106049
  } else if (entry.isFile() && shouldTransformFile3(entry.name)) {
106053
106050
  try {
106054
- const content = await readFile58(fullPath, "utf-8");
106051
+ const content = await readFile57(fullPath, "utf-8");
106055
106052
  const { transformed, changes } = transformContent(content, {
106056
106053
  targetClaudeDir: options2.targetClaudeDir
106057
106054
  });
@@ -106312,7 +106309,7 @@ async function initCommand(options2) {
106312
106309
  init_dist2();
106313
106310
  var import_picocolors30 = __toESM(require_picocolors(), 1);
106314
106311
  import { existsSync as existsSync63 } from "node:fs";
106315
- import { readFile as readFile62, rm as rm16, unlink as unlink13 } from "node:fs/promises";
106312
+ import { readFile as readFile61, rm as rm16, unlink as unlink13 } from "node:fs/promises";
106316
106313
  import { homedir as homedir51 } from "node:os";
106317
106314
  import { basename as basename25, join as join140, resolve as resolve41 } from "node:path";
106318
106315
  init_logger();
@@ -106786,13 +106783,13 @@ init_model_taxonomy();
106786
106783
  init_logger();
106787
106784
  init_dist2();
106788
106785
  init_model_taxonomy();
106789
- import { mkdir as mkdir37, readFile as readFile61, writeFile as writeFile36 } from "node:fs/promises";
106786
+ import { mkdir as mkdir37, readFile as readFile60, writeFile as writeFile36 } from "node:fs/promises";
106790
106787
  import { homedir as homedir50 } from "node:os";
106791
106788
  import { dirname as dirname38, join as join139 } from "node:path";
106792
106789
 
106793
106790
  // src/commands/portable/models-dev-cache.ts
106794
106791
  init_logger();
106795
- import { mkdir as mkdir36, readFile as readFile59, rename as rename12, writeFile as writeFile35 } from "node:fs/promises";
106792
+ import { mkdir as mkdir36, readFile as readFile58, rename as rename12, writeFile as writeFile35 } from "node:fs/promises";
106796
106793
  import { homedir as homedir48 } from "node:os";
106797
106794
  import { join as join137 } from "node:path";
106798
106795
 
@@ -106817,7 +106814,7 @@ function tmpFilePath(cacheDir) {
106817
106814
  async function readCacheEntry(cacheDir) {
106818
106815
  const filePath = cacheFilePath(cacheDir);
106819
106816
  try {
106820
- const raw2 = await readFile59(filePath, "utf-8");
106817
+ const raw2 = await readFile58(filePath, "utf-8");
106821
106818
  const parsed = JSON.parse(raw2);
106822
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) {
106823
106820
  return parsed;
@@ -106885,7 +106882,7 @@ async function getModelsDevCatalog(opts = {}) {
106885
106882
 
106886
106883
  // src/commands/portable/opencode-model-discovery.ts
106887
106884
  init_logger();
106888
- import { readFile as readFile60 } from "node:fs/promises";
106885
+ import { readFile as readFile59 } from "node:fs/promises";
106889
106886
  import { homedir as homedir49, platform as platform17 } from "node:os";
106890
106887
  import { join as join138 } from "node:path";
106891
106888
  function resolveOpenCodeAuthPath(homeDir) {
@@ -106899,7 +106896,7 @@ function resolveOpenCodeAuthPath(homeDir) {
106899
106896
  async function readAuthedProviders(homeDir) {
106900
106897
  const authPath = resolveOpenCodeAuthPath(homeDir);
106901
106898
  try {
106902
- const raw2 = await readFile60(authPath, "utf-8");
106899
+ const raw2 = await readFile59(authPath, "utf-8");
106903
106900
  const parsed = JSON.parse(raw2);
106904
106901
  if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
106905
106902
  return Object.keys(parsed);
@@ -107101,7 +107098,7 @@ async function ensureOpenCodeModel(options2) {
107101
107098
  const configPath = getOpenCodeConfigPath(options2);
107102
107099
  let existing = null;
107103
107100
  try {
107104
- const raw2 = await readFile61(configPath, "utf-8");
107101
+ const raw2 = await readFile60(configPath, "utf-8");
107105
107102
  const parsed = JSON.parse(raw2);
107106
107103
  if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
107107
107104
  existing = parsed;
@@ -107961,7 +107958,7 @@ async function processMetadataDeletions(skillSourcePath, installGlobally) {
107961
107958
  return;
107962
107959
  let sourceMetadata;
107963
107960
  try {
107964
- const content = await readFile62(sourceMetadataPath, "utf-8");
107961
+ const content = await readFile61(sourceMetadataPath, "utf-8");
107965
107962
  sourceMetadata = JSON.parse(content);
107966
107963
  } catch (error) {
107967
107964
  logger.debug(`[migrate] Failed to parse source metadata.json: ${error}`);
@@ -108255,7 +108252,7 @@ async function migrateCommand(options2) {
108255
108252
  for (const action of conflictActions) {
108256
108253
  if (!action.diff && action.targetPath && existsSync63(action.targetPath)) {
108257
108254
  try {
108258
- const targetContent = await readFile62(action.targetPath, "utf-8");
108255
+ const targetContent = await readFile61(action.targetPath, "utf-8");
108259
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);
108260
108257
  if (sourceItem) {
108261
108258
  const providerConfig = providers[action.provider];
@@ -110233,7 +110230,7 @@ init_skills_registry();
110233
110230
  init_skills_uninstaller();
110234
110231
  var import_gray_matter11 = __toESM(require_gray_matter(), 1);
110235
110232
  var import_picocolors37 = __toESM(require_picocolors(), 1);
110236
- import { readFile as readFile63 } from "node:fs/promises";
110233
+ import { readFile as readFile62 } from "node:fs/promises";
110237
110234
  import { join as join146 } from "node:path";
110238
110235
 
110239
110236
  // src/commands/skills/types.ts
@@ -110358,7 +110355,7 @@ async function handleValidate2(sourcePath) {
110358
110355
  for (const skill of skills) {
110359
110356
  const skillMdPath = join146(skill.path, "SKILL.md");
110360
110357
  try {
110361
- const content = await readFile63(skillMdPath, "utf-8");
110358
+ const content = await readFile62(skillMdPath, "utf-8");
110362
110359
  const { data } = import_gray_matter11.default(content, {
110363
110360
  engines: { javascript: { parse: () => ({}) } }
110364
110361
  });
@@ -112796,7 +112793,7 @@ init_ck_config_manager();
112796
112793
  init_file_io();
112797
112794
  init_logger();
112798
112795
  import { existsSync as existsSync69 } from "node:fs";
112799
- import { mkdir as mkdir39, readFile as readFile65 } from "node:fs/promises";
112796
+ import { mkdir as mkdir39, readFile as readFile64 } from "node:fs/promises";
112800
112797
  import { dirname as dirname45 } from "node:path";
112801
112798
  var PROCESSED_ISSUES_CAP = 500;
112802
112799
  async function readCkJson(projectDir) {
@@ -112804,7 +112801,7 @@ async function readCkJson(projectDir) {
112804
112801
  try {
112805
112802
  if (!existsSync69(configPath))
112806
112803
  return {};
112807
- const content = await readFile65(configPath, "utf-8");
112804
+ const content = await readFile64(configPath, "utf-8");
112808
112805
  return JSON.parse(content);
112809
112806
  } catch (error) {
112810
112807
  logger.warning(`Failed to parse .ck.json: ${error instanceof Error ? error.message : "Unknown"}`);
@@ -113516,7 +113513,7 @@ init_types3();
113516
113513
  init_logger();
113517
113514
  init_path_resolver();
113518
113515
  import { existsSync as existsSync84 } from "node:fs";
113519
- import { mkdir as mkdir41, readFile as readFile67, writeFile as writeFile41 } from "node:fs/promises";
113516
+ import { mkdir as mkdir41, readFile as readFile66, writeFile as writeFile41 } from "node:fs/promises";
113520
113517
  import { join as join166 } from "node:path";
113521
113518
 
113522
113519
  class VersionCacheManager {
@@ -113533,7 +113530,7 @@ class VersionCacheManager {
113533
113530
  logger.debug("Version check cache not found");
113534
113531
  return null;
113535
113532
  }
113536
- const content = await readFile67(cacheFile, "utf-8");
113533
+ const content = await readFile66(cacheFile, "utf-8");
113537
113534
  const cache5 = JSON.parse(content);
113538
113535
  if (!cache5.lastCheck || !cache5.currentVersion || !cache5.latestVersion) {
113539
113536
  logger.debug("Invalid cache structure, ignoring");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudekit-cli",
3
- "version": "3.42.2-dev.11",
3
+ "version": "3.42.2-dev.12",
4
4
  "description": "CLI tool for bootstrapping and updating ClaudeKit projects",
5
5
  "type": "module",
6
6
  "repository": {