pub struct CodexClient { /* private fields */ }Implementations§
Source§impl CodexClient
impl CodexClient
pub async fn spawn_stdio(config: StdioConfig) -> Result<Self, ClientError>
pub async fn connect_ws(config: WsConfig) -> Result<Self, ClientError>
pub async fn start_ws( config: WsStartConfig, ) -> Result<WsServerHandle, ClientError>
pub async fn start_ws_daemon( config: WsStartConfig, ) -> Result<WsServerHandle, ClientError>
pub async fn start_ws_blocking( config: WsStartConfig, ) -> Result<WsServerHandle, ClientError>
pub async fn start_and_connect_ws(config: WsConfig) -> Result<Self, ClientError>
pub fn as_api(&self) -> Codex
pub fn start_thread(&self, options: ThreadOptions) -> Thread
pub fn resume_thread( &self, target: impl Into<ResumeThread>, options: ThreadOptions, ) -> Thread
pub fn resume_thread_by_id( &self, id: impl Into<String>, options: ThreadOptions, ) -> Thread
pub fn resume_latest_thread(&self, options: ThreadOptions) -> Thread
pub fn subscribe(&self) -> Receiver<ServerEvent>
pub async fn next_event(&self) -> Result<ServerEvent, ClientError>
pub async fn set_chatgpt_auth_tokens_refresh_handler<F, Fut>(&self, handler: F)where
F: Fn(ChatgptAuthTokensRefreshParams) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<ChatgptAuthTokensRefreshResponse, ClientError>> + Send + 'static,
pub async fn clear_chatgpt_auth_tokens_refresh_handler(&self)
pub async fn set_apply_patch_approval_handler<F, Fut>(&self, handler: F)where
F: Fn(ApplyPatchApprovalParams) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<ApplyPatchApprovalResponse, ClientError>> + Send + 'static,
pub async fn clear_apply_patch_approval_handler(&self)
pub async fn set_exec_command_approval_handler<F, Fut>(&self, handler: F)where
F: Fn(ExecCommandApprovalParams) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<ExecCommandApprovalResponse, ClientError>> + Send + 'static,
pub async fn clear_exec_command_approval_handler(&self)
pub async fn set_command_execution_request_approval_handler<F, Fut>(
&self,
handler: F,
)where
F: Fn(CommandExecutionRequestApprovalParams) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<CommandExecutionRequestApprovalResponse, ClientError>> + Send + 'static,
pub async fn clear_command_execution_request_approval_handler(&self)
pub async fn set_file_change_request_approval_handler<F, Fut>(&self, handler: F)where
F: Fn(FileChangeRequestApprovalParams) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<FileChangeRequestApprovalResponse, ClientError>> + Send + 'static,
pub async fn clear_file_change_request_approval_handler(&self)
pub async fn set_tool_request_user_input_handler<F, Fut>(&self, handler: F)where
F: Fn(ToolRequestUserInputParams) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<ToolRequestUserInputResponse, ClientError>> + Send + 'static,
pub async fn clear_tool_request_user_input_handler(&self)
pub async fn set_dynamic_tool_call_handler<F, Fut>(&self, handler: F)where
F: Fn(DynamicToolCallParams) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<DynamicToolCallResponse, ClientError>> + Send + 'static,
pub async fn clear_dynamic_tool_call_handler(&self)
pub async fn initialize( &self, params: InitializeParams, ) -> Result<InitializeResult, ClientError>
pub async fn initialized(&self) -> Result<(), ClientError>
pub async fn send_raw_request( &self, method: impl Into<String>, params: Value, timeout: Option<Duration>, ) -> Result<Value, ClientError>
pub async fn send_raw_notification( &self, method: impl Into<String>, params: Value, ) -> Result<(), ClientError>
pub async fn respond_server_request<R: Serialize>( &self, id: RequestId, result: R, ) -> Result<(), ClientError>
pub async fn respond_server_request_error( &self, id: RequestId, error: RpcError, ) -> Result<(), ClientError>
pub async fn respond_chatgpt_auth_tokens_refresh( &self, id: RequestId, response: ChatgptAuthTokensRefreshResponse, ) -> Result<(), ClientError>
pub async fn respond_apply_patch_approval( &self, id: RequestId, response: ApplyPatchApprovalResponse, ) -> Result<(), ClientError>
pub async fn respond_exec_command_approval( &self, id: RequestId, response: ExecCommandApprovalResponse, ) -> Result<(), ClientError>
pub async fn respond_command_execution_request_approval( &self, id: RequestId, response: CommandExecutionRequestApprovalResponse, ) -> Result<(), ClientError>
pub async fn respond_file_change_request_approval( &self, id: RequestId, response: FileChangeRequestApprovalResponse, ) -> Result<(), ClientError>
pub async fn respond_tool_request_user_input( &self, id: RequestId, response: ToolRequestUserInputResponse, ) -> Result<(), ClientError>
pub async fn respond_dynamic_tool_call( &self, id: RequestId, response: DynamicToolCallResponse, ) -> Result<(), ClientError>
pub async fn thread_start( &self, params: ThreadStartParams, ) -> Result<ThreadResult, ClientError>
pub async fn thread_resume( &self, params: ThreadResumeParams, ) -> Result<ThreadResult, ClientError>
pub async fn thread_fork( &self, params: ThreadForkParams, ) -> Result<ThreadResult, ClientError>
pub async fn thread_archive( &self, params: ThreadArchiveParams, ) -> Result<ThreadArchiveResult, ClientError>
pub async fn thread_name_set( &self, params: ThreadSetNameParams, ) -> Result<ThreadSetNameResult, ClientError>
pub async fn thread_unarchive( &self, params: ThreadUnarchiveParams, ) -> Result<ThreadUnarchiveResult, ClientError>
pub async fn thread_compact_start( &self, params: ThreadCompactStartParams, ) -> Result<ThreadCompactStartResult, ClientError>
pub async fn thread_background_terminals_clean( &self, params: ThreadBackgroundTerminalsCleanParams, ) -> Result<ThreadBackgroundTerminalsCleanResult, ClientError>
pub async fn thread_rollback( &self, params: ThreadRollbackParams, ) -> Result<ThreadRollbackResult, ClientError>
pub async fn thread_list( &self, params: ThreadListParams, ) -> Result<ThreadListResult, ClientError>
pub async fn thread_loaded_list( &self, params: ThreadLoadedListParams, ) -> Result<ThreadLoadedListResult, ClientError>
pub async fn thread_read( &self, params: ThreadReadParams, ) -> Result<ThreadReadResult, ClientError>
pub async fn skills_list( &self, params: SkillsListParams, ) -> Result<SkillsListResult, ClientError>
pub async fn skills_remote_list( &self, params: SkillsRemoteReadParams, ) -> Result<SkillsRemoteReadResult, ClientError>
pub async fn skills_remote_export( &self, params: SkillsRemoteWriteParams, ) -> Result<SkillsRemoteWriteResult, ClientError>
pub async fn app_list( &self, params: AppsListParams, ) -> Result<AppsListResult, ClientError>
pub async fn skills_config_write( &self, params: SkillsConfigWriteParams, ) -> Result<SkillsConfigWriteResult, ClientError>
pub async fn turn_start( &self, params: TurnStartParams, ) -> Result<TurnResult, ClientError>
pub async fn turn_steer( &self, params: TurnSteerParams, ) -> Result<TurnSteerResult, ClientError>
pub async fn turn_interrupt( &self, params: TurnInterruptParams, ) -> Result<EmptyObject, ClientError>
pub async fn review_start( &self, params: ReviewStartParams, ) -> Result<ReviewStartResult, ClientError>
pub async fn model_list( &self, params: ModelListParams, ) -> Result<ModelListResult, ClientError>
pub async fn experimental_feature_list( &self, params: ExperimentalFeatureListParams, ) -> Result<ExperimentalFeatureListResult, ClientError>
pub async fn collaboration_mode_list( &self, params: CollaborationModeListParams, ) -> Result<CollaborationModeListResult, ClientError>
pub async fn mock_experimental_method( &self, params: MockExperimentalMethodParams, ) -> Result<MockExperimentalMethodResult, ClientError>
pub async fn mcp_server_oauth_login( &self, params: McpServerOauthLoginParams, ) -> Result<McpServerOauthLoginResult, ClientError>
pub async fn mcp_server_status_list( &self, params: ListMcpServerStatusParams, ) -> Result<McpServerStatusListResult, ClientError>
pub async fn windows_sandbox_setup_start( &self, params: WindowsSandboxSetupStartParams, ) -> Result<WindowsSandboxSetupStartResult, ClientError>
pub async fn account_login_start( &self, params: LoginAccountParams, ) -> Result<LoginAccountResult, ClientError>
pub async fn account_login_cancel( &self, params: CancelLoginAccountParams, ) -> Result<EmptyObject, ClientError>
pub async fn feedback_upload( &self, params: FeedbackUploadParams, ) -> Result<FeedbackUploadResult, ClientError>
pub async fn command_exec( &self, params: CommandExecParams, ) -> Result<CommandExecResult, ClientError>
pub async fn config_read( &self, params: ConfigReadParams, ) -> Result<ConfigReadResult, ClientError>
pub async fn config_value_write( &self, params: ConfigValueWriteParams, ) -> Result<ConfigValueWriteResult, ClientError>
pub async fn config_batch_write( &self, params: ConfigBatchWriteParams, ) -> Result<ConfigBatchWriteResult, ClientError>
pub async fn account_read( &self, params: GetAccountParams, ) -> Result<GetAccountResult, ClientError>
pub async fn fuzzy_file_search_session_start( &self, params: FuzzyFileSearchSessionStartParams, ) -> Result<FuzzyFileSearchSessionStartResult, ClientError>
pub async fn fuzzy_file_search_session_update( &self, params: FuzzyFileSearchSessionUpdateParams, ) -> Result<FuzzyFileSearchSessionUpdateResult, ClientError>
pub async fn fuzzy_file_search_session_stop( &self, params: FuzzyFileSearchSessionStopParams, ) -> Result<FuzzyFileSearchSessionStopResult, ClientError>
pub async fn skills_remote_read( &self, params: SkillsRemoteReadParams, ) -> Result<SkillsRemoteReadResult, ClientError>
pub async fn skills_remote_write( &self, params: SkillsRemoteWriteParams, ) -> Result<SkillsRemoteWriteResult, ClientError>
pub async fn config_mcp_server_reload(&self) -> Result<EmptyObject, ClientError>
pub async fn account_logout(&self) -> Result<EmptyObject, ClientError>
pub async fn account_rate_limits_read( &self, ) -> Result<AccountRateLimitsReadResult, ClientError>
pub async fn config_requirements_read( &self, ) -> Result<ConfigRequirementsReadResult, ClientError>
Trait Implementations§
Source§impl Clone for CodexClient
impl Clone for CodexClient
Source§fn clone(&self) -> CodexClient
fn clone(&self) -> CodexClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CodexClient
impl !RefUnwindSafe for CodexClient
impl Send for CodexClient
impl Sync for CodexClient
impl Unpin for CodexClient
impl UnsafeUnpin for CodexClient
impl !UnwindSafe for CodexClient
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