Class SessionRpc
Provides strongly-typed access to all session-level API namespaces.
The sessionId is injected automatically into every call.
Obtain an instance by calling new SessionRpc(caller, sessionId).
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SessionAccountsApiAPI methods for theaccountsnamespace.final SessionAgentApiAPI methods for theagentnamespace.API methods for theautopilotObjectivenamespace.final SessionCanvasApiAPI methods for thecanvasnamespace.final SessionCommandsApiAPI methods for thecommandsnamespace.final SessionCompletionsApiAPI methods for thecompletionsnamespace.final SessionConnectorsApiAPI methods for theconnectorsnamespace.API methods for thecontentExclusionnamespace.final SessionCustomizationsApiAPI methods for thecustomizationsnamespace.final SessionDebugApiAPI methods for thedebugnamespace.final SessionDiagnosticsApiAPI methods for thediagnosticsnamespace.final SessionEventLogApiAPI methods for theeventLognamespace.final SessionExtensionsApiAPI methods for theextensionsnamespace.final SessionFleetApiAPI methods for thefleetnamespace.final SessionGitHubAuthApiAPI methods for thegitHubAuthnamespace.final SessionHistoryApiAPI methods for thehistorynamespace.final SessionInstructionsApiAPI methods for theinstructionsnamespace.API methods for thelimitPredictionnamespace.final SessionLspApiAPI methods for thelspnamespace.API methods for themanagedSettingsnamespace.final SessionMcpApiAPI methods for themcpnamespace.final SessionMetadataApiAPI methods for themetadatanamespace.final SessionModeApiAPI methods for themodenamespace.final SessionModelApiAPI methods for themodelnamespace.final SessionNameApiAPI methods for thenamenamespace.final SessionOptionsApiAPI methods for theoptionsnamespace.final SessionPermissionsApiAPI methods for thepermissionsnamespace.final SessionPlanApiAPI methods for theplannamespace.final SessionPluginsApiAPI methods for thepluginsnamespace.final SessionProviderApiAPI methods for theprovidernamespace.final SessionProvidersApiAPI methods for theprovidersnamespace.final SessionQueueApiAPI methods for thequeuenamespace.final SessionQuotaApiAPI methods for thequotanamespace.final SessionRemoteApiAPI methods for theremotenamespace.final SessionSandboxApiAPI methods for thesandboxnamespace.final SessionScheduleApiAPI methods for theschedulenamespace.final SessionShellApiAPI methods for theshellnamespace.final SessionSkillsApiAPI methods for theskillsnamespace.final SessionTasksApiAPI methods for thetasksnamespace.final SessionTelemetryApiAPI methods for thetelemetrynamespace.final SessionToolsApiAPI methods for thetoolsnamespace.final SessionUiApiAPI methods for theuinamespace.final SessionUsageApiAPI methods for theusagenamespace.final SessionVisibilityApiAPI methods for thevisibilitynamespace.final SessionWorkflowApiAPI methods for theworkflownamespace.final SessionWorkspacesApiAPI methods for theworkspacesnamespace. -
Constructor Summary
ConstructorsConstructorDescriptionSessionRpc(RpcCaller caller, String sessionId) Creates a new session RPC client. -
Method Summary
Modifier and TypeMethodDescriptionabort(SessionAbortParams params) Aborts the current agent turn.Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop.Interrupts the current main agent turn while leaving running background work (subagents, sidekicks, and promoted attached shells) alive.log(SessionLogParams params) Emits a user-visible session log event.send(SessionSendParams params) Sends a user message to the session and returns its message ID.Sends zero or more user messages to the session in a single turn and returns their message IDs.shutdown(SessionShutdownParams params) Shuts down the session and persists its final state.suspend()Suspends the session while preserving persisted state for later resume.
-
Field Details
-
providers
API methods for theprovidersnamespace. -
sandbox
API methods for thesandboxnamespace. -
gitHubAuth
API methods for thegitHubAuthnamespace. -
accounts
API methods for theaccountsnamespace. -
debug
API methods for thedebugnamespace. -
canvas
API methods for thecanvasnamespace. -
workflow
API methods for theworkflownamespace. -
model
API methods for themodelnamespace. -
mode
API methods for themodenamespace. -
name
API methods for thenamenamespace. -
plan
API methods for theplannamespace. -
workspaces
API methods for theworkspacesnamespace. -
autopilotObjective
API methods for theautopilotObjectivenamespace. -
completions
API methods for thecompletionsnamespace. -
instructions
API methods for theinstructionsnamespace. -
customizations
API methods for thecustomizationsnamespace. -
fleet
API methods for thefleetnamespace. -
agent
API methods for theagentnamespace. -
tasks
API methods for thetasksnamespace. -
skills
API methods for theskillsnamespace. -
mcp
API methods for themcpnamespace. -
diagnostics
API methods for thediagnosticsnamespace. -
connectors
API methods for theconnectorsnamespace. -
managedSettings
API methods for themanagedSettingsnamespace. -
plugins
API methods for thepluginsnamespace. -
provider
API methods for theprovidernamespace. -
options
API methods for theoptionsnamespace. -
lsp
API methods for thelspnamespace. -
extensions
API methods for theextensionsnamespace. -
tools
API methods for thetoolsnamespace. -
commands
API methods for thecommandsnamespace. -
telemetry
API methods for thetelemetrynamespace. -
ui
API methods for theuinamespace. -
permissions
API methods for thepermissionsnamespace. -
metadata
API methods for themetadatanamespace. -
contentExclusion
API methods for thecontentExclusionnamespace. -
shell
API methods for theshellnamespace. -
history
API methods for thehistorynamespace. -
queue
API methods for thequeuenamespace. -
eventLog
API methods for theeventLognamespace. -
usage
API methods for theusagenamespace. -
quota
API methods for thequotanamespace. -
limitPrediction
API methods for thelimitPredictionnamespace. -
remote
API methods for theremotenamespace. -
visibility
API methods for thevisibilitynamespace. -
schedule
API methods for theschedulenamespace.
-
-
Constructor Details
-
SessionRpc
-
-
Method Details
-
suspend
Suspends the session while preserving persisted state for later resume.- Since:
- 1.0.0
-
send
Sends a user message to the session and returns its message ID.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
sendMessages
@CopilotExperimental public CompletableFuture<SessionSendMessagesResult> sendMessages(SessionSendMessagesParams params) Sends zero or more user messages to the session in a single turn and returns their message IDs. All provided messages are appended to the conversation in order, then exactly one agent turn runs over the resulting history. When the list is empty, one turn runs over the existing history with no new user message. Remote-backed (Mission Control) sessions do not support this method and will return an error.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
abort
Aborts the current agent turn.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
interruptMainTurn
@CopilotExperimental public CompletableFuture<SessionInterruptMainTurnResult> interruptMainTurn(SessionInterruptMainTurnParams params) Interrupts the current main agent turn while leaving running background work (subagents, sidekicks, and promoted attached shells) alive. No-op when the main loop is not processing.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
cancelAllBackgroundAgents
Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.- Since:
- 1.0.0
-
shutdown
Shuts down the session and persists its final state. Awaits any deferred sessionEnd hooks before resolving so user-supplied hook scripts complete before the runtime tears down.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
log
Emits a user-visible session log event.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-