prpm 2.1.2 → 2.1.3
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 +119 -28
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -12805,15 +12805,17 @@ var init_format_registry = __esm({
|
|
|
12805
12805
|
},
|
|
12806
12806
|
skill: {
|
|
12807
12807
|
directory: ".openskills",
|
|
12808
|
-
filePatterns: ["
|
|
12808
|
+
filePatterns: ["SKILL.md"],
|
|
12809
12809
|
nested: true,
|
|
12810
|
+
nestedIndicator: "SKILL.md",
|
|
12810
12811
|
usesPackageSubdirectory: true,
|
|
12811
12812
|
fileExtension: ".md"
|
|
12812
12813
|
},
|
|
12813
12814
|
agent: {
|
|
12814
12815
|
directory: ".openagents",
|
|
12815
|
-
filePatterns: ["
|
|
12816
|
+
filePatterns: ["AGENT.md"],
|
|
12816
12817
|
nested: true,
|
|
12818
|
+
nestedIndicator: "AGENT.md",
|
|
12817
12819
|
usesPackageSubdirectory: true,
|
|
12818
12820
|
fileExtension: ".md"
|
|
12819
12821
|
}
|
|
@@ -12829,21 +12831,23 @@ var init_format_registry = __esm({
|
|
|
12829
12831
|
fileExtension: ".md"
|
|
12830
12832
|
},
|
|
12831
12833
|
"slash-command": {
|
|
12832
|
-
directory: ".",
|
|
12833
|
-
filePatterns: ["
|
|
12834
|
+
directory: ".opencommands",
|
|
12835
|
+
filePatterns: ["*.md"],
|
|
12834
12836
|
fileExtension: ".md"
|
|
12835
12837
|
},
|
|
12836
12838
|
skill: {
|
|
12837
12839
|
directory: ".openskills",
|
|
12838
|
-
filePatterns: ["
|
|
12840
|
+
filePatterns: ["SKILL.md"],
|
|
12839
12841
|
nested: true,
|
|
12842
|
+
nestedIndicator: "SKILL.md",
|
|
12840
12843
|
usesPackageSubdirectory: true,
|
|
12841
12844
|
fileExtension: ".md"
|
|
12842
12845
|
},
|
|
12843
12846
|
agent: {
|
|
12844
12847
|
directory: ".openagents",
|
|
12845
|
-
filePatterns: ["
|
|
12848
|
+
filePatterns: ["AGENT.md"],
|
|
12846
12849
|
nested: true,
|
|
12850
|
+
nestedIndicator: "AGENT.md",
|
|
12847
12851
|
usesPackageSubdirectory: true,
|
|
12848
12852
|
fileExtension: ".md"
|
|
12849
12853
|
}
|
|
@@ -12861,15 +12865,17 @@ var init_format_registry = __esm({
|
|
|
12861
12865
|
},
|
|
12862
12866
|
skill: {
|
|
12863
12867
|
directory: ".openskills",
|
|
12864
|
-
filePatterns: ["
|
|
12868
|
+
filePatterns: ["SKILL.md"],
|
|
12865
12869
|
nested: true,
|
|
12870
|
+
nestedIndicator: "SKILL.md",
|
|
12866
12871
|
usesPackageSubdirectory: true,
|
|
12867
12872
|
fileExtension: ".md"
|
|
12868
12873
|
},
|
|
12869
12874
|
agent: {
|
|
12870
12875
|
directory: ".openagents",
|
|
12871
|
-
filePatterns: ["
|
|
12876
|
+
filePatterns: ["AGENT.md"],
|
|
12872
12877
|
nested: true,
|
|
12878
|
+
nestedIndicator: "AGENT.md",
|
|
12873
12879
|
usesPackageSubdirectory: true,
|
|
12874
12880
|
fileExtension: ".md"
|
|
12875
12881
|
}
|
|
@@ -12887,15 +12893,17 @@ var init_format_registry = __esm({
|
|
|
12887
12893
|
},
|
|
12888
12894
|
skill: {
|
|
12889
12895
|
directory: ".openskills",
|
|
12890
|
-
filePatterns: ["
|
|
12896
|
+
filePatterns: ["SKILL.md"],
|
|
12891
12897
|
nested: true,
|
|
12898
|
+
nestedIndicator: "SKILL.md",
|
|
12892
12899
|
usesPackageSubdirectory: true,
|
|
12893
12900
|
fileExtension: ".md"
|
|
12894
12901
|
},
|
|
12895
12902
|
agent: {
|
|
12896
12903
|
directory: ".openagents",
|
|
12897
|
-
filePatterns: ["
|
|
12904
|
+
filePatterns: ["AGENT.md"],
|
|
12898
12905
|
nested: true,
|
|
12906
|
+
nestedIndicator: "AGENT.md",
|
|
12899
12907
|
usesPackageSubdirectory: true,
|
|
12900
12908
|
fileExtension: ".md"
|
|
12901
12909
|
}
|
|
@@ -12913,15 +12921,17 @@ var init_format_registry = __esm({
|
|
|
12913
12921
|
},
|
|
12914
12922
|
skill: {
|
|
12915
12923
|
directory: ".openskills",
|
|
12916
|
-
filePatterns: ["
|
|
12924
|
+
filePatterns: ["SKILL.md"],
|
|
12917
12925
|
nested: true,
|
|
12926
|
+
nestedIndicator: "SKILL.md",
|
|
12918
12927
|
usesPackageSubdirectory: true,
|
|
12919
12928
|
fileExtension: ".md"
|
|
12920
12929
|
},
|
|
12921
12930
|
agent: {
|
|
12922
12931
|
directory: ".openagents",
|
|
12923
|
-
filePatterns: ["
|
|
12932
|
+
filePatterns: ["AGENT.md"],
|
|
12924
12933
|
nested: true,
|
|
12934
|
+
nestedIndicator: "AGENT.md",
|
|
12925
12935
|
usesPackageSubdirectory: true,
|
|
12926
12936
|
fileExtension: ".md"
|
|
12927
12937
|
}
|
|
@@ -13591,9 +13601,22 @@ var init_types = __esm({
|
|
|
13591
13601
|
// src/core/agents-md-progressive.ts
|
|
13592
13602
|
function generateSkillXML(entry) {
|
|
13593
13603
|
const resourceType = entry.resourceType || "skill";
|
|
13594
|
-
|
|
13595
|
-
|
|
13596
|
-
|
|
13604
|
+
let tag;
|
|
13605
|
+
let mainFile;
|
|
13606
|
+
let fullPath;
|
|
13607
|
+
if (resourceType === "command") {
|
|
13608
|
+
tag = "command";
|
|
13609
|
+
mainFile = entry.mainFile || `${entry.name}.md`;
|
|
13610
|
+
fullPath = import_path10.default.join(entry.skillPath, mainFile);
|
|
13611
|
+
} else if (resourceType === "agent") {
|
|
13612
|
+
tag = "agent";
|
|
13613
|
+
mainFile = entry.mainFile || "AGENT.md";
|
|
13614
|
+
fullPath = import_path10.default.join(entry.skillPath, mainFile);
|
|
13615
|
+
} else {
|
|
13616
|
+
tag = "skill";
|
|
13617
|
+
mainFile = entry.mainFile || "SKILL.md";
|
|
13618
|
+
fullPath = import_path10.default.join(entry.skillPath, mainFile);
|
|
13619
|
+
}
|
|
13597
13620
|
const activation = entry.eager ? "eager" : "lazy";
|
|
13598
13621
|
return `<${tag} activation="${activation}">
|
|
13599
13622
|
<name>${escapeXML(entry.name)}</name>
|
|
@@ -13657,6 +13680,26 @@ Usage notes:
|
|
|
13657
13680
|
|
|
13658
13681
|
<available_agents>`;
|
|
13659
13682
|
}
|
|
13683
|
+
function generateCommandsSystemHeader() {
|
|
13684
|
+
return `<commands_system priority="1">
|
|
13685
|
+
<usage>
|
|
13686
|
+
Commands are reusable workflows that can be invoked by the user or triggered by context.
|
|
13687
|
+
|
|
13688
|
+
How to use commands:
|
|
13689
|
+
- When a user explicitly asks for a command (e.g., "run build-actions" or "/build-actions")
|
|
13690
|
+
- Or when the task context matches a command's description
|
|
13691
|
+
- Load the command: Bash("cat <path>")
|
|
13692
|
+
- Follow the instructions in the loaded command file
|
|
13693
|
+
- Example: Bash("cat .opencommands/build-actions.md")
|
|
13694
|
+
|
|
13695
|
+
Usage notes:
|
|
13696
|
+
- Commands are loaded into your current context when invoked
|
|
13697
|
+
- Each command contains step-by-step instructions for a specific workflow
|
|
13698
|
+
- Commands may reference other skills or agents
|
|
13699
|
+
</usage>
|
|
13700
|
+
|
|
13701
|
+
<available_commands>`;
|
|
13702
|
+
}
|
|
13660
13703
|
function generateManifestFooter(hasAgents, agentsXML) {
|
|
13661
13704
|
let footer = "</available_skills>\n</skills_system>";
|
|
13662
13705
|
if (hasAgents && agentsXML) {
|
|
@@ -13722,18 +13765,21 @@ async function addSkillToManifest(entry, agentsPath = "AGENTS.md") {
|
|
|
13722
13765
|
updatedResources.push(entry);
|
|
13723
13766
|
const skills = updatedResources.filter((r) => (r.resourceType || "skill") === "skill");
|
|
13724
13767
|
const agents = updatedResources.filter((r) => r.resourceType === "agent");
|
|
13768
|
+
const commands = updatedResources.filter((r) => r.resourceType === "command");
|
|
13725
13769
|
const eagerSkills = skills.filter((s) => s.eager === true);
|
|
13726
13770
|
const lazySkills = skills.filter((s) => s.eager !== true);
|
|
13727
13771
|
const eagerAgents = agents.filter((a) => a.eager === true);
|
|
13728
13772
|
const lazyAgents = agents.filter((a) => a.eager !== true);
|
|
13773
|
+
const eagerCommands = commands.filter((c) => c.eager === true);
|
|
13774
|
+
const lazyCommands = commands.filter((c) => c.eager !== true);
|
|
13729
13775
|
let newContent = "";
|
|
13730
13776
|
if (!beforeManifest.trim() && !afterManifest.trim()) {
|
|
13731
13777
|
newContent = "";
|
|
13732
13778
|
} else {
|
|
13733
13779
|
newContent = beforeManifest;
|
|
13734
13780
|
}
|
|
13735
|
-
const hasEagerContent = eagerSkills.length > 0 || eagerAgents.length > 0;
|
|
13736
|
-
const hasLazyContent = lazySkills.length > 0 || lazyAgents.length > 0;
|
|
13781
|
+
const hasEagerContent = eagerSkills.length > 0 || eagerAgents.length > 0 || eagerCommands.length > 0;
|
|
13782
|
+
const hasLazyContent = lazySkills.length > 0 || lazyAgents.length > 0 || lazyCommands.length > 0;
|
|
13737
13783
|
if (hasEagerContent) {
|
|
13738
13784
|
if (eagerSkills.length > 0) {
|
|
13739
13785
|
newContent += generateEagerSkillsSystemHeader();
|
|
@@ -13754,6 +13800,19 @@ Do not wait for explicit requests - invoke these agents when their expertise app
|
|
|
13754
13800
|
newContent += eagerAgents.map((a) => generateSkillXML(a)).join("\n\n");
|
|
13755
13801
|
newContent += "\n\n</eager_agents>\n</agents_system>\n\n";
|
|
13756
13802
|
}
|
|
13803
|
+
if (eagerCommands.length > 0) {
|
|
13804
|
+
newContent += `<commands_system priority="0">
|
|
13805
|
+
<usage>
|
|
13806
|
+
MANDATORY: These commands are always available and should be suggested proactively.
|
|
13807
|
+
When user tasks match these commands, offer to run them.
|
|
13808
|
+
</usage>
|
|
13809
|
+
|
|
13810
|
+
<eager_commands>
|
|
13811
|
+
|
|
13812
|
+
`;
|
|
13813
|
+
newContent += eagerCommands.map((c) => generateSkillXML(c)).join("\n\n");
|
|
13814
|
+
newContent += "\n\n</eager_commands>\n</commands_system>\n\n";
|
|
13815
|
+
}
|
|
13757
13816
|
}
|
|
13758
13817
|
if (hasLazyContent) {
|
|
13759
13818
|
if (lazySkills.length > 0) {
|
|
@@ -13768,6 +13827,12 @@ Do not wait for explicit requests - invoke these agents when their expertise app
|
|
|
13768
13827
|
newContent += lazyAgents.map((a) => generateSkillXML(a)).join("\n\n");
|
|
13769
13828
|
newContent += "\n\n</available_agents>\n</agents_system>";
|
|
13770
13829
|
}
|
|
13830
|
+
if (lazyCommands.length > 0) {
|
|
13831
|
+
newContent += "\n\n" + generateCommandsSystemHeader();
|
|
13832
|
+
newContent += "\n\n";
|
|
13833
|
+
newContent += lazyCommands.map((c) => generateSkillXML(c)).join("\n\n");
|
|
13834
|
+
newContent += "\n\n</available_commands>\n</commands_system>";
|
|
13835
|
+
}
|
|
13771
13836
|
}
|
|
13772
13837
|
newContent += "\n\n<!-- PRPM_MANIFEST_END -->";
|
|
13773
13838
|
newContent += afterManifest;
|
|
@@ -13836,6 +13901,21 @@ function parseSkillsFromManifest(manifestXML) {
|
|
|
13836
13901
|
eager: activation === "eager"
|
|
13837
13902
|
});
|
|
13838
13903
|
}
|
|
13904
|
+
const commandFormatWithAttrRegex = /<command(?:\s+activation="(eager|lazy)")?\s*>\s*<name>([^<]+)<\/name>\s*<description>([^<]+)<\/description>\s*<path>([^<]+)<\/path>\s*<\/command>/g;
|
|
13905
|
+
while ((match = commandFormatWithAttrRegex.exec(manifestXML)) !== null) {
|
|
13906
|
+
const [, activation, name, description, fullPath] = match;
|
|
13907
|
+
const pathParts = fullPath.trim().split("/");
|
|
13908
|
+
const mainFile = pathParts[pathParts.length - 1];
|
|
13909
|
+
const dir = pathParts.slice(0, -1).join("/");
|
|
13910
|
+
resources.push({
|
|
13911
|
+
name: unescapeXML(name.trim()),
|
|
13912
|
+
description: unescapeXML(description.trim()),
|
|
13913
|
+
skillPath: dir,
|
|
13914
|
+
mainFile,
|
|
13915
|
+
resourceType: "command",
|
|
13916
|
+
eager: activation === "eager"
|
|
13917
|
+
});
|
|
13918
|
+
}
|
|
13839
13919
|
if (resources.length === 0) {
|
|
13840
13920
|
const legacyRegex = /<skill\s+name="([^"]+)"\s+path="([^"]+)">([^<]*)<\/skill>/g;
|
|
13841
13921
|
while ((match = legacyRegex.exec(manifestXML)) !== null) {
|
|
@@ -16423,7 +16503,7 @@ function findMainFile(files, format, subtype) {
|
|
|
16423
16503
|
return null;
|
|
16424
16504
|
}
|
|
16425
16505
|
async function handleInstall(packageSpec, options) {
|
|
16426
|
-
var _a;
|
|
16506
|
+
var _a, _b;
|
|
16427
16507
|
const startTime = Date.now();
|
|
16428
16508
|
let success = false;
|
|
16429
16509
|
let error;
|
|
@@ -16934,13 +17014,16 @@ This could indicate:
|
|
|
16934
17014
|
destPath = `${destDir}/SKILL.md`;
|
|
16935
17015
|
} else if (effectiveFormat === "claude" && effectiveSubtype === "hook") {
|
|
16936
17016
|
destPath = `${destDir}/settings.json`;
|
|
16937
|
-
} else if (effectiveFormat === "agents.md" || effectiveFormat === "gemini.md" || effectiveFormat === "claude.md") {
|
|
17017
|
+
} else if (effectiveFormat === "agents.md" || effectiveFormat === "gemini.md" || effectiveFormat === "claude.md" || effectiveFormat === "codex") {
|
|
16938
17018
|
if (effectiveSubtype === "skill") {
|
|
16939
17019
|
destPath = `${destDir}/SKILL.md`;
|
|
16940
17020
|
console.log(` \u{1F4E6} Installing skill to ${destDir}/ for progressive disclosure`);
|
|
16941
17021
|
} else if (effectiveSubtype === "agent") {
|
|
16942
17022
|
destPath = `${destDir}/AGENT.md`;
|
|
16943
17023
|
console.log(` \u{1F916} Installing agent to ${destDir}/ for progressive disclosure`);
|
|
17024
|
+
} else if (effectiveSubtype === "slash-command") {
|
|
17025
|
+
destPath = `${destDir}/${packageName}.md`;
|
|
17026
|
+
console.log(` \u26A1 Installing command to ${destDir}/ for progressive disclosure`);
|
|
16944
17027
|
} else {
|
|
16945
17028
|
const manifestFilename = getManifestFilename(effectiveFormat);
|
|
16946
17029
|
let targetPath = manifestFilename;
|
|
@@ -17150,17 +17233,13 @@ ${afterFrontmatter}`;
|
|
|
17150
17233
|
"aider",
|
|
17151
17234
|
// Uses CONVENTIONS.md
|
|
17152
17235
|
"codex",
|
|
17153
|
-
// Uses AGENTS.md (no native skills)
|
|
17154
|
-
"cursor",
|
|
17155
|
-
// Uses AGENTS.md (no native skills)
|
|
17236
|
+
// Uses AGENTS.md (no native skills/agents)
|
|
17156
17237
|
"copilot",
|
|
17157
|
-
// Uses AGENTS.md (no native skills)
|
|
17238
|
+
// Uses AGENTS.md (no native skills/agents)
|
|
17158
17239
|
"kiro",
|
|
17159
17240
|
// Uses AGENTS.md (no native skills)
|
|
17160
17241
|
"opencode",
|
|
17161
17242
|
// Uses AGENTS.md (no native skills)
|
|
17162
|
-
"ruler",
|
|
17163
|
-
// Uses AGENTS.md (no native skills)
|
|
17164
17243
|
"replit",
|
|
17165
17244
|
// Uses AGENTS.md (no native skills)
|
|
17166
17245
|
"zed",
|
|
@@ -17168,14 +17247,26 @@ ${afterFrontmatter}`;
|
|
|
17168
17247
|
"generic"
|
|
17169
17248
|
// Uses AGENTS.md (fallback format)
|
|
17170
17249
|
];
|
|
17171
|
-
|
|
17250
|
+
const partialNativeSupport = {
|
|
17251
|
+
"cursor": ["agent"]
|
|
17252
|
+
// Cursor has native rules/commands but no native agents
|
|
17253
|
+
};
|
|
17254
|
+
const needsProgressiveDisclosure = progressiveDisclosureFormats.includes(effectiveFormat) && (effectiveSubtype === "skill" || effectiveSubtype === "agent" || effectiveSubtype === "slash-command") || ((_b = partialNativeSupport[effectiveFormat]) == null ? void 0 : _b.includes(effectiveSubtype));
|
|
17255
|
+
if (needsProgressiveDisclosure && !options.noAppend) {
|
|
17172
17256
|
if (!destDir) {
|
|
17173
17257
|
throw new Error("Internal error: destDir not set for progressive disclosure installation");
|
|
17174
17258
|
}
|
|
17175
17259
|
const manifestPath = options.manifestFile || getManifestFilename(effectiveFormat);
|
|
17176
17260
|
const resourceName = stripAuthorNamespace2(packageId);
|
|
17177
|
-
const resourceType = effectiveSubtype;
|
|
17178
|
-
|
|
17261
|
+
const resourceType = effectiveSubtype === "slash-command" ? "command" : effectiveSubtype;
|
|
17262
|
+
let mainFile;
|
|
17263
|
+
if (resourceType === "command") {
|
|
17264
|
+
mainFile = `${resourceName}.md`;
|
|
17265
|
+
} else if (resourceType === "agent") {
|
|
17266
|
+
mainFile = "AGENT.md";
|
|
17267
|
+
} else {
|
|
17268
|
+
mainFile = "SKILL.md";
|
|
17269
|
+
}
|
|
17179
17270
|
let resolvedEager;
|
|
17180
17271
|
if (options.eager !== void 0) {
|
|
17181
17272
|
resolvedEager = options.eager;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prpm",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
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.
|
|
49
|
-
"@pr-pm/registry-client": "^2.3.
|
|
50
|
-
"@pr-pm/types": "^2.1.
|
|
48
|
+
"@pr-pm/converters": "^2.1.3",
|
|
49
|
+
"@pr-pm/registry-client": "^2.3.3",
|
|
50
|
+
"@pr-pm/types": "^2.1.3",
|
|
51
51
|
"ajv": "^8.17.1",
|
|
52
52
|
"ajv-formats": "^3.0.1",
|
|
53
53
|
"commander": "^11.1.0",
|