24#include <unordered_map>
110 const std::unordered_map<std::string,
111 std::vector<std::string>>*
map) {
112 tier_allowed_tools_ =
map;
124 const std::vector<ToolCall>& tool_calls);
133 static std::vector<ToolCall> sort_tool_calls(
134 const std::vector<ToolCall>&
calls);
142 void extract_and_process_directives(
182 std::optional<Message> check_tier_allowed(
192 std::pair<Message, std::string> execute_tool(
211 long long ms,
int iteration);
264 const std::string& result);
274 const std::string& reason);
284 const std::string&
error);
301 void truncate_to_limit(std::vector<ToolCall>&
calls,
int limit)
const;
331 std::optional<Message> check_schema(
const ToolCall&
call);
341 std::optional<Message> check_dup_or_approval(
357 std::vector<Message> process_single_call(
369 const std::vector<Message>&
results)
const;
385 static Message create_circuit_breaker_message();
395 static Message create_duplicate_message(
406 static std::string serialize_args(
const ToolCall&
call);
415 static std::string serialize_tool_call(
const ToolCall&
call);
430 static std::string build_post_tool_json(
434 const std::string&
tier,
458 const std::string& tool_name);
473 int effective_hard_block_threshold()
const;
555 void apply_result_size_cap(std::string& content)
const;
566 static std::string build_pre_tool_json(
568 const std::string&
tier,
669 const std::string& result,
674 ServerManager* (*server_resolver_)(
const std::string&,
void*) =
nullptr;
675 void* server_resolver_data_ =
nullptr;
683 ServerManager& servers_for(
const std::string& session_key)
const;
692 const std::unordered_map<std::string, std::vector<std::string>>*
693 tier_allowed_tools_ =
nullptr;
696 std::atomic<size_t> history_seq_{0};
737 std::optional<Message> check_mcp_authorization(
Per-identity MCP authorization with runtime grant/revoke.
Manages MCP server instances and routes tool calls.
Fixed-size ring buffer of recent tool calls.
Directive processing for tool-to-engine communication.
Types for the agentic loop engine.
long limit
Results to keep.
Per-identity MCP authorization with runtime grant/revoke.
Activate model on GPU (WARM → ACTIVE).
ToolResultKind
Categorical outcome of a single tool invocation.
@ ok
Tool dispatched, returned non-empty content.
@ error
Tool server returned an error payload.
@ optional
optional: every escape asks the host's path approver
@ tier
The TIER's identity frontmatter grammar: stem (gh#154).
MCP server lifecycle management and tool routing.
Callback function pointer types for engine events.
Configuration for the agentic loop.
Mutable state carried through the agentic loop.
A message in a conversation.
Permission persistence interface.
Outcome of precondition checks for a single tool call.
std::optional< Message > rejection
Rejection message (nullopt if cleared)
ToolResultKind kind
Category on rejection.
In-memory ring buffer of recent tool calls for introspection.