INNER CODE UNIT · JavaScript

cappedTimeout

bvisible/mcp-ssh-manager · src/index.js:690

    const cappedTimeout = Math.min(timeout, TIMEOUTS.MAX_COMMAND_TIMEOUT);

    // Expand aliases BEFORE policy evaluation so the user can't bypass a DENY
    // regex by hiding a destructive command behind an alias.
    const expandedCommand = expandCommandAlias(command);

    const denied = await applyServerPolicy(serverName, 'ssh_execute', { command, cwd }, expandedCommand);
    if (denied) return denied;

    try {
      const ssh = await getConnection(serverName);

      // Execute hooks for bench commands
      if (expandedCommand.includes('bench update')) {
        await executeHook('pre-bench-update', {
          server: serverName,
          sshConnection: ssh,
          defaultDir: cwd

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…