claudekit-cli 4.5.2-dev.2 → 4.5.2-dev.3

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": "4.5.2-dev.2",
3
- "generatedAt": "2026-07-03T23:45:55.887Z",
2
+ "version": "4.5.2-dev.3",
3
+ "generatedAt": "2026-07-06T11:49:03.646Z",
4
4
  "commands": {
5
5
  "agents": {
6
6
  "name": "agents",
package/dist/index.js CHANGED
@@ -15560,6 +15560,128 @@ var init_types2 = __esm(() => {
15560
15560
  });
15561
15561
  });
15562
15562
 
15563
+ // node_modules/compare-versions/lib/umd/index.js
15564
+ var require_umd = __commonJS((exports, module) => {
15565
+ (function(global2, factory) {
15566
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.compareVersions = {}));
15567
+ })(exports, function(exports2) {
15568
+ const semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
15569
+ const validateAndParse = (version) => {
15570
+ if (typeof version !== "string") {
15571
+ throw new TypeError("Invalid argument expected string");
15572
+ }
15573
+ const match = version.match(semver);
15574
+ if (!match) {
15575
+ throw new Error(`Invalid argument not valid semver ('${version}' received)`);
15576
+ }
15577
+ match.shift();
15578
+ return match;
15579
+ };
15580
+ const isWildcard = (s) => s === "*" || s === "x" || s === "X";
15581
+ const tryParse = (v2) => {
15582
+ const n = parseInt(v2, 10);
15583
+ return isNaN(n) ? v2 : n;
15584
+ };
15585
+ const forceType = (a3, b3) => typeof a3 !== typeof b3 ? [String(a3), String(b3)] : [a3, b3];
15586
+ const compareStrings = (a3, b3) => {
15587
+ if (isWildcard(a3) || isWildcard(b3))
15588
+ return 0;
15589
+ const [ap, bp] = forceType(tryParse(a3), tryParse(b3));
15590
+ if (ap > bp)
15591
+ return 1;
15592
+ if (ap < bp)
15593
+ return -1;
15594
+ return 0;
15595
+ };
15596
+ const compareSegments = (a3, b3) => {
15597
+ for (let i = 0;i < Math.max(a3.length, b3.length); i++) {
15598
+ const r2 = compareStrings(a3[i] || "0", b3[i] || "0");
15599
+ if (r2 !== 0)
15600
+ return r2;
15601
+ }
15602
+ return 0;
15603
+ };
15604
+ const compareVersions = (v1, v2) => {
15605
+ const n1 = validateAndParse(v1);
15606
+ const n2 = validateAndParse(v2);
15607
+ const p1 = n1.pop();
15608
+ const p2 = n2.pop();
15609
+ const r2 = compareSegments(n1, n2);
15610
+ if (r2 !== 0)
15611
+ return r2;
15612
+ if (p1 && p2) {
15613
+ return compareSegments(p1.split("."), p2.split("."));
15614
+ } else if (p1 || p2) {
15615
+ return p1 ? -1 : 1;
15616
+ }
15617
+ return 0;
15618
+ };
15619
+ const compare = (v1, v2, operator) => {
15620
+ assertValidOperator(operator);
15621
+ const res = compareVersions(v1, v2);
15622
+ return operatorResMap[operator].includes(res);
15623
+ };
15624
+ const operatorResMap = {
15625
+ ">": [1],
15626
+ ">=": [0, 1],
15627
+ "=": [0],
15628
+ "<=": [-1, 0],
15629
+ "<": [-1],
15630
+ "!=": [-1, 1]
15631
+ };
15632
+ const allowedOperators = Object.keys(operatorResMap);
15633
+ const assertValidOperator = (op) => {
15634
+ if (typeof op !== "string") {
15635
+ throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
15636
+ }
15637
+ if (allowedOperators.indexOf(op) === -1) {
15638
+ throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`);
15639
+ }
15640
+ };
15641
+ const satisfies = (version, range) => {
15642
+ range = range.replace(/([><=]+)\s+/g, "$1");
15643
+ if (range.includes("||")) {
15644
+ return range.split("||").some((r5) => satisfies(version, r5));
15645
+ } else if (range.includes(" - ")) {
15646
+ const [a3, b3] = range.split(" - ", 2);
15647
+ return satisfies(version, `>=${a3} <=${b3}`);
15648
+ } else if (range.includes(" ")) {
15649
+ return range.trim().replace(/\s{2,}/g, " ").split(" ").every((r5) => satisfies(version, r5));
15650
+ }
15651
+ const m2 = range.match(/^([<>=~^]+)/);
15652
+ const op = m2 ? m2[1] : "=";
15653
+ if (op !== "^" && op !== "~")
15654
+ return compare(version, range, op);
15655
+ const [v1, v2, v3, , vp] = validateAndParse(version);
15656
+ const [r1, r2, r3, , rp] = validateAndParse(range);
15657
+ const v4 = [v1, v2, v3];
15658
+ const r4 = [r1, r2 !== null && r2 !== undefined ? r2 : "x", r3 !== null && r3 !== undefined ? r3 : "x"];
15659
+ if (rp) {
15660
+ if (!vp)
15661
+ return false;
15662
+ if (compareSegments(v4, r4) !== 0)
15663
+ return false;
15664
+ if (compareSegments(vp.split("."), rp.split(".")) === -1)
15665
+ return false;
15666
+ }
15667
+ const nonZero = r4.findIndex((v5) => v5 !== "0") + 1;
15668
+ const i = op === "~" ? 2 : nonZero > 1 ? nonZero : 1;
15669
+ if (compareSegments(v4.slice(0, i), r4.slice(0, i)) !== 0)
15670
+ return false;
15671
+ if (compareSegments(v4.slice(i), r4.slice(i)) === -1)
15672
+ return false;
15673
+ return true;
15674
+ };
15675
+ const validate = (version) => typeof version === "string" && /^[v\d]/.test(version) && semver.test(version);
15676
+ const validateStrict = (version) => typeof version === "string" && /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(version);
15677
+ exports2.compare = compare;
15678
+ exports2.compareVersions = compareVersions;
15679
+ exports2.satisfies = satisfies;
15680
+ exports2.validate = validate;
15681
+ exports2.validateStrict = validateStrict;
15682
+ });
15683
+ });
15684
+
15563
15685
  // src/domains/installation/plugin/install-mode-detector.ts
15564
15686
  import { createHash as createHash4 } from "node:crypto";
15565
15687
  import { existsSync as existsSync6, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync as statSync2 } from "node:fs";
@@ -15605,7 +15727,7 @@ function detectPluginState(claudeDir) {
15605
15727
  state.marketplace = state.marketplace ?? marketplace;
15606
15728
  const versions = safeReaddir(ckDir).filter((v2) => isDir(join6(ckDir, v2)));
15607
15729
  if (versions.length > 0 && state.version === null) {
15608
- state.version = versions.map((v2) => ({ v: v2, mtime: statMtime(join6(ckDir, v2)) })).sort((a3, b3) => b3.mtime - a3.mtime)[0].v;
15730
+ state.version = selectPluginCacheVersion(versions, ckDir);
15609
15731
  }
15610
15732
  if (!state.installed)
15611
15733
  state.staleCache = true;
@@ -15615,6 +15737,24 @@ function detectPluginState(claudeDir) {
15615
15737
  }
15616
15738
  return state;
15617
15739
  }
15740
+ function selectPluginCacheVersion(versions, ckDir) {
15741
+ const comparable = versions.filter(isComparableSemver);
15742
+ if (comparable.length > 0) {
15743
+ return comparable.sort((a3, b3) => import_compare_versions.compareVersions(normalizeVersion(b3), normalizeVersion(a3)))[0];
15744
+ }
15745
+ return versions.map((v2) => ({ v: v2, mtime: statMtime(join6(ckDir, v2)) })).sort((a3, b3) => b3.mtime - a3.mtime)[0].v;
15746
+ }
15747
+ function isComparableSemver(version) {
15748
+ try {
15749
+ import_compare_versions.compareVersions(normalizeVersion(version), normalizeVersion(version));
15750
+ return true;
15751
+ } catch {
15752
+ return false;
15753
+ }
15754
+ }
15755
+ function normalizeVersion(version) {
15756
+ return version.replace(/^v/, "");
15757
+ }
15618
15758
  function detectLegacyState(claudeDir) {
15619
15759
  const metadata = readJsonSafe(join6(claudeDir, "metadata.json"));
15620
15760
  if (!isRecord(metadata))
@@ -15773,9 +15913,10 @@ function statMtime(p) {
15773
15913
  return 0;
15774
15914
  }
15775
15915
  }
15776
- var CK_PLUGIN_NAME = "ck", CK_MARKETPLACE_NAME = "claudekit", ENGINEER_KIT_KEY = "engineer", PLUGIN_SUPPLIED_LEGACY_PREFIXES;
15916
+ var import_compare_versions, CK_PLUGIN_NAME = "ck", CK_MARKETPLACE_NAME = "claudekit", ENGINEER_KIT_KEY = "engineer", PLUGIN_SUPPLIED_LEGACY_PREFIXES;
15777
15917
  var init_install_mode_detector = __esm(() => {
15778
15918
  init_path_resolver();
15919
+ import_compare_versions = __toESM(require_umd(), 1);
15779
15920
  PLUGIN_SUPPLIED_LEGACY_PREFIXES = ["agents/", "skills/"];
15780
15921
  });
15781
15922
 
@@ -64591,7 +64732,7 @@ var package_default;
64591
64732
  var init_package = __esm(() => {
64592
64733
  package_default = {
64593
64734
  name: "claudekit-cli",
64594
- version: "4.5.2-dev.2",
64735
+ version: "4.5.2-dev.3",
64595
64736
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
64596
64737
  type: "module",
64597
64738
  repository: {
@@ -64713,142 +64854,20 @@ var init_package = __esm(() => {
64713
64854
  };
64714
64855
  });
64715
64856
 
64716
- // node_modules/compare-versions/lib/umd/index.js
64717
- var require_umd = __commonJS((exports, module) => {
64718
- (function(global3, factory) {
64719
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global3 = typeof globalThis !== "undefined" ? globalThis : global3 || self, factory(global3.compareVersions = {}));
64720
- })(exports, function(exports2) {
64721
- const semver3 = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
64722
- const validateAndParse = (version) => {
64723
- if (typeof version !== "string") {
64724
- throw new TypeError("Invalid argument expected string");
64725
- }
64726
- const match = version.match(semver3);
64727
- if (!match) {
64728
- throw new Error(`Invalid argument not valid semver ('${version}' received)`);
64729
- }
64730
- match.shift();
64731
- return match;
64732
- };
64733
- const isWildcard = (s) => s === "*" || s === "x" || s === "X";
64734
- const tryParse = (v2) => {
64735
- const n = parseInt(v2, 10);
64736
- return isNaN(n) ? v2 : n;
64737
- };
64738
- const forceType = (a3, b3) => typeof a3 !== typeof b3 ? [String(a3), String(b3)] : [a3, b3];
64739
- const compareStrings = (a3, b3) => {
64740
- if (isWildcard(a3) || isWildcard(b3))
64741
- return 0;
64742
- const [ap, bp] = forceType(tryParse(a3), tryParse(b3));
64743
- if (ap > bp)
64744
- return 1;
64745
- if (ap < bp)
64746
- return -1;
64747
- return 0;
64748
- };
64749
- const compareSegments = (a3, b3) => {
64750
- for (let i = 0;i < Math.max(a3.length, b3.length); i++) {
64751
- const r2 = compareStrings(a3[i] || "0", b3[i] || "0");
64752
- if (r2 !== 0)
64753
- return r2;
64754
- }
64755
- return 0;
64756
- };
64757
- const compareVersions = (v1, v2) => {
64758
- const n1 = validateAndParse(v1);
64759
- const n2 = validateAndParse(v2);
64760
- const p1 = n1.pop();
64761
- const p2 = n2.pop();
64762
- const r2 = compareSegments(n1, n2);
64763
- if (r2 !== 0)
64764
- return r2;
64765
- if (p1 && p2) {
64766
- return compareSegments(p1.split("."), p2.split("."));
64767
- } else if (p1 || p2) {
64768
- return p1 ? -1 : 1;
64769
- }
64770
- return 0;
64771
- };
64772
- const compare = (v1, v2, operator) => {
64773
- assertValidOperator(operator);
64774
- const res = compareVersions(v1, v2);
64775
- return operatorResMap[operator].includes(res);
64776
- };
64777
- const operatorResMap = {
64778
- ">": [1],
64779
- ">=": [0, 1],
64780
- "=": [0],
64781
- "<=": [-1, 0],
64782
- "<": [-1],
64783
- "!=": [-1, 1]
64784
- };
64785
- const allowedOperators = Object.keys(operatorResMap);
64786
- const assertValidOperator = (op) => {
64787
- if (typeof op !== "string") {
64788
- throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
64789
- }
64790
- if (allowedOperators.indexOf(op) === -1) {
64791
- throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`);
64792
- }
64793
- };
64794
- const satisfies = (version, range) => {
64795
- range = range.replace(/([><=]+)\s+/g, "$1");
64796
- if (range.includes("||")) {
64797
- return range.split("||").some((r5) => satisfies(version, r5));
64798
- } else if (range.includes(" - ")) {
64799
- const [a3, b3] = range.split(" - ", 2);
64800
- return satisfies(version, `>=${a3} <=${b3}`);
64801
- } else if (range.includes(" ")) {
64802
- return range.trim().replace(/\s{2,}/g, " ").split(" ").every((r5) => satisfies(version, r5));
64803
- }
64804
- const m2 = range.match(/^([<>=~^]+)/);
64805
- const op = m2 ? m2[1] : "=";
64806
- if (op !== "^" && op !== "~")
64807
- return compare(version, range, op);
64808
- const [v1, v2, v3, , vp] = validateAndParse(version);
64809
- const [r1, r2, r3, , rp] = validateAndParse(range);
64810
- const v4 = [v1, v2, v3];
64811
- const r4 = [r1, r2 !== null && r2 !== undefined ? r2 : "x", r3 !== null && r3 !== undefined ? r3 : "x"];
64812
- if (rp) {
64813
- if (!vp)
64814
- return false;
64815
- if (compareSegments(v4, r4) !== 0)
64816
- return false;
64817
- if (compareSegments(vp.split("."), rp.split(".")) === -1)
64818
- return false;
64819
- }
64820
- const nonZero = r4.findIndex((v5) => v5 !== "0") + 1;
64821
- const i = op === "~" ? 2 : nonZero > 1 ? nonZero : 1;
64822
- if (compareSegments(v4.slice(0, i), r4.slice(0, i)) !== 0)
64823
- return false;
64824
- if (compareSegments(v4.slice(i), r4.slice(i)) === -1)
64825
- return false;
64826
- return true;
64827
- };
64828
- const validate2 = (version) => typeof version === "string" && /^[v\d]/.test(version) && semver3.test(version);
64829
- const validateStrict = (version) => typeof version === "string" && /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(version);
64830
- exports2.compare = compare;
64831
- exports2.compareVersions = compareVersions;
64832
- exports2.satisfies = satisfies;
64833
- exports2.validate = validate2;
64834
- exports2.validateStrict = validateStrict;
64835
- });
64836
- });
64837
-
64838
64857
  // src/domains/versioning/checking/version-utils.ts
