@@ -57,7 +57,25 @@ enum class ConnectionState
5757enum class SystemMessageMode
5858{
5959 Append,
60- Replace
60+ Replace,
61+ Customize
62+ };
63+
64+ // / Section override action for system message customization
65+ enum class SectionOverrideAction
66+ {
67+ Replace,
68+ Remove,
69+ Append,
70+ Prepend,
71+ Transform
72+ };
73+
74+ // / OAuth grant type for an MCP HTTP server
75+ enum class McpHttpServerConfigOauthGrantType
76+ {
77+ AuthorizationCode,
78+ ClientCredentials
6179};
6280
6381// JSON enum serialization
@@ -76,6 +94,26 @@ NLOHMANN_JSON_SERIALIZE_ENUM(
7694 {
7795 {SystemMessageMode::Append, " append" },
7896 {SystemMessageMode::Replace, " replace" },
97+ {SystemMessageMode::Customize, " customize" },
98+ }
99+ )
100+
101+ NLOHMANN_JSON_SERIALIZE_ENUM (
102+ SectionOverrideAction,
103+ {
104+ {SectionOverrideAction::Replace, " replace" },
105+ {SectionOverrideAction::Remove, " remove" },
106+ {SectionOverrideAction::Append, " append" },
107+ {SectionOverrideAction::Prepend, " prepend" },
108+ {SectionOverrideAction::Transform, " transform" },
109+ }
110+ )
111+
112+ NLOHMANN_JSON_SERIALIZE_ENUM (
113+ McpHttpServerConfigOauthGrantType,
114+ {
115+ {McpHttpServerConfigOauthGrantType::AuthorizationCode, " authorization_code" },
116+ {McpHttpServerConfigOauthGrantType::ClientCredentials, " client_credentials" },
79117 }
80118)
81119
@@ -595,11 +633,34 @@ struct SessionHooks
595633// Configuration Types
596634// =============================================================================
597635
636+ // / Override operation for a single system prompt section
637+ struct SectionOverride
638+ {
639+ SectionOverrideAction action = SectionOverrideAction::Replace;
640+ std::optional<std::string> content;
641+ };
642+
643+ inline void to_json (json& j, const SectionOverride& c)
644+ {
645+ j = json{{" action" , c.action }};
646+ if (c.content )
647+ j[" content" ] = *c.content ;
648+ }
649+
650+ inline void from_json (const json& j, SectionOverride& c)
651+ {
652+ if (j.contains (" action" ))
653+ c.action = j.at (" action" ).get <SectionOverrideAction>();
654+ if (j.contains (" content" ))
655+ c.content = j.at (" content" ).get <std::string>();
656+ }
657+
598658// / System message configuration
599659struct SystemMessageConfig
600660{
601661 std::optional<SystemMessageMode> mode;
602662 std::optional<std::string> content;
663+ std::optional<std::map<std::string, SectionOverride>> sections;
603664};
604665
605666inline void to_json (json& j, const SystemMessageConfig& c)
@@ -609,6 +670,8 @@ inline void to_json(json& j, const SystemMessageConfig& c)
609670 j[" mode" ] = *c.mode ;
610671 if (c.content )
611672 j[" content" ] = *c.content ;
673+ if (c.sections )
674+ j[" sections" ] = *c.sections ;
612675}
613676
614677inline void from_json (const json& j, SystemMessageConfig& c)
@@ -617,6 +680,8 @@ inline void from_json(const json& j, SystemMessageConfig& c)
617680 c.mode = j.at (" mode" ).get <SystemMessageMode>();
618681 if (j.contains (" content" ))
619682 c.content = j.at (" content" ).get <std::string>();
683+ if (j.contains (" sections" ))
684+ c.sections = j.at (" sections" ).get <std::map<std::string, SectionOverride>>();
620685}
621686
622687// / Azure-specific provider options
@@ -647,6 +712,11 @@ struct ProviderConfig
647712 std::optional<std::string> api_key;
648713 std::optional<std::string> bearer_token;
649714 std::optional<AzureOptions> azure;
715+ std::optional<std::map<std::string, std::string>> headers;
716+ std::optional<std::string> model_id;
717+ std::optional<std::string> wire_model;
718+ std::optional<int > max_input_tokens;
719+ std::optional<int > max_output_tokens;
650720
651721 // ─────────────────────────────────────────────────────────────────────────
652722 // Environment Variable Support
@@ -717,6 +787,16 @@ inline void to_json(json& j, const ProviderConfig& c)
717787 j[" bearerToken" ] = *c.bearer_token ;
718788 if (c.azure )
719789 j[" azure" ] = *c.azure ;
790+ if (c.headers )
791+ j[" headers" ] = *c.headers ;
792+ if (c.model_id )
793+ j[" modelId" ] = *c.model_id ;
794+ if (c.wire_model )
795+ j[" wireModel" ] = *c.wire_model ;
796+ if (c.max_input_tokens )
797+ j[" maxPromptTokens" ] = *c.max_input_tokens ;
798+ if (c.max_output_tokens )
799+ j[" maxOutputTokens" ] = *c.max_output_tokens ;
720800}
721801
722802inline void from_json (const json& j, ProviderConfig& c)
@@ -732,6 +812,16 @@ inline void from_json(const json& j, ProviderConfig& c)
732812 c.bearer_token = j.at (" bearerToken" ).get <std::string>();
733813 if (j.contains (" azure" ))
734814 c.azure = j.at (" azure" ).get <AzureOptions>();
815+ if (j.contains (" headers" ))
816+ c.headers = j.at (" headers" ).get <std::map<std::string, std::string>>();
817+ if (j.contains (" modelId" ))
818+ c.model_id = j.at (" modelId" ).get <std::string>();
819+ if (j.contains (" wireModel" ))
820+ c.wire_model = j.at (" wireModel" ).get <std::string>();
821+ if (j.contains (" maxPromptTokens" ))
822+ c.max_input_tokens = j.at (" maxPromptTokens" ).get <int >();
823+ if (j.contains (" maxOutputTokens" ))
824+ c.max_output_tokens = j.at (" maxOutputTokens" ).get <int >();
735825}
736826
737827// =============================================================================
@@ -871,6 +961,24 @@ inline void from_json(const json& j, CustomAgentConfig& c)
871961 c.model = j.at (" model" ).get <std::string>();
872962}
873963
964+ struct DefaultAgentConfig
965+ {
966+ std::optional<std::vector<std::string>> excluded_tools;
967+ };
968+
969+ inline void to_json (json& j, const DefaultAgentConfig& c)
970+ {
971+ j = json::object ();
972+ if (c.excluded_tools )
973+ j[" excludedTools" ] = *c.excluded_tools ;
974+ }
975+
976+ inline void from_json (const json& j, DefaultAgentConfig& c)
977+ {
978+ if (j.contains (" excludedTools" ))
979+ c.excluded_tools = j.at (" excludedTools" ).get <std::vector<std::string>>();
980+ }
981+
874982// =============================================================================
875983// Attachment Types (for MessageOptions)
876984// =============================================================================
@@ -1004,7 +1112,9 @@ struct SessionConfig
10041112{
10051113 std::optional<std::string> session_id;
10061114 std::optional<std::string> model;
1115+ std::optional<json> model_capabilities;
10071116 std::vector<Tool> tools;
1117+ std::optional<std::vector<json>> commands;
10081118 std::optional<SystemMessageConfig> system_message;
10091119 std::optional<std::vector<std::string>> available_tools;
10101120 std::optional<std::vector<std::string>> excluded_tools;
@@ -1013,6 +1123,8 @@ struct SessionConfig
10131123 bool streaming = false ;
10141124 std::optional<std::map<std::string, json>> mcp_servers;
10151125 std::optional<std::vector<CustomAgentConfig>> custom_agents;
1126+ std::optional<DefaultAgentConfig> default_agent;
1127+ std::optional<std::string> agent;
10161128
10171129 // / Directories to load skills from.
10181130 std::optional<std::vector<std::string>> skill_directories;
@@ -1044,6 +1156,9 @@ struct SessionConfig
10441156 // / Working directory for the session.
10451157 std::optional<std::string> working_directory;
10461158
1159+ // / GitHub token for per-session authentication.
1160+ std::optional<std::string> github_token;
1161+
10471162 // ===== v0.1.49 additions =====
10481163
10491164 // / Client identifier reported to the CLI (PR #510).
@@ -1075,6 +1190,8 @@ struct ResumeSessionConfig
10751190 bool streaming = false ;
10761191 std::optional<std::map<std::string, json>> mcp_servers;
10771192 std::optional<std::vector<CustomAgentConfig>> custom_agents;
1193+ std::optional<DefaultAgentConfig> default_agent;
1194+ std::optional<std::string> agent;
10781195
10791196 // / Directories to load skills from.
10801197 std::optional<std::vector<std::string>> skill_directories;
@@ -1092,10 +1209,13 @@ struct ResumeSessionConfig
10921209
10931210 // / Model to use for this session. Can change the model when resuming.
10941211 std::optional<std::string> model;
1212+ std::optional<json> model_capabilities;
10951213
10961214 // / Reasoning effort level for models that support it.
10971215 std::optional<ReasoningEffort> reasoning_effort;
10981216
1217+ std::optional<std::vector<json>> commands;
1218+
10991219 // / System message configuration.
11001220 std::optional<SystemMessageConfig> system_message;
11011221
@@ -1136,6 +1256,7 @@ struct MessageOptions
11361256 std::string prompt;
11371257 std::optional<std::vector<UserMessageAttachment>> attachments;
11381258 std::optional<std::string> mode;
1259+ std::optional<std::map<std::string, std::string>> request_headers;
11391260};
11401261
11411262inline void to_json (json& j, const MessageOptions& o)
@@ -1145,6 +1266,19 @@ inline void to_json(json& j, const MessageOptions& o)
11451266 j[" attachments" ] = *o.attachments ;
11461267 if (o.mode )
11471268 j[" mode" ] = *o.mode ;
1269+ if (o.request_headers )
1270+ j[" requestHeaders" ] = *o.request_headers ;
1271+ }
1272+
1273+ inline void from_json (const json& j, MessageOptions& o)
1274+ {
1275+ j.at (" prompt" ).get_to (o.prompt );
1276+ if (j.contains (" attachments" ))
1277+ o.attachments = j.at (" attachments" ).get <std::vector<UserMessageAttachment>>();
1278+ if (j.contains (" mode" ))
1279+ o.mode = j.at (" mode" ).get <std::string>();
1280+ if (j.contains (" requestHeaders" ))
1281+ o.request_headers = j.at (" requestHeaders" ).get <std::map<std::string, std::string>>();
11481282}
11491283
11501284// =============================================================================
0 commit comments