pub struct ConeStorage { /* private fields */ }Expand description
Storage layer for cone configurations
Implementations§
Source§impl ConeStorage
impl ConeStorage
Sourcepub async fn new(
config: ConeStorageConfig,
arbor: Arc<ArborStorage>,
) -> Result<Self, ConeError>
pub async fn new( config: ConeStorageConfig, arbor: Arc<ArborStorage>, ) -> Result<Self, ConeError>
Create a new cone storage instance with a shared Arbor storage
Sourcepub fn arbor(&self) -> &ArborStorage
pub fn arbor(&self) -> &ArborStorage
Get access to the underlying arbor storage
Sourcepub async fn cone_create(
&self,
name: String,
model_id: String,
system_prompt: Option<String>,
metadata: Option<Value>,
) -> Result<ConeConfig, ConeError>
pub async fn cone_create( &self, name: String, model_id: String, system_prompt: Option<String>, metadata: Option<Value>, ) -> Result<ConeConfig, ConeError>
Create a new cone with a new conversation tree
If a cone with the given name already exists, automatically appends #<uuid>
to make it unique. For example, “assistant” becomes “assistant#550e8400…”
Sourcepub async fn resolve_cone_identifier(
&self,
identifier: &ConeIdentifier,
) -> Result<ConeId, ConeError>
pub async fn resolve_cone_identifier( &self, identifier: &ConeIdentifier, ) -> Result<ConeId, ConeError>
Resolve a cone identifier to a ConeId
For name lookups, supports partial matching on the name portion before ‘#’:
- “assistant” matches “assistant” or “assistant#550e8400-…”
- “assistant#550e” matches “assistant#550e8400-…”
Fails if the pattern matches multiple cones (ambiguous).
Sourcepub async fn cone_get(&self, cone_id: &ConeId) -> Result<ConeConfig, ConeError>
pub async fn cone_get(&self, cone_id: &ConeId) -> Result<ConeConfig, ConeError>
Get a cone by ID
Sourcepub async fn cone_get_by_identifier(
&self,
identifier: &ConeIdentifier,
) -> Result<ConeConfig, ConeError>
pub async fn cone_get_by_identifier( &self, identifier: &ConeIdentifier, ) -> Result<ConeConfig, ConeError>
Get a cone by identifier (name or UUID)
Sourcepub async fn cone_update_head(
&self,
cone_id: &ConeId,
new_head: NodeId,
) -> Result<(), ConeError>
pub async fn cone_update_head( &self, cone_id: &ConeId, new_head: NodeId, ) -> Result<(), ConeError>
Update cone’s canonical head
Sourcepub async fn cone_update(
&self,
cone_id: &ConeId,
name: Option<String>,
model_id: Option<String>,
system_prompt: Option<Option<String>>,
metadata: Option<Value>,
) -> Result<(), ConeError>
pub async fn cone_update( &self, cone_id: &ConeId, name: Option<String>, model_id: Option<String>, system_prompt: Option<Option<String>>, metadata: Option<Value>, ) -> Result<(), ConeError>
Update cone configuration
Sourcepub async fn cone_delete(&self, cone_id: &ConeId) -> Result<(), ConeError>
pub async fn cone_delete(&self, cone_id: &ConeId) -> Result<(), ConeError>
Delete an cone (does not delete the tree)
Sourcepub async fn message_create(
&self,
cone_id: &ConeId,
role: MessageRole,
content: String,
model_id: Option<String>,
input_tokens: Option<i64>,
output_tokens: Option<i64>,
) -> Result<Message, ConeError>
pub async fn message_create( &self, cone_id: &ConeId, role: MessageRole, content: String, model_id: Option<String>, input_tokens: Option<i64>, output_tokens: Option<i64>, ) -> Result<Message, ConeError>
Create a message and return its ID
Sourcepub async fn message_create_ephemeral(
&self,
cone_id: &ConeId,
role: MessageRole,
content: String,
model_id: Option<String>,
input_tokens: Option<i64>,
output_tokens: Option<i64>,
) -> Result<Message, ConeError>
pub async fn message_create_ephemeral( &self, cone_id: &ConeId, role: MessageRole, content: String, model_id: Option<String>, input_tokens: Option<i64>, output_tokens: Option<i64>, ) -> Result<Message, ConeError>
Create an ephemeral message (marked for deletion) and return it
Sourcepub async fn message_get(
&self,
message_id: &MessageId,
) -> Result<Message, ConeError>
pub async fn message_get( &self, message_id: &MessageId, ) -> Result<Message, ConeError>
Get a message by ID
Sourcepub async fn resolve_message_handle(
&self,
identifier: &str,
) -> Result<Message, ConeError>
pub async fn resolve_message_handle( &self, identifier: &str, ) -> Result<Message, ConeError>
Resolve a message handle identifier to a Message Handle format: “msg-{message_id}:{role}:{name}”
Sourcepub fn message_to_handle(message: &Message, name: &str) -> Handle
pub fn message_to_handle(message: &Message, name: &str) -> Handle
Create a handle for a message
Format: {plugin_id}@1.0.0::chat:msg-{id}:{role}:{name}
Uses ConeHandle enum for type-safe handle creation.
Auto Trait Implementations§
impl Freeze for ConeStorage
impl !RefUnwindSafe for ConeStorage
impl Send for ConeStorage
impl Sync for ConeStorage
impl Unpin for ConeStorage
impl UnsafeUnpin for ConeStorage
impl !UnwindSafe for ConeStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more