pub struct CodexAppServerSession {
transport: Arc<AppServerTransport>,
state: Mutex<SessionState>,
}Fields§
§transport: Arc<AppServerTransport>§state: Mutex<SessionState>Implementations§
Source§impl CodexAppServerSession
impl CodexAppServerSession
pub fn new(transport: Arc<AppServerTransport>) -> Self
pub async fn start_thread( &self, options: ThreadStartOptions, timeout: Duration, ) -> Result<String, CodexAppServerProtocolError>
pub async fn resume_thread( &self, thread_id: String, model: Option<String>, cwd: Option<String>, timeout: Duration, ) -> Result<String, CodexAppServerProtocolError>
pub async fn start_turn( &self, text: String, timeout: Duration, ) -> Result<String, CodexAppServerProtocolError>
Sourcepub async fn fork_thread(
&self,
options: ThreadForkOptions,
timeout: Duration,
) -> Result<String, CodexAppServerProtocolError>
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.
pub async fn read_thread( &self, include_turns: bool, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>
pub async fn list_threads( &self, options: ThreadListOptions, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>
pub async fn archive_thread( &self, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>
pub async fn compact_thread( &self, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>
Sourcepub async fn read_account(
&self,
refresh_token: bool,
timeout: Duration,
) -> Result<Value, CodexAppServerProtocolError>
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.
pub async fn logout_account( &self, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>
pub async fn login_account( &self, options: AccountLoginOptions, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>
pub async fn cancel_login( &self, login_id: String, timeout: Duration, ) -> Result<Value, CodexAppServerProtocolError>
Sourcepub async fn steer_turn(
&self,
text: String,
expected_turn_id: String,
timeout: Duration,
) -> Result<Value, CodexAppServerProtocolError>
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.
Sourcepub async fn interrupt_turn(
&self,
timeout: Duration,
) -> Result<Value, CodexAppServerProtocolError>
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.
fn active_turn(&self) -> Result<(String, String), CodexAppServerProtocolError>
Sourcepub fn accept_server_request(
&self,
incoming: AppServerIncoming,
) -> Result<PendingServerRequest, CodexAppServerProtocolError>
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.
Sourcepub async fn respond_server_request(
&self,
id: &RpcId,
result: Result<Value, ServerResponseError>,
timeout: Duration,
) -> Result<(), CodexAppServerProtocolError>
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.
pub fn pending_server_requests(&self) -> Vec<PendingServerRequest>
pub fn snapshot(&self) -> SessionSnapshot
pub fn apply_incoming( &self, incoming: AppServerIncoming, ) -> Result<CodexAppServerEvent, CodexAppServerProtocolError>
Auto Trait Implementations§
impl !Freeze for CodexAppServerSession
impl !RefUnwindSafe for CodexAppServerSession
impl !UnwindSafe for CodexAppServerSession
impl Send for CodexAppServerSession
impl Sync for CodexAppServerSession
impl Unpin for CodexAppServerSession
impl UnsafeUnpin for CodexAppServerSession
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
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn 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>
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)
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)
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
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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 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> ⓘ
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