Skip to main content

Chat

Struct Chat 

Source
pub struct Chat { /* private fields */ }

Implementations§

Source§

impl Chat

Source

pub fn new(state: PathBuf, executable: PathBuf) -> Self

Source

pub fn discover(state: PathBuf) -> Self

Desktop discovers the packaged CLI when a session needs it, not at app startup.

Source

pub fn close(&self) -> impl Future<Output = ()> + use<>

Stop accepting work, cancel owned Chat turns and wait for their saved outcomes and ownership release. Verify Runs already admitted remain independent of Chat.

Source

pub async fn reconcile_interrupted(&self) -> Result<Vec<SessionId>, String>

Reconcile exact turn ownership after a process dies without a final change hint. Returns only sessions this observer actually reconciled.

Source

pub async fn default_model( &self, worktree: &Path, ) -> Result<Option<Model>, String>

The starting model for a new session: the worktree’s last available choice, or the first listed model in Settings order after every provider has answered.

Source

pub async fn default_model_for( &self, worktree: &Path, branch: Option<&Place>, ) -> Result<Option<Model>, String>

Source

pub async fn create( &self, worktree: &Path, selection: Option<Model>, ) -> Result<Session, String>

Persist an empty session, with no model unless one is explicitly selected.

Source

pub async fn create_for_branch( &self, workspace: &Path, branch: Option<&Place>, selection: Option<Model>, ) -> Result<Session, String>

Create only on the checkout the person selected, not a branch switched in meanwhile.

Source

pub async fn branches( &self, launch: Option<&Path>, ) -> Result<BranchListing, String>

Discover the live choices used by the Chat branch picker, independently of Verify search.

Source

pub async fn set_worktree( &self, id: &SessionId, worktree: &Path, launch: Option<&Path>, ) -> Result<Session, MoveError>

Rebind the saved conversation to a live choice, excluding active turns in any process.

Source

pub async fn list( &self, worktree: Option<&Path>, query: Option<&str>, ) -> Result<Vec<Session>, String>

Keep the catalog’s activity order while matching every word across its displayed labels.

Source

pub async fn latest_for_unavailable_checkout( &self, workspace: &Path, ) -> Result<Option<Session>, String>

Find a conversation by its former checkout, including a workspace within the worktree.

Source

pub async fn latest_for_branch( &self, branch: &Place, ) -> Result<Option<Session>, String>

The most recently active saved session on this branch, even if its checkout is gone.

Source

pub async fn latest_for_navigation( &self, branch: &Place, ) -> Result<Option<Session>, String>

Prefer the newest usable session for branch navigation. If the checkout moved and none can work on it, keep the newest saved conversation reachable with its diagnostic.

Source

pub async fn latest_available_for_branch( &self, branch: &Place, ) -> Result<Option<Session>, String>

The latest session whose exact checkout can be worked on now.

Source

pub async fn current_worktree( &self, branch: &Place, ) -> Result<Option<PathBuf>, String>

The oldest usable checkout anchors Current when there is no Verify workspace. Activity in a newer session must not redirect scans, edits or tools.

Source

pub async fn set_view( &self, id: &SessionId, view: SessionView, ) -> Result<Session, String>

Save a view without changing the session’s activity order or requiring a live checkout.

Source

pub async fn mark_seen(&self, id: &SessionId) -> Result<(), String>

Acknowledge the latest settled outcome without changing the session’s activity order. A turn still running will become unseen when it settles, even if this is called now.

Source

pub fn transcript_size(&self, id: &SessionId) -> Option<u64>

Chat records are append-only. Readers can detect a missed hint without parsing a transcript, with None covering a session that has not yet accepted a turn.

Source

pub async fn open(&self, id: &SessionId) -> Result<View, String>

The model’s streamed text, tools, and current state of each referenced Run.

Source

pub async fn set_model( &self, id: &SessionId, selection: Model, ) -> Result<Session, String>

Save a selection for the next turn without adding a message. An accepted turn keeps the selection it started with, even if the user changes the model while it streams.

Source

pub async fn send( &self, id: &SessionId, text: String, selection: Option<Model>, ) -> Result<(), SendError>

Start a durable turn and return as soon as it has an accepted user message. The recorder notifies SessionInvalidated(id) as text, tool outcomes and Run references arrive.

Source

pub async fn stop(&self, id: &SessionId) -> Result<bool, String>

Stop the active turn, even if another app owns it. Accepted Verify Runs are independent.

Source

pub async fn stop_running(&self) -> Result<(), StopRunningError>

The desktop’s quit prompt names every running Chat. Deliver the same Stop to those turns even when another process owns them, before the desktop window closes.

Trait Implementations§

Source§

impl Clone for Chat

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Forget for Chat

§

impl Freeze for Chat

§

impl Move for Chat

§

impl RefUnwindSafe for Chat

§

impl Send for Chat

§

impl Sync for Chat

§

impl Unpin for Chat

§

impl UnsafeUnpin for Chat

§

impl UnwindSafe for Chat

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<T> WasmCompatSend for T
where T: Send,

Source§

impl<T> WasmCompatSync for T
where T: Sync,

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