@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.
- package/dist/electron/index.js +23 -12
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -11198,7 +11198,11 @@ function requireScanWidgetPackagePermissions () {
|
|
|
11198
11198
|
|
|
11199
11199
|
const fs = require$$0$3;
|
|
11200
11200
|
const path = require$$1$2;
|
|
11201
|
-
const {
|
|
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
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
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
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
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
|
-
|
|
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
|
}
|