Skip to main content

AppServer

Struct AppServer 

Source
pub struct AppServer { /* private fields */ }
Expand description

Thin, explicit JSON-RPC facade for codex app-server.

  • request_json / notify_json: validated calls for known methods.
  • request_typed / notify_typed: typed wrappers with contract validation.
  • *_unchecked: bypass contract checks for experimental/custom methods.
  • server request loop is exposed directly for approval/user-input workflows.

Implementations§

Source§

impl AppServer

Source

pub async fn connect(config: ClientConfig) -> Result<Self, ClientError>

Connect app-server with explicit config.

Source

pub async fn connect_default() -> Result<Self, ClientError>

Connect app-server with default runtime discovery.

Source

pub async fn request_json( &self, method: &str, params: Value, ) -> Result<Value, RpcError>

Validated JSON-RPC request for known methods.

Source

pub async fn request_json_with_mode( &self, method: &str, params: Value, mode: RpcValidationMode, ) -> Result<Value, RpcError>

JSON-RPC request with explicit validation mode.

Source

pub async fn request_typed<P, R>( &self, method: &str, params: P, ) -> Result<R, RpcError>

Typed JSON-RPC request for known methods.

Source

pub async fn request_typed_with_mode<P, R>( &self, method: &str, params: P, mode: RpcValidationMode, ) -> Result<R, RpcError>

Typed JSON-RPC request with explicit validation mode.

Source

pub async fn request_json_unchecked( &self, method: &str, params: Value, ) -> Result<Value, RpcError>

Unchecked JSON-RPC request. Use for experimental/custom methods where strict contracts are not fixed yet.

Source

pub async fn skills_list( &self, params: SkillsListParams, ) -> Result<SkillsListResponse, RpcError>

Typed helper for skills/list.

Source

pub async fn command_exec( &self, params: CommandExecParams, ) -> Result<CommandExecResponse, RpcError>

Typed helper for command/exec.

Source

pub async fn command_exec_write( &self, params: CommandExecWriteParams, ) -> Result<CommandExecWriteResponse, RpcError>

Typed helper for command/exec/write.

Source

pub async fn command_exec_resize( &self, params: CommandExecResizeParams, ) -> Result<CommandExecResizeResponse, RpcError>

Typed helper for command/exec/resize.

Source

pub async fn command_exec_terminate( &self, params: CommandExecTerminateParams, ) -> Result<CommandExecTerminateResponse, RpcError>

Typed helper for command/exec/terminate.

Source

pub async fn notify_json( &self, method: &str, params: Value, ) -> Result<(), RuntimeError>

Validated JSON-RPC notification for known methods.

Source

pub async fn notify_json_with_mode( &self, method: &str, params: Value, mode: RpcValidationMode, ) -> Result<(), RuntimeError>

JSON-RPC notification with explicit validation mode.

Source

pub async fn notify_typed<P>( &self, method: &str, params: P, ) -> Result<(), RuntimeError>
where P: Serialize,

Typed JSON-RPC notification for known methods.

Source

pub async fn notify_typed_with_mode<P>( &self, method: &str, params: P, mode: RpcValidationMode, ) -> Result<(), RuntimeError>
where P: Serialize,

Typed JSON-RPC notification with explicit validation mode.

Source

pub async fn notify_json_unchecked( &self, method: &str, params: Value, ) -> Result<(), RuntimeError>

Unchecked JSON-RPC notification.

Source

pub async fn take_server_requests( &self, ) -> Result<ServerRequestRx, RuntimeError>

Take exclusive server-request stream receiver.

This enables explicit handling of approval / requestUserInput / tool-call cycles.

Source

pub async fn respond_server_request_ok( &self, approval_id: &str, result: Value, ) -> Result<(), RuntimeError>

Reply success payload for one server request.

Source

pub async fn respond_server_request_err( &self, approval_id: &str, err: RpcErrorObject, ) -> Result<(), RuntimeError>

Reply error payload for one server request.

Source

pub fn runtime(&self) -> &Runtime

Borrow server runtime for full low-level control.

Source

pub fn client(&self) -> &Client

Borrow underlying connected client.

Source

pub async fn shutdown(&self) -> Result<(), RuntimeError>

Explicit shutdown.

Trait Implementations§

Source§

impl Clone for AppServer

Source§

fn clone(&self) -> AppServer

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more

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
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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