Skip to main content

ClientRpcSessions

Struct ClientRpcSessions 

Source
pub struct ClientRpcSessions<'a> { /* private fields */ }
Expand description

sessions.* RPCs.

Implementations§

Source§

impl<'a> ClientRpcSessions<'a>

Source

pub async fn fork( &self, params: SessionsForkRequest, ) -> Result<SessionsForkResult, Error>

Creates a new session by forking persisted history from an existing session.

Wire method: sessions.fork.

§Parameters
  • params - Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session.
§Returns

Identifier and optional friendly name assigned to the newly forked session.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn connect( &self, params: ConnectRemoteSessionParams, ) -> Result<RemoteSessionConnectionResult, Error>

Connects to an existing remote session and exposes it as an SDK session.

Wire method: sessions.connect.

§Parameters
  • params - Remote session connection parameters.
§Returns

Remote session connection result.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn list(&self) -> Result<SessionList, Error>

Lists persisted sessions, optionally filtered by working-directory context.

Wire method: sessions.list.

§Returns

Persisted sessions matching the filter, ordered most-recently-modified first.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn list_with_params( &self, params: SessionsListRequest, ) -> Result<SessionList, Error>

Lists persisted sessions, optionally filtered by working-directory context.

Wire method: sessions.list.

§Parameters
  • params - Optional metadata-load limit and context filter applied to the returned sessions.
§Returns

Persisted sessions matching the filter, ordered most-recently-modified first.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn find_by_task_id( &self, params: SessionsFindByTaskIDRequest, ) -> Result<SessionsFindByTaskIDResult, Error>

Finds the local session bound to a GitHub task ID, if any.

Wire method: sessions.findByTaskId.

§Parameters
  • params - GitHub task ID to look up.
§Returns

ID of the local session bound to the given GitHub task, or omitted when none.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn find_by_prefix( &self, params: SessionsFindByPrefixRequest, ) -> Result<SessionsFindByPrefixResult, Error>

Resolves a UUID prefix to a unique session ID, if exactly one session matches.

Wire method: sessions.findByPrefix.

§Parameters
  • params - UUID prefix to resolve to a unique session ID.
§Returns

Session ID matching the prefix, omitted when no unique match exists.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn get_last_for_context( &self, params: SessionsGetLastForContextRequest, ) -> Result<SessionsGetLastForContextResult, Error>

Returns the most-relevant prior session for a given working-directory context.

Wire method: sessions.getLastForContext.

§Parameters
  • params - Optional working-directory context used to score session relevance.
§Returns

Most-relevant session ID for the supplied context, or omitted when no sessions exist.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn get_event_file_path( &self, params: SessionsGetEventFilePathRequest, ) -> Result<SessionsGetEventFilePathResult, Error>

Computes the absolute path to a session’s persisted events.jsonl file.

Wire method: sessions.getEventFilePath.

§Parameters
  • params - Session ID whose event-log file path to compute.
§Returns

Absolute path to the session’s events.jsonl file on disk.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn get_sizes(&self) -> Result<SessionSizes, Error>

Returns the on-disk byte size of each session’s workspace directory.

Wire method: sessions.getSizes.

§Returns

Map of sessionId -> on-disk size in bytes for each session’s workspace directory.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn check_in_use( &self, params: SessionsCheckInUseRequest, ) -> Result<SessionsCheckInUseResult, Error>

Returns the subset of the supplied session IDs that are currently held by another running process.

Wire method: sessions.checkInUse.

§Parameters
  • params - Session IDs to test for live in-use locks.
§Returns

Session IDs from the input set that are currently in use by another process.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn get_persisted_remote_steerable( &self, params: SessionsGetPersistedRemoteSteerableRequest, ) -> Result<SessionsGetPersistedRemoteSteerableResult, Error>

Returns a session’s persisted remote-steerable flag, if any has been recorded.

Wire method: sessions.getPersistedRemoteSteerable.

§Parameters
  • params - Session ID to look up the persisted remote-steerable flag for.
§Returns

