prpm 1.1.8 → 1.1.10

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
@@ -70,8 +70,22 @@ function createLockfile() {
70
70
  generated: (/* @__PURE__ */ new Date()).toISOString()
71
71
  };
72
72
  }
73
+ function getLockfileKey(packageId, format) {
74
+ if (!format) {
75
+ return packageId;
76
+ }
77
+ return `${packageId}#${format}`;
78
+ }
79
+ function parseLockfileKey(key) {
80
+ const parts = key.split("#");
81
+ return {
82
+ packageId: parts[0],
83
+ format: parts[1]
84
+ };
85
+ }
73
86
  function addToLockfile(lockfile, packageId, packageInfo) {
74
- lockfile.packages[packageId] = {
87
+ const lockfileKey = getLockfileKey(packageId, packageInfo.format);
88
+ lockfile.packages[lockfileKey] = {
75
89
  version: packageInfo.version,
76
90
  resolved: packageInfo.tarballUrl,
77
91
  integrity: "",
@@ -88,18 +102,33 @@ function addToLockfile(lockfile, packageId, packageInfo) {
88
102
  };
89
103
  lockfile.generated = (/* @__PURE__ */ new Date()).toISOString();
90
104
  }
91
- function setPackageIntegrity(lockfile, packageId, tarballBuffer) {
92
- if (!lockfile.packages[packageId]) {
93
- throw new Error(`Package ${packageId} not found in lock file`);
105
+ function setPackageIntegrity(lockfile, packageId, tarballBuffer, format) {
106
+ const lockfileKey = getLockfileKey(packageId, format);
107
+ if (!lockfile.packages[lockfileKey]) {
108
+ throw new Error(`Package ${lockfileKey} not found in lock file`);
94
109
  }
95
110
  const hash = (0, import_crypto.createHash)("sha256").update(tarballBuffer).digest("hex");
96
- lockfile.packages[packageId].integrity = `sha256-${hash}`;
111
+ lockfile.packages[lockfileKey].integrity = `sha256-${hash}`;
97
112
  }
98
- function getLockedVersion(lockfile, packageId) {
99
- if (!lockfile || !lockfile.packages[packageId]) {
113
+ function getLockedVersion(lockfile, packageId, format) {
114
+ var _a;
115
+ if (!lockfile) {
100
116
  return null;
101
117
  }
102
- return lockfile.packages[packageId].version;
118
+ if (format) {
119
+ const lockfileKey = getLockfileKey(packageId, format);
120
+ return ((_a = lockfile.packages[lockfileKey]) == null ? void 0 : _a.version) || null;
121
+ }
122
+ if (lockfile.packages[packageId]) {
123
+ return lockfile.packages[packageId].version;
124
+ }
125
+ for (const key of Object.keys(lockfile.packages)) {
126
+ const parsed = parseLockfileKey(key);
127
+ if (parsed.packageId === packageId) {
128
+ return lockfile.packages[key].version;
129
+ }
130
+ }
131
+ return null;
103
132
  }
104
133
  async function addPackage(packageInfo) {
105
134
  const lockfile = await readLockfile() || createLockfile();
@@ -141,7 +170,6 @@ function addCollectionToLockfile(lockfile, collectionKey, collectionInfo) {
141
170
  lockfile.collections = {};
142
171
  }
143
172
  lockfile.collections[collectionKey] = {
144
- scope: collectionInfo.scope,
145
173
  name_slug: collectionInfo.name_slug,
146
174
  version: collectionInfo.version,
147
175
  installedAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -525,6 +553,14 @@ function getDestinationDir2(format, subtype, name) {
525
553
  return ".prompts";
526
554
  case "mcp":
527
555
  return ".mcp/tools";
556
+ case "trae":
557
+ return ".trae/rules";
558
+ case "aider":
559
+ return ".";
560
+ case "zencoder":
561
+ return ".zencoder/rules";
562
+ case "replit":
563
+ return ".";
528
564
  default:
529
565
  throw new Error(`Unknown format: ${format}`);
530
566
  }
@@ -583,6 +619,12 @@ async function autoDetectFormat() {
583
619
  if (await fileExists("AGENTS.md")) {
584
620
  return "agents.md";
585
621
  }
622
+ if (await fileExists("CONVENTIONS.md")) {
623
+ return "aider";
624
+ }
625
+ if (await fileExists("replit.md")) {
626
+ return "replit";
627
+ }
586
628
  const formatDirs = [
587
629
  { format: "cursor", dir: ".cursor" },
588
630
  { format: "claude", dir: ".claude" },
@@ -593,6 +635,8 @@ async function autoDetectFormat() {
593
635
  { format: "gemini", dir: ".gemini" },
594
636
  { format: "opencode", dir: ".opencode" },
595
637
  { format: "droid", dir: ".factory" },
638
+ { format: "trae", dir: ".trae" },
639
+ { format: "zencoder", dir: ".zencoder" },
596
640
  { format: "agents.md", dir: ".agents" }
597
641
  ];
598
642
  for (const { format, dir } of formatDirs) {
@@ -2424,7 +2468,7 @@ async function promptYesNo(question, nonInteractiveWarning) {
2424
2468
  }
2425
2469
  return false;
2426
2470
  }
2427
- const rl = readline2.createInterface({
2471
+ const rl = readline3.createInterface({
2428
2472
  input: process.stdin,
2429
2473
  output: process.stdout
2430
2474
  });
@@ -2435,12 +2479,12 @@ async function promptYesNo(question, nonInteractiveWarning) {
2435
2479
  rl.close();
2436
2480
  }
2437
2481
  }
2438
- var readline2;
2482
+ var readline3;
2439
2483
  var init_prompts = __esm({
2440
2484
  "src/core/prompts.ts"() {
2441
2485
  "use strict";
2442
2486
  init_cjs_shims();
2443
- readline2 = __toESM(require("readline/promises"));
2487
+ readline3 = __toESM(require("readline/promises"));
2444
2488
  }
2445
2489
  });
2446
2490
 
@@ -2557,7 +2601,6 @@ async function handleCollectionsList(options) {
2557
2601
  category: options.category,
2558
2602
  tag: options.tag,
2559
2603
  official: options.official,
2560
- scope: options.scope,
2561
2604
  limit: 500
2562
2605
  // Increased limit to show more collections
2563
2606
  });
@@ -2644,25 +2687,19 @@ async function handleCollectionsList(options) {
2644
2687
  async function handleCollectionInfo(collectionSpec) {
2645
2688
  const startTime = Date.now();
2646
2689
  try {
2647
- let scope;
2648
2690
  let name_slug;
2649
2691
  let version;
2650
- const matchWithScope = collectionSpec.match(/^@?([^/]+)\/([^/@]+)(?:@(.+))?$/);
2651
- if (matchWithScope) {
2652
- [, scope, name_slug, version] = matchWithScope;
2653
- } else {
2654
- const matchNoScope = collectionSpec.match(/^([^/@]+)(?:@(.+))?$/);
2655
- if (!matchNoScope) {
2656
- throw new Error("Invalid collection format. Use: name, @scope/name, or scope/name (optionally with @version)");
2657
- }
2658
- [, name_slug, version] = matchNoScope;
2659
- scope = "collection";
2692
+ const cleanSpec = collectionSpec.replace(/^collections\//, "");
2693
+ const match = cleanSpec.match(/^([^@]+)(?:@(.+))?$/);
2694
+ if (!match) {
2695
+ throw new Error("Invalid collection format. Use: name or name@version");
2660
2696
  }
2697
+ [, name_slug, version] = match;
2661
2698
  const config = await getConfig();
2662
2699
  const client = (0, import_registry_client4.getRegistryClient)(config);
2663
- console.log(`\u{1F4E6} Loading collection: ${scope === "collection" ? name_slug : `@${scope}/${name_slug}`}...
2700
+ console.log(`\u{1F4E6} Loading collection: ${name_slug}...
2664
2701
  `);
2665
- const collection = await client.getCollection(scope, name_slug, version);
2702
+ const collection = await client.getCollection(name_slug, version);
2666
2703
  console.log(`${collection.icon || "\u{1F4E6}"} ${collection.name}`);
2667
2704
  console.log(`${"=".repeat(collection.name.length + 2)}`);
2668
2705
  console.log("");
@@ -2716,16 +2753,9 @@ async function handleCollectionInfo(collectionSpec) {
2716
2753
  });
2717
2754
  }
2718
2755
  console.log("\u{1F4A1} Install:");
2719
- if (scope === "collection") {
2720
- console.log(` prpm install ${name_slug}`);
2721
- if (optionalPkgs.length > 0) {
2722
- console.log(` prpm install ${name_slug} --skip-optional # Skip optional packages`);
2723
- }
2724
- } else {
2725
- console.log(` prpm install @${scope}/${name_slug}`);
2726
- if (optionalPkgs.length > 0) {
2727
- console.log(` prpm install @${scope}/${name_slug} --skip-optional # Skip optional packages`);
2728
- }
2756
+ console.log(` prpm install ${name_slug}`);
2757
+ if (optionalPkgs.length > 0) {
2758
+ console.log(` prpm install ${name_slug} --skip-optional # Skip optional packages`);
2729
2759
  }
2730
2760
  console.log("");
2731
2761
  await telemetry.track({
@@ -2733,7 +2763,6 @@ async function handleCollectionInfo(collectionSpec) {
2733
2763
  success: true,
2734
2764
  duration: Date.now() - startTime,
2735
2765
  data: {
2736
- scope,
2737
2766
  name_slug,
2738
2767
  packageCount: collection.packages.length
2739
2768
  }
@@ -2810,12 +2839,11 @@ async function handleCollectionPublish(manifestPath = "./collection.json") {
2810
2839
  icon: manifest.icon
2811
2840
  });
2812
2841
  console.log(`\u2705 Collection published successfully!`);
2813
- console.log(` Scope: ${result.scope}`);
2814
2842
  console.log(` Name: ${result.name_slug}`);
2815
2843
  console.log(` Version: ${result.version || "1.0.0"}`);
2816
2844
  console.log("");
2817
- console.log(`\u{1F4A1} View: prpm collection info @${result.scope}/${result.name_slug}`);
2818
- console.log(`\u{1F4A1} Install: prpm install @${result.scope}/${result.name_slug}`);
2845
+ console.log(`\u{1F4A1} View: prpm collection info ${result.name_slug}`);
2846
+ console.log(`\u{1F4A1} Install: prpm install ${result.name_slug}`);
2819
2847
  console.log("");
2820
2848
  await telemetry.track({
2821
2849
  command: "collections:publish",
@@ -2848,26 +2876,19 @@ async function handleCollectionInstall(collectionSpec, options) {
2848
2876
  let packagesInstalled = 0;
2849
2877
  let packagesFailed = 0;
2850
2878
  try {
2851
- let scope;
2852
2879
  let name_slug;
2853
2880
  let version;
2854
- const matchWithScope = collectionSpec.match(/^@?([^/]+)\/([^/@]+)(?:@(.+))?$/);
2855
- if (matchWithScope) {
2856
- [, scope, name_slug, version] = matchWithScope;
2857
- } else {
2858
- const matchNoScope = collectionSpec.match(/^([^/@]+)(?:@(.+))?$/);
2859
- if (!matchNoScope) {
2860
- throw new Error("Invalid collection format. Use: name, @scope/name, or scope/name (optionally with @version)");
2861
- }
2862
- [, name_slug, version] = matchNoScope;
2863
- scope = "collection";
2881
+ const cleanSpec = collectionSpec.replace(/^collections\//, "");
2882
+ const match = cleanSpec.match(/^([^@]+)(?:@(.+))?$/);
2883
+ if (!match) {
2884
+ throw new Error("Invalid collection format. Use: name or name@version");
2864
2885
  }
2886
+ [, name_slug, version] = match;
2865
2887
  const config = await getConfig();
2866
2888
  const client = (0, import_registry_client4.getRegistryClient)(config);
2867
- console.log(`\u{1F4E6} Installing collection: ${scope === "collection" ? name_slug : `@${scope}/${name_slug}`}...
2889
+ console.log(`\u{1F4E6} Installing collection: ${name_slug}...
2868
2890
  `);
2869
2891
  const installResult = await client.installCollection({
2870
- scope,
2871
2892
  id: name_slug,
2872
2893
  version,
2873
2894
  format: options.format,
@@ -2897,7 +2918,6 @@ async function handleCollectionInstall(collectionSpec, options) {
2897
2918
  ${progress} Installing ${pkg.packageId}@${pkg.version}...`);
2898
2919
  const installOptions = {
2899
2920
  fromCollection: {
2900
- scope,
2901
2921
  name_slug,
2902
2922
  version: collection.version || version || "1.0.0"
2903
2923
  }
@@ -2922,9 +2942,8 @@ async function handleCollectionInstall(collectionSpec, options) {
2922
2942
  }
2923
2943
  }
2924
2944
  const lockfile = await readLockfile() || createLockfile();
2925
- const collectionKey = `@${scope}/${name_slug}`;
2945
+ const collectionKey = name_slug;
2926
2946
  addCollectionToLockfile(lockfile, collectionKey, {
2927
- scope,
2928
2947
  name_slug,
2929
2948
  version: collection.version || version || "1.0.0",
2930
2949
  packages: installedPackageIds
@@ -2948,7 +2967,6 @@ async function handleCollectionInstall(collectionSpec, options) {
2948
2967
  success: true,
2949
2968
  duration: Date.now() - startTime,
2950
2969
  data: {
2951
- scope,
2952
2970
  name_slug,
2953
2971
  packageCount: packages.length,
2954
2972
  installed: packagesInstalled,
@@ -9367,6 +9385,43 @@ var init_from_droid = __esm({
9367
9385
  }
9368
9386
  });
9369
9387
 
9388
+ // ../converters/dist/from-trae.js
9389
+ var init_from_trae = __esm({
9390
+ "../converters/dist/from-trae.js"() {
9391
+ "use strict";
9392
+ init_cjs_shims();
9393
+ init_taxonomy_utils();
9394
+ }
9395
+ });
9396
+
9397
+ // ../converters/dist/from-aider.js
9398
+ var init_from_aider = __esm({
9399
+ "../converters/dist/from-aider.js"() {
9400
+ "use strict";
9401
+ init_cjs_shims();
9402
+ init_taxonomy_utils();
9403
+ }
9404
+ });
9405
+
9406
+ // ../converters/dist/from-zencoder.js
9407
+ var init_from_zencoder = __esm({
9408
+ "../converters/dist/from-zencoder.js"() {
9409
+ "use strict";
9410
+ init_cjs_shims();
9411
+ init_js_yaml();
9412
+ init_taxonomy_utils();
9413
+ }
9414
+ });
9415
+
9416
+ // ../converters/dist/from-replit.js
9417
+ var init_from_replit = __esm({
9418
+ "../converters/dist/from-replit.js"() {
9419
+ "use strict";
9420
+ init_cjs_shims();
9421
+ init_taxonomy_utils();
9422
+ }
9423
+ });
9424
+
9370
9425
  // ../converters/dist/validation.js
9371
9426
  function loadSchema(format, subtype) {
9372
9427
  const cacheKey = subtype ? `${format}:${subtype}` : format;
@@ -9403,6 +9458,10 @@ function loadSchema(format, subtype) {
9403
9458
  "opencode": "opencode.schema.json",
9404
9459
  "ruler": "ruler.schema.json",
9405
9460
  "droid": "droid.schema.json",
9461
+ "trae": "trae.schema.json",
9462
+ "aider": "aider.schema.json",
9463
+ "zencoder": "zencoder.schema.json",
9464
+ "replit": "replit.schema.json",
9406
9465
  "canonical": "canonical.schema.json"
9407
9466
  };
9408
9467
  schemaFilename = schemaMap[format] || `${format}.schema.json`;
@@ -11298,6 +11357,81 @@ var init_to_droid = __esm({
11298
11357
  }
11299
11358
  });
11300
11359
 
11360
+ // ../converters/dist/to-trae.js
11361
+ var init_to_trae = __esm({
11362
+ "../converters/dist/to-trae.js"() {
11363
+ "use strict";
11364
+ init_cjs_shims();
11365
+ }
11366
+ });
11367
+
11368
+ // ../converters/dist/to-aider.js
11369
+ var init_to_aider = __esm({
11370
+ "../converters/dist/to-aider.js"() {
11371
+ "use strict";
11372
+ init_cjs_shims();
11373
+ }
11374
+ });
11375
+
11376
+ // ../converters/dist/to-zencoder.js
11377
+ var init_to_zencoder = __esm({
11378
+ "../converters/dist/to-zencoder.js"() {
11379
+ "use strict";
11380
+ init_cjs_shims();
11381
+ }
11382
+ });
11383
+
11384
+ // ../converters/dist/to-replit.js
11385
+ var init_to_replit = __esm({
11386
+ "../converters/dist/to-replit.js"() {
11387
+ "use strict";
11388
+ init_cjs_shims();
11389
+ }
11390
+ });
11391
+
11392
+ // ../converters/dist/schema-files.js
11393
+ var import_module, import_path9, schemaRequire, convertersPackagePath, convertersDir, loadSchema2, agentsMdSchema, canonicalSchema, claudeSchema, continueSchema, copilotSchema, cursorSchema, droidSchema, geminiMdSchema, geminiSchema, kiroSteeringSchema, opencodeSchema, rulerSchema, windsurfSchema, traeSchema, aiderSchema, zencoderSchema, replitSchema, claudeAgentSchema, claudeHookSchema, claudeSkillSchema, claudeSlashCommandSchema, cursorCommandSchema, droidHookSchema, droidSkillSchema, droidSlashCommandSchema, kiroAgentSchema, kiroHookSchema, opencodeSlashCommandSchema;
11394
+ var init_schema_files = __esm({
11395
+ "../converters/dist/schema-files.js"() {
11396
+ "use strict";
11397
+ init_cjs_shims();
11398
+ import_module = require("module");
11399
+ import_path9 = require("path");
11400
+ schemaRequire = typeof require !== "undefined" ? require : (0, import_module.createRequire)(process.cwd() + "/");
11401
+ convertersPackagePath = schemaRequire.resolve("@pr-pm/converters/package.json");
11402
+ convertersDir = (0, import_path9.dirname)(convertersPackagePath);
11403
+ loadSchema2 = (filename) => schemaRequire((0, import_path9.join)(convertersDir, "schemas", filename));
11404
+ agentsMdSchema = loadSchema2("agents-md.schema.json");
11405
+ canonicalSchema = loadSchema2("canonical.schema.json");
11406
+ claudeSchema = loadSchema2("claude.schema.json");
11407
+ continueSchema = loadSchema2("continue.schema.json");
11408
+ copilotSchema = loadSchema2("copilot.schema.json");
11409
+ cursorSchema = loadSchema2("cursor.schema.json");
11410
+ droidSchema = loadSchema2("droid.schema.json");
11411
+ geminiMdSchema = loadSchema2("gemini-md.schema.json");
11412
+ geminiSchema = loadSchema2("gemini.schema.json");
11413
+ kiroSteeringSchema = loadSchema2("kiro-steering.schema.json");
11414
+ opencodeSchema = loadSchema2("opencode.schema.json");
11415
+ rulerSchema = loadSchema2("ruler.schema.json");
11416
+ windsurfSchema = loadSchema2("windsurf.schema.json");
11417
+ traeSchema = loadSchema2("trae.schema.json");
11418
+ aiderSchema = loadSchema2("aider.schema.json");
11419
+ zencoderSchema = loadSchema2("zencoder.schema.json");
11420
+ replitSchema = loadSchema2("replit.schema.json");
11421
+ claudeAgentSchema = loadSchema2("claude-agent.schema.json");
11422
+ claudeHookSchema = loadSchema2("claude-hook.schema.json");
11423
+ claudeSkillSchema = loadSchema2("claude-skill.schema.json");
11424
+ claudeSlashCommandSchema = loadSchema2("claude-slash-command.schema.json");
11425
+ cursorCommandSchema = loadSchema2("cursor-command.schema.json");
11426
+ droidHookSchema = loadSchema2("droid-hook.schema.json");
11427
+ droidSkillSchema = loadSchema2("droid-skill.schema.json");
11428
+ droidSlashCommandSchema = loadSchema2("droid-slash-command.schema.json");
11429
+ kiroAgentSchema = loadSchema2("kiro-agent.schema.json");
11430
+ kiroHookSchema = loadSchema2("kiro-hook.schema.json");
11431
+ opencodeSlashCommandSchema = loadSchema2("opencode-slash-command.schema.json");
11432
+ }
11433
+ });
11434
+
11301
11435
  // ../converters/dist/index.js
11302
11436
  var init_dist = __esm({
11303
11437
  "../converters/dist/index.js"() {
@@ -11316,6 +11450,10 @@ var init_dist = __esm({
11316
11450
  init_from_opencode();
11317
11451
  init_from_ruler();
11318
11452
  init_from_droid();
11453
+ init_from_trae();
11454
+ init_from_aider();
11455
+ init_from_zencoder();
11456
+ init_from_replit();
11319
11457
  init_to_cursor();
11320
11458
  init_to_claude();
11321
11459
  init_to_continue();
@@ -11328,8 +11466,13 @@ var init_dist = __esm({
11328
11466
  init_to_opencode();
11329
11467
  init_to_ruler();
11330
11468
  init_to_droid();
11469
+ init_to_trae();
11470
+ init_to_aider();
11471
+ init_to_zencoder();
11472
+ init_to_replit();
11331
11473
  init_taxonomy_utils();
11332
11474
  init_validation();
11475
+ init_schema_files();
11333
11476
  }
11334
11477
  });
11335
11478
 
@@ -11360,6 +11503,10 @@ function getPackageIcon2(format, subtype) {
11360
11503
  "claude.md": "\u{1F916}",
11361
11504
  "opencode": "\u26A1",
11362
11505
  "droid": "\u{1F3ED}",
11506
+ "trae": "\u{1F3AF}",
11507
+ "aider": "\u{1F91D}",
11508
+ "zencoder": "\u26A1",
11509
+ "replit": "\u{1F52E}",
11363
11510
  "mcp": "\u{1F517}",
11364
11511
  "agents.md": "\u{1F4DD}",
11365
11512
  "ruler": "\u{1F4CF}",
@@ -11380,6 +11527,10 @@ function getPackageLabel2(format, subtype) {
11380
11527
  "claude.md": "Claude",
11381
11528
  "opencode": "OpenCode",
11382
11529
  "droid": "Factory Droid",
11530
+ "trae": "Trae",
11531
+ "aider": "Aider",
11532
+ "zencoder": "Zencoder",
11533
+ "replit": "Replit",
11383
11534
  "mcp": "MCP",
11384
11535
  "agents.md": "Agents.md",
11385
11536
  "ruler": "Ruler",
@@ -11436,7 +11587,11 @@ async function handleInstall(packageSpec, options) {
11436
11587
  }
11437
11588
  const config = await getConfig();
11438
11589
  const lockfile = await readLockfile();
11439
- const lockedVersion = getLockedVersion(lockfile, packageId);
11590
+ let targetFormat = options.as;
11591
+ if (!targetFormat) {
11592
+ targetFormat = config.defaultFormat || await autoDetectFormat() || void 0;
11593
+ }
11594
+ const lockedVersion = getLockedVersion(lockfile, packageId, targetFormat);
11440
11595
  let version;
11441
11596
  if (options.frozenLockfile) {
11442
11597
  if (!lockedVersion) {
@@ -11446,46 +11601,44 @@ async function handleInstall(packageSpec, options) {
11446
11601
  } else {
11447
11602
  version = options.version || specVersion || lockedVersion || "latest";
11448
11603
  }
11449
- let targetFormat = options.as;
11450
- if (!targetFormat) {
11451
- targetFormat = config.defaultFormat || await autoDetectFormat() || void 0;
11452
- }
11453
- if (!options.force && lockfile && lockfile.packages[packageId]) {
11454
- const installedPkg = lockfile.packages[packageId];
11455
- const requestedVersion = options.version || specVersion;
11456
- const sameFormat = !targetFormat || installedPkg.format === targetFormat;
11457
- if (sameFormat && (!requestedVersion || requestedVersion === "latest" || requestedVersion === installedPkg.version)) {
11458
- console.log(`
11604
+ if (!options.force && lockfile && targetFormat) {
11605
+ const lockfileKey = getLockfileKey(packageId, targetFormat);
11606
+ const installedPkg = lockfile.packages[lockfileKey];
11607
+ if (installedPkg) {
11608
+ const requestedVersion = options.version || specVersion;
11609
+ if (!requestedVersion || requestedVersion === "latest" || requestedVersion === installedPkg.version) {
11610
+ console.log(`
11459
11611
  \u2728 Package already installed!`);
11460
- console.log(` \u{1F4E6} ${packageId}@${installedPkg.version}`);
11461
- console.log(` \u{1F504} Format: ${installedPkg.format || "unknown"} | Subtype: ${installedPkg.subtype || "unknown"}`);
11462
- console.log(`
11612
+ console.log(` \u{1F4E6} ${packageId}@${installedPkg.version}`);
11613
+ console.log(` \u{1F504} Format: ${installedPkg.format || "unknown"} | Subtype: ${installedPkg.subtype || "unknown"}`);
11614
+ console.log(`
11463
11615
  \u{1F4A1} To reinstall or upgrade:`);
11464
- console.log(` prpm upgrade ${packageId} # Upgrade to latest version`);
11465
- console.log(` prpm uninstall ${packageId} # Uninstall first, then install`);
11466
- console.log(` prpm install ${packageId} --as <format> # Install in different format`);
11467
- success = true;
11468
- return;
11469
- } else if (!sameFormat) {
11470
- console.log(`\u{1F4E6} Installing ${packageId} in ${targetFormat} format (already have ${installedPkg.format} version)`);
11471
- } else if (requestedVersion !== installedPkg.version) {
11472
- console.log(`\u{1F4E6} Upgrading ${packageId}: ${installedPkg.version} \u2192 ${requestedVersion}`);
11616
+ console.log(` prpm upgrade ${packageId} # Upgrade to latest version`);
11617
+ console.log(` prpm uninstall ${packageId} # Uninstall first, then install`);
11618
+ console.log(` prpm install ${packageId} --as <format> # Install in different format`);
11619
+ success = true;
11620
+ return;
11621
+ } else {
11622
+ console.log(`\u{1F4E6} Upgrading ${packageId}: ${installedPkg.version} \u2192 ${requestedVersion}`);
11623
+ }
11624
+ } else if (options.as) {
11625
+ const existingFormats = [];
11626
+ for (const key of Object.keys(lockfile.packages)) {
11627
+ const parsed = parseLockfileKey(key);
11628
+ if (parsed.packageId === packageId && parsed.format) {
11629
+ existingFormats.push(parsed.format);
11630
+ }
11631
+ }
11632
+ if (existingFormats.length > 0) {
11633
+ console.log(`\u{1F4E6} Installing ${packageId} in ${targetFormat} format (already have ${existingFormats.join(", ")} version${existingFormats.length > 1 ? "s" : ""})`);
11634
+ }
11473
11635
  }
11474
11636
  }
11475
11637
  console.log(`\u{1F4E5} Installing ${packageId}@${version}...`);
11476
11638
  const client = (0, import_registry_client5.getRegistryClient)(config);
11477
11639
  let isCollection = false;
11478
11640
  try {
11479
- let scope;
11480
- let name_slug;
11481
- const matchWithScope = packageId.match(/^@?([^/]+)\/([^/@]+)$/);
11482
- if (matchWithScope) {
11483
- [, scope, name_slug] = matchWithScope;
11484
- } else {
11485
- scope = "collection";
11486
- name_slug = packageId;
11487
- }
11488
- await client.getCollection(scope, name_slug, version === "latest" ? void 0 : version);
11641
+ await client.getCollection(packageId, version === "latest" ? void 0 : version);
11489
11642
  isCollection = true;
11490
11643
  return await handleCollectionInstall(packageId, {
11491
11644
  format: options.as,
@@ -11550,10 +11703,22 @@ async function handleInstall(packageSpec, options) {
11550
11703
  actualVersion = pkg.latest_version.version;
11551
11704
  console.log(` \u{1F4E6} Installing version ${pkg.latest_version.version}`);
11552
11705
  } else {
11553
- const versionInfo = await client.getPackageVersion(packageId, version);
11706
+ let resolvedVersion = version;
11707
+ if (import_semver.default.validRange(version) && !import_semver.default.valid(version)) {
11708
+ console.log(` \u{1F50D} Resolving semver range: ${version}`);
11709
+ const versionsData = await client.getPackageVersions(packageId);
11710
+ const availableVersions = versionsData.versions.map((v) => v.version);
11711
+ const maxSatisfying = import_semver.default.maxSatisfying(availableVersions, version);
11712
+ if (!maxSatisfying) {
11713
+ throw new Error(`No version found matching range "${version}". Available versions: ${availableVersions.join(", ")}`);
11714
+ }
11715
+ resolvedVersion = maxSatisfying;
11716
+ console.log(` \u2713 Resolved to version ${resolvedVersion}`);
11717
+ }
11718
+ const versionInfo = await client.getPackageVersion(packageId, resolvedVersion);
11554
11719
  tarballUrl = versionInfo.tarball_url;
11555
- actualVersion = version;
11556
- console.log(` \u{1F4E6} Installing version ${version}`);
11720
+ actualVersion = resolvedVersion;
11721
+ console.log(` \u{1F4E6} Installing version ${resolvedVersion}`);
11557
11722
  }
11558
11723
  console.log(` \u2B07\uFE0F Downloading...`);
11559
11724
  const tarball = await client.downloadPackage(tarballUrl);
@@ -11618,6 +11783,7 @@ async function handleInstall(packageSpec, options) {
11618
11783
  convertedContent = cursorResult.content;
11619
11784
  break;
11620
11785
  case "claude":
11786
+ case "claude.md":
11621
11787
  const claudeResult = toClaude(canonicalPkg);
11622
11788
  convertedContent = claudeResult.content;
11623
11789
  break;
@@ -11644,6 +11810,7 @@ async function handleInstall(packageSpec, options) {
11644
11810
  convertedContent = agentsResult.content;
11645
11811
  break;
11646
11812
  case "gemini":
11813
+ case "gemini.md":
11647
11814
  const geminiResult = toGemini(canonicalPkg);
11648
11815
  convertedContent = geminiResult.content;
11649
11816
  break;
@@ -11684,7 +11851,7 @@ async function handleInstall(packageSpec, options) {
11684
11851
  destDir = getDestinationDir2(effectiveFormat, effectiveSubtype, pkg.name);
11685
11852
  if (locationOverride && effectiveFormat === "cursor") {
11686
11853
  const relativeDestDir = destDir.startsWith("./") ? destDir.slice(2) : destDir;
11687
- destDir = import_path9.default.join(locationOverride, relativeDestDir);
11854
+ destDir = import_path10.default.join(locationOverride, relativeDestDir);
11688
11855
  console.log(` \u{1F4C1} Installing Cursor package to custom location: ${destDir}`);
11689
11856
  }
11690
11857
  let mainFile = extractedFiles[0].content;
@@ -11705,7 +11872,7 @@ async function handleInstall(packageSpec, options) {
11705
11872
  const manifestFilename = getManifestFilename(effectiveFormat);
11706
11873
  let targetPath = manifestFilename;
11707
11874
  if (locationOverride) {
11708
- targetPath = import_path9.default.join(locationOverride, `${manifestFilename.replace(".md", ".override.md")}`);
11875
+ targetPath = import_path10.default.join(locationOverride, `${manifestFilename.replace(".md", ".override.md")}`);
11709
11876
  console.log(` \u{1F4C1} Installing to custom location: ${targetPath}`);
11710
11877
  }
11711
11878
  destPath = targetPath;
@@ -11806,7 +11973,7 @@ async function handleInstall(packageSpec, options) {
11806
11973
  destDir = getDestinationDir2(effectiveFormat, effectiveSubtype, pkg.name);
11807
11974
  if (locationOverride && effectiveFormat === "cursor") {
11808
11975
  const relativeDestDir = destDir.startsWith("./") ? destDir.slice(2) : destDir;
11809
- destDir = import_path9.default.join(locationOverride, relativeDestDir);
11976
+ destDir = import_path10.default.join(locationOverride, relativeDestDir);
11810
11977
  console.log(` \u{1F4C1} Installing Cursor package to custom location: ${destDir}`);
11811
11978
  }
11812
11979
  const packageName = stripAuthorNamespace2(packageId);
@@ -11934,7 +12101,7 @@ ${afterFrontmatter}`;
11934
12101
  // Track hook installation metadata for uninstall
11935
12102
  progressiveDisclosure: progressiveDisclosureMetadata
11936
12103
  });
11937
- setPackageIntegrity(updatedLockfile, packageId, tarball);
12104
+ setPackageIntegrity(updatedLockfile, packageId, tarball, effectiveFormat);
11938
12105
  await writeLockfile(updatedLockfile);
11939
12106
  await client.trackDownload(packageId, {
11940
12107
  version: actualVersion || version,
@@ -11995,7 +12162,7 @@ async function extractTarball(tarball, packageId) {
11995
12162
  } catch (error) {
11996
12163
  throw new CLIError(`Package decompression failed: ${error.message}`);
11997
12164
  }
11998
- const tmpDir = await import_promises2.default.mkdtemp(import_path9.default.join(import_os3.default.tmpdir(), "prpm-"));
12165
+ const tmpDir = await import_promises2.default.mkdtemp(import_path10.default.join(import_os3.default.tmpdir(), "prpm-"));
11999
12166
  const cleanup = async () => {
12000
12167
  try {
12001
12168
  await import_promises2.default.rm(tmpDir, { recursive: true, force: true });
@@ -12043,7 +12210,7 @@ async function collectExtractedFiles(rootDir, excludedNames, fs12) {
12043
12210
  if (!currentDir) continue;
12044
12211
  const entries = await fs12.readdir(currentDir, { withFileTypes: true });
12045
12212
  for (const entry of entries) {
12046
- const fullPath = import_path9.default.join(currentDir, entry.name);
12213
+ const fullPath = import_path10.default.join(currentDir, entry.name);
12047
12214
  if (entry.isDirectory()) {
12048
12215
  dirs.push(fullPath);
12049
12216
  continue;
@@ -12055,7 +12222,7 @@ async function collectExtractedFiles(rootDir, excludedNames, fs12) {
12055
12222
  continue;
12056
12223
  }
12057
12224
  const content = await fs12.readFile(fullPath, "utf-8");
12058
- const relativePath = import_path9.default.relative(rootDir, fullPath).split(import_path9.default.sep).join("/");
12225
+ const relativePath = import_path10.default.relative(rootDir, fullPath).split(import_path10.default.sep).join("/");
12059
12226
  files.push({
12060
12227
  name: relativePath,
12061
12228
  content
@@ -12080,18 +12247,20 @@ async function installFromLockfile(options) {
12080
12247
  `);
12081
12248
  let successCount = 0;
12082
12249
  let failCount = 0;
12083
- for (const packageId of packageIds) {
12084
- const lockEntry = lockfile.packages[packageId];
12250
+ for (const lockfileKey of packageIds) {
12251
+ const lockEntry = lockfile.packages[lockfileKey];
12252
+ const { packageId, format } = parseLockfileKey(lockfileKey);
12253
+ const displayName = format ? `${packageId} (${format})` : packageId;
12085
12254
  try {
12086
12255
  const packageSpec = packageId.includes("@") && !packageId.startsWith("@") ? packageId.substring(0, packageId.lastIndexOf("@")) : packageId;
12087
- console.log(` Installing ${packageId}...`);
12256
+ console.log(` Installing ${displayName}...`);
12088
12257
  let locationOverride = options.location;
12089
12258
  if (!locationOverride && lockEntry.format === "agents.md" && lockEntry.installedPath) {
12090
- const baseName = import_path9.default.basename(lockEntry.installedPath);
12259
+ const baseName = import_path10.default.basename(lockEntry.installedPath);
12091
12260
  if (baseName === "AGENTS.override.md") {
12092
- locationOverride = import_path9.default.dirname(lockEntry.installedPath);
12261
+ locationOverride = import_path10.default.dirname(lockEntry.installedPath);
12093
12262
  } else if (baseName !== "AGENTS.md") {
12094
- locationOverride = import_path9.default.dirname(lockEntry.installedPath);
12263
+ locationOverride = import_path10.default.dirname(lockEntry.installedPath);
12095
12264
  }
12096
12265
  }
12097
12266
  const manifestFile = (_a = lockEntry.progressiveDisclosure) == null ? void 0 : _a.manifestPath;
@@ -12111,7 +12280,7 @@ async function installFromLockfile(options) {
12111
12280
  successCount++;
12112
12281
  } else {
12113
12282
  failCount++;
12114
- console.error(` \u274C Failed to install ${packageId}:`);
12283
+ console.error(` \u274C Failed to install ${displayName}:`);
12115
12284
  console.error(` Type: ${(_b = error == null ? void 0 : error.constructor) == null ? void 0 : _b.name}`);
12116
12285
  console.error(` Message: ${error instanceof Error ? error.message : String(error)}`);
12117
12286
  if (error instanceof CLIError) {
@@ -12160,7 +12329,7 @@ function createInstallCommand() {
12160
12329
  });
12161
12330
  return command;
12162
12331
  }
12163
- var import_commander11, import_chalk, import_registry_client5, import_stream, import_promises, tar, import_path9, import_zlib, import_promises2, import_os3;
12332
+ var import_commander11, import_chalk, import_registry_client5, import_stream, import_promises, tar, import_path10, import_zlib, import_promises2, import_os3, import_semver;
12164
12333
  var init_install = __esm({
12165
12334
  "src/commands/install.ts"() {
12166
12335
  "use strict";
@@ -12176,10 +12345,11 @@ var init_install = __esm({
12176
12345
  tar = __toESM(require("tar"));
12177
12346
  init_errors();
12178
12347
  init_prompts();
12179
- import_path9 = __toESM(require("path"));
12348
+ import_path10 = __toESM(require("path"));
12180
12349
  import_zlib = __toESM(require("zlib"));
12181
12350
  import_promises2 = __toESM(require("fs/promises"));
12182
12351
  import_os3 = __toESM(require("os"));
12352
+ import_semver = __toESM(require("semver"));
12183
12353
  init_collections();
12184
12354
  init_lockfile();
12185
12355
  init_cursor_config();
@@ -12193,7 +12363,7 @@ var init_install = __esm({
12193
12363
  init_cjs_shims();
12194
12364
  var import_commander29 = require("commander");
12195
12365
  var import_fs15 = require("fs");
12196
- var import_path18 = require("path");
12366
+ var import_path19 = require("path");
12197
12367
 
12198
12368
  // src/commands/list.ts
12199
12369
  init_cjs_shims();
@@ -12355,87 +12525,160 @@ init_filesystem();
12355
12525
  var import_fs7 = require("fs");
12356
12526
  init_errors();
12357
12527
  init_agents_md_progressive();
12358
- async function handleUninstall(name) {
12528
+ var readline = __toESM(require("readline"));
12529
+ async function promptForFormat(packageId, formats) {
12530
+ console.log(`
12531
+ \u{1F4E6} Multiple formats found for ${packageId}:`);
12532
+ formats.forEach((fmt, idx) => {
12533
+ console.log(` ${idx + 1}. ${fmt}`);
12534
+ });
12535
+ console.log(` ${formats.length + 1}. All formats`);
12536
+ const rl = readline.createInterface({
12537
+ input: process.stdin,
12538
+ output: process.stdout
12539
+ });
12540
+ return new Promise((resolve2) => {
12541
+ rl.question("\nSelect format to uninstall (number): ", (answer) => {
12542
+ rl.close();
12543
+ const choice = parseInt(answer.trim(), 10);
12544
+ if (choice > 0 && choice <= formats.length) {
12545
+ resolve2(formats[choice - 1]);
12546
+ } else if (choice === formats.length + 1) {
12547
+ resolve2("all");
12548
+ } else {
12549
+ console.log("Invalid choice, uninstalling all formats");
12550
+ resolve2("all");
12551
+ }
12552
+ });
12553
+ });
12554
+ }
12555
+ async function handleUninstall(name, options = {}) {
12359
12556
  try {
12360
- console.log(`\u{1F5D1}\uFE0F Uninstalling package: ${name}`);
12361
- const pkg = await removePackage(name);
12362
- if (!pkg) {
12557
+ const lockfile = await readLockfile();
12558
+ if (!lockfile) {
12559
+ throw new CLIError("\u274C No prpm.lock file found", 1);
12560
+ }
12561
+ const matchingKeys = [];
12562
+ for (const key of Object.keys(lockfile.packages)) {
12563
+ const parsed = parseLockfileKey(key);
12564
+ if (parsed.packageId === name) {
12565
+ matchingKeys.push(key);
12566
+ }
12567
+ }
12568
+ if (matchingKeys.length === 0) {
12363
12569
  throw new CLIError(`\u274C Package "${name}" not found`, 1);
12364
12570
  }
12365
- if (pkg.progressiveDisclosure) {
12366
- const { manifestPath, resourceName, skillName } = pkg.progressiveDisclosure;
12367
- const name2 = resourceName || skillName;
12368
- if (name2) {
12369
- try {
12370
- await removeSkillFromManifest(name2, manifestPath);
12371
- console.log(` \u{1F4DD} Removed from ${manifestPath} manifest`);
12372
- } catch (error) {
12373
- console.warn(` \u26A0\uFE0F Failed to remove from manifest: ${error}`);
12571
+ let keysToUninstall;
12572
+ if (options.format) {
12573
+ const requestedKey = getLockfileKey(name, options.format);
12574
+ if (!lockfile.packages[requestedKey]) {
12575
+ if (lockfile.packages[name] && lockfile.packages[name].format === options.format) {
12576
+ keysToUninstall = [name];
12577
+ } else {
12578
+ throw new CLIError(`\u274C Package "${name}" with format "${options.format}" not found`, 1);
12374
12579
  }
12580
+ } else {
12581
+ keysToUninstall = [requestedKey];
12582
+ }
12583
+ } else if (matchingKeys.length > 1) {
12584
+ const formats = matchingKeys.map((key) => {
12585
+ const parsed = parseLockfileKey(key);
12586
+ return parsed.format || lockfile.packages[key].format || "unknown";
12587
+ });
12588
+ const selectedFormat = await promptForFormat(name, formats);
12589
+ if (selectedFormat === "all") {
12590
+ keysToUninstall = matchingKeys;
12591
+ } else {
12592
+ const selectedKey = matchingKeys[formats.indexOf(selectedFormat)];
12593
+ keysToUninstall = [selectedKey];
12375
12594
  }
12595
+ } else {
12596
+ keysToUninstall = matchingKeys;
12376
12597
  }
12377
- if (pkg.format === "claude" && pkg.subtype === "hook" && pkg.hookMetadata) {
12378
- const settingsPath = pkg.installedPath || ".claude/settings.json";
12379
- try {
12380
- const settingsContent = await import_fs7.promises.readFile(settingsPath, "utf-8");
12381
- const settings = JSON.parse(settingsContent);
12382
- if (settings.hooks) {
12383
- let removedCount = 0;
12384
- for (const event of pkg.hookMetadata.events) {
12385
- if (settings.hooks[event]) {
12386
- const originalLength = settings.hooks[event].length;
12387
- settings.hooks[event] = settings.hooks[event].filter(
12388
- (hook) => hook.__prpm_hook_id !== pkg.hookMetadata.hookId
12389
- );
12390
- const newLength = settings.hooks[event].length;
12391
- removedCount += originalLength - newLength;
12392
- if (settings.hooks[event].length === 0) {
12393
- delete settings.hooks[event];
12598
+ for (const lockfileKey of keysToUninstall) {
12599
+ const parsed = parseLockfileKey(lockfileKey);
12600
+ const formatDisplay = parsed.format ? ` (${parsed.format})` : "";
12601
+ console.log(`
12602
+ \u{1F5D1}\uFE0F Uninstalling package: ${name}${formatDisplay}`);
12603
+ const pkg = await removePackage(lockfileKey);
12604
+ if (!pkg) {
12605
+ throw new CLIError(`\u274C Package "${name}" not found`, 1);
12606
+ }
12607
+ if (pkg.progressiveDisclosure) {
12608
+ const { manifestPath, resourceName, skillName } = pkg.progressiveDisclosure;
12609
+ const name2 = resourceName || skillName;
12610
+ if (name2) {
12611
+ try {
12612
+ await removeSkillFromManifest(name2, manifestPath);
12613
+ console.log(` \u{1F4DD} Removed from ${manifestPath} manifest`);
12614
+ } catch (error) {
12615
+ console.warn(` \u26A0\uFE0F Failed to remove from manifest: ${error}`);
12616
+ }
12617
+ }
12618
+ }
12619
+ if (pkg.format === "claude" && pkg.subtype === "hook" && pkg.hookMetadata) {
12620
+ const settingsPath = pkg.installedPath || ".claude/settings.json";
12621
+ try {
12622
+ const settingsContent = await import_fs7.promises.readFile(settingsPath, "utf-8");
12623
+ const settings = JSON.parse(settingsContent);
12624
+ if (settings.hooks) {
12625
+ let removedCount = 0;
12626
+ for (const event of pkg.hookMetadata.events) {
12627
+ if (settings.hooks[event]) {
12628
+ const originalLength = settings.hooks[event].length;
12629
+ settings.hooks[event] = settings.hooks[event].filter(
12630
+ (hook) => hook.__prpm_hook_id !== pkg.hookMetadata.hookId
12631
+ );
12632
+ const newLength = settings.hooks[event].length;
12633
+ removedCount += originalLength - newLength;
12634
+ if (settings.hooks[event].length === 0) {
12635
+ delete settings.hooks[event];
12636
+ }
12394
12637
  }
12395
12638
  }
12639
+ await import_fs7.promises.writeFile(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
12640
+ console.log(` \u{1FA9D} Removed ${removedCount} hook(s) from ${settingsPath}`);
12641
+ }
12642
+ } catch (error) {
12643
+ const err = error;
12644
+ if (err.code === "ENOENT") {
12645
+ console.warn(` \u26A0\uFE0F Settings file not found: ${settingsPath}`);
12646
+ } else {
12647
+ throw new Error(`Failed to remove hooks from settings: ${error}`);
12396
12648
  }
12397
- await import_fs7.promises.writeFile(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
12398
- console.log(` \u{1FA9D} Removed ${removedCount} hook(s) from ${settingsPath}`);
12649
+ }
12650
+ console.log(`\u2705 Successfully uninstalled ${name}`);
12651
+ return;
12652
+ }
12653
+ const packageName = stripAuthorNamespace2(name);
12654
+ let targetPath;
12655
+ if (pkg.installedPath) {
12656
+ targetPath = pkg.installedPath;
12657
+ console.log(` \u{1F4CD} Using installation path from lock file: ${targetPath}`);
12658
+ } else {
12659
+ console.warn(` \u26A0\uFE0F No installation path in lock file for ${name}`);
12660
+ console.warn(` \u26A0\uFE0F This may indicate an old or corrupted lock file`);
12661
+ throw new CLIError(`Cannot uninstall ${name}: installation path unknown`, 1);
12662
+ }
12663
+ try {
12664
+ const stats = await import_fs7.promises.stat(targetPath);
12665
+ if (stats.isDirectory()) {
12666
+ await import_fs7.promises.rm(targetPath, { recursive: true, force: true });
12667
+ console.log(` \u{1F5D1}\uFE0F Deleted directory: ${targetPath}`);
12668
+ } else if (stats.isFile()) {
12669
+ await import_fs7.promises.unlink(targetPath);
12670
+ console.log(` \u{1F5D1}\uFE0F Deleted file: ${targetPath}`);
12399
12671
  }
12400
12672
  } catch (error) {
12401
12673
  const err = error;
12402
12674
  if (err.code === "ENOENT") {
12403
- console.warn(` \u26A0\uFE0F Settings file not found: ${settingsPath}`);
12675
+ console.warn(` \u26A0\uFE0F File/directory not found: ${targetPath}`);
12404
12676
  } else {
12405
- throw new Error(`Failed to remove hooks from settings: ${error}`);
12677
+ throw err;
12406
12678
  }
12407
12679
  }
12408
- console.log(`\u2705 Successfully uninstalled ${name}`);
12409
- return;
12410
- }
12411
- const packageName = stripAuthorNamespace2(name);
12412
- let targetPath;
12413
- if (pkg.installedPath) {
12414
- targetPath = pkg.installedPath;
12415
- console.log(` \u{1F4CD} Using installation path from lock file: ${targetPath}`);
12416
- } else {
12417
- console.warn(` \u26A0\uFE0F No installation path in lock file for ${name}`);
12418
- console.warn(` \u26A0\uFE0F This may indicate an old or corrupted lock file`);
12419
- throw new CLIError(`Cannot uninstall ${name}: installation path unknown`, 1);
12420
- }
12421
- try {
12422
- const stats = await import_fs7.promises.stat(targetPath);
12423
- if (stats.isDirectory()) {
12424
- await import_fs7.promises.rm(targetPath, { recursive: true, force: true });
12425
- console.log(` \u{1F5D1}\uFE0F Deleted directory: ${targetPath}`);
12426
- } else if (stats.isFile()) {
12427
- await import_fs7.promises.unlink(targetPath);
12428
- console.log(` \u{1F5D1}\uFE0F Deleted file: ${targetPath}`);
12429
- }
12430
- } catch (error) {
12431
- const err = error;
12432
- if (err.code === "ENOENT") {
12433
- console.warn(` \u26A0\uFE0F File/directory not found: ${targetPath}`);
12434
- } else {
12435
- throw err;
12436
- }
12680
+ console.log(`\u2705 Successfully uninstalled ${name}${formatDisplay}`);
12437
12681
  }
12438
- console.log(`\u2705 Successfully uninstalled ${name}`);
12439
12682
  } catch (error) {
12440
12683
  if (error instanceof CLIError) {
12441
12684
  throw error;
@@ -12445,7 +12688,7 @@ async function handleUninstall(name) {
12445
12688
  }
12446
12689
  function createUninstallCommand() {
12447
12690
  const command = new import_commander2.Command("uninstall");
12448
- command.description("Uninstall a prompt package").argument("<id>", "Package ID to uninstall").alias("remove").action(handleUninstall);
12691
+ command.description("Uninstall a prompt package").argument("<id>", "Package ID to uninstall").option("--format <format>", "Specific format to uninstall (if multiple formats installed)").alias("remove").action(handleUninstall);
12449
12692
  return command;
12450
12693
  }
12451
12694
 
@@ -12783,7 +13026,7 @@ var import_commander7 = require("commander");
12783
13026
  var import_registry_client2 = require("@pr-pm/registry-client");
12784
13027
  init_user_config();
12785
13028
  init_telemetry();
12786
- var readline = __toESM(require("readline"));
13029
+ var readline2 = __toESM(require("readline"));
12787
13030
  init_errors();
12788
13031
  function getPackageIcon(format, subtype) {
12789
13032
  const subtypeIcons = {
@@ -12811,6 +13054,10 @@ function getPackageIcon(format, subtype) {
12811
13054
  "claude.md": "\u{1F916}",
12812
13055
  "opencode": "\u26A1",
12813
13056
  "droid": "\u{1F3ED}",
13057
+ "trae": "\u{1F3AF}",
13058
+ "aider": "\u{1F91D}",
13059
+ "zencoder": "\u26A1",
13060
+ "replit": "\u{1F52E}",
12814
13061
  "mcp": "\u{1F517}",
12815
13062
  "agents.md": "\u{1F4DD}",
12816
13063
  "ruler": "\u{1F4CF}",
@@ -12831,6 +13078,10 @@ function getPackageLabel(format, subtype) {
12831
13078
  "claude.md": "Claude",
12832
13079
  "opencode": "OpenCode",
12833
13080
  "droid": "Factory Droid",
13081
+ "trae": "Trae",
13082
+ "aider": "Aider",
13083
+ "zencoder": "Zencoder",
13084
+ "replit": "Replit",
12834
13085
  "mcp": "MCP",
12835
13086
  "agents.md": "Agents.md",
12836
13087
  "ruler": "Ruler",
@@ -12893,7 +13144,7 @@ function displayResults(packages, total, page, limit) {
12893
13144
  }
12894
13145
  function promptUser() {
12895
13146
  return new Promise((resolve2) => {
12896
- const rl = readline.createInterface({
13147
+ const rl = readline2.createInterface({
12897
13148
  input: process.stdin,
12898
13149
  output: process.stdout
12899
13150
  });
@@ -13358,7 +13609,7 @@ init_install();
13358
13609
  init_cjs_shims();
13359
13610
  var import_commander12 = require("commander");
13360
13611
  var import_promises6 = require("fs/promises");
13361
- var import_path13 = require("path");
13612
+ var import_path14 = require("path");
13362
13613
  var tar2 = __toESM(require("tar"));
13363
13614
  var import_os4 = require("os");
13364
13615
  var import_crypto2 = require("crypto");
@@ -13532,13 +13783,13 @@ init_cjs_shims();
13532
13783
  var import_ajv2 = __toESM(require("ajv"));
13533
13784
  var import_ajv_formats2 = __toESM(require("ajv-formats"));
13534
13785
  var import_fs10 = require("fs");
13535
- var import_path10 = require("path");
13786
+ var import_path11 = require("path");
13536
13787
  var schema2;
13537
13788
  var schemaCandidates = [
13538
13789
  // Source file layout (src/core → ../../schemas)
13539
- (0, import_path10.join)(__dirname, "../../schemas/prpm-manifest.schema.json"),
13790
+ (0, import_path11.join)(__dirname, "../../schemas/prpm-manifest.schema.json"),
13540
13791
  // Bundled layout (dist/index.js → ../schemas)
13541
- (0, import_path10.join)(__dirname, "../schemas/prpm-manifest.schema.json")
13792
+ (0, import_path11.join)(__dirname, "../schemas/prpm-manifest.schema.json")
13542
13793
  ];
13543
13794
  for (const candidate of schemaCandidates) {
13544
13795
  try {
@@ -13598,7 +13849,7 @@ function getManifestSchema() {
13598
13849
  // src/utils/license-extractor.ts
13599
13850
  init_cjs_shims();
13600
13851
  var import_promises3 = require("fs/promises");
13601
- var import_path11 = require("path");
13852
+ var import_path12 = require("path");
13602
13853
  var import_fs11 = require("fs");
13603
13854
  var LICENSE_FILE_PATTERNS = [
13604
13855
  "LICENSE",
@@ -13648,7 +13899,7 @@ function generateLicenseUrl(repositoryUrl, fileName) {
13648
13899
  async function extractLicenseInfo(repositoryUrl) {
13649
13900
  const cwd = process.cwd();
13650
13901
  for (const fileName of LICENSE_FILE_PATTERNS) {
13651
- const filePath = (0, import_path11.join)(cwd, fileName);
13902
+ const filePath = (0, import_path12.join)(cwd, fileName);
13652
13903
  try {
13653
13904
  await (0, import_promises3.access)(filePath, import_fs11.constants.R_OK);
13654
13905
  const text = await (0, import_promises3.readFile)(filePath, "utf-8");
@@ -13684,7 +13935,7 @@ function validateLicenseInfo(licenseInfo, packageName) {
13684
13935
  // src/utils/snippet-extractor.ts
13685
13936
  init_cjs_shims();
13686
13937
  var import_promises4 = require("fs/promises");
13687
- var import_path12 = require("path");
13938
+ var import_path13 = require("path");
13688
13939
  var MAX_SNIPPET_LENGTH = 2e3;
13689
13940
  async function extractSnippet(manifest) {
13690
13941
  const cwd = process.cwd();
@@ -13700,7 +13951,7 @@ async function extractSnippet(manifest) {
13700
13951
  const firstFile = manifest.files[0];
13701
13952
  fileName = typeof firstFile === "string" ? firstFile : firstFile.path;
13702
13953
  }
13703
- const fullPath = (0, import_path12.join)(cwd, fileName);
13954
+ const fullPath = (0, import_path13.join)(cwd, fileName);
13704
13955
  const stats = await (0, import_promises4.stat)(fullPath);
13705
13956
  if (stats.isDirectory()) {
13706
13957
  console.warn(`\u26A0\uFE0F Skipping snippet extraction: "${fullPath}" is a directory`);
@@ -13960,7 +14211,7 @@ async function validatePackageFiles(manifest) {
13960
14211
 
13961
14212
  // src/commands/publish.ts
13962
14213
  async function findAndLoadManifests() {
13963
- const prpmJsonPath = (0, import_path13.join)(process.cwd(), "prpm.json");
14214
+ const prpmJsonPath = (0, import_path14.join)(process.cwd(), "prpm.json");
13964
14215
  let prpmJsonExists = false;
13965
14216
  let prpmJsonError = null;
13966
14217
  try {
@@ -14012,7 +14263,7 @@ async function findAndLoadManifests() {
14012
14263
  throw error;
14013
14264
  }
14014
14265
  }
14015
- const marketplaceJsonPath = (0, import_path13.join)(process.cwd(), ".claude", "marketplace.json");
14266
+ const marketplaceJsonPath = (0, import_path14.join)(process.cwd(), ".claude", "marketplace.json");
14016
14267
  try {
14017
14268
  const content = await (0, import_promises6.readFile)(marketplaceJsonPath, "utf-8");
14018
14269
  const marketplaceData = JSON.parse(content);
@@ -14028,7 +14279,7 @@ async function findAndLoadManifests() {
14028
14279
  return { manifests, collections: [], source: ".claude/marketplace.json" };
14029
14280
  } catch (error) {
14030
14281
  }
14031
- const marketplaceJsonPluginPath = (0, import_path13.join)(process.cwd(), ".claude-plugin", "marketplace.json");
14282
+ const marketplaceJsonPluginPath = (0, import_path14.join)(process.cwd(), ".claude-plugin", "marketplace.json");
14032
14283
  try {
14033
14284
  const content = await (0, import_promises6.readFile)(marketplaceJsonPluginPath, "utf-8");
14034
14285
  const marketplaceData = JSON.parse(content);
@@ -14145,8 +14396,8 @@ function predictScopedPackageName(manifestName, username, organization) {
14145
14396
  return manifestName;
14146
14397
  }
14147
14398
  async function createTarball(manifest) {
14148
- const tmpDir = (0, import_path13.join)((0, import_os4.tmpdir)(), `prpm-${(0, import_crypto2.randomBytes)(8).toString("hex")}`);
14149
- const tarballPath = (0, import_path13.join)(tmpDir, "package.tar.gz");
14399
+ const tmpDir = (0, import_path14.join)((0, import_os4.tmpdir)(), `prpm-${(0, import_crypto2.randomBytes)(8).toString("hex")}`);
14400
+ const tarballPath = (0, import_path14.join)(tmpDir, "package.tar.gz");
14150
14401
  try {
14151
14402
  await (0, import_promises6.mkdir)(tmpDir, { recursive: true });
14152
14403
  const filePaths = normalizeFilePaths2(manifest.files);
@@ -14207,7 +14458,7 @@ async function handlePublish(options) {
14207
14458
  const { manifests, collections, source } = await findAndLoadManifests();
14208
14459
  if (source === "prpm.json (multi-package)" || source === "prpm.json") {
14209
14460
  try {
14210
- const prpmJsonPath = (0, import_path13.join)(process.cwd(), "prpm.json");
14461
+ const prpmJsonPath = (0, import_path14.join)(process.cwd(), "prpm.json");
14211
14462
  const prpmContent = await (0, import_promises6.readFile)(prpmJsonPath, "utf-8");
14212
14463
  const prpmManifest = JSON.parse(prpmContent);
14213
14464
  if (prpmManifest.scripts) {
@@ -14235,7 +14486,11 @@ async function handlePublish(options) {
14235
14486
  console.log(" Will publish each separately\n");
14236
14487
  }
14237
14488
  let filteredManifests = manifests;
14238
- if (options.package) {
14489
+ if (options.collection) {
14490
+ filteredManifests = [];
14491
+ console.log(` Skipping packages (publishing collection only)
14492
+ `);
14493
+ } else if (options.package) {
14239
14494
  filteredManifests = manifests.filter((m) => m.name === options.package);
14240
14495
  if (filteredManifests.length === 0) {
14241
14496
  throw new Error(`Package "${options.package}" not found in manifest. Available packages: ${manifests.map((m) => m.name).join(", ")}`);
@@ -14283,7 +14538,7 @@ async function handlePublish(options) {
14283
14538
  const RETRY_DELAY_MS = options.dryRun || process.env.NODE_ENV === "test" ? 0 : parseInt(process.env.PRPM_RETRY_DELAY_MS || "5000");
14284
14539
  const delay = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
14285
14540
  const isRetriableError = (error2) => {
14286
- return error2.includes("Service Unavailable") || error2.includes("at capacity") || error2.includes("503") || error2.includes("ECONNRESET") || error2.includes("ETIMEDOUT");
14541
+ return error2.includes("Service Unavailable") || error2.includes("Bad Gateway") || error2.includes("at capacity") || error2.includes("502") || error2.includes("503") || error2.includes("ECONNRESET") || error2.includes("ETIMEDOUT");
14287
14542
  };
14288
14543
  if (filteredManifests.length > 1 && BATCH_DELAY_MS > 0) {
14289
14544
  console.log(`\u{1F4E6} Publishing ${filteredManifests.length} packages in batches of ${BATCH_SIZE}`);
@@ -14568,7 +14823,6 @@ ${"=".repeat(60)}`);
14568
14823
  };
14569
14824
  const result = await client.createCollection(collectionData);
14570
14825
  console.log(`\u2705 Collection published successfully!`);
14571
- console.log(` Scope: ${result.scope}`);
14572
14826
  console.log(` Name: ${result.name_slug}`);
14573
14827
  console.log(` Version: ${result.version || "1.0.0"}`);
14574
14828
  console.log("");
@@ -15264,9 +15518,9 @@ function createSchemaCommand() {
15264
15518
  init_cjs_shims();
15265
15519
  var import_commander19 = require("commander");
15266
15520
  var import_promises7 = require("fs/promises");
15267
- var import_path14 = require("path");
15521
+ var import_path15 = require("path");
15268
15522
  var import_fs12 = require("fs");
15269
- var readline3 = __toESM(require("readline/promises"));
15523
+ var readline4 = __toESM(require("readline/promises"));
15270
15524
  var import_process = require("process");
15271
15525
 
15272
15526
  // src/types.ts
@@ -15632,8 +15886,8 @@ function getDefaultAuthor() {
15632
15886
  async function createExampleFiles(format, files, packageName) {
15633
15887
  const templates = EXAMPLE_TEMPLATES[format] || {};
15634
15888
  for (const file of files) {
15635
- const filePath = (0, import_path14.join)(process.cwd(), file);
15636
- const dirPath = (0, import_path14.join)(filePath, "..");
15889
+ const filePath = (0, import_path15.join)(process.cwd(), file);
15890
+ const dirPath = (0, import_path15.join)(filePath, "..");
15637
15891
  if (!(0, import_fs12.existsSync)(dirPath)) {
15638
15892
  await (0, import_promises7.mkdir)(dirPath, { recursive: true });
15639
15893
  }
@@ -15651,7 +15905,7 @@ Add your content here.
15651
15905
  }
15652
15906
  }
15653
15907
  async function createReadme(config) {
15654
- const readmePath = (0, import_path14.join)(process.cwd(), "README.md");
15908
+ const readmePath = (0, import_path15.join)(process.cwd(), "README.md");
15655
15909
  if ((0, import_fs12.existsSync)(readmePath)) {
15656
15910
  console.log(" Skipping README.md (already exists)");
15657
15911
  return;
@@ -15686,7 +15940,7 @@ ${config.license}
15686
15940
  console.log(" Created README.md");
15687
15941
  }
15688
15942
  async function initPackage(options) {
15689
- const manifestPath = (0, import_path14.join)(process.cwd(), "prpm.json");
15943
+ const manifestPath = (0, import_path15.join)(process.cwd(), "prpm.json");
15690
15944
  if ((0, import_fs12.existsSync)(manifestPath) && !options.force) {
15691
15945
  throw new Error(
15692
15946
  "prpm.json already exists. Use --force to overwrite, or run this command in a different directory."
@@ -15706,7 +15960,7 @@ async function initPackage(options) {
15706
15960
  (f) => f.replace(/example-skill/g, config.name || "example-skill")
15707
15961
  );
15708
15962
  } else {
15709
- const rl = readline3.createInterface({ input: import_process.stdin, output: import_process.stdout });
15963
+ const rl = readline4.createInterface({ input: import_process.stdin, output: import_process.stdout });
15710
15964
  try {
15711
15965
  console.log("\n\u{1F680} Welcome to PRPM package initialization!\n");
15712
15966
  console.log("This utility will walk you through creating a prpm.json file.\n");
@@ -15986,15 +16240,15 @@ function createConfigCommand() {
15986
16240
  init_cjs_shims();
15987
16241
  var import_commander21 = require("commander");
15988
16242
  var import_promises8 = require("fs/promises");
15989
- var import_path15 = require("path");
16243
+ var import_path16 = require("path");
15990
16244
  init_telemetry();
15991
16245
  init_lockfile();
15992
16246
  init_errors();
15993
16247
  function detectPackageInfo(filePath, content) {
15994
- const fileName = (0, import_path15.basename)(filePath);
16248
+ const fileName = (0, import_path16.basename)(filePath);
15995
16249
  const lowerFileName = fileName.toLowerCase();
15996
16250
  if (fileName === "SKILL.md") {
15997
- const dirName = (0, import_path15.basename)((0, import_path15.join)(filePath, ".."));
16251
+ const dirName = (0, import_path16.basename)((0, import_path16.join)(filePath, ".."));
15998
16252
  return {
15999
16253
  format: "claude",
16000
16254
  subtype: "skill",
@@ -16046,8 +16300,8 @@ async function scanDirectory2(dirPath, baseDir, scanDir, maxDepth = 5, currentDe
16046
16300
  try {
16047
16301
  const entries = await (0, import_promises8.readdir)(dirPath, { withFileTypes: true });
16048
16302
  for (const entry of entries) {
16049
- const fullPath = (0, import_path15.join)(dirPath, entry.name);
16050
- const relativePath = (0, import_path15.relative)(baseDir, fullPath);
16303
+ const fullPath = (0, import_path16.join)(dirPath, entry.name);
16304
+ const relativePath = (0, import_path16.relative)(baseDir, fullPath);
16051
16305
  if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === "build") {
16052
16306
  continue;
16053
16307
  }
@@ -16184,7 +16438,7 @@ async function handleCatalog(directories, options) {
16184
16438
  success = true;
16185
16439
  return;
16186
16440
  }
16187
- const prpmJsonPath = options.output || (0, import_path15.join)(process.cwd(), "prpm.json");
16441
+ const prpmJsonPath = options.output || (0, import_path16.join)(process.cwd(), "prpm.json");
16188
16442
  let manifest;
16189
16443
  if (options.append) {
16190
16444
  try {
@@ -16222,7 +16476,7 @@ async function handleCatalog(directories, options) {
16222
16476
  }
16223
16477
  let description = `${discovered.format} ${discovered.subtype}`;
16224
16478
  try {
16225
- const firstFilePath = (0, import_path15.join)(process.cwd(), discovered.scanDir, discovered.files[0]);
16479
+ const firstFilePath = (0, import_path16.join)(process.cwd(), discovered.scanDir, discovered.files[0]);
16226
16480
  const content = await (0, import_promises8.readFile)(firstFilePath, "utf-8");
16227
16481
  const extractedDesc = extractDescription2(content);
16228
16482
  if (extractedDesc) {
@@ -16286,12 +16540,12 @@ init_cjs_shims();
16286
16540
  var import_commander22 = require("commander");
16287
16541
  init_user_config();
16288
16542
  init_telemetry();
16289
- var readline4 = __toESM(require("readline"));
16543
+ var readline5 = __toESM(require("readline"));
16290
16544
  var fs10 = __toESM(require("fs"));
16291
16545
  var path7 = __toESM(require("path"));
16292
16546
  init_errors();
16293
16547
  function createReadline() {
16294
- return readline4.createInterface({
16548
+ return readline5.createInterface({
16295
16549
  input: process.stdin,
16296
16550
  output: process.stdout
16297
16551
  });
@@ -17433,7 +17687,7 @@ async function handleStarred(options) {
17433
17687
  for (const collection of collections) {
17434
17688
  const stars = `\u2B50 ${collection.stars || 0}`.padEnd(8);
17435
17689
  const packages2 = `\u{1F4E6} ${collection.package_count || 0} packages`;
17436
- console.log(` ${collection.scope}/${collection.name_slug}`);
17690
+ console.log(` ${collection.name_slug}`);
17437
17691
  console.log(` ${stars} ${packages2}`);
17438
17692
  if (collection.description) {
17439
17693
  const desc = collection.description.length > 80 ? collection.description.substring(0, 77) + "..." : collection.description;
@@ -17473,57 +17727,57 @@ function createStarredCommand() {
17473
17727
  init_cjs_shims();
17474
17728
  var import_commander27 = require("commander");
17475
17729
  var import_promises9 = require("fs/promises");
17476
- var import_path16 = require("path");
17730
+ var import_path17 = require("path");
17477
17731
  var import_fs13 = require("fs");
17478
17732
  var import_readline = require("readline");
17479
17733
  var import_chalk2 = __toESM(require_source());
17480
17734
  init_errors();
17481
17735
  init_dist();
17482
17736
  function getDefaultPath(format, filename, subtype, customName) {
17483
- const baseName = customName || (0, import_path16.basename)(filename, (0, import_path16.extname)(filename));
17737
+ const baseName = customName || (0, import_path17.basename)(filename, (0, import_path17.extname)(filename));
17484
17738
  switch (format) {
17485
17739
  case "cursor":
17486
17740
  if (subtype === "slash-command") {
17487
- return (0, import_path16.join)(process.cwd(), ".cursor", "commands", `${baseName}.md`);
17741
+ return (0, import_path17.join)(process.cwd(), ".cursor", "commands", `${baseName}.md`);
17488
17742
  }
17489
- return (0, import_path16.join)(process.cwd(), ".cursor", "rules", `${baseName}.mdc`);
17743
+ return (0, import_path17.join)(process.cwd(), ".cursor", "rules", `${baseName}.mdc`);
17490
17744
  case "claude":
17491
17745
  if (subtype === "skill") {
17492
- return (0, import_path16.join)(process.cwd(), ".claude", "skills", baseName, "SKILL.md");
17746
+ return (0, import_path17.join)(process.cwd(), ".claude", "skills", baseName, "SKILL.md");
17493
17747
  } else if (subtype === "slash-command") {
17494
- return (0, import_path16.join)(process.cwd(), ".claude", "commands", `${baseName}.md`);
17748
+ return (0, import_path17.join)(process.cwd(), ".claude", "commands", `${baseName}.md`);
17495
17749
  } else {
17496
- return (0, import_path16.join)(process.cwd(), ".claude", "agents", `${baseName}.md`);
17750
+ return (0, import_path17.join)(process.cwd(), ".claude", "agents", `${baseName}.md`);
17497
17751
  }
17498
17752
  case "windsurf":
17499
- return (0, import_path16.join)(process.cwd(), ".windsurf", "rules", `${baseName}.md`);
17753
+ return (0, import_path17.join)(process.cwd(), ".windsurf", "rules", `${baseName}.md`);
17500
17754
  case "kiro":
17501
17755
  if (subtype === "hook") {
17502
- return (0, import_path16.join)(process.cwd(), ".kiro", "hooks", `${baseName}.kiro.hook`);
17756
+ return (0, import_path17.join)(process.cwd(), ".kiro", "hooks", `${baseName}.kiro.hook`);
17503
17757
  }
17504
17758
  if (subtype === "agent") {
17505
- return (0, import_path16.join)(process.cwd(), ".kiro", "agents", `${baseName}.json`);
17759
+ return (0, import_path17.join)(process.cwd(), ".kiro", "agents", `${baseName}.json`);
17506
17760
  }
17507
- return (0, import_path16.join)(process.cwd(), ".kiro", "steering", `${baseName}.md`);
17761
+ return (0, import_path17.join)(process.cwd(), ".kiro", "steering", `${baseName}.md`);
17508
17762
  case "copilot":
17509
- return (0, import_path16.join)(process.cwd(), ".github", "instructions", `${baseName}.instructions.md`);
17763
+ return (0, import_path17.join)(process.cwd(), ".github", "instructions", `${baseName}.instructions.md`);
17510
17764
  case "continue":
17511
17765
  if (subtype === "slash-command" || subtype === "prompt") {
17512
- return (0, import_path16.join)(process.cwd(), ".continue", "prompts", `${baseName}.md`);
17766
+ return (0, import_path17.join)(process.cwd(), ".continue", "prompts", `${baseName}.md`);
17513
17767
  }
17514
- return (0, import_path16.join)(process.cwd(), ".continue", "rules", `${baseName}.md`);
17768
+ return (0, import_path17.join)(process.cwd(), ".continue", "rules", `${baseName}.md`);
17515
17769
  case "agents.md":
17516
- return (0, import_path16.join)(process.cwd(), "agents.md");
17770
+ return (0, import_path17.join)(process.cwd(), "agents.md");
17517
17771
  case "gemini":
17518
- return (0, import_path16.join)(process.cwd(), ".gemini", "commands", `${baseName}.toml`);
17772
+ return (0, import_path17.join)(process.cwd(), ".gemini", "commands", `${baseName}.toml`);
17519
17773
  case "ruler":
17520
- return (0, import_path16.join)(process.cwd(), ".ruler", `${baseName}.md`);
17774
+ return (0, import_path17.join)(process.cwd(), ".ruler", `${baseName}.md`);
17521
17775
  default:
17522
17776
  throw new CLIError(`Unknown format: ${format}`);
17523
17777
  }
17524
17778
  }
17525
17779
  function detectFormat(content, filepath) {
17526
- const ext = (0, import_path16.extname)(filepath).toLowerCase();
17780
+ const ext = (0, import_path17.extname)(filepath).toLowerCase();
17527
17781
  if (ext === ".mdc" || filepath.includes(".cursor/rules") || filepath.includes(".cursor/commands")) {
17528
17782
  return "cursor";
17529
17783
  }
@@ -17545,7 +17799,7 @@ function detectFormat(content, filepath) {
17545
17799
  if (filepath.includes(".continue/rules") || filepath.includes(".continue/prompts") || filepath.includes(".continuerules")) {
17546
17800
  return "continue";
17547
17801
  }
17548
- if ((0, import_path16.basename)(filepath) === "agents.md") {
17802
+ if ((0, import_path17.basename)(filepath) === "agents.md") {
17549
17803
  return "agents.md";
17550
17804
  }
17551
17805
  if (ext === ".toml" || filepath.includes(".gemini/commands")) {
@@ -17710,7 +17964,7 @@ async function handleConvert(sourcePath, options) {
17710
17964
  return;
17711
17965
  }
17712
17966
  }
17713
- const outputDir = (0, import_path16.dirname)(outputPath);
17967
+ const outputDir = (0, import_path17.dirname)(outputPath);
17714
17968
  await (0, import_promises9.mkdir)(outputDir, { recursive: true });
17715
17969
  console.log(import_chalk2.default.dim("Writing converted file..."));
17716
17970
  await (0, import_promises9.writeFile)(outputPath, result.content, "utf-8");
@@ -17777,7 +18031,7 @@ Valid subtypes: ${validSubtypes.join(", ")}`
17777
18031
  init_cjs_shims();
17778
18032
  var import_commander28 = require("commander");
17779
18033
  var import_fs14 = require("fs");
17780
- var import_path17 = require("path");
18034
+ var import_path18 = require("path");
17781
18035
  var import_chalk3 = __toESM(require_source());
17782
18036
  init_errors();
17783
18037
  init_lockfile();
@@ -17793,7 +18047,7 @@ async function exportToRuler(options) {
17793
18047
  }
17794
18048
  console.log(import_chalk3.default.green(`\u2713 Found ${packages.length} installed package${packages.length === 1 ? "" : "s"}`));
17795
18049
  console.log();
17796
- const outputDir = options.output || (0, import_path17.join)(process.cwd(), ".ruler");
18050
+ const outputDir = options.output || (0, import_path18.join)(process.cwd(), ".ruler");
17797
18051
  let rulerExists = false;
17798
18052
  try {
17799
18053
  await import_fs14.promises.access(outputDir);
@@ -17820,7 +18074,7 @@ async function exportToRuler(options) {
17820
18074
  const content = await import_fs14.promises.readFile(pkg.installedPath, "utf-8");
17821
18075
  const rulerContent = createRulerFormat(pkg.id, pkg.version, content, pkg.format, pkg.subtype);
17822
18076
  const rulerFilename = `${packageName}.md`;
17823
- const rulerPath = (0, import_path17.join)(outputDir, rulerFilename);
18077
+ const rulerPath = (0, import_path18.join)(outputDir, rulerFilename);
17824
18078
  await import_fs14.promises.writeFile(rulerPath, rulerContent, "utf-8");
17825
18079
  console.log(import_chalk3.default.green(`\u2713 Exported ${pkg.id} \u2192 ${rulerFilename}`));
17826
18080
  exportedCount++;
@@ -17860,7 +18114,7 @@ function createRulerFormat(packageId, version, content, format, subtype) {
17860
18114
  return frontmatter + contentWithoutFrontmatter;
17861
18115
  }
17862
18116
  async function ensureRulerConfig(rulerDir) {
17863
- const configPath = (0, import_path17.join)((0, import_path17.dirname)(rulerDir), "ruler.toml");
18117
+ const configPath = (0, import_path18.join)((0, import_path18.dirname)(rulerDir), "ruler.toml");
17864
18118
  try {
17865
18119
  await import_fs14.promises.access(configPath);
17866
18120
  console.log(import_chalk3.default.dim("\u2139 ruler.toml already exists (not modified)"));
@@ -17958,7 +18212,7 @@ init_telemetry();
17958
18212
  init_errors();
17959
18213
  function getVersion() {
17960
18214
  try {
17961
- const packageJsonPath = (0, import_path18.join)(__dirname, "../package.json");
18215
+ const packageJsonPath = (0, import_path19.join)(__dirname, "../package.json");
17962
18216
  const packageJson = JSON.parse((0, import_fs15.readFileSync)(packageJsonPath, "utf-8"));
17963
18217
  return packageJson.version || "0.0.0";
17964
18218
  } catch {