prpm 2.1.1 → 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 +145 -25
- 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
|
}
|
|
@@ -13519,14 +13529,15 @@ async function directoryExists(dirPath) {
|
|
|
13519
13529
|
}
|
|
13520
13530
|
function getManifestFilename(format) {
|
|
13521
13531
|
switch (format) {
|
|
13522
|
-
|
|
13523
|
-
return "AGENTS.md";
|
|
13532
|
+
// Formats with custom manifest files
|
|
13524
13533
|
case "gemini.md":
|
|
13525
13534
|
return "GEMINI.md";
|
|
13526
13535
|
case "claude.md":
|
|
13527
13536
|
return "CLAUDE.md";
|
|
13528
13537
|
case "aider":
|
|
13529
13538
|
return "CONVENTIONS.md";
|
|
13539
|
+
// All other formats use AGENTS.md for progressive disclosure
|
|
13540
|
+
// Including: agents.md, codex, cursor, copilot, kiro, opencode, ruler, replit, zed, generic
|
|
13530
13541
|
default:
|
|
13531
13542
|
return "AGENTS.md";
|
|
13532
13543
|
}
|
|
@@ -13590,9 +13601,22 @@ var init_types = __esm({
|
|
|
13590
13601
|
// src/core/agents-md-progressive.ts
|
|
13591
13602
|
function generateSkillXML(entry) {
|
|
13592
13603
|
const resourceType = entry.resourceType || "skill";
|
|
13593
|
-
|
|
13594
|
-
|
|
13595
|
-
|
|
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
|
+
}
|
|
13596
13620
|
const activation = entry.eager ? "eager" : "lazy";
|
|
13597
13621
|
return `<${tag} activation="${activation}">
|
|
13598
13622
|
<name>${escapeXML(entry.name)}</name>
|
|
@@ -13656,6 +13680,26 @@ Usage notes:
|
|
|
13656
13680
|
|
|
13657
13681
|
<available_agents>`;
|
|
13658
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
|
+
}
|
|
13659
13703
|
function generateManifestFooter(hasAgents, agentsXML) {
|
|
13660
13704
|
let footer = "</available_skills>\n</skills_system>";
|
|
13661
13705
|
if (hasAgents && agentsXML) {
|
|
@@ -13721,18 +13765,21 @@ async function addSkillToManifest(entry, agentsPath = "AGENTS.md") {
|
|
|
13721
13765
|
updatedResources.push(entry);
|
|
13722
13766
|
const skills = updatedResources.filter((r) => (r.resourceType || "skill") === "skill");
|
|
13723
13767
|
const agents = updatedResources.filter((r) => r.resourceType === "agent");
|
|
13768
|
+
const commands = updatedResources.filter((r) => r.resourceType === "command");
|
|
13724
13769
|
const eagerSkills = skills.filter((s) => s.eager === true);
|
|
13725
13770
|
const lazySkills = skills.filter((s) => s.eager !== true);
|
|
13726
13771
|
const eagerAgents = agents.filter((a) => a.eager === true);
|
|
13727
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);
|
|
13728
13775
|
let newContent = "";
|
|
13729
13776
|
if (!beforeManifest.trim() && !afterManifest.trim()) {
|
|
13730
13777
|
newContent = "";
|
|
13731
13778
|
} else {
|
|
13732
13779
|
newContent = beforeManifest;
|
|
13733
13780
|
}
|
|
13734
|
-
const hasEagerContent = eagerSkills.length > 0 || eagerAgents.length > 0;
|
|
13735
|
-
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;
|
|
13736
13783
|
if (hasEagerContent) {
|
|
13737
13784
|
if (eagerSkills.length > 0) {
|
|
13738
13785
|
newContent += generateEagerSkillsSystemHeader();
|
|
@@ -13753,6 +13800,19 @@ Do not wait for explicit requests - invoke these agents when their expertise app
|
|
|
13753
13800
|
newContent += eagerAgents.map((a) => generateSkillXML(a)).join("\n\n");
|
|
13754
13801
|
newContent += "\n\n</eager_agents>\n</agents_system>\n\n";
|
|
13755
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
|
+
}
|
|
13756
13816
|
}
|
|
13757
13817
|
if (hasLazyContent) {
|
|
13758
13818
|
if (lazySkills.length > 0) {
|
|
@@ -13767,6 +13827,12 @@ Do not wait for explicit requests - invoke these agents when their expertise app
|
|
|
13767
13827
|
newContent += lazyAgents.map((a) => generateSkillXML(a)).join("\n\n");
|
|
13768
13828
|
newContent += "\n\n</available_agents>\n</agents_system>";
|
|
13769
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
|
+
}
|
|
13770
13836
|
}
|
|
13771
13837
|
newContent += "\n\n<!-- PRPM_MANIFEST_END -->";
|
|
13772
13838
|
newContent += afterManifest;
|
|
@@ -13835,6 +13901,21 @@ function parseSkillsFromManifest(manifestXML) {
|
|
|
13835
13901
|
eager: activation === "eager"
|
|
13836
13902
|
});
|
|
13837
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
|
+
}
|
|
13838
13919
|
if (resources.length === 0) {
|
|
13839
13920
|
const legacyRegex = /<skill\s+name="([^"]+)"\s+path="([^"]+)">([^<]*)<\/skill>/g;
|
|
13840
13921
|
while ((match = legacyRegex.exec(manifestXML)) !== null) {
|
|
@@ -16422,7 +16503,7 @@ function findMainFile(files, format, subtype) {
|
|
|
16422
16503
|
return null;
|
|
16423
16504
|
}
|
|
16424
16505
|
async function handleInstall(packageSpec, options) {
|
|
16425
|
-
var _a;
|
|
16506
|
+
var _a, _b;
|
|
16426
16507
|
const startTime = Date.now();
|
|
16427
16508
|
let success = false;
|
|
16428
16509
|
let error;
|
|
@@ -16597,7 +16678,7 @@ async function handleInstall(packageSpec, options) {
|
|
|
16597
16678
|
const tarball = await client.downloadPackage(tarballUrl);
|
|
16598
16679
|
const lockfileKeyForVerification = getLockfileKey(packageId, targetFormat);
|
|
16599
16680
|
const existingEntry = lockfile == null ? void 0 : lockfile.packages[lockfileKeyForVerification];
|
|
16600
|
-
if (existingEntry == null ? void 0 : existingEntry.integrity) {
|
|
16681
|
+
if ((existingEntry == null ? void 0 : existingEntry.integrity) && existingEntry.version === actualVersion) {
|
|
16601
16682
|
console.log(` \u{1F512} Verifying integrity...`);
|
|
16602
16683
|
const isValid = verifyPackageIntegrity(lockfile, packageId, tarball, targetFormat);
|
|
16603
16684
|
if (!isValid) {
|
|
@@ -16933,13 +17014,16 @@ This could indicate:
|
|
|
16933
17014
|
destPath = `${destDir}/SKILL.md`;
|
|
16934
17015
|
} else if (effectiveFormat === "claude" && effectiveSubtype === "hook") {
|
|
16935
17016
|
destPath = `${destDir}/settings.json`;
|
|
16936
|
-
} 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") {
|
|
16937
17018
|
if (effectiveSubtype === "skill") {
|
|
16938
17019
|
destPath = `${destDir}/SKILL.md`;
|
|
16939
17020
|
console.log(` \u{1F4E6} Installing skill to ${destDir}/ for progressive disclosure`);
|
|
16940
17021
|
} else if (effectiveSubtype === "agent") {
|
|
16941
17022
|
destPath = `${destDir}/AGENT.md`;
|
|
16942
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`);
|
|
16943
17027
|
} else {
|
|
16944
17028
|
const manifestFilename = getManifestFilename(effectiveFormat);
|
|
16945
17029
|
let targetPath = manifestFilename;
|
|
@@ -17139,14 +17223,50 @@ ${afterFrontmatter}`;
|
|
|
17139
17223
|
}
|
|
17140
17224
|
}
|
|
17141
17225
|
let progressiveDisclosureMetadata;
|
|
17142
|
-
|
|
17226
|
+
const progressiveDisclosureFormats = [
|
|
17227
|
+
"agents.md",
|
|
17228
|
+
// Universal AGENTS.md format
|
|
17229
|
+
"gemini.md",
|
|
17230
|
+
// Uses GEMINI.md
|
|
17231
|
+
"claude.md",
|
|
17232
|
+
// Uses CLAUDE.md
|
|
17233
|
+
"aider",
|
|
17234
|
+
// Uses CONVENTIONS.md
|
|
17235
|
+
"codex",
|
|
17236
|
+
// Uses AGENTS.md (no native skills/agents)
|
|
17237
|
+
"copilot",
|
|
17238
|
+
// Uses AGENTS.md (no native skills/agents)
|
|
17239
|
+
"kiro",
|
|
17240
|
+
// Uses AGENTS.md (no native skills)
|
|
17241
|
+
"opencode",
|
|
17242
|
+
// Uses AGENTS.md (no native skills)
|
|
17243
|
+
"replit",
|
|
17244
|
+
// Uses AGENTS.md (no native skills)
|
|
17245
|
+
"zed",
|
|
17246
|
+
// Uses AGENTS.md (no native skills)
|
|
17247
|
+
"generic"
|
|
17248
|
+
// Uses AGENTS.md (fallback format)
|
|
17249
|
+
];
|
|
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) {
|
|
17143
17256
|
if (!destDir) {
|
|
17144
17257
|
throw new Error("Internal error: destDir not set for progressive disclosure installation");
|
|
17145
17258
|
}
|
|
17146
17259
|
const manifestPath = options.manifestFile || getManifestFilename(effectiveFormat);
|
|
17147
17260
|
const resourceName = stripAuthorNamespace2(packageId);
|
|
17148
|
-
const resourceType = effectiveSubtype;
|
|
17149
|
-
|
|
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
|
+
}
|
|
17150
17270
|
let resolvedEager;
|
|
17151
17271
|
if (options.eager !== void 0) {
|
|
17152
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",
|