pub struct ClientConfig {
pub cli_bin: PathBuf,
pub process_env: HashMap<String, String>,
pub process_cwd: Option<PathBuf>,
pub app_server_args: Vec<String>,
pub compatibility_guard: CompatibilityGuard,
pub initialize_capabilities: InitializeCapabilities,
pub hooks: RuntimeHookConfig,
}Fields§
§cli_bin: PathBuf§process_env: HashMap<String, String>§process_cwd: Option<PathBuf>§app_server_args: Vec<String>§compatibility_guard: CompatibilityGuard§initialize_capabilities: InitializeCapabilities§hooks: RuntimeHookConfigImplementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn with_cli_bin(self, cli_bin: impl Into<PathBuf>) -> Self
pub fn with_cli_bin(self, cli_bin: impl Into<PathBuf>) -> Self
Override CLI executable path.
Sourcepub fn with_process_envs(
self,
process_env: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> Self
pub fn with_process_envs( self, process_env: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> Self
Replace process environment overrides for the spawned app-server child.
Sourcepub fn with_process_env(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_process_env( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Set one process environment override for the spawned app-server child.
Sourcepub fn with_process_cwd(self, process_cwd: impl Into<PathBuf>) -> Self
pub fn with_process_cwd(self, process_cwd: impl Into<PathBuf>) -> Self
Override the working directory used to spawn the app-server child process.
Sourcepub fn with_app_server_args(
self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_app_server_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Replace extra args appended after the fixed app-server subcommand.
Sourcepub fn with_app_server_arg(self, arg: impl Into<String>) -> Self
pub fn with_app_server_arg(self, arg: impl Into<String>) -> Self
Add one extra arg appended after the fixed app-server subcommand.
Sourcepub fn with_compatibility_guard(self, guard: CompatibilityGuard) -> Self
pub fn with_compatibility_guard(self, guard: CompatibilityGuard) -> Self
Override runtime compatibility guard policy.
Sourcepub fn without_compatibility_guard(self) -> Self
pub fn without_compatibility_guard(self) -> Self
Disable compatibility guard checks at connect time.
Sourcepub fn with_initialize_capabilities(
self,
initialize_capabilities: InitializeCapabilities,
) -> Self
pub fn with_initialize_capabilities( self, initialize_capabilities: InitializeCapabilities, ) -> Self
Override initialize capability switches.
Sourcepub fn enable_experimental_api(self) -> Self
pub fn enable_experimental_api(self) -> Self
Opt into Codex experimental app-server methods and fields.
Sourcepub fn with_hooks(self, hooks: RuntimeHookConfig) -> Self
pub fn with_hooks(self, hooks: RuntimeHookConfig) -> Self
Replace runtime hook configuration.
Sourcepub fn with_pre_hook(self, hook: Arc<dyn PreHook>) -> Self
pub fn with_pre_hook(self, hook: Arc<dyn PreHook>) -> Self
Register one pre hook on client runtime config.
Sourcepub fn with_post_hook(self, hook: Arc<dyn PostHook>) -> Self
pub fn with_post_hook(self, hook: Arc<dyn PostHook>) -> Self
Register one post hook on client runtime config.
Sourcepub fn with_pre_tool_use_hook(self, hook: Arc<dyn PreHook>) -> Self
pub fn with_pre_tool_use_hook(self, hook: Arc<dyn PreHook>) -> Self
Register one pre-tool-use hook on client runtime config. When at least one pre-tool-use hook is registered, the runtime manages the approval channel internally and auto-escalates ApprovalPolicy → Untrusted. Allocation: amortized O(1) push. Complexity: O(1).
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more