MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / toolkitDynamicScope

Function toolkitDynamicScope

packages/plugins/toolkits/src/server.ts:207–223  ·  view source on GitHub ↗
(
  rules: ToolkitRuleSnapshot,
  isOrg: boolean,
)

Source from the content-addressed store, hash-verified

205// user-only prefixes drop out; the per-tool check still enforces the same
206// rule for anything the prefix cannot express.
207const toolkitDynamicScope = (
208 rules: ToolkitRuleSnapshot,
209 isOrg: boolean,
210): readonly DynamicToolScope[] => {
211 const scopes: DynamicToolScope[] = [];
212 for (const pattern of rules.accessPatterns) {
213 const scope = dynamicToolScopeForPattern(pattern);
214 if (!scope) continue;
215 if (!isOrg) {
216 scopes.push(scope);
217 continue;
218 }
219 if (scope.owner === "user") continue;
220 scopes.push(scope.owner === null ? { ...scope, owner: "org" } : scope);
221 }
222 return scopes;
223};
224
225const legacyConnectionPolicyIds = (
226 policies: readonly ToolkitPolicyRecord[],

Callers 1

Calls 2

pushMethod · 0.80

Tested by

no test coverage detected