@modootoday/pmcp 0.17.2 → 0.17.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.
@@ -612,7 +612,7 @@
612
612
  },
613
613
  {
614
614
  "name": "pmcp",
615
- "version": "0.17.2",
615
+ "version": "0.17.3",
616
616
  "description": "Find package skills and use native runtime project configuration.",
617
617
  "source": { "source": "local", "path": "./plugins/pmcp" },
618
618
  "policy": { "installation": "AVAILABLE", "authentication": "ON_USE" },
@@ -445,7 +445,7 @@
445
445
  },
446
446
  {
447
447
  "name": "pmcp",
448
- "version": "0.17.2",
448
+ "version": "0.17.3",
449
449
  "description": "Find package skills and use native runtime project configuration.",
450
450
  "source": "./plugins/pmcp"
451
451
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "description": "Find package skills and use native runtime project configuration.",
5
5
  "author": { "name": "modootoday" },
6
6
  "license": "Elastic-2.0",
package/dist/cli.js CHANGED
@@ -9225,6 +9225,30 @@ function flatMetadata(metadata2) {
9225
9225
  }
9226
9226
  return flat;
9227
9227
  }
9228
+ function namedFirst(result, entries, intent) {
9229
+ const text3 = intent.toLowerCase();
9230
+ const named2 = entries.filter((entry2) => {
9231
+ const slug = entry2.slug.toLowerCase();
9232
+ if (slug.length < 4) return false;
9233
+ const at = text3.indexOf(slug);
9234
+ if (at === -1) return false;
9235
+ const before = text3[at - 1] ?? " ";
9236
+ const after = text3[at + slug.length] ?? " ";
9237
+ return !/[a-z0-9-]/.test(before) && !/[a-z0-9-]/.test(after);
9238
+ });
9239
+ if (named2.length === 0) return result;
9240
+ const top = result.matches[0]?.score ?? 1;
9241
+ const names = new Set(named2.map((entry2) => entry2.name));
9242
+ const first = named2.map((entry2) => ({
9243
+ name: entry2.name,
9244
+ package: entry2.package,
9245
+ description: entry2.description,
9246
+ score: result.matches.find((m) => m.name === entry2.name)?.score ?? top
9247
+ }));
9248
+ const rest = result.matches.filter((match) => !names.has(match.name));
9249
+ const size = Math.max(result.matches.length, first.length);
9250
+ return { ...result, matches: [...first, ...rest].slice(0, size) };
9251
+ }
9228
9252
  function createSkillTools(options2) {
9229
9253
  const load = options2.loadCatalog ?? readCatalog;
9230
9254
  let entries = null;
@@ -9240,7 +9264,14 @@ function createSkillTools(options2) {
9240
9264
  });
9241
9265
  return entries;
9242
9266
  };
