@modootoday/pmcp 0.9.2 → 0.11.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modootoday/pmcp",
3
- "version": "0.9.2",
3
+ "version": "0.11.0",
4
4
  "license": "Elastic-2.0",
5
5
  "author": "modootoday",
6
6
  "description": "An MCP server that finds the skills your installed packages already ship. Reads SKILL.md out of node_modules by shape rather than by path, so it sees the skills, .agent, .claude, .gemini and .codex conventions alike, and keeps session startup flat as the number of installed skills grows.",
@@ -44,6 +44,10 @@
44
44
  "./cli": {
45
45
  "types": "./dist/cli.d.ts",
46
46
  "import": "./dist/cli.js"
47
+ },
48
+ "./mailbox": {
49
+ "types": "./dist/mailbox/index.d.ts",
50
+ "import": "./dist/mailbox/index.js"
47
51
  }
48
52
  },
49
53
  "bin": {
@@ -1,121 +0,0 @@
1
- /**
2
- * SKILL.md frontmatter, read as YAML the way a host reads it, and checked against
3
- * the Agent Skills specification (https://agentskills.io/specification).
4
- */
5
- type MetadataLeaf = string | readonly string[];
6
- /** A metadata value: a leaf, or a map of leaves one level below the metadata key. */
7
- type MetadataValue = MetadataLeaf | {
8
- readonly [key: string]: MetadataLeaf;
9
- };
10
- /**
11
- * Parsed frontmatter. A value with an unquoted ": " is a common authoring slip
12
- * the client guide says to recover from by quoting it, so that is retried once.
13
- */
14
- declare function frontmatterObject(source: string): Record<string, unknown> | null;
15
- declare const NAME_MAX = 64;
16
- declare const DESCRIPTION_MAX = 1024;
17
- declare const COMPATIBILITY_MAX = 500;
18
- /**
19
- * What the specification requires of one SKILL.md, as messages; empty when valid.
20
- * directory is the name of the folder holding it.
21
- */
22
- declare function specProblems(front: Record<string, unknown> | null, directory: string): string[];
23
-
24
- /**
25
- * The skills the installed packages brought with them.
26
- *
27
- * Derived from `node_modules` at read time rather than from a list somebody
28
- * maintains: installing a package is how its skill arrives and uninstalling it
29
- * is how the skill leaves, so the catalog is always true of the project.
30
- */
31
-
32
- interface SkillEntry {
33
- /** `<package>/<slug>`. Unique, and stable while the package is installed. */
34
- readonly name: string;
35
- readonly package: string;
36
- readonly slug: string;
37
- /** Frontmatter description. The only text `find` ranks against. */
38
- readonly description: string;
39
- /** Absolute path to the SKILL.md. `call` reads the body from here. */
40
- readonly path: string;
41
- /** open, free or paid. Set for marketplace skills, absent for packages. */
42
- readonly tier?: string;
43
- /** The frontmatter `metadata:` block; maps such as `requires` are kept one level down. */
44
- readonly metadata?: Readonly<Record<string, MetadataValue>>;
45
- /** Extra search terms. Ranked with the description, never used as triggers. */
46
- readonly keywords?: readonly string[];
47
- /** What the entry is. Absent means a skill. */
48
- readonly kind?: AssetKind;
49
- /**
50
- * What describe and read may open: a directory, or one file for an asset
51
- * that is a single file. Absent means the directory holding `path`.
52
- */
53
- readonly root?: string;
54
- }
55
- /** Everything the catalog serves. Commands are skills; workflows have no kind of their own. */
56
- declare const ASSET_KINDS: readonly ["skill", "agent", "hook", "mcp"];
57
- type AssetKind = (typeof ASSET_KINDS)[number];
58
- declare const kindOf: (entry: Pick<SkillEntry, "kind">) => AssetKind;
59
- interface CatalogOptions {
60
- /** Directories to walk. Each is a `node_modules` root, not a package root. */
61
- readonly roots: readonly string[];
62
- /** Package name prefixes to consider. Empty means every package. */
63
- readonly scopes?: readonly string[];
64
- /** Marketplace directories, each holding .claude-plugin/marketplace.json. */
65
- readonly marketplaces?: readonly string[];
66
- /** Package directories read directly, for a package no node_modules links. */
67
- readonly packages?: readonly string[];
68
- /** Workspace roots: the root and every member its workspaces globs name. */
69
- readonly workspaces?: readonly string[];
70
- /** Told about every marketplace skill left out, and why. */
71
- readonly onReject?: (rejection: {
72
- path: string;
73
- reason: string;
74
- }) => void;
75
- /**
76
- * Told about a skill that is served but breaks the Agent Skills specification,
77
- * or that lost a name collision. Loading stays lenient, as the client guide asks.
78
- */
79
- readonly onWarning?: (warning: {
80
- path: string;
81
- reason: string;
82
- }) => void;
83
- }
84
- /**
85
- * Directories a walk does not enter. Kept as short as the evidence allows: a
86
- * name here is a package whose skill will never be found, and the cost of one
87
- * extra readdir is far below the cost of missing a skill. Measured 20260906 --
88
- * `lib` was on this list and hid playwright's `lib/skill/SKILL.md`, which is
89
- * the most widely installed skill in the real world.
90
- */
91
- declare const SKIPPED_DIRS: ReadonlySet<string>;
92
- /**
93
- * How deep below a package root a SKILL.md is looked for. Three reaches every
94
- * convention in use (skills, .agent/skills, .claude/skills, .gemini/skills,
95
- * .codex/skills); four was measured to find nothing more.
96
- */
97
- declare const MAX_SKILL_DEPTH = 3;
98
- /**
99
- * Top-level scalar fields of a SKILL.md frontmatter, parsed as YAML, so a folded
100
- * `description: >-` arrives as its text rather than as the indicator.
101
- */
102
- declare function readFrontmatter(source: string): Record<string, string>;
103
- /** The body after the frontmatter, or the whole file when there is none. */
104
- declare function readBody(source: string): string;
105
- /**
106
- * Every skill reachable from the given roots, sorted by name.
107
- *
108
- * A package with no skills directory contributes nothing and costs one
109
- * `existsSync` per convention. A skill with no description is skipped rather
110
- * than listed:
111
- * `find` ranks descriptions, so one without a description can only ever be
112
- * found by already knowing its name, and listing it would spend a session's
113
- * tokens on an entry that cannot answer.
114
- */
115
- declare function readCatalog(options: CatalogOptions): SkillEntry[];
116
- /** A catalog entry without its body, which is what `catalog` returns. */
117
- declare function withoutBody({ path, ...rest }: SkillEntry): Omit<SkillEntry, "path">;
118
- /** Path relative to a root, for a message a reader can act on. */
119
- declare function displayPath(root: string, entry: SkillEntry): string;
120
-
121
- export { type AssetKind as A, type CatalogOptions as C, DESCRIPTION_MAX as D, type MetadataValue as M, NAME_MAX as N, type SkillEntry as S, ASSET_KINDS as a, COMPATIBILITY_MAX as b, MAX_SKILL_DEPTH as c, type MetadataLeaf as d, SKIPPED_DIRS as e, displayPath as f, frontmatterObject as g, readCatalog as h, readFrontmatter as i, kindOf as k, readBody as r, specProblems as s, withoutBody as w };