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>
impl CodexAppServerClient<OwnedAppServerTransport>
pub fn spawn( config: &OwnedAppServerConfig, ) -> Result<Self, AppServerProcessError>
pub fn spawn_with_tool_policy( config: &OwnedAppServerConfig, tool_policy: CodexToolPolicy, ) -> Result<Self, AppServerProcessError>
Source§impl<T: AppServerLineTransport> CodexAppServerClient<T>
impl<T: AppServerLineTransport> CodexAppServerClient<T>
pub fn new( transport: T, operation_timeout: Duration, ) -> Result<Self, AppServerProcessError>
pub fn new_with_tool_policy( transport: T, operation_timeout: Duration, tool_policy: CodexToolPolicy, ) -> Result<Self, AppServerProcessError>
Sourcepub fn require_reviewed_cli_version(&mut self)
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.
Sourcepub fn require_app_server_version(
&mut self,
version: &str,
) -> Result<(), AppServerProcessError>
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.
pub fn initialize(&mut self) -> Result<(), AppServerProcessError>
pub fn discover( &mut self, ) -> Result<AppServerDiscoveryReceipt, AppServerProcessError>
pub fn start_turn( &mut self, client_message_id: &str, text: &str, model: &str, effort: ReasoningEffort, ) -> Result<ActiveCodexTurn, AppServerProcessError>
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>
pub fn wait_for_terminal( &mut self, turn: &ActiveCodexTurn, ) -> Result<TurnRunReceipt, AppServerProcessError>
Sourcepub fn wait_for_terminal_with_cancellation(
&mut self,
turn: &ActiveCodexTurn,
cancelled: impl Fn() -> bool,
) -> Result<TurnRunReceipt, AppServerProcessError>
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.
pub fn interrupt( &mut self, turn: &ActiveCodexTurn, ) -> Result<TurnRunReceipt, AppServerProcessError>
pub fn shutdown(&mut self) -> Result<ShutdownReceipt, AppServerProcessError>
pub fn into_transport(self) -> T
Trait Implementations§
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> 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