12namespace entropic::mcp {
22 if (
s.size() <
prefix.size()) {
return false; }
23 for (
size_t i = 0;
i <
prefix.size(); ++
i) {
24 if (std::tolower(
static_cast<unsigned char>(
s[
i]))
25 != std::tolower(
static_cast<unsigned char>(
prefix[
i]))) {
37inline std::string_view
ltrim(std::string_view
s) {
40 && std::isspace(
static_cast<unsigned char>(
s[
i])) != 0) {
62 for (
unsigned char c :
s) {
63 if (std::isspace(
c) == 0) {
return false; }
82 auto pos =
trimmed.find(
"\"error\"");
83 return pos != std::string_view::npos && pos < 32;
103 if (
cap <= 0) {
return; }
105 if (content.size() <=
cap_sz) {
return; }
107 std::string
tail =
"\n[... truncated, "
108 + std::to_string(
lost) +
" more bytes]";
111 content.resize(
keep);
@ optional
optional: every escape asks the host's path approver