@sendinel/mcp-server 1.0.189 → 1.0.190

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.
@@ -1,5 +1,6 @@
1
1
  /** Hand-written workflows, checked against the registered schemas in CI (#4061). */
2
2
  import { SEGMENT_OPERATORS_DESCRIPTION } from '@sendinel/domain';
3
+ import { ADMIN_TOOLS } from './admin-tools.js';
3
4
  import { rankTools, scoreTool, tokenize, TOOL_ALIASES } from '../tools/tool-search.js';
4
5
  const approval = { required: true, how: 'returns approve_url; re-call with approval_id' };
5
6
  const from = (n, field) => `<from step ${n}: ${field}>`;
@@ -244,7 +245,9 @@ export function matchRecipes(goal, limit = 3, available = HOW_TO_RECIPES, tools
244
245
  .filter(({ score }) => score > 0).sort((a, b) => b.score - a.score || a.order - b.order);
245
246
  const selected = scored.slice(0, Math.max(1, Math.min(10, Math.trunc(limit))));
246
247
  const returned = new Set(selected.map(({ entry }) => entry.name));
247
- const candidates = [...entries.filter((e) => !returned.has(e.name)), ...tools];
248
+ const allowAdminTools = selected.some(({ entry: { recipe } }) => recipe.requires.scopes.includes('admin'));
249
+ const candidateTools = allowAdminTools ? tools : tools.filter((tool) => !ADMIN_TOOLS.has(tool.name));
250
+ const candidates = [...entries.filter((e) => !returned.has(e.name)), ...candidateTools];
248
251
  const suggestions = rankTools(candidates, goal, { aliases: { ...TOOL_ALIASES, ...aliases }, nearestLimit: 5 });
249
252
  const also_try = [...new Set([...suggestions.matches, ...suggestions.nearest].map(({ entry }) => entry.name))].slice(0, 5);
250
253
  if (!also_try.length && !selected.length)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendinel/mcp-server",
3
- "version": "1.0.189",
3
+ "version": "1.0.190",
4
4
  "description": "AI-controlled email operations control plane for campaigns, contacts, segments, analytics, and multi-provider sending via MCP.",
5
5
  "mcpName": "ai.sendinel/mcp-server",
6
6
  "type": "module",