Entropic 2.14.3
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic_engine Struct Reference

Engine handle struct — owns all subsystems. More...

#include </home/runner/work/entropic/entropic/src/facade/engine_handle.h>

Collaboration diagram for entropic_engine:

Public Attributes

entropic::HookRegistry hook_registry
 Hook dispatch.
 
std::mutex api_mutex
 Serializes API calls.
 
std::string last_error
 Per-handle error message.
 
std::atomic< bool > configured {false}
 True after configure()
 
std::atomic< bool > running {false}
 True during run()
 
int log_id = 0
 gh#59 (v2.3.1): unique handle id for per-handle log routing via entropic::log::HandleAwareSink.
 
entropic::ParsedConfig config
 Parsed config.
 
entropic::config::BundledModels bundled_models
 Model registry.
 
std::unique_ptr< entropic::ModelOrchestrator > orchestrator
 Model pool + routing.
 
entropic::InferenceInterface inference_iface
 Stable copy for validator lifetime.
 
entropic::InterfaceContext * inference_iface_ctx = nullptr
 Per-handle owned context backing inference_iface.user_data.
 
std::unique_ptr< entropic::ServerManager > server_manager
 MCP server lifecycle.
 
std::unique_ptr< entropic::ToolExecutor > tool_executor
 Tool dispatch.
 
std::unique_ptr< entropic::IdentityManager > identity_manager
 Identity lifecycle.
 
std::unique_ptr< entropic::MCPAuthorizationManager > mcp_auth
 Per-identity tool auth.
 
std::map< std::string, std::unique_ptr< EntropicWorkspace > > workspaces
 gh#166: named workspaces, by name.
 
std::map< std::string, std::string > session_workspace
 gh#166: session key → workspace name.
 
std::mutex workspace_mutex
 gh#166: guards both maps above. Held for lookups only.
 
std::unique_ptr< entropic::AgentEngine > engine
 Agentic loop (owns conversation state)
 
std::unique_ptr< entropic::SqliteStorageBackend > storage
 SQLite persistence.
 
std::unique_ptr< entropic::AuditLogger > audit_logger
 Audit log.
 
std::unique_ptr< entropic::SessionLogger > session_logger
 Model transcript log.
 
std::unique_ptr< entropic::ConstitutionalValidator > validator
 Constitutional validation.
 
std::unique_ptr< entropic::CompactorRegistry > compactor_registry
 Compaction strategies.
 
std::unordered_map< std::string, std::vector< std::string > > tier_allowed_tools
 Per-tier allowed_tools from identity frontmatter.
 
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::ExternalBridge > external_bridge
 Unix socket MCP bridge.
 
