载入中...
搜索中...
未找到
AgentDevelopmentSession.hpp
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <cstdint>
6#include <string>
7#include <string_view>
8#include <vector>
9
10namespace eve::dev {
11
14
17 std::string id;
18 std::string description;
19 bool required = true;
20 bool passed = false;
21};
22
25 std::uint64_t sequence = 0;
26 std::string criterionId;
27 std::string kind;
28 std::string status;
29 std::string summary;
30 std::string artifact;
31};
32
34struct [[nodiscard]] AgentDevelopmentResult {
35 std::string code;
36 std::string message;
37
39 bool isAccepted() const { return code == "applied"; }
40};
41
51public:
53 static AgentDevelopmentSession& instance();
54
60 [[nodiscard]] AgentDevelopmentResult start(std::string objective, std::vector<AgentAcceptanceCriterion> criteria,
61 std::string taskKind = {}, std::string profile = {});
63 [[nodiscard]] AgentDevelopmentResult advance(std::string_view sessionId, AgentDevelopmentPhase phase);
68 [[nodiscard]] AgentDevelopmentResult escalate(std::string_view sessionId, std::string_view toProfile);
70 [[nodiscard]] AgentDevelopmentResult record(std::string_view sessionId, AgentDevelopmentEvidence evidence);
72 [[nodiscard]] AgentDevelopmentResult complete(std::string_view sessionId, std::string summary);
74 [[nodiscard]] AgentDevelopmentResult abort(std::string_view sessionId, std::string reason);
76 void reset();
77
79 bool active() const;
81 const std::string& sessionId() const { return sessionId_; }
83 AgentDevelopmentPhase phase() const { return phase_; }
85 const std::string& objective() const { return objective_; }
87 const std::string& taskKind() const { return taskKind_; }
89 const std::string& profile() const { return profile_; }
91 std::uint64_t escalateCount() const { return escalateCount_; }
93 const std::string& summary() const { return summary_; }
95 const std::vector<AgentAcceptanceCriterion>& criteria() const { return criteria_; }
97 const std::vector<AgentDevelopmentEvidence>& evidence() const { return evidence_; }
99 bool readyToComplete() const;
100
101private:
102 AgentDevelopmentSession() = default;
103
104 std::string sessionId_;
105 std::string objective_;
106 std::string taskKind_;
107 std::string profile_;
108 std::string summary_;
109 AgentDevelopmentPhase phase_ = AgentDevelopmentPhase::Aborted;
110 std::vector<AgentAcceptanceCriterion> criteria_;
111 std::vector<AgentDevelopmentEvidence> evidence_;
112 std::uint64_t nextSession_ = 1;
113 std::uint64_t nextEvidence_ = 1;
114 std::uint64_t escalateCount_ = 0;
115};
116
120[[nodiscard]] AgentDevelopmentResult parseAgentDevelopmentPhase(std::string_view name, AgentDevelopmentPhase* phase);
121
122} // namespace eve::dev
Duration start
bool & active
ScriptComponentRecord record
Definition ECS.cpp:228
std::string name
Definition ECS.cpp:154
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
DiagnosticCode code
std::string evidence
float phase
Process-owned state machine and evidence ledger for Agent game development.
const std::string & taskKind() const
Resolved task kind for this session (verify when omitted at start).
const std::string & summary() const
Terminal summary or abort reason.
const std::string & objective() const
User-supplied objective.
const std::vector< AgentAcceptanceCriterion > & criteria() const
Immutable acceptance snapshot owned by this session.
AgentDevelopmentPhase phase() const
Current workflow phase.
const std::string & profile() const
Resolved MCP task profile id (verify.play when omitted at start).
const std::string & sessionId() const
Stable process-local session identity, invalidated by reset.
const std::vector< AgentDevelopmentEvidence > & evidence() const
Immutable evidence snapshot owned by this session.
std::uint64_t escalateCount() const
How many successful profile escalations occurred in this session.
AgentDevelopmentResult parseAgentDevelopmentPhase(std::string_view name, AgentDevelopmentPhase *phase)
Parse a stable JSON protocol phase name.
AgentDevelopmentPhase
Ordered stage of an Agent-driven game-development session.
std::string_view agentDevelopmentPhaseName(AgentDevelopmentPhase phase)
Stable JSON protocol name for a development phase.
One explicit acceptance condition for a development objective.
Immutable evidence recorded against an acceptance condition.
Structured result for development-session state transitions.
bool isAccepted() const
Whether the requested transition was accepted.