promptgraph-mcp 2.4.3 → 2.4.4
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/marketplace.js +11 -6
- package/package.json +1 -1
package/marketplace.js
CHANGED
|
@@ -177,14 +177,20 @@ export async function installSkill(query) {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
// ── filter skill files (exclude docs) ─────────────────────────────────────────
|
|
181
|
+
const SKIP_DOCS = /^(readme|license|changelog|contributing|code.?of.?conduct|security|authors|credits|install|faq|index|overview|summary|todo|notes|template|copying|warranty|funding|roadmap)/i;
|
|
182
|
+
function isSkillFile(path) {
|
|
183
|
+
const name = path.split('/').pop().toLowerCase();
|
|
184
|
+
return name.endsWith('.md') && !SKIP_DOCS.test(name.replace(/\.md$/i, ''));
|
|
185
|
+
}
|
|
186
|
+
|
|
180
187
|
async function countRepoSkills(repoUrl) {
|
|
181
188
|
try {
|
|
182
189
|
const apiUrl = `https://api.github.com/repos/${repoUrl}/git/trees/HEAD?recursive=1`;
|
|
183
190
|
const res = await fetch(apiUrl, { headers: { 'User-Agent': 'promptgraph-mcp' } });
|
|
184
191
|
if (!res.ok) return null;
|
|
185
192
|
const data = await res.json();
|
|
186
|
-
|
|
187
|
-
return (data.tree || []).filter(f => f.type === 'blob' && exts.some(e => f.path.toLowerCase().endsWith(e))).length;
|
|
193
|
+
return (data.tree || []).filter(f => f.type === 'blob' && isSkillFile(f.path)).length;
|
|
188
194
|
} catch { return null; }
|
|
189
195
|
}
|
|
190
196
|
|
|
@@ -194,12 +200,11 @@ export async function browseBundles(topK = 20) {
|
|
|
194
200
|
const registry = JSON.parse(text);
|
|
195
201
|
const bundles = registry.bundles || [];
|
|
196
202
|
await Promise.all(bundles.map(async b => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (count !== null) b.skillCount = count;
|
|
200
|
-
}
|
|
203
|
+
// Re-count all repo bundles with the new .md-only filter
|
|
204
|
+
if (b.repo_url) b.skillCount = await countRepoSkills(b.repo_url) ?? 0;
|
|
201
205
|
}));
|
|
202
206
|
return bundles
|
|
207
|
+
.filter(b => !b.repo_url || b.skillCount > 0) // hide bundles with 0 .md files
|
|
203
208
|
.map(b => ({ ...b, code: b.code || codeFor(b.id) }))
|
|
204
209
|
.sort((a, b) => (b.stars || 0) - (a.stars || 0))
|
|
205
210
|
.slice(0, topK);
|