载入中...
搜索中...
未找到
EditorAutomationProvider.h
浏览该文件的文档.
1#pragma once
2
7
8#include <cstdint>
9#include <map>
10#include <memory>
11#include <string>
12#include <vector>
13
14namespace eve::editor {
15
16class EditorTargetCoordinator;
17class EditorCommandService;
18class EditorHost;
19
22public:
27
29 std::string invoke(const std::string& operation, const std::string& requestJson) override;
30
33
38 [[nodiscard]] Result<void> attachHost(EditorHost* host);
39
41 void detachHost();
42
43private:
44 struct ObservationSession;
45
46 void refreshProfile();
47 std::string commandsJson();
48 std::string targetList() const;
49 Result<void> bindRequestedTarget(const EditorValue::Object& request);
50 std::string createTarget(const EditorValue::Object& request);
51 std::string closeTarget(const EditorValue::Object& request);
52 std::string startObservation(const EditorValue::Object& request);
53 std::string describeObservation(const EditorValue::Object& request) const;
54 std::string publishObservation(const EditorValue::Object& request);
55 std::string pollObservation(const EditorValue::Object& request);
56 std::string closeObservation(const EditorValue::Object& request);
57
58 EditorCommandService* commands_ = nullptr;
59 EditorTargetCoordinator* targets_ = nullptr;
60 EditorSession session_;
61 std::vector<EditorDiagnostic> lastDiagnostics_;
62 std::map<TargetId, AutomationOwnedTarget> ownedTargets_;
63 std::map<std::string, std::unique_ptr<ObservationSession>> observationSessions_;
64 std::uint64_t nextObservationSession_ = 1;
65};
66
67} // namespace eve::editor
LogicalId target
ActionParameterOperation operation
std::vector< FieldTarget > targets
const GltfImportRequest & request
UIHostHandle host
std::vector< VegetationPresetCommand > commands
Module-neutral bridge from DevTools/MCP to the editor command protocol.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:313
std::map< std::string, Value > Object
MCP/DevTools adapter over command discovery and target coordination.
void detachHost()
Clear the Host-scoped MCP projection filter.
~EditorAutomationProvider() override
Releases EditorAutomationProvider resources.
void targetUnregistered(const TargetId &target)
Clear automation state that still borrows an unregistered target.
std::string invoke(const std::string &operation, const std::string &requestJson) override
Invoke discovery, inspect, execute, plan, commit, undo or redo.
Result< void > attachHost(EditorHost *host)
Attach a borrowed EditorHost as the MCP projection scope (Mode A). @ownership Borrowed; host must out...
Registry and execution gate for UI-, script- and automation-neutral commands.
Composition runtime that discovers EditorPackage providers and installs them.
Definition EditorHost.h:53
Hosts interchangeable editor tools and routes their lifecycle/input.
Coordinates editable targets, per-target histories and domain commands.