载入中...
搜索中...
未找到
McpRuntimeTools.hpp
浏览该文件的文档.
1#pragma once
2
3// MCP runtime-observation tools.
4//
5// The embedded MCP server already exposes the debugger, the editor command
6// protocol and the Play Host. What it did not expose was the engine's own
7// runtime console (devtools/ConsolePanel): a Squirrel `print()` or an uncaught
8// script error only reached the process stdout/stderr, which the stdio
9// transport deliberately keeps free of anything but JSON-RPC frames. An
10// unattended agent therefore could not see the primary diagnostic channel of a
11// scripted game at all.
12//
13// This module owns the tool family that closes that gap:
14//
15// eve_console_read read retained console lines from a monotonic cursor
16// eve_console_write append an agent marker to the same ordered stream
17// eve_console_clear drop retained lines without rewinding the cursor
18// eve_screenshot_image capture the presented frame as an MCP image item
19// eve_restart soft-restart the game without unloading the resource cache
20//
21// Console lines carry a process-lifetime sequence number so a caller can read
22// incrementally and tell "nothing new happened" apart from "lines were dropped
23// before I read them".
24
25#include <Poco/JSON/Object.h>
26
27#include "common/Export.h"
28
29#include <string>
30#include <string_view>
31
32namespace eve::dev {
33
35EVENGINE_API_FOUNDATION bool isMcpRuntimeTool(std::string_view name);
36
43EVENGINE_API_FOUNDATION std::string callMcpRuntimeTool(std::string_view name, Poco::JSON::Object::Ptr args);
44
47
55[[nodiscard]] EVENGINE_API_FOUNDATION Poco::JSON::Object::Ptr crashLogSummary();
56
57} // namespace eve::dev
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::string name
bool isMcpRuntimeTool(std::string_view name)
Whether name belongs to the MCP runtime console / frame-capture surface.
Poco::JSON::Object::Ptr crashLogSummary()
Summary of the persistent crash/error log (eve.log).
std::string callMcpRuntimeTool(std::string_view name, Poco::JSON::Object::Ptr args)
Execute one runtime tool.
std::string_view mcpRuntimeToolSchemas()
Comma-separated MCP tool schema fragments without surrounding array brackets.