pub struct SessionRpcWorkspaces<'a> { /* private fields */ }Expand description
session.workspaces.* RPCs.
Implementations§
Source§impl<'a> SessionRpcWorkspaces<'a>
impl<'a> SessionRpcWorkspaces<'a>
Sourcepub async fn get_workspace(&self) -> Result<WorkspacesGetWorkspaceResult, Error>
pub async fn get_workspace(&self) -> Result<WorkspacesGetWorkspaceResult, Error>
Gets current workspace metadata for the session.
Wire method: session.workspaces.getWorkspace.
§Returns
Current workspace metadata for the session, including its absolute filesystem path when 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.
Sourcepub async fn update_metadata(
&self,
params: WorkspacesUpdateMetadataRequest,
) -> Result<WorkspacesGetWorkspaceResult, Error>
pub async fn update_metadata( &self, params: WorkspacesUpdateMetadataRequest, ) -> Result<WorkspacesGetWorkspaceResult, Error>
Updates workspace metadata for a local session and returns the refreshed workspace.
Wire method: session.workspaces.updateMetadata.
§Parameters
params- Workspace metadata fields to update.
§Returns
Current workspace metadata for the session, including its absolute filesystem path when 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.
Sourcepub async fn ensure(
&self,
params: WorkspacesEnsureRequest,
) -> Result<WorkspacesGetWorkspaceResult, Error>
pub async fn ensure( &self, params: WorkspacesEnsureRequest, ) -> Result<WorkspacesGetWorkspaceResult, Error>
Ensures a local session workspace exists and returns it.
Wire method: session.workspaces.ensure.
§Parameters
params- Optional session context used when creating a local workspace.
§Returns
Current workspace metadata for the session, including its absolute filesystem path when 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.
Sourcepub async fn list_files(&self) -> Result<WorkspacesListFilesResult, Error>
pub async fn list_files(&self) -> Result<WorkspacesListFilesResult, Error>
Lists files stored in the session workspace files directory.
Wire method: session.workspaces.listFiles.
§Returns
Relative paths of files stored in the session workspace files 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.
Sourcepub async fn read_file(
&self,
params: WorkspacesReadFileRequest,
) -> Result<WorkspacesReadFileResult, Error>
pub async fn read_file( &self, params: WorkspacesReadFileRequest, ) -> Result<WorkspacesReadFileResult, Error>
Reads a file from the session workspace files directory.
Wire method: session.workspaces.readFile.
§Parameters
params- Relative path of the workspace file to read.
§Returns
Contents of the requested workspace file as a UTF-8 string.
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.
Sourcepub async fn create_file(
&self,
params: WorkspacesCreateFileRequest,
) -> Result<(), Error>
pub async fn create_file( &self, params: WorkspacesCreateFileRequest, ) -> Result<(), Error>
Creates or overwrites a file in the session workspace files directory.
Wire method: session.workspaces.createFile.
§Parameters
params- Relative path and UTF-8 content for the workspace file to create or overwrite.
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.
Sourcepub async fn list_checkpoints(
&self,
) -> Result<WorkspacesListCheckpointsResult, Error>
pub async fn list_checkpoints( &self, ) -> Result<WorkspacesListCheckpointsResult, Error>
Lists workspace checkpoints in chronological order.
Wire method: session.workspaces.listCheckpoints.
§Returns
Workspace checkpoints in chronological order; empty when the workspace is not enabled.
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.
Sourcepub async fn read_checkpoint(
&self,
params: WorkspacesReadCheckpointRequest,
) -> Result<WorkspacesReadCheckpointResult, Error>
pub async fn read_checkpoint( &self, params: WorkspacesReadCheckpointRequest, ) -> Result<WorkspacesReadCheckpointResult, Error>
Reads the content of a workspace checkpoint by number.
Wire method: session.workspaces.readCheckpoint.
§Parameters
params- Checkpoint number to read.
§Returns
Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
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.
Sourcepub async fn add_summary(
&self,
params: WorkspacesAddSummaryRequest,
) -> Result<WorkspacesAddSummaryResult, Error>
pub async fn add_summary( &self, params: WorkspacesAddSummaryRequest, ) -> Result<WorkspacesAddSummaryResult, Error>
Adds a compaction summary checkpoint to the local session workspace.
Wire method: session.workspaces.addSummary.
§Parameters
params- Compaction summary checkpoint to persist.
§Returns
Persisted summary metadata and refreshed workspace metadata.
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.
Sourcepub async fn truncate_summaries(
&self,
params: WorkspacesTruncateSummariesRequest,
) -> Result<WorkspacesGetWorkspaceResult, Error>
pub async fn truncate_summaries( &self, params: WorkspacesTruncateSummariesRequest, ) -> Result<WorkspacesGetWorkspaceResult, Error>
Truncates local workspace compaction summaries after a rollback.
Wire method: session.workspaces.truncateSummaries.
§Parameters
params- Rollback point for local workspace summaries.
§Returns
Current workspace metadata for the session, including its absolute filesystem path when 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.
Sourcepub async fn read_autopilot_objective(
&self,
) -> Result<WorkspacesReadAutopilotObjectiveResult, Error>
pub async fn read_autopilot_objective( &self, ) -> Result<WorkspacesReadAutopilotObjectiveResult, Error>
Reads the autopilot objective state file from the local session workspace.
Wire method: session.workspaces.readAutopilotObjective.
§Returns
Autopilot objective file content, or null when missing.
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.
Sourcepub async fn write_autopilot_objective(
&self,
params: WorkspacesWriteAutopilotObjectiveRequest,
) -> Result<WorkspacesWriteAutopilotObjectiveResult, Error>
pub async fn write_autopilot_objective( &self, params: WorkspacesWriteAutopilotObjectiveRequest, ) -> Result<WorkspacesWriteAutopilotObjectiveResult, Error>
Writes the autopilot objective state file in the local session workspace.
Wire method: session.workspaces.writeAutopilotObjective.
§Parameters
params- Autopilot objective file content to persist.
§Returns
Result of writing the autopilot objective file.
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.
Sourcepub async fn delete_autopilot_objective(
&self,
) -> Result<WorkspacesDeleteAutopilotObjectiveResult, Error>
pub async fn delete_autopilot_objective( &self, ) -> Result<WorkspacesDeleteAutopilotObjectiveResult, Error>
Deletes the autopilot objective state file from the local session workspace.
Wire method: session.workspaces.deleteAutopilotObjective.
§Returns
Result of deleting the autopilot objective file.
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.
Sourcepub async fn autopilot_objective_exists(
&self,
) -> Result<WorkspacesAutopilotObjectiveExistsResult, Error>
pub async fn autopilot_objective_exists( &self, ) -> Result<WorkspacesAutopilotObjectiveExistsResult, Error>
Checks whether the local session workspace has an autopilot objective state file.
Wire method: session.workspaces.autopilotObjectiveExists.
§Returns
Whether the autopilot objective file 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.
Sourcepub async fn save_large_paste(
&self,
params: WorkspacesSaveLargePasteRequest,
) -> Result<WorkspacesSaveLargePasteResult, Error>
pub async fn save_large_paste( &self, params: WorkspacesSaveLargePasteRequest, ) -> Result<WorkspacesSaveLargePasteResult, Error>
Saves pasted content as a UTF-8 file in the session workspace.
Wire method: session.workspaces.saveLargePaste.
§Parameters
params- Pasted content to save as a UTF-8 file in the session workspace.
§Returns
Descriptor for the saved paste file, or null when the workspace is unavailable.
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.
Sourcepub async fn diff(
&self,
params: WorkspacesDiffRequest,
) -> Result<WorkspaceDiffResult, Error>
pub async fn diff( &self, params: WorkspacesDiffRequest, ) -> Result<WorkspaceDiffResult, Error>
Computes a diff for the session workspace. Never rejects for a busy session: a session-mode diff that cannot read the session’s file-change captures falls back to an unstaged git diff with isFallback: true and reports why in unavailableReason.
Wire method: session.workspaces.diff.
§Parameters
params- Parameters for computing a workspace diff.
§Returns
Workspace diff result for the requested mode.
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 SessionRpcWorkspaces<'a>
impl<'a> Clone for SessionRpcWorkspaces<'a>
Source§fn clone(&self) -> SessionRpcWorkspaces<'a>
fn clone(&self) -> SessionRpcWorkspaces<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more