Skip to main content

ReplBridgeOptions

Struct ReplBridgeOptions 

Source
pub struct ReplBridgeOptions {
Show 28 fields pub dir: String, pub machine_name: String, pub branch: String, pub git_repo_url: Option<String>, pub title: String, pub base_url: String, pub session_ingress_url: String, pub worker_type: String, pub get_access_token: Arc<dyn Fn() -> Option<String> + Send + Sync>, pub create_session: Arc<dyn Fn(String, String, Option<String>, String) -> Pin<Box<dyn Future<Output = Result<Option<String>, AgentError>> + Send>> + Send + Sync>, pub archive_session: Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Send + Sync>, pub get_current_title: Option<Arc<dyn Fn() -> String + Send + Sync>>, pub to_sdk_messages: Option<Arc<dyn Fn(Vec<Message>) -> Vec<SDKMessage> + Send + Sync>>, pub on_auth_401: Option<Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<bool, AgentError>> + Send>> + Send + Sync>>, pub get_poll_interval_config: Option<Arc<dyn Fn() -> PollIntervalConfig + Send + Sync>>, pub initial_history_cap: Option<u32>, pub initial_messages: Option<Vec<Message>>, pub previously_flushed_uuids: Option<Arc<dyn Fn() -> HashSet<String> + Send + Sync>>, pub on_inbound_message: Option<Arc<dyn Fn(SDKMessage) + Send + Sync>>, pub on_permission_response: Option<Arc<dyn Fn(BridgeControlResponse) + Send + Sync>>, pub on_interrupt: Option<Arc<dyn Fn() + Send + Sync>>, pub on_set_model: Option<Arc<dyn Fn(Option<String>) + Send + Sync>>, pub on_set_max_thinking_tokens: Option<Arc<dyn Fn(Option<u32>) + Send + Sync>>, pub on_set_permission_mode: Option<Arc<dyn Fn(PermissionMode) -> Result<(), String> + Send + Sync>>, pub on_state_change: Option<Arc<dyn Fn(BridgeState, Option<String>) + Send + Sync>>, pub on_user_message: Option<Arc<dyn Fn(String, String) -> bool + Send + Sync>>, pub perpetual: Option<bool>, pub initial_sse_sequence_num: Option<u64>,
}
Expand description

Options for initializing the REPL bridge.

Fields§

§dir: String

Current working directory.

§machine_name: String

Machine name.

§branch: String

Current git branch.

§git_repo_url: Option<String>

Git repo URL.

§title: String

Session title.

§base_url: String

Base API URL.

§session_ingress_url: String

Session ingress URL.

§worker_type: String

Worker type (e.g., “repl”, “daemon”).

§get_access_token: Arc<dyn Fn() -> Option<String> + Send + Sync>

Get the current OAuth access token.

§create_session: Arc<dyn Fn(String, String, Option<String>, String) -> Pin<Box<dyn Future<Output = Result<Option<String>, AgentError>> + Send>> + Send + Sync>

Create a new session.

§archive_session: Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Send + Sync>

Archive a session.

§get_current_title: Option<Arc<dyn Fn() -> String + Send + Sync>>

Get current session title (for reconnection).

§to_sdk_messages: Option<Arc<dyn Fn(Vec<Message>) -> Vec<SDKMessage> + Send + Sync>>

Convert internal messages to SDK format.

§on_auth_401: Option<Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<bool, AgentError>> + Send>> + Send + Sync>>

Handle OAuth 401 refresh.

§get_poll_interval_config: Option<Arc<dyn Fn() -> PollIntervalConfig + Send + Sync>>

Get poll interval config.

§initial_history_cap: Option<u32>

Max initial messages to replay on connect.

§initial_messages: Option<Vec<Message>>

Initial messages to flush on connect.

§previously_flushed_uuids: Option<Arc<dyn Fn() -> HashSet<String> + Send + Sync>>

Previously flushed UUIDs (for dedup).

§on_inbound_message: Option<Arc<dyn Fn(SDKMessage) + Send + Sync>>

Callback for inbound messages.

§on_permission_response: Option<Arc<dyn Fn(BridgeControlResponse) + Send + Sync>>

Callback for permission responses.

§on_interrupt: Option<Arc<dyn Fn() + Send + Sync>>

Callback for interrupt.

§on_set_model: Option<Arc<dyn Fn(Option<String>) + Send + Sync>>

Callback for model change.

§on_set_max_thinking_tokens: Option<Arc<dyn Fn(Option<u32>) + Send + Sync>>

Callback for max thinking tokens change.

§on_set_permission_mode: Option<Arc<dyn Fn(PermissionMode) -> Result<(), String> + Send + Sync>>

Callback for permission mode change.

§on_state_change: Option<Arc<dyn Fn(BridgeState, Option<String>) + Send + Sync>>

Callback for state changes.

§on_user_message: Option<Arc<dyn Fn(String, String) -> bool + Send + Sync>>

Callback for user messages (title derivation).

§perpetual: Option<bool>

Whether this is a perpetual (persistent) bridge.

§initial_sse_sequence_num: Option<u64>

Initial SSE sequence number (for daemon persistence).

Trait Implementations§

Source§

impl Clone for ReplBridgeOptions

Source§

fn clone(&self) -> ReplBridgeOptions

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
Source§

impl Default for ReplBridgeOptions

Source§

fn default() -> Self

Returns the “default value” for a type. 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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> TaskStateTrait for T
where T: Clone + 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

fn clone_box(&self) -> Box<dyn TaskStateTrait>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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