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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -64591,7 +64591,7 @@ var package_default;
64591
64591
  var init_package = __esm(() => {
64592
64592
  package_default = {
64593
64593
  name: "claudekit-cli",
64594
- version: "4.5.2-dev.1",
64594
+ version: "4.5.2-dev.2",
64595
64595
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
64596
64596
  type: "module",
64597
64597
  repository: {
@@ -66776,6 +66776,8 @@ This is a bug. Please open an issue at https://github.com/mrgoonie/claudekit-cli
66776
66776
 
66777
66777
  // src/domains/installation/plugin/codex-plugin-installer.ts
66778
66778
  import { execFile as execFile8 } from "node:child_process";
66779
+ import { existsSync as existsSync47, realpathSync as realpathSync4 } from "node:fs";
66780
+ import { normalize as normalize5, resolve as resolve35 } from "node:path";
66779
66781
  import { promisify as promisify9 } from "node:util";
66780
66782
  function resolveCodexExecutable(_platformName = process.platform) {
66781
66783
  return "codex";
@@ -66863,7 +66865,7 @@ function classifyCodexPluginEntry(entry, options2 = {}) {
66863
66865
  if (entry.marketplace && entry.marketplace !== expectedMarketplace) {
66864
66866
  return createState("installed-stale-source", entry, options2);
66865
66867
  }
66866
- if (options2.expectedSource && entry.source && entry.source !== options2.expectedSource) {
66868
+ if (options2.expectedSource && entry.source && !pluginSourceMatches(entry.source, options2.expectedSource)) {
66867
66869
  return createState("installed-stale-source", entry, options2);
66868
66870
  }
66869
66871
  if (options2.expectedVersion && entry.version && !versionsMatch(entry.version, options2.expectedVersion)) {
@@ -66871,6 +66873,22 @@ function classifyCodexPluginEntry(entry, options2 = {}) {
66871
66873
  }
66872
66874
  return createState("installed-current", entry, options2);
66873
66875
  }
66876
+ function pluginSourceMatches(actual, expected) {
66877
+ if (actual === expected)
66878
+ return true;
66879
+ const normalizedActual = normalizeLocalSourcePath(actual);
66880
+ const normalizedExpected = normalizeLocalSourcePath(expected);
66881
+ return normalizedActual !== null && normalizedExpected !== null && normalizedActual === normalizedExpected;
66882
+ }
66883
+ function normalizeLocalSourcePath(value) {
66884
+ const trimmed = value.trim();
66885
+ if (!trimmed || /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed))
66886
+ return null;
66887
+ const resolved = resolve35(trimmed);
66888
+ const canonical = existsSync47(resolved) ? realpathSync4.native(resolved) : resolved;
66889
+ const normalized = normalize5(canonical);
66890
+ return process.platform === "win32" ? normalized.toLowerCase() : normalized;
66891
+ }
66874
66892
  function parseTextPluginList(output2) {
66875
66893
  const pluginId = `${CK_PLUGIN_NAME}@${CK_MARKETPLACE_NAME}`.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
66876
66894
  const row = new RegExp(`^\\s*(${pluginId})\\s+(.*)$`, "im").exec(output2);
@@ -67367,7 +67385,7 @@ var init_claudekit_scanner = __esm(() => {
67367
67385
 
67368
67386
  // src/ui/ck-cli-design/tokens.ts
67369
67387
  import { homedir as homedir41, platform as platform7 } from "node:os";
67370
- import { resolve as resolve35, win32 } from "node:path";
67388
+ import { resolve as resolve36, win32 } from "node:path";
67371
67389
  function createCliDesignContext(options2 = {}) {
67372
67390
  const env2 = options2.env ?? process.env;
67373
67391
  const isTTY2 = options2.isTTY ?? process.stdout.isTTY === true;
@@ -67516,7 +67534,7 @@ function formatCdHint(value, currentPlatform = platform7()) {
67516
67534
  const absolutePath2 = win32.resolve(value);
67517
67535
  return `cd /d "${absolutePath2}"`;
67518
67536
  }
67519
- const absolutePath = resolve35(value);
67537
+ const absolutePath = resolve36(value);
67520
67538
  const displayPath = formatDisplayPath(absolutePath);
67521
67539
  if (displayPath.includes(" ")) {
67522
67540
  return `cd "${displayPath}"`;
@@ -68121,7 +68139,7 @@ var init_error_handler2 = __esm(() => {
68121
68139
  });
68122
68140
 
68123
68141
  // src/domains/versioning/release-cache.ts
68124
- import { existsSync as existsSync47 } from "node:fs";
68142
+ import { existsSync as existsSync48 } from "node:fs";
68125
68143
  import { mkdir as mkdir18, readFile as readFile37, unlink as unlink8, writeFile as writeFile20 } from "node:fs/promises";
68126
68144
  import { join as join69 } from "node:path";
68127
68145
  var ReleaseCacheEntrySchema, ReleaseCache;
@@ -68143,7 +68161,7 @@ var init_release_cache = __esm(() => {
68143
68161
  async get(key) {
68144
68162
  const cacheFile = this.getCachePath(key);
68145
68163
  try {
68146
- if (!existsSync47(cacheFile)) {
68164
+ if (!existsSync48(cacheFile)) {
68147
68165
  logger.debug(`Release cache not found for key: ${key}`);
68148
68166
  return null;
68149
68167
  }
@@ -68183,7 +68201,7 @@ var init_release_cache = __esm(() => {
68183
68201
  if (key) {
68184
68202
  const cacheFile = this.getCachePath(key);
68185
68203
  try {
68186
- if (existsSync47(cacheFile)) {
68204
+ if (existsSync48(cacheFile)) {
68187
68205
  await unlink8(cacheFile);
68188
68206
  logger.debug(`Release cache cleared for key: ${key}`);
68189
68207
  }
@@ -68862,7 +68880,7 @@ var init_github_client = __esm(() => {
68862
68880
 
68863
68881
  // src/commands/update/post-update-handler.ts
68864
68882
  import { exec as exec2, spawn as spawn2 } from "node:child_process";
68865
- import { existsSync as existsSync48 } from "node:fs";
68883
+ import { existsSync as existsSync49 } from "node:fs";
68866
68884
  import { readdir as readdir19 } from "node:fs/promises";
68867
68885
  import { builtinModules } from "node:module";
68868
68886
  import { dirname as dirname30, join as join70 } from "node:path";
@@ -68948,7 +68966,7 @@ function collectSettingsHookRegistrations(settings, options2 = {}) {
68948
68966
  }
68949
68967
  async function readManagedHookNames(claudeDir3) {
68950
68968
  const manifestPath = join70(claudeDir3, "hooks", MANAGED_HOOKS_MANIFEST);
68951
- if (!existsSync48(manifestPath))
68969
+ if (!existsSync49(manifestPath))
68952
68970
  return [];
68953
68971
  try {
68954
68972
  const data = parseJsonContent(await import_fs_extra8.readFile(manifestPath, "utf-8"));
@@ -68962,7 +68980,7 @@ async function readManagedHookNames(claudeDir3) {
68962
68980
  }
68963
68981
  async function readDisabledHookNames(claudeDir3) {
68964
68982
  const configPath = join70(claudeDir3, ".ck.json");
68965
- if (!existsSync48(configPath))
68983
+ if (!existsSync49(configPath))
68966
68984
  return new Set;
68967
68985
  try {
68968
68986
  const config = parseJsonContent(await import_fs_extra8.readFile(configPath, "utf-8"));
@@ -68974,7 +68992,7 @@ async function readDisabledHookNames(claudeDir3) {
68974
68992
  }
68975
68993
  async function countMissingCkHookRegistrations(claudeDir3, kit, options2 = {}) {
68976
68994
  const settingsPath = join70(claudeDir3, "settings.json");
68977
- if (!existsSync48(settingsPath))
68995
+ if (!existsSync49(settingsPath))
68978
68996
  return 0;
68979
68997
  const managedHooks = await readManagedHookNames(claudeDir3);
68980
68998
  if (managedHooks.length === 0)
@@ -68987,7 +69005,7 @@ async function countMissingCkHookRegistrations(claudeDir3, kit, options2 = {}) {
68987
69005
  for (const name of managedHooks) {
68988
69006
  if (disabledHooks.has(name))
68989
69007
  continue;
68990
- if (!existsSync48(join70(hooksDir, `${name}.cjs`)))
69008
+ if (!existsSync49(join70(hooksDir, `${name}.cjs`)))
68991
69009
  continue;
68992
69010
  if (!liveHookRegistrations.get(name)?.hasCorrectScope)
68993
69011
  missing++;
@@ -69034,13 +69052,13 @@ function resolveCkInitSpawnCommand(initArgs, options2 = {}) {
69034
69052
  };
69035
69053
  }
69036
69054
  function createDefaultSpawnInitFn() {
69037
- return (spawnArgs) => new Promise((resolve36) => {
69055
+ return (spawnArgs) => new Promise((resolve37) => {
69038
69056
  const initCommand = resolveCkInitSpawnCommand(spawnArgs);
69039
69057
  const child = spawn2(initCommand.command, initCommand.args, { stdio: "inherit" });
69040
- child.on("close", (code) => resolve36(code ?? 1));
69058
+ child.on("close", (code) => resolve37(code ?? 1));
69041
69059
  child.on("error", (err) => {
69042
69060
  logger.verbose(`Failed to spawn ck init: ${err.message}`);
69043
- resolve36(1);
69061
+ resolve37(1);
69044
69062
  });
69045
69063
  });
69046
69064
  }
@@ -69058,7 +69076,7 @@ async function fetchLatestReleaseTag(kit, beta) {
69058
69076
  }
69059
69077
  async function findMissingHookDependencies(claudeDir3) {
69060
69078
  const hooksDir = join70(claudeDir3, "hooks");
69061
- if (!existsSync48(hooksDir))
69079
+ if (!existsSync49(hooksDir))
69062
69080
  return [];
69063
69081
  const files = await readdir19(hooksDir);
69064
69082
  const cjsFiles = files.filter((file) => file.endsWith(".cjs"));
@@ -69075,7 +69093,7 @@ async function findMissingHookDependencies(claudeDir3) {
69075
69093
  if (!depPath || nodeBuiltins.has(depPath) || !depPath.startsWith("."))
69076
69094
  continue;
69077
69095
  const resolvedPath = join70(hooksDir, depPath);
69078
- const exists = existsSync48(resolvedPath) || HOOK_DEPENDENCY_EXTENSIONS.some((ext) => existsSync48(resolvedPath + ext)) || existsSync48(join70(resolvedPath, "index.js")) || existsSync48(join70(resolvedPath, "index.cjs")) || existsSync48(join70(resolvedPath, "index.mjs"));
69096
+ const exists = existsSync49(resolvedPath) || HOOK_DEPENDENCY_EXTENSIONS.some((ext) => existsSync49(resolvedPath + ext)) || existsSync49(join70(resolvedPath, "index.js")) || existsSync49(join70(resolvedPath, "index.cjs")) || existsSync49(join70(resolvedPath, "index.mjs"));
69079
69097
  if (!exists)
69080
69098
  missing.push(`${file}: ${depPath}`);
69081
69099
  }
@@ -69093,6 +69111,7 @@ async function promptKitUpdate(beta, yes, deps) {
69093
69111
  const detectInstallModeFn = deps?.detectInstallModeFn ?? detectInstallMode;
69094
69112
  const hasTrackedPluginSuppliedLegacyFilesFn = deps?.hasTrackedPluginSuppliedLegacyFilesFn ?? hasTrackedPluginSuppliedLegacyFiles;
69095
69113
  const shouldRefreshCodexPluginFn = deps?.shouldRefreshCodexPluginFn ?? ((options2) => shouldRefreshCodexPlugin(undefined, options2));
69114
+ const cleanupStaleCodexConfigEntriesFn = deps?.cleanupStaleCodexConfigEntriesFn ?? cleanupStaleCodexConfigEntries;
69096
69115
  const setup = await getSetupFn();
69097
69116
  const hasLocal = !!setup.project.metadata;
69098
69117
  const hasGlobal = !!setup.global.metadata;
@@ -69172,9 +69191,19 @@ async function promptKitUpdate(beta, yes, deps) {
69172
69191
  forceKitReinstall = true;
69173
69192
  }
69174
69193
  }
69175
- if (installModePreference !== "legacy" && await shouldRefreshCodexPluginFn({ expectedVersion: kitVersion })) {
69176
- logger.warning("Detected Codex ClaudeKit plugin state requiring refresh; reinstalling global Engineer content");
69177
- forceKitReinstall = true;
69194
+ if (installModePreference !== "legacy") {
69195
+ try {
69196
+ await cleanupStaleCodexConfigEntriesFn({ global: true, provider: "codex" });
69197
+ } catch (error) {
69198
+ logger.verbose(`Codex config self-heal skipped: ${error instanceof Error ? error.message : "unknown"}`);
69199
+ }
69200
+ if (await shouldRefreshCodexPluginFn({
69201
+ expectedVersion: kitVersion,
69202
+ expectedSource: join70(PathResolver.getCacheDir(true), "ck-plugin-source", ".claude")
69203
+ })) {
69204
+ logger.warning("Detected Codex ClaudeKit plugin state requiring refresh; reinstalling global Engineer content");
69205
+ forceKitReinstall = true;
69206
+ }
69178
69207
  }
69179
69208
  }
69180
69209
  } catch (error) {
@@ -69474,6 +69503,7 @@ async function promptMigrateUpdate(deps) {
69474
69503
  }
69475
69504
  var import_fs_extra8, execAsync2, SAFE_PROVIDER_NAME, HOOK_DEPENDENCY_EXTENSIONS, MANAGED_HOOKS_MANIFEST = "managed-hooks.json", StrictPluginUpdateError;
69476
69505
  var init_post_update_handler = __esm(() => {
69506
+ init_codex_toml_installer();
69477
69507
  init_ck_config_manager();
69478
69508
  init_hook_health_checker();
69479
69509
  init_codex_plugin_installer();
@@ -69483,6 +69513,7 @@ var init_post_update_handler = __esm(() => {
69483
69513
  init_version_utils();
69484
69514
  init_claudekit_scanner();
69485
69515
  init_logger();
69516
+ init_path_resolver();
69486
69517
  init_safe_prompts();
69487
69518
  init_types3();
69488
69519
  init_codex_sync_notice();
@@ -69792,7 +69823,7 @@ class ConfigVersionChecker {
69792
69823
  return null;
69793
69824
  }
69794
69825
  const delay = baseBackoff * 2 ** attempt;
69795
- await new Promise((resolve36) => setTimeout(resolve36, delay));
69826
+ await new Promise((resolve37) => setTimeout(resolve37, delay));
69796
69827
  }
69797
69828
  }
69798
69829
  return null;
@@ -69893,17 +69924,17 @@ var init_config_version_checker = __esm(() => {
69893
69924
  // src/domains/web-server/routes/system-routes.ts
69894
69925
  import { spawn as spawn3 } from "node:child_process";
69895
69926
  import { execFile as execFile9 } from "node:child_process";
69896
- import { existsSync as existsSync49 } from "node:fs";
69927
+ import { existsSync as existsSync50 } from "node:fs";
69897
69928
  import { readFile as readFile40 } from "node:fs/promises";
69898
69929
  import { cpus, homedir as homedir42, totalmem } from "node:os";
69899
69930
  import { join as join72 } from "node:path";
69900
69931
  function runCommand(cmd, args, fallback2) {
69901
- return new Promise((resolve36) => {
69932
+ return new Promise((resolve37) => {
69902
69933
  execFile9(cmd, args, { timeout: 5000 }, (err, stdout) => {
69903
69934
  if (err) {
69904
- resolve36(fallback2);
69935
+ resolve37(fallback2);
69905
69936
  } else {
69906
- resolve36(stdout.trim() || fallback2);
69937
+ resolve37(stdout.trim() || fallback2);
69907
69938
  }
69908
69939
  });
69909
69940
  });
@@ -70183,7 +70214,7 @@ async function getPackageJson() {
70183
70214
  async function getKitMetadata2(kitName) {
70184
70215
  try {
70185
70216
  const metadataPath = join72(PathResolver.getGlobalKitDir(), "metadata.json");
70186
- if (!existsSync49(metadataPath))
70217
+ if (!existsSync50(metadataPath))
70187
70218
  return null;
70188
70219
  const content = await readFile40(metadataPath, "utf-8");
70189
70220
  const metadata = JSON.parse(content);
@@ -70339,18 +70370,18 @@ var init_routes = __esm(() => {
70339
70370
  });
70340
70371
 
70341
70372
  // src/domains/web-server/static-server.ts
70342
- import { existsSync as existsSync50 } from "node:fs";
70343
- import { basename as basename24, dirname as dirname31, join as join73, resolve as resolve36 } from "node:path";
70373
+ import { existsSync as existsSync51 } from "node:fs";
70374
+ import { basename as basename24, dirname as dirname31, join as join73, resolve as resolve37 } from "node:path";
70344
70375
  import { fileURLToPath as fileURLToPath2 } from "node:url";
70345
70376
  function addRuntimeUiCandidate(candidates, runtimePath) {
70346
70377
  if (!runtimePath) {
70347
70378
  return;
70348
70379
  }
70349
- const looksLikePath = runtimePath.includes("/") || runtimePath.includes("\\") || existsSync50(runtimePath);
70380
+ const looksLikePath = runtimePath.includes("/") || runtimePath.includes("\\") || existsSync51(runtimePath);
70350
70381
  if (!looksLikePath) {
70351
70382
  return;
70352
70383
  }
70353
- const entryDir = dirname31(resolve36(runtimePath));
70384
+ const entryDir = dirname31(resolve37(runtimePath));
70354
70385
  if (basename24(entryDir) === "dist") {
70355
70386
  candidates.add(join73(entryDir, "ui"));
70356
70387
  }
@@ -70363,7 +70394,7 @@ function resolveUiDistPath() {
70363
70394
  candidates.add(join73(process.cwd(), "dist", "ui"));
70364
70395
  candidates.add(join73(process.cwd(), "src", "ui", "dist"));
70365
70396
  for (const path7 of candidates) {
70366
- if (existsSync50(join73(path7, "index.html"))) {
70397
+ if (existsSync51(join73(path7, "index.html"))) {
70367
70398
  return path7;
70368
70399
  }
70369
70400
  }
@@ -70371,7 +70402,7 @@ function resolveUiDistPath() {
70371
70402
  }
70372
70403
  function serveStatic(app) {
70373
70404
  const uiDistPath = resolveUiDistPath();
70374
- if (!existsSync50(uiDistPath)) {
70405
+ if (!existsSync51(uiDistPath)) {
70375
70406
  logger.warning(`UI dist not found at ${uiDistPath}. Run 'bun run ui:build' first.`);
70376
70407
  app.use((req, res, next) => {
70377
70408
  if (req.path.startsWith("/api/")) {
@@ -73382,10 +73413,10 @@ async function createAppServer(options2 = {}) {
73382
73413
  wsManager = new WebSocketManager(server);
73383
73414
  fileWatcher = new FileWatcher({ wsManager });
73384
73415
  fileWatcher.start();
73385
- await new Promise((resolve37, reject) => {
73416
+ await new Promise((resolve38, reject) => {
73386
73417
  const onListening = () => {
73387
73418
  server.off("error", onError);
73388
- resolve37();
73419
+ resolve38();
73389
73420
  };
73390
73421
  const onError = (error) => {
73391
73422
  server.off("listening", onListening);
@@ -73422,16 +73453,16 @@ async function createAppServer(options2 = {}) {
73422
73453
  };
73423
73454
  }
73424
73455
  async function closeHttpServer(server) {
73425
- await new Promise((resolve37) => {
73456
+ await new Promise((resolve38) => {
73426
73457
  if (!server.listening) {
73427
- resolve37();
73458
+ resolve38();
73428
73459
  return;
73429
73460
  }
73430
73461
  server.close((err) => {
73431
73462
  if (err) {
73432
73463
  logger.debug(`Server close error: ${err.message}`);
73433
73464
  }
73434
- resolve37();
73465
+ resolve38();
73435
73466
  });
73436
73467
  });
73437
73468
  }
@@ -75167,7 +75198,7 @@ var require_picomatch2 = __commonJS((exports, module) => {
75167
75198
  import { exec as exec7, execFile as execFile10, spawn as spawn4 } from "node:child_process";
75168
75199
  import { promisify as promisify15 } from "node:util";
75169
75200
  function executeInteractiveScript(command, args, options2) {
75170
- return new Promise((resolve39, reject) => {
75201
+ return new Promise((resolve40, reject) => {
75171
75202
  const child = spawn4(command, args, {
75172
75203
  stdio: ["ignore", "inherit", "inherit"],
75173
75204
  cwd: options2?.cwd,
@@ -75188,7 +75219,7 @@ function executeInteractiveScript(command, args, options2) {
75188
75219
  } else if (code !== 0) {
75189
75220
  reject(new Error(`Command exited with code ${code}`));
75190
75221
  } else {
75191
- resolve39();
75222
+ resolve40();
75192
75223
  }
75193
75224
  });
75194
75225
  child.on("error", (error) => {
@@ -75367,7 +75398,7 @@ var init_opencode_installer = __esm(() => {
75367
75398
  var PARTIAL_INSTALL_VERSION = "partial", EXIT_CODE_CRITICAL_FAILURE = 1, EXIT_CODE_PARTIAL_SUCCESS = 2;
75368
75399
 
75369
75400
  // src/services/package-installer/validators.ts
75370
- import { resolve as resolve39 } from "node:path";
75401
+ import { resolve as resolve40 } from "node:path";
75371
75402
  function validatePackageName(packageName) {
75372
75403
  if (!packageName || typeof packageName !== "string") {
75373
75404
  throw new Error("Package name must be a non-empty string");
@@ -75380,8 +75411,8 @@ function validatePackageName(packageName) {
75380
75411
  }
75381
75412
  }
75382
75413
  function validateScriptPath(skillsDir2, scriptPath) {
75383
- const skillsDirResolved = resolve39(skillsDir2);
75384
- const scriptPathResolved = resolve39(scriptPath);
75414
+ const skillsDirResolved = resolve40(skillsDir2);
75415
+ const scriptPathResolved = resolve40(scriptPath);
75385
75416
  const skillsDirNormalized = isWindows() ? skillsDirResolved.toLowerCase() : skillsDirResolved;
75386
75417
  const scriptPathNormalized = isWindows() ? scriptPathResolved.toLowerCase() : scriptPathResolved;
75387
75418
  if (!scriptPathNormalized.startsWith(skillsDirNormalized)) {
@@ -75551,7 +75582,7 @@ var init_npm_package_manager = __esm(() => {
75551
75582
  });
75552
75583
 
75553
75584
  // src/services/package-installer/install-error-handler.ts
75554
- import { existsSync as existsSync62, readFileSync as readFileSync22, unlinkSync as unlinkSync3 } from "node:fs";
75585
+ import { existsSync as existsSync63, readFileSync as readFileSync22, unlinkSync as unlinkSync3 } from "node:fs";
75555
75586
  import { join as join94 } from "node:path";
75556
75587
  function parseNameReason(str2) {
75557
75588
  const colonIndex = str2.indexOf(":");
@@ -75616,7 +75647,7 @@ function getSystemPackageCommands(summary, systemFailures) {
75616
75647
  }
75617
75648
  function displayInstallErrors(skillsDir2) {
75618
75649
  const summaryPath = join94(skillsDir2, ".install-error-summary.json");
75619
- if (!existsSync62(summaryPath)) {
75650
+ if (!existsSync63(summaryPath)) {
75620
75651
  logger.error("Skills installation failed. Run with --verbose for details.");
75621
75652
  return;
75622
75653
  }
@@ -75715,7 +75746,7 @@ async function checkNeedsSudoPackages() {
75715
75746
  }
75716
75747
  function hasInstallState(skillsDir2) {
75717
75748
  const stateFilePath = join94(skillsDir2, ".install-state.json");
75718
- return existsSync62(stateFilePath);
75749
+ return existsSync63(stateFilePath);
75719
75750
  }
75720
75751
  var WHICH_COMMAND_TIMEOUT_MS = 5000, WINDOWS_SYSTEM_PACKAGES, SYSTEM_TOOL_KEYS, WINDOWS_RSVG_COMMANDS;
75721
75752
  var init_install_error_handler = __esm(() => {
@@ -75754,7 +75785,7 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
75754
75785
  };
75755
75786
  }
75756
75787
  try {
75757
- const { existsSync: existsSync63 } = await import("node:fs");
75788
+ const { existsSync: existsSync64 } = await import("node:fs");
75758
75789
  const clack = await Promise.resolve().then(() => (init_dist2(), exports_dist));
75759
75790
  const platform10 = process.platform;
75760
75791
  const scriptName = platform10 === "win32" ? "install.ps1" : "install.sh";
@@ -75770,7 +75801,7 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
75770
75801
  error: `Path validation failed: ${errorMessage}`
75771
75802
  };
75772
75803
  }
75773
- if (!existsSync63(scriptPath)) {
75804
+ if (!existsSync64(scriptPath)) {
75774
75805
  logger.warning(`Skills installation script not found: ${scriptPath}`);
75775
75806
  logger.info("");
75776
75807
  logger.info("\uD83D\uDCD6 Manual Installation Instructions:");
@@ -75986,7 +76017,7 @@ var init_skills_installer2 = __esm(() => {
75986
76017
  });
75987
76018
 
75988
76019
  // src/services/package-installer/agy-mcp/config-manager.ts
75989
- import { existsSync as existsSync63 } from "node:fs";
76020
+ import { existsSync as existsSync64 } from "node:fs";
75990
76021
  import { mkdir as mkdir23, readFile as readFile49, writeFile as writeFile25 } from "node:fs/promises";
75991
76022
  import { dirname as dirname34, join as join96 } from "node:path";
75992
76023
  async function readJsonFile(filePath) {
@@ -76003,7 +76034,7 @@ async function addAgyToGitignore(projectDir) {
76003
76034
  const gitignorePath = join96(projectDir, ".gitignore");
76004
76035
  try {
76005
76036
  let content = "";
76006
- if (existsSync63(gitignorePath)) {
76037
+ if (existsSync64(gitignorePath)) {
76007
76038
  content = await readFile49(gitignorePath, "utf-8");
76008
76039
  const lines = content.split(`
76009
76040
  `).map((line) => line.trim()).filter((line) => !line.startsWith("#"));
@@ -76032,7 +76063,7 @@ ${AGY_GITIGNORE_PATTERN}
76032
76063
  }
76033
76064
  async function createNewSettingsWithMerge(agyConfigPath, mcpConfigPath) {
76034
76065
  const linkDir = dirname34(agyConfigPath);
76035
- if (!existsSync63(linkDir)) {
76066
+ if (!existsSync64(linkDir)) {
76036
76067
  await mkdir23(linkDir, { recursive: true });
76037
76068
  logger.debug(`Created directory: ${linkDir}`);
76038
76069
  }
@@ -76098,7 +76129,7 @@ var init_config_manager2 = __esm(() => {
76098
76129
  });
76099
76130
 
76100
76131
  // src/services/package-installer/agy-mcp/validation.ts
76101
- import { existsSync as existsSync64, lstatSync, readlinkSync } from "node:fs";
76132
+ import { existsSync as existsSync65, lstatSync, readlinkSync } from "node:fs";
76102
76133
  import { homedir as homedir45 } from "node:os";
76103
76134
  import { join as join97 } from "node:path";
76104
76135
  function getGlobalMcpConfigPath() {
@@ -76109,12 +76140,12 @@ function getLocalMcpConfigPath(projectDir) {
76109
76140
  }
76110
76141
  function findMcpConfigPath(projectDir) {
76111
76142
  const localPath = getLocalMcpConfigPath(projectDir);
76112
- if (existsSync64(localPath)) {
76143
+ if (existsSync65(localPath)) {
76113
76144
  logger.debug(`Found local MCP config: ${localPath}`);
76114
76145
  return localPath;
76115
76146
  }
76116
76147
  const globalPath = getGlobalMcpConfigPath();
76117
- if (existsSync64(globalPath)) {
76148
+ if (existsSync65(globalPath)) {
76118
76149
  logger.debug(`Found global MCP config: ${globalPath}`);
76119
76150
  return globalPath;
76120
76151
  }
@@ -76129,7 +76160,7 @@ function getAgyMcpConfigPath(projectDir, isGlobal) {
76129
76160
  }
76130
76161
  function checkExistingAgyConfig(projectDir, isGlobal = false) {
76131
76162
  const agyConfigPath = getAgyMcpConfigPath(projectDir, isGlobal);
76132
- if (!existsSync64(agyConfigPath)) {
76163
+ if (!existsSync65(agyConfigPath)) {
76133
76164
  return { exists: false, isSymlink: false, settingsPath: agyConfigPath };
76134
76165
  }
76135
76166
  try {
@@ -76153,12 +76184,12 @@ var init_validation = __esm(() => {
76153
76184
  });
76154
76185
 
76155
76186
  // src/services/package-installer/agy-mcp/linker-core.ts
76156
- import { existsSync as existsSync65 } from "node:fs";
76187
+ import { existsSync as existsSync66 } from "node:fs";
76157
76188
  import { mkdir as mkdir24, symlink as symlink3 } from "node:fs/promises";
76158
76189
  import { dirname as dirname35, join as join98 } from "node:path";
76159
76190
  async function createSymlink(targetPath, linkPath, projectDir, isGlobal) {
76160
76191
  const linkDir = dirname35(linkPath);
76161
- if (!existsSync65(linkDir)) {
76192
+ if (!existsSync66(linkDir)) {
76162
76193
  await mkdir24(linkDir, { recursive: true });
76163
76194
  logger.debug(`Created directory: ${linkDir}`);
76164
76195
  }
@@ -76199,10 +76230,10 @@ __export(exports_agy_mcp_linker, {
76199
76230
  checkExistingAgyConfig: () => checkExistingAgyConfig,
76200
76231
  addAgyToGitignore: () => addAgyToGitignore
76201
76232
  });
76202
- import { resolve as resolve40 } from "node:path";
76233
+ import { resolve as resolve41 } from "node:path";
76203
76234
  async function linkAgyMcpConfig(projectDir, options2 = {}) {
76204
76235
  const { skipGitignore = false, isGlobal = false } = options2;
76205
- const resolvedProjectDir = resolve40(projectDir);
76236
+ const resolvedProjectDir = resolve41(projectDir);
76206
76237
  const agyConfigPath = getAgyMcpConfigPath(resolvedProjectDir, isGlobal);
76207
76238
  const mcpConfigPath = findMcpConfigPath(resolvedProjectDir);
76208
76239
  if (!mcpConfigPath) {
@@ -76851,7 +76882,7 @@ var require_get_stream = __commonJS((exports, module) => {
76851
76882
  };
76852
76883
  const { maxBuffer } = options2;
76853
76884
  let stream;
76854
- await new Promise((resolve42, reject) => {
76885
+ await new Promise((resolve43, reject) => {
76855
76886
  const rejectPromise = (error) => {
76856
76887
  if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
76857
76888
  error.bufferedData = stream.getBufferedValue();
@@ -76863,7 +76894,7 @@ var require_get_stream = __commonJS((exports, module) => {
76863
76894
  rejectPromise(error);
76864
76895
  return;
76865
76896
  }
76866
- resolve42();
76897
+ resolve43();
76867
76898
  });
76868
76899
  stream.on("data", () => {
76869
76900
  if (stream.getBufferedLength() > maxBuffer) {
@@ -78224,7 +78255,7 @@ var require_extract_zip = __commonJS((exports, module) => {
78224
78255
  debug("opening", this.zipPath, "with opts", this.opts);
78225
78256
  this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
78226
78257
  this.canceled = false;
78227
- return new Promise((resolve42, reject) => {
78258
+ return new Promise((resolve43, reject) => {
78228
78259
  this.zipfile.on("error", (err) => {
78229
78260
  this.canceled = true;
78230
78261
  reject(err);
@@ -78233,7 +78264,7 @@ var require_extract_zip = __commonJS((exports, module) => {
78233
78264
  this.zipfile.on("close", () => {
78234
78265
  if (!this.canceled) {
78235
78266
  debug("zip extraction complete");
78236
- resolve42();
78267
+ resolve43();
78237
78268
  }
78238
78269
  });
78239
78270
  this.zipfile.on("entry", async (entry) => {
@@ -78552,7 +78583,7 @@ async function restoreOriginalBranch(branchName, cwd2, issueNumber) {
78552
78583
  }
78553
78584
  }
78554
78585
  function spawnAndCollect(command, args, cwd2) {
78555
- return new Promise((resolve59, reject) => {
78586
+ return new Promise((resolve60, reject) => {
78556
78587
  const child = spawn5(command, args, { ...cwd2 && { cwd: cwd2 }, stdio: ["ignore", "pipe", "pipe"] });
78557
78588
  const chunks = [];
78558
78589
  const stderrChunks = [];
@@ -78565,7 +78596,7 @@ function spawnAndCollect(command, args, cwd2) {
78565
78596
  reject(new Error(`${command} ${args[0] ?? ""} exited with code ${code2}: ${stderr}`));
78566
78597
  return;
78567
78598
  }
78568
- resolve59(Buffer.concat(chunks).toString("utf-8"));
78599
+ resolve60(Buffer.concat(chunks).toString("utf-8"));
78569
78600
  });
78570
78601
  });
78571
78602
  }
@@ -78582,7 +78613,7 @@ __export(exports_worktree_manager, {
78582
78613
  createWorktree: () => createWorktree,
78583
78614
  cleanupAllWorktrees: () => cleanupAllWorktrees
78584
78615
  });
78585
- import { existsSync as existsSync77 } from "node:fs";
78616
+ import { existsSync as existsSync78 } from "node:fs";
78586
78617
  import { readFile as readFile70, writeFile as writeFile41 } from "node:fs/promises";
78587
78618
  import { join as join162 } from "node:path";
78588
78619
  async function createWorktree(projectDir, issueNumber, baseBranch) {
@@ -78648,7 +78679,7 @@ async function cleanupAllWorktrees(projectDir) {
78648
78679
  async function ensureGitignore(projectDir) {
78649
78680
  const gitignorePath = join162(projectDir, ".gitignore");
78650
78681
  try {
78651
- const content = existsSync77(gitignorePath) ? await readFile70(gitignorePath, "utf-8") : "";
78682
+ const content = existsSync78(gitignorePath) ? await readFile70(gitignorePath, "utf-8") : "";
78652
78683
  if (!content.includes(".worktrees")) {
78653
78684
  const newContent = content.endsWith(`
78654
78685
  `) ? `${content}.worktrees/
@@ -78750,13 +78781,13 @@ var init_content_validator = __esm(() => {
78750
78781
 
78751
78782
  // src/commands/content/phases/context-cache-manager.ts
78752
78783
  import { createHash as createHash11 } from "node:crypto";
78753
- import { existsSync as existsSync83, mkdirSync as mkdirSync7, readFileSync as readFileSync25, readdirSync as readdirSync15, statSync as statSync15 } from "node:fs";
78784
+ import { existsSync as existsSync84, mkdirSync as mkdirSync7, readFileSync as readFileSync25, readdirSync as readdirSync15, statSync as statSync15 } from "node:fs";
78754
78785
  import { rename as rename16, writeFile as writeFile43 } from "node:fs/promises";
78755
78786
  import { homedir as homedir54 } from "node:os";
78756
78787
  import { basename as basename34, join as join169 } from "node:path";
78757
78788
  function getCachedContext(repoPath) {
78758
78789
  const cachePath = getCacheFilePath(repoPath);
78759
- if (!existsSync83(cachePath))
78790
+ if (!existsSync84(cachePath))
78760
78791
  return null;
78761
78792
  try {
78762
78793
  const raw2 = readFileSync25(cachePath, "utf-8");
@@ -78773,7 +78804,7 @@ function getCachedContext(repoPath) {
78773
78804
  }
78774
78805
  }
78775
78806
  async function saveCachedContext(repoPath, cache5) {
78776
- if (!existsSync83(CACHE_DIR)) {
78807
+ if (!existsSync84(CACHE_DIR)) {
78777
78808
  mkdirSync7(CACHE_DIR, { recursive: true });
78778
78809
  }
78779
78810
  const cachePath = getCacheFilePath(repoPath);
@@ -78797,7 +78828,7 @@ function computeSourceHash(repoPath) {
78797
78828
  function getDocSourcePaths(repoPath) {
78798
78829
  const paths = [];
78799
78830
  const docsDir = join169(repoPath, "docs");
78800
- if (existsSync83(docsDir)) {
78831
+ if (existsSync84(docsDir)) {
78801
78832
  try {
78802
78833
  const files = readdirSync15(docsDir);
78803
78834
  for (const f3 of files) {
@@ -78807,10 +78838,10 @@ function getDocSourcePaths(repoPath) {
78807
78838
  } catch {}
78808
78839
  }
78809
78840
  const readme = join169(repoPath, "README.md");
78810
- if (existsSync83(readme))
78841
+ if (existsSync84(readme))
78811
78842
  paths.push(readme);
78812
78843
  const stylesDir = join169(repoPath, "assets", "writing-styles");
78813
- if (existsSync83(stylesDir)) {
78844
+ if (existsSync84(stylesDir)) {
78814
78845
  try {
78815
78846
  const files = readdirSync15(stylesDir);
78816
78847
  for (const f3 of files) {
@@ -79007,7 +79038,7 @@ function extractContentFromResponse(response) {
79007
79038
 
79008
79039
  // src/commands/content/phases/docs-summarizer.ts
79009
79040
  import { execSync as execSync7 } from "node:child_process";
79010
- import { existsSync as existsSync84, readFileSync as readFileSync26, readdirSync as readdirSync16 } from "node:fs";
79041
+ import { existsSync as existsSync85, readFileSync as readFileSync26, readdirSync as readdirSync16 } from "node:fs";
79011
79042
  import { join as join170 } from "node:path";
79012
79043
  async function summarizeProjectDocs(repoPath, contentLogger) {
79013
79044
  const rawContent = collectRawDocs(repoPath);
@@ -79052,7 +79083,7 @@ async function summarizeProjectDocs(repoPath, contentLogger) {
79052
79083
  function collectRawDocs(repoPath) {
79053
79084
  let totalChars = 0;
79054
79085
  const readCapped = (filePath, maxChars) => {
79055
- if (!existsSync84(filePath))
79086
+ if (!existsSync85(filePath))
79056
79087
  return "";
79057
79088
  if (totalChars >= MAX_RAW_CONTENT_CHARS)
79058
79089
  return "";
@@ -79063,7 +79094,7 @@ function collectRawDocs(repoPath) {
79063
79094
  };
79064
79095
  const docsContent = [];
79065
79096
  const docsDir = join170(repoPath, "docs");
79066
- if (existsSync84(docsDir)) {
79097
+ if (existsSync85(docsDir)) {
79067
79098
  try {
79068
79099
  const files = readdirSync16(docsDir).filter((f3) => f3.endsWith(".md")).sort();
79069
79100
  for (const f3 of files) {
@@ -79087,7 +79118,7 @@ ${content}`);
79087
79118
  }
79088
79119
  let styles3 = "";
79089
79120
  const stylesDir = join170(repoPath, "assets", "writing-styles");
79090
- if (existsSync84(stylesDir)) {
79121
+ if (existsSync85(stylesDir)) {
79091
79122
  try {
79092
79123
  const files = readdirSync16(stylesDir).slice(0, 3);
79093
79124
  styles3 = files.map((f3) => readCapped(join170(stylesDir, f3), 1000)).filter(Boolean).join(`
@@ -79280,12 +79311,12 @@ IMPORTANT: Generate the image and output the path as JSON: {"imagePath": "/path/
79280
79311
 
79281
79312
  // src/commands/content/phases/photo-generator.ts
79282
79313
  import { execSync as execSync8 } from "node:child_process";
79283
- import { existsSync as existsSync85, mkdirSync as mkdirSync8, readdirSync as readdirSync17 } from "node:fs";
79314
+ import { existsSync as existsSync86, mkdirSync as mkdirSync8, readdirSync as readdirSync17 } from "node:fs";
79284
79315
  import { homedir as homedir55 } from "node:os";
79285
79316
  import { join as join171 } from "node:path";
79286
79317
  async function generatePhoto(_content, context, config, platform18, contentId, contentLogger) {
79287
79318
  const mediaDir = join171(config.contentDir.replace(/^~/, homedir55()), "media", String(contentId));
79288
- if (!existsSync85(mediaDir)) {
79319
+ if (!existsSync86(mediaDir)) {
79289
79320
  mkdirSync8(mediaDir, { recursive: true });
79290
79321
  }
79291
79322
  const prompt = buildPhotoPrompt(context, platform18);
@@ -79301,7 +79332,7 @@ async function generatePhoto(_content, context, config, platform18, contentId, c
79301
79332
  const parsed = parseClaudeJsonOutput(result);
79302
79333
  if (parsed && typeof parsed === "object" && "imagePath" in parsed) {
79303
79334
  const imagePath = String(parsed.imagePath);
79304
- if (existsSync85(imagePath)) {
79335
+ if (existsSync86(imagePath)) {
79305
79336
  return { path: imagePath, ...dimensions, format: "png" };
79306
79337
  }
79307
79338
  }
@@ -79397,7 +79428,7 @@ var init_content_creator = __esm(() => {
79397
79428
  });
79398
79429
 
79399
79430
  // src/commands/content/phases/content-logger.ts
79400
- import { createWriteStream as createWriteStream4, existsSync as existsSync86, mkdirSync as mkdirSync9, statSync as statSync16 } from "node:fs";
79431
+ import { createWriteStream as createWriteStream4, existsSync as existsSync87, mkdirSync as mkdirSync9, statSync as statSync16 } from "node:fs";
79401
79432
  import { homedir as homedir56 } from "node:os";
79402
79433
  import { join as join172 } from "node:path";
79403
79434
 
@@ -79411,7 +79442,7 @@ class ContentLogger {
79411
79442
  this.maxBytes = maxBytes;
79412
79443
  }
79413
79444
  init() {
79414
- if (!existsSync86(this.logDir)) {
79445
+ if (!existsSync87(this.logDir)) {
79415
79446
  mkdirSync9(this.logDir, { recursive: true });
79416
79447
  }
79417
79448
  this.rotateIfNeeded();
@@ -79549,7 +79580,7 @@ var init_sqlite_client = __esm(() => {
79549
79580
  });
79550
79581
 
79551
79582
  // src/commands/content/phases/db-manager.ts
79552
- import { existsSync as existsSync87, mkdirSync as mkdirSync10 } from "node:fs";
79583
+ import { existsSync as existsSync88, mkdirSync as mkdirSync10 } from "node:fs";
79553
79584
  import { dirname as dirname56 } from "node:path";
79554
79585
  function initDatabase(dbPath) {
79555
79586
  ensureParentDir(dbPath);
@@ -79572,7 +79603,7 @@ function runRetentionCleanup(db, retentionDays = 90) {
79572
79603
  }
79573
79604
  function ensureParentDir(dbPath) {
79574
79605
  const dir = dirname56(dbPath);
79575
- if (dir && !existsSync87(dir)) {
79606
+ if (dir && !existsSync88(dir)) {
79576
79607
  mkdirSync10(dir, { recursive: true });
79577
79608
  }
79578
79609
  }
@@ -79737,7 +79768,7 @@ function isNoiseCommit(title, author) {
79737
79768
 
79738
79769
  // src/commands/content/phases/change-detector.ts
79739
79770
  import { execSync as execSync10, spawnSync as spawnSync9 } from "node:child_process";
79740
- import { existsSync as existsSync88, readFileSync as readFileSync27, readdirSync as readdirSync18, statSync as statSync17 } from "node:fs";
79771
+ import { existsSync as existsSync89, readFileSync as readFileSync27, readdirSync as readdirSync18, statSync as statSync17 } from "node:fs";
79741
79772
  import { join as join173 } from "node:path";
79742
79773
  function detectCommits(repo, since) {
79743
79774
  try {
@@ -79848,7 +79879,7 @@ function detectTags(repo, since) {
79848
79879
  }
79849
79880
  function detectCompletedPlans(repo, since) {
79850
79881
  const plansDir = join173(repo.path, "plans");
79851
- if (!existsSync88(plansDir))
79882
+ if (!existsSync89(plansDir))
79852
79883
  return [];
79853
79884
  const sinceMs = new Date(since).getTime();
79854
79885
  const events = [];
@@ -79858,7 +79889,7 @@ function detectCompletedPlans(repo, since) {
79858
79889
  if (!entry.isDirectory())
79859
79890
  continue;
79860
79891
  const planFile = join173(plansDir, entry.name, "plan.md");
79861
- if (!existsSync88(planFile))
79892
+ if (!existsSync89(planFile))
79862
79893
  continue;
79863
79894
  try {
79864
79895
  const stat26 = statSync17(planFile);
@@ -80926,7 +80957,7 @@ var init_platform_setup_x = __esm(() => {
80926
80957
  });
80927
80958
 
80928
80959
  // src/commands/content/phases/setup-wizard.ts
80929
- import { existsSync as existsSync89 } from "node:fs";
80960
+ import { existsSync as existsSync90 } from "node:fs";
80930
80961
  import { join as join176 } from "node:path";
80931
80962
  async function runSetupWizard2(cwd2, contentLogger) {
80932
80963
  console.log();
@@ -80995,8 +81026,8 @@ async function showRepoSummary(cwd2) {
80995
81026
  function detectBrandAssets(cwd2, contentLogger) {
80996
81027
  const repos = discoverRepos2(cwd2);
80997
81028
  for (const repo of repos) {
80998
- const hasGuidelines = existsSync89(join176(repo.path, "docs", "brand-guidelines.md"));
80999
- const hasStyles = existsSync89(join176(repo.path, "assets", "writing-styles"));
81029
+ const hasGuidelines = existsSync90(join176(repo.path, "docs", "brand-guidelines.md"));
81030
+ const hasStyles = existsSync90(join176(repo.path, "assets", "writing-styles"));
81000
81031
  if (!hasGuidelines) {
81001
81032
  f2.warning(`${repo.name}: No docs/brand-guidelines.md — content will use generic tone.`);
81002
81033
  contentLogger.warn(`${repo.name}: missing docs/brand-guidelines.md`);
@@ -81062,13 +81093,13 @@ var init_setup_wizard = __esm(() => {
81062
81093
  });
81063
81094
 
81064
81095
  // src/commands/content/content-review-commands.ts
81065
- import { existsSync as existsSync90 } from "node:fs";
81096
+ import { existsSync as existsSync91 } from "node:fs";
81066
81097
  import { homedir as homedir57 } from "node:os";
81067
81098
  async function queueContent() {
81068
81099
  const cwd2 = process.cwd();
81069
81100
  const config = await loadContentConfig(cwd2);
81070
81101
  const dbPath = config.dbPath.replace(/^~/, homedir57());
81071
- if (!existsSync90(dbPath)) {
81102
+ if (!existsSync91(dbPath)) {
81072
81103
  logger.info("No content database found. Run 'ck content setup' first.");
81073
81104
  return;
81074
81105
  }
@@ -81136,12 +81167,12 @@ __export(exports_content_subcommands, {
81136
81167
  logsContent: () => logsContent,
81137
81168
  approveContentCmd: () => approveContentCmd
81138
81169
  });
81139
- import { existsSync as existsSync91, readFileSync as readFileSync28, unlinkSync as unlinkSync6 } from "node:fs";
81170
+ import { existsSync as existsSync92, readFileSync as readFileSync28, unlinkSync as unlinkSync6 } from "node:fs";
81140
81171
  import { homedir as homedir58 } from "node:os";
81141
81172
  import { join as join177 } from "node:path";
81142
81173
  function isDaemonRunning() {
81143
81174
  const lockFile = join177(LOCK_DIR, `${LOCK_NAME2}.lock`);
81144
- if (!existsSync91(lockFile))
81175
+ if (!existsSync92(lockFile))
81145
81176
  return { running: false, pid: null };
81146
81177
  try {
81147
81178
  const pidStr = readFileSync28(lockFile, "utf-8").trim();
@@ -81173,7 +81204,7 @@ async function startContent(options2) {
81173
81204
  }
81174
81205
  async function stopContent() {
81175
81206
  const lockFile = join177(LOCK_DIR, `${LOCK_NAME2}.lock`);
81176
- if (!existsSync91(lockFile)) {
81207
+ if (!existsSync92(lockFile)) {
81177
81208
  logger.info("Content daemon is not running.");
81178
81209
  return;
81179
81210
  }
@@ -81214,7 +81245,7 @@ async function logsContent(options2) {
81214
81245
  const logDir = join177(homedir58(), ".claudekit", "logs");
81215
81246
  const dateStr = new Date().toISOString().slice(0, 10).replace(/-/g, "");
81216
81247
  const logPath = join177(logDir, `content-${dateStr}.log`);
81217
- if (!existsSync91(logPath)) {
81248
+ if (!existsSync92(logPath)) {
81218
81249
  logger.info("No content logs found for today.");
81219
81250
  return;
81220
81251
  }
@@ -81249,7 +81280,7 @@ var init_content_subcommands = __esm(() => {
81249
81280
  });
81250
81281
 
81251
81282
  // src/commands/content/content-command.ts
81252
- import { existsSync as existsSync92, mkdirSync as mkdirSync11, unlinkSync as unlinkSync7, writeFileSync as writeFileSync9 } from "node:fs";
81283
+ import { existsSync as existsSync93, mkdirSync as mkdirSync11, unlinkSync as unlinkSync7, writeFileSync as writeFileSync9 } from "node:fs";
81253
81284
  import { homedir as homedir59 } from "node:os";
81254
81285
  import { join as join178 } from "node:path";
81255
81286
  async function contentCommand(options2) {
@@ -81280,7 +81311,7 @@ async function contentCommand(options2) {
81280
81311
  }
81281
81312
  contentLogger.info("Setup complete. Starting daemon...");
81282
81313
  }
81283
- if (!existsSync92(LOCK_DIR2))
81314
+ if (!existsSync93(LOCK_DIR2))
81284
81315
  mkdirSync11(LOCK_DIR2, { recursive: true });
81285
81316
  writeFileSync9(LOCK_FILE, String(process.pid), "utf-8");
81286
81317
  const dbPath = config.dbPath.replace(/^~/, homedir59());
@@ -81412,8 +81443,8 @@ function shouldRunCleanup(lastAt) {
81412
81443
  return Date.now() - new Date(lastAt).getTime() >= 86400000;
81413
81444
  }
81414
81445
  function sleep2(ms) {
81415
- return new Promise((resolve59) => {
81416
- setTimeout(resolve59, ms);
81446
+ return new Promise((resolve60) => {
81447
+ setTimeout(resolve60, ms);
81417
81448
  });
81418
81449
  }
81419
81450
  var LOCK_DIR2, LOCK_FILE, MAX_CREATION_RETRIES = 3, MAX_PUBLISH_RETRIES_PER_CYCLE = 3, PUBLISH_RETRY_WINDOW_HOURS = 24;
@@ -83671,7 +83702,7 @@ function getPagerArgs(pagerCmd) {
83671
83702
  return [];
83672
83703
  }
83673
83704
  async function trySystemPager(content) {
83674
- return new Promise((resolve59) => {
83705
+ return new Promise((resolve60) => {
83675
83706
  const pagerCmd = process.env.PAGER || "less";
83676
83707
  const pagerArgs = getPagerArgs(pagerCmd);
83677
83708
  try {
@@ -83681,20 +83712,20 @@ async function trySystemPager(content) {
83681
83712
  });
83682
83713
  const timeout2 = setTimeout(() => {
83683
83714
  pager.kill();
83684
- resolve59(false);
83715
+ resolve60(false);
83685
83716
  }, 30000);
83686
83717
  pager.stdin.write(content);
83687
83718
  pager.stdin.end();
83688
83719
  pager.on("close", (code2) => {
83689
83720
  clearTimeout(timeout2);
83690
- resolve59(code2 === 0);
83721
+ resolve60(code2 === 0);
83691
83722
  });
83692
83723
  pager.on("error", () => {
83693
83724
  clearTimeout(timeout2);
83694
- resolve59(false);
83725
+ resolve60(false);
83695
83726
  });
83696
83727
  } catch {
83697
- resolve59(false);
83728
+ resolve60(false);
83698
83729
  }
83699
83730
  });
83700
83731
  }
@@ -83721,16 +83752,16 @@ async function basicPager(content) {
83721
83752
  break;
83722
83753
  }
83723
83754
  const remaining = lines.length - currentLine;
83724
- await new Promise((resolve59) => {
83755
+ await new Promise((resolve60) => {
83725
83756
  rl.question(`-- More (${remaining} lines) [Enter/q] --`, (answer) => {
83726
83757
  if (answer.toLowerCase() === "q") {
83727
83758
  rl.close();
83728
83759
  process.exitCode = 0;
83729
- resolve59();
83760
+ resolve60();
83730
83761
  return;
83731
83762
  }
83732
83763
  process.stdout.write("\x1B[1A\x1B[2K");
83733
- resolve59();
83764
+ resolve60();
83734
83765
  });
83735
83766
  });
83736
83767
  }
@@ -88183,12 +88214,12 @@ async function configUICommand(options2 = {}) {
88183
88214
  console.log();
88184
88215
  console.log(import_picocolors15.default.dim(" Press Ctrl+C to stop"));
88185
88216
  console.log();
88186
- await new Promise((resolve37) => {
88217
+ await new Promise((resolve38) => {
88187
88218
  const shutdown = async () => {
88188
88219
  console.log();
88189
88220
  logger.info("Shutting down...");
88190
88221
  await server.close();
88191
- resolve37();
88222
+ resolve38();
88192
88223
  };
88193
88224
  process.on("SIGINT", shutdown);
88194
88225
  process.on("SIGTERM", shutdown);
@@ -88209,12 +88240,12 @@ async function configUICommand(options2 = {}) {
88209
88240
  }
88210
88241
  async function checkPort(port, host) {
88211
88242
  const { createServer: createServer2 } = await import("node:net");
88212
- return new Promise((resolve37) => {
88243
+ return new Promise((resolve38) => {
88213
88244
  const server = createServer2();
88214
- server.once("error", () => resolve37(false));
88245
+ server.once("error", () => resolve38(false));
88215
88246
  server.once("listening", () => {
88216
88247
  server.close();
88217
- resolve37(true);
88248
+ resolve38(true);
88218
88249
  });
88219
88250
  server.listen(port, host);
88220
88251
  });
@@ -89389,7 +89420,7 @@ async function checkCliInstallMethod() {
89389
89420
  };
89390
89421
  }
89391
89422
  // src/domains/health-checks/checkers/claude-md-checker.ts
89392
- import { existsSync as existsSync52, statSync as statSync11 } from "node:fs";
89423
+ import { existsSync as existsSync53, statSync as statSync11 } from "node:fs";
89393
89424
  import { join as join74 } from "node:path";
89394
89425
  function checkClaudeMd(setup, projectDir) {
89395
89426
  const results = [];
@@ -89402,7 +89433,7 @@ function checkClaudeMd(setup, projectDir) {
89402
89433
  return results;
89403
89434
  }
89404
89435
  function checkClaudeMdFile(path7, name, id) {
89405
- if (!existsSync52(path7)) {
89436
+ if (!existsSync53(path7)) {
89406
89437
  return {
89407
89438
  id,
89408
89439
  name,
@@ -89455,11 +89486,11 @@ function checkClaudeMdFile(path7, name, id) {
89455
89486
  }
89456
89487
  }
89457
89488
  // src/domains/health-checks/checkers/active-plan-checker.ts
89458
- import { existsSync as existsSync53, readFileSync as readFileSync19 } from "node:fs";
89489
+ import { existsSync as existsSync54, readFileSync as readFileSync19 } from "node:fs";
89459
89490
  import { join as join75 } from "node:path";
89460
89491
  function checkActivePlan(projectDir) {
89461
89492
  const activePlanPath = join75(projectDir, ".claude", "active-plan");
89462
- if (!existsSync53(activePlanPath)) {
89493
+ if (!existsSync54(activePlanPath)) {
89463
89494
  return {
89464
89495
  id: "ck-active-plan",
89465
89496
  name: "Active Plan",
@@ -89473,7 +89504,7 @@ function checkActivePlan(projectDir) {
89473
89504
  try {
89474
89505
  const targetPath = readFileSync19(activePlanPath, "utf-8").trim();
89475
89506
  const fullPath = join75(projectDir, targetPath);
89476
- if (!existsSync53(fullPath)) {
89507
+ if (!existsSync54(fullPath)) {
89477
89508
  return {
89478
89509
  id: "ck-active-plan",
89479
89510
  name: "Active Plan",
@@ -89509,7 +89540,7 @@ function checkActivePlan(projectDir) {
89509
89540
  }
89510
89541
  }
89511
89542
  // src/domains/health-checks/checkers/skills-checker.ts
89512
- import { existsSync as existsSync54 } from "node:fs";
89543
+ import { existsSync as existsSync55 } from "node:fs";
89513
89544
  import { join as join76 } from "node:path";
89514
89545
  function checkSkillsScripts(setup) {
89515
89546
  const results = [];
@@ -89517,7 +89548,7 @@ function checkSkillsScripts(setup) {
89517
89548
  const scriptName = platform8 === "win32" ? "install.ps1" : "install.sh";
89518
89549
  if (setup.global.path) {
89519
89550
  const globalScriptPath = join76(setup.global.path, "skills", scriptName);
89520
- const hasGlobalScript = existsSync54(globalScriptPath);
89551
+ const hasGlobalScript = existsSync55(globalScriptPath);
89521
89552
  results.push({
89522
89553
  id: "ck-global-skills-script",
89523
89554
  name: "Global Skills Script",
@@ -89532,7 +89563,7 @@ function checkSkillsScripts(setup) {
89532
89563
  }
89533
89564
  if (setup.project.metadata) {
89534
89565
  const projectScriptPath = join76(setup.project.path, "skills", scriptName);
89535
- const hasProjectScript = existsSync54(projectScriptPath);
89566
+ const hasProjectScript = existsSync55(projectScriptPath);
89536
89567
  results.push({
89537
89568
  id: "ck-project-skills-script",
89538
89569
  name: "Project Skills Script",
@@ -89568,16 +89599,16 @@ function checkComponentCounts(setup) {
89568
89599
  }
89569
89600
  // src/domains/health-checks/checkers/skill-budget-checker.ts
89570
89601
  init_path_resolver();
89571
- import { join as join78, resolve as resolve37 } from "node:path";
89602
+ import { join as join78, resolve as resolve38 } from "node:path";
89572
89603
 
89573
89604
  // src/domains/health-checks/checkers/skill-budget-scanner.ts
89574
89605
  var import_gray_matter11 = __toESM(require_gray_matter(), 1);
89575
- import { existsSync as existsSync55 } from "node:fs";
89606
+ import { existsSync as existsSync56 } from "node:fs";
89576
89607
  import { readFile as readFile41, readdir as readdir20 } from "node:fs/promises";
89577
89608
  import { basename as basename25, join as join77, relative as relative17 } from "node:path";
89578
89609
  var SKIP_DIRS5 = new Set([".git", ".venv", "__pycache__", "node_modules", "scripts", "common"]);
89579
89610
  async function scanSkills2(skillsDir2) {
89580
- if (!existsSync55(skillsDir2))
89611
+ if (!existsSync56(skillsDir2))
89581
89612
  return [];
89582
89613
  const skillDirs = await findSkillDirs(skillsDir2);
89583
89614
  const skills = [];
@@ -89609,7 +89640,7 @@ async function findSkillDirs(dir) {
89609
89640
  const results = [];
89610
89641
  for (const entry of entries) {
89611
89642
  const child = join77(dir, entry.name);
89612
- if (existsSync55(join77(child, "SKILL.md"))) {
89643
+ if (existsSync56(join77(child, "SKILL.md"))) {
89613
89644
  results.push(child);
89614
89645
  continue;
89615
89646
  }
@@ -89627,7 +89658,7 @@ function normalizeSkillId(rawName, fallbackId) {
89627
89658
 
89628
89659
  // src/domains/health-checks/checkers/skill-budget-settings.ts
89629
89660
  init_settings_merger();
89630
- import { existsSync as existsSync56 } from "node:fs";
89661
+ import { existsSync as existsSync57 } from "node:fs";
89631
89662
  import { mkdir as mkdir20, readFile as readFile42 } from "node:fs/promises";
89632
89663
  var CONTEXT_FLOOR_TOKENS = 200000;
89633
89664
  var CHARS_PER_TOKEN = 4;
@@ -89636,7 +89667,7 @@ var CK_RECOMMENDED_MAX_DESC_CHARS = 512;
89636
89667
  var RECOMMENDED_DESC_CHARS = 200;
89637
89668
  var LISTING_OVERHEAD_PER_SKILL = 4;
89638
89669
  async function readProjectSettings(settingsPath) {
89639
- if (!existsSync56(settingsPath))
89670
+ if (!existsSync57(settingsPath))
89640
89671
  return { exists: false, settings: null };
89641
89672
  try {
89642
89673
  const parsed = JSON.parse(await readFile42(settingsPath, "utf8"));
@@ -89687,8 +89718,8 @@ async function applyBudgetDefaults(settingsPath, projectClaudeDir, requiredFract
89687
89718
  // src/domains/health-checks/checkers/skill-budget-checker.ts
89688
89719
  var ENGINEER_SKILL_COUNT_THRESHOLD = 20;
89689
89720
  async function checkSkillBudget(setup, projectDir) {
89690
- const projectClaudeDir = resolve37(projectDir, ".claude");
89691
- const globalClaudeDir = resolve37(PathResolver.getGlobalKitDir());
89721
+ const projectClaudeDir = resolve38(projectDir, ".claude");
89722
+ const globalClaudeDir = resolve38(PathResolver.getGlobalKitDir());
89692
89723
  const projectScopeAliasesGlobal = projectClaudeDir === globalClaudeDir;
89693
89724
  const [projectSkills, globalSkills] = await Promise.all([
89694
89725
  projectScopeAliasesGlobal ? Promise.resolve([]) : scanSkills2(join78(projectClaudeDir, "skills")),
@@ -89945,14 +89976,14 @@ async function checkGlobalDirWritable() {
89945
89976
  }
89946
89977
  // src/domains/health-checks/checkers/hooks-checker.ts
89947
89978
  init_path_resolver();
89948
- import { existsSync as existsSync57 } from "node:fs";
89979
+ import { existsSync as existsSync58 } from "node:fs";
89949
89980
  import { readdir as readdir21 } from "node:fs/promises";
89950
89981
  import { join as join80 } from "node:path";
89951
89982
 
89952
89983
  // src/domains/health-checks/utils/path-normalizer.ts
89953
- import { normalize as normalize5 } from "node:path";
89984
+ import { normalize as normalize6 } from "node:path";
89954
89985
  function normalizePath2(filePath) {
89955
- const normalized = normalize5(filePath);
89986
+ const normalized = normalize6(filePath);
89956
89987
  const isCaseInsensitive = process.platform === "win32" || process.platform === "darwin";
89957
89988
  return isCaseInsensitive ? normalized.toLowerCase() : normalized;
89958
89989
  }
@@ -89962,8 +89993,8 @@ init_shared2();
89962
89993
  async function checkHooksExist(projectDir) {
89963
89994
  const globalHooksDir = join80(PathResolver.getGlobalKitDir(), "hooks");
89964
89995
  const projectHooksDir = join80(projectDir, ".claude", "hooks");
89965
- const globalExists = existsSync57(globalHooksDir);
89966
- const projectExists = existsSync57(projectHooksDir);
89996
+ const globalExists = existsSync58(globalHooksDir);
89997
+ const projectExists = existsSync58(projectHooksDir);
89967
89998
  let hookCount = 0;
89968
89999
  const checkedFiles = new Set;
89969
90000
  if (globalExists) {
@@ -90010,13 +90041,13 @@ async function checkHooksExist(projectDir) {
90010
90041
  // src/domains/health-checks/checkers/settings-checker.ts
90011
90042
  init_logger();
90012
90043
  init_path_resolver();
90013
- import { existsSync as existsSync58 } from "node:fs";
90044
+ import { existsSync as existsSync59 } from "node:fs";
90014
90045
  import { readFile as readFile43 } from "node:fs/promises";
90015
90046
  import { join as join81 } from "node:path";
90016
90047
  async function checkSettingsValid(projectDir) {
90017
90048
  const globalSettings = join81(PathResolver.getGlobalKitDir(), "settings.json");
90018
90049
  const projectSettings = join81(projectDir, ".claude", "settings.json");
90019
- const settingsPath = existsSync58(globalSettings) ? globalSettings : existsSync58(projectSettings) ? projectSettings : null;
90050
+ const settingsPath = existsSync59(globalSettings) ? globalSettings : existsSync59(projectSettings) ? projectSettings : null;
90020
90051
  if (!settingsPath) {
90021
90052
  return {
90022
90053
  id: "ck-settings-valid",
@@ -90085,14 +90116,14 @@ async function checkSettingsValid(projectDir) {
90085
90116
  // src/domains/health-checks/checkers/path-refs-checker.ts
90086
90117
  init_logger();
90087
90118
  init_path_resolver();
90088
- import { existsSync as existsSync59 } from "node:fs";
90119
+ import { existsSync as existsSync60 } from "node:fs";
90089
90120
  import { readFile as readFile44 } from "node:fs/promises";
90090
90121
  import { homedir as homedir43 } from "node:os";
90091
- import { dirname as dirname32, join as join82, normalize as normalize6, resolve as resolve38 } from "node:path";
90122
+ import { dirname as dirname32, join as join82, normalize as normalize7, resolve as resolve39 } from "node:path";
90092
90123
  async function checkPathRefsValid(projectDir) {
90093
90124
  const globalClaudeMd = join82(PathResolver.getGlobalKitDir(), "CLAUDE.md");
90094
90125
  const projectClaudeMd = join82(projectDir, ".claude", "CLAUDE.md");
90095
- const claudeMdPath = existsSync59(globalClaudeMd) ? globalClaudeMd : existsSync59(projectClaudeMd) ? projectClaudeMd : null;
90126
+ const claudeMdPath = existsSync60(globalClaudeMd) ? globalClaudeMd : existsSync60(projectClaudeMd) ? projectClaudeMd : null;
90096
90127
  if (!claudeMdPath) {
90097
90128
  return {
90098
90129
  id: "ck-path-refs-valid",
@@ -90125,27 +90156,27 @@ async function checkPathRefsValid(projectDir) {
90125
90156
  for (const ref of refs) {
90126
90157
  let refPath;
90127
90158
  if (ref.startsWith("$HOME") || ref.startsWith("${HOME}") || ref.startsWith("%USERPROFILE%")) {
90128
- refPath = normalize6(ref.replace(/^\$\{?HOME\}?/, home5).replace("%USERPROFILE%", home5));
90159
+ refPath = normalize7(ref.replace(/^\$\{?HOME\}?/, home5).replace("%USERPROFILE%", home5));
90129
90160
  } else if (ref.startsWith("$CLAUDE_PROJECT_DIR") || ref.startsWith("${CLAUDE_PROJECT_DIR}") || ref.startsWith("%CLAUDE_PROJECT_DIR%")) {
90130
- refPath = normalize6(ref.replace(/^\$\{?CLAUDE_PROJECT_DIR\}?/, projectDir).replace("%CLAUDE_PROJECT_DIR%", projectDir));
90161
+ refPath = normalize7(ref.replace(/^\$\{?CLAUDE_PROJECT_DIR\}?/, projectDir).replace("%CLAUDE_PROJECT_DIR%", projectDir));
90131
90162
  } else if (ref.startsWith("~")) {
90132
- refPath = normalize6(ref.replace(/^~/, home5));
90163
+ refPath = normalize7(ref.replace(/^~/, home5));
90133
90164
  } else if (ref.startsWith("/")) {
90134
- refPath = normalize6(ref);
90165
+ refPath = normalize7(ref);
90135
90166
  } else if (/^[A-Za-z]:/.test(ref)) {
90136
- refPath = normalize6(ref);
90167
+ refPath = normalize7(ref);
90137
90168
  } else {
90138
- refPath = resolve38(baseDir, ref);
90169
+ refPath = resolve39(baseDir, ref);
90139
90170
  }
90140
- const normalizedPath = normalize6(refPath);
90171
+ const normalizedPath = normalize7(refPath);
90141
90172
  const isWithinHome = normalizedPath.startsWith(home5);
90142
- const isWithinBase2 = normalizedPath.startsWith(normalize6(baseDir));
90173
+ const isWithinBase2 = normalizedPath.startsWith(normalize7(baseDir));
90143
90174
  const isAbsoluteAllowed = ref.startsWith("/") || /^[A-Za-z]:/.test(ref);
90144
90175
  if (!isWithinHome && !isWithinBase2 && !isAbsoluteAllowed) {
90145
90176
  logger.verbose("Skipping potentially unsafe path reference", { ref, refPath });
90146
90177
  continue;
90147
90178
  }
90148
- if (!existsSync59(normalizedPath)) {
90179
+ if (!existsSync60(normalizedPath)) {
90149
90180
  broken.push(ref);
90150
90181
  }
90151
90182
  }
@@ -90184,7 +90215,7 @@ async function checkPathRefsValid(projectDir) {
90184
90215
  }
90185
90216
  }
90186
90217
  // src/domains/health-checks/checkers/config-completeness-checker.ts
90187
- import { existsSync as existsSync60 } from "node:fs";
90218
+ import { existsSync as existsSync61 } from "node:fs";
90188
90219
  import { readdir as readdir22 } from "node:fs/promises";
90189
90220
  import { join as join83 } from "node:path";
90190
90221
  async function checkProjectConfigCompleteness(setup, projectDir) {
@@ -90224,11 +90255,11 @@ async function checkProjectConfigCompleteness(setup, projectDir) {
90224
90255
  const requiredDirs = ["agents", "commands", "skills"];
90225
90256
  const missingDirs = [];
90226
90257
  for (const dir of requiredDirs) {
90227
- if (!existsSync60(join83(projectClaudeDir, dir))) {
90258
+ if (!existsSync61(join83(projectClaudeDir, dir))) {
90228
90259
  missingDirs.push(dir);
90229
90260
  }
90230
90261
  }
90231
- const hasRulesOrWorkflows = existsSync60(join83(projectClaudeDir, "rules")) || existsSync60(join83(projectClaudeDir, "workflows"));
90262
+ const hasRulesOrWorkflows = existsSync61(join83(projectClaudeDir, "rules")) || existsSync61(join83(projectClaudeDir, "workflows"));
90232
90263
  if (!hasRulesOrWorkflows) {
90233
90264
  missingDirs.push("rules");
90234
90265
  }
@@ -91260,7 +91291,7 @@ init_environment();
91260
91291
  init_path_resolver();
91261
91292
  import { constants as constants3, access as access4, mkdir as mkdir21, readFile as readFile46, unlink as unlink11, writeFile as writeFile23 } from "node:fs/promises";
91262
91293
  import { arch as arch2, homedir as homedir44, platform as platform8 } from "node:os";
91263
- import { join as join88, normalize as normalize7 } from "node:path";
91294
+ import { join as join88, normalize as normalize8 } from "node:path";
91264
91295
  function shouldSkipExpensiveOperations4() {
91265
91296
  return shouldSkipExpensiveOperations();
91266
91297
  }
@@ -91282,9 +91313,9 @@ async function checkPlatformDetect() {
91282
91313
  };
91283
91314
  }
91284
91315
  async function checkHomeDirResolution() {
91285
- const nodeHome = normalize7(homedir44());
91316
+ const nodeHome = normalize8(homedir44());
91286
91317
  const rawEnvHome = getHomeDirectoryFromEnv(platform8());
91287
- const envHome = rawEnvHome ? normalize7(rawEnvHome) : "";
91318
+ const envHome = rawEnvHome ? normalize8(rawEnvHome) : "";
91288
91319
  const match = nodeHome === envHome && envHome !== "";
91289
91320
  return {
91290
91321
  id: "home-dir-resolution",
@@ -91732,17 +91763,17 @@ function createDefaultDns() {
91732
91763
  }
91733
91764
  function createDefaultTcp() {
91734
91765
  return {
91735
- connect: ({ host, port, timeoutMs }) => new Promise((resolve39) => {
91766
+ connect: ({ host, port, timeoutMs }) => new Promise((resolve40) => {
91736
91767
  const start = Date.now();
91737
91768
  const socket = net2.createConnection({ host, port });
91738
91769
  const timer = setTimeout(() => {
91739
91770
  socket.destroy();
91740
- resolve39({ ok: false, layer: "tcp", detail: "timeout", latencyMs: Date.now() - start });
91771
+ resolve40({ ok: false, layer: "tcp", detail: "timeout", latencyMs: Date.now() - start });
91741
91772
  }, timeoutMs);
91742
91773
  socket.on("connect", () => {
91743
91774
  clearTimeout(timer);
91744
91775
  socket.destroy();
91745
- resolve39({
91776
+ resolve40({
91746
91777
  ok: true,
91747
91778
  layer: "tcp",
91748
91779
  detail: "connected",
@@ -91751,7 +91782,7 @@ function createDefaultTcp() {
91751
91782
  });
91752
91783
  socket.on("error", (err) => {
91753
91784
  clearTimeout(timer);
91754
- resolve39({
91785
+ resolve40({
91755
91786
  ok: false,
91756
91787
  layer: "tcp",
91757
91788
  detail: err.message,
@@ -91763,11 +91794,11 @@ function createDefaultTcp() {
91763
91794
  }
91764
91795
  function createDefaultTls() {
91765
91796
  return {
91766
- get: (url, timeoutMs) => new Promise((resolve39) => {
91797
+ get: (url, timeoutMs) => new Promise((resolve40) => {
91767
91798
  const start = Date.now();
91768
91799
  const timer = setTimeout(() => {
91769
91800
  req.destroy();
91770
- resolve39({ ok: false, layer: "tls", detail: "timeout", latencyMs: Date.now() - start });
91801
+ resolve40({ ok: false, layer: "tls", detail: "timeout", latencyMs: Date.now() - start });
91771
91802
  }, timeoutMs);
91772
91803
  const req = https.get(url, {
91773
91804
  headers: {
@@ -91779,14 +91810,14 @@ function createDefaultTls() {
91779
91810
  const status = res.statusCode ?? 0;
91780
91811
  const latencyMs = Date.now() - start;
91781
91812
  if (status === 200) {
91782
- resolve39({ ok: true, layer: "tls", detail: `HTTP ${status}`, latencyMs });
91813
+ resolve40({ ok: true, layer: "tls", detail: `HTTP ${status}`, latencyMs });
91783
91814
  } else {
91784
- resolve39({ ok: false, layer: "tls", detail: `HTTP ${status}`, latencyMs });
91815
+ resolve40({ ok: false, layer: "tls", detail: `HTTP ${status}`, latencyMs });
91785
91816
  }
91786
91817
  });
91787
91818
  req.on("error", (err) => {
91788
91819
  clearTimeout(timer);
91789
- resolve39({
91820
+ resolve40({
91790
91821
  ok: false,
91791
91822
  layer: "tls",
91792
91823
  detail: err.message,
@@ -91907,7 +91938,7 @@ async function checkGitHubReachability(deps) {
91907
91938
  };
91908
91939
  }
91909
91940
  function raceTimeout(promise, ms) {
91910
- return new Promise((resolve39, reject) => {
91941
+ return new Promise((resolve40, reject) => {
91911
91942
  let settled = false;
91912
91943
  const timer = setTimeout(() => {
91913
91944
  setImmediate(() => {
@@ -91922,7 +91953,7 @@ function raceTimeout(promise, ms) {
91922
91953
  return;
91923
91954
  settled = true;
91924
91955
  clearTimeout(timer);
91925
- resolve39(v2);
91956
+ resolve40(v2);
91926
91957
  }, (e2) => {
91927
91958
  if (settled)
91928
91959
  return;
@@ -92590,7 +92621,7 @@ init_config_version_checker();
92590
92621
 
92591
92622
  // src/domains/sync/sync-engine.ts
92592
92623
  import { lstat as lstat6, readFile as readFile48, readlink as readlink2, realpath as realpath8, stat as stat14 } from "node:fs/promises";
92593
- import { isAbsolute as isAbsolute12, join as join91, normalize as normalize8, relative as relative19 } from "node:path";
92624
+ import { isAbsolute as isAbsolute12, join as join91, normalize as normalize9, relative as relative19 } from "node:path";
92594
92625
 
92595
92626
  // src/services/file-operations/ownership-checker.ts
92596
92627
  init_metadata_migration();
@@ -93806,7 +93837,7 @@ async function validateSymlinkChain(path8, basePath, maxDepth = MAX_SYMLINK_DEPT
93806
93837
  break;
93807
93838
  const target = await readlink2(current);
93808
93839
  const resolvedTarget = isAbsolute12(target) ? target : join91(current, "..", target);
93809
- const normalizedTarget = normalize8(resolvedTarget);
93840
+ const normalizedTarget = normalize9(resolvedTarget);
93810
93841
  const rel = relative19(basePath, normalizedTarget);
93811
93842
  if (rel.startsWith("..") || isAbsolute12(rel)) {
93812
93843
  throw new Error(`Symlink chain escapes base directory at depth ${depth}: ${path8}`);
@@ -93834,7 +93865,7 @@ async function validateSyncPath(basePath, filePath) {
93834
93865
  if (filePath.length > 1024) {
93835
93866
  throw new Error(`Path too long: ${filePath.slice(0, 50)}...`);
93836
93867
  }
93837
- const normalized = normalize8(filePath);
93868
+ const normalized = normalize9(filePath);
93838
93869
  if (isAbsolute12(normalized)) {
93839
93870
  throw new Error(`Absolute paths not allowed: ${filePath}`);
93840
93871
  }
@@ -95388,21 +95419,21 @@ init_types3();
95388
95419
 
95389
95420
  // src/domains/installation/utils/path-security.ts
95390
95421
  init_types3();
95391
- import { lstatSync as lstatSync2, realpathSync as realpathSync4 } from "node:fs";
95392
- import { relative as relative20, resolve as resolve41 } from "node:path";
95422
+ import { lstatSync as lstatSync2, realpathSync as realpathSync5 } from "node:fs";
95423
+ import { relative as relative20, resolve as resolve42 } from "node:path";
95393
95424
  var MAX_EXTRACTION_SIZE = 500 * 1024 * 1024;
95394
95425
  function isPathSafe(basePath, targetPath) {
95395
- const resolvedBase = resolve41(basePath);
95426
+ const resolvedBase = resolve42(basePath);
95396
95427
  try {
95397
95428
  const stat15 = lstatSync2(targetPath);
95398
95429
  if (stat15.isSymbolicLink()) {
95399
- const realTarget = realpathSync4(targetPath);
95430
+ const realTarget = realpathSync5(targetPath);
95400
95431
  if (!realTarget.startsWith(resolvedBase)) {
95401
95432
  return false;
95402
95433
  }
95403
95434
  }
95404
95435
  } catch {}
95405
- const resolvedTarget = resolve41(targetPath);
95436
+ const resolvedTarget = resolve42(targetPath);
95406
95437
  const relativePath = relative20(resolvedBase, resolvedTarget);
95407
95438
  return !relativePath.startsWith("..") && !relativePath.startsWith("/") && resolvedTarget.startsWith(resolvedBase);
95408
95439
  }
@@ -95490,7 +95521,7 @@ class FileDownloader {
95490
95521
  }
95491
95522
  if (downloadedSize !== totalSize) {
95492
95523
  fileStream.end();
95493
- await new Promise((resolve42) => fileStream.once("close", resolve42));
95524
+ await new Promise((resolve43) => fileStream.once("close", resolve43));
95494
95525
  try {
95495
95526
  rmSync(destPath, { force: true });
95496
95527
  } catch (cleanupError) {
@@ -95504,7 +95535,7 @@ class FileDownloader {
95504
95535
  return destPath;
95505
95536
  } catch (error) {
95506
95537
  fileStream.end();
95507
- await new Promise((resolve42) => fileStream.once("close", resolve42));
95538
+ await new Promise((resolve43) => fileStream.once("close", resolve43));
95508
95539
  try {
95509
95540
  rmSync(destPath, { force: true });
95510
95541
  } catch (cleanupError) {
@@ -95570,7 +95601,7 @@ class FileDownloader {
95570
95601
  const expectedSize = Number(response.headers.get("content-length"));
95571
95602
  if (expectedSize > 0 && downloadedSize !== expectedSize) {
95572
95603
  fileStream.end();
95573
- await new Promise((resolve42) => fileStream.once("close", resolve42));
95604
+ await new Promise((resolve43) => fileStream.once("close", resolve43));
95574
95605
  try {
95575
95606
  rmSync(destPath, { force: true });
95576
95607
  } catch (cleanupError) {
@@ -95588,7 +95619,7 @@ class FileDownloader {
95588
95619
  return destPath;
95589
95620
  } catch (error) {
95590
95621
  fileStream.end();
95591
- await new Promise((resolve42) => fileStream.once("close", resolve42));
95622
+ await new Promise((resolve43) => fileStream.once("close", resolve43));
95592
95623
  try {
95593
95624
  rmSync(destPath, { force: true });
95594
95625
  } catch (cleanupError) {
@@ -96207,10 +96238,10 @@ class Minipass extends EventEmitter3 {
96207
96238
  return this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
96208
96239
  }
96209
96240
  async promise() {
96210
- return new Promise((resolve42, reject) => {
96241
+ return new Promise((resolve43, reject) => {
96211
96242
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
96212
96243
  this.on("error", (er) => reject(er));
96213
- this.on("end", () => resolve42());
96244
+ this.on("end", () => resolve43());
96214
96245
  });
96215
96246
  }
96216
96247
  [Symbol.asyncIterator]() {
@@ -96229,7 +96260,7 @@ class Minipass extends EventEmitter3 {
96229
96260
  return Promise.resolve({ done: false, value: res });
96230
96261
  if (this[EOF])
96231
96262
  return stop();
96232
- let resolve42;
96263
+ let resolve43;
96233
96264
  let reject;
96234
96265
  const onerr = (er) => {
96235
96266
  this.off("data", ondata);
@@ -96243,19 +96274,19 @@ class Minipass extends EventEmitter3 {
96243
96274
  this.off("end", onend);
96244
96275
  this.off(DESTROYED, ondestroy);
96245
96276
  this.pause();
96246
- resolve42({ value, done: !!this[EOF] });
96277
+ resolve43({ value, done: !!this[EOF] });
96247
96278
  };
96248
96279
  const onend = () => {
96249
96280
  this.off("error", onerr);
96250
96281
  this.off("data", ondata);
96251
96282
  this.off(DESTROYED, ondestroy);
96252
96283
  stop();
96253
- resolve42({ done: true, value: undefined });
96284
+ resolve43({ done: true, value: undefined });
96254
96285
  };
96255
96286
  const ondestroy = () => onerr(new Error("stream destroyed"));
96256
96287
  return new Promise((res2, rej) => {
96257
96288
  reject = rej;
96258
- resolve42 = res2;
96289
+ resolve43 = res2;
96259
96290
  this.once(DESTROYED, ondestroy);
96260
96291
  this.once("error", onerr);
96261
96292
  this.once("end", onend);
@@ -97361,10 +97392,10 @@ class Minipass2 extends EventEmitter4 {
97361
97392
  return this[ENCODING2] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
97362
97393
  }
97363
97394
  async promise() {
97364
- return new Promise((resolve42, reject) => {
97395
+ return new Promise((resolve43, reject) => {
97365
97396
  this.on(DESTROYED2, () => reject(new Error("stream destroyed")));
97366
97397
  this.on("error", (er) => reject(er));
97367
- this.on("end", () => resolve42());
97398
+ this.on("end", () => resolve43());
97368
97399
  });
97369
97400
  }
97370
97401
  [Symbol.asyncIterator]() {
@@ -97383,7 +97414,7 @@ class Minipass2 extends EventEmitter4 {
97383
97414
  return Promise.resolve({ done: false, value: res });
97384
97415
  if (this[EOF2])
97385
97416
  return stop();
97386
- let resolve42;
97417
+ let resolve43;
97387
97418
  let reject;
97388
97419
  const onerr = (er) => {
97389
97420
  this.off("data", ondata);
@@ -97397,19 +97428,19 @@ class Minipass2 extends EventEmitter4 {
97397
97428
  this.off("end", onend);
97398
97429
  this.off(DESTROYED2, ondestroy);
97399
97430
  this.pause();
97400
- resolve42({ value, done: !!this[EOF2] });
97431
+ resolve43({ value, done: !!this[EOF2] });
97401
97432
  };
97402
97433
  const onend = () => {
97403
97434
  this.off("error", onerr);
97404
97435
  this.off("data", ondata);
97405
97436
  this.off(DESTROYED2, ondestroy);
97406
97437
  stop();
97407
- resolve42({ done: true, value: undefined });
97438
+ resolve43({ done: true, value: undefined });
97408
97439
  };
97409
97440
  const ondestroy = () => onerr(new Error("stream destroyed"));
97410
97441
  return new Promise((res2, rej) => {
97411
97442
  reject = rej;
97412
- resolve42 = res2;
97443
+ resolve43 = res2;
97413
97444
  this.once(DESTROYED2, ondestroy);
97414
97445
  this.once("error", onerr);
97415
97446
  this.once("end", onend);
@@ -98837,10 +98868,10 @@ class Minipass3 extends EventEmitter5 {
98837
98868
  return this[ENCODING3] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
98838
98869
  }
98839
98870
  async promise() {
98840
- return new Promise((resolve42, reject) => {
98871
+ return new Promise((resolve43, reject) => {
98841
98872
  this.on(DESTROYED3, () => reject(new Error("stream destroyed")));
98842
98873
  this.on("error", (er) => reject(er));
98843
- this.on("end", () => resolve42());
98874
+ this.on("end", () => resolve43());
98844
98875
  });
98845
98876
  }
98846
98877
  [Symbol.asyncIterator]() {
@@ -98859,7 +98890,7 @@ class Minipass3 extends EventEmitter5 {
98859
98890
  return Promise.resolve({ done: false, value: res });
98860
98891
  if (this[EOF3])
98861
98892
  return stop();
98862
- let resolve42;
98893
+ let resolve43;
98863
98894
  let reject;
98864
98895
  const onerr = (er) => {
98865
98896
  this.off("data", ondata);
@@ -98873,19 +98904,19 @@ class Minipass3 extends EventEmitter5 {
98873
98904
  this.off("end", onend);
98874
98905
  this.off(DESTROYED3, ondestroy);
98875
98906
  this.pause();
98876
- resolve42({ value, done: !!this[EOF3] });
98907
+ resolve43({ value, done: !!this[EOF3] });
98877
98908
  };
98878
98909
  const onend = () => {
98879
98910
  this.off("error", onerr);
98880
98911
  this.off("data", ondata);
98881
98912
  this.off(DESTROYED3, ondestroy);
98882
98913
  stop();
98883
- resolve42({ done: true, value: undefined });
98914
+ resolve43({ done: true, value: undefined });
98884
98915
  };
98885
98916
  const ondestroy = () => onerr(new Error("stream destroyed"));
98886
98917
  return new Promise((res2, rej) => {
98887
98918
  reject = rej;
98888
- resolve42 = res2;
98919
+ resolve43 = res2;
98889
98920
  this.once(DESTROYED3, ondestroy);
98890
98921
  this.once("error", onerr);
98891
98922
  this.once("end", onend);
@@ -99656,9 +99687,9 @@ var listFile = (opt, _files) => {
99656
99687
  const parse5 = new Parser(opt);
99657
99688
  const readSize = opt.maxReadSize || 16 * 1024 * 1024;
99658
99689
  const file = opt.file;
99659
- const p = new Promise((resolve42, reject) => {
99690
+ const p = new Promise((resolve43, reject) => {
99660
99691
  parse5.on("error", reject);
99661
- parse5.on("end", resolve42);
99692
+ parse5.on("end", resolve43);
99662
99693
  fs10.stat(file, (er, stat15) => {
99663
99694
  if (er) {
99664
99695
  reject(er);
@@ -102238,9 +102269,9 @@ var extractFile = (opt, _3) => {
102238
102269
  const u = new Unpack(opt);
102239
102270
  const readSize = opt.maxReadSize || 16 * 1024 * 1024;
102240
102271
  const file = opt.file;
102241
- const p = new Promise((resolve42, reject) => {
102272
+ const p = new Promise((resolve43, reject) => {
102242
102273
  u.on("error", reject);
102243
- u.on("close", resolve42);
102274
+ u.on("close", resolve43);
102244
102275
  fs17.stat(file, (er, stat15) => {
102245
102276
  if (er) {
102246
102277
  reject(er);
@@ -102373,7 +102404,7 @@ var replaceAsync = (opt, files) => {
102373
102404
  };
102374
102405
  fs18.read(fd, headBuf, 0, 512, position, onread);
102375
102406
  };
102376
- const promise = new Promise((resolve42, reject) => {
102407
+ const promise = new Promise((resolve43, reject) => {
102377
102408
  p.on("error", reject);
102378
102409
  let flag = "r+";
102379
102410
  const onopen = (er, fd) => {
@@ -102398,7 +102429,7 @@ var replaceAsync = (opt, files) => {
102398
102429
  });
102399
102430
  p.pipe(stream);
102400
102431
  stream.on("error", reject);
102401
- stream.on("close", resolve42);
102432
+ stream.on("close", resolve43);
102402
102433
  addFilesAsync2(p, files);
102403
102434
  });
102404
102435
  });
@@ -103354,8 +103385,8 @@ async function handleDownload(ctx) {
103354
103385
  import { join as join125 } from "node:path";
103355
103386
 
103356
103387
  // src/domains/installation/deletion-handler.ts
103357
- import { existsSync as existsSync66, lstatSync as lstatSync3, readdirSync as readdirSync10, rmSync as rmSync2, rmdirSync, unlinkSync as unlinkSync4 } from "node:fs";
103358
- import { dirname as dirname38, join as join110, relative as relative22, resolve as resolve43, sep as sep12 } from "node:path";
103388
+ import { existsSync as existsSync67, lstatSync as lstatSync3, readdirSync as readdirSync10, rmSync as rmSync2, rmdirSync, unlinkSync as unlinkSync4 } from "node:fs";
103389
+ import { dirname as dirname38, join as join110, relative as relative22, resolve as resolve44, sep as sep12 } from "node:path";
103359
103390
 
103360
103391
  // src/services/file-operations/manifest/manifest-reader.ts
103361
103392
  init_metadata_migration();
@@ -103545,7 +103576,7 @@ function shouldDeletePath(path16, metadata, kitType) {
103545
103576
  }
103546
103577
  function collectFilesRecursively(dir, baseDir) {
103547
103578
  const results = [];
103548
- if (!existsSync66(dir))
103579
+ if (!existsSync67(dir))
103549
103580
  return results;
103550
103581
  try {
103551
103582
  const entries = readdirSync10(dir, { withFileTypes: true });
@@ -103580,8 +103611,8 @@ function expandGlobPatterns(patterns, claudeDir3) {
103580
103611
  }
103581
103612
  var MAX_CLEANUP_ITERATIONS = 50;
103582
103613
  function cleanupEmptyDirectories(filePath, claudeDir3) {
103583
- const normalizedClaudeDir = resolve43(claudeDir3);
103584
- let currentDir = resolve43(dirname38(filePath));
103614
+ const normalizedClaudeDir = resolve44(claudeDir3);
103615
+ let currentDir = resolve44(dirname38(filePath));
103585
103616
  let iterations = 0;
103586
103617
  while (currentDir !== normalizedClaudeDir && currentDir.startsWith(normalizedClaudeDir) && iterations < MAX_CLEANUP_ITERATIONS) {
103587
103618
  iterations++;
@@ -103590,7 +103621,7 @@ function cleanupEmptyDirectories(filePath, claudeDir3) {
103590
103621
  if (entries.length === 0) {
103591
103622
  rmdirSync(currentDir);
103592
103623
  logger.debug(`Removed empty directory: ${currentDir}`);
103593
- currentDir = resolve43(dirname38(currentDir));
103624
+ currentDir = resolve44(dirname38(currentDir));
103594
103625
  } else {
103595
103626
  break;
103596
103627
  }
@@ -103600,8 +103631,8 @@ function cleanupEmptyDirectories(filePath, claudeDir3) {
103600
103631
  }
103601
103632
  }
103602
103633
  function deletePath(fullPath, claudeDir3) {
103603
- const normalizedPath = resolve43(fullPath);
103604
- const normalizedClaudeDir = resolve43(claudeDir3);
103634
+ const normalizedPath = resolve44(fullPath);
103635
+ const normalizedClaudeDir = resolve44(claudeDir3);
103605
103636
  if (!normalizedPath.startsWith(`${normalizedClaudeDir}${sep12}`) && normalizedPath !== normalizedClaudeDir) {
103606
103637
  throw new Error(`Path traversal detected: ${fullPath}`);
103607
103638
  }
@@ -103674,8 +103705,8 @@ async function handleDeletions(sourceMetadata, claudeDir3, kitType) {
103674
103705
  const result = { deletedPaths: [], preservedPaths: [], errors: [] };
103675
103706
  for (const path16 of deletions) {
103676
103707
  const fullPath = join110(claudeDir3, path16);
103677
- const normalizedPath = resolve43(fullPath);
103678
- const normalizedClaudeDir = resolve43(claudeDir3);
103708
+ const normalizedPath = resolve44(fullPath);
103709
+ const normalizedClaudeDir = resolve44(claudeDir3);
103679
103710
  if (!normalizedPath.startsWith(`${normalizedClaudeDir}${sep12}`)) {
103680
103711
  logger.warning(`Skipping invalid path: ${path16}`);
103681
103712
  result.errors.push(path16);
@@ -103686,7 +103717,7 @@ async function handleDeletions(sourceMetadata, claudeDir3, kitType) {
103686
103717
  logger.verbose(`Preserved user file: ${path16}`);
103687
103718
  continue;
103688
103719
  }
103689
- if (existsSync66(fullPath)) {
103720
+ if (existsSync67(fullPath)) {
103690
103721
  try {
103691
103722
  deletePath(fullPath, claudeDir3);
103692
103723
  result.deletedPaths.push(path16);
@@ -105463,7 +105494,7 @@ import { dirname as dirname41, join as join114 } from "node:path";
105463
105494
 
105464
105495
  // src/domains/config/installed-settings-tracker.ts
105465
105496
  init_shared();
105466
- import { existsSync as existsSync67 } from "node:fs";
105497
+ import { existsSync as existsSync68 } from "node:fs";
105467
105498
  import { mkdir as mkdir31, readFile as readFile52, writeFile as writeFile27 } from "node:fs/promises";
105468
105499
  import { dirname as dirname40, join as join113 } from "node:path";
105469
105500
  var CK_JSON_FILE = ".ck.json";
@@ -105485,7 +105516,7 @@ class InstalledSettingsTracker {
105485
105516
  }
105486
105517
  async loadInstalledSettings() {
105487
105518
  const ckJsonPath = this.getCkJsonPath();
105488
- if (!existsSync67(ckJsonPath)) {
105519
+ if (!existsSync68(ckJsonPath)) {
105489
105520
  return { hooks: [], mcpServers: [] };
105490
105521
  }
105491
105522
  try {
@@ -105505,7 +105536,7 @@ class InstalledSettingsTracker {
105505
105536
  const ckJsonPath = this.getCkJsonPath();
105506
105537
  try {
105507
105538
  let data = {};
105508
- if (existsSync67(ckJsonPath)) {
105539
+ if (existsSync68(ckJsonPath)) {
105509
105540
  const content = await readFile52(ckJsonPath, "utf-8");
105510
105541
  data = parseJsonContent(content);
105511
105542
  }
@@ -107319,7 +107350,7 @@ function buildConflictSummary(fileConflicts, hookConflicts, mcpConflicts) {
107319
107350
  init_logger();
107320
107351
  init_skip_directories();
107321
107352
  var import_fs_extra20 = __toESM(require_lib(), 1);
107322
- import { join as join120, relative as relative27, resolve as resolve44 } from "node:path";
107353
+ import { join as join120, relative as relative27, resolve as resolve45 } from "node:path";
107323
107354
 
107324
107355
  class FileScanner2 {
107325
107356
  static async getFiles(dirPath, relativeTo) {
@@ -107399,8 +107430,8 @@ class FileScanner2 {
107399
107430
  return customFiles;
107400
107431
  }
107401
107432
  static isSafePath(basePath, targetPath) {
107402
- const resolvedBase = resolve44(basePath);
107403
- const resolvedTarget = resolve44(targetPath);
107433
+ const resolvedBase = resolve45(basePath);
107434
+ const resolvedTarget = resolve45(targetPath);
107404
107435
  return resolvedTarget.startsWith(resolvedBase);
107405
107436
  }
107406
107437
  static toPosixPath(path17) {
@@ -108730,13 +108761,13 @@ init_logger();
108730
108761
  init_types3();
108731
108762
  var import_fs_extra29 = __toESM(require_lib(), 1);
108732
108763
  import { copyFile as copyFile7, mkdir as mkdir34, readdir as readdir37, rm as rm14, stat as stat21 } from "node:fs/promises";
108733
- import { basename as basename27, join as join129, normalize as normalize9 } from "node:path";
108764
+ import { basename as basename27, join as join129, normalize as normalize10 } from "node:path";
108734
108765
  function validatePath2(path17, paramName) {
108735
108766
  if (!path17 || typeof path17 !== "string") {
108736
108767
  throw new SkillsMigrationError(`${paramName} must be a non-empty string`);
108737
108768
  }
108738
108769
  if (path17.includes("..")) {
108739
- const normalized = normalize9(path17);
108770
+ const normalized = normalize10(path17);
108740
108771
  if (normalized.startsWith("..")) {
108741
108772
  throw new SkillsMigrationError(`${paramName} contains invalid path traversal: ${path17}`);
108742
108773
  }
@@ -108907,12 +108938,12 @@ async function getAllFiles(dirPath) {
108907
108938
  return files;
108908
108939
  }
108909
108940
  async function hashFile(filePath) {
108910
- return new Promise((resolve45, reject) => {
108941
+ return new Promise((resolve46, reject) => {
108911
108942
  const hash = createHash9("sha256");
108912
108943
  const stream = createReadStream2(filePath);
108913
108944
  stream.on("data", (chunk) => hash.update(chunk));
108914
108945
  stream.on("end", () => {
108915
- resolve45(hash.digest("hex"));
108946
+ resolve46(hash.digest("hex"));
108916
108947
  });
108917
108948
  stream.on("error", (error) => {
108918
108949
  stream.destroy();
@@ -109020,13 +109051,13 @@ async function detectFileChanges(currentSkillPath, baselineSkillPath) {
109020
109051
  init_types3();
109021
109052
  var import_fs_extra31 = __toESM(require_lib(), 1);
109022
109053
  import { readdir as readdir39 } from "node:fs/promises";
109023
- import { join as join131, normalize as normalize10 } from "node:path";
109054
+ import { join as join131, normalize as normalize11 } from "node:path";
109024
109055
  function validatePath3(path17, paramName) {
109025
109056
  if (!path17 || typeof path17 !== "string") {
109026
109057
  throw new SkillsMigrationError(`${paramName} must be a non-empty string`);
109027
109058
  }
109028
109059
  if (path17.includes("..")) {
109029
- const normalized = normalize10(path17);
109060
+ const normalized = normalize11(path17);
109030
109061
  if (normalized.startsWith("..")) {
109031
109062
  throw new SkillsMigrationError(`${paramName} contains invalid path traversal: ${path17}`);
109032
109063
  }
@@ -109561,7 +109592,7 @@ async function handlePostInstall(ctx) {
109561
109592
  }
109562
109593
  // src/commands/init/phases/plugin-install-handler.ts
109563
109594
  init_codex_plugin_installer();
109564
- import { cpSync as cpSync2, existsSync as existsSync70, mkdirSync as mkdirSync6, readFileSync as readFileSync24, rmSync as rmSync5, writeFileSync as writeFileSync8 } from "node:fs";
109595
+ import { cpSync as cpSync2, existsSync as existsSync71, mkdirSync as mkdirSync6, readFileSync as readFileSync24, rmSync as rmSync5, writeFileSync as writeFileSync8 } from "node:fs";
109565
109596
  import { join as join139 } from "node:path";
109566
109597
 
109567
109598
  // src/domains/installation/plugin/migrate-legacy-to-plugin.ts
@@ -109569,14 +109600,14 @@ init_install_mode_detector();
109569
109600
  import { createHash as createHash10 } from "node:crypto";
109570
109601
  import {
109571
109602
  cpSync,
109572
- existsSync as existsSync68,
109603
+ existsSync as existsSync69,
109573
109604
  mkdirSync as mkdirSync5,
109574
109605
  readFileSync as readFileSync23,
109575
109606
  readdirSync as readdirSync11,
109576
109607
  rmSync as rmSync3,
109577
109608
  writeFileSync as writeFileSync7
109578
109609
  } from "node:fs";
109579
- import { dirname as dirname43, join as join137, relative as relative31, resolve as resolve45 } from "node:path";
109610
+ import { dirname as dirname43, join as join137, relative as relative31, resolve as resolve46 } from "node:path";
109580
109611
 
109581
109612
  // src/domains/installation/plugin/plugin-installer.ts
109582
109613
  init_install_mode_detector();
@@ -109743,7 +109774,7 @@ function defaultLegacyRemover(claudeDir3, backupDir) {
109743
109774
  const legacyPath = resolveSafePluginSuppliedLegacyPath2(claudeDir3, file.path);
109744
109775
  if (!legacyPath)
109745
109776
  continue;
109746
- if (!existsSync68(legacyPath.absolutePath))
109777
+ if (!existsSync69(legacyPath.absolutePath))
109747
109778
  continue;
109748
109779
  if (!isSafeToRemovePluginSuppliedLegacyFile(file, legacyPath.absolutePath))
109749
109780
  continue;
@@ -109775,7 +109806,7 @@ function removeOrphanLegacySentinels(claudeDir3, backupDir, removedTrackedPaths)
109775
109806
  const removed = [];
109776
109807
  for (const root of [...rootsToSweep].sort(compareLegacyPaths)) {
109777
109808
  const rootAbs = join137(claudeDir3, root);
109778
- if (!existsSync68(rootAbs))
109809
+ if (!existsSync69(rootAbs))
109779
109810
  continue;
109780
109811
  const sentinels = findLegacySentinels(rootAbs).sort((a3, b3) => compareLegacyPaths(relative31(claudeDir3, a3), relative31(claudeDir3, b3)));
109781
109812
  for (const sentinelAbs of sentinels) {
@@ -109864,7 +109895,7 @@ function resolveSafePluginSuppliedLegacyPath2(claudeDir3, pathValue) {
109864
109895
  const safe = resolveSafeChildPath2(claudeDir3, normalized);
109865
109896
  if (!safe)
109866
109897
  return null;
109867
- const relativePath = normalizeLegacyPath2(relative31(resolve45(claudeDir3), safe));
109898
+ const relativePath = normalizeLegacyPath2(relative31(resolve46(claudeDir3), safe));
109868
109899
  if (!isPluginSuppliedLegacyPath2(relativePath))
109869
109900
  return null;
109870
109901
  return { absolutePath: safe, relativePath };
@@ -109873,8 +109904,8 @@ function resolveSafeChildPath2(baseDir, pathValue) {
109873
109904
  const normalized = normalizeLegacyPath2(pathValue);
109874
109905
  if (!normalized || hasPathTraversal2(normalized) || isAbsoluteLike3(normalized))
109875
109906
  return null;
109876
- const resolvedBase = resolve45(baseDir);
109877
- const resolvedTarget = resolve45(resolvedBase, normalized);
109907
+ const resolvedBase = resolve46(baseDir);
109908
+ const resolvedTarget = resolve46(resolvedBase, normalized);
109878
109909
  const relativePath = normalizeLegacyPath2(relative31(resolvedBase, resolvedTarget));
109879
109910
  if (!relativePath || relativePath === ".." || relativePath.startsWith("../"))
109880
109911
  return null;
@@ -109983,7 +110014,7 @@ function isRecord5(value) {
109983
110014
 
109984
110015
  // src/domains/installation/plugin/uninstall-plugin.ts
109985
110016
  init_install_mode_detector();
109986
- import { existsSync as existsSync69, rmSync as rmSync4 } from "node:fs";
110017
+ import { existsSync as existsSync70, rmSync as rmSync4 } from "node:fs";
109987
110018
  import { join as join138 } from "node:path";
109988
110019
  init_path_resolver();
109989
110020
  async function uninstallEnginePlugin(opts = {}) {
@@ -110007,7 +110038,7 @@ async function uninstallEnginePlugin(opts = {}) {
110007
110038
  let staleCacheRemoved = false;
110008
110039
  const marketplace = state.marketplace ?? CK_MARKETPLACE_NAME;
110009
110040
  const cacheDir = join138(claudeDir3, "plugins", "cache", marketplace, CK_PLUGIN_NAME);
110010
- if (existsSync69(cacheDir)) {
110041
+ if (existsSync70(cacheDir)) {
110011
110042
  rmSync4(cacheDir, { recursive: true, force: true });
110012
110043
  staleCacheRemoved = true;
110013
110044
  }
@@ -110106,7 +110137,7 @@ function logLegacyPluginCleanup(result) {
110106
110137
  function stagePluginSource(extractDir, stageBaseDir) {
110107
110138
  const base2 = stageBaseDir ?? join139(PathResolver.getCacheDir(true), "ck-plugin-source");
110108
110139
  const payloadSrc = join139(extractDir, ".claude");
110109
- if (!existsSync70(payloadSrc)) {
110140
+ if (!existsSync71(payloadSrc)) {
110110
110141
  throw new Error(`plugin payload not found in archive: ${payloadSrc}`);
110111
110142
  }
110112
110143
  rmSync5(base2, { recursive: true, force: true });
@@ -110141,7 +110172,7 @@ function stagePluginSource(extractDir, stageBaseDir) {
110141
110172
  }
110142
110173
  function ensureCodexPluginManifest(pluginRoot) {
110143
110174
  const manifestPath = join139(pluginRoot, ".codex-plugin", "plugin.json");
110144
- if (existsSync70(manifestPath))
110175
+ if (existsSync71(manifestPath))
110145
110176
  return;
110146
110177
  const claudeManifest = readJsonSafe4(join139(pluginRoot, ".claude-plugin", "plugin.json"));
110147
110178
  const manifest = pruneUndefined({
@@ -110236,7 +110267,7 @@ function logCodexPluginCleanup(result) {
110236
110267
  init_config_manager();
110237
110268
  init_github_client();
110238
110269
  import { mkdir as mkdir36 } from "node:fs/promises";
110239
- import { join as join142, resolve as resolve48 } from "node:path";
110270
+ import { join as join142, resolve as resolve49 } from "node:path";
110240
110271
 
110241
110272
  // src/domains/github/kit-access-checker.ts
110242
110273
  init_error2();
@@ -110408,8 +110439,8 @@ init_hook_health_checker();
110408
110439
 
110409
110440
  // src/domains/installation/fresh-installer.ts
110410
110441
  init_metadata_migration();
110411
- import { existsSync as existsSync71, readdirSync as readdirSync12, rmSync as rmSync6, rmdirSync as rmdirSync2, unlinkSync as unlinkSync5 } from "node:fs";
110412
- import { basename as basename28, dirname as dirname44, join as join140, resolve as resolve46 } from "node:path";
110442
+ import { existsSync as existsSync72, readdirSync as readdirSync12, rmSync as rmSync6, rmdirSync as rmdirSync2, unlinkSync as unlinkSync5 } from "node:fs";
110443
+ import { basename as basename28, dirname as dirname44, join as join140, resolve as resolve47 } from "node:path";
110413
110444
  init_logger();
110414
110445
  init_safe_spinner();
110415
110446
  var import_fs_extra35 = __toESM(require_lib(), 1);
@@ -110461,15 +110492,15 @@ async function analyzeFreshInstallation(claudeDir3) {
110461
110492
  };
110462
110493
  }
110463
110494
  function cleanupEmptyDirectories2(filePath, claudeDir3) {
110464
- const normalizedClaudeDir = resolve46(claudeDir3);
110465
- let currentDir = resolve46(dirname44(filePath));
110495
+ const normalizedClaudeDir = resolve47(claudeDir3);
110496
+ let currentDir = resolve47(dirname44(filePath));
110466
110497
  while (currentDir !== normalizedClaudeDir && currentDir.startsWith(normalizedClaudeDir)) {
110467
110498
  try {
110468
110499
  const entries = readdirSync12(currentDir);
110469
110500
  if (entries.length === 0) {
110470
110501
  rmdirSync2(currentDir);
110471
110502
  logger.debug(`Removed empty directory: ${currentDir}`);
110472
- currentDir = resolve46(dirname44(currentDir));
110503
+ currentDir = resolve47(dirname44(currentDir));
110473
110504
  } else {
110474
110505
  break;
110475
110506
  }
@@ -110492,7 +110523,7 @@ async function removeFilesByOwnership(claudeDir3, analysis, includeModified) {
110492
110523
  }
110493
110524
  for (const file of filesToRemove) {
110494
110525
  const fullPath = join140(claudeDir3, file.path);
110495
- if (!existsSync71(fullPath)) {
110526
+ if (!existsSync72(fullPath)) {
110496
110527
  continue;
110497
110528
  }
110498
110529
  try {
@@ -110550,8 +110581,8 @@ function getFreshBackupTargets(claudeDir3, analysis, includeModified) {
110550
110581
  mutatePaths: filesToRemove.length > 0 ? ["metadata.json"] : []
110551
110582
  };
110552
110583
  }
110553
- const deletePaths = CLAUDEKIT_SUBDIRECTORIES.filter((subdir) => existsSync71(join140(claudeDir3, subdir)));
110554
- if (existsSync71(join140(claudeDir3, "metadata.json"))) {
110584
+ const deletePaths = CLAUDEKIT_SUBDIRECTORIES.filter((subdir) => existsSync72(join140(claudeDir3, subdir)));
110585
+ if (existsSync72(join140(claudeDir3, "metadata.json"))) {
110555
110586
  deletePaths.push("metadata.json");
110556
110587
  }
110557
110588
  return {
@@ -110659,7 +110690,7 @@ async function handleFreshInstallation(claudeDir3, prompts) {
110659
110690
  var import_fs_extra36 = __toESM(require_lib(), 1);
110660
110691
  import { cp as cp5, mkdir as mkdir35, readdir as readdir42, rename as rename11, rm as rm16, stat as stat22 } from "node:fs/promises";
110661
110692
  import { homedir as homedir47 } from "node:os";
110662
- import { dirname as dirname45, join as join141, normalize as normalize11, resolve as resolve47 } from "node:path";
110693
+ import { dirname as dirname45, join as join141, normalize as normalize12, resolve as resolve48 } from "node:path";
110663
110694
  var LEGACY_KIT_MARKERS = [
110664
110695
  "metadata.json",
110665
110696
  ".ck.json",
@@ -110685,7 +110716,7 @@ function uniqueNormalizedPaths(paths) {
110685
110716
  const seen = new Set;
110686
110717
  const result = [];
110687
110718
  for (const path17 of paths) {
110688
- const normalized = normalize11(resolve47(path17));
110719
+ const normalized = normalize12(resolve48(path17));
110689
110720
  if (seen.has(normalized))
110690
110721
  continue;
110691
110722
  seen.add(normalized);
@@ -110750,8 +110781,8 @@ async function repairLegacyWindowsGlobalKitDir(options2) {
110750
110781
  if (safeEnvPath(env2.CLAUDE_CONFIG_DIR)) {
110751
110782
  return { status: "skipped", reason: "custom-global-dir", candidateDirs: [] };
110752
110783
  }
110753
- const targetDir = normalize11(resolve47(options2.targetDir));
110754
- const candidateDirs = getLegacyWindowsGlobalKitDirCandidates(env2, options2.homeDir).filter((candidate) => normalize11(resolve47(candidate)) !== targetDir);
110784
+ const targetDir = normalize12(resolve48(options2.targetDir));
110785
+ const candidateDirs = getLegacyWindowsGlobalKitDirCandidates(env2, options2.homeDir).filter((candidate) => normalize12(resolve48(candidate)) !== targetDir);
110755
110786
  const legacyDirs = [];
110756
110787
  for (const candidate of candidateDirs) {
110757
110788
  if (await hasKitMarkers(candidate)) {
@@ -110974,7 +111005,7 @@ async function handleSelection(ctx) {
110974
111005
  }
110975
111006
  }
110976
111007
  }
110977
- const resolvedDir = resolve48(targetDir);
111008
+ const resolvedDir = resolve49(targetDir);
110978
111009
  if (ctx.options.global) {
110979
111010
  try {
110980
111011
  const repairResult = await repairLegacyWindowsGlobalKitDir({ targetDir: resolvedDir });
@@ -111176,7 +111207,7 @@ async function handleSelection(ctx) {
111176
111207
  }
111177
111208
  // src/commands/init/phases/sync-handler.ts
111178
111209
  import { copyFile as copyFile8, mkdir as mkdir37, open as open5, readFile as readFile61, rename as rename12, stat as stat23, unlink as unlink13, writeFile as writeFile35 } from "node:fs/promises";
111179
- import { dirname as dirname46, join as join143, resolve as resolve49 } from "node:path";
111210
+ import { dirname as dirname46, join as join143, resolve as resolve50 } from "node:path";
111180
111211
  init_logger();
111181
111212
  init_path_resolver();
111182
111213
  var import_fs_extra38 = __toESM(require_lib(), 1);
@@ -111185,7 +111216,7 @@ async function handleSync(ctx) {
111185
111216
  if (!ctx.options.sync) {
111186
111217
  return ctx;
111187
111218
  }
111188
- const resolvedDir = ctx.options.global ? PathResolver.getGlobalKitDir() : resolve49(ctx.options.dir || ".");
111219
+ const resolvedDir = ctx.options.global ? PathResolver.getGlobalKitDir() : resolve50(ctx.options.dir || ".");
111189
111220
  const claudeDir3 = ctx.options.global ? resolvedDir : join143(resolvedDir, ".claude");
111190
111221
  if (!await import_fs_extra38.pathExists(claudeDir3)) {
111191
111222
  logger.error("Cannot sync: no .claude directory found");
@@ -111319,7 +111350,7 @@ async function acquireSyncLock(global3) {
111319
111350
  }
111320
111351
  logger.debug(`Lock stat failed: ${statError}`);
111321
111352
  }
111322
- await new Promise((resolve50) => setTimeout(resolve50, 100));
111353
+ await new Promise((resolve51) => setTimeout(resolve51, 100));
111323
111354
  continue;
111324
111355
  }
111325
111356
  throw err;
@@ -112308,10 +112339,10 @@ async function initCommand(options2) {
112308
112339
  // src/commands/migrate/migrate-command.ts
112309
112340
  init_dist2();
112310
112341
  var import_picocolors30 = __toESM(require_picocolors(), 1);
112311
- import { existsSync as existsSync72 } from "node:fs";
112342
+ import { existsSync as existsSync73 } from "node:fs";
112312
112343
  import { readFile as readFile67, rm as rm18, unlink as unlink14 } from "node:fs/promises";
112313
112344
  import { homedir as homedir52 } from "node:os";
112314
- import { basename as basename30, dirname as dirname49, join as join151, resolve as resolve50 } from "node:path";
112345
+ import { basename as basename30, dirname as dirname49, join as join151, resolve as resolve51 } from "node:path";
112315
112346
  init_logger();
112316
112347
 
112317
112348
  // src/ui/ck-cli-design/next-steps-footer.ts
@@ -113764,9 +113795,9 @@ function shouldExecuteAction2(action) {
113764
113795
  }
113765
113796
  async function executeDeleteAction(action, options2) {
113766
113797
  const preservePaths = options2?.preservePaths ?? new Set;
113767
- const shouldPreserveTarget = action.targetPath.length > 0 && preservePaths.has(resolve50(action.targetPath));
113798
+ const shouldPreserveTarget = action.targetPath.length > 0 && preservePaths.has(resolve51(action.targetPath));
113768
113799
  try {
113769
- if (!shouldPreserveTarget && action.targetPath && existsSync72(action.targetPath)) {
113800
+ if (!shouldPreserveTarget && action.targetPath && existsSync73(action.targetPath)) {
113770
113801
  await rm18(action.targetPath, { recursive: true, force: true });
113771
113802
  }
113772
113803
  await removePortableInstallation(action.item, action.type, action.provider, action.global, action.targetPath ? { path: action.targetPath } : undefined);
@@ -113795,7 +113826,7 @@ async function executeDeleteAction(action, options2) {
113795
113826
  }
113796
113827
  }
113797
113828
  function hasSuccessfulReplacementWrite(action, results) {
113798
- return results.some((result) => result.success && !result.skipped && result.provider === action.provider && replacementTypeMatches(action.type, result.portableType) && replacementItemMatches(action, result) && result.path.length > 0 && resolve50(result.path) !== resolve50(action.targetPath));
113829
+ return results.some((result) => result.success && !result.skipped && result.provider === action.provider && replacementTypeMatches(action.type, result.portableType) && replacementItemMatches(action, result) && result.path.length > 0 && resolve51(result.path) !== resolve51(action.targetPath));
113799
113830
  }
113800
113831
  function replacementTypeMatches(actionType, resultType) {
113801
113832
  return resultType === actionType || actionType === "command" && resultType === "skill";
@@ -113838,8 +113869,8 @@ function resolveHookTargetPath(item, provider, global3) {
113838
113869
  if (converted.error)
113839
113870
  return null;
113840
113871
  const targetPath = pathConfig.writeStrategy === "single-file" ? basePath : join151(basePath, converted.filename);
113841
- const resolvedTarget = resolve50(targetPath).replace(/\\/g, "/");
113842
- const resolvedBase = resolve50(basePath).replace(/\\/g, "/").replace(/\/+$/, "");
113872
+ const resolvedTarget = resolve51(targetPath).replace(/\\/g, "/");
113873
+ const resolvedBase = resolve51(basePath).replace(/\\/g, "/").replace(/\/+$/, "");
113843
113874
  if (resolvedTarget !== resolvedBase && !resolvedTarget.startsWith(`${resolvedBase}/`)) {
113844
113875
  return null;
113845
113876
  }
@@ -113848,8 +113879,8 @@ function resolveHookTargetPath(item, provider, global3) {
113848
113879
  async function processMetadataDeletions(skillSourcePath, installGlobally) {
113849
113880
  if (!skillSourcePath)
113850
113881
  return;
113851
- const sourceMetadataPath = join151(resolve50(skillSourcePath, ".."), "metadata.json");
113852
- if (!existsSync72(sourceMetadataPath))
113882
+ const sourceMetadataPath = join151(resolve51(skillSourcePath, ".."), "metadata.json");
113883
+ if (!existsSync73(sourceMetadataPath))
113853
113884
  return;
113854
113885
  let sourceMetadata;
113855
113886
  try {
@@ -113862,7 +113893,7 @@ async function processMetadataDeletions(skillSourcePath, installGlobally) {
113862
113893
  if (!sourceMetadata.deletions || sourceMetadata.deletions.length === 0)
113863
113894
  return;
113864
113895
  const claudeDir3 = installGlobally ? join151(homedir52(), ".claude") : join151(process.cwd(), ".claude");
113865
- if (!existsSync72(claudeDir3))
113896
+ if (!existsSync73(claudeDir3))
113866
113897
  return;
113867
113898
  try {
113868
113899
  const result = await handleDeletions(sourceMetadata, claudeDir3, inferKitTypeFromSourceMetadata(sourceMetadata));
@@ -114154,7 +114185,7 @@ async function migrateCommand(options2) {
114154
114185
  const interactive = process.stdout.isTTY && !options2.yes;
114155
114186
  const conflictActions = plan.actions.filter((a3) => a3.action === "conflict");
114156
114187
  for (const action of conflictActions) {
114157
- if (!action.diff && action.targetPath && existsSync72(action.targetPath)) {
114188
+ if (!action.diff && action.targetPath && existsSync73(action.targetPath)) {
114158
114189
  try {
114159
114190
  const targetContent = await readFile67(action.targetPath, "utf-8");
114160
114191
  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);
@@ -114253,9 +114284,9 @@ async function migrateCommand(options2) {
114253
114284
  const progressSink = createMigrateProgressSink(writeTasks.length + plannedDeleteActions.length);
114254
114285
  const writtenPaths = new Set;
114255
114286
  const recordHookTargetForSettings = (provider, global3, targetPath) => {
114256
- if (targetPath.length === 0 || !existsSync72(targetPath))
114287
+ if (targetPath.length === 0 || !existsSync73(targetPath))
114257
114288
  return;
114258
- const resolvedPath = resolve50(targetPath);
114289
+ const resolvedPath = resolve51(targetPath);
114259
114290
  const entry = successfulHookFiles.get(provider) ?? {
114260
114291
  files: [],
114261
114292
  global: global3
@@ -114273,7 +114304,7 @@ async function migrateCommand(options2) {
114273
114304
  const recordSuccessfulWrites = (task, taskResults) => {
114274
114305
  for (const result of taskResults.filter((entry) => entry.success)) {
114275
114306
  if (!result.skipped && result.path.length > 0) {
114276
- writtenPaths.add(resolve50(result.path));
114307
+ writtenPaths.add(resolve51(result.path));
114277
114308
  }
114278
114309
  if (task.type === "hooks") {
114279
114310
  recordHookTargetForSettings(task.provider, task.global, result.path);
@@ -114437,7 +114468,7 @@ async function migrateCommand(options2) {
114437
114468
  }
114438
114469
  }
114439
114470
  try {
114440
- const kitRoot = (agentSource ? resolve50(agentSource, "..") : null) ?? (commandSource ? resolve50(commandSource, "..") : null) ?? (skillSource ? resolve50(skillSource, "..") : null) ?? null;
114471
+ const kitRoot = (agentSource ? resolve51(agentSource, "..") : null) ?? (commandSource ? resolve51(commandSource, "..") : null) ?? (skillSource ? resolve51(skillSource, "..") : null) ?? null;
114441
114472
  const manifest = kitRoot ? await loadPortableManifest(kitRoot) : null;
114442
114473
  if (manifest?.cliVersion) {
114443
114474
  await updateAppliedManifestVersion(manifest.cliVersion);
@@ -114485,7 +114516,7 @@ async function migrateCommand(options2) {
114485
114516
  async function rollbackResults(results) {
114486
114517
  const rolledBackPaths = new Set;
114487
114518
  for (const result of results) {
114488
- if (!result.path || !existsSync72(result.path))
114519
+ if (!result.path || !existsSync73(result.path))
114489
114520
  continue;
114490
114521
  try {
114491
114522
  if (result.overwritten)
@@ -114608,7 +114639,7 @@ var import_picocolors31 = __toESM(require_picocolors(), 1);
114608
114639
 
114609
114640
  // src/commands/new/phases/directory-setup.ts
114610
114641
  init_config_manager();
114611
- import { resolve as resolve51 } from "node:path";
114642
+ import { resolve as resolve52 } from "node:path";
114612
114643
  init_logger();
114613
114644
  init_path_resolver();
114614
114645
  init_types3();
@@ -114693,7 +114724,7 @@ async function directorySetup(validOptions, prompts) {
114693
114724
  targetDir = await prompts.getDirectory(targetDir);
114694
114725
  }
114695
114726
  }
114696
- const resolvedDir = resolve51(targetDir);
114727
+ const resolvedDir = resolve52(targetDir);
114697
114728
  logger.info(`Target directory: ${resolvedDir}`);
114698
114729
  if (PathResolver.isLocalSameAsGlobal(resolvedDir)) {
114699
114730
  logger.warning("You're creating a project at HOME directory.");
@@ -115026,8 +115057,8 @@ Please use only one download method.`);
115026
115057
  }
115027
115058
  // src/commands/plan/plan-command.ts
115028
115059
  init_output_manager();
115029
- import { existsSync as existsSync75, statSync as statSync13 } from "node:fs";
115030
- import { dirname as dirname53, isAbsolute as isAbsolute15, join as join156, parse as parse7, resolve as resolve55 } from "node:path";
115060
+ import { existsSync as existsSync76, statSync as statSync13 } from "node:fs";
115061
+ import { dirname as dirname53, isAbsolute as isAbsolute15, join as join156, parse as parse7, resolve as resolve56 } from "node:path";
115031
115062
 
115032
115063
  // src/commands/plan/plan-read-handlers.ts
115033
115064
  init_config();
@@ -115036,14 +115067,14 @@ init_plans_registry();
115036
115067
  init_logger();
115037
115068
  init_output_manager();
115038
115069
  var import_picocolors32 = __toESM(require_picocolors(), 1);
115039
- import { existsSync as existsSync74, statSync as statSync12 } from "node:fs";
115040
- import { basename as basename31, dirname as dirname51, join as join155, relative as relative34, resolve as resolve53 } from "node:path";
115070
+ import { existsSync as existsSync75, statSync as statSync12 } from "node:fs";
115071
+ import { basename as basename31, dirname as dirname51, join as join155, relative as relative34, resolve as resolve54 } from "node:path";
115041
115072
 
115042
115073
  // src/commands/plan/plan-dependencies.ts
115043
115074
  init_config();
115044
115075
  init_plan_parser();
115045
115076
  init_plans_registry();
115046
- import { existsSync as existsSync73 } from "node:fs";
115077
+ import { existsSync as existsSync74 } from "node:fs";
115047
115078
  import { dirname as dirname50, join as join154 } from "node:path";
115048
115079
  async function resolvePlanDependencies(references, currentPlanFile, options2 = {}) {
115049
115080
  if (references.length === 0)
@@ -115066,7 +115097,7 @@ async function resolvePlanDependencies(references, currentPlanFile, options2 = {
115066
115097
  const scopeRoot = resolvePlanDirForScope(scope, projectRoot, config);
115067
115098
  const planFile = join154(scopeRoot, planId, "plan.md");
115068
115099
  const isSelfReference = planFile === currentPlanFile;
115069
- if (!existsSync73(planFile)) {
115100
+ if (!existsSync74(planFile)) {
115070
115101
  return {
115071
115102
  reference,
115072
115103
  scope,
@@ -115095,14 +115126,14 @@ init_config();
115095
115126
  init_plan_parser();
115096
115127
  init_plan_scope();
115097
115128
  init_plans_registry();
115098
- import { isAbsolute as isAbsolute14, resolve as resolve52 } from "node:path";
115129
+ import { isAbsolute as isAbsolute14, resolve as resolve53 } from "node:path";
115099
115130
  async function getGlobalPlansDirFromCwd() {
115100
115131
  const projectRoot = findProjectRoot(process.cwd());
115101
115132
  const { config } = await CkConfigManager.loadFull(projectRoot);
115102
115133
  return resolveGlobalPlansDir(config);
115103
115134
  }
115104
115135
  function resolveTargetFromBase(target, baseDir) {
115105
- const resolvedTarget = isAbsolute14(target) ? resolve52(target) : resolve52(baseDir, target);
115136
+ const resolvedTarget = isAbsolute14(target) ? resolve53(target) : resolve53(baseDir, target);
115106
115137
  return isWithinDir(resolvedTarget, baseDir) ? resolvedTarget : null;
115107
115138
  }
115108
115139
 
@@ -115205,8 +115236,8 @@ async function handleStatus(target, options2) {
115205
115236
  return;
115206
115237
  }
115207
115238
  const effectiveTarget = !resolvedTarget && globalBaseDir ? globalBaseDir : resolvedTarget;
115208
- const t = effectiveTarget ? resolve53(effectiveTarget) : null;
115209
- const plansDir = t && existsSync74(t) && statSync12(t).isDirectory() && !existsSync74(join155(t, "plan.md")) ? t : null;
115239
+ const t = effectiveTarget ? resolve54(effectiveTarget) : null;
115240
+ const plansDir = t && existsSync75(t) && statSync12(t).isDirectory() && !existsSync75(join155(t, "plan.md")) ? t : null;
115210
115241
  if (plansDir) {
115211
115242
  const planFiles = scanPlanDir(plansDir);
115212
115243
  if (planFiles.length === 0) {
@@ -115390,7 +115421,7 @@ init_plan_parser();
115390
115421
  init_plans_registry();
115391
115422
  init_output_manager();
115392
115423
  var import_picocolors33 = __toESM(require_picocolors(), 1);
115393
- import { basename as basename32, dirname as dirname52, relative as relative35, resolve as resolve54 } from "node:path";
115424
+ import { basename as basename32, dirname as dirname52, relative as relative35, resolve as resolve55 } from "node:path";
115394
115425
  function quoteReadTarget(filePath) {
115395
115426
  return `"${filePath.replace(/\\/g, "/").replace(/"/g, "\\\"")}"`;
115396
115427
  }
@@ -115433,13 +115464,13 @@ async function handleCreate(target, options2) {
115433
115464
  return;
115434
115465
  }
115435
115466
  const globalBaseDir = options2.global ? await getGlobalPlansDirFromCwd() : undefined;
115436
- const resolvedDir = globalBaseDir ? resolveTargetFromBase(dir, globalBaseDir) : resolve54(dir);
115467
+ const resolvedDir = globalBaseDir ? resolveTargetFromBase(dir, globalBaseDir) : resolve55(dir);
115437
115468
  if (globalBaseDir && !resolvedDir) {
115438
115469
  output.error("[X] Target directory must stay within the configured global plans root");
115439
115470
  process.exitCode = 1;
115440
115471
  return;
115441
115472
  }
115442
- const safeResolvedDir = resolvedDir ?? resolve54(dir);
115473
+ const safeResolvedDir = resolvedDir ?? resolve55(dir);
115443
115474
  const result = scaffoldPlan({
115444
115475
  title: options2.title,
115445
115476
  phases: phaseNames.map((name2) => ({ name: name2 })),
@@ -115618,25 +115649,25 @@ async function handleAddPhase(target, options2) {
115618
115649
  // src/commands/plan/plan-command.ts
115619
115650
  function resolveTargetPath(target, baseDir) {
115620
115651
  if (!baseDir) {
115621
- return resolve55(target);
115652
+ return resolve56(target);
115622
115653
  }
115623
115654
  if (isAbsolute15(target)) {
115624
- return resolve55(target);
115655
+ return resolve56(target);
115625
115656
  }
115626
- const cwdCandidate = resolve55(target);
115627
- if (existsSync75(cwdCandidate)) {
115657
+ const cwdCandidate = resolve56(target);
115658
+ if (existsSync76(cwdCandidate)) {
115628
115659
  return cwdCandidate;
115629
115660
  }
115630
- return resolve55(baseDir, target);
115661
+ return resolve56(baseDir, target);
115631
115662
  }
115632
115663
  function resolvePlanFile(target, baseDir) {
115633
- const t = target ? resolveTargetPath(target, baseDir) : baseDir ? resolve55(baseDir) : process.cwd();
115634
- if (existsSync75(t)) {
115664
+ const t = target ? resolveTargetPath(target, baseDir) : baseDir ? resolve56(baseDir) : process.cwd();
115665
+ if (existsSync76(t)) {
115635
115666
  const stat24 = statSync13(t);
115636
115667
  if (stat24.isFile())
115637
115668
  return t;
115638
115669
  const candidate = join156(t, "plan.md");
115639
- if (existsSync75(candidate))
115670
+ if (existsSync76(candidate))
115640
115671
  return candidate;
115641
115672
  }
115642
115673
  if (!target && !baseDir) {
@@ -115644,7 +115675,7 @@ function resolvePlanFile(target, baseDir) {
115644
115675
  const root = parse7(dir).root;
115645
115676
  while (dir !== root) {
115646
115677
  const candidate = join156(dir, "plan.md");
115647
- if (existsSync75(candidate))
115678
+ if (existsSync76(candidate))
115648
115679
  return candidate;
115649
115680
  dir = dirname53(dir);
115650
115681
  }
@@ -115694,7 +115725,7 @@ async function planCommand(action, target, options2) {
115694
115725
  let resolvedTarget = target;
115695
115726
  if (resolvedAction && !knownActions.has(resolvedAction)) {
115696
115727
  const looksLikePath = resolvedAction.includes("/") || resolvedAction.includes("\\") || resolvedAction.endsWith(".md") || resolvedAction === "." || resolvedAction === "..";
115697
- const existsOnDisk = !looksLikePath && existsSync75(resolve55(resolvedAction));
115728
+ const existsOnDisk = !looksLikePath && existsSync76(resolve56(resolvedAction));
115698
115729
  if (looksLikePath || existsOnDisk) {
115699
115730
  resolvedTarget = resolvedAction;
115700
115731
  resolvedAction = undefined;
@@ -115736,13 +115767,13 @@ init_claudekit_data2();
115736
115767
  init_logger();
115737
115768
  init_safe_prompts();
115738
115769
  var import_picocolors34 = __toESM(require_picocolors(), 1);
115739
- import { existsSync as existsSync76 } from "node:fs";
115740
- import { resolve as resolve56 } from "node:path";
115770
+ import { existsSync as existsSync77 } from "node:fs";
115771
+ import { resolve as resolve57 } from "node:path";
115741
115772
  async function handleAdd(projectPath, options2) {
115742
115773
  logger.debug(`Adding project: ${projectPath}, options: ${JSON.stringify(options2)}`);
115743
115774
  intro("Add Project");
115744
- const absolutePath = resolve56(projectPath);
115745
- if (!existsSync76(absolutePath)) {
115775
+ const absolutePath = resolve57(projectPath);
115776
+ if (!existsSync77(absolutePath)) {
115746
115777
  log.error(`Path does not exist: ${absolutePath}`);
115747
115778
  process.exitCode = 1;
115748
115779
  return;
@@ -116167,7 +116198,7 @@ import { readFile as readFile68 } from "node:fs/promises";
116167
116198
  import { join as join158 } from "node:path";
116168
116199
 
116169
116200
  // src/commands/skills/installed-skills-inventory.ts
116170
- import { join as join157, resolve as resolve57 } from "node:path";
116201
+ import { join as join157, resolve as resolve58 } from "node:path";
116171
116202
  init_path_resolver();
116172
116203
  var SCOPE_SORT_ORDER = {
116173
116204
  project: 0,
@@ -116175,8 +116206,8 @@ var SCOPE_SORT_ORDER = {
116175
116206
  };
116176
116207
  async function getActiveClaudeSkillInstallations(options2 = {}) {
116177
116208
  const projectDir = options2.projectDir ?? process.cwd();
116178
- const globalDir = resolve57(options2.globalDir ?? PathResolver.getGlobalKitDir());
116179
- const projectClaudeDir = resolve57(projectDir, ".claude");
116209
+ const globalDir = resolve58(options2.globalDir ?? PathResolver.getGlobalKitDir());
116210
+ const projectClaudeDir = resolve58(projectDir, ".claude");
116180
116211
  const projectScopeAliasesGlobal = projectClaudeDir === globalDir;
116181
116212
  const [projectSkills, globalSkills] = await Promise.all([
116182
116213
  projectScopeAliasesGlobal ? Promise.resolve([]) : scanSkills2(join157(projectClaudeDir, "skills")),
@@ -116924,7 +116955,7 @@ async function detectInstallations() {
116924
116955
 
116925
116956
  // src/commands/uninstall/removal-handler.ts
116926
116957
  import { readdirSync as readdirSync14, rmSync as rmSync8 } from "node:fs";
116927
- import { basename as basename33, join as join161, resolve as resolve58, sep as sep14 } from "node:path";
116958
+ import { basename as basename33, join as join161, resolve as resolve59, sep as sep14 } from "node:path";
116928
116959
  init_logger();
116929
116960
  init_safe_prompts();
116930
116961
  init_safe_spinner();
@@ -117288,8 +117319,8 @@ async function restoreUninstallBackup(backup) {
117288
117319
  }
117289
117320
  async function isPathSafeToRemove(filePath, baseDir) {
117290
117321
  try {
117291
- const resolvedPath = resolve58(filePath);
117292
- const resolvedBase = resolve58(baseDir);
117322
+ const resolvedPath = resolve59(filePath);
117323
+ const resolvedBase = resolve59(baseDir);
117293
117324
  if (!resolvedPath.startsWith(resolvedBase + sep14) && resolvedPath !== resolvedBase) {
117294
117325
  logger.debug(`Path outside installation directory: ${filePath}`);
117295
117326
  return false;
@@ -117297,7 +117328,7 @@ async function isPathSafeToRemove(filePath, baseDir) {
117297
117328
  const stats = await import_fs_extra44.lstat(filePath);
117298
117329
  if (stats.isSymbolicLink()) {
117299
117330
  const realPath = await import_fs_extra44.realpath(filePath);
117300
- const resolvedReal = resolve58(realPath);
117331
+ const resolvedReal = resolve59(realPath);
117301
117332
  if (!resolvedReal.startsWith(resolvedBase + sep14) && resolvedReal !== resolvedBase) {
117302
117333
  logger.debug(`Symlink points outside installation directory: ${filePath} -> ${realPath}`);
117303
117334
  return false;
@@ -117790,7 +117821,7 @@ ${import_picocolors40.default.bold(import_picocolors40.default.cyan(result.kitCo
117790
117821
 
117791
117822
  // src/commands/watch/watch-command.ts
117792
117823
  init_logger();
117793
- import { existsSync as existsSync82 } from "node:fs";
117824
+ import { existsSync as existsSync83 } from "node:fs";
117794
117825
  import { rm as rm19 } from "node:fs/promises";
117795
117826
  import { join as join168 } from "node:path";
117796
117827
  var import_picocolors41 = __toESM(require_picocolors(), 1);
@@ -117861,7 +117892,7 @@ function getDisclaimerMarker() {
117861
117892
  return AI_DISCLAIMER;
117862
117893
  }
117863
117894
  function spawnAndCollect2(command, args) {
117864
- return new Promise((resolve59, reject) => {
117895
+ return new Promise((resolve60, reject) => {
117865
117896
  const child = spawn6(command, args, { stdio: ["ignore", "pipe", "pipe"] });
117866
117897
  const chunks = [];
117867
117898
  const stderrChunks = [];
@@ -117874,7 +117905,7 @@ function spawnAndCollect2(command, args) {
117874
117905
  reject(new Error(`${command} exited with code ${code2}: ${stderr}`));
117875
117906
  return;
117876
117907
  }
117877
- resolve59(Buffer.concat(chunks).toString("utf-8"));
117908
+ resolve60(Buffer.concat(chunks).toString("utf-8"));
117878
117909
  });
117879
117910
  });
117880
117911
  }
@@ -117982,7 +118013,7 @@ function formatResponse(content, showBranding) {
117982
118013
  return disclaimer + formatted + branding;
117983
118014
  }
117984
118015
  async function postViaGh(owner, repo, issueNumber, body) {
117985
- return new Promise((resolve59, reject) => {
118016
+ return new Promise((resolve60, reject) => {
117986
118017
  const args = [
117987
118018
  "issue",
117988
118019
  "comment",
@@ -118004,7 +118035,7 @@ async function postViaGh(owner, repo, issueNumber, body) {
118004
118035
  reject(new Error(`gh exited with code ${code2}: ${stderr}`));
118005
118036
  return;
118006
118037
  }
118007
- resolve59();
118038
+ resolve60();
118008
118039
  });
118009
118040
  });
118010
118041
  }
@@ -118122,7 +118153,7 @@ After completing the implementation:
118122
118153
  "--allowedTools",
118123
118154
  tools
118124
118155
  ];
118125
- await new Promise((resolve59, reject) => {
118156
+ await new Promise((resolve60, reject) => {
118126
118157
  const child = spawn8("claude", args, { cwd: cwd2, stdio: ["pipe", "pipe", "pipe"], detached: false });
118127
118158
  child.stdin.write(prompt);
118128
118159
  child.stdin.end();
@@ -118147,7 +118178,7 @@ After completing the implementation:
118147
118178
  reject(new Error(`Claude exited ${code2}: ${stderr.slice(0, 500)}`));
118148
118179
  return;
118149
118180
  }
118150
- resolve59();
118181
+ resolve60();
118151
118182
  });
118152
118183
  });
118153
118184
  }
@@ -118291,7 +118322,7 @@ function checkRateLimit2(processedThisHour, maxPerHour) {
118291
118322
  return processedThisHour < maxPerHour;
118292
118323
  }
118293
118324
  function spawnAndCollect3(command, args) {
118294
- return new Promise((resolve59, reject) => {
118325
+ return new Promise((resolve60, reject) => {
118295
118326
  const child = spawn9(command, args, { stdio: ["ignore", "pipe", "pipe"] });
118296
118327
  const chunks = [];
118297
118328
  const stderrChunks = [];
@@ -118304,7 +118335,7 @@ function spawnAndCollect3(command, args) {
118304
118335
  reject(new Error(`${command} exited with code ${code2}: ${stderr}`));
118305
118336
  return;
118306
118337
  }
118307
- resolve59(Buffer.concat(chunks).toString("utf-8"));
118338
+ resolve60(Buffer.concat(chunks).toString("utf-8"));
118308
118339
  });
118309
118340
  });
118310
118341
  }
@@ -118356,7 +118387,7 @@ async function invokeClaude(options2) {
118356
118387
  return collectClaudeOutput(child, options2.timeoutSec, verbose);
118357
118388
  }
118358
118389
  function collectClaudeOutput(child, timeoutSec, verbose = false) {
118359
- return new Promise((resolve59, reject) => {
118390
+ return new Promise((resolve60, reject) => {
118360
118391
  const chunks = [];
118361
118392
  const stderrChunks = [];
118362
118393
  child.stdout?.on("data", (chunk) => {
@@ -118386,7 +118417,7 @@ function collectClaudeOutput(child, timeoutSec, verbose = false) {
118386
118417
  reject(new Error(`Claude exited with code ${code2}: ${stderr}`));
118387
118418
  return;
118388
118419
  }
118389
- resolve59(verbose ? parseStreamJsonOutput(stdout2) : parseClaudeOutput(stdout2));
118420
+ resolve60(verbose ? parseStreamJsonOutput(stdout2) : parseClaudeOutput(stdout2));
118390
118421
  });
118391
118422
  });
118392
118423
  }
@@ -119089,14 +119120,14 @@ function cleanExpiredIssues(state, ttlDays) {
119089
119120
  init_ck_config_manager();
119090
119121
  init_file_io();
119091
119122
  init_logger();
119092
- import { existsSync as existsSync78 } from "node:fs";
119123
+ import { existsSync as existsSync79 } from "node:fs";
119093
119124
  import { mkdir as mkdir41, readFile as readFile71 } from "node:fs/promises";
119094
119125
  import { dirname as dirname55 } from "node:path";
119095
119126
  var PROCESSED_ISSUES_CAP = 500;
119096
119127
  async function readCkJson(projectDir) {
119097
119128
  const configPath = CkConfigManager.getProjectConfigPath(projectDir);
119098
119129
  try {
119099
- if (!existsSync78(configPath))
119130
+ if (!existsSync79(configPath))
119100
119131
  return {};
119101
119132
  const content = await readFile71(configPath, "utf-8");
119102
119133
  return JSON.parse(content);
@@ -119122,7 +119153,7 @@ async function loadWatchState(projectDir) {
119122
119153
  async function saveWatchState(projectDir, state) {
119123
119154
  const configPath = CkConfigManager.getProjectConfigPath(projectDir);
119124
119155
  const configDir = dirname55(configPath);
119125
- if (!existsSync78(configDir)) {
119156
+ if (!existsSync79(configDir)) {
119126
119157
  await mkdir41(configDir, { recursive: true });
119127
119158
  }
119128
119159
  const raw2 = await readCkJson(projectDir);
@@ -119249,7 +119280,7 @@ async function processImplementationQueue(state, config, setup, options2, watchL
119249
119280
  // src/commands/watch/phases/repo-scanner.ts
119250
119281
  init_logger();
119251
119282
  import { spawnSync as spawnSync7 } from "node:child_process";
119252
- import { existsSync as existsSync79 } from "node:fs";
119283
+ import { existsSync as existsSync80 } from "node:fs";
119253
119284
  import { readdir as readdir47, stat as stat25 } from "node:fs/promises";
119254
119285
  import { join as join165 } from "node:path";
119255
119286
  async function scanForRepos(parentDir) {
@@ -119263,7 +119294,7 @@ async function scanForRepos(parentDir) {
119263
119294
  if (!entryStat.isDirectory())
119264
119295
  continue;
119265
119296
  const gitDir = join165(fullPath, ".git");
119266
- if (!existsSync79(gitDir))
119297
+ if (!existsSync80(gitDir))
119267
119298
  continue;
119268
119299
  const result = spawnSync7("gh", ["repo", "view", "--json", "owner,name"], {
119269
119300
  encoding: "utf-8",
@@ -119287,7 +119318,7 @@ async function scanForRepos(parentDir) {
119287
119318
  // src/commands/watch/phases/setup-validator.ts
119288
119319
  init_logger();
119289
119320
  import { spawnSync as spawnSync8 } from "node:child_process";
119290
- import { existsSync as existsSync80 } from "node:fs";
119321
+ import { existsSync as existsSync81 } from "node:fs";
119291
119322
  import { homedir as homedir53 } from "node:os";
119292
119323
  import { join as join166 } from "node:path";
119293
119324
  async function validateSetup(cwd2) {
@@ -119321,7 +119352,7 @@ Run this command from a directory with a GitHub remote.`);
119321
119352
  throw new Error(`Failed to parse repository info: ${ghRepo.stdout}`);
119322
119353
  }
119323
119354
  const skillsPath = join166(homedir53(), ".claude", "skills");
119324
- const skillsAvailable = existsSync80(skillsPath);
119355
+ const skillsAvailable = existsSync81(skillsPath);
119325
119356
  if (!skillsAvailable) {
119326
119357
  logger.warning(`ClaudeKit Engineer skills not found at ${skillsPath}`);
119327
119358
  }
@@ -119337,7 +119368,7 @@ Run this command from a directory with a GitHub remote.`);
119337
119368
  init_logger();
119338
119369
  init_path_resolver();
119339
119370
  import { createWriteStream as createWriteStream3, statSync as statSync14 } from "node:fs";
119340
- import { existsSync as existsSync81 } from "node:fs";
119371
+ import { existsSync as existsSync82 } from "node:fs";
119341
119372
  import { mkdir as mkdir42, rename as rename15 } from "node:fs/promises";
119342
119373
  import { join as join167 } from "node:path";
119343
119374
 
@@ -119352,7 +119383,7 @@ class WatchLogger {
119352
119383
  }
119353
119384
  async init() {
119354
119385
  try {
119355
- if (!existsSync81(this.logDir)) {
119386
+ if (!existsSync82(this.logDir)) {
119356
119387
  await mkdir42(this.logDir, { recursive: true });
119357
119388
  }
119358
119389
  const dateStr = formatDate(new Date);
@@ -119538,7 +119569,7 @@ async function watchCommand(options2) {
119538
119569
  }
119539
119570
  async function discoverRepos(options2, watchLog) {
119540
119571
  const cwd2 = process.cwd();
119541
- const isGitRepo = existsSync82(join168(cwd2, ".git"));
119572
+ const isGitRepo = existsSync83(join168(cwd2, ".git"));
119542
119573
  if (options2.force) {
119543
119574
  await forceRemoveLock(watchLog);
119544
119575
  }
@@ -119650,7 +119681,7 @@ function formatQueueInfo(state) {
119650
119681
  return "idle";
119651
119682
  }
119652
119683
  function sleep(ms) {
119653
- return new Promise((resolve59) => setTimeout(resolve59, ms));
119684
+ return new Promise((resolve60) => setTimeout(resolve60, ms));
119654
119685
  }
119655
119686
  // src/cli/command-registry.ts
119656
119687
  init_logger();
@@ -119795,7 +119826,7 @@ function registerCommands(cli) {
119795
119826
  // src/cli/version-display.ts
119796
119827
  init_package();
119797
119828
  init_config_version_checker();
119798
- import { existsSync as existsSync94, readFileSync as readFileSync29 } from "node:fs";
119829
+ import { existsSync as existsSync95, readFileSync as readFileSync29 } from "node:fs";
119799
119830
  import { join as join180 } from "node:path";
119800
119831
 
119801
119832
  // src/domains/versioning/version-checker.ts
@@ -119809,7 +119840,7 @@ init_types3();
119809
119840
  // src/domains/versioning/version-cache.ts
119810
119841
  init_logger();
119811
119842
  init_path_resolver();
119812
- import { existsSync as existsSync93 } from "node:fs";
119843
+ import { existsSync as existsSync94 } from "node:fs";
119813
119844
  import { mkdir as mkdir43, readFile as readFile73, writeFile as writeFile45 } from "node:fs/promises";
119814
119845
  import { join as join179 } from "node:path";
119815
119846
 
@@ -119823,7 +119854,7 @@ class VersionCacheManager {
119823
119854
  static async load() {
119824
119855
  const cacheFile = VersionCacheManager.getCacheFile();
119825
119856
  try {
119826
- if (!existsSync93(cacheFile)) {
119857
+ if (!existsSync94(cacheFile)) {
119827
119858
  logger.debug("Version check cache not found");
119828
119859
  return null;
119829
119860
  }
@@ -119844,7 +119875,7 @@ class VersionCacheManager {
119844
119875
  const cacheFile = VersionCacheManager.getCacheFile();
119845
119876
  const cacheDir = PathResolver.getCacheDir(false);
119846
119877
  try {
119847
- if (!existsSync93(cacheDir)) {
119878
+ if (!existsSync94(cacheDir)) {
119848
119879
  await mkdir43(cacheDir, { recursive: true, mode: 448 });
119849
119880
  }
119850
119881
  await writeFile45(cacheFile, JSON.stringify(cache5, null, 2), "utf-8");
@@ -119866,7 +119897,7 @@ class VersionCacheManager {
119866
119897
  static async clear() {
119867
119898
  const cacheFile = VersionCacheManager.getCacheFile();
119868
119899
  try {
119869
- if (existsSync93(cacheFile)) {
119900
+ if (existsSync94(cacheFile)) {
119870
119901
  const fs20 = await import("node:fs/promises");
119871
119902
  await fs20.unlink(cacheFile);
119872
119903
  logger.debug("Version check cache cleared");
@@ -120133,7 +120164,7 @@ async function displayVersion() {
120133
120164
  const prefix = PathResolver.getPathPrefix(false);
120134
120165
  const localMetadataPath = prefix ? join180(process.cwd(), prefix, "metadata.json") : join180(process.cwd(), "metadata.json");
120135
120166
  const isLocalSameAsGlobal = localMetadataPath === globalMetadataPath;
120136
- if (!isLocalSameAsGlobal && existsSync94(localMetadataPath)) {
120167
+ if (!isLocalSameAsGlobal && existsSync95(localMetadataPath)) {
120137
120168
  try {
120138
120169
  const rawMetadata = JSON.parse(readFileSync29(localMetadataPath, "utf-8"));
120139
120170
  const metadata = MetadataSchema.parse(rawMetadata);
@@ -120147,7 +120178,7 @@ async function displayVersion() {
120147
120178
  logger.verbose("Failed to parse local metadata.json", { error });
120148
120179
  }
120149
120180
  }
120150
- if (existsSync94(globalMetadataPath)) {
120181
+ if (existsSync95(globalMetadataPath)) {
120151
120182
  try {
120152
120183
  const rawMetadata = JSON.parse(readFileSync29(globalMetadataPath, "utf-8"));
120153
120184
  const metadata = MetadataSchema.parse(rawMetadata);