@modootoday/pmcp 0.17.4 → 0.18.2
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/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +2 -2
- package/.mcp.json +1 -1
- package/CHANGELOG.md +152 -0
- package/CONTRIBUTING.md +71 -0
- package/README.md +98 -201
- package/SECURITY.md +17 -1
- package/dist/apply-JUTGS5WZ.js +242 -0
- package/dist/{attachment-tU5FZrgZ.d.ts → attachment-D84OGI6n.d.ts} +1 -1
- package/dist/available-DBSIVVJ6.js +73 -0
- package/dist/broadcast-CBMVOV3G.js +18 -0
- package/dist/chunk-26WLNWDG.js +93 -0
- package/dist/chunk-2FIV63WC.js +252 -0
- package/dist/chunk-2P4Z2NUX.js +28 -0
- package/dist/chunk-34DECPVC.js +22 -0
- package/dist/chunk-3FCFAQDG.js +42 -0
- package/dist/chunk-3IDXEV5E.js +1934 -0
- package/dist/chunk-3PW4FI7U.js +32 -0
- package/dist/chunk-3Y3HDMHA.js +108 -0
- package/dist/chunk-47O3X4VS.js +113 -0
- package/dist/chunk-4NDEP7HU.js +26 -0
- package/dist/chunk-5OMOPUE6.js +39 -0
- package/dist/chunk-5QQWS4US.js +53 -0
- package/dist/chunk-5ZABTVSW.js +48 -0
- package/dist/chunk-65KAQSJP.js +7 -0
- package/dist/chunk-6STKGOCW.js +27 -0
- package/dist/chunk-6WXMJOMI.js +9 -0
- package/dist/chunk-73AKO4UL.js +24 -0
- package/dist/chunk-7DLZC73N.js +29 -0
- package/dist/chunk-7GBYECSK.js +72 -0
- package/dist/chunk-7HFIGCSL.js +419 -0
- package/dist/chunk-7TD53M7L.js +13 -0
- package/dist/chunk-7UCZAN4J.js +778 -0
- package/dist/chunk-A4PKLESO.js +112 -0
- package/dist/chunk-A7VF7A35.js +1025 -0
- package/dist/chunk-ABTJQ4QV.js +74 -0
- package/dist/chunk-AJ4VXM2U.js +349 -0
- package/dist/chunk-BBTBJCFA.js +380 -0
- package/dist/chunk-BU65MNVU.js +13 -0
- package/dist/chunk-C4NHQGHL.js +142 -0
- package/dist/chunk-CJTKR6K6.js +1213 -0
- package/dist/chunk-D77IRGHO.js +1246 -0
- package/dist/chunk-DCU2EXQV.js +78 -0
- package/dist/chunk-DMZHQZ7P.js +104 -0
- package/dist/chunk-DZ2MRTYT.js +135 -0
- package/dist/chunk-E2YOZ2FF.js +207 -0
- package/dist/chunk-E3DQB5LS.js +48 -0
- package/dist/chunk-EATCUWGG.js +66 -0
- package/dist/chunk-EAWPJHJ7.js +155 -0
- package/dist/chunk-EIDIVIAD.js +33 -0
- package/dist/chunk-F5QYZK7E.js +396 -0
- package/dist/chunk-F5XMGOOX.js +28 -0
- package/dist/chunk-FENOGX3U.js +31 -0
- package/dist/chunk-GZHHEHKY.js +44 -0
- package/dist/chunk-HDMBVLCZ.js +53 -0
- package/dist/chunk-HQOB7OQS.js +81 -0
- package/dist/chunk-I2ZP2PSA.js +211 -0
- package/dist/chunk-IG33DXLT.js +151 -0
- package/dist/chunk-IJBSOWHK.js +86 -0
- package/dist/chunk-INT7QLEU.js +114 -0
- package/dist/chunk-J7UYNJCR.js +9 -0
- package/dist/chunk-JEL35P7S.js +53 -0
- package/dist/chunk-JGJ4INEN.js +32 -0
- package/dist/chunk-JS5RTH4I.js +84 -0
- package/dist/chunk-JWRZDYB5.js +59 -0
- package/dist/chunk-KMXRRSKT.js +660 -0
- package/dist/chunk-LBXO4VPG.js +73 -0
- package/dist/chunk-LLBPVZXM.js +67 -0
- package/dist/chunk-LLT5FQBE.js +57 -0
- package/dist/chunk-LMT3PPXJ.js +17 -0
- package/dist/chunk-LMUBBIE2.js +83 -0
- package/dist/chunk-LTZH5E3G.js +479 -0
- package/dist/chunk-LW4TG7EL.js +39 -0
- package/dist/chunk-MPSQXSC6.js +346 -0
- package/dist/chunk-MVFH26QT.js +97 -0
- package/dist/chunk-NLEXKE7U.js +67 -0
- package/dist/chunk-NQPURJT5.js +44 -0
- package/dist/chunk-NRBQK6UX.js +105 -0
- package/dist/chunk-OEH47H6A.js +48 -0
- package/dist/chunk-OG7QR2DP.js +75 -0
- package/dist/chunk-OPYFEHKG.js +52 -0
- package/dist/chunk-P4N7DBD5.js +83 -0
- package/dist/chunk-PAX3QXX2.js +140 -0
- package/dist/chunk-PKODFR5F.js +102 -0
- package/dist/chunk-PMJG2CXF.js +122 -0
- package/dist/chunk-Q5H3L6Y4.js +23 -0
- package/dist/chunk-QEF7EK3T.js +28 -0
- package/dist/chunk-QEW4J3IZ.js +74 -0
- package/dist/chunk-QPL7E2HW.js +464 -0
- package/dist/chunk-R2GPCZUX.js +22 -0
- package/dist/chunk-R5MT42JS.js +284 -0
- package/dist/chunk-RMATE45Z.js +197 -0
- package/dist/chunk-RPQOBHVU.js +87 -0
- package/dist/chunk-S3PIAMXV.js +230 -0
- package/dist/chunk-T3LKX23M.js +168 -0
- package/dist/chunk-T6GOWHK6.js +30 -0
- package/dist/chunk-TIA4SPU2.js +10 -0
- package/dist/chunk-TNCZ6444.js +57 -0
- package/dist/chunk-TVL5RTE6.js +269 -0
- package/dist/chunk-TXQ7L33K.js +45 -0
- package/dist/chunk-UPQTAHUK.js +189 -0
- package/dist/chunk-V4NPDK6X.js +14 -0
- package/dist/chunk-VJFEN6DJ.js +38 -0
- package/dist/chunk-VMHUEOT5.js +643 -0
- package/dist/chunk-VRPMYPZU.js +4985 -0
- package/dist/chunk-WIW772I3.js +25 -0
- package/dist/chunk-XELAZAIM.js +136 -0
- package/dist/chunk-XNML2KIC.js +23 -0
- package/dist/chunk-XP2U3LO3.js +30 -0
- package/dist/chunk-YGOWIJPE.js +51 -0
- package/dist/chunk-YIXDHQYE.js +11 -0
- package/dist/chunk-YSAWTGNA.js +117 -0
- package/dist/claude-U2JC2DNQ.js +77 -0
- package/dist/cli-MI4ZCAZ3.js +41 -0
- package/dist/cli-ZN7ZVDEZ.js +46 -0
- package/dist/cli.js +144 -16197
- package/dist/completion-ILSRB3LW.js +142 -0
- package/dist/config-DnpLL2kT.d.ts +46 -0
- package/dist/{service-qpCsOXkQ.d.ts → core-C1LPjxK6.d.ts} +2 -6
- package/dist/diagnostics-XKXVVQWH.js +93 -0
- package/dist/doctor-O2E63YGO.js +538 -0
- package/dist/entry-X6CSYQRQ.js +305 -0
- package/dist/exec-mcp-2PMWBPD7.js +365 -0
- package/dist/harness-L2KSI2ZB.js +177 -0
- package/dist/harness-egress-bridge.js +4 -4
- package/dist/harness-launch-gate.js +47 -940
- package/dist/harness-pane-runner.js +13 -80
- package/dist/harness-worker.js +21 -2703
- package/dist/hook-body.js +5222 -0
- package/dist/hook-spec-C5fWTSCH.d.ts +100 -0
- package/dist/hook.js +26 -0
- package/dist/hooks-BHTA44X7.js +21 -0
- package/dist/host-UIZAXXQH.js +22 -0
- package/dist/host-UWK754BW.js +210 -0
- package/dist/host-run-BI2OTZDZ.js +307 -0
- package/dist/http.d.ts +5 -42
- package/dist/http.js +21 -2234
- package/dist/import-mcp-GPKJI7DI.js +400 -0
- package/dist/index.d.ts +146 -168
- package/dist/index.js +133 -4948
- package/dist/init-3C2Y7BNJ.js +14 -0
- package/dist/install-GG7HHZK2.js +796 -0
- package/dist/invoke-44CJRVMK.js +23 -0
- package/dist/list-MCP2FXUF.js +68 -0
- package/dist/list-WL6L4J5H.js +65 -0
- package/dist/load-BEUBABtB.d.ts +21 -0
- package/dist/logout-F5EJ5MOU.js +44 -0
- package/dist/logs-TBUA4UWU.js +107 -0
- package/dist/mailbox/index.d.ts +10 -5
- package/dist/mailbox/index.js +53 -1572
- package/dist/mailbox-BMTZOSZ7.js +285 -0
- package/dist/mailbox-GDJ7BWQN.js +189 -0
- package/dist/mainline-KAD2ERLP.js +639 -0
- package/dist/marketplace-G4VQET5W.js +191 -0
- package/dist/mcp-235QZN2A.js +15 -0
- package/dist/mcp-FJ2UQ4RH.js +193 -0
- package/dist/models-ISU4DCMA.js +32 -0
- package/dist/opencode-CN7JLQYO.js +60 -0
- package/dist/pause-7LILUVGL.js +18 -0
- package/dist/preview-DT7DWG5F.js +91 -0
- package/dist/project/hook-adapter.d.ts +5 -2
- package/dist/project/hook-adapter.js +41 -27
- package/dist/project-5YV5CUEG.js +70 -0
- package/dist/pty-XTJ4MIWK.js +94 -0
- package/dist/recovery-U6QB3PMT.js +100 -0
- package/dist/reindex-Y27QJFDB.js +22 -0
- package/dist/resume-26VFAAMH.js +18 -0
- package/dist/run-3AXTZSR7.js +126 -0
- package/dist/run-3SOVRQIA.js +19 -0
- package/dist/serve-DQMKTFIV.js +104 -0
- package/dist/session-XM2CR425.js +159 -0
- package/dist/setup-DTKZLZUT.js +18 -0
- package/dist/start-login-YTZV6KMF.js +416 -0
- package/dist/status-A2OUTNGK.js +9 -0
- package/dist/status-H2VAHIDV.js +10 -0
- package/dist/status-MROQ7WR7.js +43 -0
- package/dist/status-RO55QPKV.js +55 -0
- package/dist/status-UME2L33L.js +286 -0
- package/dist/stdio.d.ts +3 -13
- package/dist/stdio.js +16 -3186
- package/dist/sweep-35LGQTTO.js +18 -0
- package/dist/test-AGZOJLRZ.js +561 -0
- package/dist/tools-gpHNq9Dh.d.ts +328 -0
- package/dist/tui-G5LLWCSV.js +153 -0
- package/dist/unbroadcast-5QNGAJR2.js +18 -0
- package/dist/validate-IU52H2IC.js +46 -0
- package/dist/worker-QZ5T6LJD.js +80 -0
- package/dist/worktree-create-PZSRB7PH.js +89 -0
- package/dist/worktree-list-JYB6VXLW.js +51 -0
- package/dist/worktree-sync-UF5CXPWV.js +30 -0
- package/docs/authoring.md +82 -0
- package/docs/browser-and-desktop.md +46 -0
- package/docs/commands.md +325 -0
- package/docs/compare.md +35 -0
- package/docs/compatibility.md +55 -0
- package/docs/embeddings.md +1 -1
- package/docs/getting-started.md +105 -0
- package/docs/git-workflow.md +60 -0
- package/docs/glossary.md +31 -0
- package/docs/hooks/capabilities/antigravity.json +199 -0
- package/docs/hooks/capabilities/claude.json +179 -0
- package/docs/hooks/capabilities/codex.json +179 -0
- package/docs/hooks/capabilities/gemini.json +196 -0
- package/docs/hooks/capabilities/grok.json +192 -0
- package/docs/hooks/capabilities/opencode.json +184 -0
- package/docs/hooks.md +264 -0
- package/docs/install.md +72 -0
- package/docs/library-skills.md +132 -0
- package/docs/mailbox.md +16 -5
- package/docs/project-configuration.md +540 -58
- package/docs/sessions.md +64 -0
- package/docs/skills.md +4 -45
- package/docs/terminal-harness.md +92 -44
- package/docs/terminal-workspace.md +81 -169
- package/gemini-extension.json +2 -2
- package/mcp.json +1 -1
- package/package.json +16 -2
- package/plugin.json +2 -2
- package/plugins/pmcp/.claude-plugin/plugin.json +4 -2
- package/plugins/pmcp/.mcp.json +1 -1
- package/plugins/pmcp/gemini-extension.json +2 -2
- package/plugins/pmcp/mcp.json +1 -1
- package/plugins/pmcp/mod/commands.ts +72 -0
- package/plugins/pmcp/mod/contract.d.ts +39 -0
- package/plugins/pmcp/mod/draw.tsx +216 -0
- package/plugins/pmcp/mod/guard.ts +42 -0
- package/plugins/pmcp/mod/hooks.json +4 -0
- package/plugins/pmcp/mod/host.ts +46 -0
- package/plugins/pmcp/mod/model.ts +144 -0
- package/plugins/pmcp/mod/reader/index.ts +18 -0
- package/plugins/pmcp/mod/reader/read.ts +76 -0
- package/plugins/pmcp/mod/reader/settings.ts +54 -0
- package/plugins/pmcp/mod/reader/types.ts +38 -0
- package/plugins/pmcp/mod/register.tsx +73 -0
- package/plugins/pmcp/mod/sessions/format.ts +91 -0
- package/plugins/pmcp/mod/sessions/types.ts +162 -0
- package/plugins/pmcp/mod/snapshot.ts +75 -0
- package/plugins/pmcp/mod/spinner.tsx +30 -0
- package/plugins/pmcp/mod/state.ts +28 -0
- package/plugins/pmcp/plugin.json +2 -2
- package/plugins/pmcp/skills/agent-assets-migrate/SKILL.md +96 -0
- package/plugins/pmcp/skills/headless-agents-ci-scaffold/SKILL.md +101 -0
- package/plugins/pmcp/skills/marketplace-plugin-scaffold/SKILL.md +87 -0
- package/plugins/pmcp/skills/package-skill-catalog/SKILL.md +51 -15
- package/plugins/pmcp/skills/pmcp-browser/SKILL.md +27 -0
- package/plugins/pmcp/skills/pmcp-desktop/SKILL.md +25 -0
- package/plugins/pmcp/skills/pmcp-project-init/SKILL.md +153 -0
- package/plugins/pmcp/skills/pmcp-sessions-and-git/SKILL.md +96 -0
- package/plugins/pmcp/skills/skill-package-scaffold/SKILL.md +89 -0
- package/schema/catalog-v1.json +187 -0
- package/schema/library.json +196 -0
- package/schema/marketplace-manifest.json +144 -0
- package/schema/plugin-manifest.json +59 -0
- package/schema/skill-frontmatter.json +170 -0
- package/schema/skill-metadata-core.json +131 -0
- package/skills/agent-assets-migrate/SKILL.md +96 -0
- package/skills/headless-agents-ci-scaffold/SKILL.md +101 -0
- package/skills/marketplace-plugin-scaffold/SKILL.md +87 -0
- package/skills/package-skill-catalog/SKILL.md +51 -15
- package/skills/pmcp-browser/SKILL.md +27 -0
- package/skills/pmcp-desktop/SKILL.md +25 -0
- package/skills/pmcp-project-init/SKILL.md +153 -0
- package/skills/pmcp-sessions-and-git/SKILL.md +96 -0
- package/skills/skill-package-scaffold/SKILL.md +89 -0
- package/dist/config-BkSpjUG6.d.ts +0 -50
- package/dist/embed-DRROSD3F.d.ts +0 -53
- package/dist/hook-spec-CSJJySsH.d.ts +0 -11
- package/dist/server-VWSY3Shw.d.ts +0 -543
- package/dist/tui-worker.js +0 -6549
- package/docs/manual-library-skills.md +0 -74
- /package/dist/{tui-worker.d.ts → hook.d.ts} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/commands/options/remote.ts
|
|
2
|
+
var REMOTE_OPTIONS = [
|
|
3
|
+
{
|
|
4
|
+
name: "provider",
|
|
5
|
+
describe: "Public free catalog (default) or explicitly hosted service.",
|
|
6
|
+
placeholder: "<public|hosted>"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: "project",
|
|
10
|
+
describe: "Project directory containing package.json.",
|
|
11
|
+
placeholder: "<dir>"
|
|
12
|
+
},
|
|
13
|
+
{ name: "api", describe: "Catalog API origin.", placeholder: "<origin>" },
|
|
14
|
+
{
|
|
15
|
+
name: "catalog",
|
|
16
|
+
describe: "Use a saved catalog response without network access.",
|
|
17
|
+
placeholder: "<file>"
|
|
18
|
+
},
|
|
19
|
+
{ name: "json", describe: "Print machine-readable results.", boolean: true }
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
// src/commands/specs/remote.ts
|
|
23
|
+
var availableSpec = {
|
|
24
|
+
name: "available",
|
|
25
|
+
describe: "Find provided skills matching this project's installed dependencies",
|
|
26
|
+
usage: "pmcp available [--project <dir>] [--catalog <file>] [--json]",
|
|
27
|
+
options: REMOTE_OPTIONS
|
|
28
|
+
};
|
|
29
|
+
var previewSpec = {
|
|
30
|
+
name: "preview",
|
|
31
|
+
describe: "Show a skill's contents and a complete example",
|
|
32
|
+
usage: "pmcp preview <skill-package> [--json]",
|
|
33
|
+
options: REMOTE_OPTIONS
|
|
34
|
+
};
|
|
35
|
+
var MANAGE_OPTIONS = [
|
|
36
|
+
...REMOTE_OPTIONS,
|
|
37
|
+
{
|
|
38
|
+
name: "dry-run",
|
|
39
|
+
describe: "Show the plan without installing or changing files.",
|
|
40
|
+
boolean: true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "yes",
|
|
44
|
+
describe: "Approve the displayed project and lockfile changes.",
|
|
45
|
+
boolean: true
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
var installSpec = {
|
|
49
|
+
name: "install",
|
|
50
|
+
describe: "Install matching skill npm packages with the project's package manager",
|
|
51
|
+
usage: "pmcp install <skill-package>... | --all [--dry-run | --yes]",
|
|
52
|
+
options: [
|
|
53
|
+
...MANAGE_OPTIONS,
|
|
54
|
+
{
|
|
55
|
+
name: "all",
|
|
56
|
+
describe: "Select all matching skill packages.",
|
|
57
|
+
boolean: true
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
};
|
|
61
|
+
var syncSpec = {
|
|
62
|
+
name: "sync",
|
|
63
|
+
describe: "Update declared skill packages without removing other dependencies",
|
|
64
|
+
usage: "pmcp sync [--project <dir>] [--dry-run | --yes]",
|
|
65
|
+
options: MANAGE_OPTIONS
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
availableSpec,
|
|
70
|
+
previewSpec,
|
|
71
|
+
installSpec,
|
|
72
|
+
syncSpec
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=chunk-ABTJQ4QV.js.map
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bodyOf,
|
|
3
|
+
frontmatterObject,
|
|
4
|
+
readCatalog,
|
|
5
|
+
specProblems
|
|
6
|
+
} from "./chunk-KMXRRSKT.js";
|
|
7
|
+
|
|
8
|
+
// src/validate.ts
|
|
9
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3, statSync as statSync2 } from "fs";
|
|
10
|
+
import { basename as basename2, join as join3, resolve } from "path";
|
|
11
|
+
|
|
12
|
+
// src/validate/deny-list.ts
|
|
13
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "fs";
|
|
14
|
+
import { dirname, join } from "path";
|
|
15
|
+
var MAX_BYTES = 1024 * 1024;
|
|
16
|
+
function readDenyList(path) {
|
|
17
|
+
return readFileSync(path, "utf8").split("\n").map((line) => line.trim().toLowerCase()).filter((line) => line !== "" && !line.startsWith("#"));
|
|
18
|
+
}
|
|
19
|
+
function filesUnder(dir) {
|
|
20
|
+
return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
21
|
+
const path = join(dir, entry.name);
|
|
22
|
+
if (entry.isDirectory()) return filesUnder(path);
|
|
23
|
+
return entry.isFile() ? [path] : [];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function denyListFindings(skillMd, denyList) {
|
|
27
|
+
if (denyList === void 0) return [];
|
|
28
|
+
if (!existsSync(denyList))
|
|
29
|
+
return [
|
|
30
|
+
{ path: denyList, reason: "deny_list file not found", level: "error" }
|
|
31
|
+
];
|
|
32
|
+
const terms = readDenyList(denyList);
|
|
33
|
+
const findings = [];
|
|
34
|
+
for (const file of filesUnder(dirname(skillMd))) {
|
|
35
|
+
if (statSync(file).size > MAX_BYTES) continue;
|
|
36
|
+
const text = readFileSync(file, "utf8").toLowerCase();
|
|
37
|
+
terms.forEach((term, index) => {
|
|
38
|
+
if (!text.includes(term)) return;
|
|
39
|
+
findings.push({
|
|
40
|
+
path: file,
|
|
41
|
+
reason: `contains deny-list entry ${index + 1}`,
|
|
42
|
+
level: "error"
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return findings;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/validate/profile.ts
|
|
50
|
+
import { existsSync as existsSync2, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "fs";
|
|
51
|
+
import { basename, dirname as dirname2, join as join2 } from "path";
|
|
52
|
+
|
|
53
|
+
// src/metadata/profiles/catalog-v1/schema.ts
|
|
54
|
+
import { z as z2 } from "zod";
|
|
55
|
+
|
|
56
|
+
// src/metadata/schema.ts
|
|
57
|
+
import { z } from "zod";
|
|
58
|
+
var TIERS = ["open", "free", "paid", "internal"];
|
|
59
|
+
var RUNTIMES = [
|
|
60
|
+
"claude-code",
|
|
61
|
+
"codex-cli",
|
|
62
|
+
"gemini-cli",
|
|
63
|
+
"grok-cli",
|
|
64
|
+
"antigravity"
|
|
65
|
+
];
|
|
66
|
+
var tier = z.enum(TIERS);
|
|
67
|
+
var runtime = z.enum(RUNTIMES);
|
|
68
|
+
var version = z.string().regex(/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/);
|
|
69
|
+
var kebab = z.string().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/);
|
|
70
|
+
var strings = z.array(z.string());
|
|
71
|
+
var requires = z.looseObject({
|
|
72
|
+
mcp: strings.optional(),
|
|
73
|
+
bin: strings.optional(),
|
|
74
|
+
env: strings.optional(),
|
|
75
|
+
"gpu-gb": z.string().optional(),
|
|
76
|
+
capabilities: strings.optional()
|
|
77
|
+
});
|
|
78
|
+
var skillMetadataCore = z.looseObject({
|
|
79
|
+
version: version.optional(),
|
|
80
|
+
keywords: strings.optional(),
|
|
81
|
+
locales: z.array(z.string().regex(/^[a-z]{2}$/)).optional(),
|
|
82
|
+
level: z.enum(["L1", "L2", "L3", "L4", "L5"]).optional(),
|
|
83
|
+
domain: kebab.optional(),
|
|
84
|
+
install: z.enum(["default", "optional", "catalog-only"]).optional(),
|
|
85
|
+
requires: requires.optional(),
|
|
86
|
+
provides: strings.optional(),
|
|
87
|
+
approval: z.enum(["none", "scripts", "hooks"]).optional(),
|
|
88
|
+
"output-license": z.string().optional(),
|
|
89
|
+
pair: strings.optional(),
|
|
90
|
+
"verified-runtimes": z.array(runtime).refine((v) => new Set(v).size === v.length, "Runtime listed twice").meta({
|
|
91
|
+
description: "Generated from recorded runtime evaluations; do not author by hand.",
|
|
92
|
+
readOnly: true,
|
|
93
|
+
uniqueItems: true
|
|
94
|
+
}).optional(),
|
|
95
|
+
tier: tier.meta({
|
|
96
|
+
deprecated: true,
|
|
97
|
+
description: "Inherited from marketplace metadata.tier; repeated skill tiers warn."
|
|
98
|
+
}).optional()
|
|
99
|
+
}).meta({
|
|
100
|
+
title: "Skill metadata",
|
|
101
|
+
description: "The metadata map of a SKILL.md frontmatter: catalog fields pmcp reads (level, domain, install, keywords and the rest)."
|
|
102
|
+
});
|
|
103
|
+
var skillFrontmatter = z.looseObject({
|
|
104
|
+
name: z.string().min(1),
|
|
105
|
+
description: z.string().min(1),
|
|
106
|
+
license: z.string().optional(),
|
|
107
|
+
compatibility: z.string().optional(),
|
|
108
|
+
"allowed-tools": z.union([z.string(), strings]).optional(),
|
|
109
|
+
metadata: skillMetadataCore.optional()
|
|
110
|
+
}).meta({
|
|
111
|
+
title: "SKILL.md frontmatter",
|
|
112
|
+
description: "The Agent Skills frontmatter pmcp validate checks: name, description and the optional fields."
|
|
113
|
+
});
|
|
114
|
+
var manifestFields = {
|
|
115
|
+
tier: z.never().optional(),
|
|
116
|
+
name: z.string().min(1),
|
|
117
|
+
description: z.string().min(1).optional(),
|
|
118
|
+
version: version.optional(),
|
|
119
|
+
displayName: z.string().min(1).optional(),
|
|
120
|
+
renames: z.record(z.string().min(1), z.string().min(1).nullable()).optional(),
|
|
121
|
+
interface: z.looseObject({ displayName: z.string().min(1).optional() }).optional()
|
|
122
|
+
};
|
|
123
|
+
var pluginManifest = z.looseObject(manifestFields).meta({
|
|
124
|
+
title: "Plugin manifest",
|
|
125
|
+
description: "A native plugin manifest as pmcp reads it from a marketplace."
|
|
126
|
+
});
|
|
127
|
+
var marketplaceManifest = z.looseObject({
|
|
128
|
+
...manifestFields,
|
|
129
|
+
metadata: z.looseObject({
|
|
130
|
+
tier: tier.optional(),
|
|
131
|
+
description: z.string().min(1).optional(),
|
|
132
|
+
version: version.optional()
|
|
133
|
+
}).optional(),
|
|
134
|
+
plugins: z.array(pluginManifest)
|
|
135
|
+
}).meta({
|
|
136
|
+
title: "Marketplace manifest",
|
|
137
|
+
description: "A native plugin marketplace manifest and the plugins it lists."
|
|
138
|
+
});
|
|
139
|
+
function skillDuplicationWarnings(metadata, pluginVersion) {
|
|
140
|
+
const warnings = [];
|
|
141
|
+
if (metadata.tier !== void 0)
|
|
142
|
+
warnings.push(
|
|
143
|
+
"metadata.tier is inherited from the marketplace; remove the repeated field"
|
|
144
|
+
);
|
|
145
|
+
if (metadata.version !== void 0 && metadata.version === pluginVersion)
|
|
146
|
+
warnings.push(
|
|
147
|
+
"metadata.version equals the plugin version; inherit it instead"
|
|
148
|
+
);
|
|
149
|
+
return warnings;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// src/metadata/profiles/catalog-v1/schema.ts
|
|
153
|
+
var SERVER_TOOLS = [
|
|
154
|
+
"job_estimate",
|
|
155
|
+
"job_submit",
|
|
156
|
+
"job_status",
|
|
157
|
+
"job_result",
|
|
158
|
+
"job_cancel"
|
|
159
|
+
];
|
|
160
|
+
var catalogMetadata = z2.strictObject({
|
|
161
|
+
...skillMetadataCore.shape,
|
|
162
|
+
level: skillMetadataCore.shape.level.unwrap(),
|
|
163
|
+
domain: kebab,
|
|
164
|
+
install: skillMetadataCore.shape.install.unwrap(),
|
|
165
|
+
requires: requires.strict().optional(),
|
|
166
|
+
"server-tools": z2.array(z2.enum(SERVER_TOOLS)).optional()
|
|
167
|
+
});
|
|
168
|
+
var catalogV1 = skillFrontmatter.extend({
|
|
169
|
+
name: kebab,
|
|
170
|
+
description: z2.string().min(40),
|
|
171
|
+
metadata: catalogMetadata
|
|
172
|
+
}).meta({
|
|
173
|
+
title: "Catalog skill frontmatter",
|
|
174
|
+
description: 'The SKILL.md frontmatter of a marketplace catalog skill: [catalog.validation] profile = "catalog-v1".'
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// src/metadata/profiles/catalog-v1/frontmatter.ts
|
|
178
|
+
import { parse } from "yaml";
|
|
179
|
+
|
|
180
|
+
// src/metadata/profiles/catalog-v1/skills.ts
|
|
181
|
+
function skillFindings(skill) {
|
|
182
|
+
const out = [];
|
|
183
|
+
const add = (rule, message) => out.push({ rule, message, severity: "error" });
|
|
184
|
+
const result = catalogV1.safeParse(skill.front);
|
|
185
|
+
if (!result.success) {
|
|
186
|
+
for (const issue of result.error.issues)
|
|
187
|
+
add(`schema.${issue.path.join(".") || "frontmatter"}`, issue.message);
|
|
188
|
+
return out;
|
|
189
|
+
}
|
|
190
|
+
const { name, description, metadata: m } = result.data;
|
|
191
|
+
const { tier: tier2, body } = skill;
|
|
192
|
+
for (const message of skillDuplicationWarnings(m, skill.pluginVersion))
|
|
193
|
+
out.push({ rule: "duplication", message, severity: "warning" });
|
|
194
|
+
if (name !== skill.dirName)
|
|
195
|
+
add(
|
|
196
|
+
"name.directory",
|
|
197
|
+
`name must equal the directory name ${skill.dirName}`
|
|
198
|
+
);
|
|
199
|
+
if (m.tier !== void 0 && m.tier !== tier2)
|
|
200
|
+
add("tier.mismatch", `metadata.tier ${m.tier} in a ${tier2} marketplace`);
|
|
201
|
+
if (tier2 !== "internal") {
|
|
202
|
+
if (/[^\x20-\x7E]/u.test(description))
|
|
203
|
+
add("description.ascii", "description must be plain English ASCII");
|
|
204
|
+
if (!/\bUse (?:when|whenever|before|after|for)\b/u.test(description))
|
|
205
|
+
add(
|
|
206
|
+
"description.trigger",
|
|
207
|
+
'description should say when to use it ("Use when ...")'
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
if (tier2 === "open" && m.keywords?.some((k) => /[^\x20-\x7E]/u.test(k)))
|
|
211
|
+
add("keywords.ascii", "metadata.keywords must be English in the open tier");
|
|
212
|
+
if (!m["output-license"] && (tier2 === "paid" || (tier2 === "open" || tier2 === "free") && m.domain.startsWith("asset")))
|
|
213
|
+
add("output-license.required", "metadata.output-license missing");
|
|
214
|
+
if (!m.approval && (tier2 === "paid" || skill.hasScripts))
|
|
215
|
+
add("approval.required", "metadata.approval missing");
|
|
216
|
+
if (tier2 === "open" && m.pair !== void 0)
|
|
217
|
+
add("pair.tier", "metadata.pair is not allowed in the open tier");
|
|
218
|
+
if (tier2 !== "paid" && m["server-tools"] !== void 0)
|
|
219
|
+
add(
|
|
220
|
+
"server-tools.forbidden",
|
|
221
|
+
`metadata.server-tools is not allowed in the ${tier2} tier`
|
|
222
|
+
);
|
|
223
|
+
if (tier2 === "paid") {
|
|
224
|
+
if (!m["server-tools"]?.length)
|
|
225
|
+
add("server-tools.required", "metadata.server-tools missing");
|
|
226
|
+
if (body.includes("job_submit") && (!body.includes("job_estimate") || body.indexOf("job_estimate") > body.indexOf("job_submit")))
|
|
227
|
+
add(
|
|
228
|
+
"server-tools.order",
|
|
229
|
+
"job_estimate must come before job_submit in the body"
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
if (tier2 !== "open" && m.install === "default")
|
|
233
|
+
add(
|
|
234
|
+
"install.default",
|
|
235
|
+
`metadata.install default is not allowed in the ${tier2} tier`
|
|
236
|
+
);
|
|
237
|
+
if ([...m.locales ?? []].sort().join(",") !== [...new Set(skill.localeFiles)].sort().join(","))
|
|
238
|
+
add(
|
|
239
|
+
"locales.files",
|
|
240
|
+
"metadata.locales does not match references/*.<locale>.md"
|
|
241
|
+
);
|
|
242
|
+
return out;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// src/metadata/profiles/library.ts
|
|
246
|
+
import { z as z3 } from "zod";
|
|
247
|
+
var libraryMetadata = skillMetadataCore.extend({
|
|
248
|
+
"target-version": z3.string().min(1).optional(),
|
|
249
|
+
ecosystem: z3.enum(["npm", "pypi", "crates", "go"]).optional(),
|
|
250
|
+
"target-identity": z3.string().min(1).optional(),
|
|
251
|
+
"selected-version": z3.string().min(1).optional(),
|
|
252
|
+
loading: z3.enum(["manual", "automatic"]).optional()
|
|
253
|
+
});
|
|
254
|
+
var libraryProfile = skillFrontmatter.extend({ metadata: libraryMetadata.optional() }).meta({
|
|
255
|
+
title: "Library skill frontmatter",
|
|
256
|
+
description: 'The SKILL.md frontmatter of a library skill: [catalog.validation] profile = "library".'
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// src/validate/profile.ts
|
|
260
|
+
function localeFiles(skillDir) {
|
|
261
|
+
const references = join2(skillDir, "references");
|
|
262
|
+
if (!existsSync2(references)) return [];
|
|
263
|
+
return readdirSync2(references).flatMap(
|
|
264
|
+
(file) => /\.([a-z]{2})\.md$/u.exec(file)?.[1] ?? []
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
function tierOf(front, given) {
|
|
268
|
+
const own = front.metadata?.tier;
|
|
269
|
+
const tier2 = given ?? own;
|
|
270
|
+
return TIERS.includes(tier2) ? tier2 : "open";
|
|
271
|
+
}
|
|
272
|
+
function catalogV12(skillMd, tier2) {
|
|
273
|
+
const text = readFileSync2(skillMd, "utf8");
|
|
274
|
+
const front = frontmatterObject(text);
|
|
275
|
+
const skillDir = dirname2(skillMd);
|
|
276
|
+
const findings = skillFindings({
|
|
277
|
+
tier: tierOf(front, tier2),
|
|
278
|
+
dirName: basename(skillDir),
|
|
279
|
+
front,
|
|
280
|
+
body: bodyOf(text),
|
|
281
|
+
hasScripts: existsSync2(join2(skillDir, "scripts")),
|
|
282
|
+
localeFiles: localeFiles(skillDir)
|
|
283
|
+
});
|
|
284
|
+
return findings.map((finding) => ({
|
|
285
|
+
path: skillMd,
|
|
286
|
+
reason: `${finding.rule}: ${finding.message}`,
|
|
287
|
+
level: finding.severity === "error" ? "error" : "warning"
|
|
288
|
+
}));
|
|
289
|
+
}
|
|
290
|
+
function library(skillMd) {
|
|
291
|
+
const front = frontmatterObject(readFileSync2(skillMd, "utf8"));
|
|
292
|
+
const result = libraryProfile.safeParse(front);
|
|
293
|
+
if (result.success) return [];
|
|
294
|
+
return result.error.issues.map((issue) => ({
|
|
295
|
+
path: skillMd,
|
|
296
|
+
reason: `schema.${issue.path.join(".") || "frontmatter"}: ${issue.message}`,
|
|
297
|
+
level: "error"
|
|
298
|
+
}));
|
|
299
|
+
}
|
|
300
|
+
function profileFindings(skillMd, profile, tier2) {
|
|
301
|
+
if (profile === "catalog-v1") return catalogV12(skillMd, tier2);
|
|
302
|
+
if (profile === "library") return library(skillMd);
|
|
303
|
+
return [];
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// src/validate.ts
|
|
307
|
+
function selected(skillMd, settings, tier2) {
|
|
308
|
+
return [
|
|
309
|
+
...profileFindings(skillMd, settings.profile, tier2),
|
|
310
|
+
...denyListFindings(skillMd, settings.denyList)
|
|
311
|
+
];
|
|
312
|
+
}
|
|
313
|
+
function validateSkillDir(dir, settings = {}) {
|
|
314
|
+
const root = resolve(dir);
|
|
315
|
+
const skillMd = basename2(root) === "SKILL.md" ? root : join3(root, "SKILL.md");
|
|
316
|
+
if (!existsSync3(skillMd) || !statSync2(skillMd).isFile()) {
|
|
317
|
+
return [{ path: root, reason: "no SKILL.md", level: "error" }];
|
|
318
|
+
}
|
|
319
|
+
const front = frontmatterObject(readFileSync3(skillMd, "utf8"));
|
|
320
|
+
const directory = basename2(skillMd === root ? join3(root, "..") : root);
|
|
321
|
+
return [
|
|
322
|
+
...specProblems(front, directory).map((reason) => ({
|
|
323
|
+
path: skillMd,
|
|
324
|
+
reason,
|
|
325
|
+
level: "error"
|
|
326
|
+
})),
|
|
327
|
+
...selected(skillMd, settings)
|
|
328
|
+
];
|
|
329
|
+
}
|
|
330
|
+
function validateCatalog(options, settings = {}) {
|
|
331
|
+
const findings = [];
|
|
332
|
+
const entries = readCatalog({
|
|
333
|
+
...options,
|
|
334
|
+
onReject: (r) => findings.push({ ...r, level: "error" }),
|
|
335
|
+
onWarning: (w) => findings.push({ ...w, level: "warning" })
|
|
336
|
+
});
|
|
337
|
+
for (const entry of entries) {
|
|
338
|
+
if (entry.kind !== void 0 && entry.kind !== "skill") continue;
|
|
339
|
+
if (basename2(entry.path) !== "SKILL.md") continue;
|
|
340
|
+
findings.push(...selected(entry.path, settings, entry.tier));
|
|
341
|
+
}
|
|
342
|
+
return findings;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export {
|
|
346
|
+
validateSkillDir,
|
|
347
|
+
validateCatalog
|
|
348
|
+
};
|
|
349
|
+
//# sourceMappingURL=chunk-AJ4VXM2U.js.map
|