|
Entropic 2.3.8
Local-first agentic inference engine
|
C boundary implementation for i_storage_backend.h. More...
#include <entropic/interfaces/i_storage_backend.h>#include <entropic/storage/backend.h>#include <entropic/types/logging.h>#include <cstring>#include <new>#include <optional>#include <string>
Go to the source code of this file.
Classes | |
| struct | entropic_storage_backend |
Functions | |
| static char * | dup_string (const std::string &s) |
| Duplicate a std::string to a malloc'd C string. | |
| static std::optional< std::string > | opt_str (const char *s) |
| Convert optional C string to std::optional<std::string>. | |
| entropic_storage_backend_t | entropic_storage_create (const char *db_path) |
| Create a storage backend. | |
| entropic_error_t | entropic_storage_initialize (entropic_storage_backend_t storage) |
| Initialize storage. | |
| void | entropic_storage_destroy (entropic_storage_backend_t storage) |
| Destroy storage. | |
| char * | entropic_storage_create_conversation (entropic_storage_backend_t storage, const char *title, const char *project_path, const char *model_id) |
| Create a conversation. | |
| entropic_error_t | entropic_storage_save_conversation (entropic_storage_backend_t storage, const char *conversation_id, const char *messages_json) |
| Save messages to a conversation. | |
| entropic_error_t | entropic_storage_load_conversation (entropic_storage_backend_t storage, const char *conversation_id, char **result_json) |
| Load a conversation. | |
| entropic_error_t | entropic_storage_list_conversations (entropic_storage_backend_t storage, int limit, int offset, char **result_json) |
| List conversations. | |
| entropic_error_t | entropic_storage_search_conversations (entropic_storage_backend_t storage, const char *query, int limit, char **result_json) |
| Search conversations. | |
| entropic_error_t | entropic_storage_delete_conversation (entropic_storage_backend_t storage, const char *conversation_id) |
| Delete a conversation. | |
| entropic_error_t | entropic_storage_create_delegation (entropic_storage_backend_t storage, const char *parent_conversation_id, const char *delegating_tier, const char *target_tier, const char *task, int max_turns, char **result_json) |
| Create a delegation. | |
| entropic_error_t | entropic_storage_complete_delegation (entropic_storage_backend_t storage, const char *delegation_id, const char *status, const char *result_summary) |
| Complete a delegation. | |
| entropic_error_t | entropic_storage_get_delegations (entropic_storage_backend_t storage, const char *conversation_id, char **result_json) |
| Get delegations for a conversation. | |
| entropic_error_t | entropic_storage_save_snapshot (entropic_storage_backend_t storage, const char *conversation_id, const char *messages_json) |
| Save a compaction snapshot. | |
| entropic_error_t | entropic_storage_get_stats (entropic_storage_backend_t storage, char **result_json) |
| Get statistics. | |
C boundary implementation for i_storage_backend.h.
Wraps SqliteStorageBackend in opaque handles, catches all exceptions at the .so boundary, and converts to entropic_error_t codes.
Definition in file c_interface.cpp.
|
static |
Duplicate a std::string to a malloc'd C string.
| s | Source string. |
Definition at line 53 of file c_interface.cpp.
| entropic_error_t entropic_storage_complete_delegation | ( | entropic_storage_backend_t | storage, |
| const char * | delegation_id, | ||
| const char * | status, | ||
| const char * | result_summary | ||
| ) |
Complete a delegation.
Mark a delegation as completed or failed.
| storage | Handle. |
| delegation_id | Delegation ID. |
| status | Status string. |
| result_summary | Optional summary. |
Definition at line 333 of file c_interface.cpp.
| entropic_storage_backend_t entropic_storage_create | ( | const char * | db_path | ) |
Create a storage backend.
Create a storage backend with SQLite at the given path.
| db_path | Database file path. |
Definition at line 80 of file c_interface.cpp.
| char * entropic_storage_create_conversation | ( | entropic_storage_backend_t | storage, |
| const char * | title, | ||
| const char * | project_path, | ||
| const char * | model_id | ||
| ) |
Create a conversation.
Create a new conversation.
| storage | Handle. |
| title | Title. |
| project_path | Optional project path. |
| model_id | Optional model ID. |
Definition at line 131 of file c_interface.cpp.
| entropic_error_t entropic_storage_create_delegation | ( | entropic_storage_backend_t | storage, |
| const char * | parent_conversation_id, | ||
| const char * | delegating_tier, | ||
| const char * | target_tier, | ||
| const char * | task, | ||
| int | max_turns, | ||
| char ** | result_json | ||
| ) |
Create a delegation.
Create a delegation record with a child conversation.
| storage | Handle. |
| parent_conversation_id | Parent conversation. |
| delegating_tier | Source tier. |
| target_tier | Target tier. |
| task | Task description. |
| max_turns | Turn limit. |
| result_json | Output JSON. |
Definition at line 294 of file c_interface.cpp.
| entropic_error_t entropic_storage_delete_conversation | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id | ||
| ) |
Delete a conversation.
Delete a conversation and all associated records.
| storage | Handle. |
| conversation_id | Conversation ID. |
Definition at line 264 of file c_interface.cpp.
| void entropic_storage_destroy | ( | entropic_storage_backend_t | storage | ) |
Destroy storage.
Destroy storage and close connections.
| storage | Handle (NULL-safe). |
Definition at line 115 of file c_interface.cpp.
| entropic_error_t entropic_storage_get_delegations | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id, | ||
| char ** | result_json | ||
| ) |
Get delegations for a conversation.
Get delegations for a parent conversation.
| storage | Handle. |
| conversation_id | Parent conversation. |
| result_json | Output JSON. |
Definition at line 360 of file c_interface.cpp.
| entropic_error_t entropic_storage_get_stats | ( | entropic_storage_backend_t | storage, |
| char ** | result_json | ||
| ) |
Get statistics.
Get storage statistics.
| storage | Handle. |
| result_json | Output JSON. |
Definition at line 415 of file c_interface.cpp.
| entropic_error_t entropic_storage_initialize | ( | entropic_storage_backend_t | storage | ) |
Initialize storage.
Initialize storage (run migrations, create tables).
| storage | Handle. |
Definition at line 98 of file c_interface.cpp.
| entropic_error_t entropic_storage_list_conversations | ( | entropic_storage_backend_t | storage, |
| int | limit, | ||
| int | offset, | ||
| char ** | result_json | ||
| ) |
List conversations.
List conversations with pagination.
| storage | Handle. |
| limit | Max results. |
| offset | Offset. |
| result_json | Output JSON. |
Definition at line 210 of file c_interface.cpp.
| entropic_error_t entropic_storage_load_conversation | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id, | ||
| char ** | result_json | ||
| ) |
Load a conversation.
Load a conversation with messages.
| storage | Handle. |
| conversation_id | Conversation ID. |
| result_json | Output JSON. |
Definition at line 181 of file c_interface.cpp.
| entropic_error_t entropic_storage_save_conversation | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id, | ||
| const char * | messages_json | ||
| ) |
Save messages to a conversation.
| storage | Handle. |
| conversation_id | Conversation ID. |
| messages_json | JSON array. |
Definition at line 156 of file c_interface.cpp.
| entropic_error_t entropic_storage_save_snapshot | ( | entropic_storage_backend_t | storage, |
| const char * | conversation_id, | ||
| const char * | messages_json | ||
| ) |
Save a compaction snapshot.
Save a pre-compaction snapshot of full conversation history.
| storage | Handle. |
| conversation_id | Conversation ID. |
| messages_json | JSON messages. |
Definition at line 389 of file c_interface.cpp.
| entropic_error_t entropic_storage_search_conversations | ( | entropic_storage_backend_t | storage, |
| const char * | query, | ||
| int | limit, | ||
| char ** | result_json | ||
| ) |
Search conversations.
Full-text search across conversations.
| storage | Handle. |
| query | FTS5 query. |
| limit | Max results. |
| result_json | Output JSON. |
Definition at line 238 of file c_interface.cpp.
|
static |
Convert optional C string to std::optional<std::string>.
| s | C string or NULL. |
Definition at line 66 of file c_interface.cpp.