载入中...
搜索中...
未找到
McpTaskProfile.hpp
浏览该文件的文档.
1#pragma once
2
17#include "common/Export.h"
18
19#include <cstdint>
20#include <optional>
21#include <string>
22#include <string_view>
23#include <vector>
24
25namespace eve::dev {
26
29 std::string to;
30 std::string reason;
31 std::string errorCode;
32};
33
36 std::uint64_t toolCalls = 0;
37 std::uint64_t toolsFiltered = 0;
38 std::uint64_t escalateCount = 0;
39 std::uint64_t approxResultBytes = 0;
40};
41
52[[nodiscard]] EVENGINE_API_FOUNDATION bool mcpResolveTaskProfile(std::string_view taskKind, std::string_view profile,
53 std::string* outProfile, std::string* outTaskKind,
54 std::string* errorCode, std::string* errorMessage);
55
57[[nodiscard]] EVENGINE_API_FOUNDATION std::vector<std::string> mcpProfileToolsetTags(std::string_view profile);
58
60[[nodiscard]] EVENGINE_API_FOUNDATION std::string mcpProfileToolsetEnv(std::string_view profile);
61
63[[nodiscard]] EVENGINE_API_FOUNDATION bool mcpProfileAllowsTool(std::string_view profile, std::string_view tool);
64
69[[nodiscard]] EVENGINE_API_FOUNDATION std::optional<McpProfileEscalate> mcpProfileEscalateHint(std::string_view profile,
70 std::string_view tool);
71
73EVENGINE_API_FOUNDATION void mcpSetProcessProfile(std::string_view profile);
74
76[[nodiscard]] EVENGINE_API_FOUNDATION std::string mcpProcessProfile();
77
79EVENGINE_API_FOUNDATION void mcpSetSessionProfile(std::string_view profile);
80
82[[nodiscard]] EVENGINE_API_FOUNDATION std::string mcpSessionProfile();
83
85EVENGINE_API_FOUNDATION void mcpFilterNoteCall(bool allowed, std::size_t resultBytes, bool offeredEscalate);
86
89
92
93} // namespace eve::dev
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
bool 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::string mcpProcessProfile()
Current process-level profile; empty when unset.
std::vector< std::string > mcpProfileToolsetTags(std::string_view profile)
Tag list advertised for EVE_MCP_TOOLSET when only a named profile is chosen.
std::string mcpProfileToolsetEnv(std::string_view profile)
Comma-joined toolset tags for env forwarding (eve-mcp --profile=).
void mcpSetProcessProfile(std::string_view profile)
Install or clear the process-level profile (EVE_MCP_PROFILE mirror for tests).
McpFilterStats mcpFilterStats()
Snapshot of proxy metrics since process start / last test reset.
void mcpFilterStatsResetForTest()
Test helper: zero proxy metrics.
bool mcpProfileAllowsTool(std::string_view profile, std::string_view tool)
Whether tool is allowed under a concrete named profile (empty = no profile gate).
void mcpFilterNoteCall(bool allowed, std::size_t resultBytes, bool offeredEscalate)
Record a tools/call attempt for proxy metrics.
std::string mcpSessionProfile()
Current session-level profile; empty when no session overlay.
std::optional< McpProfileEscalate > mcpProfileEscalateHint(std::string_view profile, std::string_view tool)
Suggest an escalate edge when tool is denied by profile.
void mcpSetSessionProfile(std::string_view profile)
Install or clear the session-level profile overlay.
Proxy counters for profile A/B comparisons (not billing truth).
Suggested profile change when a call is rejected by the active profile.