MCPcopy Index your code
hub / github.com/anus-dev/ANUS / isCommandAllowed

Function isCommandAllowed

packages/core/src/utils/shell-utils.ts:448–458  ·  view source on GitHub ↗
(
  command: string,
  config: Config,
)

Source from the content-addressed store, hash-verified

446 * @returns An object with 'allowed' boolean and optional 'reason' string if not allowed.
447 */
448export function isCommandAllowed(
449 command: string,
450 config: Config,
451): { allowed: boolean; reason?: string } {
452 // By not providing a sessionAllowlist, we invoke "default allow" behavior.
453 const { allAllowed, blockReason } = checkCommandPermissions(command, config);
454 if (allAllowed) {
455 return { allowed: true };
456 }
457 return { allowed: false, reason: blockReason };
458}

Callers 3

shell.test.tsFile · 0.85
validateToolParamsMethod · 0.85

Calls 1

checkCommandPermissionsFunction · 0.85

Tested by

no test coverage detected