@agentskillshub/cli 0.2.1 → 0.2.2
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/bin/ash.mjs +13 -0
- package/package.json +1 -1
package/bin/ash.mjs
CHANGED
|
@@ -45,6 +45,13 @@ const GRADE = {
|
|
|
45
45
|
// CJK detection — Chinese queries have no word boundaries, so we bigram them.
|
|
46
46
|
const CJK = /[一-鿿]/;
|
|
47
47
|
|
|
48
|
+
// Generic terms that appear in ~half the catalog — they drown the distinctive
|
|
49
|
+
// part of a query. Ignored during scoring unless the whole query is generic.
|
|
50
|
+
const STOPWORDS = new Set([
|
|
51
|
+
"ai", "mcp", "mcps", "agent", "agents", "tool", "tools", "skill", "skills",
|
|
52
|
+
"server", "servers", "app", "apps", "工具", "服务器", "服务",
|
|
53
|
+
]);
|
|
54
|
+
|
|
48
55
|
// ─── tiny ANSI (auto-off when not a TTY / NO_COLOR) ──────────────────────────
|
|
49
56
|
const tty = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
50
57
|
const c = (code, s) => (tty ? `\x1b[${code}m${s}\x1b[0m` : s);
|
|
@@ -150,8 +157,14 @@ function scoreRow(row, tokens) {
|
|
|
150
157
|
// English-only repos via our curated scenario titles, and ranks
|
|
151
158
|
// scenario-relevant skills higher. Empty/undefined on older indexes.
|
|
152
159
|
const scen = (row.w || "").toLowerCase();
|
|
160
|
+
// When the query has a distinctive term, generic tokens (ai/mcp/agent/工具…)
|
|
161
|
+
// match half the catalog and drown it — "去 AI 味" would rank vercel/ai over
|
|
162
|
+
// the actual humanizer. Skip generic tokens for scoring UNLESS the whole query
|
|
163
|
+
// is generic (then they're all we have).
|
|
164
|
+
const hasContent = tokens.some((t) => !STOPWORDS.has(t));
|
|
153
165
|
let score = 0;
|
|
154
166
|
for (const tok of tokens) {
|
|
167
|
+
if (hasContent && STOPWORDS.has(tok)) continue;
|
|
155
168
|
if (name === tok) score += 50;
|
|
156
169
|
else if (name.includes(tok)) score += 20;
|
|
157
170
|
if (full.includes(tok)) score += 8;
|
package/package.json
CHANGED