prpm 1.1.7 → 1.1.9

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
@@ -3211,7 +3211,7 @@ function fromClaude(content, metadata, sourceFormat = "claude", explicitSubtype)
3211
3211
  }
3212
3212
  };
3213
3213
  sections.push(metadataSection);
3214
- const toolsField = frontmatter["allowed-tools"] || frontmatter.tools;
3214
+ const toolsField = frontmatter.tools || frontmatter["allowed-tools"];
3215
3215
  if (toolsField) {
3216
3216
  const tools = toolsField.split(",").map((t) => t.trim()).filter(Boolean);
3217
3217
  if (tools.length > 0) {
@@ -9382,7 +9382,11 @@ function loadSchema(format, subtype) {
9382
9382
  "claude:hook": "claude-hook.schema.json",
9383
9383
  "cursor:slash-command": "cursor-command.schema.json",
9384
9384
  "kiro:hook": "kiro-hooks.schema.json",
9385
- "kiro:agent": "kiro-agent.schema.json"
9385
+ "kiro:agent": "kiro-agent.schema.json",
9386
+ "droid:skill": "droid-skill.schema.json",
9387
+ "droid:slash-command": "droid-slash-command.schema.json",
9388
+ "droid:hook": "droid-hook.schema.json",
9389
+ "opencode:slash-command": "opencode-slash-command.schema.json"
9386
9390
  };
9387
9391
  schemaFilename = subtypeSchemaMap[cacheKey];
9388
9392
  }
@@ -9789,24 +9793,45 @@ function convertContent2(pkg, warnings, options, isSlashCommand = false) {
9789
9793
  const metadata = pkg.content.sections.find((s) => s.type === "metadata");
9790
9794
  const tools = pkg.content.sections.find((s) => s.type === "tools");
9791
9795
  const persona = pkg.content.sections.find((s) => s.type === "persona");
9796
+ lines.push("---");
9792
9797
  if (!isSlashCommand) {
9793
- lines.push("---");
9794
- lines.push(`name: ${pkg.name}`);
9798
+ lines.push(`name: ${pkg.id}`);
9795
9799
  if ((metadata == null ? void 0 : metadata.type) === "metadata") {
9796
9800
  lines.push(`description: ${metadata.data.description}`);
9797
9801
  }
9798
9802
  const toolsValue = ((_a = options == null ? void 0 : options.claudeConfig) == null ? void 0 : _a.tools) || ((tools == null ? void 0 : tools.type) === "tools" ? tools.tools.join(", ") : void 0);
9799
9803
  if (toolsValue) {
9800
- lines.push(`allowed-tools: ${toolsValue}`);
9804
+ lines.push(`tools: ${toolsValue}`);
9801
9805
  }
9802
9806
  const storedModel = (metadata == null ? void 0 : metadata.type) === "metadata" ? (_b = metadata.data.claudeAgent) == null ? void 0 : _b.model : void 0;
9803
9807
  const modelValue = ((_c = options == null ? void 0 : options.claudeConfig) == null ? void 0 : _c.model) || storedModel;
9804
9808
  if (modelValue) {
9805
9809
  lines.push(`model: ${modelValue}`);
9806
9810
  }
9807
- lines.push("---");
9808
- lines.push("");
9811
+ } else {
9812
+ const claudeSlashCommand = (metadata == null ? void 0 : metadata.type) === "metadata" ? metadata.data.claudeSlashCommand : void 0;
9813
+ if (claudeSlashCommand) {
9814
+ if (claudeSlashCommand.allowedTools) {
9815
+ lines.push(`allowed-tools: ${claudeSlashCommand.allowedTools}`);
9816
+ }
9817
+ if (claudeSlashCommand.argumentHint) {
9818
+ lines.push(`argument-hint: ${claudeSlashCommand.argumentHint}`);
9819
+ }
9820
+ if (claudeSlashCommand.description) {
9821
+ lines.push(`description: ${claudeSlashCommand.description}`);
9822
+ }
9823
+ if (claudeSlashCommand.model) {
9824
+ lines.push(`model: ${claudeSlashCommand.model}`);
9825
+ }
9826
+ if (claudeSlashCommand.disableModelInvocation !== void 0) {
9827
+ lines.push(`disable-model-invocation: ${claudeSlashCommand.disableModelInvocation}`);
9828
+ }
9829
+ } else if ((metadata == null ? void 0 : metadata.type) === "metadata" && metadata.data.description) {
9830
+ lines.push(`description: ${metadata.data.description}`);
9831
+ }
9809
9832
  }
9833
+ lines.push("---");
9834
+ lines.push("");
9810
9835
  if ((metadata == null ? void 0 : metadata.type) === "metadata") {
9811
9836
  const { title, icon } = metadata.data;
9812
9837
  if (icon) {
@@ -10282,9 +10307,10 @@ function toKiro(pkg, options = {}) {
10282
10307
  const warnings = [];
10283
10308
  let qualityScore = 100;
10284
10309
  try {
10285
- const config = options.kiroConfig;
10286
- if (!config || !config.inclusion) {
10287
- throw new Error("Kiro format requires inclusion mode (always|fileMatch|manual)");
10310
+ const config = options.kiroConfig || { inclusion: "always" };
10311
+ if (!config.inclusion) {
10312
+ config.inclusion = "always";
10313
+ warnings.push('No inclusion mode specified, defaulting to "always" per schema');
10288
10314
  }
10289
10315
  if (config.inclusion === "fileMatch" && !config.fileMatchPattern) {
10290
10316
  throw new Error("fileMatch inclusion mode requires fileMatchPattern");
@@ -10318,7 +10344,7 @@ ${content}`;
10318
10344
  }
10319
10345
  function generateFrontmatter2(config) {
10320
10346
  const lines = ["---"];
10321
- lines.push(`inclusion: ${config.inclusion}`);
10347
+ lines.push(`inclusion: ${config.inclusion || "always"}`);
10322
10348
  if (config.inclusion === "fileMatch" && config.fileMatchPattern) {
10323
10349
  lines.push(`fileMatchPattern: "${config.fileMatchPattern}"`);
10324
10350
  }
@@ -10783,16 +10809,7 @@ function toAgentsMd(pkg, options = {}) {
10783
10809
  let qualityScore = 100;
10784
10810
  try {
10785
10811
  const config = options.agentsMdConfig || {};
10786
- const content = convertContent5(pkg, warnings, config);
10787
- let fullContent;
10788
- if (config.includeFrontmatter && (config.project || config.scope)) {
10789
- const frontmatter = generateFrontmatter3(config);
10790
- fullContent = `${frontmatter}
10791
-
10792
- ${content}`;
10793
- } else {
10794
- fullContent = content;
10795
- }
10812
+ const fullContent = convertContent5(pkg, warnings, config);
10796
10813
  const lossyConversion = warnings.some((w) => w.includes("not supported") || w.includes("skipped"));
10797
10814
  if (lossyConversion) {
10798
10815
  qualityScore -= 10;
@@ -10815,17 +10832,6 @@ ${content}`;
10815
10832
  };
10816
10833
  }
10817
10834
  }
10818
- function generateFrontmatter3(config) {
10819
- const lines = ["---"];
10820
- if (config.project) {
10821
- lines.push(`project: ${config.project}`);
10822
- }
10823
- if (config.scope) {
10824
- lines.push(`scope: ${config.scope}`);
10825
- }
10826
- lines.push("---");
10827
- return lines.join("\n");
10828
- }
10829
10835
  function convertContent5(pkg, warnings, config) {
10830
10836
  var _a, _b, _c;
10831
10837
  const lines = [];
@@ -11292,6 +11298,45 @@ var init_to_droid = __esm({
11292
11298
  }
11293
11299
  });
11294
11300
 
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");
11337
+ }
11338
+ });
11339
+
11295
11340
  // ../converters/dist/index.js
11296
11341
  var init_dist = __esm({
11297
11342
  "../converters/dist/index.js"() {
@@ -11324,6 +11369,7 @@ var init_dist = __esm({
11324
11369
  init_to_droid();
11325
11370
  init_taxonomy_utils();
11326
11371
  init_validation();
11372
+ init_schema_files();
11327
11373
  }
11328
11374
  });
11329
11375
 
@@ -11678,7 +11724,7 @@ async function handleInstall(packageSpec, options) {
11678
11724
  destDir = getDestinationDir2(effectiveFormat, effectiveSubtype, pkg.name);
11679
11725
  if (locationOverride && effectiveFormat === "cursor") {
11680
11726
  const relativeDestDir = destDir.startsWith("./") ? destDir.slice(2) : destDir;
11681
- destDir = import_path9.default.join(locationOverride, relativeDestDir);
11727
+ destDir = import_path10.default.join(locationOverride, relativeDestDir);
11682
11728
  console.log(` \u{1F4C1} Installing Cursor package to custom location: ${destDir}`);
11683
11729
  }
11684
11730
  let mainFile = extractedFiles[0].content;
@@ -11699,7 +11745,7 @@ async function handleInstall(packageSpec, options) {
11699
11745
  const manifestFilename = getManifestFilename(effectiveFormat);
11700
11746
  let targetPath = manifestFilename;
11701
11747
  if (locationOverride) {
11702
- targetPath = import_path9.default.join(locationOverride, `${manifestFilename.replace(".md", ".override.md")}`);
11748
+ targetPath = import_path10.default.join(locationOverride, `${manifestFilename.replace(".md", ".override.md")}`);
11703
11749
  console.log(` \u{1F4C1} Installing to custom location: ${targetPath}`);
11704
11750
  }
11705
11751
  destPath = targetPath;
@@ -11800,7 +11846,7 @@ async function handleInstall(packageSpec, options) {
11800
11846
  destDir = getDestinationDir2(effectiveFormat, effectiveSubtype, pkg.name);
11801
11847
  if (locationOverride && effectiveFormat === "cursor") {
11802
11848
  const relativeDestDir = destDir.startsWith("./") ? destDir.slice(2) : destDir;
11803
- destDir = import_path9.default.join(locationOverride, relativeDestDir);
11849
+ destDir = import_path10.default.join(locationOverride, relativeDestDir);
11804
11850
  console.log(` \u{1F4C1} Installing Cursor package to custom location: ${destDir}`);
11805
11851
  }
11806
11852
  const packageName = stripAuthorNamespace2(packageId);
@@ -11989,7 +12035,7 @@ async function extractTarball(tarball, packageId) {
11989
12035
  } catch (error) {
11990
12036
  throw new CLIError(`Package decompression failed: ${error.message}`);
11991
12037
  }
11992
- const tmpDir = await import_promises2.default.mkdtemp(import_path9.default.join(import_os3.default.tmpdir(), "prpm-"));
12038
+ const tmpDir = await import_promises2.default.mkdtemp(import_path10.default.join(import_os3.default.tmpdir(), "prpm-"));
11993
12039
  const cleanup = async () => {
11994
12040
  try {
11995
12041
  await import_promises2.default.rm(tmpDir, { recursive: true, force: true });
@@ -12037,7 +12083,7 @@ async function collectExtractedFiles(rootDir, excludedNames, fs12) {
12037
12083
  if (!currentDir) continue;
12038
12084
  const entries = await fs12.readdir(currentDir, { withFileTypes: true });
12039
12085
  for (const entry of entries) {
12040
- const fullPath = import_path9.default.join(currentDir, entry.name);
12086
+ const fullPath = import_path10.default.join(currentDir, entry.name);
12041
12087
  if (entry.isDirectory()) {
12042
12088
  dirs.push(fullPath);
12043
12089
  continue;
@@ -12049,7 +12095,7 @@ async function collectExtractedFiles(rootDir, excludedNames, fs12) {
12049
12095
  continue;
12050
12096
  }
12051
12097
  const content = await fs12.readFile(fullPath, "utf-8");
12052
- const relativePath = import_path9.default.relative(rootDir, fullPath).split(import_path9.default.sep).join("/");
12098
+ const relativePath = import_path10.default.relative(rootDir, fullPath).split(import_path10.default.sep).join("/");
12053
12099
  files.push({
12054
12100
  name: relativePath,
12055
12101
  content
@@ -12081,11 +12127,11 @@ async function installFromLockfile(options) {
12081
12127
  console.log(` Installing ${packageId}...`);
12082
12128
  let locationOverride = options.location;
12083
12129
  if (!locationOverride && lockEntry.format === "agents.md" && lockEntry.installedPath) {
12084
- const baseName = import_path9.default.basename(lockEntry.installedPath);
12130
+ const baseName = import_path10.default.basename(lockEntry.installedPath);
12085
12131
  if (baseName === "AGENTS.override.md") {
12086
- locationOverride = import_path9.default.dirname(lockEntry.installedPath);
12132
+ locationOverride = import_path10.default.dirname(lockEntry.installedPath);
12087
12133
  } else if (baseName !== "AGENTS.md") {
12088
- locationOverride = import_path9.default.dirname(lockEntry.installedPath);
12134
+ locationOverride = import_path10.default.dirname(lockEntry.installedPath);
12089
12135
  }
12090
12136
  }
12091
12137
  const manifestFile = (_a = lockEntry.progressiveDisclosure) == null ? void 0 : _a.manifestPath;
@@ -12154,7 +12200,7 @@ function createInstallCommand() {
12154
12200
  });
12155
12201
  return command;
12156
12202
  }
12157
- var import_commander11, import_chalk, import_registry_client5, import_stream, import_promises, tar, import_path9, import_zlib, import_promises2, import_os3;
12203
+ var import_commander11, import_chalk, import_registry_client5, import_stream, import_promises, tar, import_path10, import_zlib, import_promises2, import_os3;
12158
12204
  var init_install = __esm({
12159
12205
  "src/commands/install.ts"() {
12160
12206
  "use strict";
@@ -12170,7 +12216,7 @@ var init_install = __esm({
12170
12216
  tar = __toESM(require("tar"));
12171
12217
  init_errors();
12172
12218
  init_prompts();
12173
- import_path9 = __toESM(require("path"));
12219
+ import_path10 = __toESM(require("path"));
12174
12220
  import_zlib = __toESM(require("zlib"));
12175
12221
  import_promises2 = __toESM(require("fs/promises"));
12176
12222
  import_os3 = __toESM(require("os"));
@@ -12187,7 +12233,7 @@ var init_install = __esm({
12187
12233
  init_cjs_shims();
12188
12234
  var import_commander29 = require("commander");
12189
12235
  var import_fs15 = require("fs");
12190
- var import_path18 = require("path");
12236
+ var import_path19 = require("path");
12191
12237
 
12192
12238
  // src/commands/list.ts
12193
12239
  init_cjs_shims();
@@ -13352,7 +13398,7 @@ init_install();
13352
13398
  init_cjs_shims();
13353
13399
  var import_commander12 = require("commander");
13354
13400
  var import_promises6 = require("fs/promises");
13355
- var import_path13 = require("path");
13401
+ var import_path14 = require("path");
13356
13402
  var tar2 = __toESM(require("tar"));
13357
13403
  var import_os4 = require("os");
13358
13404
  var import_crypto2 = require("crypto");
@@ -13526,13 +13572,13 @@ init_cjs_shims();
13526
13572
  var import_ajv2 = __toESM(require("ajv"));
13527
13573
  var import_ajv_formats2 = __toESM(require("ajv-formats"));
13528
13574
  var import_fs10 = require("fs");
13529
- var import_path10 = require("path");
13575
+ var import_path11 = require("path");
13530
13576
  var schema2;
13531
13577
  var schemaCandidates = [
13532
13578
  // Source file layout (src/core → ../../schemas)
13533
- (0, import_path10.join)(__dirname, "../../schemas/prpm-manifest.schema.json"),
13579
+ (0, import_path11.join)(__dirname, "../../schemas/prpm-manifest.schema.json"),
13534
13580
  // Bundled layout (dist/index.js → ../schemas)
13535
- (0, import_path10.join)(__dirname, "../schemas/prpm-manifest.schema.json")
13581
+ (0, import_path11.join)(__dirname, "../schemas/prpm-manifest.schema.json")
13536
13582
  ];
13537
13583
  for (const candidate of schemaCandidates) {
13538
13584
  try {
@@ -13592,7 +13638,7 @@ function getManifestSchema() {
13592
13638
  // src/utils/license-extractor.ts
13593
13639
  init_cjs_shims();
13594
13640
  var import_promises3 = require("fs/promises");
13595
- var import_path11 = require("path");
13641
+ var import_path12 = require("path");
13596
13642
  var import_fs11 = require("fs");
13597
13643
  var LICENSE_FILE_PATTERNS = [
13598
13644
  "LICENSE",
@@ -13642,7 +13688,7 @@ function generateLicenseUrl(repositoryUrl, fileName) {
13642
13688
  async function extractLicenseInfo(repositoryUrl) {
13643
13689
  const cwd = process.cwd();
13644
13690
  for (const fileName of LICENSE_FILE_PATTERNS) {
13645
- const filePath = (0, import_path11.join)(cwd, fileName);
13691
+ const filePath = (0, import_path12.join)(cwd, fileName);
13646
13692
  try {
13647
13693
  await (0, import_promises3.access)(filePath, import_fs11.constants.R_OK);
13648
13694
  const text = await (0, import_promises3.readFile)(filePath, "utf-8");
@@ -13678,7 +13724,7 @@ function validateLicenseInfo(licenseInfo, packageName) {
13678
13724
  // src/utils/snippet-extractor.ts
13679
13725
  init_cjs_shims();
13680
13726
  var import_promises4 = require("fs/promises");
13681
- var import_path12 = require("path");
13727
+ var import_path13 = require("path");
13682
13728
  var MAX_SNIPPET_LENGTH = 2e3;
13683
13729
  async function extractSnippet(manifest) {
13684
13730
  const cwd = process.cwd();
@@ -13694,7 +13740,7 @@ async function extractSnippet(manifest) {
13694
13740
  const firstFile = manifest.files[0];
13695
13741
  fileName = typeof firstFile === "string" ? firstFile : firstFile.path;
13696
13742
  }
13697
- const fullPath = (0, import_path12.join)(cwd, fileName);
13743
+ const fullPath = (0, import_path13.join)(cwd, fileName);
13698
13744
  const stats = await (0, import_promises4.stat)(fullPath);
13699
13745
  if (stats.isDirectory()) {
13700
13746
  console.warn(`\u26A0\uFE0F Skipping snippet extraction: "${fullPath}" is a directory`);
@@ -13882,6 +13928,9 @@ async function validatePackageFiles(manifest) {
13882
13928
  if (manifest.subtype === "skill") {
13883
13929
  return filePath.endsWith("SKILL.md");
13884
13930
  }
13931
+ if (manifest.subtype === "hook") {
13932
+ return false;
13933
+ }
13885
13934
  if (filePath.endsWith(".json")) {
13886
13935
  return false;
13887
13936
  }
@@ -13951,7 +14000,7 @@ async function validatePackageFiles(manifest) {
13951
14000
 
13952
14001
  // src/commands/publish.ts
13953
14002
  async function findAndLoadManifests() {
13954
- const prpmJsonPath = (0, import_path13.join)(process.cwd(), "prpm.json");
14003
+ const prpmJsonPath = (0, import_path14.join)(process.cwd(), "prpm.json");
13955
14004
  let prpmJsonExists = false;
13956
14005
  let prpmJsonError = null;
13957
14006
  try {
@@ -14003,7 +14052,7 @@ async function findAndLoadManifests() {
14003
14052
  throw error;
14004
14053
  }
14005
14054
  }
14006
- const marketplaceJsonPath = (0, import_path13.join)(process.cwd(), ".claude", "marketplace.json");
14055
+ const marketplaceJsonPath = (0, import_path14.join)(process.cwd(), ".claude", "marketplace.json");
14007
14056
  try {
14008
14057
  const content = await (0, import_promises6.readFile)(marketplaceJsonPath, "utf-8");
14009
14058
  const marketplaceData = JSON.parse(content);
@@ -14019,7 +14068,7 @@ async function findAndLoadManifests() {
14019
14068
  return { manifests, collections: [], source: ".claude/marketplace.json" };
14020
14069
  } catch (error) {
14021
14070
  }
14022
- const marketplaceJsonPluginPath = (0, import_path13.join)(process.cwd(), ".claude-plugin", "marketplace.json");
14071
+ const marketplaceJsonPluginPath = (0, import_path14.join)(process.cwd(), ".claude-plugin", "marketplace.json");
14023
14072
  try {
14024
14073
  const content = await (0, import_promises6.readFile)(marketplaceJsonPluginPath, "utf-8");
14025
14074
  const marketplaceData = JSON.parse(content);
@@ -14136,8 +14185,8 @@ function predictScopedPackageName(manifestName, username, organization) {
14136
14185
  return manifestName;
14137
14186
  }
14138
14187
  async function createTarball(manifest) {
14139
- const tmpDir = (0, import_path13.join)((0, import_os4.tmpdir)(), `prpm-${(0, import_crypto2.randomBytes)(8).toString("hex")}`);
14140
- const tarballPath = (0, import_path13.join)(tmpDir, "package.tar.gz");
14188
+ const tmpDir = (0, import_path14.join)((0, import_os4.tmpdir)(), `prpm-${(0, import_crypto2.randomBytes)(8).toString("hex")}`);
14189
+ const tarballPath = (0, import_path14.join)(tmpDir, "package.tar.gz");
14141
14190
  try {
14142
14191
  await (0, import_promises6.mkdir)(tmpDir, { recursive: true });
14143
14192
  const filePaths = normalizeFilePaths2(manifest.files);
@@ -14198,7 +14247,7 @@ async function handlePublish(options) {
14198
14247
  const { manifests, collections, source } = await findAndLoadManifests();
14199
14248
  if (source === "prpm.json (multi-package)" || source === "prpm.json") {
14200
14249
  try {
14201
- const prpmJsonPath = (0, import_path13.join)(process.cwd(), "prpm.json");
14250
+ const prpmJsonPath = (0, import_path14.join)(process.cwd(), "prpm.json");
14202
14251
  const prpmContent = await (0, import_promises6.readFile)(prpmJsonPath, "utf-8");
14203
14252
  const prpmManifest = JSON.parse(prpmContent);
14204
14253
  if (prpmManifest.scripts) {
@@ -14274,7 +14323,7 @@ async function handlePublish(options) {
14274
14323
  const RETRY_DELAY_MS = options.dryRun || process.env.NODE_ENV === "test" ? 0 : parseInt(process.env.PRPM_RETRY_DELAY_MS || "5000");
14275
14324
  const delay = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
14276
14325
  const isRetriableError = (error2) => {
14277
- return error2.includes("Service Unavailable") || error2.includes("at capacity") || error2.includes("503") || error2.includes("ECONNRESET") || error2.includes("ETIMEDOUT");
14326
+ return error2.includes("Service Unavailable") || error2.includes("Bad Gateway") || error2.includes("at capacity") || error2.includes("502") || error2.includes("503") || error2.includes("ECONNRESET") || error2.includes("ETIMEDOUT");
14278
14327
  };
14279
14328
  if (filteredManifests.length > 1 && BATCH_DELAY_MS > 0) {
14280
14329
  console.log(`\u{1F4E6} Publishing ${filteredManifests.length} packages in batches of ${BATCH_SIZE}`);
@@ -14418,6 +14467,15 @@ ${"=".repeat(60)}`);
14418
14467
  }
14419
14468
  console.log(` Size: ${sizeDisplay}`);
14420
14469
  console.log("");
14470
+ let publishAsAuthor;
14471
+ if ((userInfo == null ? void 0 : userInfo.is_admin) && manifest.author) {
14472
+ publishAsAuthor = typeof manifest.author === "string" ? manifest.author : manifest.author.name;
14473
+ console.log(` \u{1F510} Admin override: Publishing as author "${publishAsAuthor}"`);
14474
+ }
14475
+ if (selectedOrgId) {
14476
+ console.log(` Publishing as organization: ${(_b = userInfo.organizations.find((org) => org.id === selectedOrgId)) == null ? void 0 : _b.name}`);
14477
+ console.log(` Organization ID: ${selectedOrgId}`);
14478
+ }
14421
14479
  if (options.dryRun) {
14422
14480
  console.log("\u2705 Dry run successful! Package is ready to publish.");
14423
14481
  publishedPackages.push({
@@ -14429,15 +14487,6 @@ ${"=".repeat(60)}`);
14429
14487
  break;
14430
14488
  }
14431
14489
  console.log("\u{1F680} Publishing to registry...");
14432
- let publishAsAuthor;
14433
- if ((userInfo == null ? void 0 : userInfo.is_admin) && manifest.author) {
14434
- publishAsAuthor = typeof manifest.author === "string" ? manifest.author : manifest.author.name;
14435
- console.log(` \u{1F510} Admin override: Publishing as author "${publishAsAuthor}"`);
14436
- }
14437
- if (selectedOrgId) {
14438
- console.log(` Publishing as organization: ${(_b = userInfo.organizations.find((org) => org.id === selectedOrgId)) == null ? void 0 : _b.name}`);
14439
- console.log(` Organization ID: ${selectedOrgId}`);
14440
- }
14441
14490
  const publishOptions = {};
14442
14491
  if (selectedOrgId) {
14443
14492
  publishOptions.orgId = selectedOrgId;
@@ -15255,7 +15304,7 @@ function createSchemaCommand() {
15255
15304
  init_cjs_shims();
15256
15305
  var import_commander19 = require("commander");
15257
15306
  var import_promises7 = require("fs/promises");
15258
- var import_path14 = require("path");
15307
+ var import_path15 = require("path");
15259
15308
  var import_fs12 = require("fs");
15260
15309
  var readline3 = __toESM(require("readline/promises"));
15261
15310
  var import_process = require("process");
@@ -15623,8 +15672,8 @@ function getDefaultAuthor() {
15623
15672
  async function createExampleFiles(format, files, packageName) {
15624
15673
  const templates = EXAMPLE_TEMPLATES[format] || {};
15625
15674
  for (const file of files) {
15626
- const filePath = (0, import_path14.join)(process.cwd(), file);
15627
- const dirPath = (0, import_path14.join)(filePath, "..");
15675
+ const filePath = (0, import_path15.join)(process.cwd(), file);
15676
+ const dirPath = (0, import_path15.join)(filePath, "..");
15628
15677
  if (!(0, import_fs12.existsSync)(dirPath)) {
15629
15678
  await (0, import_promises7.mkdir)(dirPath, { recursive: true });
15630
15679
  }
@@ -15642,7 +15691,7 @@ Add your content here.
15642
15691
  }
15643
15692
  }
15644
15693
  async function createReadme(config) {
15645
- const readmePath = (0, import_path14.join)(process.cwd(), "README.md");
15694
+ const readmePath = (0, import_path15.join)(process.cwd(), "README.md");
15646
15695
  if ((0, import_fs12.existsSync)(readmePath)) {
15647
15696
  console.log(" Skipping README.md (already exists)");
15648
15697
  return;
@@ -15677,7 +15726,7 @@ ${config.license}
15677
15726
  console.log(" Created README.md");
15678
15727
  }
15679
15728
  async function initPackage(options) {
15680
- const manifestPath = (0, import_path14.join)(process.cwd(), "prpm.json");
15729
+ const manifestPath = (0, import_path15.join)(process.cwd(), "prpm.json");
15681
15730
  if ((0, import_fs12.existsSync)(manifestPath) && !options.force) {
15682
15731
  throw new Error(
15683
15732
  "prpm.json already exists. Use --force to overwrite, or run this command in a different directory."
@@ -15977,15 +16026,15 @@ function createConfigCommand() {
15977
16026
  init_cjs_shims();
15978
16027
  var import_commander21 = require("commander");
15979
16028
  var import_promises8 = require("fs/promises");
15980
- var import_path15 = require("path");
16029
+ var import_path16 = require("path");
15981
16030
  init_telemetry();
15982
16031
  init_lockfile();
15983
16032
  init_errors();
15984
16033
  function detectPackageInfo(filePath, content) {
15985
- const fileName = (0, import_path15.basename)(filePath);
16034
+ const fileName = (0, import_path16.basename)(filePath);
15986
16035
  const lowerFileName = fileName.toLowerCase();
15987
16036
  if (fileName === "SKILL.md") {
15988
- const dirName = (0, import_path15.basename)((0, import_path15.join)(filePath, ".."));
16037
+ const dirName = (0, import_path16.basename)((0, import_path16.join)(filePath, ".."));
15989
16038
  return {
15990
16039
  format: "claude",
15991
16040
  subtype: "skill",
@@ -16037,8 +16086,8 @@ async function scanDirectory2(dirPath, baseDir, scanDir, maxDepth = 5, currentDe
16037
16086
  try {
16038
16087
  const entries = await (0, import_promises8.readdir)(dirPath, { withFileTypes: true });
16039
16088
  for (const entry of entries) {
16040
- const fullPath = (0, import_path15.join)(dirPath, entry.name);
16041
- const relativePath = (0, import_path15.relative)(baseDir, fullPath);
16089
+ const fullPath = (0, import_path16.join)(dirPath, entry.name);
16090
+ const relativePath = (0, import_path16.relative)(baseDir, fullPath);
16042
16091
  if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === "build") {
16043
16092
  continue;
16044
16093
  }
@@ -16175,7 +16224,7 @@ async function handleCatalog(directories, options) {
16175
16224
  success = true;
16176
16225
  return;
16177
16226
  }
16178
- const prpmJsonPath = options.output || (0, import_path15.join)(process.cwd(), "prpm.json");
16227
+ const prpmJsonPath = options.output || (0, import_path16.join)(process.cwd(), "prpm.json");
16179
16228
  let manifest;
16180
16229
  if (options.append) {
16181
16230
  try {
@@ -16213,7 +16262,7 @@ async function handleCatalog(directories, options) {
16213
16262
  }
16214
16263
  let description = `${discovered.format} ${discovered.subtype}`;
16215
16264
  try {
16216
- const firstFilePath = (0, import_path15.join)(process.cwd(), discovered.scanDir, discovered.files[0]);
16265
+ const firstFilePath = (0, import_path16.join)(process.cwd(), discovered.scanDir, discovered.files[0]);
16217
16266
  const content = await (0, import_promises8.readFile)(firstFilePath, "utf-8");
16218
16267
  const extractedDesc = extractDescription2(content);
16219
16268
  if (extractedDesc) {
@@ -17464,57 +17513,57 @@ function createStarredCommand() {
17464
17513
  init_cjs_shims();
17465
17514
  var import_commander27 = require("commander");
17466
17515
  var import_promises9 = require("fs/promises");
17467
- var import_path16 = require("path");
17516
+ var import_path17 = require("path");
17468
17517
  var import_fs13 = require("fs");
17469
17518
  var import_readline = require("readline");
17470
17519
  var import_chalk2 = __toESM(require_source());
17471
17520
  init_errors();
17472
17521
  init_dist();
17473
17522
  function getDefaultPath(format, filename, subtype, customName) {
17474
- const baseName = customName || (0, import_path16.basename)(filename, (0, import_path16.extname)(filename));
17523
+ const baseName = customName || (0, import_path17.basename)(filename, (0, import_path17.extname)(filename));
17475
17524
  switch (format) {
17476
17525
  case "cursor":
17477
17526
  if (subtype === "slash-command") {
17478
- return (0, import_path16.join)(process.cwd(), ".cursor", "commands", `${baseName}.md`);
17527
+ return (0, import_path17.join)(process.cwd(), ".cursor", "commands", `${baseName}.md`);
17479
17528
  }
17480
- return (0, import_path16.join)(process.cwd(), ".cursor", "rules", `${baseName}.mdc`);
17529
+ return (0, import_path17.join)(process.cwd(), ".cursor", "rules", `${baseName}.mdc`);
17481
17530
  case "claude":
17482
17531
  if (subtype === "skill") {
17483
- return (0, import_path16.join)(process.cwd(), ".claude", "skills", baseName, "SKILL.md");
17532
+ return (0, import_path17.join)(process.cwd(), ".claude", "skills", baseName, "SKILL.md");
17484
17533
  } else if (subtype === "slash-command") {
17485
- return (0, import_path16.join)(process.cwd(), ".claude", "commands", `${baseName}.md`);
17534
+ return (0, import_path17.join)(process.cwd(), ".claude", "commands", `${baseName}.md`);
17486
17535
  } else {
17487
- return (0, import_path16.join)(process.cwd(), ".claude", "agents", `${baseName}.md`);
17536
+ return (0, import_path17.join)(process.cwd(), ".claude", "agents", `${baseName}.md`);
17488
17537
  }
17489
17538
  case "windsurf":
17490
- return (0, import_path16.join)(process.cwd(), ".windsurf", "rules", `${baseName}.md`);
17539
+ return (0, import_path17.join)(process.cwd(), ".windsurf", "rules", `${baseName}.md`);
17491
17540
  case "kiro":
17492
17541
  if (subtype === "hook") {
17493
- return (0, import_path16.join)(process.cwd(), ".kiro", "hooks", `${baseName}.kiro.hook`);
17542
+ return (0, import_path17.join)(process.cwd(), ".kiro", "hooks", `${baseName}.kiro.hook`);
17494
17543
  }
17495
17544
  if (subtype === "agent") {
17496
- return (0, import_path16.join)(process.cwd(), ".kiro", "agents", `${baseName}.json`);
17545
+ return (0, import_path17.join)(process.cwd(), ".kiro", "agents", `${baseName}.json`);
17497
17546
  }
17498
- return (0, import_path16.join)(process.cwd(), ".kiro", "steering", `${baseName}.md`);
17547
+ return (0, import_path17.join)(process.cwd(), ".kiro", "steering", `${baseName}.md`);
17499
17548
  case "copilot":
17500
- return (0, import_path16.join)(process.cwd(), ".github", "instructions", `${baseName}.instructions.md`);
17549
+ return (0, import_path17.join)(process.cwd(), ".github", "instructions", `${baseName}.instructions.md`);
17501
17550
  case "continue":
17502
17551
  if (subtype === "slash-command" || subtype === "prompt") {
17503
- return (0, import_path16.join)(process.cwd(), ".continue", "prompts", `${baseName}.md`);
17552
+ return (0, import_path17.join)(process.cwd(), ".continue", "prompts", `${baseName}.md`);
17504
17553
  }
17505
- return (0, import_path16.join)(process.cwd(), ".continue", "rules", `${baseName}.md`);
17554
+ return (0, import_path17.join)(process.cwd(), ".continue", "rules", `${baseName}.md`);
17506
17555
  case "agents.md":
17507
- return (0, import_path16.join)(process.cwd(), "agents.md");
17556
+ return (0, import_path17.join)(process.cwd(), "agents.md");
17508
17557
  case "gemini":
17509
- return (0, import_path16.join)(process.cwd(), ".gemini", "commands", `${baseName}.toml`);
17558
+ return (0, import_path17.join)(process.cwd(), ".gemini", "commands", `${baseName}.toml`);
17510
17559
  case "ruler":
17511
- return (0, import_path16.join)(process.cwd(), ".ruler", `${baseName}.md`);
17560
+ return (0, import_path17.join)(process.cwd(), ".ruler", `${baseName}.md`);
17512
17561
  default:
17513
17562
  throw new CLIError(`Unknown format: ${format}`);
17514
17563
  }
17515
17564
  }
17516
17565
  function detectFormat(content, filepath) {
17517
- const ext = (0, import_path16.extname)(filepath).toLowerCase();
17566
+ const ext = (0, import_path17.extname)(filepath).toLowerCase();
17518
17567
  if (ext === ".mdc" || filepath.includes(".cursor/rules") || filepath.includes(".cursor/commands")) {
17519
17568
  return "cursor";
17520
17569
  }
@@ -17536,7 +17585,7 @@ function detectFormat(content, filepath) {
17536
17585
  if (filepath.includes(".continue/rules") || filepath.includes(".continue/prompts") || filepath.includes(".continuerules")) {
17537
17586
  return "continue";
17538
17587
  }
17539
- if ((0, import_path16.basename)(filepath) === "agents.md") {
17588
+ if ((0, import_path17.basename)(filepath) === "agents.md") {
17540
17589
  return "agents.md";
17541
17590
  }
17542
17591
  if (ext === ".toml" || filepath.includes(".gemini/commands")) {
@@ -17701,7 +17750,7 @@ async function handleConvert(sourcePath, options) {
17701
17750
  return;
17702
17751
  }
17703
17752
  }
17704
- const outputDir = (0, import_path16.dirname)(outputPath);
17753
+ const outputDir = (0, import_path17.dirname)(outputPath);
17705
17754
  await (0, import_promises9.mkdir)(outputDir, { recursive: true });
17706
17755
  console.log(import_chalk2.default.dim("Writing converted file..."));
17707
17756
  await (0, import_promises9.writeFile)(outputPath, result.content, "utf-8");
@@ -17768,7 +17817,7 @@ Valid subtypes: ${validSubtypes.join(", ")}`
17768
17817
  init_cjs_shims();
17769
17818
  var import_commander28 = require("commander");
17770
17819
  var import_fs14 = require("fs");
17771
- var import_path17 = require("path");
17820
+ var import_path18 = require("path");
17772
17821
  var import_chalk3 = __toESM(require_source());
17773
17822
  init_errors();
17774
17823
  init_lockfile();
@@ -17784,7 +17833,7 @@ async function exportToRuler(options) {
17784
17833
  }
17785
17834
  console.log(import_chalk3.default.green(`\u2713 Found ${packages.length} installed package${packages.length === 1 ? "" : "s"}`));
17786
17835
  console.log();
17787
- const outputDir = options.output || (0, import_path17.join)(process.cwd(), ".ruler");
17836
+ const outputDir = options.output || (0, import_path18.join)(process.cwd(), ".ruler");
17788
17837
  let rulerExists = false;
17789
17838
  try {
17790
17839
  await import_fs14.promises.access(outputDir);
@@ -17811,7 +17860,7 @@ async function exportToRuler(options) {
17811
17860
  const content = await import_fs14.promises.readFile(pkg.installedPath, "utf-8");
17812
17861
  const rulerContent = createRulerFormat(pkg.id, pkg.version, content, pkg.format, pkg.subtype);
17813
17862
  const rulerFilename = `${packageName}.md`;
17814
- const rulerPath = (0, import_path17.join)(outputDir, rulerFilename);
17863
+ const rulerPath = (0, import_path18.join)(outputDir, rulerFilename);
17815
17864
  await import_fs14.promises.writeFile(rulerPath, rulerContent, "utf-8");
17816
17865
  console.log(import_chalk3.default.green(`\u2713 Exported ${pkg.id} \u2192 ${rulerFilename}`));
17817
17866
  exportedCount++;
@@ -17851,7 +17900,7 @@ function createRulerFormat(packageId, version, content, format, subtype) {
17851
17900
  return frontmatter + contentWithoutFrontmatter;
17852
17901
  }
17853
17902
  async function ensureRulerConfig(rulerDir) {
17854
- const configPath = (0, import_path17.join)((0, import_path17.dirname)(rulerDir), "ruler.toml");
17903
+ const configPath = (0, import_path18.join)((0, import_path18.dirname)(rulerDir), "ruler.toml");
17855
17904
  try {
17856
17905
  await import_fs14.promises.access(configPath);
17857
17906
  console.log(import_chalk3.default.dim("\u2139 ruler.toml already exists (not modified)"));
@@ -17949,7 +17998,7 @@ init_telemetry();
17949
17998
  init_errors();
17950
17999
  function getVersion() {
17951
18000
  try {
17952
- const packageJsonPath = (0, import_path18.join)(__dirname, "../package.json");
18001
+ const packageJsonPath = (0, import_path19.join)(__dirname, "../package.json");
17953
18002
  const packageJson = JSON.parse((0, import_fs15.readFileSync)(packageJsonPath, "utf-8"));
17954
18003
  return packageJson.version || "0.0.0";
17955
18004
  } catch {