@@ -11,34 +11,54 @@ option java_package = "com.cursor.sdk.v1";
1111option ruby_package = "Cursor::Sdk::V1" ;
1212option swift_prefix = "CursorSdkV1" ;
1313
14- // Agent, run, streaming, cancellation, and artifact APIs.
14+ // Agent lifecycle , run streaming, cancellation, and artifact APIs.
1515service SdkAgentService {
16+ // Create a new local or cloud agent.
1617 rpc CreateAgent (CreateAgentRequest ) returns (CreateAgentResponse );
18+ // Re-attach to an existing agent and apply updated options.
1719 rpc ResumeAgent (ResumeAgentRequest ) returns (ResumeAgentResponse );
20+ // Reload an agent's durable state from its store without sending a message.
1821 rpc ReloadAgent (ReloadAgentRequest ) returns (ReloadAgentResponse );
22+ // Release local resources for an agent. Does not delete durable cloud state.
1923 rpc CloseAgent (CloseAgentRequest ) returns (CloseAgentResponse );
24+ // Send a user message and stream run events until the run completes.
2025 rpc Send (SendRequest ) returns (stream RunStreamMessage );
26+ // Block until a live run reaches a terminal status and return its result.
2127 rpc WaitLiveRun (WaitLiveRunRequest ) returns (WaitLiveRunResponse );
28+ // Fetch a point-in-time snapshot of a run.
2229 rpc GetRun (GetRunRequest ) returns (GetRunResponse );
30+ // List runs for an agent, newest first unless otherwise noted by the bridge.
2331 rpc ListRuns (ListRunsRequest ) returns (ListRunsResponse );
32+ // Fetch the conversation JSON associated with a run.
2433 rpc GetRunConversation (GetRunConversationRequest ) returns (GetRunConversationResponse );
34+ // Subscribe to durable run events, optionally resuming after a prior offset.
2535 rpc ObserveRun (ObserveRunRequest ) returns (stream RunStreamMessage );
36+ // Request cancellation of an in-flight run.
2637 rpc CancelRun (CancelRunRequest ) returns (CancelRunResponse );
38+ // Fetch metadata for a single agent.
2739 rpc GetAgent (GetAgentRequest ) returns (GetAgentResponse );
40+ // List agents visible to the caller.
2841 rpc ListAgents (ListAgentsRequest ) returns (ListAgentsResponse );
42+ // Archive an agent so it no longer appears in default listings.
2943 rpc ArchiveAgent (ArchiveAgentRequest ) returns (ArchiveAgentResponse );
44+ // Restore an archived agent.
3045 rpc UnarchiveAgent (UnarchiveAgentRequest ) returns (UnarchiveAgentResponse );
46+ // Permanently delete an agent and its durable data.
3147 rpc DeleteAgent (DeleteAgentRequest ) returns (DeleteAgentResponse );
48+ // List messages recorded for an agent.
3249 rpc ListAgentMessages (ListAgentMessagesRequest ) returns (ListAgentMessagesResponse );
50+ // List artifacts produced by a cloud agent.
3351 rpc ListArtifacts (ListArtifactsRequest ) returns (ListArtifactsResponse );
52+ // Download an artifact as a stream of bytes.
3453 rpc DownloadArtifact (DownloadArtifactRequest ) returns (stream DownloadArtifactChunk );
35- // Billed token usage and dollar cost for an agent's runs. Cloud-only for
36- // now ; local agents fail with the SDK's cloud-only error.
54+ // Billed token usage and dollar cost for an agent's runs.
55+ // Cloud agents only ; local agents fail with a cloud-only / unavailable error.
3756 rpc GetUsage (GetUsageRequest ) returns (GetUsageResponse );
3857}
3958
4059message CreateAgentRequest {
4160 AgentOptions options = 1 ;
61+ // Optional key that makes CreateAgent retries safe for cloud agents.
4262 optional string idempotency_key = 2 ;
4363}
4464
@@ -73,6 +93,7 @@ message SendRequest {
7393 string agent_id = 1 ;
7494 UserMessage message = 2 ;
7595 SendOptions options = 3 ;
96+ // Optional key that makes Send retries safe for cloud agents.
7697 optional string idempotency_key = 4 ;
7798}
7899
@@ -100,6 +121,7 @@ message ListRunsRequest {
100121
101122message ListRunsResponse {
102123 repeated RunSnapshot items = 1 ;
124+ // Opaque pagination cursor. Empty when there are no further pages.
103125 string next_cursor = 2 ;
104126}
105127
@@ -108,16 +130,20 @@ message GetRunConversationRequest {
108130}
109131
110132message GetRunConversationResponse {
133+ // Opaque conversation document encoded as JSON.
111134 string conversation_json = 1 ;
112135}
113136
114137message ObserveRunRequest {
115138 string run_id = 1 ;
139+ // Resume after this exclusive offset from a prior ObserveRun / Send stream.
140+ // When unset, the stream starts from the beginning of durable events.
116141 optional string after_offset = 2 ;
117142}
118143
119144message CancelRunRequest {
120145 string run_id = 1 ;
146+ // Optional agent hint used by some bridge deployments for routing.
121147 optional string agent_id = 2 ;
122148}
123149
@@ -138,6 +164,7 @@ message ListAgentsRequest {
138164
139165message ListAgentsResponse {
140166 repeated SdkAgentInfo items = 1 ;
167+ // Opaque pagination cursor. Empty when there are no further pages.
141168 string next_cursor = 2 ;
142169}
143170
@@ -181,6 +208,7 @@ message ListArtifactsResponse {
181208
182209message DownloadArtifactRequest {
183210 string agent_id = 1 ;
211+ // Artifact path as returned by ListArtifacts.
184212 string path = 2 ;
185213}
186214
@@ -199,6 +227,7 @@ message ListAgentsOptions {
199227 string cursor = 2 ;
200228 Runtime runtime = 3 ;
201229 string cwd = 4 ;
230+ // Filter cloud agents associated with this pull-request URL.
202231 string pr_url = 5 ;
203232 optional bool include_archived = 6 ;
204233 string api_key = 7 ;
0 commit comments