Skip to main content

InProcessBackend

Struct InProcessBackend 

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

A SessionBackend over a live runtime in this process.

Runtime-agnostic (GA-40): commands awaited from a non-tokio executor (GPUI) run on the tokio runtime the backend was created on.

Implementations§

Source§

impl InProcessBackend

Source

pub fn new(runtime: Arc<AgentSessionRuntime>) -> Self

Wraps runtime.

Source

pub fn with_server_info( runtime: Arc<AgentSessionRuntime>, server: ServerInfo, ) -> Self

Wraps runtime, reporting server from _oino/hello. Commands awaited outside a tokio runtime run on the runtime current here (or the session’s own runtime).

Source

pub fn runtime(&self) -> &Arc<AgentSessionRuntime> ⓘ

The runtime.

Source

pub fn state(&self) -> RpcSessionState

Returns the state.

Trait Implementations§

Source§

impl Debug for InProcessBackend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SessionBackend for InProcessBackend

Source§

fn events(&self) -> BoxStream<'static, ClientEvent>

Events of the current session; streams follow session replacements made through this backend and end after SessionBackend::shutdown.

Source§

fn shutdown_requested(&self) -> BoxFuture<'static, ()>

Resolves once an extension called ctx.shutdown() and the session is idle.

Source§

fn send( &self, command: RpcCommand, ) -> BoxFuture<'_, Result<RpcResponseData, ClientError>>

Any agent session or _oino/* command; returns the response data.
Source§

fn send_with_id( &self, request_id: Option<String>, command: RpcCommand, ) -> BoxFuture<'_, Result<RpcResponseData, ClientError>>

SessionBackend::send with the RPC request id; bash streams bash_execution_update{id} with it (the command id goes to executeBash).
Source§

fn ui_respond(&self, response: UiResponse)

Answers a dialog (extension_ui_response); idempotent, first answer wins.
Source§

fn session_id(&self) -> String

Current session id.
Source§

fn shutdown(&self) -> BoxFuture<'_, ()>

Orderly shutdown (session_shutdown{reason:"quit"}); later commands fail with ClientError::Closed.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<B> FrontendApi for B
where B: SessionBackend + ?Sized,

Source§

fn completions( &self, text: &str, cursor: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<CompletionGroup>, ClientError>> + Send + '_>>

_oino/get_completions.
Source§

fn ui_action( &self, panel_id: &str, action_id: &str, value: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/ui_action (v1 shape; the v2 payload rides the same command).
Source§

fn ui_visible( &self, entry_id: &str, visible: bool, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/ui_visible: report an entry visible/hidden in this frontend (ui-protocol §6.5); core aggregates and sends $show/$hide.
Source§

fn ui_resync( &self, rev: u64, ) -> Pin<Box<dyn Future<Output = Result<Value, ClientError>> + Send + '_>>

_oino/ui_resync: a fresh registry snapshot after a rev gap (§9.2).
Source§

fn editor_event( &self, event: EditorEvent, ) -> Pin<Box<dyn Future<Output = Result<bool, ClientError>> + Send + '_>>

_oino/editor_event → whether an extension consumed it.
Source§

fn invoke_shortcut( &self, id: &str, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/invoke_shortcut.
Source§

fn shortcuts( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ShortcutInfo>, ClientError>> + Send + '_>>

_oino/get_shortcuts.
Source§

fn settings_schema( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, ClientError>> + Send + '_>>

_oino/get_settings_schema (ui-protocol §6.6 namespaces).
Source§

fn extension_settings( &self, namespace: &str, layer: SettingsLayer, ) -> Pin<Box<dyn Future<Output = Result<Value, ClientError>> + Send + '_>>

_oino/get_extension_settings.
Source§

fn set_extension_setting( &self, namespace: &str, key: &str, value: Option<Value>, scope: SettingsScope, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/set_extension_setting (None deletes).
Source§

fn settings( &self, ) -> Pin<Box<dyn Future<Output = Result<Value, ClientError>> + Send + '_>>

_oino/get_settings (merged core settings).
Source§

fn set_setting( &self, key: &str, value: Option<Value>, scope: SettingsScope, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/set_setting (None deletes).
Source§

fn service_call( &self, target: Option<&str>, name: &str, payload: Value, ) -> Pin<Box<dyn Future<Output = Result<Value, ClientError>> + Send + '_>>

_oino/service_call.
Source§

fn auth_providers( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<AuthProviderInfo>, ClientError>> + Send + '_>>

_oino/auth_providers.
Source§

fn login( &self, provider: &str, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/login (runs the OAuth flow; resolves when it finished).
Source§

fn logout( &self, provider: &str, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/logout.
Source§

fn set_api_key( &self, provider: &str, key: &str, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/set_api_key.
Source§

fn topics( &self, subscribe: &[&str], unsubscribe: &[&str], ) -> Pin<Box<dyn Future<Output = Result<Vec<TopicValue>, ClientError>> + Send + '_>>

_oino/topics: changes the subscription; returns the sticky values it now matches.
Source§

fn bus_get( &self, topic: &str, ) -> Pin<Box<dyn Future<Output = Result<Option<Value>, ClientError>> + Send + '_>>

_oino/bus_get: last sticky value of topic.
Source§

fn agents( &self, follow: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<AgentTree, ClientError>> + Send + '_>>

_oino/agents: the nested-agent tree; follow toggles agent_event forwarding.
Source§

fn agent_messages( &self, agent_id: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentMessage>, ClientError>> + Send + '_>>

_oino/agent_messages: transcript of one nested agent.
Source§

fn agent_abort( &self, agent_id: &str, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/agent_abort.
Source§

fn queue_edit( &self, edit: QueueEdit, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/queue_edit.
Source§

fn queue_remove( &self, queue: QueueKind, index: usize, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/queue_edit{op: remove}.
Source§

fn queue_send_now( &self, queue: QueueKind, index: usize, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/queue_edit{op: sendNow}.
Source§

fn queue_move( &self, queue: QueueKind, from: usize, to: usize, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/queue_edit{op: move}.
Source§

fn queue_set_text( &self, queue: QueueKind, index: usize, text: &str, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/queue_edit{op: edit}.
Source§

fn checkpoints( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Checkpoint>, ClientError>> + Send + '_>>

_oino/checkpoints.
Source§

fn rewind( &self, entry_id: &str, options: RewindOptions, ) -> Pin<Box<dyn Future<Output = Result<RewindResult, ClientError>> + Send + '_>>

_oino/rewind.
Source§

fn running_bash( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<RunningBash>, ClientError>> + Send + '_>>

_oino/running_bash.
Source§

fn extensions( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExtensionInfo>, ClientError>> + Send + '_>>

_oino/extensions.
Source§

fn render( &self, request: RenderRow, ) -> Pin<Box<dyn Future<Output = Result<Option<Value>, ClientError>> + Send + '_>>

_oino/render: the OUS node an extension renders for one transcript row, or None (ui-protocol §6.4; built-in tool rows included).
Source§

fn set_extension_enabled( &self, id: &str, enabled: bool, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + '_>>

_oino/set_extension_enabled.
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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