promptgraph-mcp 1.5.16 → 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
@@ -90,6 +90,7 @@ if (args[0] === 'marketplace' && (args[1] === 'bundles' || args[1] === 'bundle')
90
90
  spin.start();
91
91
  const bundles = await browseBundles(1000);
92
92
  spin.stop();
93
+ console.clear();
93
94
 
94
95
  if (bundles?.error) { error(bundles.error); process.exit(1); }
95
96
 
@@ -137,6 +138,7 @@ if (args[0] === 'marketplace') {
137
138
  spin.start();
138
139
  const all = await browseMarketplace(1000);
139
140
  spin.stop();
141
+ console.clear();
140
142
 
141
143
  if (all?.error) {
142
144
  error(all.error);
@@ -174,11 +176,11 @@ if (args[0] === 'marketplace') {
174
176
  slice.forEach((s, i) => {
175
177
  const num = chalk.gray(String(startIdx + i + 1).padStart(2) + '.');
176
178
  const stars = (s.stars > 0 ? chalk.yellow('★ ' + s.stars) : chalk.gray('★ 0'));
177
- 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);
178
181
  console.log(wrap(s.description, 64, ' '));
179
182
  if (s.tags?.length) console.log(' ' + purple(s.tags.map(t => '#' + t).join(' ')));
180
- console.log(' ' + chalk.gray('install: ') + chalk.cyan(`pg_marketplace_install("${s.id}")`));
181
- 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}`));
182
184
  console.log();
183
185
  });
184
186
 
@@ -190,12 +192,10 @@ if (args[0] === 'marketplace') {
190
192
  console.log(' ' + nav.join(' '));
191
193
  console.log();
192
194
  }
193
- console.log(' ' + chalk.gray('These run through your AI assistant via the PromptGraph MCP server:'));
194
- console.log(' ' + chalk.cyan('pg_marketplace_install') + chalk.gray(' install a skill ') + chalk.gray('(or /pg-fetch <id>)'));
195
- console.log(' ' + chalk.cyan('pg_marketplace_publish') + chalk.gray(' share your own ') + chalk.gray('(or /pg-publish <file>)'));
196
- 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}`));
197
197
  console.log();
198
- 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>'));
199
199
  console.log();
200
200
  process.exit(0);
201
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.16",
3
+ "version": "1.5.18",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "bin": {