载入中...
搜索中...
未找到
McpTaskProfile.hpp 文件参考

Named Agent task profiles that narrow the MCP tool surface. 更多...

#include "common/Export.h"
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <vector>

浏览源代码.

类

struct  eve::dev::McpProfileEscalate
 Suggested profile change when a call is rejected by the active profile. 更多...
 
struct  eve::dev::McpFilterStats
 Proxy counters for profile A/B comparisons (not billing truth). 更多...
 

命名空间

namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 
namespace  eve::dev
 

函数

bool eve::dev::mcpResolveTaskProfile (std::string_view taskKind, std::string_view profile, std::string *outProfile, std::string *outTaskKind, std::string *errorCode, std::string *errorMessage)
 Resolve taskKind + optional profile into a concrete profile id.
 
std::vector< std::string > eve::dev::mcpProfileToolsetTags (std::string_view profile)
 Tag list advertised for EVE_MCP_TOOLSET when only a named profile is chosen.
 
std::string eve::dev::mcpProfileToolsetEnv (std::string_view profile)
 Comma-joined toolset tags for env forwarding (eve-mcp --profile=).
 
bool eve::dev::mcpProfileAllowsTool (std::string_view profile, std::string_view tool)
 Whether tool is allowed under a concrete named profile (empty = no profile gate).
 
std::optional< McpProfileEscalate > eve::dev::mcpProfileEscalateHint (std::string_view profile, std::string_view tool)
 Suggest an escalate edge when tool is denied by profile.
 
void eve::dev::mcpSetProcessProfile (std::string_view profile)
 Install or clear the process-level profile (EVE_MCP_PROFILE mirror for tests).
 
std::string eve::dev::mcpProcessProfile ()
 Current process-level profile; empty when unset.
 
void eve::dev::mcpSetSessionProfile (std::string_view profile)
 Install or clear the session-level profile overlay.
 
std::string eve::dev::mcpSessionProfile ()
 Current session-level profile; empty when no session overlay.
 
void eve::dev::mcpFilterNoteCall (bool allowed, std::size_t resultBytes, bool offeredEscalate)
 Record a tools/call attempt for proxy metrics.
 
McpFilterStats eve::dev::mcpFilterStats ()
 Snapshot of proxy metrics since process start / last test reset.
 
void eve::dev::mcpFilterStatsResetForTest ()
 Test helper: zero proxy metrics.
 

详细描述

Named Agent task profiles that narrow the MCP tool surface.

Profiles stack with EVE_MCP_TOOLSET / READONLY / EXCLUDE: allowed = envFilter ∧ processProfile ∧ sessionProfile

Process profile: EVE_MCP_PROFILE (connection-time, e.g. eve-mcp –profile=). Session profile: set by eve_agent_session_start / cleared on reset. Call-time enforcement does not depend on Cursor refreshing tools/list.

参见
docs/dev/2026-10-20-agent-task-profile-mcp-plan.md

在文件 McpTaskProfile.hpp 中定义.