Skip to main content

ConeStorage

Struct ConeStorage 

Source
pub struct ConeStorage { /* private fields */ }
Expand description

Storage layer for cone configurations

Implementations§

Source§

impl ConeStorage

Source

pub async fn new( config: ConeStorageConfig, arbor: Arc<ArborStorage>, ) -> Result<Self, ConeError>

Create a new cone storage instance with a shared Arbor storage

Source

pub fn arbor(&self) -> &ArborStorage

Get access to the underlying arbor storage

Source

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…”

Source

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).

Source

pub async fn cone_get(&self, cone_id: &ConeId) -> Result<ConeConfig, ConeError>

Get a cone by ID

Source

pub async fn cone_get_by_identifier( &self, identifier: &ConeIdentifier, ) -> Result<ConeConfig, ConeError>

Get a cone by identifier (name or UUID)

Source

pub async fn cone_list(&self) -> Result<Vec<ConeInfo>, ConeError>

List all cones

Source

pub async fn cone_update_head( &self, cone_id: &ConeId, new_head: NodeId, ) -> Result<(), ConeError>

Update cone’s canonical head

Source

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

Source

pub async fn cone_delete(&self, cone_id: &ConeId) -> Result<(), ConeError>

Delete an cone (does not delete the tree)

Source

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

Source

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

Source

pub async fn message_get( &self, message_id: &MessageId, ) -> Result<Message, ConeError>

Get a message by ID

Source

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}”

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> MaybeSend for T
where T: Send,