41namespace neograph::acp {
43using json = neograph::json;
53 bool embedded_context =
false;
71 bool load_session =
false;
79 bool read_text_file =
false;
80 bool write_text_file =
false;
86 bool terminal =
false;
94struct NEOGRAPH_API ContentBlock {
98 std::string mime_type;
101 std::optional<std::string> title;
102 std::optional<std::string> description;
103 std::optional<std::int64_t> size;
114 static ContentBlock text_block(std::string s);
117 static ContentBlock resource_link(std::string uri,
119 std::string mime_type = {});
128 int protocol_version = 1;
133struct NEOGRAPH_API InitializeResponse {
134 int protocol_version = 1;
138 std::vector<json> auth_methods;
152struct NEOGRAPH_API NewSessionRequest {
154 std::vector<McpServerConfig> mcp_servers;
157struct NEOGRAPH_API NewSessionResponse {
158 std::string session_id;
169struct NEOGRAPH_API PromptRequest {
170 std::string session_id;
171 std::vector<ContentBlock> prompt;
189NEOGRAPH_API std::string stop_reason_to_string(StopReason s);
190NEOGRAPH_API StopReason stop_reason_from_string(std::string_view s);
192struct NEOGRAPH_API PromptResponse {
193 StopReason stop_reason = StopReason::EndTurn;
200struct NEOGRAPH_API CancelNotification {
201 std::string session_id;
208struct NEOGRAPH_API ReadTextFileRequest {
209 std::string session_id;
211 std::optional<int> line;
212 std::optional<int> limit;
215struct NEOGRAPH_API ReadTextFileResponse {
219struct NEOGRAPH_API WriteTextFileRequest {
220 std::string session_id;
225NEOGRAPH_API
void to_json(json& j,
const ReadTextFileRequest& r);
226NEOGRAPH_API
void from_json(
const json& j, ReadTextFileRequest& r);
227NEOGRAPH_API
void to_json(json& j,
const ReadTextFileResponse& r);
228NEOGRAPH_API
void from_json(
const json& j, ReadTextFileResponse& r);
229NEOGRAPH_API
void to_json(json& j,
const WriteTextFileRequest& r);
230NEOGRAPH_API
void from_json(
const json& j, WriteTextFileRequest& r);
243struct NEOGRAPH_API ToolCallUpdate {
244 std::string tool_call_id;
245 std::string tool_name;
249 std::vector<ContentBlock> content;
254NEOGRAPH_API
void to_json(json& j,
const ToolCallUpdate& t);
255NEOGRAPH_API
void from_json(
const json& j, ToolCallUpdate& t);
262struct NEOGRAPH_API PermissionOption {
263 std::string option_id;
268NEOGRAPH_API
void to_json(json& j,
const PermissionOption& o);
269NEOGRAPH_API
void from_json(
const json& j, PermissionOption& o);
271struct NEOGRAPH_API RequestPermissionRequest {
272 std::string session_id;
273 ToolCallUpdate tool_call;
274 std::vector<PermissionOption> options;
277NEOGRAPH_API
void to_json(json& j,
const RequestPermissionRequest& r);
278NEOGRAPH_API
void from_json(
const json& j, RequestPermissionRequest& r);
286struct NEOGRAPH_API RequestPermissionOutcome {
287 PermissionOutcomeKind kind = PermissionOutcomeKind::Cancelled;
288 std::string option_id;
291NEOGRAPH_API
void to_json(json& j,
const RequestPermissionOutcome& o);
292NEOGRAPH_API
void from_json(
const json& j, RequestPermissionOutcome& o);
294struct NEOGRAPH_API RequestPermissionResponse {
295 RequestPermissionOutcome outcome;
298NEOGRAPH_API
void to_json(json& j,
const RequestPermissionResponse& r);
299NEOGRAPH_API
void from_json(
const json& j, RequestPermissionResponse& r);
323struct NEOGRAPH_API SessionNotification {
324 std::string session_id;
331NEOGRAPH_API
void to_json(json& j,
const PromptCapabilities& c);
332NEOGRAPH_API
void from_json(
const json& j, PromptCapabilities& c);
334NEOGRAPH_API
void to_json(json& j,
const McpCapabilities& c);
335NEOGRAPH_API
void from_json(
const json& j, McpCapabilities& c);
337NEOGRAPH_API
void to_json(json& j,
const SessionCapabilities& c);
338NEOGRAPH_API
void from_json(
const json& j, SessionCapabilities& c);
340NEOGRAPH_API
void to_json(json& j,
const AgentCapabilities& c);
341NEOGRAPH_API
void from_json(
const json& j, AgentCapabilities& c);
343NEOGRAPH_API
void to_json(json& j,
const FsCapabilities& c);
344NEOGRAPH_API
void from_json(
const json& j, FsCapabilities& c);
346NEOGRAPH_API
void to_json(json& j,
const ClientCapabilities& c);
347NEOGRAPH_API
void from_json(
const json& j, ClientCapabilities& c);
349NEOGRAPH_API
void to_json(json& j,
const ContentBlock& b);
350NEOGRAPH_API
void from_json(
const json& j, ContentBlock& b);
352NEOGRAPH_API
void to_json(json& j,
const InitializeRequest& r);
353NEOGRAPH_API
void from_json(
const json& j, InitializeRequest& r);
355NEOGRAPH_API
void to_json(json& j,
const InitializeResponse& r);
356NEOGRAPH_API
void from_json(
const json& j, InitializeResponse& r);
358NEOGRAPH_API
void to_json(json& j,
const McpServerConfig& c);
359NEOGRAPH_API
void from_json(
const json& j, McpServerConfig& c);
361NEOGRAPH_API
void to_json(json& j,
const NewSessionRequest& r);
362NEOGRAPH_API
void from_json(
const json& j, NewSessionRequest& r);
364NEOGRAPH_API
void to_json(json& j,
const NewSessionResponse& r);
365NEOGRAPH_API
void from_json(
const json& j, NewSessionResponse& r);
367NEOGRAPH_API
void to_json(json& j,
const PromptRequest& r);
368NEOGRAPH_API
void from_json(
const json& j, PromptRequest& r);
370NEOGRAPH_API
void to_json(json& j,
const PromptResponse& r);
371NEOGRAPH_API
void from_json(
const json& j, PromptResponse& r);
373NEOGRAPH_API
void to_json(json& j,
const CancelNotification& n);
374NEOGRAPH_API
void from_json(
const json& j, CancelNotification& n);
376NEOGRAPH_API
void to_json(json& j,
const SessionUpdate& u);
377NEOGRAPH_API
void from_json(
const json& j, SessionUpdate& u);
379NEOGRAPH_API
void to_json(json& j,
const SessionNotification& n);
380NEOGRAPH_API
void from_json(
const json& j, SessionNotification& n);
StopReason
Why the agent stopped responding for this turn.
@ EndTurn
"end_turn" — turn finished normally.
@ MaxTurnRequests
"max_turn_requests" — agent reached its turn-request budget.
@ Refusal
"refusal" — agent refused to continue.
@ Cancelled
"cancelled" — cancelled via session/cancel.
@ MaxTokens
"max_tokens" — model hit the token cap.
PermissionOutcomeKind
The user's decision (or absence thereof).
NEOGRAPH_API export/import macro for shared-library builds.
Thin C++ RAII wrapper around yyjson with nlohmann-compatible API.
Capabilities advertised in InitializeResponse.
Capabilities advertised by the editor in InitializeRequest.
File-system access methods the client offers (agent→client direction).
Sent once by the editor when the connection comes up.
json client_info
free-form metadata bag (e.g. name/version)
MCP server transports the agent supports (stdio is implicit / required).
Single MCP server entry attached to the session.
Capabilities the agent advertises about which prompt content it accepts.
Optional session-management features the agent supports.
Streaming event the agent sends while a prompt is in flight.
std::string session_update
discriminator
ContentBlock content
populated for *_chunk variants
json raw
full original JSON (always populated)