Skip to main content

CodexAppServerSession

Struct CodexAppServerSession 

Source
pub struct CodexAppServerSession {
    transport: Arc<AppServerTransport>,
    state: Mutex<SessionState>,
}

Fields§

§transport: Arc<AppServerTransport>§state: Mutex<SessionState>

Implementations§

Source§

impl CodexAppServerSession

Source

pub fn new(transport: Arc<AppServerTransport>) -> Self

Source

pub async fn start_thread( &self, options: ThreadStartOptions, timeout: Duration, ) -> Result<String, CodexAppServerProtocolError>

Source

pub async fn resume_thread( &self, thread_id: String, model: Option<String>, cwd: Option<String>, timeout: Duration, ) -> Result<String, CodexAppServerProtocolError>

Source

pub async fn start_turn( &self, text: String, timeout: Duration, ) -> Result<String, CodexAppServerProtocolError>

Source

pub async fn fork_thread( &self, options: ThreadForkOptions, timeout: Duration, ) -> Result<String, CodexAppServerProtocolError>

Fork the active thread without changing this session’s thread identity. The returned id is independent and must be persisted by the caller that creates the new AgentMux pane.

Source

pub async fn read_thread( &self, include_turns: bool, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Source

pub async fn list_threads( &self, options: ThreadListOptions, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Source

pub async fn archive_thread( &self, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Source

pub async fn compact_thread( &self, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Source

pub async fn read_account( &self, refresh_token: bool, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Verify the account selected by the caller’s isolated CODEX_HOME.

Source

pub async fn logout_account( &self, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Source

pub async fn login_account( &self, options: AccountLoginOptions, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Source

pub async fn cancel_login( &self, login_id: String, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Source

pub async fn steer_turn( &self, text: String, expected_turn_id: String, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Add input to the active turn only when the caller supplies the exact turn precondition. Ordinary queued messages should not call this API.

Source

pub async fn interrupt_turn( &self, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>

Interrupt the active turn. The turn remains active locally until its authoritative turn/completed notification arrives.

Source

fn active_turn(&self) -> Result<(String, String), CodexAppServerProtocolError>

Source

pub fn accept_server_request( &self, incoming: AppServerIncoming, ) -> Result<PendingServerRequest, CodexAppServerProtocolError>

Validate and queue a server request for an explicit UI/policy decision. No request is approved implicitly.

Source

pub async fn respond_server_request( &self, id: &RpcId, result: Result<Value, ServerResponseError>, timeout: Duration, ) -> Result<(), CodexAppServerProtocolError>

Send a decision for a queued request. The request remains pending if the transport write fails, allowing a retry; successful responses consume it.

Source

pub fn pending_server_requests(&self) -> Vec<PendingServerRequest>

Source

pub fn snapshot(&self) -> SessionSnapshot

Source

pub fn apply_incoming( &self, incoming: AppServerIncoming, ) -> Result<CodexAppServerEvent, CodexAppServerProtocolError>

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

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

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

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
§

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

§

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
§

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

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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