The session’s persisted remote-steerable flag, or omitted when no value has been persisted.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn close( &self, params: SessionsCloseRequest, ) -> Result<SessionsCloseResult, Error>

Closes a session: emits shutdown, flushes pending events, releases the in-use lock, and disposes the active session.

Wire method: sessions.close.

§Parameters
  • params - Session ID to close.
§Returns

Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn bulk_delete( &self, params: SessionsBulkDeleteRequest, ) -> Result<SessionBulkDeleteResult, Error>

Closes, deactivates, and deletes a set of sessions, returning the bytes freed per session.

Wire method: sessions.bulkDelete.

§Parameters
  • params - Session IDs to close, deactivate, and delete from disk.
§Returns

Map of sessionId -> bytes freed by removing the session’s workspace directory.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn prune_old( &self, params: SessionsPruneOldRequest, ) -> Result<SessionPruneResult, Error>

Deletes sessions older than the given threshold, with optional dry-run and exclusion list.

Wire method: sessions.pruneOld.

§Parameters
  • params - Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true).
§Returns

Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn save( &self, params: SessionsSaveRequest, ) -> Result<SessionsSaveResult, Error>

Flushes a session’s pending events to disk.

Wire method: sessions.save.

§Parameters
  • params - Session ID whose pending events should be flushed to disk.
§Returns

Flush a session’s pending events to disk. No-op when no writer exists for the session (e.g., already closed).

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn release_lock( &self, params: SessionsReleaseLockRequest, ) -> Result<SessionsReleaseLockResult, Error>

Releases the in-use lock held by this process for a session.

Wire method: sessions.releaseLock.

§Parameters
  • params - Session ID whose in-use lock should be released.
§Returns

Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn enrich_metadata( &self, params: SessionsEnrichMetadataRequest, ) -> Result<SessionEnrichMetadataResult, Error>

Backfills missing summary and context fields on the supplied session metadata records.

Wire method: sessions.enrichMetadata.

§Parameters
  • params - Session metadata records to enrich with summary and context information.
§Returns

The same metadata records, with summary and context fields backfilled where available.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn reload_plugin_hooks( &self, params: SessionsReloadPluginHooksRequest, ) -> Result<SessionsReloadPluginHooksResult, Error>

Reloads user, plugin, and (optionally) repo hooks on the active session.

Wire method: sessions.reloadPluginHooks.

§Parameters
  • params - Active session ID and an optional flag for deferring repo-level hooks until folder trust.
§Returns

Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn load_deferred_repo_hooks( &self, params: SessionsLoadDeferredRepoHooksRequest, ) -> Result<SessionLoadDeferredRepoHooksResult, Error>

Loads previously-deferred repo-level hooks on the active session, returning queued startup prompts.

Wire method: sessions.loadDeferredRepoHooks.

§Parameters
  • params - Active session ID whose deferred repo-level hooks should be loaded.
§Returns

Queued repo-level startup prompts and the total hook command count after loading.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Source

pub async fn set_additional_plugins( &self, params: SessionsSetAdditionalPluginsRequest, ) -> Result<SessionsSetAdditionalPluginsResult, Error>

Replaces the manager-wide additional plugins registered with the session manager.

Wire method: sessions.setAdditionalPlugins.

§Parameters
  • params - Manager-wide additional plugins to register; replaces any previously-configured set.
§Returns

Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload.

Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.

Trait Implementations§

Source§

impl<'a> Clone for ClientRpcSessions<'a>

Source§

fn clone(&self) -> ClientRpcSessions<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for ClientRpcSessions<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ClientRpcSessions<'a>

§

impl<'a> !RefUnwindSafe for ClientRpcSessions<'a>

§

impl<'a> Send for ClientRpcSessions<'a>

§

impl<'a> Sync for ClientRpcSessions<'a>

§

impl<'a> Unpin for ClientRpcSessions<'a>

§

impl<'a> UnsafeUnpin for ClientRpcSessions<'a>

§

impl<'a> !UnwindSafe for ClientRpcSessions<'a>

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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