64839
64858
  function isUpdateCheckDisabled() {
64840
64859
  return process.env.NO_UPDATE_NOTIFIER === "1" || process.env.NO_UPDATE_NOTIFIER === "true" || !process.stdout.isTTY;
64841
64860
  }
64842
- function normalizeVersion(version) {
64861
+ function normalizeVersion2(version) {
64843
64862
  return version.replace(/^v/i, "");
64844
64863
  }
64845
64864
  function isPrereleaseVersion(version) {
64846
64865
  if (!version)
64847
64866
  return false;
64848
- return /-(beta|alpha|rc|dev)[.\d]/i.test(normalizeVersion(version));
64867
+ return /-(beta|alpha|rc|dev)[.\d]/i.test(normalizeVersion2(version));
64849
64868
  }
64850
64869
  function parseVersionParts(version) {
64851
- const normalized = normalizeVersion(version);
64870
+ const normalized = normalizeVersion2(version);
64852
64871
  const [base, ...prereleaseParts] = normalized.split("-");
64853
64872
  return {
64854
64873
  base,
@@ -64865,23 +64884,23 @@ function isPrereleaseOfSameBase(currentVersion, latestVersion) {
64865
64884
  return current.base === latest.base;
64866
64885
  }
64867
64886
  function versionsMatch(installed, latest) {
64868
- return normalizeVersion(installed) === normalizeVersion(latest);
64887
+ return normalizeVersion2(installed) === normalizeVersion2(latest);
64869
64888
  }
64870
64889
  function isNewerVersion(currentVersion, latestVersion) {
64871
64890
  try {
64872
- const current = normalizeVersion(currentVersion);
64873
- const latest = normalizeVersion(latestVersion);
64891
+ const current = normalizeVersion2(currentVersion);
64892
+ const latest = normalizeVersion2(latestVersion);
64874
64893
  if (isPrereleaseOfSameBase(current, latest)) {
64875
64894
  return false;
64876
64895
  }
64877
- return import_compare_versions.compareVersions(latest, current) > 0;
64896
+ return import_compare_versions2.compareVersions(latest, current) > 0;
64878
64897
  } catch {
64879
64898
  return false;
64880
64899
  }
64881
64900
  }
64882
- var import_compare_versions;
64901
+ var import_compare_versions2;
64883
64902
  var init_version_utils = __esm(() => {
64884
- import_compare_versions = __toESM(require_umd(), 1);
64903
+ import_compare_versions2 = __toESM(require_umd(), 1);
64885
64904
  });
64886
64905
 
64887
64906
  // src/commands/update/error.ts
@@ -64965,7 +64984,7 @@ var init_registry_client = __esm(() => {
64965
64984
 
64966
64985
  // src/commands/update/version-comparator.ts
64967
64986
  function compareCliVersions(currentVersion, targetVersion, opts) {
64968
- const comparison = import_compare_versions2.compareVersions(currentVersion, targetVersion);
64987
+ const comparison = import_compare_versions3.compareVersions(currentVersion, targetVersion);
64969
64988
  if (comparison === 0) {
64970
64989
  return { status: "up-to-date" };
64971
64990
  }
@@ -64987,10 +65006,10 @@ function parseCliVersionFromOutput(output2) {
64987
65006
  const match = output2.match(/CLI Version:\s*(\S+)/);
64988
65007
  return match ? match[1] : null;
64989
65008
  }
64990
- var import_compare_versions2;
65009
+ var import_compare_versions3;
64991
65010
  var init_version_comparator = __esm(() => {
64992
65011
  init_version_utils();
64993
- import_compare_versions2 = __toESM(require_umd(), 1);
65012
+ import_compare_versions3 = __toESM(require_umd(), 1);
64994
65013
  });
64995
65014
 
64996
65015
  // src/commands/update/package-manager-runner.ts
@@ -68254,7 +68273,7 @@ class VersionFormatter {
68254
68273
  static compare(v1, v2) {
68255
68274
  const normV1 = VersionFormatter.normalize(v1);
68256
68275
  const normV2 = VersionFormatter.normalize(v2);
68257
- return import_compare_versions3.compareVersions(normV1, normV2);
68276
+ return import_compare_versions4.compareVersions(normV1, normV2);
68258
68277
  }
68259
68278
  static formatRelativeTime(dateString) {
68260
68279
  if (!dateString)
@@ -68342,20 +68361,20 @@ class VersionFormatter {
68342
68361
  const majorA = Number.parseInt(normA.split(".")[0], 10);
68343
68362
  const majorB = Number.parseInt(normB.split(".")[0], 10);
68344
68363
  if (majorA === 0 && majorB === 0) {
68345
- return import_compare_versions3.compareVersions(normB, normA);
68364
+ return import_compare_versions4.compareVersions(normB, normA);
68346
68365
  }
68347
68366
  if (majorA === 0)
68348
68367
  return 1;
68349
68368
  if (majorB === 0)
68350
68369
  return -1;
68351
- return import_compare_versions3.compareVersions(normB, normA);
68370
+ return import_compare_versions4.compareVersions(normB, normA);
68352
68371
  });
68353
68372
  }
68354
68373
  }
68355
- var import_compare_versions3;
68374
+ var import_compare_versions4;
68356
68375
  var init_version_formatter = __esm(() => {
68357
68376
  init_logger();
68358
- import_compare_versions3 = __toESM(require_umd(), 1);
68377
+ import_compare_versions4 = __toESM(require_umd(), 1);
68359
68378
  });
68360
68379
 
68361
68380
  // src/domains/versioning/release-filter.ts
@@ -69700,7 +69719,7 @@ class ConfigVersionChecker {
69700
69719
  return isPrereleaseVersion(currentVersion) ? "beta" : "stable";
69701
69720
  }
69702
69721
  static isValidSemverCore(version) {
69703
- const [coreVersion] = normalizeVersion(version).split(/[-+]/, 1);
69722
+ const [coreVersion] = normalizeVersion2(version).split(/[-+]/, 1);
69704
69723
  const coreParts = coreVersion?.split(".") ?? [];
69705
69724
  return coreParts.length === 3 && coreParts.every((part) => /^\d+$/.test(part));
69706
69725
  }
@@ -69711,12 +69730,12 @@ class ConfigVersionChecker {
69711
69730
  if (!tagName || tagName.length > 256) {
69712
69731
  continue;
69713
69732
  }
69714
- const normalizedVersion = normalizeVersion(tagName);
69733
+ const normalizedVersion = normalizeVersion2(tagName);
69715
69734
  if (!ConfigVersionChecker.isValidSemverCore(normalizedVersion)) {
69716
69735
  logger.debug(`Invalid version format from GitHub: ${tagName}`);
69717
69736
  continue;
69718
69737
  }
69719
- if (!highestVersion || import_compare_versions4.compareVersions(normalizedVersion, highestVersion) > 0) {
69738
+ if (!highestVersion || import_compare_versions5.compareVersions(normalizedVersion, highestVersion) > 0) {
69720
69739
  highestVersion = normalizedVersion;
69721
69740
  }
69722
69741
  }
@@ -69829,7 +69848,7 @@ class ConfigVersionChecker {
69829
69848
  return null;
69830
69849
  }
69831
69850
  static async checkForUpdates(kitType, currentVersion, global3 = false, channel) {
69832
- const normalizedCurrent = normalizeVersion(currentVersion);
69851
+ const normalizedCurrent = normalizeVersion2(currentVersion);
69833
69852
  const resolvedChannel = ConfigVersionChecker.resolveChannel(normalizedCurrent, channel);
69834
69853
  const cache3 = await ConfigVersionChecker.loadCache(kitType, global3, resolvedChannel);
69835
69854
  const now = Date.now();
@@ -69904,13 +69923,13 @@ class ConfigVersionChecker {
69904
69923
  }
69905
69924
  }
69906
69925
  }
69907
- var import_compare_versions4, CACHE_TTL_HOURS = 24, DEFAULT_CACHE_TTL_MS, MIN_CACHE_TTL_MS, MAX_CACHE_TTL_MS, CACHE_TTL_MS, GITHUB_API_TIMEOUT_MS = 1e4, CACHE_FILENAME = "config-update-cache.json", RELEASES_PER_PAGE = 100, KIT_REPOS;
69926
+ var import_compare_versions5, CACHE_TTL_HOURS = 24, DEFAULT_CACHE_TTL_MS, MIN_CACHE_TTL_MS, MAX_CACHE_TTL_MS, CACHE_TTL_MS, GITHUB_API_TIMEOUT_MS = 1e4, CACHE_FILENAME = "config-update-cache.json", RELEASES_PER_PAGE = 100, KIT_REPOS;
69908
69927
  var init_config_version_checker = __esm(() => {
69909
69928
  init_version_utils();
69910
69929
  init_claudekit_constants();
69911
69930
  init_logger();
69912
69931
  init_path_resolver();
69913
- import_compare_versions4 = __toESM(require_umd(), 1);
69932
+ import_compare_versions5 = __toESM(require_umd(), 1);
69914
69933
  DEFAULT_CACHE_TTL_MS = CACHE_TTL_HOURS * 60 * 60 * 1000;
69915
69934
  MIN_CACHE_TTL_MS = 60 * 1000;
69916
69935
  MAX_CACHE_TTL_MS = 7 * 24 * 60 * 60 * 1000;
@@ -69958,7 +69977,7 @@ function hasCliUpdate(currentVersion, latestVersion) {
69958
69977
  return false;
69959
69978
  }
69960
69979
  try {
69961
- return import_compare_versions5.compareVersions(normalizeVersion(latestVersion), normalizeVersion(currentVersion)) > 0;
69980
+ return import_compare_versions6.compareVersions(normalizeVersion2(latestVersion), normalizeVersion2(currentVersion)) > 0;
69962
69981
  } catch (error) {
69963
69982
  logger.debug(`Version comparison failed for "${currentVersion}" vs "${latestVersion}": ${error}`);
69964
69983
  return latestVersion !== currentVersion;
@@ -70229,7 +70248,7 @@ async function getKitMetadata2(kitName) {
70229
70248
  return null;
70230
70249
  }
70231
70250
  }
70232
- var import_compare_versions5, versionCache, CACHE_TTL_MS2;
70251
+ var import_compare_versions6, versionCache, CACHE_TTL_MS2;
70233
70252
  var init_system_routes = __esm(() => {
70234
70253
  init_update_cli();
70235
70254
  init_github_client();
@@ -70242,7 +70261,7 @@ var init_system_routes = __esm(() => {
70242
70261
  init_path_resolver();
70243
70262
  init_kit();
70244
70263
  init_package();
70245
- import_compare_versions5 = __toESM(require_umd(), 1);
70264
+ import_compare_versions6 = __toESM(require_umd(), 1);
70246
70265
  versionCache = new Map;
70247
70266
  CACHE_TTL_MS2 = 5 * 60 * 1000;
70248
70267
  });
@@ -88639,7 +88658,7 @@ init_logger();
88639
88658
  import { readFileSync as readFileSync17 } from "node:fs";
88640
88659
  var MIN_GH_CLI_VERSION = "2.20.0";
88641
88660
  var GH_COMMAND_TIMEOUT_MS = 1e4;
88642
- function compareVersions6(a3, b3) {
88661
+ function compareVersions7(a3, b3) {
88643
88662
  const partsA = a3.split(".").map(Number);
88644
88663
  const partsB = b3.split(".").map(Number);
88645
88664
  const maxLen = Math.max(partsA.length, partsB.length);
@@ -88860,7 +88879,7 @@ async function getCommandVersion(command, versionFlag, versionRegex) {
88860
88879
  return null;
88861
88880
  }
88862
88881
  }
88863
- function compareVersions7(current, required) {
88882
+ function compareVersions8(current, required) {
88864
88883
  const parseCurrent = current.split(".").map((n) => Number.parseInt(n, 10));
88865
88884
  const parseRequired = required.split(".").map((n) => Number.parseInt(n, 10));
88866
88885
  for (let i = 0;i < 3; i++) {
@@ -88884,7 +88903,7 @@ async function checkDependency(config) {
88884
88903
  let meetsRequirements = true;
88885
88904
  let message;
88886
88905
  if (config.minVersion && version) {
88887
- meetsRequirements = compareVersions7(version, config.minVersion);
88906
+ meetsRequirements = compareVersions8(version, config.minVersion);
88888
88907
  if (!meetsRequirements) {
88889
88908
  message = `Version ${version} is below minimum ${config.minVersion}`;
88890
88909
  }
@@ -89279,7 +89298,7 @@ class SystemChecker {
89279
89298
  const { stdout } = await execAsync6("gh --version");
89280
89299
  const match = stdout.match(/(\d+\.\d+\.\d+)/);
89281
89300
  const version = match?.[1];
89282
- if (version && compareVersions6(version, MIN_GH_CLI_VERSION) < 0) {
89301
+ if (version && compareVersions7(version, MIN_GH_CLI_VERSION) < 0) {
89283
89302
  return {
89284
89303
  id: "gh-cli-version",
89285
89304
  name: "GitHub CLI",
@@ -109710,6 +109729,7 @@ async function migrateLegacyToPlugin(opts) {
109710
109729
  const ts = opts.now ?? new Date().toISOString();
109711
109730
  const before = detectInstallMode(claudeDir3);
109712
109731
  if (before.mode === "plugin") {
109732
+ prunePluginSuppliedLegacyFilesFromMetadata(claudeDir3);
109713
109733
  return base("noop-already-plugin", before.mode, before.plugin.enabled);
109714
109734
  }
109715
109735
  if (!await installer.isClaudeAvailable() || !await installer.isPluginSupported()) {
@@ -109735,6 +109755,7 @@ async function migrateLegacyToPlugin(opts) {
109735
109755
  backupDir = join137(claudeDir3, "backups", `ck-legacy-${ts.replace(/[:.]/g, "-")}`);
109736
109756
  mkdirSync5(backupDir, { recursive: true });
109737
109757
  removedPaths = removeLegacy(claudeDir3, backupDir);
109758
+ prunePluginSuppliedLegacyFilesFromMetadata(claudeDir3, removedPaths);
109738
109759
  }
109739
109760
  const installedVersion = detectPluginState(claudeDir3).version;
109740
109761
  const receiptPath = writeReceipt(claudeDir3, {
@@ -109958,6 +109979,45 @@ function collectTrackedFiles2(meta) {
109958
109979
  }
109959
109980
  return out;
109960
109981
  }
109982
+ function prunePluginSuppliedLegacyFilesFromMetadata(claudeDir3, removedPaths) {
109983
+ const metadataPath = join137(claudeDir3, "metadata.json");
109984
+ const meta = readJsonSafe3(metadataPath);
109985
+ if (!isRecord5(meta))
109986
+ return;
109987
+ const removed = removedPaths ? new Set(removedPaths.map(normalizeComparableLegacyPath).filter(Boolean)) : null;
109988
+ let changed = false;
109989
+ const pruneFiles = (files) => {
109990
+ if (!Array.isArray(files))
109991
+ return files;
109992
+ const pruned = files.filter((file) => {
109993
+ if (!isRecord5(file) || typeof file.path !== "string")
109994
+ return true;
109995
+ const normalizedPath = normalizeComparableLegacyPath(file.path);
109996
+ const resolvedPath = resolveSafePluginSuppliedLegacyPath2(claudeDir3, normalizedPath);
109997
+ const shouldPrune = removed ? removed.has(normalizedPath) || resolvedPath !== null && !existsSync69(resolvedPath.absolutePath) : isPluginSuppliedLegacyPath2(normalizedPath);
109998
+ return !shouldPrune;
109999
+ });
110000
+ if (pruned.length !== files.length)
110001
+ changed = true;
110002
+ return pruned;
110003
+ };
110004
+ if (isRecord5(meta.kits)) {
110005
+ const engineer = meta.kits[ENGINEER_KIT_KEY];
110006
+ if (isRecord5(engineer)) {
110007
+ engineer.files = pruneFiles(engineer.files);
110008
+ }
110009
+ } else {
110010
+ meta.files = pruneFiles(meta.files);
110011
+ meta.installedFiles = pruneFiles(meta.installedFiles);
110012
+ }
110013
+ if (changed) {
110014
+ writeFileSync7(metadataPath, `${JSON.stringify(meta, null, 2)}
110015
+ `, "utf-8");
110016
+ }
110017
+ }
110018
+ function normalizeComparableLegacyPath(pathValue) {
110019
+ return normalizeLegacyPath2(pathValue).replace(/^\.\/+/, "").replace(/^\.claude\//, "");
110020
+ }
109961
110021
  function writeReceipt(claudeDir3, receipt) {
109962
110022
  const receiptPath = join137(claudeDir3, ".ck-migration-log.json");
109963
110023
  const existing = readJsonSafe3(receiptPath);
@@ -110401,7 +110461,7 @@ async function runPreflightChecks() {
110401
110461
  return result;
110402
110462
  }
110403
110463
  if (result.ghVersion) {
110404
- const comparison = compareVersions6(result.ghVersion, MIN_GH_CLI_VERSION);
110464
+ const comparison = compareVersions7(result.ghVersion, MIN_GH_CLI_VERSION);
110405
110465
  result.ghVersionOk = comparison >= 0;
110406
110466
  if (!result.ghVersionOk) {
110407
110467
  logger.debug(`GitHub CLI version ${result.ghVersion} is below minimum ${MIN_GH_CLI_VERSION}`);
@@ -119968,7 +120028,7 @@ init_npm_registry();
119968
120028
  init_claudekit_constants();
119969
120029
  init_logger();
119970
120030
  init_version_utils();
119971
- var import_compare_versions6 = __toESM(require_umd(), 1);
120031
+ var import_compare_versions7 = __toESM(require_umd(), 1);
119972
120032
 
119973
120033
  class CliVersionChecker {
119974
120034
  static async check(currentVersion) {
@@ -119982,13 +120042,13 @@ class CliVersionChecker {
119982
120042
  logger.debug("Failed to fetch latest CLI version from npm");
119983
120043
  return null;
119984
120044
  }
119985
- const current = normalizeVersion(currentVersion);
119986
- const latest = normalizeVersion(latestVersion);
120045
+ const current = normalizeVersion2(currentVersion);
120046
+ const latest = normalizeVersion2(latestVersion);
119987
120047
  if (isPrereleaseOfSameBase(current, latest)) {
119988
120048
  logger.debug(`CLI version check: skipping update - prerelease (${current}) is same base as stable (${latest})`);
119989
120049
  return null;
119990
120050
  }
119991
- const updateAvailable = import_compare_versions6.compareVersions(latest, current) > 0;
120051
+ const updateAvailable = import_compare_versions7.compareVersions(latest, current) > 0;
119992
120052
  logger.debug(`CLI version check: current=${current}, latest=${latest}, updateAvailable=${updateAvailable}`);
119993
120053
  return {
119994
120054
  currentVersion: current,
@@ -120026,8 +120086,8 @@ function displayKitNotification(result, options2 = {}) {
120026
120086
  return;
120027
120087
  const { currentVersion, latestVersion } = result;
120028
120088
  const { isGlobal = false, kitName } = options2;
120029
- const displayCurrent = normalizeVersion(currentVersion);
120030
- const displayLatest = normalizeVersion(latestVersion);
120089
+ const displayCurrent = normalizeVersion2(currentVersion);
120090
+ const displayLatest = normalizeVersion2(latestVersion);
120031
120091
  const boxWidth = 52;
120032
120092
  const { topBorder, bottomBorder, emptyLine, padLine } = createNotificationBox2(import_picocolors44.default.cyan, boxWidth);
120033
120093
  const headerText = import_picocolors44.default.bold(import_picocolors44.default.yellow("⬆ Kit Update Available"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudekit-cli",
3
- "version": "4.5.2-dev.2",
3
+ "version": "4.5.2-dev.3",
4
4
  "description": "CLI tool for bootstrapping and updating ClaudeKit projects",
5
5
  "type": "module",
6
6
  "repository": {