53class ModelOrchestrator;
57class MCPAuthorizationManager;
59class SqliteStorageBackend;
61class ConstitutionalValidator;
62class CompactorRegistry;
65struct InterfaceContext;
86 std::filesystem::path
root;
91 std::unique_ptr<entropic::ServerManager>
servers;
136 std::unique_ptr<entropic::MCPAuthorizationManager>
mcp_auth;
148 std::map<std::string, std::unique_ptr<EntropicWorkspace>>
workspaces;
157 std::unique_ptr<entropic::AgentEngine>
engine;
158 std::unique_ptr<entropic::SqliteStorageBackend>
storage;
163 std::unique_ptr<entropic::ConstitutionalValidator>
validator;
188 void* state_observer_data =
nullptr;
195 void* queue_observer_data =
nullptr;
238 const std::string& key) {
239 if (
h ==
nullptr) {
return nullptr; }
240 std::lock_guard<std::mutex> lock(
h->workspace_mutex);
241 auto bound =
h->session_workspace.find(key);
242 if (
bound ==
h->session_workspace.end()) {
return nullptr; }
243 auto ws =
h->workspaces.find(
bound->second);
244 return ws ==
h->workspaces.end() ?
nullptr :
ws->second.get();
256 const std::string& key) {
258 if (
ws !=
nullptr &&
ws->servers) {
return ws->servers.get(); }
259 return h !=
nullptr ?
h->server_manager.get() :
nullptr;
335 const std::optional<std::string>& app_context);
354 const std::string& session_key,
const std::filesystem::path& path,
377 const std::string& key);
399 : lock_(
h->api_mutex), log_scope_(
h->log_id) {}
405 std::lock_guard<std::mutex> lock_;
462 const char* session_key =
nullptr)
464 log_scope_(
h !=
nullptr ?
h->log_id : 0),
465 key_(session_key !=
nullptr ? session_key :
""),
470 session_scope_(session_key !=
nullptr ? session_key :
"") {}
477 if (claimed_) { engine_->
end_turn(key_); }
491 if (!claimed_ && engine_ !=
nullptr) {
503 const std::string&
key()
const {
return key_; }
524 bool claimed_ =
false;
JSONL audit logger for MCP tool calls.
Bundled model registry — resolves keys to filesystem paths.
Core agent execution engine.
bool try_begin_turn(const std::string &key)
Try to claim one turn for a named session (gh#144 / gh#158).
void end_turn(const std::string &key)
Release a turn claimed by try_begin_turn (gh#144 / gh#158).
gh#59 (v2.3.1): RAII guard combining api_mutex + log scope.
HandleApiLock(entropic_handle_t h)
Lock handle mutex + enter log scope.
gh#144 (v2.12.0): RAII turn claim + log scope, for the RUN paths.
bool claim()
Claim the turn.
bool claimed() const
Whether this guard owns the turn.
HandleTurnGuard(entropic_handle_t h, const char *session_key=nullptr)
Enter the handle's log scope.
const std::string & key() const
The session this guard claims for.
~HandleTurnGuard()
Release the turn if this guard claimed it.
Thread-safe hook registration and dispatch.
RAII publication of one run's session key to its own thread.
Manages MCP server instances and routes tool calls.
Bundled model registry loaded from bundled_models.yaml.
gh#59 (v2.3.1): RAII guard — sets thread's current handle_id.
Per-identity compactor registration and dispatch.
Configuration structs with defaults.
Post-generation constitutional compliance validator.
AgentEngine * engine
Fallback interrupt target.
Core agent execution engine.
Public C API for the Entropic inference engine.
ent_decision_t(* ent_path_approval_cb)(const ent_path_approval_request_t *req, void *user_data)
Host decision for one outside-root filesystem access.
Error types for cross-.so error reporting.
Unix socket MCP bridge — exposes a running engine to external clients.
Thread-safe hook registration and dispatch.
Serve the external MCP bridge over Streamable HTTP (gh#204, v2.14.0).
IdentityManager – lifecycle management for static and dynamic identities.
spdlog initialization and logger access.
Per-identity MCP authorization with runtime grant/revoke.
Activate model on GPU (WARM → ACTIVE).
void wire_external_server_policy(entropic_handle_t h, ServerManager &servers, bool with_declared)
Give a server set the handle's external-server policy (v2.14.0).
void apply_workspace_app_context(entropic_handle_t h, const std::string &workspace, const std::optional< std::string > &app_context)
Give a workspace's sessions prompts built on its own app_context (gh#179), or return them to the hand...
@ optional
optional: every escape asks the host's path approver
EntropicWorkspace * workspace_for(entropic_handle_t h, const std::string &key)
The workspace a session is bound to, or nullptr for the default.
std::filesystem::path bridge_project_dir(entropic_handle_t h)
The project dir the external bridge derives its socket from.
ENTROPIC_EXPORT void swap_session_tool_dir(const std::string &session_key, const std::filesystem::path &path, bool entering, void *ud)
The facade's gh#160 ScopedSandbox swap callback.
std::filesystem::path expected_bridge_socket(entropic_handle_t h)
The socket this handle's external bridge binds, or empty when the handle runs no bridge (v2....
void wire_outside_root_approver(entropic_handle_t h)
Point the DEFAULT server set's filesystem server at the handle's path-approval slot (v2....
std::size_t release_session_tool_state(entropic_handle_t h, const std::string &key)
Release a session's per-session tool state on every server set (gh#158).
entropic::ServerManager * workspace_servers(entropic_handle_t h, const std::string &key)
The MCP servers a session's tools must run against (gh#166).
ModelOrchestrator — multi-model lifecycle and routing.
gh#158: the cancel token of the run executing on THIS thread.
MCP server lifecycle management and tool routing.
Session model log — raw streaming transcript.
SqliteStorageBackend — conversation persistence via SQLite.
A named repository a session's tools operate in (gh#166).
std::unique_ptr< entropic::ServerManager > servers
Its own instances.
std::optional< std::string > app_context
gh#179: this workspace's app_context; nullopt = the handle's.
std::string name
Caller-chosen workspace name.
std::filesystem::path root
Tool root for bound sessions.
Holds orchestrator + tier for C callback user_data.
Full parsed configuration.
Engine handle struct — owns all subsystems.
std::unique_ptr< entropic::ConstitutionalValidator > validator
Constitutional validation.
std::unique_ptr< entropic::ToolExecutor > tool_executor
Tool dispatch.
void(* critique_end_cb)(void *)
Fires after the critique generate returns.
int log_id
gh#59 (v2.3.1): unique handle id for per-handle log routing via entropic::log::HandleAwareSink.
std::mutex workspace_mutex
gh#166: guards both maps above. Held for lookups only.
std::map< std::string, std::unique_ptr< EntropicWorkspace > > workspaces
gh#166: named workspaces, by name.
std::atomic< bool > running
True during run()
std::unordered_map< std::string, std::vector< std::string > > tier_validation_rules
Per-tier validation_rules from identity frontmatter (v2.0.6).
std::unique_ptr< entropic::SqliteStorageBackend > storage
SQLite persistence.
entropic::InferenceInterface inference_iface
Stable copy for validator lifetime.
std::unique_ptr< entropic::http::HttpListener > http_listener
Streamable-HTTP front end for external_bridge (gh#204).
std::unique_ptr< entropic::AuditLogger > audit_logger
Audit log.
std::unique_ptr< entropic::SessionLogger > session_logger
Model transcript log.
std::unordered_map< std::string, std::vector< std::string > > tier_allowed_tools
Per-tier allowed_tools from identity frontmatter.
std::unique_ptr< entropic::CompactorRegistry > compactor_registry
Compaction strategies.
std::atomic< bool > configured
True after configure()
std::unique_ptr< entropic::ExternalBridge > external_bridge
Unix socket MCP bridge.
void(* state_observer)(int, void *)
Observer for engine state transitions.
entropic::config::BundledModels bundled_models
Model registry.
void * stream_observer_data
Observer user_data.
std::map< std::string, std::string > session_workspace
gh#166: session key → workspace name.
std::unique_ptr< entropic::IdentityManager > identity_manager
Identity lifecycle.
std::string last_error
Per-handle error message.
std::unique_ptr< entropic::AgentEngine > engine
Agentic loop (owns conversation state)
void * critique_cb_data
Forwarded to both callbacks.
std::unique_ptr< entropic::MCPAuthorizationManager > mcp_auth
Per-identity tool auth.
void * path_approval_data
Forwarded to the approver.
std::unique_ptr< entropic::ModelOrchestrator > orchestrator
Model pool + routing.
entropic::ParsedConfig config
Parsed config.
void(* stream_observer)(const char *, size_t, void *)
Global stream observer — fires for all streaming output.
void(* queue_observer)(const char *, size_t, void *)
Observer fired when a queued mid-gen user message is consumed and seeded as the next turn.
std::unique_ptr< entropic::ServerManager > server_manager
MCP server lifecycle.
std::mutex path_approval_mutex
Guards the pair above: the thunk reads it from run threads while the setter may write it from any thr...
entropic::InterfaceContext * inference_iface_ctx
Per-handle owned context backing inference_iface.user_data.
std::mutex api_mutex
Serializes API calls.
ent_path_approval_cb path_approval_cb
Consumer's approver for filesystem access outside the root.
void(* critique_start_cb)(void *)
Fires before the constitutional validator's critique generate begins.
entropic::HookRegistry hook_registry
Hook dispatch.