载入中...
搜索中...
未找到
AgentDevelopmentSession.cpp
浏览该文件的文档.
14AgentDevelopmentResult rejected(std::string code, std::string message) { return {std::move(code), std::move(message)}; }
18 if (from == "content.scene" && (to == "verify.play" || to == "content.map" || to == "workshop.rpg")) return true;
19 if (from == "content.map" && (to == "verify.play" || to == "content.scene" || to == "workshop.rpg")) return true;
21 if (from == "verify.play" && (to == "content.scene" || to == "content.map" || to == "script.bind" ||
59 if (criteria.empty()) return rejected("invalid-criteria", "at least one acceptance criterion is required");
64 if (!mcpResolveTaskProfile(taskKind, profile, &resolvedProfile, &resolvedKind, &errorCode, &errorMessage))
70 if (!ids.insert(criterion.id).second) return rejected("duplicate-criterion", "criterion ids must be unique");
84AgentDevelopmentResult AgentDevelopmentSession::escalate(std::string_view sessionId, std::string_view toProfile) {
85 if (sessionId != sessionId_) return rejected("session-not-found", "development session was not found");
91 if (!mcpResolveTaskProfile({}, toProfile, &resolvedProfile, &resolvedKind, &errorCode, &errorMessage))
102AgentDevelopmentResult AgentDevelopmentSession::advance(std::string_view sessionId, AgentDevelopmentPhase phase) {
103 if (sessionId != sessionId_) return rejected("session-not-found", "development session was not found");
111AgentDevelopmentResult AgentDevelopmentSession::record(std::string_view sessionId, AgentDevelopmentEvidence evidence) {
112 if (sessionId != sessionId_) return rejected("session-not-found", "development session was not found");
118 if (evidence.kind == "eval") return rejected("invalid-evidence-kind", "required criteria reject eval evidence");
137AgentDevelopmentResult AgentDevelopmentSession::complete(std::string_view sessionId, std::string summary) {
138 if (sessionId != sessionId_) return rejected("session-not-found", "development session was not found");
143 return rejected("acceptance-incomplete", "required acceptance criteria do not all have passing evidence");
144 if (summary.empty()) return rejected("invalid-summary", "completion summary must not be empty");
150AgentDevelopmentResult AgentDevelopmentSession::abort(std::string_view sessionId, std::string reason) {
151 if (sessionId != sessionId_) return rejected("session-not-found", "development session was not found");
174 return !sessionId_.empty() && phase_ != AgentDevelopmentPhase::Complete && phase_ != AgentDevelopmentPhase::Aborted;
203AgentDevelopmentResult parseAgentDevelopmentPhase(std::string_view name, AgentDevelopmentPhase* phase) {
Named Agent task profiles that narrow the MCP tool surface.
Process-owned state machine and evidence ledger for Agent game development.
Definition AgentDevelopmentSession.hpp:50
const std::string & taskKind() const
Resolved task kind for this session (verify when omitted at start).
Definition AgentDevelopmentSession.hpp:87
AgentDevelopmentResult complete(std::string_view sessionId, std::string summary)
Complete only from Verify when every required criterion has passing evidence.
Definition AgentDevelopmentSession.cpp:137
const std::string & summary() const
Terminal summary or abort reason.
Definition AgentDevelopmentSession.hpp:93
AgentDevelopmentResult escalate(std::string_view sessionId, std::string_view toProfile)
Narrow or widen the MCP tool surface along a declared escalate edge.
Definition AgentDevelopmentSession.cpp:84
const std::string & objective() const
User-supplied objective.
Definition AgentDevelopmentSession.hpp:85
bool active() const
Whether a non-terminal session currently owns the workflow.
Definition AgentDevelopmentSession.cpp:173
const std::vector< AgentAcceptanceCriterion > & criteria() const
Immutable acceptance snapshot owned by this session.
Definition AgentDevelopmentSession.hpp:95
AgentDevelopmentResult abort(std::string_view sessionId, std::string reason)
Abort an active session with an explicit reason.
Definition AgentDevelopmentSession.cpp:150
AgentDevelopmentResult start(std::string objective, std::vector< AgentAcceptanceCriterion > criteria, std::string taskKind={}, std::string profile={})
Start one session; rejects empty objectives, duplicate criteria, or an active session.
Definition AgentDevelopmentSession.cpp:54
bool readyToComplete() const
Whether all required criteria have passing evidence.
Definition AgentDevelopmentSession.cpp:177
const std::string & profile() const
Resolved MCP task profile id (verify.play when omitted at start).
Definition AgentDevelopmentSession.hpp:89
const std::string & sessionId() const
Stable process-local session identity, invalidated by reset.
Definition AgentDevelopmentSession.hpp:81
AgentDevelopmentResult record(std::string_view sessionId, AgentDevelopmentEvidence evidence)
Append evidence; only pass evidence updates criterion satisfaction.
Definition AgentDevelopmentSession.cpp:111
const std::vector< AgentDevelopmentEvidence > & evidence() const
Immutable evidence snapshot owned by this session.
Definition AgentDevelopmentSession.hpp:97
AgentDevelopmentResult advance(std::string_view sessionId, AgentDevelopmentPhase phase)
Advance through the declared workflow graph without mutating game state.
Definition AgentDevelopmentSession.cpp:102
void reset()
Clear all process-owned session metadata. Intended for host teardown and tests.
Definition AgentDevelopmentSession.cpp:159
static AgentDevelopmentSession & instance()
Return the process-lifetime session authority.
Definition AgentDevelopmentSession.cpp:49
Definition ActionGuideExport.cpp:13
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.
Definition McpTaskProfile.cpp:81
AgentDevelopmentResult parseAgentDevelopmentPhase(std::string_view name, AgentDevelopmentPhase *phase)
Parse a stable JSON protocol phase name.
Definition AgentDevelopmentSession.cpp:203
AgentDevelopmentPhase
Ordered stage of an Agent-driven game-development session.
Definition AgentDevelopmentSession.hpp:13
void mcpSetSessionProfile(std::string_view profile)
Install or clear the session-level profile overlay.
Definition McpTaskProfile.cpp:273
std::string_view agentDevelopmentPhaseName(AgentDevelopmentPhase phase)
Stable JSON protocol name for a development phase.
Definition AgentDevelopmentSession.cpp:189
Result< T > rejected(RuleId rule, std::string message, eve::DiagnosticCode code=eve::DiagnosticCode::PreconditionViolation)
Construct a Rejected result for invalid editing input or preconditions.
Definition EditingResult.h:143
Immutable evidence recorded against an acceptance condition.
Definition AgentDevelopmentSession.hpp:24
Structured result for development-session state transitions.
Definition AgentDevelopmentSession.hpp:34