Entropic 2.14.3
Local-first agentic inference engine
Loading...
Searching...
No Matches
bash.cpp File Reference

BashServer implementation — shell command execution under an enforced timeout, one process group per command. More...

#include <entropic/mcp/servers/bash.h>
#include <entropic/types/run_scope.h>
#include <entropic/mcp/tool_base.h>
#include <entropic/mcp/server_base.h>
#include <entropic/types/logging.h>
#include <nlohmann/json.hpp>
#include <array>
#include <cerrno>
#include <chrono>
#include <csignal>
#include <cstdio>
#include <cstring>
#include <filesystem>
#include <stdexcept>
#include <string>
#include <thread>
#include <fcntl.h>
#include <poll.h>
#include <spawn.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
Include dependency graph for bash.cpp:

Go to the source code of this file.

Classes

class  entropic::ExecuteTool
 Tool for executing shell commands. More...
 

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Functions

static bool entropic::is_safe_cwd (const std::string &cwd)
 Reject working_dir values that would smuggle shell syntax.
 

Variables

char ** environ
 
static auto logger = entropic::log::get("mcp.bash")
 

Detailed Description

BashServer implementation — shell command execution under an enforced timeout, one process group per command.

Version
2.13.0

Definition in file bash.cpp.

Variable Documentation

◆ cancelled

bool cancelled = false

The run was interrupted and the group was killed (gh#172)

Definition at line 101 of file bash.cpp.

◆ elapsed_ms

long long elapsed_ms = 0

Wall time, spawn to reap.

Definition at line 102 of file bash.cpp.

◆ exit_code

int exit_code = -1

Shell status; 128+N if killed by signal N.

Definition at line 99 of file bash.cpp.

◆ logger

auto logger = entropic::log::get("mcp.bash")
static

Definition at line 37 of file bash.cpp.

◆ output

std::string output

Combined stdout+stderr (partial on timeout)

Definition at line 98 of file bash.cpp.

◆ timed_out

bool timed_out = false

The deadline expired and the group was killed.

Definition at line 100 of file bash.cpp.