claudekit-cli 3.32.3-dev.1 → 3.33.0-dev.1

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.
Files changed (2) hide show
  1. package/dist/index.js +51 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -23196,7 +23196,7 @@ function getPagerArgs(pagerCmd) {
23196
23196
  return [];
23197
23197
  }
23198
23198
  async function trySystemPager(content) {
23199
- return new Promise((resolve13) => {
23199
+ return new Promise((resolve14) => {
23200
23200
  const pagerCmd = process.env.PAGER || "less";
23201
23201
  const pagerArgs = getPagerArgs(pagerCmd);
23202
23202
  try {
@@ -23206,20 +23206,20 @@ async function trySystemPager(content) {
23206
23206
  });
23207
23207
  const timeout = setTimeout(() => {
23208
23208
  pager.kill();
23209
- resolve13(false);
23209
+ resolve14(false);
23210
23210
  }, 30000);
23211
23211
  pager.stdin.write(content);
23212
23212
  pager.stdin.end();
23213
23213
  pager.on("close", (code2) => {
23214
23214
  clearTimeout(timeout);
23215
- resolve13(code2 === 0);
23215
+ resolve14(code2 === 0);
23216
23216
  });
23217
23217
  pager.on("error", () => {
23218
23218
  clearTimeout(timeout);
23219
- resolve13(false);
23219
+ resolve14(false);
23220
23220
  });
23221
23221
  } catch {
23222
- resolve13(false);
23222
+ resolve14(false);
23223
23223
  }
23224
23224
  });
23225
23225
  }
@@ -23246,16 +23246,16 @@ async function basicPager(content) {
23246
23246
  break;
23247
23247
  }
23248
23248
  const remaining = lines.length - currentLine;
23249
- await new Promise((resolve13) => {
23249
+ await new Promise((resolve14) => {
23250
23250
  rl.question(`-- More (${remaining} lines) [Enter/q] --`, (answer) => {
23251
23251
  if (answer.toLowerCase() === "q") {
23252
23252
  rl.close();
23253
23253
  process.exitCode = 0;
23254
- resolve13();
23254
+ resolve14();
23255
23255
  return;
23256
23256
  }
23257
23257
  process.stdout.write("\x1B[1A\x1B[2K");
23258
- resolve13();
23258
+ resolve14();
23259
23259
  });
23260
23260
  });
23261
23261
  }
@@ -48637,7 +48637,7 @@ async function findSkillByName(name2, sourcePath) {
48637
48637
  // src/commands/skills/skills-installer.ts
48638
48638
  import { existsSync as existsSync24 } from "node:fs";
48639
48639
  import { cp as cp2, mkdir as mkdir23, stat as stat12 } from "node:fs/promises";
48640
- import { dirname as dirname14 } from "node:path";
48640
+ import { dirname as dirname14, resolve as resolve12 } from "node:path";
48641
48641
 
48642
48642
  // src/commands/skills/skills-registry.ts
48643
48643
  init_zod();
@@ -48750,6 +48750,13 @@ async function syncRegistry() {
48750
48750
  }
48751
48751
 
48752
48752
  // src/commands/skills/skills-installer.ts
48753
+ function isSamePath(path1, path22) {
48754
+ try {
48755
+ return resolve12(path1) === resolve12(path22);
48756
+ } catch {
48757
+ return false;
48758
+ }
48759
+ }
48753
48760
  function getErrorMessage(error, targetPath) {
48754
48761
  if (error instanceof Error && "code" in error) {
48755
48762
  const code2 = error.code;
@@ -48773,6 +48780,16 @@ async function installSkillForAgent(skill, agent, options2) {
48773
48780
  const agentConfig = agents[agent];
48774
48781
  const targetPath = getInstallPath(skill.name, agent, options2);
48775
48782
  const alreadyExists = isSkillInstalled(skill.name, agent, options2);
48783
+ if (isSamePath(skill.path, targetPath)) {
48784
+ return {
48785
+ agent,
48786
+ agentDisplayName: agentConfig.displayName,
48787
+ success: true,
48788
+ path: targetPath,
48789
+ skipped: true,
48790
+ skipReason: "Skill already exists at source location"
48791
+ };
48792
+ }
48776
48793
  try {
48777
48794
  const parentDir = dirname14(targetPath);
48778
48795
  if (!existsSync24(parentDir)) {
@@ -49318,19 +49335,22 @@ async function skillsCommand(options2) {
49318
49335
  spinner.start(`Installing ${ctx.selectedSkills.length} skill(s)...`);
49319
49336
  let totalSuccessful = 0;
49320
49337
  let totalFailed = 0;
49338
+ let totalSkipped = 0;
49321
49339
  const allResults = [];
49322
49340
  for (const skill of ctx.selectedSkills) {
49323
49341
  const results = await installSkillToAgents(skill, ctx.selectedAgents, {
49324
49342
  global: ctx.installGlobally
49325
49343
  });
49326
49344
  allResults.push({ skill: skill.name, results });
49327
- totalSuccessful += results.filter((r2) => r2.success).length;
49345
+ totalSuccessful += results.filter((r2) => r2.success && !r2.skipped).length;
49328
49346
  totalFailed += results.filter((r2) => !r2.success).length;
49347
+ totalSkipped += results.filter((r2) => r2.skipped).length;
49329
49348
  }
49330
49349
  spinner.stop("Installation complete");
49331
49350
  console.log();
49332
49351
  for (const { skill, results } of allResults) {
49333
- const successful = results.filter((r2) => r2.success);
49352
+ const successful = results.filter((r2) => r2.success && !r2.skipped);
49353
+ const skipped = results.filter((r2) => r2.skipped);
49334
49354
  const failed = results.filter((r2) => !r2.success);
49335
49355
  if (successful.length > 0) {
49336
49356
  f2.success(`${import_picocolors21.default.cyan(skill)} → ${successful.length} agent(s)`);
@@ -49338,6 +49358,12 @@ async function skillsCommand(options2) {
49338
49358
  f2.message(` ${import_picocolors21.default.green("✓")} ${r2.agentDisplayName}`);
49339
49359
  }
49340
49360
  }
49361
+ if (skipped.length > 0) {
49362
+ f2.info(`${import_picocolors21.default.cyan(skill)} → ${skipped.length} skipped`);
49363
+ for (const r2 of skipped) {
49364
+ f2.message(` ${import_picocolors21.default.yellow("○")} ${r2.agentDisplayName}: ${import_picocolors21.default.dim(r2.skipReason || "Already at source location")}`);
49365
+ }
49366
+ }
49341
49367
  if (failed.length > 0) {
49342
49368
  f2.error(`${import_picocolors21.default.cyan(skill)} failed: ${failed.length} agent(s)`);
49343
49369
  for (const r2 of failed) {
@@ -49346,13 +49372,20 @@ async function skillsCommand(options2) {
49346
49372
  }
49347
49373
  }
49348
49374
  console.log();
49349
- if (totalSuccessful === 0 && totalFailed === 0) {
49375
+ if (totalSuccessful === 0 && totalFailed === 0 && totalSkipped === 0) {
49350
49376
  $e(import_picocolors21.default.yellow("No installations performed"));
49351
49377
  } else if (totalFailed > 0 && totalSuccessful === 0) {
49352
49378
  $e(import_picocolors21.default.red("Installation failed"));
49353
49379
  process.exit(1);
49354
49380
  } else {
49355
- $e(import_picocolors21.default.green(`Done! ${totalSuccessful} installed, ${totalFailed} failed`));
49381
+ const parts = [];
49382
+ if (totalSuccessful > 0)
49383
+ parts.push(`${totalSuccessful} installed`);
49384
+ if (totalSkipped > 0)
49385
+ parts.push(`${totalSkipped} skipped`);
49386
+ if (totalFailed > 0)
49387
+ parts.push(`${totalFailed} failed`);
49388
+ $e(import_picocolors21.default.green(`Done! ${parts.join(", ")}`));
49356
49389
  }
49357
49390
  } catch (error) {
49358
49391
  logger.error(error instanceof Error ? error.message : "Unknown error");
@@ -49407,7 +49440,7 @@ async function detectInstallations() {
49407
49440
 
49408
49441
  // src/commands/uninstall/removal-handler.ts
49409
49442
  import { readdirSync as readdirSync4, rmSync as rmSync5 } from "node:fs";
49410
- import { join as join81, resolve as resolve12, sep as sep3 } from "node:path";
49443
+ import { join as join81, resolve as resolve13, sep as sep3 } from "node:path";
49411
49444
  init_logger();
49412
49445
  var import_fs_extra36 = __toESM(require_lib(), 1);
49413
49446
 
@@ -49544,8 +49577,8 @@ async function isDirectory(filePath) {
49544
49577
  }
49545
49578
  async function isPathSafeToRemove(filePath, baseDir) {
49546
49579
  try {
49547
- const resolvedPath = resolve12(filePath);
49548
- const resolvedBase = resolve12(baseDir);
49580
+ const resolvedPath = resolve13(filePath);
49581
+ const resolvedBase = resolve13(baseDir);
49549
49582
  if (!resolvedPath.startsWith(resolvedBase + sep3) && resolvedPath !== resolvedBase) {
49550
49583
  logger.debug(`Path outside installation directory: ${filePath}`);
49551
49584
  return false;
@@ -49553,7 +49586,7 @@ async function isPathSafeToRemove(filePath, baseDir) {
49553
49586
  const stats = await import_fs_extra36.lstat(filePath);
49554
49587
  if (stats.isSymbolicLink()) {
49555
49588
  const realPath = await import_fs_extra36.realpath(filePath);
49556
- const resolvedReal = resolve12(realPath);
49589
+ const resolvedReal = resolve13(realPath);
49557
49590
  if (!resolvedReal.startsWith(resolvedBase + sep3) && resolvedReal !== resolvedBase) {
49558
49591
  logger.debug(`Symlink points outside installation directory: ${filePath} -> ${realPath}`);
49559
49592
  return false;
@@ -49938,7 +49971,7 @@ var import_fs_extra37 = __toESM(require_lib(), 1);
49938
49971
  // package.json
49939
49972
  var package_default = {
49940
49973
  name: "claudekit-cli",
49941
- version: "3.32.3-dev.1",
49974
+ version: "3.33.0-dev.1",
49942
49975
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
49943
49976
  type: "module",
49944
49977
  repository: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudekit-cli",
3
- "version": "3.32.3-dev.1",
3
+ "version": "3.33.0-dev.1",
4
4
  "description": "CLI tool for bootstrapping and updating ClaudeKit projects",
5
5
  "type": "module",
6
6
  "repository": {