@trops/dash-core 0.1.711 → 0.1.712

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.
@@ -11198,7 +11198,11 @@ function requireScanWidgetPackagePermissions () {
11198
11198
 
11199
11199
  const fs = require$$0$3;
11200
11200
  const path = require$$1$2;
11201
- const { toolPatternFromTemplate } = toolPattern;
11201
+ const {
11202
+ toolPatternFromTemplate,
11203
+ isToolPattern,
11204
+ toolListAllows,
11205
+ } = toolPattern;
11202
11206
 
11203
11207
  const SOURCE_EXTS = new Set([".js", ".jsx", ".ts", ".tsx"]);
11204
11208
  const SKIP_DIRS = new Set([
@@ -11231,18 +11235,20 @@ function requireScanWidgetPackagePermissions () {
11231
11235
  if (typeof code !== "string" || !code) return { providers: [], tools: [] };
11232
11236
  const stripped = _stripLineComments(code);
11233
11237
  const providerPattern = /useMcpProvider\s*\(\s*["'`]([^"'`]+)["'`]/g;
11234
- const callPattern = /callTool\s*\(\s*["'`]([^"'`]+)["'`]/g;
11235
- return {
11236
- providers: Array.from(new Set(_captureAll(stripped, providerPattern))),
11238
+ // Group 2 is the literal; group 3 is set when the literal is followed by
11239
+ // `.concat(` — the compiled form of a template (`"a_".concat(x)`).
11240
+ const callPattern = /callTool\s*\(\s*(["'`])([^"'`]+)\1(\s*\.concat\s*\()?/g;
11241
+ const tools = [];
11242
+ for (const m of stripped.matchAll(callPattern)) {
11237
11243
  // Template names (`algolia_search_${index}`) become wildcard patterns
11238
11244
  // (`algolia_search_*`); ones too vague to pattern are dropped.
11239
- tools: Array.from(
11240
- new Set(
11241
- _captureAll(stripped, callPattern)
11242
- .map(toolPatternFromTemplate)
11243
- .filter(Boolean),
11244
- ),
11245
- ),
11245
+ const raw = m[3] ? m[2] + "${}" : m[2];
11246
+ const tool = toolPatternFromTemplate(raw);
11247
+ if (tool) tools.push(tool);
11248
+ }
11249
+ return {
11250
+ providers: Array.from(new Set(_captureAll(stripped, providerPattern))),
11251
+ tools: Array.from(new Set(tools)),
11246
11252
  };
11247
11253
  }
11248
11254
 
@@ -11459,7 +11465,12 @@ function requireScanWidgetPackagePermissions () {
11459
11465
  } else {
11460
11466
  const existing = new Set(out[name].tools || []);
11461
11467
  for (const t of perms.tools || []) existing.add(t);
11462
- out[name].tools = Array.from(existing).sort();
11468
+ // Drop plain names a scanned wildcard already covers, e.g. the
11469
+ // "algolia_search_" older scans read from compiled bundles.
11470
+ const wildcards = (perms.tools || []).filter(isToolPattern);
11471
+ out[name].tools = Array.from(existing)
11472
+ .filter((t) => isToolPattern(t) || !toolListAllows(wildcards, t))
11473
+ .sort();
11463
11474
  }
11464
11475
  }
11465
11476
  }