prpm 1.1.9 → 1.1.11

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(),
@@ -514,6 +542,7 @@ function getDestinationDir2(format, subtype, name) {
514
542
  case "agents.md":
515
543
  case "gemini.md":
516
544
  case "claude.md":
545
+ case "aider":
517
546
  if (subtype === "skill" && packageName) {
518
547
  return `.openskills/${packageName}`;
519
548
  }
@@ -525,6 +554,12 @@ function getDestinationDir2(format, subtype, name) {
525
554
  return ".prompts";
526
555
  case "mcp":
527
556
  return ".mcp/tools";
557
+ case "trae":
558
+ return ".trae/rules";
559
+ case "zencoder":
560
+ return ".zencoder/rules";
561
+ case "replit":
562
+ return ".";
528
563
  default:
529
564
  throw new Error(`Unknown format: ${format}`);
530
565
  }
@@ -569,6 +604,8 @@ function getManifestFilename(format) {
569
604
  return "GEMINI.md";
570
605
  case "claude.md":
571
606
  return "CLAUDE.md";
607
+ case "aider":
608
+ return "CONVENTIONS.md";
572
609
  default:
573
610
  return "AGENTS.md";
574
611
  }
@@ -583,6 +620,12 @@ async function autoDetectFormat() {
583
620
  if (await fileExists("AGENTS.md")) {
584
621
  return "agents.md";
585
622
  }
623
+ if (await fileExists("CONVENTIONS.md")) {
624
+ return "aider";
625
+ }
626
+ if (await fileExists("replit.md")) {
627
+ return "replit";
628
+ }
586
629
  const formatDirs = [
587
630
  { format: "cursor", dir: ".cursor" },
588
631
  { format: "claude", dir: ".claude" },
@@ -593,6 +636,8 @@ async function autoDetectFormat() {
593
636
  { format: "gemini", dir: ".gemini" },
594
637
  { format: "opencode", dir: ".opencode" },
595
638
  { format: "droid", dir: ".factory" },
639
+ { format: "trae", dir: ".trae" },
640
+ { format: "zencoder", dir: ".zencoder" },
596
641
  { format: "agents.md", dir: ".agents" }
597
642
  ];
598
643
  for (const { format, dir } of formatDirs) {
@@ -623,6 +668,16 @@ var init_filesystem = __esm({
623
668
  }
624
669
  });
625
670
 
671
+ // src/types.ts
672
+ var import_types;
673
+ var init_types = __esm({
674
+ "src/types.ts"() {
675
+ "use strict";
676
+ init_cjs_shims();
677
+ import_types = require("@pr-pm/types");
678
+ }
679
+ });
680
+
626
681
  // src/core/agents-md-progressive.ts
627
682
  function generateSkillXML(entry) {
628
683
  const resourceType = entry.resourceType || "skill";
@@ -2424,7 +2479,7 @@ async function promptYesNo(question, nonInteractiveWarning) {
2424
2479
  }
2425
2480
  return false;
2426
2481
  }
2427
- const rl = readline2.createInterface({
2482
+ const rl = readline3.createInterface({
2428
2483
  input: process.stdin,
2429
2484
  output: process.stdout
2430
2485
  });
@@ -2435,12 +2490,12 @@ async function promptYesNo(question, nonInteractiveWarning) {
2435
2490
  rl.close();
2436
2491
  }
2437
2492
  }
2438
- var readline2;
2493
+ var readline3;
2439
2494
  var init_prompts = __esm({
2440
2495
  "src/core/prompts.ts"() {
2441
2496
  "use strict";
2442
2497
  init_cjs_shims();
2443
- readline2 = __toESM(require("readline/promises"));
2498
+ readline3 = __toESM(require("readline/promises"));
2444
2499
  }
2445
2500
  });
2446
2501
 
@@ -2557,7 +2612,6 @@ async function handleCollectionsList(options) {
2557
2612
  category: options.category,
2558
2613
  tag: options.tag,
2559
2614
  official: options.official,
2560
- scope: options.scope,
2561
2615
  limit: 500
2562
2616
  // Increased limit to show more collections
2563
2617
  });
@@ -2644,25 +2698,19 @@ async function handleCollectionsList(options) {
2644
2698
  async function handleCollectionInfo(collectionSpec) {
2645
2699
  const startTime = Date.now();
2646
2700
  try {
2647
- let scope;
2648
2701
  let name_slug;
2649
2702
  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";
2703
+ const cleanSpec = collectionSpec.replace(/^collections\//, "");
2704
+ const match = cleanSpec.match(/^([^@]+)(?:@(.+))?$/);
2705
+ if (!match) {
2706
+ throw new Error("Invalid collection format. Use: name or name@version");
2660
2707
  }
2708
+ [, name_slug, version] = match;
2661
2709
  const config = await getConfig();
2662
2710
  const client = (0, import_registry_client4.getRegistryClient)(config);
2663
- console.log(`\u{1F4E6} Loading collection: ${scope === "collection" ? name_slug : `@${scope}/${name_slug}`}...
2711
+ console.log(`\u{1F4E6} Loading collection: ${name_slug}...
2664
2712
  `);
2665
- const collection = await client.getCollection(scope, name_slug, version);
2713
+ const collection = await client.getCollection(name_slug, version);
2666
2714
  console.log(`${collection.icon || "\u{1F4E6}"} ${collection.name}`);
2667
2715
  console.log(`${"=".repeat(collection.name.length + 2)}`);
2668
2716
  console.log("");
@@ -2716,16 +2764,9 @@ async function handleCollectionInfo(collectionSpec) {
2716
2764
  });
2717
2765
  }
2718
2766
  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
- }
2767
+ console.log(` prpm install ${name_slug}`);
2768
+ if (optionalPkgs.length > 0) {
2769
+ console.log(` prpm install ${name_slug} --skip-optional # Skip optional packages`);
2729
2770
  }
2730
2771
  console.log("");
2731
2772
  await telemetry.track({
@@ -2733,7 +2774,6 @@ async function handleCollectionInfo(collectionSpec) {
2733
2774
  success: true,
2734
2775
  duration: Date.now() - startTime,
2735
2776
  data: {
2736
- scope,
2737
2777
  name_slug,
2738
2778
  packageCount: collection.packages.length
2739
2779
  }
@@ -2810,12 +2850,11 @@ async function handleCollectionPublish(manifestPath = "./collection.json") {
2810
2850
  icon: manifest.icon
2811
2851
  });
2812
2852
  console.log(`\u2705 Collection published successfully!`);
2813
- console.log(` Scope: ${result.scope}`);
2814
2853
  console.log(` Name: ${result.name_slug}`);
2815
2854
  console.log(` Version: ${result.version || "1.0.0"}`);
2816
2855
  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}`);
2856
+ console.log(`\u{1F4A1} View: prpm collection info ${result.name_slug}`);
2857
+ console.log(`\u{1F4A1} Install: prpm install ${result.name_slug}`);
2819
2858
  console.log("");
2820
2859
  await telemetry.track({
2821
2860
  command: "collections:publish",
@@ -2848,26 +2887,19 @@ async function handleCollectionInstall(collectionSpec, options) {
2848
2887
  let packagesInstalled = 0;
2849
2888
  let packagesFailed = 0;
2850
2889
  try {
2851
- let scope;
2852
2890
  let name_slug;
2853
2891
  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";
2892
+ const cleanSpec = collectionSpec.replace(/^collections\//, "");
2893
+ const match = cleanSpec.match(/^([^@]+)(?:@(.+))?$/);
2894
+ if (!match) {
2895
+ throw new Error("Invalid collection format. Use: name or name@version");
2864
2896
  }
2897
+ [, name_slug, version] = match;
2865
2898
  const config = await getConfig();
2866
2899
  const client = (0, import_registry_client4.getRegistryClient)(config);
2867
- console.log(`\u{1F4E6} Installing collection: ${scope === "collection" ? name_slug : `@${scope}/${name_slug}`}...
2900
+ console.log(`\u{1F4E6} Installing collection: ${name_slug}...
2868
2901
  `);
2869
2902
  const installResult = await client.installCollection({
2870
- scope,
2871
2903
  id: name_slug,
2872
2904
  version,
2873
2905
  format: options.format,
@@ -2897,7 +2929,6 @@ async function handleCollectionInstall(collectionSpec, options) {
2897
2929
  ${progress} Installing ${pkg.packageId}@${pkg.version}...`);
2898
2930
  const installOptions = {
2899
2931
  fromCollection: {
2900
- scope,
2901
2932
  name_slug,
2902
2933
  version: collection.version || version || "1.0.0"
2903
2934
  }
@@ -2922,9 +2953,8 @@ async function handleCollectionInstall(collectionSpec, options) {
2922
2953
  }
2923
2954
  }
2924
2955
  const lockfile = await readLockfile() || createLockfile();
2925
- const collectionKey = `@${scope}/${name_slug}`;
2956
+ const collectionKey = name_slug;
2926
2957
  addCollectionToLockfile(lockfile, collectionKey, {
2927
- scope,
2928
2958
  name_slug,
2929
2959
  version: collection.version || version || "1.0.0",
2930
2960
  packages: installedPackageIds
@@ -2948,7 +2978,6 @@ async function handleCollectionInstall(collectionSpec, options) {
2948
2978
  success: true,
2949
2979
  duration: Date.now() - startTime,
2950
2980
  data: {
2951
- scope,
2952
2981
  name_slug,
2953
2982
  packageCount: packages.length,
2954
2983
  installed: packagesInstalled,
@@ -9367,6 +9396,43 @@ var init_from_droid = __esm({
9367
9396
  }
9368
9397
  });
9369
9398
 
9399
+ // ../converters/dist/from-trae.js
9400
+ var init_from_trae = __esm({
9401
+ "../converters/dist/from-trae.js"() {
9402
+ "use strict";
9403
+ init_cjs_shims();
9404
+ init_taxonomy_utils();
9405
+ }
9406
+ });
9407
+
9408
+ // ../converters/dist/from-aider.js
9409
+ var init_from_aider = __esm({
9410
+ "../converters/dist/from-aider.js"() {
9411
+ "use strict";
9412
+ init_cjs_shims();
9413
+ init_taxonomy_utils();
9414
+ }
9415
+ });
9416
+
9417
+ // ../converters/dist/from-zencoder.js
9418
+ var init_from_zencoder = __esm({
9419
+ "../converters/dist/from-zencoder.js"() {
9420
+ "use strict";
9421
+ init_cjs_shims();
9422
+ init_js_yaml();
9423
+ init_taxonomy_utils();
9424
+ }
9425
+ });
9426
+
9427
+ // ../converters/dist/from-replit.js
9428
+ var init_from_replit = __esm({
9429
+ "../converters/dist/from-replit.js"() {
9430
+ "use strict";
9431
+ init_cjs_shims();
9432
+ init_taxonomy_utils();
9433
+ }
9434
+ });
9435
+
9370
9436
  // ../converters/dist/validation.js
9371
9437
  function loadSchema(format, subtype) {
9372
9438
  const cacheKey = subtype ? `${format}:${subtype}` : format;
@@ -9403,6 +9469,10 @@ function loadSchema(format, subtype) {
9403
9469
  "opencode": "opencode.schema.json",
9404
9470
  "ruler": "ruler.schema.json",
9405
9471
  "droid": "droid.schema.json",
9472
+ "trae": "trae.schema.json",
9473
+ "aider": "aider.schema.json",
9474
+ "zencoder": "zencoder.schema.json",
9475
+ "replit": "replit.schema.json",
9406
9476
  "canonical": "canonical.schema.json"
9407
9477
  };
9408
9478
  schemaFilename = schemaMap[format] || `${format}.schema.json`;
@@ -11121,6 +11191,149 @@ var init_to_gemini = __esm({
11121
11191
  });
11122
11192
 
11123
11193
  // ../converters/dist/to-opencode.js
11194
+ function toOpencode(pkg) {
11195
+ const warnings = [];
11196
+ let qualityScore = 100;
11197
+ try {
11198
+ const content = convertContent6(pkg, warnings);
11199
+ const lossyConversion = warnings.some((w) => w.includes("not supported") || w.includes("skipped"));
11200
+ if (lossyConversion) {
11201
+ qualityScore -= 10;
11202
+ }
11203
+ return {
11204
+ content,
11205
+ format: "opencode",
11206
+ warnings: warnings.length > 0 ? warnings : void 0,
11207
+ lossyConversion,
11208
+ qualityScore
11209
+ };
11210
+ } catch (error) {
11211
+ warnings.push(`Conversion error: ${error instanceof Error ? error.message : String(error)}`);
11212
+ return {
11213
+ content: "",
11214
+ format: "opencode",
11215
+ warnings,
11216
+ lossyConversion: true,
11217
+ qualityScore: 0
11218
+ };
11219
+ }
11220
+ }
11221
+ function convertContent6(pkg, warnings) {
11222
+ const lines = [];
11223
+ const metadata = pkg.content.sections.find((s) => s.type === "metadata");
11224
+ const tools = pkg.content.sections.find((s) => s.type === "tools");
11225
+ const instructions = pkg.content.sections.find((s) => s.type === "instructions");
11226
+ const frontmatter = {};
11227
+ if (pkg.subtype === "slash-command") {
11228
+ const opencodeSlashCommand = (metadata == null ? void 0 : metadata.type) === "metadata" ? metadata.data.opencodeSlashCommand : void 0;
11229
+ if (opencodeSlashCommand == null ? void 0 : opencodeSlashCommand.template) {
11230
+ frontmatter.template = opencodeSlashCommand.template;
11231
+ } else if ((instructions == null ? void 0 : instructions.type) === "instructions") {
11232
+ frontmatter.template = instructions.content;
11233
+ warnings.push("No template field found, using instructions content as template");
11234
+ } else {
11235
+ frontmatter.template = "Execute the following task: {{args}}";
11236
+ warnings.push("REQUIRED template field missing for slash command, using default placeholder");
11237
+ }
11238
+ if (opencodeSlashCommand) {
11239
+ if (opencodeSlashCommand.description)
11240
+ frontmatter.description = opencodeSlashCommand.description;
11241
+ if (opencodeSlashCommand.agent)
11242
+ frontmatter.agent = opencodeSlashCommand.agent;
11243
+ if (opencodeSlashCommand.model)
11244
+ frontmatter.model = opencodeSlashCommand.model;
11245
+ if (opencodeSlashCommand.subtask !== void 0)
11246
+ frontmatter.subtask = opencodeSlashCommand.subtask;
11247
+ } else if ((metadata == null ? void 0 : metadata.type) === "metadata" && metadata.data.description) {
11248
+ frontmatter.description = metadata.data.description;
11249
+ }
11250
+ } else {
11251
+ if ((metadata == null ? void 0 : metadata.type) === "metadata") {
11252
+ frontmatter.description = metadata.data.description;
11253
+ }
11254
+ const opencodeData = (metadata == null ? void 0 : metadata.type) === "metadata" ? metadata.data.opencode : void 0;
11255
+ if (opencodeData) {
11256
+ if (opencodeData.mode) {
11257
+ frontmatter.mode = opencodeData.mode;
11258
+ } else {
11259
+ frontmatter.mode = "all";
11260
+ warnings.push('REQUIRED mode field missing, defaulting to "all"');
11261
+ }
11262
+ if (opencodeData.model)
11263
+ frontmatter.model = opencodeData.model;
11264
+ if (opencodeData.temperature !== void 0)
11265
+ frontmatter.temperature = opencodeData.temperature;
11266
+ if (opencodeData.permission)
11267
+ frontmatter.permission = opencodeData.permission;
11268
+ if (opencodeData.disable !== void 0)
11269
+ frontmatter.disable = opencodeData.disable;
11270
+ } else {
11271
+ frontmatter.mode = "all";
11272
+ warnings.push('REQUIRED mode field missing, defaulting to "all"');
11273
+ }
11274
+ if ((tools == null ? void 0 : tools.type) === "tools" && tools.tools.length > 0) {
11275
+ const toolsObj = {};
11276
+ const toolMap = {
11277
+ "Write": "write",
11278
+ "Edit": "edit",
11279
+ "Bash": "bash",
11280
+ "Read": "read",
11281
+ "Grep": "grep",
11282
+ "Glob": "glob",
11283
+ "WebFetch": "webfetch",
11284
+ "WebSearch": "websearch"
11285
+ };
11286
+ for (const tool of tools.tools) {
11287
+ const opencodeToolName = toolMap[tool] || tool.toLowerCase();
11288
+ toolsObj[opencodeToolName] = true;
11289
+ }
11290
+ frontmatter.tools = toolsObj;
11291
+ }
11292
+ }
11293
+ lines.push("---");
11294
+ lines.push(jsYaml.dump(frontmatter, { indent: 2, lineWidth: -1 }).trim());
11295
+ lines.push("---");
11296
+ lines.push("");
11297
+ if ((instructions == null ? void 0 : instructions.type) === "instructions") {
11298
+ lines.push(instructions.content);
11299
+ } else {
11300
+ const contentSections = pkg.content.sections.filter((s) => s.type !== "metadata" && s.type !== "tools");
11301
+ for (const section of contentSections) {
11302
+ if (section.type === "persona") {
11303
+ if (section.data.role) {
11304
+ lines.push(`You are a ${section.data.role}.`);
11305
+ lines.push("");
11306
+ }
11307
+ } else if (section.type === "instructions") {
11308
+ lines.push(section.content);
11309
+ lines.push("");
11310
+ } else if (section.type === "rules") {
11311
+ lines.push("## Rules");
11312
+ lines.push("");
11313
+ for (const rule of section.items) {
11314
+ lines.push(`- ${rule.content}`);
11315
+ }
11316
+ lines.push("");
11317
+ } else if (section.type === "examples") {
11318
+ lines.push("## Examples");
11319
+ lines.push("");
11320
+ for (const example of section.examples) {
11321
+ if (example.description) {
11322
+ lines.push(`### ${example.description}`);
11323
+ lines.push("");
11324
+ }
11325
+ lines.push("```");
11326
+ lines.push(example.code);
11327
+ lines.push("```");
11328
+ lines.push("");
11329
+ }
11330
+ } else {
11331
+ warnings.push(`Section type '${section.type}' may not be fully supported in OpenCode format`);
11332
+ }
11333
+ }
11334
+ }
11335
+ return lines.join("\n").trim() + "\n";
11336
+ }
11124
11337
  var init_to_opencode = __esm({
11125
11338
  "../converters/dist/to-opencode.js"() {
11126
11339
  "use strict";
@@ -11150,7 +11363,7 @@ function toRuler(pkg, options = {}) {
11150
11363
  warnings.push("Hooks are not supported by Ruler");
11151
11364
  qualityScore -= 20;
11152
11365
  }
11153
- const content = convertContent6(pkg.content, warnings);
11366
+ const content = convertContent7(pkg.content, warnings);
11154
11367
  const header = `<!-- Package: ${pkg.name} -->
11155
11368
  <!-- Author: ${pkg.author || "Unknown"} -->
11156
11369
  ${pkg.description ? `<!-- Description: ${pkg.description} -->
@@ -11186,7 +11399,7 @@ ${content}`;
11186
11399
  };
11187
11400
  }
11188
11401
  }
11189
- function convertContent6(content, warnings) {
11402
+ function convertContent7(content, warnings) {
11190
11403
  const parts = [];
11191
11404
  const metadataSection = content.sections.find((s) => s.type === "metadata");
11192
11405
  if (metadataSection) {
@@ -11290,102 +11503,828 @@ var init_to_ruler = __esm({
11290
11503
  });
11291
11504
 
11292
11505
  // ../converters/dist/to-droid.js
11293
- var init_to_droid = __esm({
11294
- "../converters/dist/to-droid.js"() {
11295
- "use strict";
11296
- init_cjs_shims();
11297
- init_js_yaml();
11506
+ function toDroid(pkg) {
11507
+ const warnings = [];
11508
+ let qualityScore = 100;
11509
+ try {
11510
+ const result = convertContent8(pkg, warnings, qualityScore);
11511
+ const content = result.content;
11512
+ qualityScore = result.qualityScore;
11513
+ const lossyConversion = warnings.some((w) => w.includes("not supported") || w.includes("skipped"));
11514
+ if (lossyConversion) {
11515
+ qualityScore -= 10;
11516
+ }
11517
+ return {
11518
+ content,
11519
+ format: "droid",
11520
+ warnings: warnings.length > 0 ? warnings : void 0,
11521
+ lossyConversion,
11522
+ qualityScore
11523
+ };
11524
+ } catch (error) {
11525
+ warnings.push(`Conversion error: ${error instanceof Error ? error.message : String(error)}`);
11526
+ return {
11527
+ content: "",
11528
+ format: "droid",
11529
+ warnings,
11530
+ lossyConversion: true,
11531
+ qualityScore: 0
11532
+ };
11298
11533
  }
11299
- });
11534
+ }
11535
+ function convertContent8(pkg, warnings, qualityScore) {
11536
+ var _a;
11537
+ const lines = [];
11538
+ const metadata = pkg.content.sections.find((s) => s.type === "metadata");
11539
+ const instructions = pkg.content.sections.find((s) => s.type === "instructions");
11540
+ const rules = pkg.content.sections.find((s) => s.type === "rules");
11541
+ const examples = pkg.content.sections.find((s) => s.type === "examples");
11542
+ const persona = pkg.content.sections.find((s) => s.type === "persona");
11543
+ const frontmatter = {};
11544
+ if ((metadata == null ? void 0 : metadata.type) === "metadata") {
11545
+ frontmatter.name = metadata.data.title || pkg.name;
11546
+ frontmatter.description = metadata.data.description || pkg.description;
11547
+ const droidData = metadata.data.droid;
11548
+ if (droidData) {
11549
+ if (droidData.argumentHint) {
11550
+ frontmatter["argument-hint"] = droidData.argumentHint;
11551
+ }
11552
+ if (droidData.allowedTools && droidData.allowedTools.length > 0) {
11553
+ frontmatter["allowed-tools"] = droidData.allowedTools;
11554
+ }
11555
+ }
11556
+ } else {
11557
+ frontmatter.name = pkg.name;
11558
+ frontmatter.description = pkg.description;
11559
+ }
11560
+ if ((_a = pkg.metadata) == null ? void 0 : _a.droid) {
11561
+ if (pkg.metadata.droid.argumentHint && !frontmatter["argument-hint"]) {
11562
+ frontmatter["argument-hint"] = pkg.metadata.droid.argumentHint;
11563
+ }
11564
+ if (pkg.metadata.droid.allowedTools && pkg.metadata.droid.allowedTools.length > 0 && !frontmatter["allowed-tools"]) {
11565
+ frontmatter["allowed-tools"] = pkg.metadata.droid.allowedTools;
11566
+ }
11567
+ }
11568
+ lines.push("---");
11569
+ lines.push(jsYaml.dump(frontmatter, { indent: 2, lineWidth: -1 }).trim());
11570
+ lines.push("---");
11571
+ lines.push("");
11572
+ const bodyParts = [];
11573
+ if ((persona == null ? void 0 : persona.type) === "persona") {
11574
+ bodyParts.push(`# Role
11300
11575
 
11301
- // ../converters/dist/schema-files.js
11302
- var import_module, import_path9, schemaRequire, convertersPackagePath, convertersDir, loadSchema2, agentsMdSchema, canonicalSchema, claudeSchema, continueSchema, copilotSchema, cursorSchema, droidSchema, geminiMdSchema, geminiSchema, kiroSteeringSchema, opencodeSchema, rulerSchema, windsurfSchema, claudeAgentSchema, claudeHookSchema, claudeSkillSchema, claudeSlashCommandSchema, cursorCommandSchema, droidHookSchema, droidSkillSchema, droidSlashCommandSchema, kiroAgentSchema, kiroHookSchema, opencodeSlashCommandSchema;
11303
- var init_schema_files = __esm({
11304
- "../converters/dist/schema-files.js"() {
11305
- "use strict";
11306
- init_cjs_shims();
11307
- import_module = require("module");
11308
- import_path9 = require("path");
11309
- schemaRequire = typeof require !== "undefined" ? require : (0, import_module.createRequire)(process.cwd() + "/");
11310
- convertersPackagePath = schemaRequire.resolve("@pr-pm/converters/package.json");
11311
- convertersDir = (0, import_path9.dirname)(convertersPackagePath);
11312
- loadSchema2 = (filename) => schemaRequire((0, import_path9.join)(convertersDir, "schemas", filename));
11313
- agentsMdSchema = loadSchema2("agents-md.schema.json");
11314
- canonicalSchema = loadSchema2("canonical.schema.json");
11315
- claudeSchema = loadSchema2("claude.schema.json");
11316
- continueSchema = loadSchema2("continue.schema.json");
11317
- copilotSchema = loadSchema2("copilot.schema.json");
11318
- cursorSchema = loadSchema2("cursor.schema.json");
11319
- droidSchema = loadSchema2("droid.schema.json");
11320
- geminiMdSchema = loadSchema2("gemini-md.schema.json");
11321
- geminiSchema = loadSchema2("gemini.schema.json");
11322
- kiroSteeringSchema = loadSchema2("kiro-steering.schema.json");
11323
- opencodeSchema = loadSchema2("opencode.schema.json");
11324
- rulerSchema = loadSchema2("ruler.schema.json");
11325
- windsurfSchema = loadSchema2("windsurf.schema.json");
11326
- claudeAgentSchema = loadSchema2("claude-agent.schema.json");
11327
- claudeHookSchema = loadSchema2("claude-hook.schema.json");
11328
- claudeSkillSchema = loadSchema2("claude-skill.schema.json");
11329
- claudeSlashCommandSchema = loadSchema2("claude-slash-command.schema.json");
11330
- cursorCommandSchema = loadSchema2("cursor-command.schema.json");
11331
- droidHookSchema = loadSchema2("droid-hook.schema.json");
11332
- droidSkillSchema = loadSchema2("droid-skill.schema.json");
11333
- droidSlashCommandSchema = loadSchema2("droid-slash-command.schema.json");
11334
- kiroAgentSchema = loadSchema2("kiro-agent.schema.json");
11335
- kiroHookSchema = loadSchema2("kiro-hook.schema.json");
11336
- opencodeSlashCommandSchema = loadSchema2("opencode-slash-command.schema.json");
11576
+ ${persona.data.role}`);
11577
+ warnings.push("Persona section converted to Role heading");
11578
+ }
11579
+ if ((instructions == null ? void 0 : instructions.type) === "instructions") {
11580
+ bodyParts.push(instructions.content);
11581
+ }
11582
+ if ((rules == null ? void 0 : rules.type) === "rules") {
11583
+ const rulesHeader = `## ${rules.title || "Rules"}`;
11584
+ const rulesList = rules.items.map((rule, idx) => {
11585
+ const prefix = rules.ordered ? `${idx + 1}. ` : "- ";
11586
+ return `${prefix}${rule.content}`;
11587
+ }).join("\n");
11588
+ bodyParts.push(`${rulesHeader}
11589
+
11590
+ ${rulesList}`);
11337
11591
  }
11338
- });
11592
+ if ((examples == null ? void 0 : examples.type) === "examples") {
11593
+ const examplesHeader = `## ${examples.title || "Examples"}`;
11594
+ const examplesList = examples.examples.map((example) => {
11595
+ let exampleText = `### ${example.description}
11339
11596
 
11340
- // ../converters/dist/index.js
11341
- var init_dist = __esm({
11342
- "../converters/dist/index.js"() {
11597
+ `;
11598
+ if (example.language) {
11599
+ exampleText += `\`\`\`${example.language}
11600
+ ${example.code}
11601
+ \`\`\``;
11602
+ } else {
11603
+ exampleText += `\`\`\`
11604
+ ${example.code}
11605
+ \`\`\``;
11606
+ }
11607
+ return exampleText;
11608
+ }).join("\n\n");
11609
+ bodyParts.push(`${examplesHeader}
11610
+
11611
+ ${examplesList}`);
11612
+ }
11613
+ const supportedTypes = ["metadata", "instructions", "rules", "examples", "persona"];
11614
+ const unsupportedSections = pkg.content.sections.filter((s) => !supportedTypes.includes(s.type));
11615
+ if (unsupportedSections.length > 0) {
11616
+ const types2 = unsupportedSections.map((s) => s.type).join(", ");
11617
+ warnings.push(`Factory Droid does not support these section types: ${types2}. They were skipped.`);
11618
+ qualityScore -= unsupportedSections.length * 5;
11619
+ }
11620
+ lines.push(bodyParts.join("\n\n"));
11621
+ return {
11622
+ content: lines.join("\n").trim() + "\n",
11623
+ qualityScore
11624
+ };
11625
+ }
11626
+ var init_to_droid = __esm({
11627
+ "../converters/dist/to-droid.js"() {
11343
11628
  "use strict";
11344
11629
  init_cjs_shims();
11345
- init_canonical();
11346
- init_from_cursor();
11347
- init_from_claude();
11348
- init_from_continue();
11349
- init_from_copilot();
11350
- init_from_kiro();
11351
- init_from_kiro_agent();
11352
- init_from_windsurf();
11353
- init_from_agents_md();
11354
- init_from_gemini();
11355
- init_from_opencode();
11356
- init_from_ruler();
11357
- init_from_droid();
11358
- init_to_cursor();
11359
- init_to_claude();
11360
- init_to_continue();
11361
- init_to_copilot();
11362
- init_to_kiro();
11363
- init_to_kiro_agent();
11364
- init_to_windsurf();
11365
- init_to_agents_md();
11366
- init_to_gemini();
11367
- init_to_opencode();
11368
- init_to_ruler();
11369
- init_to_droid();
11370
- init_taxonomy_utils();
11371
- init_validation();
11372
- init_schema_files();
11630
+ init_js_yaml();
11373
11631
  }
11374
11632
  });
11375
11633
 
11376
- // src/commands/install.ts
11377
- function getPackageIcon2(format, subtype) {
11378
- const subtypeIcons = {
11379
- "skill": "\u{1F393}",
11380
- "agent": "\u{1F916}",
11381
- "slash-command": "\u26A1",
11382
- "rule": "\u{1F4CB}",
11383
- "prompt": "\u{1F4AC}",
11384
- "collection": "\u{1F4E6}",
11385
- "chatmode": "\u{1F4AC}",
11386
- "tool": "\u{1F527}",
11387
- "hook": "\u{1FA9D}",
11388
- "workflow": "\u{1F504}",
11634
+ // ../converters/dist/to-trae.js
11635
+ function toTrae(pkg, options = {}) {
11636
+ const warnings = [];
11637
+ let qualityScore = 100;
11638
+ try {
11639
+ const content = convertContent9(pkg, warnings);
11640
+ const lossyConversion = warnings.some((w) => w.includes("not supported") || w.includes("skipped"));
11641
+ if (lossyConversion) {
11642
+ qualityScore -= 10;
11643
+ }
11644
+ return {
11645
+ content,
11646
+ format: "trae",
11647
+ warnings: warnings.length > 0 ? warnings : void 0,
11648
+ lossyConversion,
11649
+ qualityScore
11650
+ };
11651
+ } catch (error) {
11652
+ warnings.push(`Conversion error: ${error instanceof Error ? error.message : String(error)}`);
11653
+ return {
11654
+ content: "",
11655
+ format: "trae",
11656
+ warnings,
11657
+ lossyConversion: true,
11658
+ qualityScore: 0
11659
+ };
11660
+ }
11661
+ }
11662
+ function convertContent9(pkg, warnings) {
11663
+ var _a, _b, _c;
11664
+ const lines = [];
11665
+ const title = ((_a = pkg.metadata) == null ? void 0 : _a.title) || pkg.name;
11666
+ lines.push(`# ${title}`);
11667
+ lines.push("");
11668
+ if (pkg.description || ((_b = pkg.metadata) == null ? void 0 : _b.description)) {
11669
+ lines.push(pkg.description || ((_c = pkg.metadata) == null ? void 0 : _c.description) || "");
11670
+ lines.push("");
11671
+ }
11672
+ for (const section of pkg.content.sections) {
11673
+ if (section.type === "metadata" || section.type === "tools" || section.type === "persona") {
11674
+ if (section.type === "persona") {
11675
+ warnings.push("Persona section skipped (not supported by Trae)");
11676
+ } else if (section.type === "tools") {
11677
+ warnings.push("Tools section skipped (not supported by Trae)");
11678
+ }
11679
+ continue;
11680
+ }
11681
+ const sectionContent = convertSection8(section, warnings);
11682
+ if (sectionContent) {
11683
+ lines.push(sectionContent);
11684
+ lines.push("");
11685
+ }
11686
+ }
11687
+ return lines.join("\n").trim();
11688
+ }
11689
+ function convertSection8(section, warnings) {
11690
+ switch (section.type) {
11691
+ case "instructions":
11692
+ return convertInstructions8(section);
11693
+ case "rules":
11694
+ return convertRules8(section);
11695
+ case "examples":
11696
+ return convertExamples8(section);
11697
+ case "context":
11698
+ return convertContext8(section);
11699
+ case "custom":
11700
+ if (!section.editorType) {
11701
+ return section.content;
11702
+ }
11703
+ warnings.push(`Custom ${section.editorType} section skipped`);
11704
+ return "";
11705
+ default:
11706
+ return "";
11707
+ }
11708
+ }
11709
+ function convertInstructions8(section) {
11710
+ const lines = [];
11711
+ lines.push(`## ${section.title}`);
11712
+ lines.push("");
11713
+ lines.push(section.content);
11714
+ return lines.join("\n");
11715
+ }
11716
+ function convertRules8(section) {
11717
+ const lines = [];
11718
+ lines.push(`## ${section.title}`);
11719
+ lines.push("");
11720
+ section.items.forEach((rule, index) => {
11721
+ const prefix = section.ordered ? `${index + 1}.` : "-";
11722
+ lines.push(`${prefix} ${rule.content}`);
11723
+ if (rule.rationale) {
11724
+ lines.push(` - Rationale: ${rule.rationale}`);
11725
+ }
11726
+ if (rule.examples && rule.examples.length > 0) {
11727
+ rule.examples.forEach((example) => {
11728
+ lines.push(` - Example: \`${example}\``);
11729
+ });
11730
+ }
11731
+ });
11732
+ return lines.join("\n");
11733
+ }
11734
+ function convertExamples8(section) {
11735
+ const lines = [];
11736
+ lines.push(`## ${section.title}`);
11737
+ lines.push("");
11738
+ section.examples.forEach((example) => {
11739
+ if (example.good === false) {
11740
+ lines.push(`### \u274C Avoid: ${example.description}`);
11741
+ } else if (example.good === true) {
11742
+ lines.push(`### \u2705 Preferred: ${example.description}`);
11743
+ } else {
11744
+ lines.push(`### ${example.description}`);
11745
+ }
11746
+ lines.push("");
11747
+ const lang = example.language || "";
11748
+ lines.push("```" + lang);
11749
+ lines.push(example.code);
11750
+ lines.push("```");
11751
+ lines.push("");
11752
+ });
11753
+ return lines.join("\n");
11754
+ }
11755
+ function convertContext8(section) {
11756
+ const lines = [];
11757
+ lines.push(`## ${section.title}`);
11758
+ lines.push("");
11759
+ lines.push(section.content);
11760
+ return lines.join("\n");
11761
+ }
11762
+ var init_to_trae = __esm({
11763
+ "../converters/dist/to-trae.js"() {
11764
+ "use strict";
11765
+ init_cjs_shims();
11766
+ }
11767
+ });
11768
+
11769
+ // ../converters/dist/to-aider.js
11770
+ function toAider(pkg, options = {}) {
11771
+ const warnings = [];
11772
+ let qualityScore = 100;
11773
+ try {
11774
+ const content = convertContent10(pkg, warnings);
11775
+ const lossyConversion = warnings.some((w) => w.includes("not supported") || w.includes("skipped"));
11776
+ if (lossyConversion) {
11777
+ qualityScore -= 10;
11778
+ }
11779
+ return {
11780
+ content,
11781
+ format: "aider",
11782
+ warnings: warnings.length > 0 ? warnings : void 0,
11783
+ lossyConversion,
11784
+ qualityScore
11785
+ };
11786
+ } catch (error) {
11787
+ warnings.push(`Conversion error: ${error instanceof Error ? error.message : String(error)}`);
11788
+ return {
11789
+ content: "",
11790
+ format: "aider",
11791
+ warnings,
11792
+ lossyConversion: true,
11793
+ qualityScore: 0
11794
+ };
11795
+ }
11796
+ }
11797
+ function convertContent10(pkg, warnings) {
11798
+ var _a, _b, _c;
11799
+ const lines = [];
11800
+ const title = ((_a = pkg.metadata) == null ? void 0 : _a.title) || pkg.name;
11801
+ lines.push(`# ${title}`);
11802
+ lines.push("");
11803
+ if (pkg.description || ((_b = pkg.metadata) == null ? void 0 : _b.description)) {
11804
+ lines.push(pkg.description || ((_c = pkg.metadata) == null ? void 0 : _c.description) || "");
11805
+ lines.push("");
11806
+ }
11807
+ for (const section of pkg.content.sections) {
11808
+ if (section.type === "metadata" || section.type === "tools" || section.type === "persona") {
11809
+ if (section.type === "persona") {
11810
+ warnings.push("Persona section skipped (not supported by Aider)");
11811
+ } else if (section.type === "tools") {
11812
+ warnings.push("Tools section skipped (not supported by Aider)");
11813
+ }
11814
+ continue;
11815
+ }
11816
+ const sectionContent = convertSection9(section, warnings);
11817
+ if (sectionContent) {
11818
+ lines.push(sectionContent);
11819
+ lines.push("");
11820
+ }
11821
+ }
11822
+ return lines.join("\n").trim();
11823
+ }
11824
+ function convertSection9(section, warnings) {
11825
+ switch (section.type) {
11826
+ case "instructions":
11827
+ return convertInstructions9(section);
11828
+ case "rules":
11829
+ return convertRules9(section);
11830
+ case "examples":
11831
+ return convertExamples9(section);
11832
+ case "context":
11833
+ return convertContext9(section);
11834
+ case "custom":
11835
+ if (!section.editorType) {
11836
+ return section.content;
11837
+ }
11838
+ warnings.push(`Custom ${section.editorType} section skipped`);
11839
+ return "";
11840
+ default:
11841
+ return "";
11842
+ }
11843
+ }
11844
+ function convertInstructions9(section) {
11845
+ const lines = [];
11846
+ lines.push(`## ${section.title}`);
11847
+ lines.push("");
11848
+ lines.push(section.content);
11849
+ return lines.join("\n");
11850
+ }
11851
+ function convertRules9(section) {
11852
+ const lines = [];
11853
+ lines.push(`## ${section.title}`);
11854
+ lines.push("");
11855
+ section.items.forEach((rule, index) => {
11856
+ const prefix = section.ordered ? `${index + 1}.` : "-";
11857
+ lines.push(`${prefix} ${rule.content}`);
11858
+ if (rule.rationale) {
11859
+ lines.push(` - Rationale: ${rule.rationale}`);
11860
+ }
11861
+ if (rule.examples && rule.examples.length > 0) {
11862
+ rule.examples.forEach((example) => {
11863
+ lines.push(` - Example: \`${example}\``);
11864
+ });
11865
+ }
11866
+ });
11867
+ return lines.join("\n");
11868
+ }
11869
+ function convertExamples9(section) {
11870
+ const lines = [];
11871
+ lines.push(`## ${section.title}`);
11872
+ lines.push("");
11873
+ section.examples.forEach((example) => {
11874
+ if (example.good === false) {
11875
+ lines.push(`### \u274C Avoid: ${example.description}`);
11876
+ } else if (example.good === true) {
11877
+ lines.push(`### \u2705 Preferred: ${example.description}`);
11878
+ } else {
11879
+ lines.push(`### ${example.description}`);
11880
+ }
11881
+ lines.push("");
11882
+ const lang = example.language || "";
11883
+ lines.push("```" + lang);
11884
+ lines.push(example.code);
11885
+ lines.push("```");
11886
+ lines.push("");
11887
+ });
11888
+ return lines.join("\n");
11889
+ }
11890
+ function convertContext9(section) {
11891
+ const lines = [];
11892
+ lines.push(`## ${section.title}`);
11893
+ lines.push("");
11894
+ lines.push(section.content);
11895
+ return lines.join("\n");
11896
+ }
11897
+ var init_to_aider = __esm({
11898
+ "../converters/dist/to-aider.js"() {
11899
+ "use strict";
11900
+ init_cjs_shims();
11901
+ }
11902
+ });
11903
+
11904
+ // ../converters/dist/to-zencoder.js
11905
+ function toZencoder(pkg, options = {}) {
11906
+ var _a, _b;
11907
+ const warnings = [];
11908
+ let qualityScore = 100;
11909
+ try {
11910
+ const config = options.zencoderConfig || {};
11911
+ const hasConfig = config.description || config.globs || config.alwaysApply !== void 0 || ((_a = pkg.metadata) == null ? void 0 : _a.globs) || ((_b = pkg.metadata) == null ? void 0 : _b.alwaysApply) !== void 0;
11912
+ const includeFrontmatter = config.includeFrontmatter ?? hasConfig;
11913
+ const content = convertContent11(pkg, warnings, config);
11914
+ let fullContent;
11915
+ if (includeFrontmatter) {
11916
+ const frontmatter = generateFrontmatter3(pkg, config);
11917
+ if (frontmatter) {
11918
+ fullContent = `${frontmatter}
11919
+
11920
+ ${content}`;
11921
+ } else {
11922
+ fullContent = content;
11923
+ }
11924
+ } else {
11925
+ fullContent = content;
11926
+ }
11927
+ const lossyConversion = warnings.some((w) => w.includes("not supported") || w.includes("skipped"));
11928
+ if (lossyConversion) {
11929
+ qualityScore -= 10;
11930
+ }
11931
+ return {
11932
+ content: fullContent,
11933
+ format: "zencoder",
11934
+ warnings: warnings.length > 0 ? warnings : void 0,
11935
+ lossyConversion,
11936
+ qualityScore
11937
+ };
11938
+ } catch (error) {
11939
+ warnings.push(`Conversion error: ${error instanceof Error ? error.message : String(error)}`);
11940
+ return {
11941
+ content: "",
11942
+ format: "zencoder",
11943
+ warnings,
11944
+ lossyConversion: true,
11945
+ qualityScore: 0
11946
+ };
11947
+ }
11948
+ }
11949
+ function generateFrontmatter3(pkg, config) {
11950
+ var _a, _b, _c;
11951
+ const lines = [];
11952
+ let hasContent = false;
11953
+ const description = config.description || pkg.description || ((_a = pkg.metadata) == null ? void 0 : _a.description);
11954
+ if (description) {
11955
+ if (!hasContent) {
11956
+ lines.push("---");
11957
+ hasContent = true;
11958
+ }
11959
+ lines.push(`description: ${JSON.stringify(description)}`);
11960
+ }
11961
+ const globs = config.globs || ((_b = pkg.metadata) == null ? void 0 : _b.globs);
11962
+ if (globs && globs.length > 0) {
11963
+ if (!hasContent) {
11964
+ lines.push("---");
11965
+ hasContent = true;
11966
+ }
11967
+ lines.push("globs:");
11968
+ globs.forEach((glob) => {
11969
+ lines.push(` - ${JSON.stringify(glob)}`);
11970
+ });
11971
+ }
11972
+ const alwaysApply = config.alwaysApply ?? ((_c = pkg.metadata) == null ? void 0 : _c.alwaysApply);
11973
+ if (alwaysApply !== void 0) {
11974
+ if (!hasContent) {
11975
+ lines.push("---");
11976
+ hasContent = true;
11977
+ }
11978
+ lines.push(`alwaysApply: ${alwaysApply}`);
11979
+ }
11980
+ if (hasContent) {
11981
+ lines.push("---");
11982
+ return lines.join("\n");
11983
+ }
11984
+ return "";
11985
+ }
11986
+ function convertContent11(pkg, warnings, config) {
11987
+ var _a, _b, _c;
11988
+ const lines = [];
11989
+ const title = ((_a = pkg.metadata) == null ? void 0 : _a.title) || pkg.name;
11990
+ lines.push(`# ${title}`);
11991
+ lines.push("");
11992
+ if (!config.description && (pkg.description || ((_b = pkg.metadata) == null ? void 0 : _b.description))) {
11993
+ lines.push(pkg.description || ((_c = pkg.metadata) == null ? void 0 : _c.description) || "");
11994
+ lines.push("");
11995
+ }
11996
+ for (const section of pkg.content.sections) {
11997
+ if (section.type === "metadata" || section.type === "tools" || section.type === "persona") {
11998
+ if (section.type === "persona") {
11999
+ warnings.push("Persona section skipped (not supported by Zencoder)");
12000
+ } else if (section.type === "tools") {
12001
+ warnings.push("Tools section skipped (not supported by Zencoder)");
12002
+ }
12003
+ continue;
12004
+ }
12005
+ const sectionContent = convertSection10(section, warnings);
12006
+ if (sectionContent) {
12007
+ lines.push(sectionContent);
12008
+ lines.push("");
12009
+ }
12010
+ }
12011
+ return lines.join("\n").trim();
12012
+ }
12013
+ function convertSection10(section, warnings) {
12014
+ switch (section.type) {
12015
+ case "instructions":
12016
+ return convertInstructions10(section);
12017
+ case "rules":
12018
+ return convertRules10(section);
12019
+ case "examples":
12020
+ return convertExamples10(section);
12021
+ case "context":
12022
+ return convertContext10(section);
12023
+ case "custom":
12024
+ if (!section.editorType) {
12025
+ return section.content;
12026
+ }
12027
+ warnings.push(`Custom ${section.editorType} section skipped`);
12028
+ return "";
12029
+ default:
12030
+ return "";
12031
+ }
12032
+ }
12033
+ function convertInstructions10(section) {
12034
+ const lines = [];
12035
+ lines.push(`## ${section.title}`);
12036
+ lines.push("");
12037
+ lines.push(section.content);
12038
+ return lines.join("\n");
12039
+ }
12040
+ function convertRules10(section) {
12041
+ const lines = [];
12042
+ lines.push(`## ${section.title}`);
12043
+ lines.push("");
12044
+ section.items.forEach((rule, index) => {
12045
+ const prefix = section.ordered ? `${index + 1}.` : "-";
12046
+ lines.push(`${prefix} ${rule.content}`);
12047
+ if (rule.rationale) {
12048
+ lines.push(` - Rationale: ${rule.rationale}`);
12049
+ }
12050
+ if (rule.examples && rule.examples.length > 0) {
12051
+ rule.examples.forEach((example) => {
12052
+ lines.push(` - Example: \`${example}\``);
12053
+ });
12054
+ }
12055
+ });
12056
+ return lines.join("\n");
12057
+ }
12058
+ function convertExamples10(section) {
12059
+ const lines = [];
12060
+ lines.push(`## ${section.title}`);
12061
+ lines.push("");
12062
+ section.examples.forEach((example) => {
12063
+ if (example.good === false) {
12064
+ lines.push(`### \u274C Avoid: ${example.description}`);
12065
+ } else if (example.good === true) {
12066
+ lines.push(`### \u2705 Preferred: ${example.description}`);
12067
+ } else {
12068
+ lines.push(`### ${example.description}`);
12069
+ }
12070
+ lines.push("");
12071
+ const lang = example.language || "";
12072
+ lines.push("```" + lang);
12073
+ lines.push(example.code);
12074
+ lines.push("```");
12075
+ lines.push("");
12076
+ });
12077
+ return lines.join("\n");
12078
+ }
12079
+ function convertContext10(section) {
12080
+ const lines = [];
12081
+ lines.push(`## ${section.title}`);
12082
+ lines.push("");
12083
+ lines.push(section.content);
12084
+ return lines.join("\n");
12085
+ }
12086
+ var init_to_zencoder = __esm({
12087
+ "../converters/dist/to-zencoder.js"() {
12088
+ "use strict";
12089
+ init_cjs_shims();
12090
+ }
12091
+ });
12092
+
12093
+ // ../converters/dist/to-replit.js
12094
+ function toReplit(pkg, options = {}) {
12095
+ const warnings = [];
12096
+ let qualityScore = 100;
12097
+ try {
12098
+ const content = convertContent12(pkg, warnings);
12099
+ const lossyConversion = warnings.some((w) => w.includes("not supported") || w.includes("skipped"));
12100
+ if (lossyConversion) {
12101
+ qualityScore -= 10;
12102
+ }
12103
+ return {
12104
+ content,
12105
+ format: "replit",
12106
+ warnings: warnings.length > 0 ? warnings : void 0,
12107
+ lossyConversion,
12108
+ qualityScore
12109
+ };
12110
+ } catch (error) {
12111
+ warnings.push(`Conversion error: ${error instanceof Error ? error.message : String(error)}`);
12112
+ return {
12113
+ content: "",
12114
+ format: "replit",
12115
+ warnings,
12116
+ lossyConversion: true,
12117
+ qualityScore: 0
12118
+ };
12119
+ }
12120
+ }
12121
+ function convertContent12(pkg, warnings) {
12122
+ var _a, _b, _c;
12123
+ const lines = [];
12124
+ const title = ((_a = pkg.metadata) == null ? void 0 : _a.title) || pkg.name;
12125
+ lines.push(`# ${title}`);
12126
+ lines.push("");
12127
+ if (pkg.description || ((_b = pkg.metadata) == null ? void 0 : _b.description)) {
12128
+ lines.push(pkg.description || ((_c = pkg.metadata) == null ? void 0 : _c.description) || "");
12129
+ lines.push("");
12130
+ }
12131
+ for (const section of pkg.content.sections) {
12132
+ if (section.type === "metadata" || section.type === "tools" || section.type === "persona") {
12133
+ if (section.type === "persona") {
12134
+ warnings.push("Persona section skipped (not supported by Replit)");
12135
+ } else if (section.type === "tools") {
12136
+ warnings.push("Tools section skipped (not supported by Replit)");
12137
+ }
12138
+ continue;
12139
+ }
12140
+ const sectionContent = convertSection11(section, warnings);
12141
+ if (sectionContent) {
12142
+ lines.push(sectionContent);
12143
+ lines.push("");
12144
+ }
12145
+ }
12146
+ return lines.join("\n").trim();
12147
+ }
12148
+ function convertSection11(section, warnings) {
12149
+ switch (section.type) {
12150
+ case "instructions":
12151
+ return convertInstructions11(section);
12152
+ case "rules":
12153
+ return convertRules11(section);
12154
+ case "examples":
12155
+ return convertExamples11(section);
12156
+ case "context":
12157
+ return convertContext11(section);
12158
+ case "custom":
12159
+ if (!section.editorType) {
12160
+ return section.content;
12161
+ }
12162
+ warnings.push(`Custom ${section.editorType} section skipped`);
12163
+ return "";
12164
+ default:
12165
+ return "";
12166
+ }
12167
+ }
12168
+ function convertInstructions11(section) {
12169
+ const lines = [];
12170
+ lines.push(`## ${section.title}`);
12171
+ lines.push("");
12172
+ lines.push(section.content);
12173
+ return lines.join("\n");
12174
+ }
12175
+ function convertRules11(section) {
12176
+ const lines = [];
12177
+ lines.push(`## ${section.title}`);
12178
+ lines.push("");
12179
+ section.items.forEach((rule, index) => {
12180
+ const prefix = section.ordered ? `${index + 1}.` : "-";
12181
+ lines.push(`${prefix} ${rule.content}`);
12182
+ if (rule.rationale) {
12183
+ lines.push(` - Rationale: ${rule.rationale}`);
12184
+ }
12185
+ if (rule.examples && rule.examples.length > 0) {
12186
+ rule.examples.forEach((example) => {
12187
+ lines.push(` - Example: \`${example}\``);
12188
+ });
12189
+ }
12190
+ });
12191
+ return lines.join("\n");
12192
+ }
12193
+ function convertExamples11(section) {
12194
+ const lines = [];
12195
+ lines.push(`## ${section.title}`);
12196
+ lines.push("");
12197
+ section.examples.forEach((example) => {
12198
+ if (example.good === false) {
12199
+ lines.push(`### \u274C Avoid: ${example.description}`);
12200
+ } else if (example.good === true) {
12201
+ lines.push(`### \u2705 Preferred: ${example.description}`);
12202
+ } else {
12203
+ lines.push(`### ${example.description}`);
12204
+ }
12205
+ lines.push("");
12206
+ const lang = example.language || "";
12207
+ lines.push("```" + lang);
12208
+ lines.push(example.code);
12209
+ lines.push("```");
12210
+ lines.push("");
12211
+ });
12212
+ return lines.join("\n");
12213
+ }
12214
+ function convertContext11(section) {
12215
+ const lines = [];
12216
+ lines.push(`## ${section.title}`);
12217
+ lines.push("");
12218
+ lines.push(section.content);
12219
+ return lines.join("\n");
12220
+ }
12221
+ var init_to_replit = __esm({
12222
+ "../converters/dist/to-replit.js"() {
12223
+ "use strict";
12224
+ init_cjs_shims();
12225
+ }
12226
+ });
12227
+
12228
+ // ../converters/dist/schema-files.js
12229
+ 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;
12230
+ var init_schema_files = __esm({
12231
+ "../converters/dist/schema-files.js"() {
12232
+ "use strict";
12233
+ init_cjs_shims();
12234
+ import_module = require("module");
12235
+ import_path9 = require("path");
12236
+ schemaRequire = typeof require !== "undefined" ? require : (0, import_module.createRequire)(process.cwd() + "/");
12237
+ convertersPackagePath = schemaRequire.resolve("@pr-pm/converters/package.json");
12238
+ convertersDir = (0, import_path9.dirname)(convertersPackagePath);
12239
+ loadSchema2 = (filename) => schemaRequire((0, import_path9.join)(convertersDir, "schemas", filename));
12240
+ agentsMdSchema = loadSchema2("agents-md.schema.json");
12241
+ canonicalSchema = loadSchema2("canonical.schema.json");
12242
+ claudeSchema = loadSchema2("claude.schema.json");
12243
+ continueSchema = loadSchema2("continue.schema.json");
12244
+ copilotSchema = loadSchema2("copilot.schema.json");
12245
+ cursorSchema = loadSchema2("cursor.schema.json");
12246
+ droidSchema = loadSchema2("droid.schema.json");
12247
+ geminiMdSchema = loadSchema2("gemini-md.schema.json");
12248
+ geminiSchema = loadSchema2("gemini.schema.json");
12249
+ kiroSteeringSchema = loadSchema2("kiro-steering.schema.json");
12250
+ opencodeSchema = loadSchema2("opencode.schema.json");
12251
+ rulerSchema = loadSchema2("ruler.schema.json");
12252
+ windsurfSchema = loadSchema2("windsurf.schema.json");
12253
+ traeSchema = loadSchema2("trae.schema.json");
12254
+ aiderSchema = loadSchema2("aider.schema.json");
12255
+ zencoderSchema = loadSchema2("zencoder.schema.json");
12256
+ replitSchema = loadSchema2("replit.schema.json");
12257
+ claudeAgentSchema = loadSchema2("claude-agent.schema.json");
12258
+ claudeHookSchema = loadSchema2("claude-hook.schema.json");
12259
+ claudeSkillSchema = loadSchema2("claude-skill.schema.json");
12260
+ claudeSlashCommandSchema = loadSchema2("claude-slash-command.schema.json");
12261
+ cursorCommandSchema = loadSchema2("cursor-command.schema.json");
12262
+ droidHookSchema = loadSchema2("droid-hook.schema.json");
12263
+ droidSkillSchema = loadSchema2("droid-skill.schema.json");
12264
+ droidSlashCommandSchema = loadSchema2("droid-slash-command.schema.json");
12265
+ kiroAgentSchema = loadSchema2("kiro-agent.schema.json");
12266
+ kiroHookSchema = loadSchema2("kiro-hook.schema.json");
12267
+ opencodeSlashCommandSchema = loadSchema2("opencode-slash-command.schema.json");
12268
+ }
12269
+ });
12270
+
12271
+ // ../converters/dist/index.js
12272
+ var init_dist = __esm({
12273
+ "../converters/dist/index.js"() {
12274
+ "use strict";
12275
+ init_cjs_shims();
12276
+ init_canonical();
12277
+ init_from_cursor();
12278
+ init_from_claude();
12279
+ init_from_continue();
12280
+ init_from_copilot();
12281
+ init_from_kiro();
12282
+ init_from_kiro_agent();
12283
+ init_from_windsurf();
12284
+ init_from_agents_md();
12285
+ init_from_gemini();
12286
+ init_from_opencode();
12287
+ init_from_ruler();
12288
+ init_from_droid();
12289
+ init_from_trae();
12290
+ init_from_aider();
12291
+ init_from_zencoder();
12292
+ init_from_replit();
12293
+ init_to_cursor();
12294
+ init_to_claude();
12295
+ init_to_continue();
12296
+ init_to_copilot();
12297
+ init_to_kiro();
12298
+ init_to_kiro_agent();
12299
+ init_to_windsurf();
12300
+ init_to_agents_md();
12301
+ init_to_gemini();
12302
+ init_to_opencode();
12303
+ init_to_ruler();
12304
+ init_to_droid();
12305
+ init_to_trae();
12306
+ init_to_aider();
12307
+ init_to_zencoder();
12308
+ init_to_replit();
12309
+ init_taxonomy_utils();
12310
+ init_validation();
12311
+ init_schema_files();
12312
+ }
12313
+ });
12314
+
12315
+ // src/commands/install.ts
12316
+ function getPackageIcon2(format, subtype) {
12317
+ const subtypeIcons = {
12318
+ "skill": "\u{1F393}",
12319
+ "agent": "\u{1F916}",
12320
+ "slash-command": "\u26A1",
12321
+ "rule": "\u{1F4CB}",
12322
+ "prompt": "\u{1F4AC}",
12323
+ "collection": "\u{1F4E6}",
12324
+ "chatmode": "\u{1F4AC}",
12325
+ "tool": "\u{1F527}",
12326
+ "hook": "\u{1FA9D}",
12327
+ "workflow": "\u{1F504}",
11389
12328
  "template": "\u{1F4C4}"
11390
12329
  };
11391
12330
  const formatIcons = {
@@ -11400,6 +12339,10 @@ function getPackageIcon2(format, subtype) {
11400
12339
  "claude.md": "\u{1F916}",
11401
12340
  "opencode": "\u26A1",
11402
12341
  "droid": "\u{1F3ED}",
12342
+ "trae": "\u{1F3AF}",
12343
+ "aider": "\u{1F91D}",
12344
+ "zencoder": "\u26A1",
12345
+ "replit": "\u{1F52E}",
11403
12346
  "mcp": "\u{1F517}",
11404
12347
  "agents.md": "\u{1F4DD}",
11405
12348
  "ruler": "\u{1F4CF}",
@@ -11420,6 +12363,10 @@ function getPackageLabel2(format, subtype) {
11420
12363
  "claude.md": "Claude",
11421
12364
  "opencode": "OpenCode",
11422
12365
  "droid": "Factory Droid",
12366
+ "trae": "Trae",
12367
+ "aider": "Aider",
12368
+ "zencoder": "Zencoder",
12369
+ "replit": "Replit",
11423
12370
  "mcp": "MCP",
11424
12371
  "agents.md": "Agents.md",
11425
12372
  "ruler": "Ruler",
@@ -11476,7 +12423,11 @@ async function handleInstall(packageSpec, options) {
11476
12423
  }
11477
12424
  const config = await getConfig();
11478
12425
  const lockfile = await readLockfile();
11479
- const lockedVersion = getLockedVersion(lockfile, packageId);
12426
+ let targetFormat = options.as;
12427
+ if (!targetFormat) {
12428
+ targetFormat = config.defaultFormat || await autoDetectFormat() || void 0;
12429
+ }
12430
+ const lockedVersion = getLockedVersion(lockfile, packageId, targetFormat);
11480
12431
  let version;
11481
12432
  if (options.frozenLockfile) {
11482
12433
  if (!lockedVersion) {
@@ -11486,46 +12437,44 @@ async function handleInstall(packageSpec, options) {
11486
12437
  } else {
11487
12438
  version = options.version || specVersion || lockedVersion || "latest";
11488
12439
  }
11489
- let targetFormat = options.as;
11490
- if (!targetFormat) {
11491
- targetFormat = config.defaultFormat || await autoDetectFormat() || void 0;
11492
- }
11493
- if (!options.force && lockfile && lockfile.packages[packageId]) {
11494
- const installedPkg = lockfile.packages[packageId];
11495
- const requestedVersion = options.version || specVersion;
11496
- const sameFormat = !targetFormat || installedPkg.format === targetFormat;
11497
- if (sameFormat && (!requestedVersion || requestedVersion === "latest" || requestedVersion === installedPkg.version)) {
11498
- console.log(`
12440
+ if (!options.force && lockfile && targetFormat) {
12441
+ const lockfileKey = getLockfileKey(packageId, targetFormat);
12442
+ const installedPkg = lockfile.packages[lockfileKey];
12443
+ if (installedPkg) {
12444
+ const requestedVersion = options.version || specVersion;
12445
+ if (!requestedVersion || requestedVersion === "latest" || requestedVersion === installedPkg.version) {
12446
+ console.log(`
11499
12447
  \u2728 Package already installed!`);
11500
- console.log(` \u{1F4E6} ${packageId}@${installedPkg.version}`);
11501
- console.log(` \u{1F504} Format: ${installedPkg.format || "unknown"} | Subtype: ${installedPkg.subtype || "unknown"}`);
11502
- console.log(`
12448
+ console.log(` \u{1F4E6} ${packageId}@${installedPkg.version}`);
12449
+ console.log(` \u{1F504} Format: ${installedPkg.format || "unknown"} | Subtype: ${installedPkg.subtype || "unknown"}`);
12450
+ console.log(`
11503
12451
  \u{1F4A1} To reinstall or upgrade:`);
11504
- console.log(` prpm upgrade ${packageId} # Upgrade to latest version`);
11505
- console.log(` prpm uninstall ${packageId} # Uninstall first, then install`);
11506
- console.log(` prpm install ${packageId} --as <format> # Install in different format`);
11507
- success = true;
11508
- return;
11509
- } else if (!sameFormat) {
11510
- console.log(`\u{1F4E6} Installing ${packageId} in ${targetFormat} format (already have ${installedPkg.format} version)`);
11511
- } else if (requestedVersion !== installedPkg.version) {
11512
- console.log(`\u{1F4E6} Upgrading ${packageId}: ${installedPkg.version} \u2192 ${requestedVersion}`);
12452
+ console.log(` prpm upgrade ${packageId} # Upgrade to latest version`);
12453
+ console.log(` prpm uninstall ${packageId} # Uninstall first, then install`);
12454
+ console.log(` prpm install ${packageId} --as <format> # Install in different format`);
12455
+ success = true;
12456
+ return;
12457
+ } else {
12458
+ console.log(`\u{1F4E6} Upgrading ${packageId}: ${installedPkg.version} \u2192 ${requestedVersion}`);
12459
+ }
12460
+ } else if (options.as) {
12461
+ const existingFormats = [];
12462
+ for (const key of Object.keys(lockfile.packages)) {
12463
+ const parsed = parseLockfileKey(key);
12464
+ if (parsed.packageId === packageId && parsed.format) {
12465
+ existingFormats.push(parsed.format);
12466
+ }
12467
+ }
12468
+ if (existingFormats.length > 0) {
12469
+ console.log(`\u{1F4E6} Installing ${packageId} in ${targetFormat} format (already have ${existingFormats.join(", ")} version${existingFormats.length > 1 ? "s" : ""})`);
12470
+ }
11513
12471
  }
11514
12472
  }
11515
12473
  console.log(`\u{1F4E5} Installing ${packageId}@${version}...`);
11516
12474
  const client = (0, import_registry_client5.getRegistryClient)(config);
11517
12475
  let isCollection = false;
11518
12476
  try {
11519
- let scope;
11520
- let name_slug;
11521
- const matchWithScope = packageId.match(/^@?([^/]+)\/([^/@]+)$/);
11522
- if (matchWithScope) {
11523
- [, scope, name_slug] = matchWithScope;
11524
- } else {
11525
- scope = "collection";
11526
- name_slug = packageId;
11527
- }
11528
- await client.getCollection(scope, name_slug, version === "latest" ? void 0 : version);
12477
+ await client.getCollection(packageId, version === "latest" ? void 0 : version);
11529
12478
  isCollection = true;
11530
12479
  return await handleCollectionInstall(packageId, {
11531
12480
  format: options.as,
@@ -11590,10 +12539,22 @@ async function handleInstall(packageSpec, options) {
11590
12539
  actualVersion = pkg.latest_version.version;
11591
12540
  console.log(` \u{1F4E6} Installing version ${pkg.latest_version.version}`);
11592
12541
  } else {
11593
- const versionInfo = await client.getPackageVersion(packageId, version);
12542
+ let resolvedVersion = version;
12543
+ if (import_semver.default.validRange(version) && !import_semver.default.valid(version)) {
12544
+ console.log(` \u{1F50D} Resolving semver range: ${version}`);
12545
+ const versionsData = await client.getPackageVersions(packageId);
12546
+ const availableVersions = versionsData.versions.map((v) => v.version);
12547
+ const maxSatisfying = import_semver.default.maxSatisfying(availableVersions, version);
12548
+ if (!maxSatisfying) {
12549
+ throw new Error(`No version found matching range "${version}". Available versions: ${availableVersions.join(", ")}`);
12550
+ }
12551
+ resolvedVersion = maxSatisfying;
12552
+ console.log(` \u2713 Resolved to version ${resolvedVersion}`);
12553
+ }
12554
+ const versionInfo = await client.getPackageVersion(packageId, resolvedVersion);
11594
12555
  tarballUrl = versionInfo.tarball_url;
11595
- actualVersion = version;
11596
- console.log(` \u{1F4E6} Installing version ${version}`);
12556
+ actualVersion = resolvedVersion;
12557
+ console.log(` \u{1F4E6} Installing version ${resolvedVersion}`);
11597
12558
  }
11598
12559
  console.log(` \u2B07\uFE0F Downloading...`);
11599
12560
  const tarball = await client.downloadPackage(tarballUrl);
@@ -11651,13 +12612,15 @@ async function handleInstall(packageSpec, options) {
11651
12612
  throw new CLIError(`Failed to parse ${pkg.format} format: ${error2.message}`);
11652
12613
  }
11653
12614
  let convertedContent;
12615
+ const targetFormat2 = format == null ? void 0 : format.toLowerCase();
11654
12616
  try {
11655
- switch (format) {
12617
+ switch (targetFormat2) {
11656
12618
  case "cursor":
11657
12619
  const cursorResult = toCursor(canonicalPkg);
11658
12620
  convertedContent = cursorResult.content;
11659
12621
  break;
11660
12622
  case "claude":
12623
+ case "claude.md":
11661
12624
  const claudeResult = toClaude(canonicalPkg);
11662
12625
  convertedContent = claudeResult.content;
11663
12626
  break;
@@ -11684,11 +12647,39 @@ async function handleInstall(packageSpec, options) {
11684
12647
  convertedContent = agentsResult.content;
11685
12648
  break;
11686
12649
  case "gemini":
12650
+ case "gemini.md":
11687
12651
  const geminiResult = toGemini(canonicalPkg);
11688
12652
  convertedContent = geminiResult.content;
11689
12653
  break;
12654
+ case "ruler":
12655
+ convertedContent = toRuler(canonicalPkg).content;
12656
+ break;
12657
+ case "opencode":
12658
+ convertedContent = toOpencode(canonicalPkg).content;
12659
+ break;
12660
+ case "droid":
12661
+ convertedContent = toDroid(canonicalPkg).content;
12662
+ break;
12663
+ case "trae":
12664
+ convertedContent = toTrae(canonicalPkg).content;
12665
+ break;
12666
+ case "aider":
12667
+ convertedContent = toAider(canonicalPkg).content;
12668
+ break;
12669
+ case "zencoder":
12670
+ convertedContent = toZencoder(canonicalPkg).content;
12671
+ break;
12672
+ case "replit":
12673
+ convertedContent = toReplit(canonicalPkg).content;
12674
+ break;
12675
+ case "generic":
12676
+ convertedContent = toCursor(canonicalPkg).content;
12677
+ break;
12678
+ case "canonical":
12679
+ convertedContent = JSON.stringify(canonicalPkg, null, 2);
12680
+ break;
11690
12681
  default:
11691
- throw new CLIError(`Unsupported target format for conversion: ${format}`);
12682
+ throw new CLIError(`Unsupported target format for conversion: ${targetFormat2 || format}`);
11692
12683
  }
11693
12684
  } catch (error2) {
11694
12685
  throw new CLIError(`Failed to convert to ${format} format: ${error2.message}`);
@@ -11774,6 +12765,16 @@ async function handleInstall(packageSpec, options) {
11774
12765
  }
11775
12766
  } else if (effectiveFormat === "kiro" && effectiveSubtype === "hook") {
11776
12767
  destPath = `${destDir}/${packageName}.kiro.hook`;
12768
+ } else if (effectiveFormat === "aider") {
12769
+ if (effectiveSubtype === "skill") {
12770
+ destPath = `${destDir}/SKILL.md`;
12771
+ } else if (effectiveSubtype === "agent") {
12772
+ destPath = `${destDir}/AGENT.md`;
12773
+ } else {
12774
+ destPath = `${destDir}/CONVENTIONS.md`;
12775
+ }
12776
+ } else if (effectiveFormat === "droid" && effectiveSubtype === "skill") {
12777
+ destPath = `${destDir}/SKILL.md`;
11777
12778
  } else {
11778
12779
  destPath = `${destDir}/${packageName}.${fileExtension}`;
11779
12780
  }
@@ -11930,7 +12931,7 @@ ${afterFrontmatter}`;
11930
12931
  }
11931
12932
  }
11932
12933
  let progressiveDisclosureMetadata;
11933
- if ((effectiveFormat === "agents.md" || effectiveFormat === "gemini.md" || effectiveFormat === "claude.md") && (effectiveSubtype === "skill" || effectiveSubtype === "agent") && !options.noAppend) {
12934
+ if ((effectiveFormat === "agents.md" || effectiveFormat === "gemini.md" || effectiveFormat === "claude.md" || effectiveFormat === "aider") && (effectiveSubtype === "skill" || effectiveSubtype === "agent") && !options.noAppend) {
11934
12935
  if (!destDir) {
11935
12936
  throw new Error("Internal error: destDir not set for progressive disclosure installation");
11936
12937
  }
@@ -11974,7 +12975,7 @@ ${afterFrontmatter}`;
11974
12975
  // Track hook installation metadata for uninstall
11975
12976
  progressiveDisclosure: progressiveDisclosureMetadata
11976
12977
  });
11977
- setPackageIntegrity(updatedLockfile, packageId, tarball);
12978
+ setPackageIntegrity(updatedLockfile, packageId, tarball, effectiveFormat);
11978
12979
  await writeLockfile(updatedLockfile);
11979
12980
  await client.trackDownload(packageId, {
11980
12981
  version: actualVersion || version,
@@ -12120,11 +13121,13 @@ async function installFromLockfile(options) {
12120
13121
  `);
12121
13122
  let successCount = 0;
12122
13123
  let failCount = 0;
12123
- for (const packageId of packageIds) {
12124
- const lockEntry = lockfile.packages[packageId];
13124
+ for (const lockfileKey of packageIds) {
13125
+ const lockEntry = lockfile.packages[lockfileKey];
13126
+ const { packageId, format } = parseLockfileKey(lockfileKey);
13127
+ const displayName = format ? `${packageId} (${format})` : packageId;
12125
13128
  try {
12126
13129
  const packageSpec = packageId.includes("@") && !packageId.startsWith("@") ? packageId.substring(0, packageId.lastIndexOf("@")) : packageId;
12127
- console.log(` Installing ${packageId}...`);
13130
+ console.log(` Installing ${displayName}...`);
12128
13131
  let locationOverride = options.location;
12129
13132
  if (!locationOverride && lockEntry.format === "agents.md" && lockEntry.installedPath) {
12130
13133
  const baseName = import_path10.default.basename(lockEntry.installedPath);
@@ -12151,7 +13154,7 @@ async function installFromLockfile(options) {
12151
13154
  successCount++;
12152
13155
  } else {
12153
13156
  failCount++;
12154
- console.error(` \u274C Failed to install ${packageId}:`);
13157
+ console.error(` \u274C Failed to install ${displayName}:`);
12155
13158
  console.error(` Type: ${(_b = error == null ? void 0 : error.constructor) == null ? void 0 : _b.name}`);
12156
13159
  console.error(` Message: ${error instanceof Error ? error.message : String(error)}`);
12157
13160
  if (error instanceof CLIError) {
@@ -12174,10 +13177,20 @@ async function installFromLockfile(options) {
12174
13177
  }
12175
13178
  function createInstallCommand() {
12176
13179
  const command = new import_commander11.Command("install");
12177
- command.description("Install a package from the registry, or install all packages from prpm.lock if no package specified").argument("[package]", "Package to install (e.g., react-rules or react-rules@1.2.0). If omitted, installs all packages from prpm.lock").option("--version <version>", "Specific version to install").option("--as <format>", "Convert and install in specific format (cursor, claude, continue, windsurf, copilot, kiro, agents.md, gemini.md, claude.md, canonical)").option("--format <format>", "Alias for --as").option("--location <path>", "Custom location for installed files (Agents.md or nested Cursor rules)").option("--subtype <subtype>", "Specify subtype when converting (skill, agent, rule, etc.)").option("--frozen-lockfile", "Fail if lock file needs to be updated (for CI)").option("--no-append", "Skip adding skill to manifest file (skill files only)").option("--manifest-file <filename>", "Custom manifest filename for progressive disclosure (default: AGENTS.md)", "AGENTS.md").action(async (packageSpec, options) => {
13180
+ command.description("Install a package from the registry, or install all packages from prpm.lock if no package specified").argument("[package]", "Package to install (e.g., react-rules or react-rules@1.2.0). If omitted, installs all packages from prpm.lock").option("--version <version>", "Specific version to install").option("--as <format>", `Convert and install in specific format (${import_types.FORMATS.join(", ")})`).option("--format <format>", "Alias for --as").option("--location <path>", "Custom location for installed files (Agents.md or nested Cursor rules)").option("--subtype <subtype>", "Specify subtype when converting (skill, agent, rule, etc.)").option("--frozen-lockfile", "Fail if lock file needs to be updated (for CI)").option("--no-append", "Skip adding skill to manifest file (skill files only)").option("--manifest-file <filename>", "Custom manifest filename for progressive disclosure").action(async (packageSpec, options) => {
12178
13181
  const convertTo = options.format || options.as;
12179
- if (convertTo && !["cursor", "claude", "continue", "windsurf", "copilot", "kiro", "agents.md", "gemini.md", "claude.md", "canonical", "gemini"].includes(convertTo)) {
12180
- throw new CLIError("\u274C Format must be one of: cursor, claude, continue, windsurf, copilot, kiro, agents.md, canonical, gemini\n\n\u{1F4A1} Examples:\n prpm install my-package --as cursor # Convert to Cursor format\n prpm install my-package --format claude # Convert to Claude format\n prpm install my-package --format kiro # Convert to Kiro format\n prpm install my-package --format agents.md # Convert to Agents.md format\n prpm install my-package # Install in native format", 1);
13182
+ const validFormats = import_types.FORMATS;
13183
+ if (convertTo && !validFormats.includes(convertTo)) {
13184
+ throw new CLIError(`\u274C Format must be one of: ${validFormats.join(", ")}
13185
+
13186
+ \u{1F4A1} Examples:
13187
+ prpm install my-package --as cursor # Convert to Cursor format
13188
+ prpm install my-package --format claude # Convert to Claude format
13189
+ prpm install my-package --format claude.md # Convert to Claude.md format
13190
+ prpm install my-package --format kiro # Convert to Kiro format
13191
+ prpm install my-package --format agents.md # Convert to Agents.md format
13192
+ prpm install my-package --format gemini.md # Convert to Gemini format
13193
+ prpm install my-package # Install in native format`, 1);
12181
13194
  }
12182
13195
  if (!packageSpec) {
12183
13196
  await installFromLockfile({
@@ -12200,7 +13213,7 @@ function createInstallCommand() {
12200
13213
  });
12201
13214
  return command;
12202
13215
  }
12203
- var import_commander11, import_chalk, import_registry_client5, import_stream, import_promises, tar, import_path10, import_zlib, import_promises2, import_os3;
13216
+ var import_commander11, import_chalk, import_registry_client5, import_stream, import_promises, tar, import_path10, import_zlib, import_promises2, import_os3, import_semver;
12204
13217
  var init_install = __esm({
12205
13218
  "src/commands/install.ts"() {
12206
13219
  "use strict";
@@ -12211,6 +13224,7 @@ var init_install = __esm({
12211
13224
  init_user_config();
12212
13225
  init_filesystem();
12213
13226
  init_telemetry();
13227
+ init_types();
12214
13228
  import_stream = require("stream");
12215
13229
  import_promises = require("stream/promises");
12216
13230
  tar = __toESM(require("tar"));
@@ -12220,6 +13234,7 @@ var init_install = __esm({
12220
13234
  import_zlib = __toESM(require("zlib"));
12221
13235
  import_promises2 = __toESM(require("fs/promises"));
12222
13236
  import_os3 = __toESM(require("os"));
13237
+ import_semver = __toESM(require("semver"));
12223
13238
  init_collections();
12224
13239
  init_lockfile();
12225
13240
  init_cursor_config();
@@ -12392,90 +13407,168 @@ init_cjs_shims();
12392
13407
  var import_commander2 = require("commander");
12393
13408
  init_lockfile();
12394
13409
  init_filesystem();
13410
+ init_types();
12395
13411
  var import_fs7 = require("fs");
12396
13412
  init_errors();
12397
13413
  init_agents_md_progressive();
12398
- async function handleUninstall(name) {
13414
+ var readline = __toESM(require("readline"));
13415
+ async function promptForFormat(packageId, formats) {
13416
+ console.log(`
13417
+ \u{1F4E6} Multiple formats found for ${packageId}:`);
13418
+ formats.forEach((fmt, idx) => {
13419
+ console.log(` ${idx + 1}. ${fmt}`);
13420
+ });
13421
+ console.log(` ${formats.length + 1}. All formats`);
13422
+ const rl = readline.createInterface({
13423
+ input: process.stdin,
13424
+ output: process.stdout
13425
+ });
13426
+ return new Promise((resolve2) => {
13427
+ rl.question("\nSelect format to uninstall (number): ", (answer) => {
13428
+ rl.close();
13429
+ const choice = parseInt(answer.trim(), 10);
13430
+ if (choice > 0 && choice <= formats.length) {
13431
+ resolve2(formats[choice - 1]);
13432
+ } else if (choice === formats.length + 1) {
13433
+ resolve2("all");
13434
+ } else {
13435
+ console.log("Invalid choice, uninstalling all formats");
13436
+ resolve2("all");
13437
+ }
13438
+ });
13439
+ });
13440
+ }
13441
+ async function handleUninstall(name, options = {}) {
12399
13442
  try {
12400
- console.log(`\u{1F5D1}\uFE0F Uninstalling package: ${name}`);
12401
- const pkg = await removePackage(name);
12402
- if (!pkg) {
13443
+ const requestedFormat = options.format || options.as;
13444
+ if (requestedFormat && !import_types.FORMATS.includes(requestedFormat)) {
13445
+ throw new CLIError(`\u274C Format must be one of: ${import_types.FORMATS.join(", ")}`, 1);
13446
+ }
13447
+ const lockfile = await readLockfile();
13448
+ if (!lockfile) {
13449
+ throw new CLIError("\u274C No prpm.lock file found", 1);
13450
+ }
13451
+ const matchingKeys = [];
13452
+ for (const key of Object.keys(lockfile.packages)) {
13453
+ const parsed = parseLockfileKey(key);
13454
+ if (parsed.packageId === name) {
13455
+ matchingKeys.push(key);
13456
+ }
13457
+ }
13458
+ if (matchingKeys.length === 0) {
12403
13459
  throw new CLIError(`\u274C Package "${name}" not found`, 1);
12404
13460
  }
12405
- if (pkg.progressiveDisclosure) {
12406
- const { manifestPath, resourceName, skillName } = pkg.progressiveDisclosure;
12407
- const name2 = resourceName || skillName;
12408
- if (name2) {
12409
- try {
12410
- await removeSkillFromManifest(name2, manifestPath);
12411
- console.log(` \u{1F4DD} Removed from ${manifestPath} manifest`);
12412
- } catch (error) {
12413
- console.warn(` \u26A0\uFE0F Failed to remove from manifest: ${error}`);
13461
+ let keysToUninstall;
13462
+ if (requestedFormat) {
13463
+ const requestedKey = getLockfileKey(name, requestedFormat);
13464
+ if (!lockfile.packages[requestedKey]) {
13465
+ if (lockfile.packages[name] && lockfile.packages[name].format === requestedFormat) {
13466
+ keysToUninstall = [name];
13467
+ } else {
13468
+ throw new CLIError(`\u274C Package "${name}" with format "${requestedFormat}" not found`, 1);
12414
13469
  }
13470
+ } else {
13471
+ keysToUninstall = [requestedKey];
13472
+ }
13473
+ } else if (matchingKeys.length > 1) {
13474
+ const formats = matchingKeys.map((key) => {
13475
+ const parsed = parseLockfileKey(key);
13476
+ return parsed.format || lockfile.packages[key].format || "unknown";
13477
+ });
13478
+ const selectedFormat = await promptForFormat(name, formats);
13479
+ if (selectedFormat === "all") {
13480
+ keysToUninstall = matchingKeys;
13481
+ } else {
13482
+ const selectedKey = matchingKeys[formats.indexOf(selectedFormat)];
13483
+ keysToUninstall = [selectedKey];
12415
13484
  }
13485
+ } else {
13486
+ keysToUninstall = matchingKeys;
12416
13487
  }
12417
- if (pkg.format === "claude" && pkg.subtype === "hook" && pkg.hookMetadata) {
12418
- const settingsPath = pkg.installedPath || ".claude/settings.json";
12419
- try {
12420
- const settingsContent = await import_fs7.promises.readFile(settingsPath, "utf-8");
12421
- const settings = JSON.parse(settingsContent);
12422
- if (settings.hooks) {
12423
- let removedCount = 0;
12424
- for (const event of pkg.hookMetadata.events) {
12425
- if (settings.hooks[event]) {
12426
- const originalLength = settings.hooks[event].length;
12427
- settings.hooks[event] = settings.hooks[event].filter(
12428
- (hook) => hook.__prpm_hook_id !== pkg.hookMetadata.hookId
12429
- );
12430
- const newLength = settings.hooks[event].length;
12431
- removedCount += originalLength - newLength;
12432
- if (settings.hooks[event].length === 0) {
12433
- delete settings.hooks[event];
13488
+ for (const lockfileKey of keysToUninstall) {
13489
+ const parsed = parseLockfileKey(lockfileKey);
13490
+ const formatDisplay = parsed.format ? ` (${parsed.format})` : "";
13491
+ console.log(`
13492
+ \u{1F5D1}\uFE0F Uninstalling package: ${name}${formatDisplay}`);
13493
+ const pkg = await removePackage(lockfileKey);
13494
+ if (!pkg) {
13495
+ throw new CLIError(`\u274C Package "${name}" not found`, 1);
13496
+ }
13497
+ if (pkg.progressiveDisclosure) {
13498
+ const { manifestPath, resourceName, skillName } = pkg.progressiveDisclosure;
13499
+ const name2 = resourceName || skillName;
13500
+ if (name2) {
13501
+ try {
13502
+ await removeSkillFromManifest(name2, manifestPath);
13503
+ console.log(` \u{1F4DD} Removed from ${manifestPath} manifest`);
13504
+ } catch (error) {
13505
+ console.warn(` \u26A0\uFE0F Failed to remove from manifest: ${error}`);
13506
+ }
13507
+ }
13508
+ }
13509
+ if (pkg.format === "claude" && pkg.subtype === "hook" && pkg.hookMetadata) {
13510
+ const settingsPath = pkg.installedPath || ".claude/settings.json";
13511
+ try {
13512
+ const settingsContent = await import_fs7.promises.readFile(settingsPath, "utf-8");
13513
+ const settings = JSON.parse(settingsContent);
13514
+ if (settings.hooks) {
13515
+ let removedCount = 0;
13516
+ for (const event of pkg.hookMetadata.events) {
13517
+ if (settings.hooks[event]) {
13518
+ const originalLength = settings.hooks[event].length;
13519
+ settings.hooks[event] = settings.hooks[event].filter(
13520
+ (hook) => hook.__prpm_hook_id !== pkg.hookMetadata.hookId
13521
+ );
13522
+ const newLength = settings.hooks[event].length;
13523
+ removedCount += originalLength - newLength;
13524
+ if (settings.hooks[event].length === 0) {
13525
+ delete settings.hooks[event];
13526
+ }
12434
13527
  }
12435
13528
  }
13529
+ await import_fs7.promises.writeFile(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
13530
+ console.log(` \u{1FA9D} Removed ${removedCount} hook(s) from ${settingsPath}`);
13531
+ }
13532
+ } catch (error) {
13533
+ const err = error;
13534
+ if (err.code === "ENOENT") {
13535
+ console.warn(` \u26A0\uFE0F Settings file not found: ${settingsPath}`);
13536
+ } else {
13537
+ throw new Error(`Failed to remove hooks from settings: ${error}`);
12436
13538
  }
12437
- await import_fs7.promises.writeFile(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
12438
- console.log(` \u{1FA9D} Removed ${removedCount} hook(s) from ${settingsPath}`);
13539
+ }
13540
+ console.log(`\u2705 Successfully uninstalled ${name}`);
13541
+ return;
13542
+ }
13543
+ const packageName = stripAuthorNamespace2(name);
13544
+ let targetPath;
13545
+ if (pkg.installedPath) {
13546
+ targetPath = pkg.installedPath;
13547
+ console.log(` \u{1F4CD} Using installation path from lock file: ${targetPath}`);
13548
+ } else {
13549
+ console.warn(` \u26A0\uFE0F No installation path in lock file for ${name}`);
13550
+ console.warn(` \u26A0\uFE0F This may indicate an old or corrupted lock file`);
13551
+ throw new CLIError(`Cannot uninstall ${name}: installation path unknown`, 1);
13552
+ }
13553
+ try {
13554
+ const stats = await import_fs7.promises.stat(targetPath);
13555
+ if (stats.isDirectory()) {
13556
+ await import_fs7.promises.rm(targetPath, { recursive: true, force: true });
13557
+ console.log(` \u{1F5D1}\uFE0F Deleted directory: ${targetPath}`);
13558
+ } else if (stats.isFile()) {
13559
+ await import_fs7.promises.unlink(targetPath);
13560
+ console.log(` \u{1F5D1}\uFE0F Deleted file: ${targetPath}`);
12439
13561
  }
12440
13562
  } catch (error) {
12441
13563
  const err = error;
12442
13564
  if (err.code === "ENOENT") {
12443
- console.warn(` \u26A0\uFE0F Settings file not found: ${settingsPath}`);
13565
+ console.warn(` \u26A0\uFE0F File/directory not found: ${targetPath}`);
12444
13566
  } else {
12445
- throw new Error(`Failed to remove hooks from settings: ${error}`);
13567
+ throw err;
12446
13568
  }
12447
13569
  }
12448
- console.log(`\u2705 Successfully uninstalled ${name}`);
12449
- return;
12450
- }
12451
- const packageName = stripAuthorNamespace2(name);
12452
- let targetPath;
12453
- if (pkg.installedPath) {
12454
- targetPath = pkg.installedPath;
12455
- console.log(` \u{1F4CD} Using installation path from lock file: ${targetPath}`);
12456
- } else {
12457
- console.warn(` \u26A0\uFE0F No installation path in lock file for ${name}`);
12458
- console.warn(` \u26A0\uFE0F This may indicate an old or corrupted lock file`);
12459
- throw new CLIError(`Cannot uninstall ${name}: installation path unknown`, 1);
12460
- }
12461
- try {
12462
- const stats = await import_fs7.promises.stat(targetPath);
12463
- if (stats.isDirectory()) {
12464
- await import_fs7.promises.rm(targetPath, { recursive: true, force: true });
12465
- console.log(` \u{1F5D1}\uFE0F Deleted directory: ${targetPath}`);
12466
- } else if (stats.isFile()) {
12467
- await import_fs7.promises.unlink(targetPath);
12468
- console.log(` \u{1F5D1}\uFE0F Deleted file: ${targetPath}`);
12469
- }
12470
- } catch (error) {
12471
- const err = error;
12472
- if (err.code === "ENOENT") {
12473
- console.warn(` \u26A0\uFE0F File/directory not found: ${targetPath}`);
12474
- } else {
12475
- throw err;
12476
- }
13570
+ console.log(`\u2705 Successfully uninstalled ${name}${formatDisplay}`);
12477
13571
  }
12478
- console.log(`\u2705 Successfully uninstalled ${name}`);
12479
13572
  } catch (error) {
12480
13573
  if (error instanceof CLIError) {
12481
13574
  throw error;
@@ -12485,7 +13578,7 @@ async function handleUninstall(name) {
12485
13578
  }
12486
13579
  function createUninstallCommand() {
12487
13580
  const command = new import_commander2.Command("uninstall");
12488
- command.description("Uninstall a prompt package").argument("<id>", "Package ID to uninstall").alias("remove").action(handleUninstall);
13581
+ command.description("Uninstall a prompt package").argument("<id>", "Package ID to uninstall").option("--format <format>", "Specific format to uninstall (if multiple formats installed)").option("--as <format>", "Alias for --format (use when multiple formats are installed)").alias("remove").action(handleUninstall);
12489
13582
  return command;
12490
13583
  }
12491
13584
 
@@ -12731,6 +13824,7 @@ var import_commander5 = require("commander");
12731
13824
  var import_registry_client = require("@pr-pm/registry-client");
12732
13825
  init_user_config();
12733
13826
  init_telemetry();
13827
+ init_types();
12734
13828
  init_errors();
12735
13829
  async function handleTrending(options) {
12736
13830
  const startTime = Date.now();
@@ -12784,12 +13878,12 @@ async function handleTrending(options) {
12784
13878
  }
12785
13879
  function createTrendingCommand() {
12786
13880
  const command = new import_commander5.Command("trending");
12787
- command.description("Show trending packages").option("--format <format>", "Filter by format (cursor, claude, continue, windsurf, copilot, kiro, agents.md, generic)").option("--subtype <subtype>", "Filter by subtype (rule, agent, skill, slash-command, prompt, workflow, tool, template, collection, chatmode, hook)").option("--limit <number>", "Number of packages to show", "10").action(async (options) => {
13881
+ command.description("Show trending packages").option("--format <format>", `Filter by format (${import_types.FORMATS.join(", ")})`).option("--subtype <subtype>", `Filter by subtype (${import_types.SUBTYPES.join(", ")})`).option("--limit <number>", "Number of packages to show", "10").action(async (options) => {
12788
13882
  const format = options.format;
12789
13883
  const subtype = options.subtype;
12790
13884
  const limit = options.limit ? parseInt(options.limit, 10) : 10;
12791
- const validFormats = ["cursor", "claude", "continue", "windsurf", "copilot", "kiro", "agents.md", "generic", "mcp"];
12792
- const validSubtypes = ["rule", "agent", "skill", "slash-command", "prompt", "workflow", "tool", "template", "collection", "chatmode", "hook"];
13885
+ const validFormats = import_types.FORMATS;
13886
+ const validSubtypes = import_types.SUBTYPES;
12793
13887
  if (options.format && !validFormats.includes(format)) {
12794
13888
  console.error(`\u274C Format must be one of: ${validFormats.join(", ")}`);
12795
13889
  throw new CLIError(`\u274C Format must be one of: ${validFormats.join(", ")}`, 1);
@@ -12823,7 +13917,8 @@ var import_commander7 = require("commander");
12823
13917
  var import_registry_client2 = require("@pr-pm/registry-client");
12824
13918
  init_user_config();
12825
13919
  init_telemetry();
12826
- var readline = __toESM(require("readline"));
13920
+ init_types();
13921
+ var readline2 = __toESM(require("readline"));
12827
13922
  init_errors();
12828
13923
  function getPackageIcon(format, subtype) {
12829
13924
  const subtypeIcons = {
@@ -12851,6 +13946,10 @@ function getPackageIcon(format, subtype) {
12851
13946
  "claude.md": "\u{1F916}",
12852
13947
  "opencode": "\u26A1",
12853
13948
  "droid": "\u{1F3ED}",
13949
+ "trae": "\u{1F3AF}",
13950
+ "aider": "\u{1F91D}",
13951
+ "zencoder": "\u26A1",
13952
+ "replit": "\u{1F52E}",
12854
13953
  "mcp": "\u{1F517}",
12855
13954
  "agents.md": "\u{1F4DD}",
12856
13955
  "ruler": "\u{1F4CF}",
@@ -12871,6 +13970,10 @@ function getPackageLabel(format, subtype) {
12871
13970
  "claude.md": "Claude",
12872
13971
  "opencode": "OpenCode",
12873
13972
  "droid": "Factory Droid",
13973
+ "trae": "Trae",
13974
+ "aider": "Aider",
13975
+ "zencoder": "Zencoder",
13976
+ "replit": "Replit",
12874
13977
  "mcp": "MCP",
12875
13978
  "agents.md": "Agents.md",
12876
13979
  "ruler": "Ruler",
@@ -12933,7 +14036,7 @@ function displayResults(packages, total, page, limit) {
12933
14036
  }
12934
14037
  function promptUser() {
12935
14038
  return new Promise((resolve2) => {
12936
- const rl = readline.createInterface({
14039
+ const rl = readline2.createInterface({
12937
14040
  input: process.stdin,
12938
14041
  output: process.stdout
12939
14042
  });
@@ -13160,14 +14263,14 @@ Try:`);
13160
14263
  }
13161
14264
  function createSearchCommand() {
13162
14265
  const command = new import_commander7.Command("search");
13163
- command.description("Search for packages in the registry").argument("[query]", "Search query (optional when using --format/--subtype or --author)").option("--format <format>", "Filter by package format (cursor, claude, continue, windsurf, copilot, kiro, agents.md, generic, mcp)").option("--subtype <subtype>", "Filter by package subtype (rule, agent, skill, slash-command, prompt, workflow, tool, template, collection, chatmode, hook)").option("--author <username>", "Filter by author username").option("--language <language>", "Filter by programming language (javascript, typescript, python, etc.)").option("--framework <framework>", "Filter by framework (react, nextjs, django, etc.)").option("--limit <number>", "Number of results per page", "20").option("--page <number>", "Page number (default: 1)", "1").option("--interactive", "Enable interactive pagination (default: true for multiple pages)", true).option("--no-interactive", "Disable interactive pagination").action(async (query, options) => {
14266
+ command.description("Search for packages in the registry").argument("[query]", "Search query (optional when using --format/--subtype or --author)").option("--format <format>", `Filter by package format (${import_types.FORMATS.join(", ")})`).option("--subtype <subtype>", `Filter by package subtype (${import_types.SUBTYPES.join(", ")})`).option("--author <username>", "Filter by author username").option("--language <language>", "Filter by programming language (javascript, typescript, python, etc.)").option("--framework <framework>", "Filter by framework (react, nextjs, django, etc.)").option("--limit <number>", "Number of results per page", "20").option("--page <number>", "Page number (default: 1)", "1").option("--interactive", "Enable interactive pagination (default: true for multiple pages)", true).option("--no-interactive", "Disable interactive pagination").action(async (query, options) => {
13164
14267
  const format = options.format;
13165
14268
  const subtype = options.subtype;
13166
14269
  const author = options.author;
13167
14270
  const limit = options.limit ? parseInt(options.limit, 10) : 20;
13168
14271
  const page = options.page ? parseInt(options.page, 10) : 1;
13169
- const validFormats = ["cursor", "claude", "continue", "windsurf", "copilot", "kiro", "agents.md", "generic", "mcp"];
13170
- const validSubtypes = ["rule", "agent", "skill", "slash-command", "prompt", "workflow", "tool", "template", "collection", "chatmode", "hook"];
14272
+ const validFormats = [...import_types.FORMATS];
14273
+ const validSubtypes = [...import_types.SUBTYPES];
13171
14274
  if (options.format && !validFormats.includes(format)) {
13172
14275
  console.error(`\u274C Format must be one of: ${validFormats.join(", ")}`);
13173
14276
  throw new CLIError(`\u274C Format must be one of: ${validFormats.join(", ")}`, 1);
@@ -14275,7 +15378,11 @@ async function handlePublish(options) {
14275
15378
  console.log(" Will publish each separately\n");
14276
15379
  }
14277
15380
  let filteredManifests = manifests;
14278
- if (options.package) {
15381
+ if (options.collection) {
15382
+ filteredManifests = [];
15383
+ console.log(` Skipping packages (publishing collection only)
15384
+ `);
15385
+ } else if (options.package) {
14279
15386
  filteredManifests = manifests.filter((m) => m.name === options.package);
14280
15387
  if (filteredManifests.length === 0) {
14281
15388
  throw new Error(`Package "${options.package}" not found in manifest. Available packages: ${manifests.map((m) => m.name).join(", ")}`);
@@ -14608,7 +15715,6 @@ ${"=".repeat(60)}`);
14608
15715
  };
14609
15716
  const result = await client.createCollection(collectionData);
14610
15717
  console.log(`\u2705 Collection published successfully!`);
14611
- console.log(` Scope: ${result.scope}`);
14612
15718
  console.log(` Name: ${result.name_slug}`);
14613
15719
  console.log(` Version: ${result.version || "1.0.0"}`);
14614
15720
  console.log("");
@@ -15306,14 +16412,9 @@ var import_commander19 = require("commander");
15306
16412
  var import_promises7 = require("fs/promises");
15307
16413
  var import_path15 = require("path");
15308
16414
  var import_fs12 = require("fs");
15309
- var readline3 = __toESM(require("readline/promises"));
16415
+ var readline4 = __toESM(require("readline/promises"));
15310
16416
  var import_process = require("process");
15311
-
15312
- // src/types.ts
15313
- init_cjs_shims();
15314
- var import_types = require("@pr-pm/types");
15315
-
15316
- // src/commands/init.ts
16417
+ init_types();
15317
16418
  init_errors();
15318
16419
  var FORMAT_EXAMPLES = {
15319
16420
  cursor: {
@@ -15746,7 +16847,7 @@ async function initPackage(options) {
15746
16847
  (f) => f.replace(/example-skill/g, config.name || "example-skill")
15747
16848
  );
15748
16849
  } else {
15749
- const rl = readline3.createInterface({ input: import_process.stdin, output: import_process.stdout });
16850
+ const rl = readline4.createInterface({ input: import_process.stdin, output: import_process.stdout });
15750
16851
  try {
15751
16852
  console.log("\n\u{1F680} Welcome to PRPM package initialization!\n");
15752
16853
  console.log("This utility will walk you through creating a prpm.json file.\n");
@@ -16326,12 +17427,12 @@ init_cjs_shims();
16326
17427
  var import_commander22 = require("commander");
16327
17428
  init_user_config();
16328
17429
  init_telemetry();
16329
- var readline4 = __toESM(require("readline"));
17430
+ var readline5 = __toESM(require("readline"));
16330
17431
  var fs10 = __toESM(require("fs"));
16331
17432
  var path7 = __toESM(require("path"));
16332
17433
  init_errors();
16333
17434
  function createReadline() {
16334
- return readline4.createInterface({
17435
+ return readline5.createInterface({
16335
17436
  input: process.stdin,
16336
17437
  output: process.stdout
16337
17438
  });
@@ -17473,7 +18574,7 @@ async function handleStarred(options) {
17473
18574
  for (const collection of collections) {
17474
18575
  const stars = `\u2B50 ${collection.stars || 0}`.padEnd(8);
17475
18576
  const packages2 = `\u{1F4E6} ${collection.package_count || 0} packages`;
17476
- console.log(` ${collection.scope}/${collection.name_slug}`);
18577
+ console.log(` ${collection.name_slug}`);
17477
18578
  console.log(` ${stars} ${packages2}`);
17478
18579
  if (collection.description) {
17479
18580
  const desc = collection.description.length > 80 ? collection.description.substring(0, 77) + "..." : collection.description;