9243
- const byName = (name) => catalog().find((candidate2) => candidate2.name === name) ?? null;
9267
+ const byName = (name) => {
9268
+ const all = catalog();
9269
+ const exact = all.find((candidate2) => candidate2.name === name);
9270
+ if (exact) return exact;
9271
+ const suffix = `/${name.replace(/^\/+/, "")}`;
9272
+ const short = all.filter((candidate2) => candidate2.name.endsWith(suffix));
9273
+ return short.length === 1 ? short[0] : null;
9274
+ };
9244
9275
  return {
9245
9276
  /**
9246
9277
  * Grouped, and without bodies. The cheap overview and the search's miss
@@ -9301,7 +9332,8 @@ function createSkillTools(options2) {
9301
9332
  embedder: options2.embedder,
9302
9333
  cache: options2.cache,
9303
9334
  vectors: options2.vectors
9304
- }).then((result) => {
9335
+ }).then((ranked) => {
9336
+ const result = namedFirst(ranked, scoped, intent);
9305
9337
  const marked = result.matches.map((match) => {
9306
9338
  const entry2 = byName(match.name) ?? void 0;
9307
9339
  return {
@@ -9855,7 +9887,7 @@ function registerMailboxTools(server, service) {
9855
9887
 
9856
9888
  // src/mcp.ts
9857
9889
  var SERVER_NAME = "pmcp";
9858
- var SERVER_VERSION = "0.17.2";
9890
+ var SERVER_VERSION = "0.17.3";
9859
9891
  function registerSkillTools(server, tools) {
9860
9892
  registerCatalogTool(server, tools);
9861
9893
  registerFindTool(server, tools);
@@ -16157,7 +16189,7 @@ function dispatch(argv, options2 = {}) {
16157
16189
  }
16158
16190
  return run(command3, rest, { ui, env, cwd });
16159
16191
  }
16160
- var VERSION = "0.17.2";
16192
+ var VERSION = "0.17.3";
16161
16193
  async function defaultEntry(options2, context) {
16162
16194
  const terminal = options2.terminal ?? {
16163
16195
  stdin: process.stdin.isTTY === true,
package/dist/http.js CHANGED
@@ -1611,6 +1611,30 @@ function flatMetadata(metadata) {
1611
1611
  }
1612
1612
  return flat;
1613
1613
  }
1614
+ function namedFirst(result, entries, intent) {
1615
+ const text = intent.toLowerCase();
1616
+ const named = entries.filter((entry) => {
1617
+ const slug = entry.slug.toLowerCase();
1618
+ if (slug.length < 4) return false;
1619
+ const at = text.indexOf(slug);
1620
+ if (at === -1) return false;
1621
+ const before = text[at - 1] ?? " ";
1622
+ const after = text[at + slug.length] ?? " ";
1623
+ return !/[a-z0-9-]/.test(before) && !/[a-z0-9-]/.test(after);
1624
+ });
1625
+ if (named.length === 0) return result;
1626
+ const top = result.matches[0]?.score ?? 1;
1627
+ const names = new Set(named.map((entry) => entry.name));
1628
+ const first = named.map((entry) => ({
1629
+ name: entry.name,
1630
+ package: entry.package,
1631
+ description: entry.description,
1632
+ score: result.matches.find((m) => m.name === entry.name)?.score ?? top
1633
+ }));
1634
+ const rest = result.matches.filter((match) => !names.has(match.name));
1635
+ const size = Math.max(result.matches.length, first.length);
1636
+ return { ...result, matches: [...first, ...rest].slice(0, size) };
1637
+ }
1614
1638
  function createSkillTools(options) {
1615
1639
  const load = options.loadCatalog ?? readCatalog;
1616
1640
  let entries = null;
@@ -1626,7 +1650,14 @@ function createSkillTools(options) {
1626
1650
  });
1627
1651
  return entries;
1628
1652
  };
1629
- const byName = (name) => catalog().find((candidate) => candidate.name === name) ?? null;
1653
+ const byName = (name) => {
1654
+ const all = catalog();
1655
+ const exact = all.find((candidate) => candidate.name === name);
1656
+ if (exact) return exact;
1657
+ const suffix = `/${name.replace(/^\/+/, "")}`;
1658
+ const short = all.filter((candidate) => candidate.name.endsWith(suffix));
1659
+ return short.length === 1 ? short[0] : null;
1660
+ };
1630
1661
  return {
1631
1662
  /**
1632
1663
  * Grouped, and without bodies. The cheap overview and the search's miss
@@ -1687,7 +1718,8 @@ function createSkillTools(options) {
1687
1718
  embedder: options.embedder,
1688
1719
  cache: options.cache,
1689
1720
  vectors: options.vectors
1690
- }).then((result) => {
1721
+ }).then((ranked) => {
1722
+ const result = namedFirst(ranked, scoped, intent);
1691
1723
  const marked = result.matches.map((match) => {
1692
1724
  const entry = byName(match.name) ?? void 0;
1693
1725
  return {
@@ -2290,7 +2322,7 @@ function registerMailboxTools(server, service) {
2290
2322
 
2291
2323
  // src/mcp.ts
2292
2324
  var SERVER_NAME = "pmcp";
2293
- var SERVER_VERSION = "0.17.2";
2325
+ var SERVER_VERSION = "0.17.3";
2294
2326
  function registerSkillTools(server, tools) {
2295
2327
  registerCatalogTool(server, tools);
2296
2328
  registerFindTool(server, tools);
package/dist/index.d.ts CHANGED
@@ -275,7 +275,7 @@ declare function resolveSkillFileUri(uri: string, entries: readonly SkillEntry[]
275
275
 
276
276
  /** Reported to the host on connect. */
277
277
  declare const SERVER_NAME = "pmcp";
278
- declare const SERVER_VERSION = "0.17.2";
278
+ declare const SERVER_VERSION = "0.17.3";
279
279
  /**
280
280
  * Registers the skill_* tools on a server.
281
281
  *
package/dist/index.js CHANGED
@@ -4058,6 +4058,30 @@ function flatMetadata(metadata) {
4058
4058
  }
4059
4059
  return flat;
4060
4060
  }
4061
+ function namedFirst(result, entries, intent) {
4062
+ const text = intent.toLowerCase();
4063
+ const named2 = entries.filter((entry) => {
4064
+ const slug = entry.slug.toLowerCase();
4065
+ if (slug.length < 4) return false;
4066
+ const at = text.indexOf(slug);
4067
+ if (at === -1) return false;
4068
+ const before = text[at - 1] ?? " ";
4069
+ const after = text[at + slug.length] ?? " ";
4070
+ return !/[a-z0-9-]/.test(before) && !/[a-z0-9-]/.test(after);
4071
+ });
4072
+ if (named2.length === 0) return result;
4073
+ const top = result.matches[0]?.score ?? 1;
4074
+ const names = new Set(named2.map((entry) => entry.name));
4075
+ const first = named2.map((entry) => ({
4076
+ name: entry.name,
4077
+ package: entry.package,
4078
+ description: entry.description,
4079
+ score: result.matches.find((m) => m.name === entry.name)?.score ?? top
4080
+ }));
4081
+ const rest = result.matches.filter((match) => !names.has(match.name));
4082
+ const size = Math.max(result.matches.length, first.length);
4083
+ return { ...result, matches: [...first, ...rest].slice(0, size) };
4084
+ }
4061
4085
  function createSkillTools(options) {
4062
4086
  const load = options.loadCatalog ?? readCatalog;
4063
4087
  let entries = null;
@@ -4073,7 +4097,14 @@ function createSkillTools(options) {
4073
4097
  });
4074
4098
  return entries;
4075
4099
  };
4076
- const byName = (name) => catalog().find((candidate) => candidate.name === name) ?? null;
4100
+ const byName = (name) => {
4101
+ const all = catalog();
4102
+ const exact = all.find((candidate) => candidate.name === name);
4103
+ if (exact) return exact;
4104
+ const suffix = `/${name.replace(/^\/+/, "")}`;
4105
+ const short = all.filter((candidate) => candidate.name.endsWith(suffix));
4106
+ return short.length === 1 ? short[0] : null;
4107
+ };
4077
4108
  return {
4078
4109
  /**
4079
4110
  * Grouped, and without bodies. The cheap overview and the search's miss
@@ -4134,7 +4165,8 @@ function createSkillTools(options) {
4134
4165
  embedder: options.embedder,
4135
4166
  cache: options.cache,
4136
4167
  vectors: options.vectors
4137
- }).then((result) => {
4168
+ }).then((ranked) => {
4169
+ const result = namedFirst(ranked, scoped, intent);
4138
4170
  const marked = result.matches.map((match) => {
4139
4171
  const entry = byName(match.name) ?? void 0;
4140
4172
  return {
@@ -4837,7 +4869,7 @@ function registerMailboxTools(server, service) {
4837
4869
 
4838
4870
  // src/mcp.ts
4839
4871
  var SERVER_NAME = "pmcp";
4840
- var SERVER_VERSION = "0.17.2";
4872
+ var SERVER_VERSION = "0.17.3";
4841
4873
  function registerSkillTools(server, tools) {
4842
4874
  registerCatalogTool(server, tools);
4843
4875
  registerFindTool(server, tools);
package/dist/stdio.js CHANGED
@@ -1258,6 +1258,30 @@ function flatMetadata(metadata) {
1258
1258
  }
1259
1259
  return flat;
1260
1260
  }
1261
+ function namedFirst(result, entries, intent) {
1262
+ const text = intent.toLowerCase();
1263
+ const named = entries.filter((entry) => {
1264
+ const slug = entry.slug.toLowerCase();
1265
+ if (slug.length < 4) return false;
1266
+ const at = text.indexOf(slug);
1267
+ if (at === -1) return false;
1268
+ const before = text[at - 1] ?? " ";
1269
+ const after = text[at + slug.length] ?? " ";
1270
+ return !/[a-z0-9-]/.test(before) && !/[a-z0-9-]/.test(after);
1271
+ });
1272
+ if (named.length === 0) return result;
1273
+ const top = result.matches[0]?.score ?? 1;
1274
+ const names = new Set(named.map((entry) => entry.name));
1275
+ const first = named.map((entry) => ({
1276
+ name: entry.name,
1277
+ package: entry.package,
1278
+ description: entry.description,
1279
+ score: result.matches.find((m) => m.name === entry.name)?.score ?? top
1280
+ }));
1281
+ const rest = result.matches.filter((match) => !names.has(match.name));
1282
+ const size = Math.max(result.matches.length, first.length);
1283
+ return { ...result, matches: [...first, ...rest].slice(0, size) };
1284
+ }
1261
1285
  function createSkillTools(options) {
1262
1286
  const load = options.loadCatalog ?? readCatalog;
1263
1287
  let entries = null;
@@ -1273,7 +1297,14 @@ function createSkillTools(options) {
1273
1297
  });
1274
1298
  return entries;
1275
1299
  };
1276
- const byName = (name) => catalog().find((candidate) => candidate.name === name) ?? null;
1300
+ const byName = (name) => {
1301
+ const all = catalog();
1302
+ const exact = all.find((candidate) => candidate.name === name);
1303
+ if (exact) return exact;
1304
+ const suffix = `/${name.replace(/^\/+/, "")}`;
1305
+ const short = all.filter((candidate) => candidate.name.endsWith(suffix));
1306
+ return short.length === 1 ? short[0] : null;
1307
+ };
1277
1308
  return {
1278
1309
  /**
1279
1310
  * Grouped, and without bodies. The cheap overview and the search's miss
@@ -1334,7 +1365,8 @@ function createSkillTools(options) {
1334
1365
  embedder: options.embedder,
1335
1366
  cache: options.cache,
1336
1367
  vectors: options.vectors
1337
- }).then((result) => {
1368
+ }).then((ranked) => {
1369
+ const result = namedFirst(ranked, scoped, intent);
1338
1370
  const marked = result.matches.map((match) => {
1339
1371
  const entry = byName(match.name) ?? void 0;
1340
1372
  return {
@@ -1937,7 +1969,7 @@ function registerMailboxTools(server, service) {
1937
1969
 
1938
1970
  // src/mcp.ts
1939
1971
  var SERVER_NAME = "pmcp";
1940
- var SERVER_VERSION = "0.17.2";
1972
+ var SERVER_VERSION = "0.17.3";
1941
1973
  function registerSkillTools(server, tools) {
1942
1974
  registerCatalogTool(server, tools);
1943
1975
  registerFindTool(server, tools);
package/docs/skills.md CHANGED
@@ -9,7 +9,9 @@ Skills are discovered by filename, including `skills/`, `.agents/skills/`,
9
9
  `lib/skill/` layouts
10
10
  within the discovery depth. A skill needs a frontmatter `description` for search.
11
11
 
12
- `skill_find` accepts a problem description and returns matching skills.
12
+ `skill_find` accepts a problem description and returns matching skills; a skill whose short
13
+ name appears in the request as a whole word is listed first. The other tools take a skill's
14
+ full name, or a short name that belongs to exactly one skill, and answer with the full name.
13
15
  `skill_call` opens the selected document and lists the reference, script and asset
14
16
  files it carries as a text list. It attaches no resource links, because some clients ask
15
17
  the user to create every linked file as an attachment. Local MCP reading requires no login.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "mcpServers": {
5
5
  "pmcp": {
6
6
  "type": "stdio",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modootoday/pmcp",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "license": "Elastic-2.0",
5
5
  "author": "modootoday",
6
6
  "description": "Use the skills your packages already ship, and keep your AI tools' project configuration in one place.",
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "pmcp",
4
- "version": "0.17.2",
4
+ "version": "0.17.3",
5
5
  "description": "Find package skills and use native runtime project configuration.",
6
6
  "author": { "name": "modootoday" },
7
7
  "license": "Elastic-2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "description": "Find package skills and use native runtime project configuration.",
5
5
  "author": { "name": "modootoday" },
6
6
  "license": "Elastic-2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "mcpServers": {
5
5
  "pmcp": {
6
6
  "type": "stdio",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "pmcp",
4
- "version": "0.17.2",
4
+ "version": "0.17.3",
5
5
  "description": "Find package skills and use native runtime project configuration.",
6
6
  "author": { "name": "modootoday" },
7
7
  "license": "Elastic-2.0",