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
impl InProcessBackend
Sourcepub fn new(runtime: Arc<AgentSessionRuntime>) -> Self
pub fn new(runtime: Arc<AgentSessionRuntime>) -> Self
Wraps runtime.
Sourcepub fn with_server_info(
runtime: Arc<AgentSessionRuntime>,
server: ServerInfo,
) -> Self
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).
Sourcepub fn runtime(&self) -> &Arc<AgentSessionRuntime> ⓘ
pub fn runtime(&self) -> &Arc<AgentSessionRuntime> ⓘ
The runtime.
Sourcepub fn state(&self) -> RpcSessionState
pub fn state(&self) -> RpcSessionState
Returns the state.
Trait Implementations§
Source§impl Debug for InProcessBackend
impl Debug for InProcessBackend
Source§impl SessionBackend for InProcessBackend
impl SessionBackend for InProcessBackend
Source§fn events(&self) -> BoxStream<'static, ClientEvent>
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, ()>
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>>
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>>
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)
fn ui_respond(&self, response: UiResponse)
Answers a dialog (
extension_ui_response); idempotent, first answer wins.Source§fn session_id(&self) -> String
fn session_id(&self) -> String
Current session id.
Auto Trait Implementations§
impl !RefUnwindSafe for InProcessBackend
impl !UnwindSafe for InProcessBackend
impl Freeze for InProcessBackend
impl Send for InProcessBackend
impl Sync for InProcessBackend
impl Unpin for InProcessBackend
impl UnsafeUnpin for InProcessBackend
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
Source§impl<B> FrontendApi for Bwhere
B: SessionBackend + ?Sized,
impl<B> FrontendApi for Bwhere
B: SessionBackend + ?Sized,
Source§fn completions(
&self,
text: &str,
cursor: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompletionGroup>, ClientError>> + Send + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
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 + '_>>
fn extensions( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExtensionInfo>, ClientError>> + Send + '_>>
_oino/extensions.