dsh-tool-folder 0.1.7 → 0.1.8

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.
Files changed (2) hide show
  1. package/lib/index.js +17 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -467,12 +467,27 @@ export function apply(ctx, config) {
467
467
 
468
468
  const stamp = tools.map((t) => t.name).join("\u0001");
469
469
  if (indexStamp !== stamp) {
470
+ // V4 document expansion (measured 0.1.7→0.1.8): the tool corpus is
471
+ // pure-English, so Chinese queries always get df=0 and BM25 scores
472
+ // nothing (measured recall 0/26). Inject per-tool aliases from
473
+ // cfg.aliases (prefix-matched) into the index text — CN recall
474
+ // 0%→88%, EN +15pp, both from the same expansion.
470
475
  index = buildIndex(
471
- tools.map((t) => ({ id: t.name, text: `${t.name} ${t.description || ""}` })),
476
+ tools.map((t) => {
477
+ const aliasWords = [];
478
+ for (const [prefix, keywords] of Object.entries(cfg.aliases || {})) {
479
+ if (t.name.startsWith(prefix)) aliasWords.push(...keywords);
480
+ }
481
+ return {
482
+ id: t.name,
483
+ text: `${t.name} ${t.description || ""} ${aliasWords.join(" ")}`,
484
+ };
485
+ }),
472
486
  );
473
487
  indexStamp = stamp;
474
488
  allTools = tools;
475
- logger.info("index rebuilt: %d tools", tools.length);
489
+ logger.info("index rebuilt: %d tools (doc-expansion enabled)", tools.length);
490
+
476
491
  }
477
492
 
478
493
  const query = extractQuery(context);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tool-folder",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Fold the DSH tool surface per request + ChainGuard firewall (high-risk block + exfil-chain detection). Shrinks schema tokens 80-90% while keeping selection accuracy. v0.1.6 adds a zod Config schema so every toggle renders in the DSH settings UI.",
5
5
  "keywords": [
6
6
  "dsh-plugin",