prpm 2.1.28 → 2.1.30
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 +129 -17
- package/dist/schemas/codex-agent-role.schema.json +28 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -923,6 +923,16 @@ function fromClaude(content, metadata, sourceFormat = "claude", explicitSubtype)
|
|
|
923
923
|
}
|
|
924
924
|
sections.push(...bodySections);
|
|
925
925
|
const subtype = detectSubtypeFromFrontmatter(frontmatter, explicitSubtype);
|
|
926
|
+
if (subtype === "skill" && (frontmatter.name || frontmatter["allowed-tools"] || frontmatter.compatibility || frontmatter.license)) {
|
|
927
|
+
metadataSection.data.agentSkills = {
|
|
928
|
+
name: frontmatter.name,
|
|
929
|
+
license: frontmatter.license,
|
|
930
|
+
compatibility: frontmatter.compatibility,
|
|
931
|
+
// Normalize to space-delimited per Agent Skills spec (Claude uses comma-separated)
|
|
932
|
+
allowedTools: frontmatter["allowed-tools"] ? frontmatter["allowed-tools"].split(",").map((t) => t.trim()).filter(Boolean).join(" ") : void 0,
|
|
933
|
+
metadata: typeof frontmatter.metadata === "object" && frontmatter.metadata !== null ? frontmatter.metadata : void 0
|
|
934
|
+
};
|
|
935
|
+
}
|
|
926
936
|
const pkg = {
|
|
927
937
|
id: metadata.id,
|
|
928
938
|
version: metadata.version || "1.0.0",
|
|
@@ -8696,7 +8706,7 @@ function parseFrontmatter8(content) {
|
|
|
8696
8706
|
}
|
|
8697
8707
|
function parseAllowedTools(toolsString) {
|
|
8698
8708
|
return toolsString.split(/\s+/).filter(Boolean).map((tool) => {
|
|
8699
|
-
const match = tool.match(/^([A-Za-
|
|
8709
|
+
const match = tool.match(/^([A-Za-z0-9_.-]+)(?:\([^)]*\))?$/);
|
|
8700
8710
|
return match ? match[1] : tool;
|
|
8701
8711
|
}).filter((tool, index, arr) => arr.indexOf(tool) === index);
|
|
8702
8712
|
}
|
|
@@ -8760,12 +8770,64 @@ function fromCodex(content, metadata) {
|
|
|
8760
8770
|
setTaxonomy(pkg, "codex", "skill");
|
|
8761
8771
|
return pkg;
|
|
8762
8772
|
}
|
|
8773
|
+
function fromCodexAgentRole(content, metadata) {
|
|
8774
|
+
var _a;
|
|
8775
|
+
let role = {};
|
|
8776
|
+
try {
|
|
8777
|
+
role = import_toml.default.parse(content);
|
|
8778
|
+
} catch {
|
|
8779
|
+
}
|
|
8780
|
+
const sections = [];
|
|
8781
|
+
const metadataSection = {
|
|
8782
|
+
type: "metadata",
|
|
8783
|
+
data: {
|
|
8784
|
+
title: metadata.name || metadata.id,
|
|
8785
|
+
description: metadata.description || "",
|
|
8786
|
+
version: metadata.version || "1.0.0",
|
|
8787
|
+
author: metadata.author
|
|
8788
|
+
}
|
|
8789
|
+
};
|
|
8790
|
+
metadataSection.data.codexAgent = {
|
|
8791
|
+
model: role.model,
|
|
8792
|
+
modelReasoningEffort: role.model_reasoning_effort,
|
|
8793
|
+
sandboxMode: role.sandbox_mode
|
|
8794
|
+
};
|
|
8795
|
+
sections.push(metadataSection);
|
|
8796
|
+
if ((_a = role.developer_instructions) == null ? void 0 : _a.trim()) {
|
|
8797
|
+
sections.push({
|
|
8798
|
+
type: "instructions",
|
|
8799
|
+
title: "Instructions",
|
|
8800
|
+
content: role.developer_instructions.trim()
|
|
8801
|
+
});
|
|
8802
|
+
}
|
|
8803
|
+
const canonicalContent = {
|
|
8804
|
+
format: "canonical",
|
|
8805
|
+
version: "1.0",
|
|
8806
|
+
sections
|
|
8807
|
+
};
|
|
8808
|
+
const pkg = {
|
|
8809
|
+
...metadata,
|
|
8810
|
+
id: metadata.id,
|
|
8811
|
+
name: metadata.name || metadata.id,
|
|
8812
|
+
version: metadata.version,
|
|
8813
|
+
author: metadata.author,
|
|
8814
|
+
description: metadata.description || "",
|
|
8815
|
+
tags: metadata.tags || [],
|
|
8816
|
+
format: "codex",
|
|
8817
|
+
subtype: "agent",
|
|
8818
|
+
content: canonicalContent
|
|
8819
|
+
};
|
|
8820
|
+
setTaxonomy(pkg, "codex", "agent");
|
|
8821
|
+
return pkg;
|
|
8822
|
+
}
|
|
8823
|
+
var import_toml;
|
|
8763
8824
|
var init_from_codex = __esm({
|
|
8764
8825
|
"../converters/dist/from-codex.js"() {
|
|
8765
8826
|
"use strict";
|
|
8766
8827
|
init_cjs_shims();
|
|
8767
8828
|
init_taxonomy_utils();
|
|
8768
8829
|
init_js_yaml();
|
|
8830
|
+
import_toml = __toESM(require_toml(), 1);
|
|
8769
8831
|
}
|
|
8770
8832
|
});
|
|
8771
8833
|
|
|
@@ -8980,6 +9042,7 @@ function loadSchema(format, subtype) {
|
|
|
8980
9042
|
"opencode:plugin": "opencode-plugin.schema.json",
|
|
8981
9043
|
"opencode:skill": "agent-skills.schema.json",
|
|
8982
9044
|
"codex:skill": "agent-skills.schema.json",
|
|
9045
|
+
"codex:agent": "codex-agent-role.schema.json",
|
|
8983
9046
|
"gemini:extension": "gemini-extension.schema.json",
|
|
8984
9047
|
"amp:skill": "agent-skills.schema.json",
|
|
8985
9048
|
"amp:slash-command": "amp-command.schema.json",
|
|
@@ -12568,10 +12631,13 @@ function toCodex(pkg, options = {}) {
|
|
|
12568
12631
|
try {
|
|
12569
12632
|
const config = options.codexConfig || {};
|
|
12570
12633
|
const isSkill = pkg.subtype === "skill";
|
|
12634
|
+
const isAgent = pkg.subtype === "agent";
|
|
12571
12635
|
const isSlashCommand = pkg.subtype === "slash-command";
|
|
12572
12636
|
let content;
|
|
12573
12637
|
if (isSkill && !config.forceAgentsMd) {
|
|
12574
12638
|
content = convertToSkillMd(pkg, warnings);
|
|
12639
|
+
} else if (isAgent) {
|
|
12640
|
+
content = convertToAgentRoleToml(pkg, warnings);
|
|
12575
12641
|
} else if (isSlashCommand) {
|
|
12576
12642
|
content = convertSlashCommandToSection(pkg, warnings);
|
|
12577
12643
|
if (config.appendMode && config.existingContent) {
|
|
@@ -12602,15 +12668,43 @@ function toCodex(pkg, options = {}) {
|
|
|
12602
12668
|
};
|
|
12603
12669
|
}
|
|
12604
12670
|
}
|
|
12671
|
+
function convertToAgentRoleToml(pkg, warnings) {
|
|
12672
|
+
const metadataSection = pkg.content.sections.find((s) => s.type === "metadata");
|
|
12673
|
+
const instructionsSection = pkg.content.sections.find((s) => s.type === "instructions");
|
|
12674
|
+
const role = {};
|
|
12675
|
+
const codexAgent = (metadataSection == null ? void 0 : metadataSection.type) === "metadata" ? metadataSection.data.codexAgent : void 0;
|
|
12676
|
+
if (codexAgent == null ? void 0 : codexAgent.model) {
|
|
12677
|
+
role["model"] = codexAgent.model;
|
|
12678
|
+
}
|
|
12679
|
+
if (codexAgent == null ? void 0 : codexAgent.modelReasoningEffort) {
|
|
12680
|
+
role["model_reasoning_effort"] = codexAgent.modelReasoningEffort;
|
|
12681
|
+
}
|
|
12682
|
+
if (codexAgent == null ? void 0 : codexAgent.sandboxMode) {
|
|
12683
|
+
role["sandbox_mode"] = codexAgent.sandboxMode;
|
|
12684
|
+
}
|
|
12685
|
+
if ((instructionsSection == null ? void 0 : instructionsSection.type) === "instructions") {
|
|
12686
|
+
role["developer_instructions"] = instructionsSection.content;
|
|
12687
|
+
} else if (pkg.description) {
|
|
12688
|
+
role["developer_instructions"] = pkg.description;
|
|
12689
|
+
}
|
|
12690
|
+
for (const section of pkg.content.sections) {
|
|
12691
|
+
if (section.type === "tools") {
|
|
12692
|
+
warnings.push("Tools section skipped (not supported by Codex agent role TOML)");
|
|
12693
|
+
} else if (section.type === "persona") {
|
|
12694
|
+
warnings.push("Persona section skipped (not supported by Codex agent role TOML)");
|
|
12695
|
+
} else if (section.type === "rules") {
|
|
12696
|
+
warnings.push("Rules section skipped (not supported by Codex agent role TOML - use developer_instructions)");
|
|
12697
|
+
}
|
|
12698
|
+
}
|
|
12699
|
+
return import_toml2.default.stringify(role);
|
|
12700
|
+
}
|
|
12605
12701
|
function convertToSkillMd(pkg, warnings) {
|
|
12606
|
-
var _a;
|
|
12607
12702
|
const lines = [];
|
|
12608
12703
|
const metadataSection = pkg.content.sections.find((s) => s.type === "metadata");
|
|
12609
12704
|
const toolsSection = pkg.content.sections.find((s) => s.type === "tools");
|
|
12610
|
-
const title = ((_a = pkg.metadata) == null ? void 0 : _a.title) || pkg.name;
|
|
12611
12705
|
const description = pkg.description || "";
|
|
12612
12706
|
const frontmatter = {
|
|
12613
|
-
name: slugify(
|
|
12707
|
+
name: slugify(stripNamespace(pkg.name)),
|
|
12614
12708
|
description: truncateDescription(description, 1024)
|
|
12615
12709
|
};
|
|
12616
12710
|
if (pkg.license) {
|
|
@@ -12663,6 +12757,9 @@ function truncateDescription(desc, maxLength) {
|
|
|
12663
12757
|
return desc;
|
|
12664
12758
|
return desc.substring(0, maxLength - 3) + "...";
|
|
12665
12759
|
}
|
|
12760
|
+
function stripNamespace(name) {
|
|
12761
|
+
return name.replace(/^@[^/]+\//, "");
|
|
12762
|
+
}
|
|
12666
12763
|
function slugify(name) {
|
|
12667
12764
|
let slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
12668
12765
|
if (!slug) {
|
|
@@ -12885,10 +12982,14 @@ function parseArgumentHint2(hint) {
|
|
|
12885
12982
|
}
|
|
12886
12983
|
return hint.split(/\s+/).filter(Boolean);
|
|
12887
12984
|
}
|
|
12888
|
-
function generateFilename2(pkg) {
|
|
12985
|
+
function generateFilename2(pkg, name) {
|
|
12889
12986
|
if ((pkg == null ? void 0 : pkg.subtype) === "skill") {
|
|
12890
12987
|
return "SKILL.md";
|
|
12891
12988
|
}
|
|
12989
|
+
if ((pkg == null ? void 0 : pkg.subtype) === "agent") {
|
|
12990
|
+
const roleName = name || (pkg == null ? void 0 : pkg.name) || "agent";
|
|
12991
|
+
return `${roleName}.toml`;
|
|
12992
|
+
}
|
|
12892
12993
|
return "AGENTS.md";
|
|
12893
12994
|
}
|
|
12894
12995
|
function isCodexSkillFormat(content) {
|
|
@@ -12901,11 +13002,13 @@ function isCodexSkillFormat(content) {
|
|
|
12901
13002
|
const hasDescription = /^[ \t]*description\s*:/m.test(frontmatterText);
|
|
12902
13003
|
return hasName && hasDescription;
|
|
12903
13004
|
}
|
|
13005
|
+
var import_toml2;
|
|
12904
13006
|
var init_to_codex = __esm({
|
|
12905
13007
|
"../converters/dist/to-codex.js"() {
|
|
12906
13008
|
"use strict";
|
|
12907
13009
|
init_cjs_shims();
|
|
12908
13010
|
init_js_yaml();
|
|
13011
|
+
import_toml2 = __toESM(require_toml(), 1);
|
|
12909
13012
|
}
|
|
12910
13013
|
});
|
|
12911
13014
|
|
|
@@ -13489,7 +13592,7 @@ var init_format_registry = __esm({
|
|
|
13489
13592
|
fileExtension: ".md"
|
|
13490
13593
|
},
|
|
13491
13594
|
skill: {
|
|
13492
|
-
directory: ".
|
|
13595
|
+
directory: ".agents/skills",
|
|
13493
13596
|
filePatterns: ["SKILL.md"],
|
|
13494
13597
|
nested: true,
|
|
13495
13598
|
nestedIndicator: "SKILL.md",
|
|
@@ -13497,12 +13600,9 @@ var init_format_registry = __esm({
|
|
|
13497
13600
|
fileExtension: ".md"
|
|
13498
13601
|
},
|
|
13499
13602
|
agent: {
|
|
13500
|
-
directory: ".
|
|
13501
|
-
filePatterns: ["
|
|
13502
|
-
|
|
13503
|
-
nestedIndicator: "AGENT.md",
|
|
13504
|
-
usesPackageSubdirectory: true,
|
|
13505
|
-
fileExtension: ".md"
|
|
13603
|
+
directory: ".codex/agents",
|
|
13604
|
+
filePatterns: ["*.toml"],
|
|
13605
|
+
fileExtension: ".toml"
|
|
13506
13606
|
}
|
|
13507
13607
|
}
|
|
13508
13608
|
},
|
|
@@ -14279,6 +14379,7 @@ __export(dist_exports, {
|
|
|
14279
14379
|
fromClaude: () => fromClaude,
|
|
14280
14380
|
fromClaudePlugin: () => fromClaudePlugin,
|
|
14281
14381
|
fromCodex: () => fromCodex,
|
|
14382
|
+
fromCodexAgentRole: () => fromCodexAgentRole,
|
|
14282
14383
|
fromContinue: () => fromContinue,
|
|
14283
14384
|
fromCopilot: () => fromCopilot,
|
|
14284
14385
|
fromCursor: () => fromCursor,
|
|
@@ -17970,8 +18071,13 @@ This could indicate:
|
|
|
17970
18071
|
destPath = `${destDir}/SKILL.md`;
|
|
17971
18072
|
console.log(` \u{1F4E6} Installing skill to ${destDir}/ for progressive disclosure`);
|
|
17972
18073
|
} else if (effectiveSubtype === "agent") {
|
|
17973
|
-
|
|
17974
|
-
|
|
18074
|
+
if (effectiveFormat === "codex") {
|
|
18075
|
+
destPath = `${destDir}/${packageName}.toml`;
|
|
18076
|
+
console.log(` \u{1F916} Installing Codex agent role to ${destPath}`);
|
|
18077
|
+
} else {
|
|
18078
|
+
destPath = `${destDir}/AGENT.md`;
|
|
18079
|
+
console.log(` \u{1F916} Installing agent to ${destDir}/ for progressive disclosure`);
|
|
18080
|
+
}
|
|
17975
18081
|
} else if (effectiveSubtype === "slash-command") {
|
|
17976
18082
|
destPath = `${destDir}/${packageName}.md`;
|
|
17977
18083
|
console.log(` \u26A1 Installing command to ${destDir}/ for progressive disclosure`);
|
|
@@ -26000,7 +26106,10 @@ function getDefaultPath(format, filename, subtype, customName) {
|
|
|
26000
26106
|
return (0, import_path25.join)(process.cwd(), ".factory", `${baseName}.md`);
|
|
26001
26107
|
case "codex":
|
|
26002
26108
|
if (subtype === "skill") {
|
|
26003
|
-
return (0, import_path25.join)(process.cwd(), ".
|
|
26109
|
+
return (0, import_path25.join)(process.cwd(), ".agents", "skills", baseName, "SKILL.md");
|
|
26110
|
+
}
|
|
26111
|
+
if (subtype === "agent") {
|
|
26112
|
+
return (0, import_path25.join)(process.cwd(), ".agents", "agents", baseName, "AGENT.md");
|
|
26004
26113
|
}
|
|
26005
26114
|
return (0, import_path25.join)(process.cwd(), "AGENTS.md");
|
|
26006
26115
|
default:
|
|
@@ -26045,8 +26154,11 @@ function detectFormat(content, filepath) {
|
|
|
26045
26154
|
if (filepath.includes(".zed/extensions") || filepath.includes(".zed/slash_commands")) {
|
|
26046
26155
|
return "zed";
|
|
26047
26156
|
}
|
|
26048
|
-
if (filepath.includes(".
|
|
26049
|
-
return "codex";
|
|
26157
|
+
if (filepath.includes(".agents/skills")) {
|
|
26158
|
+
return "codex-skill";
|
|
26159
|
+
}
|
|
26160
|
+
if (filepath.includes(".agents/agents")) {
|
|
26161
|
+
return "codex-agent";
|
|
26050
26162
|
}
|
|
26051
26163
|
if (isCursorHooksFormat(content)) return "cursor-hooks";
|
|
26052
26164
|
if (isClaudeFormat(content)) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://registry.prpm.dev/api/v1/schemas/codex/agent-role.json",
|
|
4
|
+
"title": "Codex Agent Role Format",
|
|
5
|
+
"description": "JSON Schema for OpenAI Codex CLI agent role configuration (TOML format, installed to ~/.codex/agents/)",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"model": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Model identifier to use for this agent role"
|
|
11
|
+
},
|
|
12
|
+
"model_reasoning_effort": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": ["low", "medium", "high"],
|
|
15
|
+
"description": "Reasoning effort level for the model"
|
|
16
|
+
},
|
|
17
|
+
"developer_instructions": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "System prompt / developer instructions for this agent role"
|
|
20
|
+
},
|
|
21
|
+
"sandbox_mode": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"enum": ["read-only", "workspace-write", "danger-full-access"],
|
|
24
|
+
"description": "Filesystem/network sandbox policy: read-only (default), workspace-write, or danger-full-access (no sandbox)"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"additionalProperties": false
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prpm",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.30",
|
|
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.31",
|
|
49
|
+
"@pr-pm/registry-client": "^2.3.30",
|
|
50
|
+
"@pr-pm/types": "^2.1.31",
|
|
51
51
|
"ajv": "^8.17.1",
|
|
52
52
|
"ajv-formats": "^3.0.1",
|
|
53
53
|
"chalk": "^5.6.2",
|