Skip to main content

CodexAppServerClient

Struct CodexAppServerClient 

Source
pub struct CodexAppServerClient<T: AppServerLineTransport> { /* private fields */ }
Expand description

Drives the pure transcript state machine through an injected line transport.

Implementations§

Source§

impl CodexAppServerClient<OwnedAppServerTransport>

Source§

impl<T: AppServerLineTransport> CodexAppServerClient<T>

Source

pub fn new( transport: T, operation_timeout: Duration, ) -> Result<Self, AppServerProcessError>

Source

pub fn new_with_tool_policy( transport: T, operation_timeout: Duration, tool_policy: CodexToolPolicy, ) -> Result<Self, AppServerProcessError>

Source

pub fn require_reviewed_cli_version(&mut self)

Require the exact reviewed standalone CLI version during initialize. Injected transcript transports use this same guard as owned processes.

Source

pub fn require_app_server_version( &mut self, version: &str, ) -> Result<(), AppServerProcessError>

Requires the already pinned executable’s reviewed app-server version. This is intentionally a closed string supplied by the owned-child configuration, never by a provider response or request payload.

Source

pub fn initialize(&mut self) -> Result<(), AppServerProcessError>

Source

pub fn discover( &mut self, ) -> Result<AppServerDiscoveryReceipt, AppServerProcessError>

Source

pub fn start_turn( &mut self, client_message_id: &str, text: &str, model: &str, effort: ReasoningEffort, ) -> Result<ActiveCodexTurn, AppServerProcessError>

Source

pub fn start_turn_with_instructions( &mut self, client_message_id: &str, text: &str, base_instructions: Option<&str>, developer_instructions: Option<&str>, model: &str, effort: ReasoningEffort, ) -> Result<ActiveCodexTurn, AppServerProcessError>

Source

pub fn wait_for_terminal( &mut self, turn: &ActiveCodexTurn, ) -> Result<TurnRunReceipt, AppServerProcessError>

Source

pub fn wait_for_terminal_with_cancellation( &mut self, turn: &ActiveCodexTurn, cancelled: impl Fn() -> bool, ) -> Result<TurnRunReceipt, AppServerProcessError>

Wait for a terminal while honoring the caller’s one cancellation authority. Cancellation after turn/start sends turn/interrupt on the same owned client and joins the terminal lifecycle before returning.

Source

pub fn interrupt( &mut self, turn: &ActiveCodexTurn, ) -> Result<TurnRunReceipt, AppServerProcessError>

Source

pub fn shutdown(&mut self) -> Result<ShutdownReceipt, AppServerProcessError>

Source

pub fn into_transport(self) -> T

Trait Implementations§

Source§

impl<T: AppServerLineTransport> Debug for CodexAppServerClient<T>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for CodexAppServerClient<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for CodexAppServerClient<T>
where T: RefUnwindSafe,

§

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

§

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

§

impl<T> Unpin for CodexAppServerClient<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for CodexAppServerClient<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for CodexAppServerClient<T>
where T: UnwindSafe,

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, 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> 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 = !

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.