promptgraph-mcp 1.5.17 → 1.5.18

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/index.js CHANGED
@@ -176,11 +176,11 @@ if (args[0] === 'marketplace') {
176
176
  slice.forEach((s, i) => {
177
177
  const num = chalk.gray(String(startIdx + i + 1).padStart(2) + '.');
178
178
  const stars = (s.stars > 0 ? chalk.yellow('★ ' + s.stars) : chalk.gray('★ 0'));
179
- console.log(' ' + num + ' ' + chalk.white.bold(s.id) + ' ' + stars);
179
+ const code = s.code ? chalk.bgHex('#2A2440').hex('#C4B5FD')(` ${s.code} `) : '';
180
+ console.log(' ' + num + ' ' + chalk.white.bold(s.id) + ' ' + stars + ' ' + code);
180
181
  console.log(wrap(s.description, 64, ' '));
181
182
  if (s.tags?.length) console.log(' ' + purple(s.tags.map(t => '#' + t).join(' ')));
182
- console.log(' ' + chalk.gray('install: ') + chalk.cyan(`pg_marketplace_install("${s.id}")`));
183
- console.log(' ' + chalk.gray('use: ') + chalk.cyan(`pg_search("${s.id}")`) + chalk.gray(' → read the file'));
183
+ console.log(' ' + chalk.gray('install: tell your AI ') + chalk.cyan(`install ${s.code || s.id}`));
184
184
  console.log();
185
185
  });
186
186
 
@@ -192,12 +192,10 @@ if (args[0] === 'marketplace') {
192
192
  console.log(' ' + nav.join(' '));
193
193
  console.log();
194
194
  }
195
- console.log(' ' + chalk.gray('These run through your AI assistant via the PromptGraph MCP server:'));
196
- console.log(' ' + chalk.cyan('pg_marketplace_install') + chalk.gray(' install a skill ') + chalk.gray('(or /pg-fetch <id>)'));
197
- console.log(' ' + chalk.cyan('pg_marketplace_publish') + chalk.gray(' share your own ') + chalk.gray('(or /pg-publish <file>)'));
198
- console.log(' ' + chalk.cyan('pg_search') + chalk.gray(' find & apply any installed skill'));
195
+ console.log(' ' + chalk.gray('To install: tell your AI assistant ') + chalk.cyan('install <code or name>'));
196
+ console.log(' ' + chalk.gray('e.g. ') + chalk.cyan(`install ${slice[0].code || slice[0].id}`) + chalk.gray(' or ') + chalk.cyan(`install ${slice[0].id}`));
199
197
  console.log();
200
- console.log(' ' + chalk.gray('Browse curated sets: ') + chalk.cyan(`${bin} marketplace bundles`));
198
+ console.log(' ' + chalk.gray('Curated sets: ') + chalk.cyan(`${bin} marketplace bundles`) + chalk.gray(' · Publish: ') + chalk.cyan('/pg-publish <file>'));
201
199
  console.log();
202
200
  process.exit(0);
203
201
  }
package/marketplace.js CHANGED
@@ -51,13 +51,25 @@ export async function browseMarketplace(topK = 20) {
51
51
  }
52
52
  }
53
53
 
54
- export async function installSkill(skillId) {
54
+ export async function installSkill(query) {
55
55
  try {
56
56
  const text = await fetchText(REGISTRY_URL);
57
57
  const registry = JSON.parse(text);
58
- const skill = registry.skills?.find(s => s.id === skillId);
59
- if (!skill) return { error: `Skill "${skillId}" not found in registry` };
60
- if (!skill.raw_url) return { error: `Skill "${skillId}" has no download URL` };
58
+ const q = String(query).trim().toLowerCase();
59
+ // match by code, id, or name (case-insensitive)
60
+ const skill = registry.skills?.find(s =>
61
+ s.code?.toLowerCase() === q ||
62
+ s.id?.toLowerCase() === q ||
63
+ s.name?.toLowerCase() === q
64
+ );
65
+ if (!skill) {
66
+ // maybe it's a bundle code/id — hint the user
67
+ const bundle = (registry.bundles || []).find(b => b.code?.toLowerCase() === q || b.id?.toLowerCase() === q);
68
+ if (bundle) return { error: `"${query}" is a bundle. Use pg_bundle_install("${bundle.id}") instead.` };
69
+ return { error: `No skill matching "${query}" (try a code like pg-xxxxxx, an id, or a name)` };
70
+ }
71
+ if (!skill.raw_url) return { error: `Skill "${skill.id}" has no download URL` };
72
+ const skillId = skill.id;
61
73
 
62
74
  fs.mkdirSync(SKILLS_DIR, { recursive: true });
63
75
  const dest = path.join(SKILLS_DIR, `${skillId}.md`);
@@ -88,8 +100,11 @@ export async function installBundle(bundleId) {
88
100
  try {
89
101
  const text = await fetchText(REGISTRY_URL);
90
102
  const registry = JSON.parse(text);
91
- const bundle = (registry.bundles || []).find(b => b.id === bundleId);
92
- if (!bundle) return { error: `Bundle "${bundleId}" not found in registry` };
103
+ const q = String(bundleId).trim().toLowerCase();
104
+ const bundle = (registry.bundles || []).find(b =>
105
+ b.code?.toLowerCase() === q || b.id?.toLowerCase() === q || b.name?.toLowerCase() === q
106
+ );
107
+ if (!bundle) return { error: `No bundle matching "${bundleId}"` };
93
108
 
94
109
  fs.mkdirSync(SKILLS_DIR, { recursive: true });
95
110
  const installed = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptgraph-mcp",
3
- "version": "1.5.17",
3
+ "version": "1.5.18",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "bin": {