prpm 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +151 -31
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -12715,7 +12715,7 @@ var init_format_registry = __esm({
12715
12715
  },
12716
12716
  opencode: {
12717
12717
  name: "OpenCode",
12718
- description: "OpenCode agents, commands, and tools",
12718
+ description: "OpenCode agents, commands, tools, and plugins",
12719
12719
  documentationUrl: "https://opencode.ai",
12720
12720
  subtypes: {
12721
12721
  agent: {
@@ -12732,6 +12732,11 @@ var init_format_registry = __esm({
12732
12732
  directory: ".opencode/tool",
12733
12733
  filePatterns: ["*.md", "*.json"],
12734
12734
  fileExtension: ".md"
12735
+ },
12736
+ plugin: {
12737
+ directory: ".opencode/plugin",
12738
+ filePatterns: ["*.js", "*.ts"],
12739
+ fileExtension: ".ts"
12735
12740
  }
12736
12741
  }
12737
12742
  },
@@ -12805,15 +12810,17 @@ var init_format_registry = __esm({
12805
12810
  },
12806
12811
  skill: {
12807
12812
  directory: ".openskills",
12808
- filePatterns: ["*.md"],
12813
+ filePatterns: ["SKILL.md"],
12809
12814
  nested: true,
12815
+ nestedIndicator: "SKILL.md",
12810
12816
  usesPackageSubdirectory: true,
12811
12817
  fileExtension: ".md"
12812
12818
  },
12813
12819
  agent: {
12814
12820
  directory: ".openagents",
12815
- filePatterns: ["*.md"],
12821
+ filePatterns: ["AGENT.md"],
12816
12822
  nested: true,
12823
+ nestedIndicator: "AGENT.md",
12817
12824
  usesPackageSubdirectory: true,
12818
12825
  fileExtension: ".md"
12819
12826
  }
@@ -12829,21 +12836,23 @@ var init_format_registry = __esm({
12829
12836
  fileExtension: ".md"
12830
12837
  },
12831
12838
  "slash-command": {
12832
- directory: ".",
12833
- filePatterns: ["AGENTS.md"],
12839
+ directory: ".opencommands",
12840
+ filePatterns: ["*.md"],
12834
12841
  fileExtension: ".md"
12835
12842
  },
12836
12843
  skill: {
12837
12844
  directory: ".openskills",
12838
- filePatterns: ["*.md"],
12845
+ filePatterns: ["SKILL.md"],
12839
12846
  nested: true,
12847
+ nestedIndicator: "SKILL.md",
12840
12848
  usesPackageSubdirectory: true,
12841
12849
  fileExtension: ".md"
12842
12850
  },
12843
12851
  agent: {
12844
12852
  directory: ".openagents",
12845
- filePatterns: ["*.md"],
12853
+ filePatterns: ["AGENT.md"],
12846
12854
  nested: true,
12855
+ nestedIndicator: "AGENT.md",
12847
12856
  usesPackageSubdirectory: true,
12848
12857
  fileExtension: ".md"
12849
12858
  }
@@ -12861,15 +12870,17 @@ var init_format_registry = __esm({
12861
12870
  },
12862
12871
  skill: {
12863
12872
  directory: ".openskills",
12864
- filePatterns: ["*.md"],
12873
+ filePatterns: ["SKILL.md"],
12865
12874
  nested: true,
12875
+ nestedIndicator: "SKILL.md",
12866
12876
  usesPackageSubdirectory: true,
12867
12877
  fileExtension: ".md"
12868
12878
  },
12869
12879
  agent: {
12870
12880
  directory: ".openagents",
12871
- filePatterns: ["*.md"],
12881
+ filePatterns: ["AGENT.md"],
12872
12882
  nested: true,
12883
+ nestedIndicator: "AGENT.md",
12873
12884
  usesPackageSubdirectory: true,
12874
12885
  fileExtension: ".md"
12875
12886
  }
@@ -12887,15 +12898,17 @@ var init_format_registry = __esm({
12887
12898
  },
12888
12899
  skill: {
12889
12900
  directory: ".openskills",
12890
- filePatterns: ["*.md"],
12901
+ filePatterns: ["SKILL.md"],
12891
12902
  nested: true,
12903
+ nestedIndicator: "SKILL.md",
12892
12904
  usesPackageSubdirectory: true,
12893
12905
  fileExtension: ".md"
12894
12906
  },
12895
12907
  agent: {
12896
12908
  directory: ".openagents",
12897
- filePatterns: ["*.md"],
12909
+ filePatterns: ["AGENT.md"],
12898
12910
  nested: true,
12911
+ nestedIndicator: "AGENT.md",
12899
12912
  usesPackageSubdirectory: true,
12900
12913
  fileExtension: ".md"
12901
12914
  }
@@ -12913,15 +12926,17 @@ var init_format_registry = __esm({
12913
12926
  },
12914
12927
  skill: {
12915
12928
  directory: ".openskills",
12916
- filePatterns: ["*.md"],
12929
+ filePatterns: ["SKILL.md"],
12917
12930
  nested: true,
12931
+ nestedIndicator: "SKILL.md",
12918
12932
  usesPackageSubdirectory: true,
12919
12933
  fileExtension: ".md"
12920
12934
  },
12921
12935
  agent: {
12922
12936
  directory: ".openagents",
12923
- filePatterns: ["*.md"],
12937
+ filePatterns: ["AGENT.md"],
12924
12938
  nested: true,
12939
+ nestedIndicator: "AGENT.md",
12925
12940
  usesPackageSubdirectory: true,
12926
12941
  fileExtension: ".md"
12927
12942
  }
@@ -13591,9 +13606,22 @@ var init_types = __esm({
13591
13606
  // src/core/agents-md-progressive.ts
13592
13607
  function generateSkillXML(entry) {
13593
13608
  const resourceType = entry.resourceType || "skill";
13594
- const tag = resourceType === "agent" ? "agent" : "skill";
13595
- const mainFile = entry.mainFile || (resourceType === "agent" ? "AGENT.md" : "SKILL.md");
13596
- const fullPath = import_path10.default.join(entry.skillPath, mainFile);
13609
+ let tag;
13610
+ let mainFile;
13611
+ let fullPath;
13612
+ if (resourceType === "command") {
13613
+ tag = "command";
13614
+ mainFile = entry.mainFile || `${entry.name}.md`;
13615
+ fullPath = import_path10.default.join(entry.skillPath, mainFile);
13616
+ } else if (resourceType === "agent") {
13617
+ tag = "agent";
13618
+ mainFile = entry.mainFile || "AGENT.md";
13619
+ fullPath = import_path10.default.join(entry.skillPath, mainFile);
13620
+ } else {
13621
+ tag = "skill";
13622
+ mainFile = entry.mainFile || "SKILL.md";
13623
+ fullPath = import_path10.default.join(entry.skillPath, mainFile);
13624
+ }
13597
13625
  const activation = entry.eager ? "eager" : "lazy";
13598
13626
  return `<${tag} activation="${activation}">
13599
13627
  <name>${escapeXML(entry.name)}</name>
@@ -13657,6 +13685,26 @@ Usage notes:
13657
13685
 
13658
13686
  <available_agents>`;
13659
13687
  }
13688
+ function generateCommandsSystemHeader() {
13689
+ return `<commands_system priority="1">
13690
+ <usage>
13691
+ Commands are reusable workflows that can be invoked by the user or triggered by context.
13692
+
13693
+ How to use commands:
13694
+ - When a user explicitly asks for a command (e.g., "run build-actions" or "/build-actions")
13695
+ - Or when the task context matches a command's description
13696
+ - Load the command: Bash("cat <path>")
13697
+ - Follow the instructions in the loaded command file
13698
+ - Example: Bash("cat .opencommands/build-actions.md")
13699
+
13700
+ Usage notes:
13701
+ - Commands are loaded into your current context when invoked
13702
+ - Each command contains step-by-step instructions for a specific workflow
13703
+ - Commands may reference other skills or agents
13704
+ </usage>
13705
+
13706
+ <available_commands>`;
13707
+ }
13660
13708
  function generateManifestFooter(hasAgents, agentsXML) {
13661
13709
  let footer = "</available_skills>\n</skills_system>";
13662
13710
  if (hasAgents && agentsXML) {
@@ -13722,18 +13770,21 @@ async function addSkillToManifest(entry, agentsPath = "AGENTS.md") {
13722
13770
  updatedResources.push(entry);
13723
13771
  const skills = updatedResources.filter((r) => (r.resourceType || "skill") === "skill");
13724
13772
  const agents = updatedResources.filter((r) => r.resourceType === "agent");
13773
+ const commands = updatedResources.filter((r) => r.resourceType === "command");
13725
13774
  const eagerSkills = skills.filter((s) => s.eager === true);
13726
13775
  const lazySkills = skills.filter((s) => s.eager !== true);
13727
13776
  const eagerAgents = agents.filter((a) => a.eager === true);
13728
13777
  const lazyAgents = agents.filter((a) => a.eager !== true);
13778
+ const eagerCommands = commands.filter((c) => c.eager === true);
13779
+ const lazyCommands = commands.filter((c) => c.eager !== true);
13729
13780
  let newContent = "";
13730
13781
  if (!beforeManifest.trim() && !afterManifest.trim()) {
13731
13782
  newContent = "";
13732
13783
  } else {
13733
13784
  newContent = beforeManifest;
13734
13785
  }
13735
- const hasEagerContent = eagerSkills.length > 0 || eagerAgents.length > 0;
13736
- const hasLazyContent = lazySkills.length > 0 || lazyAgents.length > 0;
13786
+ const hasEagerContent = eagerSkills.length > 0 || eagerAgents.length > 0 || eagerCommands.length > 0;
13787
+ const hasLazyContent = lazySkills.length > 0 || lazyAgents.length > 0 || lazyCommands.length > 0;
13737
13788
  if (hasEagerContent) {
13738
13789
  if (eagerSkills.length > 0) {
13739
13790
  newContent += generateEagerSkillsSystemHeader();
@@ -13754,6 +13805,19 @@ Do not wait for explicit requests - invoke these agents when their expertise app
13754
13805
  newContent += eagerAgents.map((a) => generateSkillXML(a)).join("\n\n");
13755
13806
  newContent += "\n\n</eager_agents>\n</agents_system>\n\n";
13756
13807
  }
13808
+ if (eagerCommands.length > 0) {
13809
+ newContent += `<commands_system priority="0">
13810
+ <usage>
13811
+ MANDATORY: These commands are always available and should be suggested proactively.
13812
+ When user tasks match these commands, offer to run them.
13813
+ </usage>
13814
+
13815
+ <eager_commands>
13816
+
13817
+ `;
13818
+ newContent += eagerCommands.map((c) => generateSkillXML(c)).join("\n\n");
13819
+ newContent += "\n\n</eager_commands>\n</commands_system>\n\n";
13820
+ }
13757
13821
  }
13758
13822
  if (hasLazyContent) {
13759
13823
  if (lazySkills.length > 0) {
@@ -13768,6 +13832,12 @@ Do not wait for explicit requests - invoke these agents when their expertise app
13768
13832
  newContent += lazyAgents.map((a) => generateSkillXML(a)).join("\n\n");
13769
13833
  newContent += "\n\n</available_agents>\n</agents_system>";
13770
13834
  }
13835
+ if (lazyCommands.length > 0) {
13836
+ newContent += "\n\n" + generateCommandsSystemHeader();
13837
+ newContent += "\n\n";
13838
+ newContent += lazyCommands.map((c) => generateSkillXML(c)).join("\n\n");
13839
+ newContent += "\n\n</available_commands>\n</commands_system>";
13840
+ }
13771
13841
  }
13772
13842
  newContent += "\n\n<!-- PRPM_MANIFEST_END -->";
13773
13843
  newContent += afterManifest;
@@ -13836,6 +13906,21 @@ function parseSkillsFromManifest(manifestXML) {
13836
13906
  eager: activation === "eager"
13837
13907
  });
13838
13908
  }
13909
+ const commandFormatWithAttrRegex = /<command(?:\s+activation="(eager|lazy)")?\s*>\s*<name>([^<]+)<\/name>\s*<description>([^<]+)<\/description>\s*<path>([^<]+)<\/path>\s*<\/command>/g;
13910
+ while ((match = commandFormatWithAttrRegex.exec(manifestXML)) !== null) {
13911
+ const [, activation, name, description, fullPath] = match;
13912
+ const pathParts = fullPath.trim().split("/");
13913
+ const mainFile = pathParts[pathParts.length - 1];
13914
+ const dir = pathParts.slice(0, -1).join("/");
13915
+ resources.push({
13916
+ name: unescapeXML(name.trim()),
13917
+ description: unescapeXML(description.trim()),
13918
+ skillPath: dir,
13919
+ mainFile,
13920
+ resourceType: "command",
13921
+ eager: activation === "eager"
13922
+ });
13923
+ }
13839
13924
  if (resources.length === 0) {
13840
13925
  const legacyRegex = /<skill\s+name="([^"]+)"\s+path="([^"]+)">([^<]*)<\/skill>/g;
13841
13926
  while ((match = legacyRegex.exec(manifestXML)) !== null) {
@@ -16423,7 +16508,7 @@ function findMainFile(files, format, subtype) {
16423
16508
  return null;
16424
16509
  }
16425
16510
  async function handleInstall(packageSpec, options) {
16426
- var _a;
16511
+ var _a, _b, _c;
16427
16512
  const startTime = Date.now();
16428
16513
  let success = false;
16429
16514
  let error;
@@ -16934,13 +17019,16 @@ This could indicate:
16934
17019
  destPath = `${destDir}/SKILL.md`;
16935
17020
  } else if (effectiveFormat === "claude" && effectiveSubtype === "hook") {
16936
17021
  destPath = `${destDir}/settings.json`;
16937
- } else if (effectiveFormat === "agents.md" || effectiveFormat === "gemini.md" || effectiveFormat === "claude.md") {
17022
+ } else if (effectiveFormat === "agents.md" || effectiveFormat === "gemini.md" || effectiveFormat === "claude.md" || effectiveFormat === "codex") {
16938
17023
  if (effectiveSubtype === "skill") {
16939
17024
  destPath = `${destDir}/SKILL.md`;
16940
17025
  console.log(` \u{1F4E6} Installing skill to ${destDir}/ for progressive disclosure`);
16941
17026
  } else if (effectiveSubtype === "agent") {
16942
17027
  destPath = `${destDir}/AGENT.md`;
16943
17028
  console.log(` \u{1F916} Installing agent to ${destDir}/ for progressive disclosure`);
17029
+ } else if (effectiveSubtype === "slash-command") {
17030
+ destPath = `${destDir}/${packageName}.md`;
17031
+ console.log(` \u26A1 Installing command to ${destDir}/ for progressive disclosure`);
16944
17032
  } else {
16945
17033
  const manifestFilename = getManifestFilename(effectiveFormat);
16946
17034
  let targetPath = manifestFilename;
@@ -16984,6 +17072,18 @@ This could indicate:
16984
17072
  }
16985
17073
  } else if (effectiveFormat === "droid" && effectiveSubtype === "skill") {
16986
17074
  destPath = `${destDir}/SKILL.md`;
17075
+ } else if (effectiveFormat === "droid" && effectiveSubtype === "agent") {
17076
+ destDir = `.openagents/${packageName}`;
17077
+ destPath = `${destDir}/AGENT.md`;
17078
+ console.log(` \u{1F916} Installing agent to ${destDir}/ for progressive disclosure`);
17079
+ } else if (effectiveFormat === "cursor" && effectiveSubtype === "agent") {
17080
+ destDir = `.openagents/${packageName}`;
17081
+ destPath = `${destDir}/AGENT.md`;
17082
+ console.log(` \u{1F916} Installing agent to ${destDir}/ for progressive disclosure`);
17083
+ } else if (effectiveFormat === "opencode" && effectiveSubtype === "skill") {
17084
+ destDir = `.openskills/${packageName}`;
17085
+ destPath = `${destDir}/SKILL.md`;
17086
+ console.log(` \u{1F4E6} Installing skill to ${destDir}/ for progressive disclosure`);
16987
17087
  } else {
16988
17088
  destPath = `${destDir}/${packageName}.${fileExtension}`;
16989
17089
  }
@@ -17150,17 +17250,11 @@ ${afterFrontmatter}`;
17150
17250
  "aider",
17151
17251
  // Uses CONVENTIONS.md
17152
17252
  "codex",
17153
- // Uses AGENTS.md (no native skills)
17154
- "cursor",
17155
- // Uses AGENTS.md (no native skills)
17253
+ // Uses AGENTS.md (no native skills/agents/commands)
17156
17254
  "copilot",
17157
- // Uses AGENTS.md (no native skills)
17255
+ // Uses AGENTS.md (no native skills/agents/commands)
17158
17256
  "kiro",
17159
17257
  // Uses AGENTS.md (no native skills)
17160
- "opencode",
17161
- // Uses AGENTS.md (no native skills)
17162
- "ruler",
17163
- // Uses AGENTS.md (no native skills)
17164
17258
  "replit",
17165
17259
  // Uses AGENTS.md (no native skills)
17166
17260
  "zed",
@@ -17168,14 +17262,40 @@ ${afterFrontmatter}`;
17168
17262
  "generic"
17169
17263
  // Uses AGENTS.md (fallback format)
17170
17264
  ];
17171
- if (progressiveDisclosureFormats.includes(effectiveFormat) && (effectiveSubtype === "skill" || effectiveSubtype === "agent") && !options.noAppend) {
17265
+ const partialNativeSupport = {
17266
+ "cursor": ["agent"],
17267
+ // Cursor has native rules/commands but no native agents
17268
+ "opencode": ["skill"],
17269
+ // OpenCode has native agents/commands but no native skills
17270
+ "droid": ["agent"]
17271
+ // Factory Droid has native skills/commands/hooks but no native agents
17272
+ };
17273
+ const needsProgressiveDisclosure = progressiveDisclosureFormats.includes(effectiveFormat) && (effectiveSubtype === "skill" || effectiveSubtype === "agent" || effectiveSubtype === "slash-command") || ((_b = partialNativeSupport[effectiveFormat]) == null ? void 0 : _b.includes(effectiveSubtype));
17274
+ if (needsProgressiveDisclosure && !options.noAppend) {
17275
+ if ((_c = partialNativeSupport[effectiveFormat]) == null ? void 0 : _c.includes(effectiveSubtype)) {
17276
+ const resourceName2 = stripAuthorNamespace2(packageId);
17277
+ if (effectiveSubtype === "skill") {
17278
+ destDir = `.openskills/${resourceName2}`;
17279
+ } else if (effectiveSubtype === "agent") {
17280
+ destDir = `.openagents/${resourceName2}`;
17281
+ } else if (effectiveSubtype === "slash-command") {
17282
+ destDir = ".opencommands";
17283
+ }
17284
+ }
17172
17285
  if (!destDir) {
17173
17286
  throw new Error("Internal error: destDir not set for progressive disclosure installation");
17174
17287
  }
17175
17288
  const manifestPath = options.manifestFile || getManifestFilename(effectiveFormat);
17176
17289
  const resourceName = stripAuthorNamespace2(packageId);
17177
- const resourceType = effectiveSubtype;
17178
- const mainFile = resourceType === "agent" ? "AGENT.md" : "SKILL.md";
17290
+ const resourceType = effectiveSubtype === "slash-command" ? "command" : effectiveSubtype;
17291
+ let mainFile;
17292
+ if (resourceType === "command") {
17293
+ mainFile = `${resourceName}.md`;
17294
+ } else if (resourceType === "agent") {
17295
+ mainFile = "AGENT.md";
17296
+ } else {
17297
+ mainFile = "SKILL.md";
17298
+ }
17179
17299
  let resolvedEager;
17180
17300
  if (options.eager !== void 0) {
17181
17301
  resolvedEager = options.eager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prpm",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "Prompt Package Manager CLI - Install and manage prompt-based files",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -45,9 +45,9 @@
45
45
  "license": "MIT",
46
46
  "dependencies": {
47
47
  "@octokit/rest": "^22.0.0",
48
- "@pr-pm/converters": "^2.1.2",
49
- "@pr-pm/registry-client": "^2.3.2",
50
- "@pr-pm/types": "^2.1.2",
48
+ "@pr-pm/converters": "^2.1.4",
49
+ "@pr-pm/registry-client": "^2.3.4",
50
+ "@pr-pm/types": "^2.1.4",
51
51
  "ajv": "^8.17.1",
52
52
  "ajv-formats": "^3.0.1",
53
53
  "commander": "^11.1.0",