|
Entropic 2.3.8
Local-first agentic inference engine
|
Manages the lifecycle of all identities in the engine. More...
#include <entropic/core/identity_manager.h>
Public Member Functions | |
| IdentityManager (const IdentityManagerConfig &config) | |
| Construct with configuration. | |
| void | set_grammar_interface (const GrammarValidationInterface &iface) |
| Set grammar validation interface. | |
| void | set_mcp_interface (const MCPKeyInterface &iface) |
| Set MCP key management interface. | |
| size_t | load_static (const std::vector< IdentityConfig > &identities) |
| Load static identities from config loader. | |
| entropic_error_t | create (const IdentityConfig &config) |
| Create a new dynamic identity. | |
| entropic_error_t | update (const std::string &name, const IdentityConfig &config) |
| Update an existing dynamic identity. | |
| entropic_error_t | destroy (const std::string &name) |
| Destroy a dynamic identity. | |
| const IdentityConfig * | get (const std::string &name) const |
| Get identity config by name. | |
| bool | has (const std::string &name) const |
| Check if an identity exists. | |
| std::vector< std::string > | list () const |
| List all identity names. | |
| std::vector< const IdentityConfig * > | list_routable () const |
| List only routable identities (for classification prompt). | |
| size_t | count () const |
| Get the total number of identities. | |
| size_t | count_dynamic () const |
| Get the number of dynamic identities. | |
| bool | is_router_dirty () const |
| Check if the router classification prompt needs rebuilding. | |
| void | clear_router_dirty () |
| Clear the dirty flag (called after router prompt rebuild). | |
| void | set_in_use_checker (bool(*checker)(const std::string &name, void *user_data), void *user_data) |
| Set the in-use checker callback. | |
| void | set_cache_invalidator (void(*cb)(void *user_data), void *user_data) |
| Set a callback invoked whenever an identity changes. | |
Manages the lifecycle of all identities in the engine.
Definition at line 108 of file identity_manager.h.
|
explicit |
Construct with configuration.
| config | Identity manager configuration. |
| config | Identity manager configuration. |
Definition at line 135 of file identity_manager.cpp.
| void entropic::IdentityManager::clear_router_dirty | ( | ) |
Clear the dirty flag (called after router prompt rebuild).
Clear the dirty flag.
Definition at line 394 of file identity_manager.cpp.
| size_t entropic::IdentityManager::count | ( | ) | const |
Get the total number of identities.
Definition at line 355 of file identity_manager.cpp.
| size_t entropic::IdentityManager::count_dynamic | ( | ) | const |
Get the number of dynamic identities.
Definition at line 366 of file identity_manager.cpp.
| entropic_error_t entropic::IdentityManager::create | ( | const IdentityConfig & | config | ) |
Create a new dynamic identity.
| config | Identity configuration. |
| config | Identity configuration. |
Definition at line 195 of file identity_manager.cpp.
| entropic_error_t entropic::IdentityManager::destroy | ( | const std::string & | name | ) |
Destroy a dynamic identity.
| name | Identity name to destroy. |
| name | Identity name to destroy. |
Definition at line 262 of file identity_manager.cpp.
| const IdentityConfig * entropic::IdentityManager::get | ( | const std::string & | name | ) | const |
Get identity config by name.
| name | Identity name. |
Pointer valid until identity is destroyed or updated. Read via shared_lock.
| name | Identity name. |
Definition at line 288 of file identity_manager.cpp.
| bool entropic::IdentityManager::has | ( | const std::string & | name | ) | const |
Check if an identity exists.
| name | Identity name. |
| name | Identity name. |
Definition at line 304 of file identity_manager.cpp.
| bool entropic::IdentityManager::is_router_dirty | ( | ) | const |
Check if the router classification prompt needs rebuilding.
Definition at line 385 of file identity_manager.cpp.
| std::vector< std::string > entropic::IdentityManager::list | ( | ) | const |
List all identity names.
Definition at line 317 of file identity_manager.cpp.
| std::vector< const IdentityConfig * > entropic::IdentityManager::list_routable | ( | ) | const |
List only routable identities (for classification prompt).
List only routable identities for classification prompt.
Routable = routable==true && interstitial==false. Pointers valid until next create/update/destroy.
Definition at line 336 of file identity_manager.cpp.
| size_t entropic::IdentityManager::load_static | ( | const std::vector< IdentityConfig > & | identities | ) |
Load static identities from config loader.
| identities | Vector of static identity configs. |
Called once at engine startup. Static identities have origin=STATIC and cannot be destroyed via destroy().
| identities | Vector of static identity configs. |
Definition at line 170 of file identity_manager.cpp.
| void entropic::IdentityManager::set_cache_invalidator | ( | void(*)(void *user_data) | cb, |
| void * | user_data | ||
| ) |
Set a callback invoked whenever an identity changes.
Register a cache-invalidation callback.
Fires after create/update/destroy + reload_from_disk. Consumers use this to invalidate prompt caches keyed on identity content. (P1-7, 2.0.6-rc16)
| cb | Callback (nullable). |
| user_data | Opaque pointer forwarded to cb. @utility |
Fires on every identity create / update / destroy / reload. Facade wires this to ModelOrchestrator::clear_all_prompt_caches so cached KV prefixes never outlive a system-prompt change. (P1-7, 2.0.6-rc16)
| cb | Callback invoked on identity change (nullable). |
| user_data | Forwarded to cb. |
Definition at line 426 of file identity_manager.cpp.
| void entropic::IdentityManager::set_grammar_interface | ( | const GrammarValidationInterface & | iface | ) |
Set grammar validation interface.
| iface | Grammar validation callbacks. |
| iface | Grammar validation callbacks. |
Definition at line 146 of file identity_manager.cpp.
| void entropic::IdentityManager::set_in_use_checker | ( | bool(*)(const std::string &name, void *user_data) | checker, |
| void * | user_data | ||
| ) |
Set the in-use checker callback.
| checker | Function returning true if name is in active delegation. |
| user_data | Opaque pointer forwarded to checker. |
| checker | Function returning true if name is in active delegation. |
| user_data | Opaque pointer forwarded to checker. |
Definition at line 407 of file identity_manager.cpp.
| void entropic::IdentityManager::set_mcp_interface | ( | const MCPKeyInterface & | iface | ) |
Set MCP key management interface.
| iface | MCP key callbacks. |
| iface | MCP key callbacks. |
Definition at line 157 of file identity_manager.cpp.
| entropic_error_t entropic::IdentityManager::update | ( | const std::string & | name, |
| const IdentityConfig & | config | ||
| ) |
Update an existing dynamic identity.
| name | Identity name to update. |
| config | New configuration (name field must match). |
| name | Identity name to update. |
| config | New configuration (name field must match). |
Definition at line 228 of file identity_manager.cpp.