std::unique_ptr< entropic::http::HttpListener > http_listener
 Streamable-HTTP front end for external_bridge (gh#204).
 
void(* stream_observer )(const char *, size_t, void *) = nullptr
 Global stream observer — fires for all streaming output.
 
void * stream_observer_data = nullptr
 Observer user_data.
 
void(* state_observer )(int, void *) = nullptr
 Observer for engine state transitions.
 
void * state_observer_data = nullptr
 
void(* queue_observer )(const char *, size_t, void *) = nullptr
 Observer fired when a queued mid-gen user message is consumed and seeded as the next turn.
 
void * queue_observer_data = nullptr
 
void(* critique_start_cb )(void *) = nullptr
 Fires before the constitutional validator's critique generate begins.
 
void(* critique_end_cb )(void *) = nullptr
 Fires after the critique generate returns.
 
void * critique_cb_data = nullptr
 Forwarded to both callbacks.
 
ent_path_approval_cb path_approval_cb = nullptr
 Consumer's approver for filesystem access outside the root.
 
void * path_approval_data = nullptr
 Forwarded to the approver.
 
std::mutex path_approval_mutex
 Guards the pair above: the thunk reads it from run threads while the setter may write it from any thread.
 

Detailed Description

Engine handle struct — owns all subsystems.

The public C API casts entropic_handle_t to/from this struct. Members are grouped by the phase that wires them.

Destruction order
Reverse of creation: engine, storage, audit, constitutional, MCP, inference, config, hooks. Each pointer is null-safe.
Version
2.0.0

Definition at line 108 of file engine_handle.h.

Member Data Documentation

◆ api_mutex

std::mutex entropic_engine::api_mutex

Serializes API calls.

Definition at line 111 of file engine_handle.h.

◆ audit_logger

std::unique_ptr<entropic::AuditLogger> entropic_engine::audit_logger

Audit log.

Definition at line 159 of file engine_handle.h.

◆ bundled_models

entropic::config::BundledModels entropic_engine::bundled_models

Model registry.

Definition at line 123 of file engine_handle.h.

◆ compactor_registry

std::unique_ptr<entropic::CompactorRegistry> entropic_engine::compactor_registry

Compaction strategies.

Definition at line 164 of file engine_handle.h.

◆ config

entropic::ParsedConfig entropic_engine::config

Parsed config.

Definition at line 122 of file engine_handle.h.

◆ configured

std::atomic<bool> entropic_engine::configured {false}

True after configure()

Definition at line 113 of file engine_handle.h.

◆ critique_cb_data

void* entropic_engine::critique_cb_data = nullptr

Forwarded to both callbacks.

Definition at line 207 of file engine_handle.h.

◆ critique_end_cb

void(* entropic_engine::critique_end_cb) (void *) = nullptr

Fires after the critique generate returns.

Definition at line 205 of file engine_handle.h.

◆ critique_start_cb

void(* entropic_engine::critique_start_cb) (void *) = nullptr

Fires before the constitutional validator's critique generate begins.

Stored on the handle so pre-configure registration survives validator reconstruction (the rewire_critique_callbacks helper re-applies the slot to any newly-built ConstitutionalValidator).

Definition at line 203 of file engine_handle.h.

◆ engine

std::unique_ptr<entropic::AgentEngine> entropic_engine::engine

Agentic loop (owns conversation state)

Definition at line 157 of file engine_handle.h.

◆ external_bridge

std::unique_ptr<entropic::ExternalBridge> entropic_engine::external_bridge

Unix socket MCP bridge.

Definition at line 173 of file engine_handle.h.

◆ hook_registry

entropic::HookRegistry entropic_engine::hook_registry

Hook dispatch.

Definition at line 110 of file engine_handle.h.

◆ http_listener

std::unique_ptr<entropic::http::HttpListener> entropic_engine::http_listener

Streamable-HTTP front end for external_bridge (gh#204).

Declared AFTER it so it is destroyed FIRST: it dispatches into the bridge.

Definition at line 176 of file engine_handle.h.

◆ identity_manager

std::unique_ptr<entropic::IdentityManager> entropic_engine::identity_manager

Identity lifecycle.

Definition at line 135 of file engine_handle.h.

◆ inference_iface

entropic::InferenceInterface entropic_engine::inference_iface

Stable copy for validator lifetime.

Definition at line 127 of file engine_handle.h.

◆ inference_iface_ctx

entropic::InterfaceContext* entropic_engine::inference_iface_ctx = nullptr

Per-handle owned context backing inference_iface.user_data.

Pre-v2.2.6 this was a process-global static — gh#58 follow-up.

Definition at line 130 of file engine_handle.h.

◆ last_error

std::string entropic_engine::last_error

Per-handle error message.

Definition at line 112 of file engine_handle.h.

◆ log_id

int entropic_engine::log_id = 0

gh#59 (v2.3.1): unique handle id for per-handle log routing via entropic::log::HandleAwareSink.

Monotonic 1.. (0 is reserved for "no handle scope"). Set in entropic_create.

Definition at line 119 of file engine_handle.h.

◆ mcp_auth

std::unique_ptr<entropic::MCPAuthorizationManager> entropic_engine::mcp_auth

Per-identity tool auth.

Definition at line 136 of file engine_handle.h.

◆ orchestrator

std::unique_ptr<entropic::ModelOrchestrator> entropic_engine::orchestrator

Model pool + routing.

Definition at line 126 of file engine_handle.h.

◆ path_approval_cb

ent_path_approval_cb entropic_engine::path_approval_cb = nullptr

Consumer's approver for filesystem access outside the root.

Stored on the handle so pre-configure registration survives server construction; the default server set's FilesystemServer holds a facade thunk that reads this slot per call. Workspaces never do.

Definition at line 214 of file engine_handle.h.

◆ path_approval_data

void* entropic_engine::path_approval_data = nullptr

Forwarded to the approver.

Definition at line 215 of file engine_handle.h.

◆ path_approval_mutex

std::mutex entropic_engine::path_approval_mutex

Guards the pair above: the thunk reads it from run threads while the setter may write it from any thread.

Definition at line 218 of file engine_handle.h.

◆ queue_observer

void(* entropic_engine::queue_observer) (const char *, size_t, void *) = nullptr

Observer fired when a queued mid-gen user message is consumed and seeded as the next turn.

Stored on the handle so pre-configure registration survives engine construction.

Definition at line 194 of file engine_handle.h.

◆ queue_observer_data

void* entropic_engine::queue_observer_data = nullptr

Definition at line 195 of file engine_handle.h.

◆ running

std::atomic<bool> entropic_engine::running {false}

True during run()

Definition at line 114 of file engine_handle.h.

◆ server_manager

std::unique_ptr<entropic::ServerManager> entropic_engine::server_manager

MCP server lifecycle.

Definition at line 133 of file engine_handle.h.

◆ session_logger

std::unique_ptr<entropic::SessionLogger> entropic_engine::session_logger

Model transcript log.

Definition at line 160 of file engine_handle.h.

◆ session_workspace

std::map<std::string, std::string> entropic_engine::session_workspace

gh#166: session key → workspace name.

A key that is absent resolves to the default workspace, so every existing consumer — which binds nothing — is unaffected.

Definition at line 152 of file engine_handle.h.

◆ state_observer

void(* entropic_engine::state_observer) (int, void *) = nullptr

Observer for engine state transitions.

Forwarded to engine callbacks so bridge async tasks can project VERIFYING → "validating"/"revising" phases.

Definition at line 187 of file engine_handle.h.

◆ state_observer_data

void* entropic_engine::state_observer_data = nullptr

Definition at line 188 of file engine_handle.h.

◆ storage

std::unique_ptr<entropic::SqliteStorageBackend> entropic_engine::storage

SQLite persistence.

Definition at line 158 of file engine_handle.h.

◆ stream_observer

void(* entropic_engine::stream_observer) (const char *, size_t, void *) = nullptr

Global stream observer — fires for all streaming output.

Definition at line 180 of file engine_handle.h.

◆ stream_observer_data

void* entropic_engine::stream_observer_data = nullptr

Observer user_data.

Definition at line 181 of file engine_handle.h.

◆ tier_allowed_tools

std::unordered_map<std::string, std::vector<std::string> > entropic_engine::tier_allowed_tools

Per-tier allowed_tools from identity frontmatter.

Definition at line 168 of file engine_handle.h.

◆ tier_validation_rules

std::unordered_map<std::string, std::vector<std::string> > entropic_engine::tier_validation_rules

Per-tier validation_rules from identity frontmatter (v2.0.6).

Definition at line 170 of file engine_handle.h.

◆ tool_executor

std::unique_ptr<entropic::ToolExecutor> entropic_engine::tool_executor

Tool dispatch.

Definition at line 134 of file engine_handle.h.

◆ validator

std::unique_ptr<entropic::ConstitutionalValidator> entropic_engine::validator

Constitutional validation.

Definition at line 163 of file engine_handle.h.

◆ workspace_mutex

std::mutex entropic_engine::workspace_mutex
mutable

gh#166: guards both maps above. Held for lookups only.

Definition at line 154 of file engine_handle.h.

◆ workspaces

std::map<std::string, std::unique_ptr<EntropicWorkspace> > entropic_engine::workspaces

gh#166: named workspaces, by name.

The DEFAULT workspace is server_manager above and is not in this map.

Definition at line 148 of file engine_handle.h.


The documentation for this struct was generated from the following file: