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 +8 -8
- package/marketplace.js +21 -6
- package/package.json +1 -1
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
|
-
|
|
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(`
|
|
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('
|
|
194
|
-
console.log('
|
|
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('
|
|
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(
|
|
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
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
92
|
-
|
|
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 = [];
|