diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StopAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ArchiveAgent.g.cs similarity index 79% rename from src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StopAgent.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ArchiveAgent.g.cs index da7d17d..f013975 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StopAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ArchiveAgent.g.cs @@ -7,66 +7,66 @@ public partial class CursorAgentsClient { - private static readonly global::CursorAgents.EndPointSecurityRequirement s_StopAgentSecurityRequirement0 = + private static readonly global::CursorAgents.EndPointSecurityRequirement s_ArchiveAgentSecurityRequirement0 = new global::CursorAgents.EndPointSecurityRequirement { Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; - private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_StopAgentSecurityRequirements = + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_ArchiveAgentSecurityRequirements = new global::CursorAgents.EndPointSecurityRequirement[] - { s_StopAgentSecurityRequirement0, + { s_ArchiveAgentSecurityRequirement0, }; - partial void PrepareStopAgentArguments( + partial void PrepareArchiveAgentArguments( global::System.Net.Http.HttpClient httpClient, ref string id); - partial void PrepareStopAgentRequest( + partial void PrepareArchiveAgentRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string id); - partial void ProcessStopAgentResponse( + partial void ProcessArchiveAgentResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessStopAgentResponseContent( + partial void ProcessArchiveAgentResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); /// - /// Stop an agent
- /// Stop a running cloud agent. This pauses the agent's execution without deleting it. Stopped agents cannot be resumed. + /// Archive an agent
+ /// Archive an agent. Archived agents remain readable but cannot accept new runs until unarchived. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task StopAgentAsync( + public async global::System.Threading.Tasks.Task ArchiveAgentAsync( string id, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); - PrepareStopAgentArguments( + PrepareArchiveAgentArguments( httpClient: HttpClient, id: ref id); var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( availableAuthorizations: Authorizations, - securityRequirements: s_StopAgentSecurityRequirements, - operationName: "StopAgentAsync"); + securityRequirements: s_ArchiveAgentSecurityRequirements, + operationName: "ArchiveAgentAsync"); using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( clientOptions: Options, @@ -85,7 +85,7 @@ partial void ProcessStopAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: $"/v0/agents/{id}/stop", + path: $"/v1/agents/{id}/archive", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -124,7 +124,7 @@ partial void ProcessStopAgentResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareStopAgentRequest( + PrepareArchiveAgentRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, id: id); @@ -144,9 +144,9 @@ partial void ProcessStopAgentResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "StopAgent", - methodName: "StopAgentAsync", - pathTemplate: "$\"/v0/agents/{id}/stop\"", + operationId: "ArchiveAgent", + methodName: "ArchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/archive\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -171,9 +171,9 @@ partial void ProcessStopAgentResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "StopAgent", - methodName: "StopAgentAsync", - pathTemplate: "$\"/v0/agents/{id}/stop\"", + operationId: "ArchiveAgent", + methodName: "ArchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/archive\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -206,9 +206,9 @@ partial void ProcessStopAgentResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "StopAgent", - methodName: "StopAgentAsync", - pathTemplate: "$\"/v0/agents/{id}/stop\"", + operationId: "ArchiveAgent", + methodName: "ArchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/archive\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -245,7 +245,7 @@ partial void ProcessStopAgentResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessStopAgentResponse( + ProcessArchiveAgentResponse( httpClient: HttpClient, httpResponseMessage: __response); if (__response.IsSuccessStatusCode) @@ -253,9 +253,9 @@ partial void ProcessStopAgentResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "StopAgent", - methodName: "StopAgentAsync", - pathTemplate: "$\"/v0/agents/{id}/stop\"", + operationId: "ArchiveAgent", + methodName: "ArchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/archive\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -273,9 +273,9 @@ partial void ProcessStopAgentResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "StopAgent", - methodName: "StopAgentAsync", - pathTemplate: "$\"/v0/agents/{id}/stop\"", + operationId: "ArchiveAgent", + methodName: "ArchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/archive\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -288,45 +288,7 @@ partial void ProcessStopAgentResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - bad agent ID format - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::CursorAgents.Error? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -364,7 +326,7 @@ partial void ProcessStopAgentResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -402,7 +364,7 @@ partial void ProcessStopAgentResponseContent( h => h.Value), }; } - // Agent not found or access denied + // Agent or run not found. if ((int)__response.StatusCode == 404) { string? __content_404 = null; @@ -440,45 +402,7 @@ partial void ProcessStopAgentResponseContent( h => h.Value), }; } - // Conflict - agent is deleted or archived - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::CursorAgents.Error? __value_409 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_409 = global::CursorAgents.Error.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_409 = global::CursorAgents.Error.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -516,7 +440,7 @@ partial void ProcessStopAgentResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -567,7 +491,7 @@ partial void ProcessStopAgentResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessStopAgentResponseContent( + ProcessArchiveAgentResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -577,7 +501,7 @@ partial void ProcessStopAgentResponseContent( __response.EnsureSuccessStatusCode(); return - global::CursorAgents.StopAgentResponse.FromJson(__content, JsonSerializerContext) ?? + global::CursorAgents.IdResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } catch (global::System.Exception __ex) @@ -607,7 +531,7 @@ partial void ProcessStopAgentResponseContent( ).ConfigureAwait(false); return - await global::CursorAgents.StopAgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::CursorAgents.IdResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } catch (global::System.Exception __ex) diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Authorizations.Bearer.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Authorizations.Basic.g.cs similarity index 51% rename from src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Authorizations.Bearer.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Authorizations.Basic.g.cs index 58d2ed0..d4cb14f 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Authorizations.Bearer.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Authorizations.Basic.g.cs @@ -7,16 +7,18 @@ public sealed partial class CursorAgentsClient { /// - public void AuthorizeUsingBearer( - string apiKey) + public void AuthorizeUsingBasic( + string username, + string password) { - apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + username = username ?? throw new global::System.ArgumentNullException(nameof(username)); + password = password ?? throw new global::System.ArgumentNullException(nameof(password)); for (var i = Authorizations.Count - 1; i >= 0; i--) { var __authorization = Authorizations[i]; if (__authorization.Type == "Http" && - __authorization.Name == "Bearer") + __authorization.Name == "Basic") { Authorizations.RemoveAt(i); } @@ -25,10 +27,11 @@ public void AuthorizeUsingBearer( Authorizations.Add(new global::CursorAgents.EndPointAuthorization { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - Value = apiKey, + Name = "Basic", + Value = global::System.Convert.ToBase64String( + global::System.Text.Encoding.UTF8.GetBytes($"{username}:{password}")), }); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgentArtifacts.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs similarity index 86% rename from src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgentArtifacts.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs index d6c64f9..f1958a3 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgentArtifacts.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs @@ -7,66 +7,77 @@ public partial class CursorAgentsClient { - private static readonly global::CursorAgents.EndPointSecurityRequirement s_ListAgentArtifactsSecurityRequirement0 = + private static readonly global::CursorAgents.EndPointSecurityRequirement s_CancelRunSecurityRequirement0 = new global::CursorAgents.EndPointSecurityRequirement { Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; - private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_ListAgentArtifactsSecurityRequirements = + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_CancelRunSecurityRequirements = new global::CursorAgents.EndPointSecurityRequirement[] - { s_ListAgentArtifactsSecurityRequirement0, + { s_CancelRunSecurityRequirement0, }; - partial void PrepareListAgentArtifactsArguments( + partial void PrepareCancelRunArguments( global::System.Net.Http.HttpClient httpClient, - ref string id); - partial void PrepareListAgentArtifactsRequest( + ref string id, + ref string runId); + partial void PrepareCancelRunRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string id); - partial void ProcessListAgentArtifactsResponse( + string id, + string runId); + partial void ProcessCancelRunResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessListAgentArtifactsResponseContent( + partial void ProcessCancelRunResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); /// - /// List agent artifacts
- /// List artifacts generated by a cloud agent created within the last 6 months. Returns at most 100 artifacts. + /// Cancel a run
+ /// Cancel the active run for an agent. Cancellation is terminal —
+ /// the run transitions to `CANCELLED`. Cancelling a run that is
+ /// already terminal or was never active returns
+ /// `409 run_not_cancellable`. To continue the conversation,
+ /// create a new run on the same agent. ///
/// /// Example: bc-00000000-0000-0000-0000-000000000001 /// + /// + /// Example: run-00000000-0000-0000-0000-000000000001 + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task ListAgentArtifactsAsync( + public async global::System.Threading.Tasks.Task CancelRunAsync( string id, + string runId, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); - PrepareListAgentArtifactsArguments( + PrepareCancelRunArguments( httpClient: HttpClient, - id: ref id); + id: ref id, + runId: ref runId); var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( availableAuthorizations: Authorizations, - securityRequirements: s_ListAgentArtifactsSecurityRequirements, - operationName: "ListAgentArtifactsAsync"); + securityRequirements: s_CancelRunSecurityRequirements, + operationName: "CancelRunAsync"); using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( clientOptions: Options, @@ -85,7 +96,7 @@ partial void ProcessListAgentArtifactsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: $"/v0/agents/{id}/artifacts", + path: $"/v1/agents/{id}/runs/{runId}/cancel", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -93,7 +104,7 @@ partial void ProcessListAgentArtifactsResponseContent( clientParameters: Options.QueryParameters, requestParameters: requestOptions?.QueryParameters); var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, + method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); #if NET6_0_OR_GREATER __httpRequest.Version = global::System.Net.HttpVersion.Version11; @@ -124,10 +135,11 @@ partial void ProcessListAgentArtifactsResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareListAgentArtifactsRequest( + PrepareCancelRunRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, - id: id); + id: id, + runId: runId); return __httpRequest; } @@ -144,10 +156,10 @@ partial void ProcessListAgentArtifactsResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListAgentArtifacts", - methodName: "ListAgentArtifactsAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts\"", - httpMethod: "GET", + operationId: "CancelRun", + methodName: "CancelRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/cancel\"", + httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, response: null, @@ -171,10 +183,10 @@ partial void ProcessListAgentArtifactsResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListAgentArtifacts", - methodName: "ListAgentArtifactsAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts\"", - httpMethod: "GET", + operationId: "CancelRun", + methodName: "CancelRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/cancel\"", + httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, response: null, @@ -206,10 +218,10 @@ partial void ProcessListAgentArtifactsResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListAgentArtifacts", - methodName: "ListAgentArtifactsAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts\"", - httpMethod: "GET", + operationId: "CancelRun", + methodName: "CancelRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/cancel\"", + httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, response: __response, @@ -245,7 +257,7 @@ partial void ProcessListAgentArtifactsResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessListAgentArtifactsResponse( + ProcessCancelRunResponse( httpClient: HttpClient, httpResponseMessage: __response); if (__response.IsSuccessStatusCode) @@ -253,10 +265,10 @@ partial void ProcessListAgentArtifactsResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListAgentArtifacts", - methodName: "ListAgentArtifactsAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts\"", - httpMethod: "GET", + operationId: "CancelRun", + methodName: "CancelRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/cancel\"", + httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, response: __response, @@ -273,10 +285,10 @@ partial void ProcessListAgentArtifactsResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "ListAgentArtifacts", - methodName: "ListAgentArtifactsAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts\"", - httpMethod: "GET", + operationId: "CancelRun", + methodName: "CancelRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/cancel\"", + httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, response: __response, @@ -288,45 +300,7 @@ partial void ProcessListAgentArtifactsResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - bad agent ID format or artifacts expired for an agent older than 6 months - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::CursorAgents.Error? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -364,7 +338,7 @@ partial void ProcessListAgentArtifactsResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -402,7 +376,7 @@ partial void ProcessListAgentArtifactsResponseContent( h => h.Value), }; } - // Agent not found or access denied + // Agent or run not found. if ((int)__response.StatusCode == 404) { string? __content_404 = null; @@ -440,7 +414,45 @@ partial void ProcessListAgentArtifactsResponseContent( h => h.Value), }; } - // Rate limit exceeded + // Resource state conflict (`agent_busy`, `agent_archived`, or `run_not_cancellable`). + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::CursorAgents.Error? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::CursorAgents.Error.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::CursorAgents.Error.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + statusCode: __response.StatusCode) + { + ResponseBody = __content_409, + ResponseObject = __value_409, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -478,7 +490,7 @@ partial void ProcessListAgentArtifactsResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -529,7 +541,7 @@ partial void ProcessListAgentArtifactsResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessListAgentArtifactsResponseContent( + ProcessCancelRunResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -539,7 +551,7 @@ partial void ProcessListAgentArtifactsResponseContent( __response.EnsureSuccessStatusCode(); return - global::CursorAgents.ListArtifactsResponse.FromJson(__content, JsonSerializerContext) ?? + global::CursorAgents.IdResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } catch (global::System.Exception __ex) @@ -569,7 +581,7 @@ partial void ProcessListAgentArtifactsResponseContent( ).ConfigureAwait(false); return - await global::CursorAgents.ListArtifactsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::CursorAgents.IdResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } catch (global::System.Exception __ex) diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Constructors.Bearer.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Constructors.Basic.g.cs similarity index 79% rename from src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Constructors.Bearer.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Constructors.Basic.g.cs index 7e5bbc3..3ea8cd7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Constructors.Bearer.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.Constructors.Basic.g.cs @@ -8,22 +8,24 @@ public sealed partial class CursorAgentsClient /// public CursorAgentsClient( - string apiKey, + string username, + string password, global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null, global::System.Collections.Generic.List? authorizations = null, bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) { - Authorizing(HttpClient, ref apiKey); + Authorizing(HttpClient, ref username, ref password); - AuthorizeUsingBearer(apiKey); + AuthorizeUsingBasic(username, password); Authorized(HttpClient); } partial void Authorizing( global::System.Net.Http.HttpClient client, - ref string apiKey); + ref string username, + ref string password); partial void Authorized( global::System.Net.Http.HttpClient client); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs index 856ac4f..06e61d6 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs @@ -14,10 +14,10 @@ public partial class CursorAgentsClient { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; @@ -42,8 +42,10 @@ partial void ProcessCreateAgentResponseContent( ref string content); /// - /// Launch an agent
- /// Start a new cloud agent to work on your repository + /// Create an agent
+ /// Create a Cloud Agent and immediately enqueue its initial run.
+ /// The response contains both the durable `agent` and the initial
+ /// `run`. ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -86,7 +88,7 @@ partial void ProcessCreateAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: "/v0/agents", + path: "/v1/agents", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -153,7 +155,7 @@ partial void ProcessCreateAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateAgent", methodName: "CreateAgentAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -180,7 +182,7 @@ partial void ProcessCreateAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateAgent", methodName: "CreateAgentAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -215,7 +217,7 @@ partial void ProcessCreateAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateAgent", methodName: "CreateAgentAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -262,7 +264,7 @@ partial void ProcessCreateAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateAgent", methodName: "CreateAgentAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -282,7 +284,7 @@ partial void ProcessCreateAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateAgent", methodName: "CreateAgentAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -295,7 +297,7 @@ partial void ProcessCreateAgentResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request + // Validation error or malformed request body. if ((int)__response.StatusCode == 400) { string? __content_400 = null; @@ -333,7 +335,7 @@ partial void ProcessCreateAgentResponseContent( h => h.Value), }; } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -371,7 +373,7 @@ partial void ProcessCreateAgentResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions, plan limits exceeded, or storage full + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -409,7 +411,7 @@ partial void ProcessCreateAgentResponseContent( h => h.Value), }; } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -447,7 +449,7 @@ partial void ProcessCreateAgentResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -578,26 +580,43 @@ partial void ProcessCreateAgentResponseContent( } } /// - /// Launch an agent
- /// Start a new cloud agent to work on your repository + /// Create an agent
+ /// Create a Cloud Agent and immediately enqueue its initial run.
+ /// The response contains both the durable `agent` and the initial
+ /// `run`. ///
/// - /// - /// Set to an explicit model ID for launch requests, or use "default" to use the configured default model. When omitted, Cursor resolves your user default model, then your team default model, then a system default.
- /// Example: claude-4-sonnet + /// + /// + /// Repository configuration. v1 currently supports one entry. + /// + /// + /// Custom branch name for the agent to create.
+ /// Example: feature/add-readme + /// + /// + /// Whether to create a new branch (true) or push to an existing head branch (false). Only applies when `repos[0].prUrl` is provided.
+ /// Default Value: true + /// + /// + /// Whether Cursor should open a pull request when the run completes.
+ /// Default Value: false + /// + /// + /// Whether to skip requesting the user as a reviewer when Cursor opens a PR. Only applies when `autoCreatePR` is true.
+ /// Default Value: false /// - /// - /// - /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task CreateAgentAsync( global::CursorAgents.CreateAgentRequestPrompt prompt, - global::CursorAgents.CreateAgentRequestSource source, - string? model = default, - global::CursorAgents.CreateAgentRequestTarget? target = default, - global::CursorAgents.CreateAgentRequestWebhook? webhook = default, + global::System.Collections.Generic.IList repos, + global::CursorAgents.ModelRef? model = default, + string? branchName = default, + bool? autoGenerateBranch = default, + bool? autoCreatePR = default, + bool? skipReviewerRequest = default, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -605,9 +624,11 @@ partial void ProcessCreateAgentResponseContent( { Prompt = prompt, Model = model, - Source = source, - Target = target, - Webhook = webhook, + Repos = repos, + BranchName = branchName, + AutoGenerateBranch = autoGenerateBranch, + AutoCreatePR = autoCreatePR, + SkipReviewerRequest = skipReviewerRequest, }; return await CreateAgentAsync( diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.AddFollowup.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs similarity index 90% rename from src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.AddFollowup.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs index ee95674..8c0b675 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.AddFollowup.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs @@ -7,57 +7,59 @@ public partial class CursorAgentsClient { - private static readonly global::CursorAgents.EndPointSecurityRequirement s_AddFollowupSecurityRequirement0 = + private static readonly global::CursorAgents.EndPointSecurityRequirement s_CreateRunSecurityRequirement0 = new global::CursorAgents.EndPointSecurityRequirement { Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; - private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_AddFollowupSecurityRequirements = + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_CreateRunSecurityRequirements = new global::CursorAgents.EndPointSecurityRequirement[] - { s_AddFollowupSecurityRequirement0, + { s_CreateRunSecurityRequirement0, }; - partial void PrepareAddFollowupArguments( + partial void PrepareCreateRunArguments( global::System.Net.Http.HttpClient httpClient, ref string id, - global::CursorAgents.AddFollowupRequest request); - partial void PrepareAddFollowupRequest( + global::CursorAgents.CreateRunRequest request); + partial void PrepareCreateRunRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string id, - global::CursorAgents.AddFollowupRequest request); - partial void ProcessAddFollowupResponse( + global::CursorAgents.CreateRunRequest request); + partial void ProcessCreateRunResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessAddFollowupResponseContent( + partial void ProcessCreateRunResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); /// - /// Add followup
- /// Add a followup instruction to an existing cloud agent + /// Create a run
+ /// Send a follow-up prompt to an existing active agent. The new
+ /// run uses the agent's current conversation and workspace state.
+ /// Only one run can be active per agent at a time. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task AddFollowupAsync( + public async global::System.Threading.Tasks.Task CreateRunAsync( string id, - global::CursorAgents.AddFollowupRequest request, + global::CursorAgents.CreateRunRequest request, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -65,7 +67,7 @@ partial void ProcessAddFollowupResponseContent( PrepareArguments( client: HttpClient); - PrepareAddFollowupArguments( + PrepareCreateRunArguments( httpClient: HttpClient, id: ref id, request: request); @@ -73,8 +75,8 @@ partial void ProcessAddFollowupResponseContent( var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( availableAuthorizations: Authorizations, - securityRequirements: s_AddFollowupSecurityRequirements, - operationName: "AddFollowupAsync"); + securityRequirements: s_CreateRunSecurityRequirements, + operationName: "CreateRunAsync"); using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( clientOptions: Options, @@ -93,7 +95,7 @@ partial void ProcessAddFollowupResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: $"/v0/agents/{id}/followup", + path: $"/v1/agents/{id}/runs", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -138,7 +140,7 @@ partial void ProcessAddFollowupResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareAddFollowupRequest( + PrepareCreateRunRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, id: id, @@ -159,9 +161,9 @@ partial void ProcessAddFollowupResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddFollowup", - methodName: "AddFollowupAsync", - pathTemplate: "$\"/v0/agents/{id}/followup\"", + operationId: "CreateRun", + methodName: "CreateRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -186,9 +188,9 @@ partial void ProcessAddFollowupResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddFollowup", - methodName: "AddFollowupAsync", - pathTemplate: "$\"/v0/agents/{id}/followup\"", + operationId: "CreateRun", + methodName: "CreateRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -221,9 +223,9 @@ partial void ProcessAddFollowupResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddFollowup", - methodName: "AddFollowupAsync", - pathTemplate: "$\"/v0/agents/{id}/followup\"", + operationId: "CreateRun", + methodName: "CreateRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -260,7 +262,7 @@ partial void ProcessAddFollowupResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessAddFollowupResponse( + ProcessCreateRunResponse( httpClient: HttpClient, httpResponseMessage: __response); if (__response.IsSuccessStatusCode) @@ -268,9 +270,9 @@ partial void ProcessAddFollowupResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddFollowup", - methodName: "AddFollowupAsync", - pathTemplate: "$\"/v0/agents/{id}/followup\"", + operationId: "CreateRun", + methodName: "CreateRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -288,9 +290,9 @@ partial void ProcessAddFollowupResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "AddFollowup", - methodName: "AddFollowupAsync", - pathTemplate: "$\"/v0/agents/{id}/followup\"", + operationId: "CreateRun", + methodName: "CreateRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest!, @@ -303,7 +305,7 @@ partial void ProcessAddFollowupResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - bad agent ID format or invalid request body + // Validation error or malformed request body. if ((int)__response.StatusCode == 400) { string? __content_400 = null; @@ -341,7 +343,7 @@ partial void ProcessAddFollowupResponseContent( h => h.Value), }; } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -379,7 +381,7 @@ partial void ProcessAddFollowupResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -417,7 +419,7 @@ partial void ProcessAddFollowupResponseContent( h => h.Value), }; } - // Agent not found or access denied + // Agent or run not found. if ((int)__response.StatusCode == 404) { string? __content_404 = null; @@ -455,7 +457,7 @@ partial void ProcessAddFollowupResponseContent( h => h.Value), }; } - // Conflict - agent is deleted or archived + // Resource state conflict (`agent_busy`, `agent_archived`, or `run_not_cancellable`). if ((int)__response.StatusCode == 409) { string? __content_409 = null; @@ -493,7 +495,7 @@ partial void ProcessAddFollowupResponseContent( h => h.Value), }; } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -531,7 +533,7 @@ partial void ProcessAddFollowupResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -582,7 +584,7 @@ partial void ProcessAddFollowupResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessAddFollowupResponseContent( + ProcessCreateRunResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -592,7 +594,7 @@ partial void ProcessAddFollowupResponseContent( __response.EnsureSuccessStatusCode(); return - global::CursorAgents.AddFollowupResponse.FromJson(__content, JsonSerializerContext) ?? + global::CursorAgents.CreateRunResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } catch (global::System.Exception __ex) @@ -622,7 +624,7 @@ partial void ProcessAddFollowupResponseContent( ).ConfigureAwait(false); return - await global::CursorAgents.AddFollowupResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::CursorAgents.CreateRunResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } catch (global::System.Exception __ex) @@ -662,28 +664,30 @@ partial void ProcessAddFollowupResponseContent( } } /// - /// Add followup
- /// Add a followup instruction to an existing cloud agent + /// Create a run
+ /// Send a follow-up prompt to an existing active agent. The new
+ /// run uses the agent's current conversation and workspace state.
+ /// Only one run can be active per agent at a time. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task AddFollowupAsync( + public async global::System.Threading.Tasks.Task CreateRunAsync( string id, - global::CursorAgents.AddFollowupRequestPrompt prompt, + global::CursorAgents.CreateRunRequestPrompt prompt, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { - var __request = new global::CursorAgents.AddFollowupRequest + var __request = new global::CursorAgents.CreateRunRequest { Prompt = prompt, }; - return await AddFollowupAsync( + return await CreateRunAsync( id: id, request: __request, requestOptions: requestOptions, diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DeleteAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DeleteAgent.g.cs index 177f0d4..0937302 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DeleteAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DeleteAgent.g.cs @@ -14,10 +14,10 @@ public partial class CursorAgentsClient { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; @@ -42,16 +42,16 @@ partial void ProcessDeleteAgentResponseContent( ref string content); /// - /// Delete an agent
- /// Delete a cloud agent. This action is permanent and cannot be undone. + /// Delete an agent permanently
+ /// Permanently delete an agent. This action is irreversible. Use POST /v1/agents/{id}/archive for reversible removal. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task DeleteAgentAsync( + public async global::System.Threading.Tasks.Task DeleteAgentAsync( string id, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,7 +85,7 @@ partial void ProcessDeleteAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: $"/v0/agents/{id}", + path: $"/v1/agents/{id}", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -146,7 +146,7 @@ partial void ProcessDeleteAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeleteAgent", methodName: "DeleteAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest!, @@ -173,7 +173,7 @@ partial void ProcessDeleteAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeleteAgent", methodName: "DeleteAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest!, @@ -208,7 +208,7 @@ partial void ProcessDeleteAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeleteAgent", methodName: "DeleteAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest!, @@ -255,7 +255,7 @@ partial void ProcessDeleteAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeleteAgent", methodName: "DeleteAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest!, @@ -275,7 +275,7 @@ partial void ProcessDeleteAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeleteAgent", methodName: "DeleteAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest!, @@ -288,45 +288,7 @@ partial void ProcessDeleteAgentResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - bad agent ID format - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::CursorAgents.Error? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -364,7 +326,7 @@ partial void ProcessDeleteAgentResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -402,7 +364,7 @@ partial void ProcessDeleteAgentResponseContent( h => h.Value), }; } - // Agent not found or access denied + // Agent or run not found. if ((int)__response.StatusCode == 404) { string? __content_404 = null; @@ -440,45 +402,7 @@ partial void ProcessDeleteAgentResponseContent( h => h.Value), }; } - // Conflict - agent is deleted or archived - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::CursorAgents.Error? __value_409 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_409 = global::CursorAgents.Error.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_409 = global::CursorAgents.Error.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -516,7 +440,7 @@ partial void ProcessDeleteAgentResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -577,7 +501,7 @@ partial void ProcessDeleteAgentResponseContent( __response.EnsureSuccessStatusCode(); return - global::CursorAgents.DeleteAgentResponse.FromJson(__content, JsonSerializerContext) ?? + global::CursorAgents.IdResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } catch (global::System.Exception __ex) @@ -607,7 +531,7 @@ partial void ProcessDeleteAgentResponseContent( ).ConfigureAwait(false); return - await global::CursorAgents.DeleteAgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::CursorAgents.IdResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } catch (global::System.Exception __ex) diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgentArtifact.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DownloadArtifact.g.cs similarity index 91% rename from src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgentArtifact.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DownloadArtifact.g.cs index f49f512..f117b13 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgentArtifact.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DownloadArtifact.g.cs @@ -7,56 +7,58 @@ public partial class CursorAgentsClient { - private static readonly global::CursorAgents.EndPointSecurityRequirement s_GetAgentArtifactSecurityRequirement0 = + private static readonly global::CursorAgents.EndPointSecurityRequirement s_DownloadArtifactSecurityRequirement0 = new global::CursorAgents.EndPointSecurityRequirement { Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; - private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_GetAgentArtifactSecurityRequirements = + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_DownloadArtifactSecurityRequirements = new global::CursorAgents.EndPointSecurityRequirement[] - { s_GetAgentArtifactSecurityRequirement0, + { s_DownloadArtifactSecurityRequirement0, }; - partial void PrepareGetAgentArtifactArguments( + partial void PrepareDownloadArtifactArguments( global::System.Net.Http.HttpClient httpClient, ref string id, ref string path); - partial void PrepareGetAgentArtifactRequest( + partial void PrepareDownloadArtifactRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string id, string path); - partial void ProcessGetAgentArtifactResponse( + partial void ProcessDownloadArtifactResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessGetAgentArtifactResponseContent( + partial void ProcessDownloadArtifactResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); /// /// Download an artifact
- /// Retrieve a temporary 15-minute presigned S3 URL for a specific artifact from an agent created within the last 6 months. The response includes both the URL and its expiration time. + /// Retrieve a temporary 15-minute presigned S3 URL for an
+ /// artifact. The `path` query parameter must be a relative path
+ /// under `artifacts/` returned by GET /v1/agents/{id}/artifacts. ///
/// /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// - /// Example: /opt/cursor/artifacts/screenshot.png + /// Example: artifacts/screenshot.png /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task GetAgentArtifactAsync( + public async global::System.Threading.Tasks.Task DownloadArtifactAsync( string id, string path, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, @@ -64,7 +66,7 @@ partial void ProcessGetAgentArtifactResponseContent( { PrepareArguments( client: HttpClient); - PrepareGetAgentArtifactArguments( + PrepareDownloadArtifactArguments( httpClient: HttpClient, id: ref id, path: ref path); @@ -72,8 +74,8 @@ partial void ProcessGetAgentArtifactResponseContent( var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( availableAuthorizations: Authorizations, - securityRequirements: s_GetAgentArtifactSecurityRequirements, - operationName: "GetAgentArtifactAsync"); + securityRequirements: s_DownloadArtifactSecurityRequirements, + operationName: "DownloadArtifactAsync"); using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( clientOptions: Options, @@ -92,7 +94,7 @@ partial void ProcessGetAgentArtifactResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: $"/v0/agents/{id}/artifacts/download", + path: $"/v1/agents/{id}/artifacts/download", baseUri: HttpClient.BaseAddress); __pathBuilder .AddRequiredParameter("path", path) @@ -134,7 +136,7 @@ partial void ProcessGetAgentArtifactResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareGetAgentArtifactRequest( + PrepareDownloadArtifactRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, id: id, @@ -155,9 +157,9 @@ partial void ProcessGetAgentArtifactResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentArtifact", - methodName: "GetAgentArtifactAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts/download\"", + operationId: "DownloadArtifact", + methodName: "DownloadArtifactAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -182,9 +184,9 @@ partial void ProcessGetAgentArtifactResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentArtifact", - methodName: "GetAgentArtifactAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts/download\"", + operationId: "DownloadArtifact", + methodName: "DownloadArtifactAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -217,9 +219,9 @@ partial void ProcessGetAgentArtifactResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentArtifact", - methodName: "GetAgentArtifactAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts/download\"", + operationId: "DownloadArtifact", + methodName: "DownloadArtifactAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -256,7 +258,7 @@ partial void ProcessGetAgentArtifactResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessGetAgentArtifactResponse( + ProcessDownloadArtifactResponse( httpClient: HttpClient, httpResponseMessage: __response); if (__response.IsSuccessStatusCode) @@ -264,9 +266,9 @@ partial void ProcessGetAgentArtifactResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentArtifact", - methodName: "GetAgentArtifactAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts/download\"", + operationId: "DownloadArtifact", + methodName: "DownloadArtifactAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -284,9 +286,9 @@ partial void ProcessGetAgentArtifactResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentArtifact", - methodName: "GetAgentArtifactAsync", - pathTemplate: "$\"/v0/agents/{id}/artifacts/download\"", + operationId: "DownloadArtifact", + methodName: "DownloadArtifactAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -299,7 +301,7 @@ partial void ProcessGetAgentArtifactResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - bad agent ID format, missing path query parameter, or artifacts expired for an agent older than 6 months + // Validation error or malformed request body. if ((int)__response.StatusCode == 400) { string? __content_400 = null; @@ -337,7 +339,7 @@ partial void ProcessGetAgentArtifactResponseContent( h => h.Value), }; } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -375,7 +377,7 @@ partial void ProcessGetAgentArtifactResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -413,7 +415,7 @@ partial void ProcessGetAgentArtifactResponseContent( h => h.Value), }; } - // Agent or artifact not found + // Agent or run not found. if ((int)__response.StatusCode == 404) { string? __content_404 = null; @@ -451,7 +453,7 @@ partial void ProcessGetAgentArtifactResponseContent( h => h.Value), }; } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -489,7 +491,7 @@ partial void ProcessGetAgentArtifactResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -540,7 +542,7 @@ partial void ProcessGetAgentArtifactResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessGetAgentArtifactResponseContent( + ProcessDownloadArtifactResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -550,7 +552,7 @@ partial void ProcessGetAgentArtifactResponseContent( __response.EnsureSuccessStatusCode(); return - global::CursorAgents.GetArtifactResponse.FromJson(__content, JsonSerializerContext) ?? + global::CursorAgents.DownloadArtifactResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } catch (global::System.Exception __ex) @@ -580,7 +582,7 @@ partial void ProcessGetAgentArtifactResponseContent( ).ConfigureAwait(false); return - await global::CursorAgents.GetArtifactResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::CursorAgents.DownloadArtifactResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } catch (global::System.Exception __ex) diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgent.g.cs index a34e80b..460c016 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgent.g.cs @@ -14,10 +14,10 @@ public partial class CursorAgentsClient { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; @@ -42,16 +42,16 @@ partial void ProcessGetAgentResponseContent( ref string content); /// - /// Agent status
- /// Retrieve the current status and results of a cloud agent + /// Get an agent
+ /// Retrieve durable metadata for an agent. Execution status lives on runs. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task GetAgentAsync( + public async global::System.Threading.Tasks.Task GetAgentAsync( string id, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,7 +85,7 @@ partial void ProcessGetAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: $"/v0/agents/{id}", + path: $"/v1/agents/{id}", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -146,7 +146,7 @@ partial void ProcessGetAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAgent", methodName: "GetAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -173,7 +173,7 @@ partial void ProcessGetAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAgent", methodName: "GetAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -208,7 +208,7 @@ partial void ProcessGetAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAgent", methodName: "GetAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -255,7 +255,7 @@ partial void ProcessGetAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAgent", methodName: "GetAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -275,7 +275,7 @@ partial void ProcessGetAgentResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAgent", methodName: "GetAgentAsync", - pathTemplate: "$\"/v0/agents/{id}\"", + pathTemplate: "$\"/v1/agents/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -288,45 +288,7 @@ partial void ProcessGetAgentResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - bad agent ID format - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::CursorAgents.Error? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -364,7 +326,7 @@ partial void ProcessGetAgentResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -402,7 +364,7 @@ partial void ProcessGetAgentResponseContent( h => h.Value), }; } - // Agent not found or access denied + // Agent or run not found. if ((int)__response.StatusCode == 404) { string? __content_404 = null; @@ -440,7 +402,7 @@ partial void ProcessGetAgentResponseContent( h => h.Value), }; } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -478,7 +440,7 @@ partial void ProcessGetAgentResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -539,7 +501,7 @@ partial void ProcessGetAgentResponseContent( __response.EnsureSuccessStatusCode(); return - global::CursorAgents.GetAgentResponse.FromJson(__content, JsonSerializerContext) ?? + global::CursorAgents.Agent.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } catch (global::System.Exception __ex) @@ -569,7 +531,7 @@ partial void ProcessGetAgentResponseContent( ).ConfigureAwait(false); return - await global::CursorAgents.GetAgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::CursorAgents.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } catch (global::System.Exception __ex) diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetMe.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetApiKeyInfo.g.cs similarity index 84% rename from src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetMe.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetApiKeyInfo.g.cs index a3a894f..f51ebe0 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetMe.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetApiKeyInfo.g.cs @@ -7,59 +7,59 @@ public partial class CursorAgentsClient { - private static readonly global::CursorAgents.EndPointSecurityRequirement s_GetMeSecurityRequirement0 = + private static readonly global::CursorAgents.EndPointSecurityRequirement s_GetApiKeyInfoSecurityRequirement0 = new global::CursorAgents.EndPointSecurityRequirement { Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; - private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_GetMeSecurityRequirements = + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_GetApiKeyInfoSecurityRequirements = new global::CursorAgents.EndPointSecurityRequirement[] - { s_GetMeSecurityRequirement0, + { s_GetApiKeyInfoSecurityRequirement0, }; - partial void PrepareGetMeArguments( + partial void PrepareGetApiKeyInfoArguments( global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetMeRequest( + partial void PrepareGetApiKeyInfoRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetMeResponse( + partial void ProcessGetApiKeyInfoResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessGetMeResponseContent( + partial void ProcessGetApiKeyInfoResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); /// /// API key info
- /// Retrieve information about the API key being used for authentication + /// Retrieve information about the API key being used for authentication. ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task GetMeAsync( + public async global::System.Threading.Tasks.Task GetApiKeyInfoAsync( global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); - PrepareGetMeArguments( + PrepareGetApiKeyInfoArguments( httpClient: HttpClient); var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( availableAuthorizations: Authorizations, - securityRequirements: s_GetMeSecurityRequirements, - operationName: "GetMeAsync"); + securityRequirements: s_GetApiKeyInfoSecurityRequirements, + operationName: "GetApiKeyInfoAsync"); using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( clientOptions: Options, @@ -78,7 +78,7 @@ partial void ProcessGetMeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: "/v0/me", + path: "/v1/me", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -117,7 +117,7 @@ partial void ProcessGetMeResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareGetMeRequest( + PrepareGetApiKeyInfoRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest); @@ -136,9 +136,9 @@ partial void ProcessGetMeResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMe", - methodName: "GetMeAsync", - pathTemplate: "\"/v0/me\"", + operationId: "GetApiKeyInfo", + methodName: "GetApiKeyInfoAsync", + pathTemplate: "\"/v1/me\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -163,9 +163,9 @@ partial void ProcessGetMeResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMe", - methodName: "GetMeAsync", - pathTemplate: "\"/v0/me\"", + operationId: "GetApiKeyInfo", + methodName: "GetApiKeyInfoAsync", + pathTemplate: "\"/v1/me\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -198,9 +198,9 @@ partial void ProcessGetMeResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMe", - methodName: "GetMeAsync", - pathTemplate: "\"/v0/me\"", + operationId: "GetApiKeyInfo", + methodName: "GetApiKeyInfoAsync", + pathTemplate: "\"/v1/me\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -237,7 +237,7 @@ partial void ProcessGetMeResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessGetMeResponse( + ProcessGetApiKeyInfoResponse( httpClient: HttpClient, httpResponseMessage: __response); if (__response.IsSuccessStatusCode) @@ -245,9 +245,9 @@ partial void ProcessGetMeResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMe", - methodName: "GetMeAsync", - pathTemplate: "\"/v0/me\"", + operationId: "GetApiKeyInfo", + methodName: "GetApiKeyInfoAsync", + pathTemplate: "\"/v1/me\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -265,9 +265,9 @@ partial void ProcessGetMeResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetMe", - methodName: "GetMeAsync", - pathTemplate: "\"/v0/me\"", + operationId: "GetApiKeyInfo", + methodName: "GetApiKeyInfoAsync", + pathTemplate: "\"/v1/me\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -280,7 +280,7 @@ partial void ProcessGetMeResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -318,45 +318,7 @@ partial void ProcessGetMeResponseContent( h => h.Value), }; } - // API key not found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::CursorAgents.Error? __value_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::CursorAgents.Error.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_404 = global::CursorAgents.Error.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -394,7 +356,7 @@ partial void ProcessGetMeResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -445,7 +407,7 @@ partial void ProcessGetMeResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessGetMeResponseContent( + ProcessGetApiKeyInfoResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -455,7 +417,7 @@ partial void ProcessGetMeResponseContent( __response.EnsureSuccessStatusCode(); return - global::CursorAgents.GetMeResponse.FromJson(__content, JsonSerializerContext) ?? + global::CursorAgents.ApiKeyInfo.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } catch (global::System.Exception __ex) @@ -485,7 +447,7 @@ partial void ProcessGetMeResponseContent( ).ConfigureAwait(false); return - await global::CursorAgents.GetMeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::CursorAgents.ApiKeyInfo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } catch (global::System.Exception __ex) diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetRun.g.cs new file mode 100644 index 0000000..09ecd98 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetRun.g.cs @@ -0,0 +1,582 @@ + +#nullable enable + +namespace CursorAgents +{ + public partial class CursorAgentsClient + { + + + private static readonly global::CursorAgents.EndPointSecurityRequirement s_GetRunSecurityRequirement0 = + new global::CursorAgents.EndPointSecurityRequirement + { + Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] + { new global::CursorAgents.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BasicAuth", + Location = "Header", + Name = "Basic", + FriendlyName = "Basic", + }, + }, + }; + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_GetRunSecurityRequirements = + new global::CursorAgents.EndPointSecurityRequirement[] + { s_GetRunSecurityRequirement0, + }; + partial void PrepareGetRunArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + ref string runId); + partial void PrepareGetRunRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + string runId); + partial void ProcessGetRunResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetRunResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a run
+ /// Retrieve status and timestamps for a specific run. + ///
+ /// + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Example: run-00000000-0000-0000-0000-000000000001 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetRunAsync( + string id, + string runId, + global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetRunArguments( + httpClient: HttpClient, + id: ref id, + runId: ref runId); + + + var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetRunSecurityRequirements, + operationName: "GetRunAsync"); + + using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::CursorAgents.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::CursorAgents.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::CursorAgents.PathBuilder( + path: $"/v1/agents/{id}/runs/{runId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::CursorAgents.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetRunRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + runId: runId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRun", + methodName: "GetRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRun", + methodName: "GetRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::CursorAgents.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::CursorAgents.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRun", + methodName: "GetRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::CursorAgents.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetRunResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRun", + methodName: "GetRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRun", + methodName: "GetRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid or missing API key. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::CursorAgents.Error? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::CursorAgents.Error.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::CursorAgents.Error.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Authenticated but insufficient permissions, plan required, or feature unavailable. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::CursorAgents.Error? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::CursorAgents.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::CursorAgents.Error.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Agent or run not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::CursorAgents.Error? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::CursorAgents.Error.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::CursorAgents.Error.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::CursorAgents.Error? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::CursorAgents.Error.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::CursorAgents.Error.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseObject = __value_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::CursorAgents.Error? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::CursorAgents.Error.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::CursorAgents.Error.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetRunResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::CursorAgents.Run.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::CursorAgents.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::CursorAgents.Run.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::CursorAgents.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgents.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgents.g.cs index 2387629..66f5436 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgents.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgents.g.cs @@ -14,10 +14,10 @@ public partial class CursorAgentsClient { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; @@ -29,13 +29,15 @@ partial void PrepareListAgentsArguments( global::System.Net.Http.HttpClient httpClient, ref int? limit, ref string? cursor, - ref string? prUrl); + ref string? prUrl, + ref bool? includeArchived); partial void PrepareListAgentsRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, int? limit, string? cursor, - string? prUrl); + string? prUrl, + bool? includeArchived); partial void ProcessListAgentsResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -47,16 +49,15 @@ partial void ProcessListAgentsResponseContent( /// /// List agents
- /// List all cloud agents for the authenticated user + /// List agents for the authenticated user, newest first. ///
/// /// Default Value: 20 /// - /// - /// Example: bc_xyz789 - /// - /// - /// Example: https://github.com/your-org/your-repo/pull/123 + /// + /// + /// + /// Default Value: true /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -65,6 +66,7 @@ partial void ProcessListAgentsResponseContent( int? limit = default, string? cursor = default, string? prUrl = default, + bool? includeArchived = default, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -74,7 +76,8 @@ partial void ProcessListAgentsResponseContent( httpClient: HttpClient, limit: ref limit, cursor: ref cursor, - prUrl: ref prUrl); + prUrl: ref prUrl, + includeArchived: ref includeArchived); var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( @@ -99,12 +102,13 @@ partial void ProcessListAgentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: "/v0/agents", + path: "/v1/agents", baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("cursor", cursor) - .AddOptionalParameter("prUrl", prUrl) + .AddOptionalParameter("prUrl", prUrl) + .AddOptionalParameter("includeArchived", includeArchived?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -148,7 +152,8 @@ partial void ProcessListAgentsResponseContent( httpRequestMessage: __httpRequest, limit: limit, cursor: cursor, - prUrl: prUrl); + prUrl: prUrl, + includeArchived: includeArchived); return __httpRequest; } @@ -167,7 +172,7 @@ partial void ProcessListAgentsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListAgents", methodName: "ListAgentsAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -194,7 +199,7 @@ partial void ProcessListAgentsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListAgents", methodName: "ListAgentsAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -229,7 +234,7 @@ partial void ProcessListAgentsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListAgents", methodName: "ListAgentsAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -276,7 +281,7 @@ partial void ProcessListAgentsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListAgents", methodName: "ListAgentsAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -296,7 +301,7 @@ partial void ProcessListAgentsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListAgents", methodName: "ListAgentsAsync", - pathTemplate: "\"/v0/agents\"", + pathTemplate: "\"/v1/agents\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -309,7 +314,7 @@ partial void ProcessListAgentsResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - bad query parameters + // Validation error or malformed request body. if ((int)__response.StatusCode == 400) { string? __content_400 = null; @@ -347,7 +352,7 @@ partial void ProcessListAgentsResponseContent( h => h.Value), }; } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -385,7 +390,7 @@ partial void ProcessListAgentsResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -423,7 +428,7 @@ partial void ProcessListAgentsResponseContent( h => h.Value), }; } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -461,7 +466,7 @@ partial void ProcessListAgentsResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgentConversation.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListArtifacts.g.cs similarity index 79% rename from src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgentConversation.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListArtifacts.g.cs index 40e2ac2..ef5c205 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgentConversation.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListArtifacts.g.cs @@ -7,66 +7,69 @@ public partial class CursorAgentsClient { - private static readonly global::CursorAgents.EndPointSecurityRequirement s_GetAgentConversationSecurityRequirement0 = + private static readonly global::CursorAgents.EndPointSecurityRequirement s_ListArtifactsSecurityRequirement0 = new global::CursorAgents.EndPointSecurityRequirement { Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; - private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_GetAgentConversationSecurityRequirements = + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_ListArtifactsSecurityRequirements = new global::CursorAgents.EndPointSecurityRequirement[] - { s_GetAgentConversationSecurityRequirement0, + { s_ListArtifactsSecurityRequirement0, }; - partial void PrepareGetAgentConversationArguments( + partial void PrepareListArtifactsArguments( global::System.Net.Http.HttpClient httpClient, ref string id); - partial void PrepareGetAgentConversationRequest( + partial void PrepareListArtifactsRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, string id); - partial void ProcessGetAgentConversationResponse( + partial void ProcessListArtifactsResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); - partial void ProcessGetAgentConversationResponseContent( + partial void ProcessListArtifactsResponseContent( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage, ref string content); /// - /// Get agent conversation
- /// Retrieve the conversation history of a cloud agent, including all user prompts and assistant responses + /// List artifacts
+ /// List artifacts produced by an agent. Each artifact's `path` is
+ /// relative to the workspace's `artifacts/` directory. Pass that
+ /// `path` to GET /v1/agents/{id}/artifacts/download to obtain a
+ /// presigned download URL. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - public async global::System.Threading.Tasks.Task GetAgentConversationAsync( + public async global::System.Threading.Tasks.Task ListArtifactsAsync( string id, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); - PrepareGetAgentConversationArguments( + PrepareListArtifactsArguments( httpClient: HttpClient, id: ref id); var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( availableAuthorizations: Authorizations, - securityRequirements: s_GetAgentConversationSecurityRequirements, - operationName: "GetAgentConversationAsync"); + securityRequirements: s_ListArtifactsSecurityRequirements, + operationName: "ListArtifactsAsync"); using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( clientOptions: Options, @@ -85,7 +88,7 @@ partial void ProcessGetAgentConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: $"/v0/agents/{id}/conversation", + path: $"/v1/agents/{id}/artifacts", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -124,7 +127,7 @@ partial void ProcessGetAgentConversationResponseContent( PrepareRequest( client: HttpClient, request: __httpRequest); - PrepareGetAgentConversationRequest( + PrepareListArtifactsRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, id: id); @@ -144,9 +147,9 @@ partial void ProcessGetAgentConversationResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentConversation", - methodName: "GetAgentConversationAsync", - pathTemplate: "$\"/v0/agents/{id}/conversation\"", + operationId: "ListArtifacts", + methodName: "ListArtifactsAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -171,9 +174,9 @@ partial void ProcessGetAgentConversationResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentConversation", - methodName: "GetAgentConversationAsync", - pathTemplate: "$\"/v0/agents/{id}/conversation\"", + operationId: "ListArtifacts", + methodName: "ListArtifactsAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -206,9 +209,9 @@ partial void ProcessGetAgentConversationResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentConversation", - methodName: "GetAgentConversationAsync", - pathTemplate: "$\"/v0/agents/{id}/conversation\"", + operationId: "ListArtifacts", + methodName: "ListArtifactsAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -245,7 +248,7 @@ partial void ProcessGetAgentConversationResponseContent( ProcessResponse( client: HttpClient, response: __response); - ProcessGetAgentConversationResponse( + ProcessListArtifactsResponse( httpClient: HttpClient, httpResponseMessage: __response); if (__response.IsSuccessStatusCode) @@ -253,9 +256,9 @@ partial void ProcessGetAgentConversationResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentConversation", - methodName: "GetAgentConversationAsync", - pathTemplate: "$\"/v0/agents/{id}/conversation\"", + operationId: "ListArtifacts", + methodName: "ListArtifactsAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -273,9 +276,9 @@ partial void ProcessGetAgentConversationResponseContent( await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( - operationId: "GetAgentConversation", - methodName: "GetAgentConversationAsync", - pathTemplate: "$\"/v0/agents/{id}/conversation\"", + operationId: "ListArtifacts", + methodName: "ListArtifactsAsync", + pathTemplate: "$\"/v1/agents/{id}/artifacts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -288,45 +291,7 @@ partial void ProcessGetAgentConversationResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - bad agent ID format - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::CursorAgents.Error? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::CursorAgents.Error.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -364,7 +329,7 @@ partial void ProcessGetAgentConversationResponseContent( h => h.Value), }; } - // Forbidden - insufficient permissions + // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -402,7 +367,7 @@ partial void ProcessGetAgentConversationResponseContent( h => h.Value), }; } - // Agent not found or access denied + // Agent or run not found. if ((int)__response.StatusCode == 404) { string? __content_404 = null; @@ -440,45 +405,7 @@ partial void ProcessGetAgentConversationResponseContent( h => h.Value), }; } - // Conflict - agent is deleted or archived - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::CursorAgents.Error? __value_409 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_409 = global::CursorAgents.Error.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_409 = global::CursorAgents.Error.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::CursorAgents.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -516,7 +443,7 @@ partial void ProcessGetAgentConversationResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; @@ -567,7 +494,7 @@ partial void ProcessGetAgentConversationResponseContent( client: HttpClient, response: __response, content: ref __content); - ProcessGetAgentConversationResponseContent( + ProcessListArtifactsResponseContent( httpClient: HttpClient, httpResponseMessage: __response, content: ref __content); @@ -577,7 +504,7 @@ partial void ProcessGetAgentConversationResponseContent( __response.EnsureSuccessStatusCode(); return - global::CursorAgents.GetAgentConversationResponse.FromJson(__content, JsonSerializerContext) ?? + global::CursorAgents.ListArtifactsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } catch (global::System.Exception __ex) @@ -607,7 +534,7 @@ partial void ProcessGetAgentConversationResponseContent( ).ConfigureAwait(false); return - await global::CursorAgents.GetAgentConversationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + await global::CursorAgents.ListArtifactsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } catch (global::System.Exception __ex) diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListModels.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListModels.g.cs index 69308a0..9e33c5b 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListModels.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListModels.g.cs @@ -14,10 +14,10 @@ public partial class CursorAgentsClient { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; @@ -40,8 +40,11 @@ partial void ProcessListModelsResponseContent( ref string content); /// - /// List available models
- /// Returns a recommended set of explicit model IDs for launch requests. This list excludes "default". + /// List models
+ /// Returns a recommended set of explicit model IDs you can pass
+ /// to the `model.id` field on POST /v1/agents. To use the
+ /// configured default model, omit the `model` field from the
+ /// request body entirely. ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -78,7 +81,7 @@ partial void ProcessListModelsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: "/v0/models", + path: "/v1/models", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -138,7 +141,7 @@ partial void ProcessListModelsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModels", methodName: "ListModelsAsync", - pathTemplate: "\"/v0/models\"", + pathTemplate: "\"/v1/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -165,7 +168,7 @@ partial void ProcessListModelsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModels", methodName: "ListModelsAsync", - pathTemplate: "\"/v0/models\"", + pathTemplate: "\"/v1/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -200,7 +203,7 @@ partial void ProcessListModelsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModels", methodName: "ListModelsAsync", - pathTemplate: "\"/v0/models\"", + pathTemplate: "\"/v1/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -247,7 +250,7 @@ partial void ProcessListModelsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModels", methodName: "ListModelsAsync", - pathTemplate: "\"/v0/models\"", + pathTemplate: "\"/v1/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -267,7 +270,7 @@ partial void ProcessListModelsResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModels", methodName: "ListModelsAsync", - pathTemplate: "\"/v0/models\"", + pathTemplate: "\"/v1/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -280,7 +283,7 @@ partial void ProcessListModelsResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -318,7 +321,7 @@ partial void ProcessListModelsResponseContent( h => h.Value), }; } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -356,7 +359,7 @@ partial void ProcessListModelsResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRepositories.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRepositories.g.cs index 96f02c8..d47472b 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRepositories.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRepositories.g.cs @@ -14,10 +14,10 @@ public partial class CursorAgentsClient { new global::CursorAgents.EndPointAuthorizationRequirement { Type = "Http", - SchemeId = "BearerAuth", + SchemeId = "BasicAuth", Location = "Header", - Name = "Bearer", - FriendlyName = "Bearer", + Name = "Basic", + FriendlyName = "Basic", }, }, }; @@ -41,7 +41,13 @@ partial void ProcessListRepositoriesResponseContent( /// /// List GitHub repositories
- /// Retrieve a list of GitHub repositories accessible to the authenticated user + /// List GitHub repositories accessible to the authenticated user
+ /// through Cursor's GitHub App installation. This endpoint has
+ /// very strict rate limits (1 request per user per minute, 30
+ /// per user per hour) and can take tens of seconds to respond
+ /// for users with access to many repositories. Cache responses
+ /// aggressively and handle this information not being available
+ /// gracefully. ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -78,7 +84,7 @@ partial void ProcessListRepositoriesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { var __pathBuilder = new global::CursorAgents.PathBuilder( - path: "/v0/repositories", + path: "/v1/repositories", baseUri: HttpClient.BaseAddress); var __path = __pathBuilder.ToString(); __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -138,7 +144,7 @@ partial void ProcessListRepositoriesResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListRepositories", methodName: "ListRepositoriesAsync", - pathTemplate: "\"/v0/repositories\"", + pathTemplate: "\"/v1/repositories\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -165,7 +171,7 @@ partial void ProcessListRepositoriesResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListRepositories", methodName: "ListRepositoriesAsync", - pathTemplate: "\"/v0/repositories\"", + pathTemplate: "\"/v1/repositories\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -200,7 +206,7 @@ partial void ProcessListRepositoriesResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListRepositories", methodName: "ListRepositoriesAsync", - pathTemplate: "\"/v0/repositories\"", + pathTemplate: "\"/v1/repositories\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -247,7 +253,7 @@ partial void ProcessListRepositoriesResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListRepositories", methodName: "ListRepositoriesAsync", - pathTemplate: "\"/v0/repositories\"", + pathTemplate: "\"/v1/repositories\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -267,7 +273,7 @@ partial void ProcessListRepositoriesResponseContent( context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListRepositories", methodName: "ListRepositoriesAsync", - pathTemplate: "\"/v0/repositories\"", + pathTemplate: "\"/v1/repositories\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest!, @@ -280,7 +286,7 @@ partial void ProcessListRepositoriesResponseContent( willRetry: false, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Unauthorized - invalid or missing API key + // Invalid or missing API key. if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -318,7 +324,7 @@ partial void ProcessListRepositoriesResponseContent( h => h.Value), }; } - // Rate limit exceeded + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) { string? __content_429 = null; @@ -356,7 +362,7 @@ partial void ProcessListRepositoriesResponseContent( h => h.Value), }; } - // Internal server error + // Internal server error. if ((int)__response.StatusCode == 500) { string? __content_500 = null; diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRuns.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRuns.g.cs new file mode 100644 index 0000000..9ef27cf --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRuns.g.cs @@ -0,0 +1,592 @@ + +#nullable enable + +namespace CursorAgents +{ + public partial class CursorAgentsClient + { + + + private static readonly global::CursorAgents.EndPointSecurityRequirement s_ListRunsSecurityRequirement0 = + new global::CursorAgents.EndPointSecurityRequirement + { + Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] + { new global::CursorAgents.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BasicAuth", + Location = "Header", + Name = "Basic", + FriendlyName = "Basic", + }, + }, + }; + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_ListRunsSecurityRequirements = + new global::CursorAgents.EndPointSecurityRequirement[] + { s_ListRunsSecurityRequirement0, + }; + partial void PrepareListRunsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + ref int? limit, + ref string? cursor); + partial void PrepareListRunsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + int? limit, + string? cursor); + partial void ProcessListRunsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListRunsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List runs
+ /// List runs for an agent, newest first. + ///
+ /// + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ListRunsAsync( + string id, + int? limit = default, + string? cursor = default, + global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListRunsArguments( + httpClient: HttpClient, + id: ref id, + limit: ref limit, + cursor: ref cursor); + + + var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListRunsSecurityRequirements, + operationName: "ListRunsAsync"); + + using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::CursorAgents.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::CursorAgents.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::CursorAgents.PathBuilder( + path: $"/v1/agents/{id}/runs", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("cursor", cursor) + ; + var __path = __pathBuilder.ToString(); + __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::CursorAgents.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListRunsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + limit: limit, + cursor: cursor); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListRuns", + methodName: "ListRunsAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListRuns", + methodName: "ListRunsAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::CursorAgents.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::CursorAgents.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListRuns", + methodName: "ListRunsAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::CursorAgents.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListRunsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListRuns", + methodName: "ListRunsAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListRuns", + methodName: "ListRunsAsync", + pathTemplate: "$\"/v1/agents/{id}/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid or missing API key. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::CursorAgents.Error? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::CursorAgents.Error.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::CursorAgents.Error.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Authenticated but insufficient permissions, plan required, or feature unavailable. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::CursorAgents.Error? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::CursorAgents.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::CursorAgents.Error.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Agent or run not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::CursorAgents.Error? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::CursorAgents.Error.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::CursorAgents.Error.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::CursorAgents.Error? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::CursorAgents.Error.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::CursorAgents.Error.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseObject = __value_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::CursorAgents.Error? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::CursorAgents.Error.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::CursorAgents.Error.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListRunsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::CursorAgents.ListRunsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::CursorAgents.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::CursorAgents.ListRunsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::CursorAgents.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs new file mode 100644 index 0000000..ee00162 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs @@ -0,0 +1,383 @@ + +#nullable enable + +namespace CursorAgents +{ + public partial class CursorAgentsClient + { + + + private static readonly global::CursorAgents.EndPointSecurityRequirement s_StreamRunSecurityRequirement0 = + new global::CursorAgents.EndPointSecurityRequirement + { + Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] + { new global::CursorAgents.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BasicAuth", + Location = "Header", + Name = "Basic", + FriendlyName = "Basic", + }, + }, + }; + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_StreamRunSecurityRequirements = + new global::CursorAgents.EndPointSecurityRequirement[] + { s_StreamRunSecurityRequirement0, + }; + partial void PrepareStreamRunArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + ref string runId, + ref string? lastEventId); + partial void PrepareStreamRunRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + string runId, + string? lastEventId); + partial void ProcessStreamRunResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Stream a run
+ /// Stream Server-Sent Events for one run. Event types include
+ /// `status`, `assistant`, `thinking`, `tool_call`, `heartbeat`,
+ /// `result`, `error`, and `done`. Reconnect with the
+ /// `Last-Event-ID` header to resume after a disconnect; the event
+ /// ID must belong to the requested run. Responses include the
+ /// `X-Cursor-Stream-Retention-Seconds` header. After the
+ /// retention window the endpoint may return `410 stream_expired`. + ///
+ /// + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Example: run-00000000-0000-0000-0000-000000000001 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Collections.Generic.IAsyncEnumerable StreamRunAsync( + string id, + string runId, + string? lastEventId = default, + global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, + [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareStreamRunArguments( + httpClient: HttpClient, + id: ref id, + runId: ref runId, + lastEventId: ref lastEventId); + + + var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_StreamRunSecurityRequirements, + operationName: "StreamRunAsync"); + + using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::CursorAgents.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::CursorAgents.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::CursorAgents.PathBuilder( + path: $"/v1/agents/{id}/runs/{runId}/stream", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (lastEventId != default) + { + __httpRequest.Headers.TryAddWithoutValidation("Last-Event-ID", lastEventId.ToString()); + } + + global::CursorAgents.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareStreamRunRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + runId: runId, + lastEventId: lastEventId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamRun", + methodName: "StreamRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/stream\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamRun", + methodName: "StreamRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/stream\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::CursorAgents.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::CursorAgents.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamRun", + methodName: "StreamRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/stream\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::CursorAgents.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessStreamRunResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamRun", + methodName: "StreamRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/stream\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamRun", + methodName: "StreamRunAsync", + pathTemplate: "$\"/v1/agents/{id}/runs/{runId}/stream\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::CursorAgents.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + using var __stream = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + await foreach (var __sseEvent in global::System.Net.ServerSentEvents.SseParser + .Create(__stream).EnumerateAsync(__effectiveCancellationToken)) + { + var __content = __sseEvent.Data; + if (__content == "[DONE]") + { + yield break; + } + + var __streamedResponse = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(string), JsonSerializerContext) ?? + throw new global::CursorAgents.ApiException( + message: $"Response deserialization failed for \"{__content}\" ", + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + + yield return __streamedResponse; + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.UnarchiveAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.UnarchiveAgent.g.cs new file mode 100644 index 0000000..197ec35 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.UnarchiveAgent.g.cs @@ -0,0 +1,574 @@ + +#nullable enable + +namespace CursorAgents +{ + public partial class CursorAgentsClient + { + + + private static readonly global::CursorAgents.EndPointSecurityRequirement s_UnarchiveAgentSecurityRequirement0 = + new global::CursorAgents.EndPointSecurityRequirement + { + Authorizations = new global::CursorAgents.EndPointAuthorizationRequirement[] + { new global::CursorAgents.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "BasicAuth", + Location = "Header", + Name = "Basic", + FriendlyName = "Basic", + }, + }, + }; + private static readonly global::CursorAgents.EndPointSecurityRequirement[] s_UnarchiveAgentSecurityRequirements = + new global::CursorAgents.EndPointSecurityRequirement[] + { s_UnarchiveAgentSecurityRequirement0, + }; + partial void PrepareUnarchiveAgentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareUnarchiveAgentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessUnarchiveAgentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUnarchiveAgentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Unarchive an agent
+ /// Unarchive an agent so it can accept new runs again. + ///
+ /// + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UnarchiveAgentAsync( + string id, + global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUnarchiveAgentArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::CursorAgents.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UnarchiveAgentSecurityRequirements, + operationName: "UnarchiveAgentAsync"); + + using var __timeoutCancellationTokenSource = global::CursorAgents.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::CursorAgents.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::CursorAgents.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::CursorAgents.PathBuilder( + path: $"/v1/agents/{id}/unarchive", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::CursorAgents.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::CursorAgents.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUnarchiveAgentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UnarchiveAgent", + methodName: "UnarchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/unarchive\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UnarchiveAgent", + methodName: "UnarchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/unarchive\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::CursorAgents.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::CursorAgents.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UnarchiveAgent", + methodName: "UnarchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/unarchive\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::CursorAgents.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUnarchiveAgentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UnarchiveAgent", + methodName: "UnarchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/unarchive\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::CursorAgents.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::CursorAgents.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UnarchiveAgent", + methodName: "UnarchiveAgentAsync", + pathTemplate: "$\"/v1/agents/{id}/unarchive\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid or missing API key. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::CursorAgents.Error? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::CursorAgents.Error.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::CursorAgents.Error.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Authenticated but insufficient permissions, plan required, or feature unavailable. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::CursorAgents.Error? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::CursorAgents.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::CursorAgents.Error.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Agent or run not found. + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::CursorAgents.Error? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::CursorAgents.Error.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::CursorAgents.Error.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::CursorAgents.Error? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::CursorAgents.Error.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::CursorAgents.Error.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseObject = __value_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal server error. + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::CursorAgents.Error? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::CursorAgents.Error.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::CursorAgents.Error.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::CursorAgents.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUnarchiveAgentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::CursorAgents.IdResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::CursorAgents.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::CursorAgents.IdResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::CursorAgents.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.g.cs index fee11b4..a5eca2f 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.g.cs @@ -4,7 +4,10 @@ namespace CursorAgents { /// - /// Programmatically create and manage AI-powered coding agents that work autonomously on your repositories
+ /// Programmatically create and manage Cursor Cloud Agents that work
+ /// autonomously on your repositories. v1 separates a durable agent
+ /// from one or more runs: each prompt submission creates a run on the
+ /// agent. Streaming and cancellation are scoped to the active run.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListAgentArtifacts.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ArchiveAgent.g.cs similarity index 80% rename from src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListAgentArtifacts.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ArchiveAgent.g.cs index 5ffa22c..35e256c 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListAgentArtifacts.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ArchiveAgent.g.cs @@ -5,8 +5,8 @@ namespace CursorAgents public partial interface ICursorAgentsClient { /// - /// List agent artifacts
- /// List artifacts generated by a cloud agent created within the last 6 months. Returns at most 100 artifacts. + /// Archive an agent
+ /// Archive an agent. Archived agents remain readable but cannot accept new runs until unarchived. ///
/// /// Example: bc-00000000-0000-0000-0000-000000000001 @@ -14,7 +14,7 @@ public partial interface ICursorAgentsClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task ListAgentArtifactsAsync( + global::System.Threading.Tasks.Task ArchiveAgentAsync( string id, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.Authorizations.Basic.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.Authorizations.Basic.g.cs new file mode 100644 index 0000000..e1374cd --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.Authorizations.Basic.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace CursorAgents +{ + public partial interface ICursorAgentsClient + { + /// + /// Authorize using basic authentication. + /// + /// + /// + + public void AuthorizeUsingBasic( + string username, + string password); + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.Authorizations.Bearer.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.Authorizations.Bearer.g.cs deleted file mode 100644 index 4937452..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.Authorizations.Bearer.g.cs +++ /dev/null @@ -1,16 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - public partial interface ICursorAgentsClient - { - /// - /// Authorize using bearer authentication. - /// - /// - - public void AuthorizeUsingBearer( - string apiKey); - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CancelRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CancelRun.g.cs new file mode 100644 index 0000000..a280d83 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CancelRun.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace CursorAgents +{ + public partial interface ICursorAgentsClient + { + /// + /// Cancel a run
+ /// Cancel the active run for an agent. Cancellation is terminal —
+ /// the run transitions to `CANCELLED`. Cancelling a run that is
+ /// already terminal or was never active returns
+ /// `409 run_not_cancellable`. To continue the conversation,
+ /// create a new run on the same agent. + ///
+ /// + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Example: run-00000000-0000-0000-0000-000000000001 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CancelRunAsync( + string id, + string runId, + global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateAgent.g.cs index 1f5abe5..d51061a 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateAgent.g.cs @@ -5,8 +5,10 @@ namespace CursorAgents public partial interface ICursorAgentsClient { /// - /// Launch an agent
- /// Start a new cloud agent to work on your repository + /// Create an agent
+ /// Create a Cloud Agent and immediately enqueue its initial run.
+ /// The response contains both the durable `agent` and the initial
+ /// `run`. ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -18,26 +20,43 @@ public partial interface ICursorAgentsClient global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// - /// Launch an agent
- /// Start a new cloud agent to work on your repository + /// Create an agent
+ /// Create a Cloud Agent and immediately enqueue its initial run.
+ /// The response contains both the durable `agent` and the initial
+ /// `run`. ///
/// - /// - /// Set to an explicit model ID for launch requests, or use "default" to use the configured default model. When omitted, Cursor resolves your user default model, then your team default model, then a system default.
- /// Example: claude-4-sonnet + /// + /// + /// Repository configuration. v1 currently supports one entry. + /// + /// + /// Custom branch name for the agent to create.
+ /// Example: feature/add-readme + /// + /// + /// Whether to create a new branch (true) or push to an existing head branch (false). Only applies when `repos[0].prUrl` is provided.
+ /// Default Value: true + /// + /// + /// Whether Cursor should open a pull request when the run completes.
+ /// Default Value: false + /// + /// + /// Whether to skip requesting the user as a reviewer when Cursor opens a PR. Only applies when `autoCreatePR` is true.
+ /// Default Value: false /// - /// - /// - /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// global::System.Threading.Tasks.Task CreateAgentAsync( global::CursorAgents.CreateAgentRequestPrompt prompt, - global::CursorAgents.CreateAgentRequestSource source, - string? model = default, - global::CursorAgents.CreateAgentRequestTarget? target = default, - global::CursorAgents.CreateAgentRequestWebhook? webhook = default, + global::System.Collections.Generic.IList repos, + global::CursorAgents.ModelRef? model = default, + string? branchName = default, + bool? autoGenerateBranch = default, + bool? autoCreatePR = default, + bool? skipReviewerRequest = default, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.AddFollowup.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateRun.g.cs similarity index 65% rename from src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.AddFollowup.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateRun.g.cs index 354bf7c..e1b4d99 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.AddFollowup.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateRun.g.cs @@ -5,36 +5,40 @@ namespace CursorAgents public partial interface ICursorAgentsClient { /// - /// Add followup
- /// Add a followup instruction to an existing cloud agent + /// Create a run
+ /// Send a follow-up prompt to an existing active agent. The new
+ /// run uses the agent's current conversation and workspace state.
+ /// Only one run can be active per agent at a time. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task AddFollowupAsync( + global::System.Threading.Tasks.Task CreateRunAsync( string id, - global::CursorAgents.AddFollowupRequest request, + global::CursorAgents.CreateRunRequest request, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// - /// Add followup
- /// Add a followup instruction to an existing cloud agent + /// Create a run
+ /// Send a follow-up prompt to an existing active agent. The new
+ /// run uses the agent's current conversation and workspace state.
+ /// Only one run can be active per agent at a time. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task AddFollowupAsync( + global::System.Threading.Tasks.Task CreateRunAsync( string id, - global::CursorAgents.AddFollowupRequestPrompt prompt, + global::CursorAgents.CreateRunRequestPrompt prompt, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.DeleteAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.DeleteAgent.g.cs index 83ee9af..c7d0741 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.DeleteAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.DeleteAgent.g.cs @@ -5,16 +5,16 @@ namespace CursorAgents public partial interface ICursorAgentsClient { /// - /// Delete an agent
- /// Delete a cloud agent. This action is permanent and cannot be undone. + /// Delete an agent permanently
+ /// Permanently delete an agent. This action is irreversible. Use POST /v1/agents/{id}/archive for reversible removal. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task DeleteAgentAsync( + global::System.Threading.Tasks.Task DeleteAgentAsync( string id, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgentArtifact.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.DownloadArtifact.g.cs similarity index 79% rename from src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgentArtifact.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.DownloadArtifact.g.cs index 46f0bf1..e2c65d3 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgentArtifact.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.DownloadArtifact.g.cs @@ -6,18 +6,20 @@ public partial interface ICursorAgentsClient { /// /// Download an artifact
- /// Retrieve a temporary 15-minute presigned S3 URL for a specific artifact from an agent created within the last 6 months. The response includes both the URL and its expiration time. + /// Retrieve a temporary 15-minute presigned S3 URL for an
+ /// artifact. The `path` query parameter must be a relative path
+ /// under `artifacts/` returned by GET /v1/agents/{id}/artifacts. ///
/// /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// - /// Example: /opt/cursor/artifacts/screenshot.png + /// Example: artifacts/screenshot.png /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task GetAgentArtifactAsync( + global::System.Threading.Tasks.Task DownloadArtifactAsync( string id, string path, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgent.g.cs index e4aab8b..cf32293 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgent.g.cs @@ -5,16 +5,16 @@ namespace CursorAgents public partial interface ICursorAgentsClient { /// - /// Agent status
- /// Retrieve the current status and results of a cloud agent + /// Get an agent
+ /// Retrieve durable metadata for an agent. Execution status lives on runs. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task GetAgentAsync( + global::System.Threading.Tasks.Task GetAgentAsync( string id, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetMe.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetApiKeyInfo.g.cs similarity index 93% rename from src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetMe.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetApiKeyInfo.g.cs index 018c0be..a56d410 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetMe.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetApiKeyInfo.g.cs @@ -6,12 +6,12 @@ public partial interface ICursorAgentsClient { /// /// API key info
- /// Retrieve information about the API key being used for authentication + /// Retrieve information about the API key being used for authentication. ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task GetMeAsync( + global::System.Threading.Tasks.Task GetApiKeyInfoAsync( global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgentConversation.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetRun.g.cs similarity index 71% rename from src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgentConversation.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetRun.g.cs index 5e8a835..343e41b 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetAgentConversation.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.GetRun.g.cs @@ -5,17 +5,21 @@ namespace CursorAgents public partial interface ICursorAgentsClient { /// - /// Get agent conversation
- /// Retrieve the conversation history of a cloud agent, including all user prompts and assistant responses + /// Get a run
+ /// Retrieve status and timestamps for a specific run. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Example: run-00000000-0000-0000-0000-000000000001 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task GetAgentConversationAsync( + global::System.Threading.Tasks.Task GetRunAsync( string id, + string runId, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListAgents.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListAgents.g.cs index 47cf309..67b4de9 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListAgents.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListAgents.g.cs @@ -6,16 +6,15 @@ public partial interface ICursorAgentsClient { /// /// List agents
- /// List all cloud agents for the authenticated user + /// List agents for the authenticated user, newest first. ///
/// /// Default Value: 20 /// - /// - /// Example: bc_xyz789 - /// - /// - /// Example: https://github.com/your-org/your-repo/pull/123 + /// + /// + /// + /// Default Value: true /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -24,6 +23,7 @@ public partial interface ICursorAgentsClient int? limit = default, string? cursor = default, string? prUrl = default, + bool? includeArchived = default, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListArtifacts.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListArtifacts.g.cs new file mode 100644 index 0000000..a194b88 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListArtifacts.g.cs @@ -0,0 +1,25 @@ +#nullable enable + +namespace CursorAgents +{ + public partial interface ICursorAgentsClient + { + /// + /// List artifacts
+ /// List artifacts produced by an agent. Each artifact's `path` is
+ /// relative to the workspace's `artifacts/` directory. Pass that
+ /// `path` to GET /v1/agents/{id}/artifacts/download to obtain a
+ /// presigned download URL. + ///
+ /// + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ListArtifactsAsync( + string id, + global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListModels.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListModels.g.cs index e5fa4df..9c42022 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListModels.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListModels.g.cs @@ -5,8 +5,11 @@ namespace CursorAgents public partial interface ICursorAgentsClient { /// - /// List available models
- /// Returns a recommended set of explicit model IDs for launch requests. This list excludes "default". + /// List models
+ /// Returns a recommended set of explicit model IDs you can pass
+ /// to the `model.id` field on POST /v1/agents. To use the
+ /// configured default model, omit the `model` field from the
+ /// request body entirely. ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListRepositories.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListRepositories.g.cs index 65fd67b..f0eca97 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListRepositories.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListRepositories.g.cs @@ -6,7 +6,13 @@ public partial interface ICursorAgentsClient { /// /// List GitHub repositories
- /// Retrieve a list of GitHub repositories accessible to the authenticated user + /// List GitHub repositories accessible to the authenticated user
+ /// through Cursor's GitHub App installation. This endpoint has
+ /// very strict rate limits (1 request per user per minute, 30
+ /// per user per hour) and can take tens of seconds to respond
+ /// for users with access to many repositories. Cache responses
+ /// aggressively and handle this information not being available
+ /// gracefully. ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListRuns.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListRuns.g.cs new file mode 100644 index 0000000..355236d --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.ListRuns.g.cs @@ -0,0 +1,28 @@ +#nullable enable + +namespace CursorAgents +{ + public partial interface ICursorAgentsClient + { + /// + /// List runs
+ /// List runs for an agent, newest first. + ///
+ /// + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ListRunsAsync( + string id, + int? limit = default, + string? cursor = default, + global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs new file mode 100644 index 0000000..cb8d5ff --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace CursorAgents +{ + public partial interface ICursorAgentsClient + { + /// + /// Stream a run
+ /// Stream Server-Sent Events for one run. Event types include
+ /// `status`, `assistant`, `thinking`, `tool_call`, `heartbeat`,
+ /// `result`, `error`, and `done`. Reconnect with the
+ /// `Last-Event-ID` header to resume after a disconnect; the event
+ /// ID must belong to the requested run. Responses include the
+ /// `X-Cursor-Stream-Retention-Seconds` header. After the
+ /// retention window the endpoint may return `410 stream_expired`. + ///
+ /// + /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Example: run-00000000-0000-0000-0000-000000000001 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Collections.Generic.IAsyncEnumerable StreamRunAsync( + string id, + string runId, + string? lastEventId = default, + global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StopAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.UnarchiveAgent.g.cs similarity index 77% rename from src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StopAgent.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.UnarchiveAgent.g.cs index 0c7edd2..e0fee25 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StopAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.UnarchiveAgent.g.cs @@ -5,16 +5,16 @@ namespace CursorAgents public partial interface ICursorAgentsClient { /// - /// Stop an agent
- /// Stop a running cloud agent. This pauses the agent's execution without deleting it. Stopped agents cannot be resumed. + /// Unarchive an agent
+ /// Unarchive an agent so it can accept new runs again. ///
/// - /// Example: bc_abc123 + /// Example: bc-00000000-0000-0000-0000-000000000001 /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// - global::System.Threading.Tasks.Task StopAgentAsync( + global::System.Threading.Tasks.Task UnarchiveAgentAsync( string id, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.g.cs index 39a2f24..2b8f29f 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.g.cs @@ -4,7 +4,10 @@ namespace CursorAgents { /// - /// Programmatically create and manage AI-powered coding agents that work autonomously on your repositories
+ /// Programmatically create and manage Cursor Cloud Agents that work
+ /// autonomously on your repositories. v1 separates a durable agent
+ /// from one or more runs: each prompt submission creates a run on the
+ /// agent. Streaming and cancellation are scoped to the active run.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.Agent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.Agent.g.cs new file mode 100644 index 0000000..3db6a5c --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.Agent.g.cs @@ -0,0 +1,155 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace CursorAgents.JsonConverters +{ + /// + public class AgentJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::CursorAgents.Agent Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("createdAt")) __score0++; + if (__jsonProps.Contains("env")) __score0++; + if (__jsonProps.Contains("env.type")) __score0++; + if (__jsonProps.Contains("id")) __score0++; + if (__jsonProps.Contains("latestRunId")) __score0++; + if (__jsonProps.Contains("name")) __score0++; + if (__jsonProps.Contains("status")) __score0++; + if (__jsonProps.Contains("updatedAt")) __score0++; + if (__jsonProps.Contains("url")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("autoCreatePR")) __score1++; + if (__jsonProps.Contains("autoGenerateBranch")) __score1++; + if (__jsonProps.Contains("branchName")) __score1++; + if (__jsonProps.Contains("repos")) __score1++; + if (__jsonProps.Contains("skipReviewerRequest")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::CursorAgents.AgentSummary? summary = default; + global::CursorAgents.AgentVariant2? agentVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::CursorAgents.AgentSummary), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::CursorAgents.AgentSummary).Name}"); + summary = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::CursorAgents.AgentVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::CursorAgents.AgentVariant2).Name}"); + agentVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (summary == null && agentVariant2 == null) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::CursorAgents.AgentSummary), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::CursorAgents.AgentSummary).Name}"); + summary = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::CursorAgents.AgentVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::CursorAgents.AgentVariant2).Name}"); + agentVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::CursorAgents.Agent( + summary, + + agentVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::CursorAgents.Agent value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsSummary) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::CursorAgents.AgentSummary), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::CursorAgents.AgentSummary).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Summary!, typeInfo); + } + else if (value.IsAgentVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::CursorAgents.AgentVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::CursorAgents.AgentVariant2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentVariant2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentResponseStatus.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.AgentSummaryStatus.g.cs similarity index 66% rename from src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentResponseStatus.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.AgentSummaryStatus.g.cs index 573336b..631b470 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentResponseStatus.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.AgentSummaryStatus.g.cs @@ -3,10 +3,10 @@ namespace CursorAgents.JsonConverters { /// - public sealed class GetAgentResponseStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class AgentSummaryStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::CursorAgents.GetAgentResponseStatus Read( + public override global::CursorAgents.AgentSummaryStatus Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class GetAgentResponseStatusJsonConverter : global::System.Text.Js var stringValue = reader.GetString(); if (stringValue != null) { - return global::CursorAgents.GetAgentResponseStatusExtensions.ToEnum(stringValue) ?? default; + return global::CursorAgents.AgentSummaryStatusExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class GetAgentResponseStatusJsonConverter : global::System.Text.Js case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::CursorAgents.GetAgentResponseStatus)numValue; + return (global::CursorAgents.AgentSummaryStatus)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::CursorAgents.GetAgentResponseStatus); + return default(global::CursorAgents.AgentSummaryStatus); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class GetAgentResponseStatusJsonConverter : global::System.Text.Js /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::CursorAgents.GetAgentResponseStatus value, + global::CursorAgents.AgentSummaryStatus value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::CursorAgents.GetAgentResponseStatusExtensions.ToValueString(value)); + writer.WriteStringValue(global::CursorAgents.AgentSummaryStatusExtensions.ToValueString(value)); } } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentResponseStatusNullable.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.AgentSummaryStatusNullable.g.cs similarity index 68% rename from src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentResponseStatusNullable.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.AgentSummaryStatusNullable.g.cs index 2ce7122..30c7da7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentResponseStatusNullable.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.AgentSummaryStatusNullable.g.cs @@ -3,10 +3,10 @@ namespace CursorAgents.JsonConverters { /// - public sealed class GetAgentResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class AgentSummaryStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::CursorAgents.GetAgentResponseStatus? Read( + public override global::CursorAgents.AgentSummaryStatus? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class GetAgentResponseStatusNullableJsonConverter : global::System var stringValue = reader.GetString(); if (stringValue != null) { - return global::CursorAgents.GetAgentResponseStatusExtensions.ToEnum(stringValue); + return global::CursorAgents.AgentSummaryStatusExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class GetAgentResponseStatusNullableJsonConverter : global::System case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::CursorAgents.GetAgentResponseStatus)numValue; + return (global::CursorAgents.AgentSummaryStatus)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::CursorAgents.GetAgentResponseStatus?); + return default(global::CursorAgents.AgentSummaryStatus?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class GetAgentResponseStatusNullableJsonConverter : global::System /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::CursorAgents.GetAgentResponseStatus? value, + global::CursorAgents.AgentSummaryStatus? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::CursorAgents.GetAgentResponseStatusExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::CursorAgents.AgentSummaryStatusExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentConversationResponseMessageType.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentConversationResponseMessageType.g.cs deleted file mode 100644 index 385069c..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentConversationResponseMessageType.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace CursorAgents.JsonConverters -{ - /// - public sealed class GetAgentConversationResponseMessageTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::CursorAgents.GetAgentConversationResponseMessageType Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::CursorAgents.GetAgentConversationResponseMessageTypeExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::CursorAgents.GetAgentConversationResponseMessageType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::CursorAgents.GetAgentConversationResponseMessageType); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::CursorAgents.GetAgentConversationResponseMessageType value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::CursorAgents.GetAgentConversationResponseMessageTypeExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentConversationResponseMessageTypeNullable.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentConversationResponseMessageTypeNullable.g.cs deleted file mode 100644 index e51ff7f..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.GetAgentConversationResponseMessageTypeNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace CursorAgents.JsonConverters -{ - /// - public sealed class GetAgentConversationResponseMessageTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::CursorAgents.GetAgentConversationResponseMessageType? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::CursorAgents.GetAgentConversationResponseMessageTypeExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::CursorAgents.GetAgentConversationResponseMessageType)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::CursorAgents.GetAgentConversationResponseMessageType?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::CursorAgents.GetAgentConversationResponseMessageType? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::CursorAgents.GetAgentConversationResponseMessageTypeExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.ListAgentsResponseAgentStatus.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.ListAgentsResponseAgentStatus.g.cs deleted file mode 100644 index 1ba2e61..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.ListAgentsResponseAgentStatus.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace CursorAgents.JsonConverters -{ - /// - public sealed class ListAgentsResponseAgentStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::CursorAgents.ListAgentsResponseAgentStatus Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::CursorAgents.ListAgentsResponseAgentStatusExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::CursorAgents.ListAgentsResponseAgentStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::CursorAgents.ListAgentsResponseAgentStatus); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::CursorAgents.ListAgentsResponseAgentStatus value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::CursorAgents.ListAgentsResponseAgentStatusExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.ListAgentsResponseAgentStatusNullable.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.ListAgentsResponseAgentStatusNullable.g.cs deleted file mode 100644 index 5387eaa..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.ListAgentsResponseAgentStatusNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace CursorAgents.JsonConverters -{ - /// - public sealed class ListAgentsResponseAgentStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::CursorAgents.ListAgentsResponseAgentStatus? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::CursorAgents.ListAgentsResponseAgentStatusExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::CursorAgents.ListAgentsResponseAgentStatus)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::CursorAgents.ListAgentsResponseAgentStatus?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::CursorAgents.ListAgentsResponseAgentStatus? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::CursorAgents.ListAgentsResponseAgentStatusExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CreateAgentResponseStatus.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStatus.g.cs similarity index 66% rename from src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CreateAgentResponseStatus.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStatus.g.cs index ac1084d..26c5917 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CreateAgentResponseStatus.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStatus.g.cs @@ -3,10 +3,10 @@ namespace CursorAgents.JsonConverters { /// - public sealed class CreateAgentResponseStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RunStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::CursorAgents.CreateAgentResponseStatus Read( + public override global::CursorAgents.RunStatus Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class CreateAgentResponseStatusJsonConverter : global::System.Text var stringValue = reader.GetString(); if (stringValue != null) { - return global::CursorAgents.CreateAgentResponseStatusExtensions.ToEnum(stringValue) ?? default; + return global::CursorAgents.RunStatusExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class CreateAgentResponseStatusJsonConverter : global::System.Text case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::CursorAgents.CreateAgentResponseStatus)numValue; + return (global::CursorAgents.RunStatus)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::CursorAgents.CreateAgentResponseStatus); + return default(global::CursorAgents.RunStatus); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class CreateAgentResponseStatusJsonConverter : global::System.Text /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::CursorAgents.CreateAgentResponseStatus value, + global::CursorAgents.RunStatus value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::CursorAgents.CreateAgentResponseStatusExtensions.ToValueString(value)); + writer.WriteStringValue(global::CursorAgents.RunStatusExtensions.ToValueString(value)); } } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CreateAgentResponseStatusNullable.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStatusNullable.g.cs similarity index 68% rename from src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CreateAgentResponseStatusNullable.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStatusNullable.g.cs index 5502f30..588802c 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CreateAgentResponseStatusNullable.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStatusNullable.g.cs @@ -3,10 +3,10 @@ namespace CursorAgents.JsonConverters { /// - public sealed class CreateAgentResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class RunStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::CursorAgents.CreateAgentResponseStatus? Read( + public override global::CursorAgents.RunStatus? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class CreateAgentResponseStatusNullableJsonConverter : global::Sys var stringValue = reader.GetString(); if (stringValue != null) { - return global::CursorAgents.CreateAgentResponseStatusExtensions.ToEnum(stringValue); + return global::CursorAgents.RunStatusExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class CreateAgentResponseStatusNullableJsonConverter : global::Sys case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::CursorAgents.CreateAgentResponseStatus)numValue; + return (global::CursorAgents.RunStatus)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::CursorAgents.CreateAgentResponseStatus?); + return default(global::CursorAgents.RunStatus?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class CreateAgentResponseStatusNullableJsonConverter : global::Sys /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::CursorAgents.CreateAgentResponseStatus? value, + global::CursorAgents.RunStatus? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::CursorAgents.CreateAgentResponseStatusExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::CursorAgents.RunStatusExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs index aa64924..bdabff2 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs @@ -13,21 +13,15 @@ namespace CursorAgents DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] { - typeof(global::CursorAgents.JsonConverters.CreateAgentResponseStatusJsonConverter), + typeof(global::CursorAgents.JsonConverters.AgentSummaryStatusJsonConverter), - typeof(global::CursorAgents.JsonConverters.CreateAgentResponseStatusNullableJsonConverter), + typeof(global::CursorAgents.JsonConverters.AgentSummaryStatusNullableJsonConverter), - typeof(global::CursorAgents.JsonConverters.ListAgentsResponseAgentStatusJsonConverter), + typeof(global::CursorAgents.JsonConverters.RunStatusJsonConverter), - typeof(global::CursorAgents.JsonConverters.ListAgentsResponseAgentStatusNullableJsonConverter), + typeof(global::CursorAgents.JsonConverters.RunStatusNullableJsonConverter), - typeof(global::CursorAgents.JsonConverters.GetAgentResponseStatusJsonConverter), - - typeof(global::CursorAgents.JsonConverters.GetAgentResponseStatusNullableJsonConverter), - - typeof(global::CursorAgents.JsonConverters.GetAgentConversationResponseMessageTypeJsonConverter), - - typeof(global::CursorAgents.JsonConverters.GetAgentConversationResponseMessageTypeNullableJsonConverter), + typeof(global::CursorAgents.JsonConverters.AgentJsonConverter), typeof(global::CursorAgents.JsonConverters.UnixTimestampJsonConverter), })] @@ -36,56 +30,50 @@ namespace CursorAgents [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Image))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelRef))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RepoConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AgentEnv))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AgentSummary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AgentSummaryStatus), TypeInfoPropertyName = "AgentSummaryStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Agent), TypeInfoPropertyName = "Agent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AgentVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Run))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunStatus), TypeInfoPropertyName = "RunStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentRequestPrompt))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentRequestSource))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentRequestTarget))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentRequestWebhook))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Error))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ErrorError1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateRunRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateRunRequestPrompt))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateRunResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListAgentsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListRunsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.IdResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Artifact))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListArtifactsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetArtifactResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AddFollowupRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AddFollowupRequestPrompt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentResponseStatus), TypeInfoPropertyName = "CreateAgentResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentResponseSource))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentResponseTarget))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListAgentsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListAgentsResponseAgent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListAgentsResponseAgentStatus), TypeInfoPropertyName = "ListAgentsResponseAgentStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListAgentsResponseAgentSource))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListAgentsResponseAgentTarget))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetAgentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetAgentResponseStatus), TypeInfoPropertyName = "GetAgentResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetAgentResponseSource))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetAgentResponseTarget))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.DeleteAgentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AddFollowupResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.StopAgentResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetAgentConversationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetAgentConversationResponseMessage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetAgentConversationResponseMessageType), TypeInfoPropertyName = "GetAgentConversationResponseMessageType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.GetMeResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.DownloadArtifactResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ApiKeyInfo))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListModelsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Repository))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListRepositoriesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListRepositoriesResponseRepositorie))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Error))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ErrorError1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs index f6337df..0adbb92 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs @@ -44,71 +44,71 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::CursorAgents.CreateAgentRequest? Type4 { get; set; } + public global::CursorAgents.ModelRef? Type4 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentRequestPrompt? Type5 { get; set; } + public global::CursorAgents.RepoConfig? Type5 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type6 { get; set; } + public global::CursorAgents.AgentEnv? Type6 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentRequestSource? Type7 { get; set; } + public global::CursorAgents.AgentSummary? Type7 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentRequestTarget? Type8 { get; set; } + public global::CursorAgents.AgentSummaryStatus? Type8 { get; set; } /// /// /// - public bool? Type9 { get; set; } + public global::System.DateTime? Type9 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentRequestWebhook? Type10 { get; set; } + public global::CursorAgents.Agent? Type10 { get; set; } /// /// /// - public global::CursorAgents.Error? Type11 { get; set; } + public global::CursorAgents.AgentVariant2? Type11 { get; set; } /// /// /// - public global::CursorAgents.ErrorError1? Type12 { get; set; } + public global::System.Collections.Generic.IList? Type12 { get; set; } /// /// /// - public global::CursorAgents.Artifact? Type13 { get; set; } + public bool? Type13 { get; set; } /// /// /// - public long? Type14 { get; set; } + public global::CursorAgents.Run? Type14 { get; set; } /// /// /// - public global::System.DateTime? Type15 { get; set; } + public global::CursorAgents.RunStatus? Type15 { get; set; } /// /// /// - public global::CursorAgents.ListArtifactsResponse? Type16 { get; set; } + public global::CursorAgents.CreateAgentRequest? Type16 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type17 { get; set; } + public global::CursorAgents.CreateAgentRequestPrompt? Type17 { get; set; } /// /// /// - public global::CursorAgents.GetArtifactResponse? Type18 { get; set; } + public global::System.Collections.Generic.IList? Type18 { get; set; } /// /// /// - public global::CursorAgents.AddFollowupRequest? Type19 { get; set; } + public global::CursorAgents.CreateRunRequest? Type19 { get; set; } /// /// /// - public global::CursorAgents.AddFollowupRequestPrompt? Type20 { get; set; } + public global::CursorAgents.CreateRunRequestPrompt? Type20 { get; set; } /// /// /// @@ -116,131 +116,107 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::CursorAgents.CreateAgentResponseStatus? Type22 { get; set; } + public global::CursorAgents.CreateRunResponse? Type22 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentResponseSource? Type23 { get; set; } + public global::CursorAgents.ListAgentsResponse? Type23 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentResponseTarget? Type24 { get; set; } + public global::System.Collections.Generic.IList? Type24 { get; set; } /// /// /// - public global::CursorAgents.ListAgentsResponse? Type25 { get; set; } + public global::CursorAgents.ListRunsResponse? Type25 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type26 { get; set; } + public global::System.Collections.Generic.IList? Type26 { get; set; } /// /// /// - public global::CursorAgents.ListAgentsResponseAgent? Type27 { get; set; } + public global::CursorAgents.IdResponse? Type27 { get; set; } /// /// /// - public global::CursorAgents.ListAgentsResponseAgentStatus? Type28 { get; set; } + public global::CursorAgents.Artifact? Type28 { get; set; } /// /// /// - public global::CursorAgents.ListAgentsResponseAgentSource? Type29 { get; set; } + public long? Type29 { get; set; } /// /// /// - public global::CursorAgents.ListAgentsResponseAgentTarget? Type30 { get; set; } + public global::CursorAgents.ListArtifactsResponse? Type30 { get; set; } /// /// /// - public global::CursorAgents.GetAgentResponse? Type31 { get; set; } + public global::System.Collections.Generic.IList? Type31 { get; set; } /// /// /// - public global::CursorAgents.GetAgentResponseStatus? Type32 { get; set; } + public global::CursorAgents.DownloadArtifactResponse? Type32 { get; set; } /// /// /// - public global::CursorAgents.GetAgentResponseSource? Type33 { get; set; } + public global::CursorAgents.ApiKeyInfo? Type33 { get; set; } /// /// /// - public global::CursorAgents.GetAgentResponseTarget? Type34 { get; set; } + public global::CursorAgents.ListModelsResponse? Type34 { get; set; } /// /// /// - public global::CursorAgents.DeleteAgentResponse? Type35 { get; set; } + public global::System.Collections.Generic.IList? Type35 { get; set; } /// /// /// - public global::CursorAgents.AddFollowupResponse? Type36 { get; set; } + public global::CursorAgents.Repository? Type36 { get; set; } /// /// /// - public global::CursorAgents.StopAgentResponse? Type37 { get; set; } + public global::CursorAgents.ListRepositoriesResponse? Type37 { get; set; } /// /// /// - public global::CursorAgents.GetAgentConversationResponse? Type38 { get; set; } + public global::System.Collections.Generic.IList? Type38 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type39 { get; set; } + public global::CursorAgents.Error? Type39 { get; set; } /// /// /// - public global::CursorAgents.GetAgentConversationResponseMessage? Type40 { get; set; } - /// - /// - /// - public global::CursorAgents.GetAgentConversationResponseMessageType? Type41 { get; set; } - /// - /// - /// - public global::CursorAgents.GetMeResponse? Type42 { get; set; } - /// - /// - /// - public global::CursorAgents.ListModelsResponse? Type43 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type44 { get; set; } - /// - /// - /// - public global::CursorAgents.ListRepositoriesResponse? Type45 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.IList? Type46 { get; set; } + public global::CursorAgents.ErrorError1? Type40 { get; set; } + /// /// /// - public global::CursorAgents.ListRepositoriesResponseRepositorie? Type47 { get; set; } - + public global::System.Collections.Generic.List? ListType0 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType0 { get; set; } + public global::System.Collections.Generic.List? ListType1 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType1 { get; set; } + public global::System.Collections.Generic.List? ListType2 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType2 { get; set; } + public global::System.Collections.Generic.List? ListType3 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType3 { get; set; } + public global::System.Collections.Generic.List? ListType4 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType4 { get; set; } + public global::System.Collections.Generic.List? ListType5 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType5 { get; set; } + public global::System.Collections.Generic.List? ListType6 { get; set; } } } \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequestPrompt.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequestPrompt.Json.g.cs deleted file mode 100644 index ec493aa..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequestPrompt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class AddFollowupRequestPrompt - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.AddFollowupRequestPrompt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.AddFollowupRequestPrompt), - jsonSerializerContext) as global::CursorAgents.AddFollowupRequestPrompt; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.AddFollowupRequestPrompt? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.AddFollowupRequestPrompt), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.AddFollowupRequestPrompt; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupResponse.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Agent.Json.g.cs similarity index 87% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupResponse.Json.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.Agent.Json.g.cs index da85e74..8f27632 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupResponse.Json.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Agent.Json.g.cs @@ -2,7 +2,7 @@ namespace CursorAgents { - public sealed partial class AddFollowupResponse + public readonly partial struct Agent { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::CursorAgents.AddFollowupResponse? FromJson( + public static global::CursorAgents.Agent? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::CursorAgents.AddFollowupResponse), - jsonSerializerContext) as global::CursorAgents.AddFollowupResponse; + typeof(global::CursorAgents.Agent), + jsonSerializerContext) as global::CursorAgents.Agent?; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::CursorAgents.AddFollowupResponse? FromJson( + public static global::CursorAgents.Agent? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::CursorAgents.AddFollowupResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.AddFollowupResponse; + typeof(global::CursorAgents.Agent), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.Agent?; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Agent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Agent.g.cs new file mode 100644 index 0000000..6b211c8 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Agent.g.cs @@ -0,0 +1,221 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public readonly partial struct Agent : global::System.IEquatable + { + /// + /// + /// +#if NET6_0_OR_GREATER + public global::CursorAgents.AgentSummary? Summary { get; init; } +#else + public global::CursorAgents.AgentSummary? Summary { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Summary))] +#endif + public bool IsSummary => Summary != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::CursorAgents.AgentVariant2? AgentVariant2 { get; init; } +#else + public global::CursorAgents.AgentVariant2? AgentVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(AgentVariant2))] +#endif + public bool IsAgentVariant2 => AgentVariant2 != null; + /// + /// + /// + public static implicit operator Agent(global::CursorAgents.AgentSummary value) => new Agent((global::CursorAgents.AgentSummary?)value); + + /// + /// + /// + public static implicit operator global::CursorAgents.AgentSummary?(Agent @this) => @this.Summary; + + /// + /// + /// + public Agent(global::CursorAgents.AgentSummary? value) + { + Summary = value; + } + + /// + /// + /// + public static implicit operator Agent(global::CursorAgents.AgentVariant2 value) => new Agent((global::CursorAgents.AgentVariant2?)value); + + /// + /// + /// + public static implicit operator global::CursorAgents.AgentVariant2?(Agent @this) => @this.AgentVariant2; + + /// + /// + /// + public Agent(global::CursorAgents.AgentVariant2? value) + { + AgentVariant2 = value; + } + + /// + /// + /// + public Agent( + global::CursorAgents.AgentSummary? summary, + global::CursorAgents.AgentVariant2? agentVariant2 + ) + { + Summary = summary; + AgentVariant2 = agentVariant2; + } + + /// + /// + /// + public object? Object => + AgentVariant2 as object ?? + Summary as object + ; + + /// + /// + /// + public override string? ToString() => + Summary?.ToString() ?? + AgentVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsSummary && IsAgentVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? summary = null, + global::System.Func? agentVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSummary && summary != null) + { + return summary(Summary!); + } + else if (IsAgentVariant2 && agentVariant2 != null) + { + return agentVariant2(AgentVariant2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? summary = null, + global::System.Action? agentVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsSummary) + { + summary?.Invoke(Summary!); + } + else if (IsAgentVariant2) + { + agentVariant2?.Invoke(AgentVariant2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Summary, + typeof(global::CursorAgents.AgentSummary), + AgentVariant2, + typeof(global::CursorAgents.AgentVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(Agent other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Summary, other.Summary) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(AgentVariant2, other.AgentVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(Agent obj1, Agent obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(Agent obj1, Agent obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is Agent o && Equals(o); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentEnv.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentEnv.Json.g.cs new file mode 100644 index 0000000..ca02634 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentEnv.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class AgentEnv + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::CursorAgents.AgentEnv? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.AgentEnv), + jsonSerializerContext) as global::CursorAgents.AgentEnv; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::CursorAgents.AgentEnv? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::CursorAgents.AgentEnv), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.AgentEnv; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentEnv.g.cs similarity index 55% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupResponse.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.AgentEnv.g.cs index a775a18..1eeb260 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentEnv.g.cs @@ -6,16 +6,16 @@ namespace CursorAgents /// /// /// - public sealed partial class AddFollowupResponse + public sealed partial class AgentEnv { /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 + /// Execution environment type.
+ /// Example: cloud ///
- /// bc_abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("id")] + /// cloud + [global::System.Text.Json.Serialization.JsonPropertyName("type")] [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } + public required string Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -24,25 +24,25 @@ public sealed partial class AddFollowupResponse public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 + /// + /// Execution environment type.
+ /// Example: cloud /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public AddFollowupResponse( - string id) + public AgentEnv( + string type) { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public AddFollowupResponse() + public AgentEnv() { } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.Json.g.cs new file mode 100644 index 0000000..a059e08 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class AgentSummary + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::CursorAgents.AgentSummary? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.AgentSummary), + jsonSerializerContext) as global::CursorAgents.AgentSummary; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::CursorAgents.AgentSummary? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::CursorAgents.AgentSummary), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.AgentSummary; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.g.cs new file mode 100644 index 0000000..6823193 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.g.cs @@ -0,0 +1,140 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class AgentSummary + { + /// + /// Unique agent identifier.
+ /// Example: bc-00000000-0000-0000-0000-000000000001 + ///
+ /// bc-00000000-0000-0000-0000-000000000001 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Auto-derived agent name.
+ /// Example: Add README with setup instructions + ///
+ /// Add README with setup instructions + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Agent lifecycle state. Execution status lives on runs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.AgentSummaryStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::CursorAgents.AgentSummaryStatus Status { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("env")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::CursorAgents.AgentEnv Env { get; set; } + + /// + /// URL to view the agent in Cursor Web.
+ /// Example: https://cursor.com/agents?id=bc-00000000-0000-0000-0000-000000000001 + ///
+ /// https://cursor.com/agents?id=bc-00000000-0000-0000-0000-000000000001 + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// When the agent was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// When the agent was last updated. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// ID of the most recent run on this agent, if any.
+ /// Example: run-00000000-0000-0000-0000-000000000001 + ///
+ /// run-00000000-0000-0000-0000-000000000001 + [global::System.Text.Json.Serialization.JsonPropertyName("latestRunId")] + public string? LatestRunId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique agent identifier.
+ /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Auto-derived agent name.
+ /// Example: Add README with setup instructions + /// + /// + /// Agent lifecycle state. Execution status lives on runs. + /// + /// + /// + /// URL to view the agent in Cursor Web.
+ /// Example: https://cursor.com/agents?id=bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// When the agent was created. + /// + /// + /// When the agent was last updated. + /// + /// + /// ID of the most recent run on this agent, if any.
+ /// Example: run-00000000-0000-0000-0000-000000000001 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentSummary( + string id, + string name, + global::CursorAgents.AgentSummaryStatus status, + global::CursorAgents.AgentEnv env, + string url, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + string? latestRunId) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Status = status; + this.Env = env ?? throw new global::System.ArgumentNullException(nameof(env)); + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.LatestRunId = latestRunId; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentSummary() + { + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseStatus.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummaryStatus.g.cs similarity index 54% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseStatus.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummaryStatus.g.cs index cea8d75..8f61e07 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseStatus.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummaryStatus.g.cs @@ -4,41 +4,46 @@ namespace CursorAgents { /// - /// Initial status of the newly created agent
- /// Example: CREATING + /// Agent lifecycle state. Execution status lives on runs. ///
- public enum CreateAgentResponseStatus + public enum AgentSummaryStatus { /// /// /// - Creating, + Active, + /// + /// + /// + Archived, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class CreateAgentResponseStatusExtensions + public static class AgentSummaryStatusExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this CreateAgentResponseStatus value) + public static string ToValueString(this AgentSummaryStatus value) { return value switch { - CreateAgentResponseStatus.Creating => "CREATING", + AgentSummaryStatus.Active => "ACTIVE", + AgentSummaryStatus.Archived => "ARCHIVED", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static CreateAgentResponseStatus? ToEnum(string value) + public static AgentSummaryStatus? ToEnum(string value) { return value switch { - "CREATING" => CreateAgentResponseStatus.Creating, + "ACTIVE" => AgentSummaryStatus.Active, + "ARCHIVED" => AgentSummaryStatus.Archived, _ => null, }; } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetMeResponse.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.Json.g.cs similarity index 87% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.GetMeResponse.Json.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.Json.g.cs index 81f7fb2..030b19d 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetMeResponse.Json.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.Json.g.cs @@ -2,7 +2,7 @@ namespace CursorAgents { - public sealed partial class GetMeResponse + public sealed partial class AgentVariant2 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::CursorAgents.GetMeResponse? FromJson( + public static global::CursorAgents.AgentVariant2? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::CursorAgents.GetMeResponse), - jsonSerializerContext) as global::CursorAgents.GetMeResponse; + typeof(global::CursorAgents.AgentVariant2), + jsonSerializerContext) as global::CursorAgents.AgentVariant2; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::CursorAgents.GetMeResponse? FromJson( + public static global::CursorAgents.AgentVariant2? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::CursorAgents.GetMeResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.GetMeResponse; + typeof(global::CursorAgents.AgentVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.AgentVariant2; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.g.cs new file mode 100644 index 0000000..9ec9de3 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.g.cs @@ -0,0 +1,98 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class AgentVariant2 + { + /// + /// Repository configuration. v1 currently supports one entry. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("repos")] + public global::System.Collections.Generic.IList? Repos { get; set; } + + /// + /// Branch the agent works on.
+ /// Example: cursor/add-readme + ///
+ /// cursor/add-readme + [global::System.Text.Json.Serialization.JsonPropertyName("branchName")] + public string? BranchName { get; set; } + + /// + /// Whether the branch was auto-generated.
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("autoGenerateBranch")] + public bool? AutoGenerateBranch { get; set; } + + /// + /// Whether Cursor opens a pull request when the run completes.
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("autoCreatePR")] + public bool? AutoCreatePR { get; set; } + + /// + /// Whether to skip requesting the user as a reviewer when Cursor opens a PR. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("skipReviewerRequest")] + public bool? SkipReviewerRequest { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Repository configuration. v1 currently supports one entry. + /// + /// + /// Branch the agent works on.
+ /// Example: cursor/add-readme + /// + /// + /// Whether the branch was auto-generated.
+ /// Example: true + /// + /// + /// Whether Cursor opens a pull request when the run completes.
+ /// Example: true + /// + /// + /// Whether to skip requesting the user as a reviewer when Cursor opens a PR. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentVariant2( + global::System.Collections.Generic.IList? repos, + string? branchName, + bool? autoGenerateBranch, + bool? autoCreatePR, + bool? skipReviewerRequest) + { + this.Repos = repos; + this.BranchName = branchName; + this.AutoGenerateBranch = autoGenerateBranch; + this.AutoCreatePR = autoCreatePR; + this.SkipReviewerRequest = skipReviewerRequest; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentVariant2() + { + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequest.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.Json.g.cs similarity index 88% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequest.Json.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.Json.g.cs index 2979f5a..23c4f02 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequest.Json.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.Json.g.cs @@ -2,7 +2,7 @@ namespace CursorAgents { - public sealed partial class AddFollowupRequest + public sealed partial class ApiKeyInfo { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::CursorAgents.AddFollowupRequest? FromJson( + public static global::CursorAgents.ApiKeyInfo? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::CursorAgents.AddFollowupRequest), - jsonSerializerContext) as global::CursorAgents.AddFollowupRequest; + typeof(global::CursorAgents.ApiKeyInfo), + jsonSerializerContext) as global::CursorAgents.ApiKeyInfo; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::CursorAgents.AddFollowupRequest? FromJson( + public static global::CursorAgents.ApiKeyInfo? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::CursorAgents.AddFollowupRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.AddFollowupRequest; + typeof(global::CursorAgents.ApiKeyInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ApiKeyInfo; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetMeResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.g.cs similarity index 68% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.GetMeResponse.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.g.cs index 8c7ca15..b32ce79 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetMeResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.g.cs @@ -6,10 +6,9 @@ namespace CursorAgents /// /// /// - public sealed partial class GetMeResponse + public sealed partial class ApiKeyInfo { /// - /// The name of the API key
/// Example: Production API Key ///
/// Production API Key @@ -18,21 +17,19 @@ public sealed partial class GetMeResponse public required string ApiKeyName { get; set; } /// - /// When the API key was created
- /// Example: 2024-01-15T10:30:00Z + /// ///
- /// 2024-01-15T10:30:00Z [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.DateTime CreatedAt { get; set; } /// - /// Email address of the user who owns the API key (if available)
/// Example: developer@example.com ///
/// developer@example.com [global::System.Text.Json.Serialization.JsonPropertyName("userEmail")] - public string? UserEmail { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required string UserEmail { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -41,37 +38,32 @@ public sealed partial class GetMeResponse public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - /// The name of the API key
/// Example: Production API Key /// - /// - /// When the API key was created
- /// Example: 2024-01-15T10:30:00Z - /// + /// /// - /// Email address of the user who owns the API key (if available)
/// Example: developer@example.com /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public GetMeResponse( + public ApiKeyInfo( string apiKeyName, global::System.DateTime createdAt, - string? userEmail) + string userEmail) { this.ApiKeyName = apiKeyName ?? throw new global::System.ArgumentNullException(nameof(apiKeyName)); this.CreatedAt = createdAt; - this.UserEmail = userEmail; + this.UserEmail = userEmail ?? throw new global::System.ArgumentNullException(nameof(userEmail)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public GetMeResponse() + public ApiKeyInfo() { } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Artifact.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Artifact.g.cs index 8150622..968e9a7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.Artifact.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Artifact.g.cs @@ -9,16 +9,16 @@ namespace CursorAgents public sealed partial class Artifact { /// - /// Absolute artifact path in the cloud agent environment
- /// Example: /opt/cursor/artifacts/screenshot.png + /// Artifact path relative to the workspace's `artifacts/` directory.
+ /// Example: artifacts/screenshot.png ///
- /// /opt/cursor/artifacts/screenshot.png - [global::System.Text.Json.Serialization.JsonPropertyName("absolutePath")] + /// artifacts/screenshot.png + [global::System.Text.Json.Serialization.JsonPropertyName("path")] [global::System.Text.Json.Serialization.JsonRequired] - public required string AbsolutePath { get; set; } + public required string Path { get; set; } /// - /// Artifact file size in bytes
+ /// File size in bytes.
/// Example: 12345 ///
/// 12345 @@ -27,10 +27,8 @@ public sealed partial class Artifact public required long SizeBytes { get; set; } /// - /// Last modified timestamp for the artifact
- /// Example: 2024-01-15T11:02:00.000Z + /// Last modified timestamp. ///
- /// 2024-01-15T11:02:00.000Z [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.DateTime UpdatedAt { get; set; } @@ -44,27 +42,26 @@ public sealed partial class Artifact /// /// Initializes a new instance of the class. /// - /// - /// Absolute artifact path in the cloud agent environment
- /// Example: /opt/cursor/artifacts/screenshot.png + /// + /// Artifact path relative to the workspace's `artifacts/` directory.
+ /// Example: artifacts/screenshot.png /// /// - /// Artifact file size in bytes
+ /// File size in bytes.
/// Example: 12345 /// /// - /// Last modified timestamp for the artifact
- /// Example: 2024-01-15T11:02:00.000Z + /// Last modified timestamp. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Artifact( - string absolutePath, + string path, long sizeBytes, global::System.DateTime updatedAt) { - this.AbsolutePath = absolutePath ?? throw new global::System.ArgumentNullException(nameof(absolutePath)); + this.Path = path ?? throw new global::System.ArgumentNullException(nameof(path)); this.SizeBytes = sizeBytes; this.UpdatedAt = updatedAt; } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequest.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequest.g.cs index b247226..9c244ae 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequest.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequest.g.cs @@ -16,31 +16,46 @@ public sealed partial class CreateAgentRequest public required global::CursorAgents.CreateAgentRequestPrompt Prompt { get; set; } /// - /// Set to an explicit model ID for launch requests, or use "default" to use the configured default model. When omitted, Cursor resolves your user default model, then your team default model, then a system default.
- /// Example: claude-4-sonnet + /// ///
- /// claude-4-sonnet [global::System.Text.Json.Serialization.JsonPropertyName("model")] - public string? Model { get; set; } + public global::CursorAgents.ModelRef? Model { get; set; } /// - /// + /// Repository configuration. v1 currently supports one entry. /// - [global::System.Text.Json.Serialization.JsonPropertyName("source")] + [global::System.Text.Json.Serialization.JsonPropertyName("repos")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.CreateAgentRequestSource Source { get; set; } + public required global::System.Collections.Generic.IList Repos { get; set; } /// - /// + /// Custom branch name for the agent to create.
+ /// Example: feature/add-readme ///
- [global::System.Text.Json.Serialization.JsonPropertyName("target")] - public global::CursorAgents.CreateAgentRequestTarget? Target { get; set; } + /// feature/add-readme + [global::System.Text.Json.Serialization.JsonPropertyName("branchName")] + public string? BranchName { get; set; } /// - /// + /// Whether to create a new branch (true) or push to an existing head branch (false). Only applies when `repos[0].prUrl` is provided.
+ /// Default Value: true + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("autoGenerateBranch")] + public bool? AutoGenerateBranch { get; set; } + + /// + /// Whether Cursor should open a pull request when the run completes.
+ /// Default Value: false ///
- [global::System.Text.Json.Serialization.JsonPropertyName("webhook")] - public global::CursorAgents.CreateAgentRequestWebhook? Webhook { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("autoCreatePR")] + public bool? AutoCreatePR { get; set; } + + /// + /// Whether to skip requesting the user as a reviewer when Cursor opens a PR. Only applies when `autoCreatePR` is true.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("skipReviewerRequest")] + public bool? SkipReviewerRequest { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -52,28 +67,45 @@ public sealed partial class CreateAgentRequest /// Initializes a new instance of the class. /// /// - /// - /// - /// Set to an explicit model ID for launch requests, or use "default" to use the configured default model. When omitted, Cursor resolves your user default model, then your team default model, then a system default.
- /// Example: claude-4-sonnet + /// + /// Repository configuration. v1 currently supports one entry. + /// + /// + /// + /// Custom branch name for the agent to create.
+ /// Example: feature/add-readme + /// + /// + /// Whether to create a new branch (true) or push to an existing head branch (false). Only applies when `repos[0].prUrl` is provided.
+ /// Default Value: true + /// + /// + /// Whether Cursor should open a pull request when the run completes.
+ /// Default Value: false + /// + /// + /// Whether to skip requesting the user as a reviewer when Cursor opens a PR. Only applies when `autoCreatePR` is true.
+ /// Default Value: false /// - /// - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CreateAgentRequest( global::CursorAgents.CreateAgentRequestPrompt prompt, - global::CursorAgents.CreateAgentRequestSource source, - string? model, - global::CursorAgents.CreateAgentRequestTarget? target, - global::CursorAgents.CreateAgentRequestWebhook? webhook) + global::System.Collections.Generic.IList repos, + global::CursorAgents.ModelRef? model, + string? branchName, + bool? autoGenerateBranch, + bool? autoCreatePR, + bool? skipReviewerRequest) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.Model = model; - this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); - this.Target = target; - this.Webhook = webhook; + this.Repos = repos ?? throw new global::System.ArgumentNullException(nameof(repos)); + this.BranchName = branchName; + this.AutoGenerateBranch = autoGenerateBranch; + this.AutoCreatePR = autoCreatePR; + this.SkipReviewerRequest = skipReviewerRequest; } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestPrompt.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestPrompt.g.cs index 8df253d..bb8db73 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestPrompt.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestPrompt.g.cs @@ -9,19 +9,17 @@ namespace CursorAgents public sealed partial class CreateAgentRequestPrompt { /// - /// The task or instructions for the agent to execute
- /// Example: Add a README.md file with installation instructions + /// Task instruction for the agent.
+ /// Example: Add a README with setup instructions ///
- /// Add a README.md file with installation instructions + /// Add a README with setup instructions [global::System.Text.Json.Serialization.JsonPropertyName("text")] [global::System.Text.Json.Serialization.JsonRequired] public required string Text { get; set; } /// - /// Optional array of base64 encoded images (max 5)
- /// Example: [{"data":"iVBORw0KGgoAAAANSUhEUgAA...","dimension":{"width":1024,"height":768}}] + /// Optional base64-encoded images. Maximum 5 images, 15 MB each. ///
- /// [{"data":"iVBORw0KGgoAAAANSUhEUgAA...","dimension":{"width":1024,"height":768}}] [global::System.Text.Json.Serialization.JsonPropertyName("images")] public global::System.Collections.Generic.IList? Images { get; set; } @@ -35,12 +33,11 @@ public sealed partial class CreateAgentRequestPrompt /// Initializes a new instance of the class. ///
/// - /// The task or instructions for the agent to execute
- /// Example: Add a README.md file with installation instructions + /// Task instruction for the agent.
+ /// Example: Add a README with setup instructions /// /// - /// Optional array of base64 encoded images (max 5)
- /// Example: [{"data":"iVBORw0KGgoAAAANSUhEUgAA...","dimension":{"width":1024,"height":768}}] + /// Optional base64-encoded images. Maximum 5 images, 15 MB each. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestSource.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestSource.Json.g.cs deleted file mode 100644 index 19025e0..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class CreateAgentRequestSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.CreateAgentRequestSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.CreateAgentRequestSource), - jsonSerializerContext) as global::CursorAgents.CreateAgentRequestSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.CreateAgentRequestSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.CreateAgentRequestSource), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CreateAgentRequestSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestTarget.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestTarget.g.cs deleted file mode 100644 index 91297ad..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestTarget.g.cs +++ /dev/null @@ -1,100 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class CreateAgentRequestTarget - { - /// - /// Whether to automatically create a pull request when the agent completes
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("autoCreatePr")] - public bool? AutoCreatePr { get; set; } - - /// - /// Whether to open the pull request as the Cursor GitHub App instead of as the user. Only applies if autoCreatePr is true.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("openAsCursorGithubApp")] - public bool? OpenAsCursorGithubApp { get; set; } - - /// - /// Whether to skip adding the user as a reviewer to the pull request. Only applies if autoCreatePr is true and the PR is opened as the Cursor GitHub App.
- /// Default Value: false - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("skipReviewerRequest")] - public bool? SkipReviewerRequest { get; set; } - - /// - /// Custom branch name for the agent to create
- /// Example: feature/add-readme - ///
- /// feature/add-readme - [global::System.Text.Json.Serialization.JsonPropertyName("branchName")] - public string? BranchName { get; set; } - - /// - /// Whether to create a new branch (true) or use the PR's existing head branch (false). Only applies when source.prUrl is provided.
- /// Default Value: true - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("autoBranch")] - public bool? AutoBranch { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Whether to automatically create a pull request when the agent completes
- /// Default Value: false - /// - /// - /// Whether to open the pull request as the Cursor GitHub App instead of as the user. Only applies if autoCreatePr is true.
- /// Default Value: false - /// - /// - /// Whether to skip adding the user as a reviewer to the pull request. Only applies if autoCreatePr is true and the PR is opened as the Cursor GitHub App.
- /// Default Value: false - /// - /// - /// Custom branch name for the agent to create
- /// Example: feature/add-readme - /// - /// - /// Whether to create a new branch (true) or use the PR's existing head branch (false). Only applies when source.prUrl is provided.
- /// Default Value: true - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CreateAgentRequestTarget( - bool? autoCreatePr, - bool? openAsCursorGithubApp, - bool? skipReviewerRequest, - string? branchName, - bool? autoBranch) - { - this.AutoCreatePr = autoCreatePr; - this.OpenAsCursorGithubApp = openAsCursorGithubApp; - this.SkipReviewerRequest = skipReviewerRequest; - this.BranchName = branchName; - this.AutoBranch = autoBranch; - } - - /// - /// Initializes a new instance of the class. - /// - public CreateAgentRequestTarget() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestWebhook.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestWebhook.Json.g.cs deleted file mode 100644 index 81f51ac..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestWebhook.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class CreateAgentRequestWebhook - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.CreateAgentRequestWebhook? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.CreateAgentRequestWebhook), - jsonSerializerContext) as global::CursorAgents.CreateAgentRequestWebhook; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.CreateAgentRequestWebhook? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.CreateAgentRequestWebhook), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CreateAgentRequestWebhook; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestWebhook.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestWebhook.g.cs deleted file mode 100644 index 12604b0..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestWebhook.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class CreateAgentRequestWebhook - { - /// - /// URL to receive webhook notifications about agent status changes
- /// Example: https://example.com/webhooks/cursor-agent - ///
- /// https://example.com/webhooks/cursor-agent - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } - - /// - /// Secret key for webhook payload verification
- /// Example: your-webhook-secret-key-minimum-32-characters - ///
- /// your-webhook-secret-key-minimum-32-characters - [global::System.Text.Json.Serialization.JsonPropertyName("secret")] - public string? Secret { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL to receive webhook notifications about agent status changes
- /// Example: https://example.com/webhooks/cursor-agent - /// - /// - /// Secret key for webhook payload verification
- /// Example: your-webhook-secret-key-minimum-32-characters - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CreateAgentRequestWebhook( - string url, - string? secret) - { - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); - this.Secret = secret; - } - - /// - /// Initializes a new instance of the class. - /// - public CreateAgentRequestWebhook() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponse.g.cs index 2a1494b..18d5063 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponse.g.cs @@ -8,55 +8,20 @@ namespace CursorAgents ///
public sealed partial class CreateAgentResponse { - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 - ///
- /// bc_abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// Name for the agent
- /// Example: Add README Documentation - ///
- /// Add README Documentation - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// Initial status of the newly created agent
- /// Example: CREATING - ///
- /// CREATING - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.CreateAgentResponseStatusJsonConverter))] - public global::CursorAgents.CreateAgentResponseStatus Status { get; set; } - /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("source")] + [global::System.Text.Json.Serialization.JsonPropertyName("agent")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.AgentJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.CreateAgentResponseSource Source { get; set; } + public required global::CursorAgents.Agent Agent { get; set; } /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("target")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.CreateAgentResponseTarget Target { get; set; } - - /// - /// When the agent was created
- /// Example: 2024-01-15T10:30:00Z - ///
- /// 2024-01-15T10:30:00Z - [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonPropertyName("run")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreatedAt { get; set; } + public required global::CursorAgents.Run Run { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -67,41 +32,17 @@ public sealed partial class CreateAgentResponse /// /// Initializes a new instance of the class. /// - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 - /// - /// - /// Name for the agent
- /// Example: Add README Documentation - /// - /// - /// - /// - /// When the agent was created
- /// Example: 2024-01-15T10:30:00Z - /// - /// - /// Initial status of the newly created agent
- /// Example: CREATING - /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CreateAgentResponse( - string id, - string name, - global::CursorAgents.CreateAgentResponseSource source, - global::CursorAgents.CreateAgentResponseTarget target, - global::System.DateTime createdAt, - global::CursorAgents.CreateAgentResponseStatus status) + global::CursorAgents.Agent agent, + global::CursorAgents.Run run) { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Status = status; - this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); - this.Target = target ?? throw new global::System.ArgumentNullException(nameof(target)); - this.CreatedAt = createdAt; + this.Agent = agent; + this.Run = run ?? throw new global::System.ArgumentNullException(nameof(run)); } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseSource.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseSource.Json.g.cs deleted file mode 100644 index f166796..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class CreateAgentResponseSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.CreateAgentResponseSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.CreateAgentResponseSource), - jsonSerializerContext) as global::CursorAgents.CreateAgentResponseSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.CreateAgentResponseSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.CreateAgentResponseSource), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CreateAgentResponseSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseSource.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseSource.g.cs deleted file mode 100644 index 70dfb44..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseSource.g.cs +++ /dev/null @@ -1,63 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class CreateAgentResponseSource - { - /// - /// The GitHub repository URL
- /// Example: https://github.com/your-org/your-repo - ///
- /// https://github.com/your-org/your-repo - [global::System.Text.Json.Serialization.JsonPropertyName("repository")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Repository { get; set; } - - /// - /// Git ref (branch/tag) used as the base branch
- /// Example: main - ///
- /// main - [global::System.Text.Json.Serialization.JsonPropertyName("ref")] - public string? Ref { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The GitHub repository URL
- /// Example: https://github.com/your-org/your-repo - /// - /// - /// Git ref (branch/tag) used as the base branch
- /// Example: main - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CreateAgentResponseSource( - string repository, - string? @ref) - { - this.Repository = repository ?? throw new global::System.ArgumentNullException(nameof(repository)); - this.Ref = @ref; - } - - /// - /// Initializes a new instance of the class. - /// - public CreateAgentResponseSource() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseTarget.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseTarget.Json.g.cs deleted file mode 100644 index 8524a06..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseTarget.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class CreateAgentResponseTarget - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.CreateAgentResponseTarget? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.CreateAgentResponseTarget), - jsonSerializerContext) as global::CursorAgents.CreateAgentResponseTarget; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.CreateAgentResponseTarget? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.CreateAgentResponseTarget), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CreateAgentResponseTarget; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseTarget.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseTarget.g.cs deleted file mode 100644 index 8b0acfc..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentResponseTarget.g.cs +++ /dev/null @@ -1,119 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class CreateAgentResponseTarget - { - /// - /// The Git branch name where the agent is working
- /// Example: cursor/add-readme-1234 - ///
- /// cursor/add-readme-1234 - [global::System.Text.Json.Serialization.JsonPropertyName("branchName")] - public string? BranchName { get; set; } - - /// - /// URL to view the agent in Cursor Web
- /// Example: https://cursor.com/agents?id=bc_abc123 - ///
- /// https://cursor.com/agents?id=bc_abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } - - /// - /// URL of the pull request, if agent was created from a PR
- /// Example: https://github.com/your-org/your-repo/pull/123 - ///
- /// https://github.com/your-org/your-repo/pull/123 - [global::System.Text.Json.Serialization.JsonPropertyName("prUrl")] - public string? PrUrl { get; set; } - - /// - /// Whether a pull request will be automatically created
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("autoCreatePr")] - public bool? AutoCreatePr { get; set; } - - /// - /// Whether the pull request will be opened as the Cursor GitHub App
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("openAsCursorGithubApp")] - public bool? OpenAsCursorGithubApp { get; set; } - - /// - /// Whether to skip adding the user as a reviewer to the pull request
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("skipReviewerRequest")] - public bool? SkipReviewerRequest { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL to view the agent in Cursor Web
- /// Example: https://cursor.com/agents?id=bc_abc123 - /// - /// - /// The Git branch name where the agent is working
- /// Example: cursor/add-readme-1234 - /// - /// - /// URL of the pull request, if agent was created from a PR
- /// Example: https://github.com/your-org/your-repo/pull/123 - /// - /// - /// Whether a pull request will be automatically created
- /// Example: false - /// - /// - /// Whether the pull request will be opened as the Cursor GitHub App
- /// Example: false - /// - /// - /// Whether to skip adding the user as a reviewer to the pull request
- /// Example: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public CreateAgentResponseTarget( - string url, - string? branchName, - string? prUrl, - bool? autoCreatePr, - bool? openAsCursorGithubApp, - bool? skipReviewerRequest) - { - this.BranchName = branchName; - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); - this.PrUrl = prUrl; - this.AutoCreatePr = autoCreatePr; - this.OpenAsCursorGithubApp = openAsCursorGithubApp; - this.SkipReviewerRequest = skipReviewerRequest; - } - - /// - /// Initializes a new instance of the class. - /// - public CreateAgentResponseTarget() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponse.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequest.Json.g.cs similarity index 87% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponse.Json.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequest.Json.g.cs index a0bb973..9419575 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponse.Json.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequest.Json.g.cs @@ -2,7 +2,7 @@ namespace CursorAgents { - public sealed partial class GetAgentResponse + public sealed partial class CreateRunRequest { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::CursorAgents.GetAgentResponse? FromJson( + public static global::CursorAgents.CreateRunRequest? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::CursorAgents.GetAgentResponse), - jsonSerializerContext) as global::CursorAgents.GetAgentResponse; + typeof(global::CursorAgents.CreateRunRequest), + jsonSerializerContext) as global::CursorAgents.CreateRunRequest; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::CursorAgents.GetAgentResponse? FromJson( + public static global::CursorAgents.CreateRunRequest? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::CursorAgents.GetAgentResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.GetAgentResponse; + typeof(global::CursorAgents.CreateRunRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CreateRunRequest; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequest.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequest.g.cs similarity index 69% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequest.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequest.g.cs index ec62a94..f57350d 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequest.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequest.g.cs @@ -6,14 +6,14 @@ namespace CursorAgents /// /// /// - public sealed partial class AddFollowupRequest + public sealed partial class CreateRunRequest { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.AddFollowupRequestPrompt Prompt { get; set; } + public required global::CursorAgents.CreateRunRequestPrompt Prompt { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,22 +22,22 @@ public sealed partial class AddFollowupRequest public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public AddFollowupRequest( - global::CursorAgents.AddFollowupRequestPrompt prompt) + public CreateRunRequest( + global::CursorAgents.CreateRunRequestPrompt prompt) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public AddFollowupRequest() + public CreateRunRequest() { } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestTarget.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.Json.g.cs similarity index 86% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestTarget.Json.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.Json.g.cs index 63dcd8d..db1726b 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestTarget.Json.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.Json.g.cs @@ -2,7 +2,7 @@ namespace CursorAgents { - public sealed partial class CreateAgentRequestTarget + public sealed partial class CreateRunRequestPrompt { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::CursorAgents.CreateAgentRequestTarget? FromJson( + public static global::CursorAgents.CreateRunRequestPrompt? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::CursorAgents.CreateAgentRequestTarget), - jsonSerializerContext) as global::CursorAgents.CreateAgentRequestTarget; + typeof(global::CursorAgents.CreateRunRequestPrompt), + jsonSerializerContext) as global::CursorAgents.CreateRunRequestPrompt; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::CursorAgents.CreateAgentRequestTarget? FromJson( + public static global::CursorAgents.CreateRunRequestPrompt? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::CursorAgents.CreateAgentRequestTarget), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CreateAgentRequestTarget; + typeof(global::CursorAgents.CreateRunRequestPrompt), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CreateRunRequestPrompt; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequestPrompt.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.g.cs similarity index 58% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequestPrompt.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.g.cs index a4210e5..2869900 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.AddFollowupRequestPrompt.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.g.cs @@ -6,22 +6,20 @@ namespace CursorAgents /// /// /// - public sealed partial class AddFollowupRequestPrompt + public sealed partial class CreateRunRequestPrompt { /// - /// The followup instruction for the agent
- /// Example: Also add a section about troubleshooting + /// Follow-up instruction text.
+ /// Example: Also add troubleshooting steps ///
- /// Also add a section about troubleshooting + /// Also add troubleshooting steps [global::System.Text.Json.Serialization.JsonPropertyName("text")] [global::System.Text.Json.Serialization.JsonRequired] public required string Text { get; set; } /// - /// Optional array of base64 encoded images (max 5)
- /// Example: [{"data":"iVBORw0KGgoAAAANSUhEUgAA...","dimension":{"width":1024,"height":768}}] + /// Optional base64-encoded images. Maximum 5 images, 15 MB each. ///
- /// [{"data":"iVBORw0KGgoAAAANSUhEUgAA...","dimension":{"width":1024,"height":768}}] [global::System.Text.Json.Serialization.JsonPropertyName("images")] public global::System.Collections.Generic.IList? Images { get; set; } @@ -32,20 +30,19 @@ public sealed partial class AddFollowupRequestPrompt public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - /// The followup instruction for the agent
- /// Example: Also add a section about troubleshooting + /// Follow-up instruction text.
+ /// Example: Also add troubleshooting steps /// /// - /// Optional array of base64 encoded images (max 5)
- /// Example: [{"data":"iVBORw0KGgoAAAANSUhEUgAA...","dimension":{"width":1024,"height":768}}] + /// Optional base64-encoded images. Maximum 5 images, 15 MB each. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public AddFollowupRequestPrompt( + public CreateRunRequestPrompt( string text, global::System.Collections.Generic.IList? images) { @@ -54,9 +51,9 @@ public AddFollowupRequestPrompt( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public AddFollowupRequestPrompt() + public CreateRunRequestPrompt() { } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.StopAgentResponse.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunResponse.Json.g.cs similarity index 87% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.StopAgentResponse.Json.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunResponse.Json.g.cs index 97e7d82..b809696 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.StopAgentResponse.Json.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace CursorAgents { - public sealed partial class StopAgentResponse + public sealed partial class CreateRunResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::CursorAgents.StopAgentResponse? FromJson( + public static global::CursorAgents.CreateRunResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::CursorAgents.StopAgentResponse), - jsonSerializerContext) as global::CursorAgents.StopAgentResponse; + typeof(global::CursorAgents.CreateRunResponse), + jsonSerializerContext) as global::CursorAgents.CreateRunResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::CursorAgents.StopAgentResponse? FromJson( + public static global::CursorAgents.CreateRunResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::CursorAgents.StopAgentResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.StopAgentResponse; + typeof(global::CursorAgents.CreateRunResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CreateRunResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunResponse.g.cs new file mode 100644 index 0000000..3e43afc --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunResponse.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class CreateRunResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("run")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::CursorAgents.Run Run { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateRunResponse( + global::CursorAgents.Run run) + { + this.Run = run ?? throw new global::System.ArgumentNullException(nameof(run)); + } + + /// + /// Initializes a new instance of the class. + /// + public CreateRunResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.DeleteAgentResponse.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.DownloadArtifactResponse.Json.g.cs similarity index 86% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.DeleteAgentResponse.Json.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.DownloadArtifactResponse.Json.g.cs index 21e3eaf..cd534f8 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.DeleteAgentResponse.Json.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.DownloadArtifactResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace CursorAgents { - public sealed partial class DeleteAgentResponse + public sealed partial class DownloadArtifactResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::CursorAgents.DeleteAgentResponse? FromJson( + public static global::CursorAgents.DownloadArtifactResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::CursorAgents.DeleteAgentResponse), - jsonSerializerContext) as global::CursorAgents.DeleteAgentResponse; + typeof(global::CursorAgents.DownloadArtifactResponse), + jsonSerializerContext) as global::CursorAgents.DownloadArtifactResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::CursorAgents.DeleteAgentResponse? FromJson( + public static global::CursorAgents.DownloadArtifactResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::CursorAgents.DeleteAgentResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.DeleteAgentResponse; + typeof(global::CursorAgents.DownloadArtifactResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.DownloadArtifactResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetArtifactResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.DownloadArtifactResponse.g.cs similarity index 75% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.GetArtifactResponse.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.DownloadArtifactResponse.g.cs index a0f70a3..6696de4 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetArtifactResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.DownloadArtifactResponse.g.cs @@ -6,10 +6,10 @@ namespace CursorAgents /// /// /// - public sealed partial class GetArtifactResponse + public sealed partial class DownloadArtifactResponse { /// - /// Temporary 15-minute presigned S3 URL for downloading the artifact
+ /// Temporary 15-minute presigned S3 URL for downloading the artifact.
/// Example: https://cloud-agent-artifacts.s3.us-east-1.amazonaws.com/... ///
/// https://cloud-agent-artifacts.s3.us-east-1.amazonaws.com/... @@ -18,10 +18,8 @@ public sealed partial class GetArtifactResponse public required string Url { get; set; } /// - /// When the presigned download URL expires
- /// Example: 2026-03-04T22:30:00.000Z + /// When the presigned URL expires. ///
- /// 2026-03-04T22:30:00.000Z [global::System.Text.Json.Serialization.JsonPropertyName("expiresAt")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.DateTime ExpiresAt { get; set; } @@ -33,20 +31,19 @@ public sealed partial class GetArtifactResponse public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - /// Temporary 15-minute presigned S3 URL for downloading the artifact
+ /// Temporary 15-minute presigned S3 URL for downloading the artifact.
/// Example: https://cloud-agent-artifacts.s3.us-east-1.amazonaws.com/... /// /// - /// When the presigned download URL expires
- /// Example: 2026-03-04T22:30:00.000Z + /// When the presigned URL expires. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public GetArtifactResponse( + public DownloadArtifactResponse( string url, global::System.DateTime expiresAt) { @@ -55,9 +52,9 @@ public GetArtifactResponse( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public GetArtifactResponse() + public DownloadArtifactResponse() { } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Error.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Error.g.cs index 2ca7927..65cdc55 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.Error.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Error.g.cs @@ -12,7 +12,8 @@ public sealed partial class Error /// ///
[global::System.Text.Json.Serialization.JsonPropertyName("error")] - public global::CursorAgents.ErrorError1? Error1 { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required global::CursorAgents.ErrorError1 Error1 { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -28,9 +29,9 @@ public sealed partial class Error [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Error( - global::CursorAgents.ErrorError1? error1) + global::CursorAgents.ErrorError1 error1) { - this.Error1 = error1; + this.Error1 = error1 ?? throw new global::System.ArgumentNullException(nameof(error1)); } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ErrorError1.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ErrorError1.g.cs index cce3b0a..b1d516b 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ErrorError1.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ErrorError1.g.cs @@ -9,16 +9,26 @@ namespace CursorAgents public sealed partial class ErrorError1 { /// - /// Human-readable error message + /// Machine-readable error code. Possible values include
+ /// `unauthorized`, `api_key_not_found`, `plan_required`,
+ /// `role_forbidden`, `feature_unavailable`,
+ /// `validation_error`, `missing_body`, `agent_not_found`,
+ /// `run_not_found`, `agent_busy`, `agent_archived`,
+ /// `run_not_cancellable`, `rate_limit_exceeded`,
+ /// `stream_expired`, `stream_unavailable`,
+ /// `invalid_last_event_id`, `upstream_error`, and
+ /// `internal_error`. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("message")] - public string? Message { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Code { get; set; } /// - /// Machine-readable error code + /// Human-readable error message. /// - [global::System.Text.Json.Serialization.JsonPropertyName("code")] - public string? Code { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,21 +39,29 @@ public sealed partial class ErrorError1 /// /// Initializes a new instance of the class. /// - /// - /// Human-readable error message - /// /// - /// Machine-readable error code + /// Machine-readable error code. Possible values include
+ /// `unauthorized`, `api_key_not_found`, `plan_required`,
+ /// `role_forbidden`, `feature_unavailable`,
+ /// `validation_error`, `missing_body`, `agent_not_found`,
+ /// `run_not_found`, `agent_busy`, `agent_archived`,
+ /// `run_not_cancellable`, `rate_limit_exceeded`,
+ /// `stream_expired`, `stream_unavailable`,
+ /// `invalid_last_event_id`, `upstream_error`, and
+ /// `internal_error`. + /// + /// + /// Human-readable error message. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ErrorError1( - string? message, - string? code) + string code, + string message) { - this.Message = message; - this.Code = code; + this.Code = code ?? throw new global::System.ArgumentNullException(nameof(code)); + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponse.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponse.Json.g.cs deleted file mode 100644 index 8fd607f..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class GetAgentConversationResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.GetAgentConversationResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.GetAgentConversationResponse), - jsonSerializerContext) as global::CursorAgents.GetAgentConversationResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.GetAgentConversationResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.GetAgentConversationResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.GetAgentConversationResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponse.g.cs deleted file mode 100644 index 6ea5ef3..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponse.g.cs +++ /dev/null @@ -1,61 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class GetAgentConversationResponse - { - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 - ///
- /// bc_abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// Array of conversation messages ordered chronologically - /// - [global::System.Text.Json.Serialization.JsonPropertyName("messages")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Messages { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 - /// - /// - /// Array of conversation messages ordered chronologically - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetAgentConversationResponse( - string id, - global::System.Collections.Generic.IList messages) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetAgentConversationResponse() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessage.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessage.Json.g.cs deleted file mode 100644 index 2115424..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessage.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class GetAgentConversationResponseMessage - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.GetAgentConversationResponseMessage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.GetAgentConversationResponseMessage), - jsonSerializerContext) as global::CursorAgents.GetAgentConversationResponseMessage; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.GetAgentConversationResponseMessage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.GetAgentConversationResponseMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.GetAgentConversationResponseMessage; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessage.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessage.g.cs deleted file mode 100644 index d98b957..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessage.g.cs +++ /dev/null @@ -1,80 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class GetAgentConversationResponseMessage - { - /// - /// Unique identifier for the message
- /// Example: msg_123 - ///
- /// msg_123 - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// Type of message - either from the user or the model
- /// Example: user_message - ///
- /// user_message - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.GetAgentConversationResponseMessageTypeJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.GetAgentConversationResponseMessageType Type { get; set; } - - /// - /// The content of the message
- /// Example: Add a README.md file with installation instructions - ///
- /// Add a README.md file with installation instructions - [global::System.Text.Json.Serialization.JsonPropertyName("text")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Text { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier for the message
- /// Example: msg_123 - /// - /// - /// Type of message - either from the user or the model
- /// Example: user_message - /// - /// - /// The content of the message
- /// Example: Add a README.md file with installation instructions - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetAgentConversationResponseMessage( - string id, - global::CursorAgents.GetAgentConversationResponseMessageType type, - string text) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Type = type; - this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); - } - - /// - /// Initializes a new instance of the class. - /// - public GetAgentConversationResponseMessage() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessageType.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessageType.g.cs deleted file mode 100644 index af21514..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentConversationResponseMessageType.g.cs +++ /dev/null @@ -1,52 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// Type of message - either from the user or the model
- /// Example: user_message - ///
- public enum GetAgentConversationResponseMessageType - { - /// - /// - /// - AssistantMessage, - /// - /// - /// - UserMessage, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class GetAgentConversationResponseMessageTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this GetAgentConversationResponseMessageType value) - { - return value switch - { - GetAgentConversationResponseMessageType.AssistantMessage => "assistant_message", - GetAgentConversationResponseMessageType.UserMessage => "user_message", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static GetAgentConversationResponseMessageType? ToEnum(string value) - { - return value switch - { - "assistant_message" => GetAgentConversationResponseMessageType.AssistantMessage, - "user_message" => GetAgentConversationResponseMessageType.UserMessage, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponse.g.cs deleted file mode 100644 index d7be710..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponse.g.cs +++ /dev/null @@ -1,129 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class GetAgentResponse - { - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 - ///
- /// bc_abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// Name for the agent
- /// Example: Add README Documentation - ///
- /// Add README Documentation - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// Current status of the cloud agent
- /// Example: RUNNING - ///
- /// RUNNING - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.GetAgentResponseStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.GetAgentResponseStatus Status { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("source")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.GetAgentResponseSource Source { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.GetAgentResponseTarget Target { get; set; } - - /// - /// Summary of the agent's work
- /// Example: Added README.md with installation instructions and usage examples - ///
- /// Added README.md with installation instructions and usage examples - [global::System.Text.Json.Serialization.JsonPropertyName("summary")] - public string? Summary { get; set; } - - /// - /// When the agent was created
- /// Example: 2024-01-15T10:30:00Z - ///
- /// 2024-01-15T10:30:00Z - [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreatedAt { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 - /// - /// - /// Name for the agent
- /// Example: Add README Documentation - /// - /// - /// Current status of the cloud agent
- /// Example: RUNNING - /// - /// - /// - /// - /// When the agent was created
- /// Example: 2024-01-15T10:30:00Z - /// - /// - /// Summary of the agent's work
- /// Example: Added README.md with installation instructions and usage examples - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetAgentResponse( - string id, - string name, - global::CursorAgents.GetAgentResponseStatus status, - global::CursorAgents.GetAgentResponseSource source, - global::CursorAgents.GetAgentResponseTarget target, - global::System.DateTime createdAt, - string? summary) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Status = status; - this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); - this.Target = target ?? throw new global::System.ArgumentNullException(nameof(target)); - this.Summary = summary; - this.CreatedAt = createdAt; - } - - /// - /// Initializes a new instance of the class. - /// - public GetAgentResponse() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseSource.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseSource.Json.g.cs deleted file mode 100644 index e2a2fc7..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class GetAgentResponseSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.GetAgentResponseSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.GetAgentResponseSource), - jsonSerializerContext) as global::CursorAgents.GetAgentResponseSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.GetAgentResponseSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.GetAgentResponseSource), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.GetAgentResponseSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseSource.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseSource.g.cs deleted file mode 100644 index f29c7bf..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseSource.g.cs +++ /dev/null @@ -1,62 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class GetAgentResponseSource - { - /// - /// The GitHub repository URL
- /// Example: https://github.com/your-org/your-repo - ///
- /// https://github.com/your-org/your-repo - [global::System.Text.Json.Serialization.JsonPropertyName("repository")] - public string? Repository { get; set; } - - /// - /// Git ref (branch/tag) used as the base branch
- /// Example: main - ///
- /// main - [global::System.Text.Json.Serialization.JsonPropertyName("ref")] - public string? Ref { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The GitHub repository URL
- /// Example: https://github.com/your-org/your-repo - /// - /// - /// Git ref (branch/tag) used as the base branch
- /// Example: main - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetAgentResponseSource( - string? repository, - string? @ref) - { - this.Repository = repository; - this.Ref = @ref; - } - - /// - /// Initializes a new instance of the class. - /// - public GetAgentResponseSource() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseTarget.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseTarget.Json.g.cs deleted file mode 100644 index 1d33ca9..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseTarget.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class GetAgentResponseTarget - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.GetAgentResponseTarget? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.GetAgentResponseTarget), - jsonSerializerContext) as global::CursorAgents.GetAgentResponseTarget; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.GetAgentResponseTarget? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.GetAgentResponseTarget), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.GetAgentResponseTarget; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseTarget.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseTarget.g.cs deleted file mode 100644 index 4918870..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseTarget.g.cs +++ /dev/null @@ -1,119 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class GetAgentResponseTarget - { - /// - /// The Git branch name where the agent is working
- /// Example: cursor/add-readme-1234 - ///
- /// cursor/add-readme-1234 - [global::System.Text.Json.Serialization.JsonPropertyName("branchName")] - public string? BranchName { get; set; } - - /// - /// URL to view the agent in Cursor Web
- /// Example: https://cursor.com/agents?id=bc_abc123 - ///
- /// https://cursor.com/agents?id=bc_abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } - - /// - /// URL to view the pull request in GitHub, if any
- /// Example: https://github.com/your-org/your-repo/pull/1234 - ///
- /// https://github.com/your-org/your-repo/pull/1234 - [global::System.Text.Json.Serialization.JsonPropertyName("prUrl")] - public string? PrUrl { get; set; } - - /// - /// Whether a pull request will be automatically created
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("autoCreatePr")] - public bool? AutoCreatePr { get; set; } - - /// - /// Whether the pull request will be opened as the Cursor GitHub App
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("openAsCursorGithubApp")] - public bool? OpenAsCursorGithubApp { get; set; } - - /// - /// Whether to skip adding the user as a reviewer to the pull request
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("skipReviewerRequest")] - public bool? SkipReviewerRequest { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL to view the agent in Cursor Web
- /// Example: https://cursor.com/agents?id=bc_abc123 - /// - /// - /// The Git branch name where the agent is working
- /// Example: cursor/add-readme-1234 - /// - /// - /// URL to view the pull request in GitHub, if any
- /// Example: https://github.com/your-org/your-repo/pull/1234 - /// - /// - /// Whether a pull request will be automatically created
- /// Example: false - /// - /// - /// Whether the pull request will be opened as the Cursor GitHub App
- /// Example: false - /// - /// - /// Whether to skip adding the user as a reviewer to the pull request
- /// Example: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GetAgentResponseTarget( - string url, - string? branchName, - string? prUrl, - bool? autoCreatePr, - bool? openAsCursorGithubApp, - bool? skipReviewerRequest) - { - this.BranchName = branchName; - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); - this.PrUrl = prUrl; - this.AutoCreatePr = autoCreatePr; - this.OpenAsCursorGithubApp = openAsCursorGithubApp; - this.SkipReviewerRequest = skipReviewerRequest; - } - - /// - /// Initializes a new instance of the class. - /// - public GetAgentResponseTarget() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetArtifactResponse.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.GetArtifactResponse.Json.g.cs deleted file mode 100644 index 3061656..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetArtifactResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class GetArtifactResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.GetArtifactResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.GetArtifactResponse), - jsonSerializerContext) as global::CursorAgents.GetArtifactResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.GetArtifactResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.GetArtifactResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.GetArtifactResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.IdResponse.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.IdResponse.Json.g.cs new file mode 100644 index 0000000..e43fa4d --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.IdResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class IdResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::CursorAgents.IdResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.IdResponse), + jsonSerializerContext) as global::CursorAgents.IdResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::CursorAgents.IdResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::CursorAgents.IdResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.IdResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.StopAgentResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.IdResponse.g.cs similarity index 68% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.StopAgentResponse.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.IdResponse.g.cs index faf18a0..c472352 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.StopAgentResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.IdResponse.g.cs @@ -6,13 +6,11 @@ namespace CursorAgents /// /// /// - public sealed partial class StopAgentResponse + public sealed partial class IdResponse { /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 + /// Identifier of the affected resource. ///
- /// bc_abc123 [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] public required string Id { get; set; } @@ -24,25 +22,24 @@ public sealed partial class StopAgentResponse public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 + /// Identifier of the affected resource. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public StopAgentResponse( + public IdResponse( string id) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public StopAgentResponse() + public IdResponse() { } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Image.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Image.g.cs index 011774f..3e3ff06 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.Image.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Image.g.cs @@ -9,7 +9,7 @@ namespace CursorAgents public sealed partial class Image { /// - /// Base64 encoded image data
+ /// Base64 encoded image data (max 15 MB)
/// Example: iVBORw0KGgoAAAANSUhEUgAA... ///
/// iVBORw0KGgoAAAANSUhEUgAA... @@ -33,7 +33,7 @@ public sealed partial class Image /// Initializes a new instance of the class. ///
/// - /// Base64 encoded image data
+ /// Base64 encoded image data (max 15 MB)
/// Example: iVBORw0KGgoAAAANSUhEUgAA... /// /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageDimension.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageDimension.g.cs index 6630a62..92a03c6 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageDimension.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageDimension.g.cs @@ -9,14 +9,14 @@ namespace CursorAgents public sealed partial class ImageDimension { /// - /// Width must be a positive integer + /// Width in pixels /// [global::System.Text.Json.Serialization.JsonPropertyName("width")] [global::System.Text.Json.Serialization.JsonRequired] public required int Width { get; set; } /// - /// Height must be a positive integer + /// Height in pixels /// [global::System.Text.Json.Serialization.JsonPropertyName("height")] [global::System.Text.Json.Serialization.JsonRequired] @@ -32,10 +32,10 @@ public sealed partial class ImageDimension /// Initializes a new instance of the class. ///
/// - /// Width must be a positive integer + /// Width in pixels /// /// - /// Height must be a positive integer + /// Height in pixels /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponse.g.cs index cd43b48..aa8aab7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponse.g.cs @@ -9,17 +9,17 @@ namespace CursorAgents public sealed partial class ListAgentsResponse { /// - /// List of agents + /// Agents, newest first. /// - [global::System.Text.Json.Serialization.JsonPropertyName("agents")] + [global::System.Text.Json.Serialization.JsonPropertyName("items")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Agents { get; set; } + public required global::System.Collections.Generic.IList Items { get; set; } /// - /// Cursor for fetching the next page of results
- /// Example: bc_def456 + /// Cursor for fetching the next page of results, or null when there are no more.
+ /// Example: bc-00000000-0000-0000-0000-000000000002 ///
- /// bc_def456 + /// bc-00000000-0000-0000-0000-000000000002 [global::System.Text.Json.Serialization.JsonPropertyName("nextCursor")] public string? NextCursor { get; set; } @@ -32,21 +32,21 @@ public sealed partial class ListAgentsResponse /// /// Initializes a new instance of the class. /// - /// - /// List of agents + /// + /// Agents, newest first. /// /// - /// Cursor for fetching the next page of results
- /// Example: bc_def456 + /// Cursor for fetching the next page of results, or null when there are no more.
+ /// Example: bc-00000000-0000-0000-0000-000000000002 /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ListAgentsResponse( - global::System.Collections.Generic.IList agents, + global::System.Collections.Generic.IList items, string? nextCursor) { - this.Agents = agents ?? throw new global::System.ArgumentNullException(nameof(agents)); + this.Items = items ?? throw new global::System.ArgumentNullException(nameof(items)); this.NextCursor = nextCursor; } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgent.g.cs deleted file mode 100644 index fb17227..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgent.g.cs +++ /dev/null @@ -1,129 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class ListAgentsResponseAgent - { - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 - ///
- /// bc_abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// Name for the agent
- /// Example: Add README Documentation - ///
- /// Add README Documentation - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// Current status of the cloud agent
- /// Example: RUNNING - ///
- /// RUNNING - [global::System.Text.Json.Serialization.JsonPropertyName("status")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.ListAgentsResponseAgentStatusJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.ListAgentsResponseAgentStatus Status { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("source")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.ListAgentsResponseAgentSource Source { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("target")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::CursorAgents.ListAgentsResponseAgentTarget Target { get; set; } - - /// - /// Summary of the agent's work
- /// Example: Added README.md with installation instructions and usage examples - ///
- /// Added README.md with installation instructions and usage examples - [global::System.Text.Json.Serialization.JsonPropertyName("summary")] - public string? Summary { get; set; } - - /// - /// When the agent was created
- /// Example: 2024-01-15T10:30:00Z - ///
- /// 2024-01-15T10:30:00Z - [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.DateTime CreatedAt { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 - /// - /// - /// Name for the agent
- /// Example: Add README Documentation - /// - /// - /// Current status of the cloud agent
- /// Example: RUNNING - /// - /// - /// - /// - /// When the agent was created
- /// Example: 2024-01-15T10:30:00Z - /// - /// - /// Summary of the agent's work
- /// Example: Added README.md with installation instructions and usage examples - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ListAgentsResponseAgent( - string id, - string name, - global::CursorAgents.ListAgentsResponseAgentStatus status, - global::CursorAgents.ListAgentsResponseAgentSource source, - global::CursorAgents.ListAgentsResponseAgentTarget target, - global::System.DateTime createdAt, - string? summary) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Status = status; - this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); - this.Target = target ?? throw new global::System.ArgumentNullException(nameof(target)); - this.Summary = summary; - this.CreatedAt = createdAt; - } - - /// - /// Initializes a new instance of the class. - /// - public ListAgentsResponseAgent() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentSource.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentSource.Json.g.cs deleted file mode 100644 index 2da7a39..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class ListAgentsResponseAgentSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.ListAgentsResponseAgentSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.ListAgentsResponseAgentSource), - jsonSerializerContext) as global::CursorAgents.ListAgentsResponseAgentSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.ListAgentsResponseAgentSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.ListAgentsResponseAgentSource), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ListAgentsResponseAgentSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentSource.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentSource.g.cs deleted file mode 100644 index 0937997..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentSource.g.cs +++ /dev/null @@ -1,62 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class ListAgentsResponseAgentSource - { - /// - /// The GitHub repository URL
- /// Example: https://github.com/your-org/your-repo - ///
- /// https://github.com/your-org/your-repo - [global::System.Text.Json.Serialization.JsonPropertyName("repository")] - public string? Repository { get; set; } - - /// - /// Git ref (branch/tag) used as the base branch
- /// Example: main - ///
- /// main - [global::System.Text.Json.Serialization.JsonPropertyName("ref")] - public string? Ref { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The GitHub repository URL
- /// Example: https://github.com/your-org/your-repo - /// - /// - /// Git ref (branch/tag) used as the base branch
- /// Example: main - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ListAgentsResponseAgentSource( - string? repository, - string? @ref) - { - this.Repository = repository; - this.Ref = @ref; - } - - /// - /// Initializes a new instance of the class. - /// - public ListAgentsResponseAgentSource() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentStatus.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentStatus.g.cs deleted file mode 100644 index 146ce4c..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentStatus.g.cs +++ /dev/null @@ -1,70 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// Current status of the cloud agent
- /// Example: RUNNING - ///
- public enum ListAgentsResponseAgentStatus - { - /// - /// - /// - Creating, - /// - /// - /// - Error, - /// - /// - /// - Expired, - /// - /// - /// - Finished, - /// - /// - /// - Running, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class ListAgentsResponseAgentStatusExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this ListAgentsResponseAgentStatus value) - { - return value switch - { - ListAgentsResponseAgentStatus.Creating => "CREATING", - ListAgentsResponseAgentStatus.Error => "ERROR", - ListAgentsResponseAgentStatus.Expired => "EXPIRED", - ListAgentsResponseAgentStatus.Finished => "FINISHED", - ListAgentsResponseAgentStatus.Running => "RUNNING", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static ListAgentsResponseAgentStatus? ToEnum(string value) - { - return value switch - { - "CREATING" => ListAgentsResponseAgentStatus.Creating, - "ERROR" => ListAgentsResponseAgentStatus.Error, - "EXPIRED" => ListAgentsResponseAgentStatus.Expired, - "FINISHED" => ListAgentsResponseAgentStatus.Finished, - "RUNNING" => ListAgentsResponseAgentStatus.Running, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentTarget.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentTarget.Json.g.cs deleted file mode 100644 index b485ce0..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentTarget.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class ListAgentsResponseAgentTarget - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.ListAgentsResponseAgentTarget? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.ListAgentsResponseAgentTarget), - jsonSerializerContext) as global::CursorAgents.ListAgentsResponseAgentTarget; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.ListAgentsResponseAgentTarget? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.ListAgentsResponseAgentTarget), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ListAgentsResponseAgentTarget; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentTarget.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentTarget.g.cs deleted file mode 100644 index 35e5ecd..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgentTarget.g.cs +++ /dev/null @@ -1,119 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class ListAgentsResponseAgentTarget - { - /// - /// The Git branch name where the agent is working
- /// Example: cursor/add-readme-1234 - ///
- /// cursor/add-readme-1234 - [global::System.Text.Json.Serialization.JsonPropertyName("branchName")] - public string? BranchName { get; set; } - - /// - /// URL to view the agent in Cursor Web
- /// Example: https://cursor.com/agents?id=bc_abc123 - ///
- /// https://cursor.com/agents?id=bc_abc123 - [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } - - /// - /// URL to view the pull request in GitHub, if any
- /// Example: https://github.com/your-org/your-repo/pull/1234 - ///
- /// https://github.com/your-org/your-repo/pull/1234 - [global::System.Text.Json.Serialization.JsonPropertyName("prUrl")] - public string? PrUrl { get; set; } - - /// - /// Whether a pull request will be automatically created
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("autoCreatePr")] - public bool? AutoCreatePr { get; set; } - - /// - /// Whether the pull request will be opened as the Cursor GitHub App
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("openAsCursorGithubApp")] - public bool? OpenAsCursorGithubApp { get; set; } - - /// - /// Whether to skip adding the user as a reviewer to the pull request
- /// Example: false - ///
- /// false - [global::System.Text.Json.Serialization.JsonPropertyName("skipReviewerRequest")] - public bool? SkipReviewerRequest { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// URL to view the agent in Cursor Web
- /// Example: https://cursor.com/agents?id=bc_abc123 - /// - /// - /// The Git branch name where the agent is working
- /// Example: cursor/add-readme-1234 - /// - /// - /// URL to view the pull request in GitHub, if any
- /// Example: https://github.com/your-org/your-repo/pull/1234 - /// - /// - /// Whether a pull request will be automatically created
- /// Example: false - /// - /// - /// Whether the pull request will be opened as the Cursor GitHub App
- /// Example: false - /// - /// - /// Whether to skip adding the user as a reviewer to the pull request
- /// Example: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ListAgentsResponseAgentTarget( - string url, - string? branchName, - string? prUrl, - bool? autoCreatePr, - bool? openAsCursorGithubApp, - bool? skipReviewerRequest) - { - this.BranchName = branchName; - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); - this.PrUrl = prUrl; - this.AutoCreatePr = autoCreatePr; - this.OpenAsCursorGithubApp = openAsCursorGithubApp; - this.SkipReviewerRequest = skipReviewerRequest; - } - - /// - /// Initializes a new instance of the class. - /// - public ListAgentsResponseAgentTarget() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListArtifactsResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListArtifactsResponse.g.cs index db3608f..90fbeeb 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListArtifactsResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListArtifactsResponse.g.cs @@ -9,11 +9,11 @@ namespace CursorAgents public sealed partial class ListArtifactsResponse { /// - /// Artifacts generated by the cloud agent. Returns at most 100 artifacts. + /// Artifacts produced by the agent. Returns at most 100 artifacts. /// - [global::System.Text.Json.Serialization.JsonPropertyName("artifacts")] + [global::System.Text.Json.Serialization.JsonPropertyName("items")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Artifacts { get; set; } + public required global::System.Collections.Generic.IList Items { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -24,16 +24,16 @@ public sealed partial class ListArtifactsResponse /// /// Initializes a new instance of the class. /// - /// - /// Artifacts generated by the cloud agent. Returns at most 100 artifacts. + /// + /// Artifacts produced by the agent. Returns at most 100 artifacts. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ListArtifactsResponse( - global::System.Collections.Generic.IList artifacts) + global::System.Collections.Generic.IList items) { - this.Artifacts = artifacts ?? throw new global::System.ArgumentNullException(nameof(artifacts)); + this.Items = items ?? throw new global::System.ArgumentNullException(nameof(items)); } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListModelsResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListModelsResponse.g.cs index c6041e4..3d186c7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListModelsResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListModelsResponse.g.cs @@ -9,13 +9,13 @@ namespace CursorAgents public sealed partial class ListModelsResponse { /// - /// Array of recommended explicit model IDs
- /// Example: [claude-4-sonnet-thinking, gpt-5.2, claude-4.5-sonnet-thinking] + /// Recommended set of explicit model IDs you can pass to the `model.id` field on POST /v1/agents.
+ /// Example: [composer-2, gpt-5.5, claude-4.6-sonnet-thinking] ///
- /// [claude-4-sonnet-thinking, gpt-5.2, claude-4.5-sonnet-thinking] - [global::System.Text.Json.Serialization.JsonPropertyName("models")] + /// [composer-2, gpt-5.5, claude-4.6-sonnet-thinking] + [global::System.Text.Json.Serialization.JsonPropertyName("items")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Models { get; set; } + public required global::System.Collections.Generic.IList Items { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -26,17 +26,17 @@ public sealed partial class ListModelsResponse /// /// Initializes a new instance of the class. /// - /// - /// Array of recommended explicit model IDs
- /// Example: [claude-4-sonnet-thinking, gpt-5.2, claude-4.5-sonnet-thinking] + /// + /// Recommended set of explicit model IDs you can pass to the `model.id` field on POST /v1/agents.
+ /// Example: [composer-2, gpt-5.5, claude-4.6-sonnet-thinking] /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ListModelsResponse( - global::System.Collections.Generic.IList models) + global::System.Collections.Generic.IList items) { - this.Models = models ?? throw new global::System.ArgumentNullException(nameof(models)); + this.Items = items ?? throw new global::System.ArgumentNullException(nameof(items)); } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponse.g.cs index 1ddabf0..707b117 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponse.g.cs @@ -9,11 +9,11 @@ namespace CursorAgents public sealed partial class ListRepositoriesResponse { /// - /// Array of GitHub repositories the user has access to + /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("repositories")] + [global::System.Text.Json.Serialization.JsonPropertyName("items")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Repositories { get; set; } + public required global::System.Collections.Generic.IList Items { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -24,16 +24,14 @@ public sealed partial class ListRepositoriesResponse /// /// Initializes a new instance of the class. /// - /// - /// Array of GitHub repositories the user has access to - /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ListRepositoriesResponse( - global::System.Collections.Generic.IList repositories) + global::System.Collections.Generic.IList items) { - this.Repositories = repositories ?? throw new global::System.ArgumentNullException(nameof(repositories)); + this.Items = items ?? throw new global::System.ArgumentNullException(nameof(items)); } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponseRepositorie.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponseRepositorie.Json.g.cs deleted file mode 100644 index a228fa7..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponseRepositorie.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace CursorAgents -{ - public sealed partial class ListRepositoriesResponseRepositorie - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::CursorAgents.ListRepositoriesResponseRepositorie? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::CursorAgents.ListRepositoriesResponseRepositorie), - jsonSerializerContext) as global::CursorAgents.ListRepositoriesResponseRepositorie; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::CursorAgents.ListRepositoriesResponseRepositorie? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::CursorAgents.ListRepositoriesResponseRepositorie), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ListRepositoriesResponseRepositorie; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponseRepositorie.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponseRepositorie.g.cs deleted file mode 100644 index b07325f..0000000 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRepositoriesResponseRepositorie.g.cs +++ /dev/null @@ -1,79 +0,0 @@ - -#nullable enable - -namespace CursorAgents -{ - /// - /// - /// - public sealed partial class ListRepositoriesResponseRepositorie - { - /// - /// The owner of the repository (user or organization)
- /// Example: your-org - ///
- /// your-org - [global::System.Text.Json.Serialization.JsonPropertyName("owner")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Owner { get; set; } - - /// - /// The name of the repository
- /// Example: your-repo - ///
- /// your-repo - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// The full URL to the GitHub repository
- /// Example: https://github.com/your-org/your-repo - ///
- /// https://github.com/your-org/your-repo - [global::System.Text.Json.Serialization.JsonPropertyName("repository")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Repository { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// The owner of the repository (user or organization)
- /// Example: your-org - /// - /// - /// The name of the repository
- /// Example: your-repo - /// - /// - /// The full URL to the GitHub repository
- /// Example: https://github.com/your-org/your-repo - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ListRepositoriesResponseRepositorie( - string owner, - string name, - string repository) - { - this.Owner = owner ?? throw new global::System.ArgumentNullException(nameof(owner)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Repository = repository ?? throw new global::System.ArgumentNullException(nameof(repository)); - } - - /// - /// Initializes a new instance of the class. - /// - public ListRepositoriesResponseRepositorie() - { - } - } -} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgent.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.Json.g.cs similarity index 87% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgent.Json.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.Json.g.cs index 1aa7818..cc8bd34 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponseAgent.Json.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace CursorAgents { - public sealed partial class ListAgentsResponseAgent + public sealed partial class ListRunsResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::CursorAgents.ListAgentsResponseAgent? FromJson( + public static global::CursorAgents.ListRunsResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::CursorAgents.ListAgentsResponseAgent), - jsonSerializerContext) as global::CursorAgents.ListAgentsResponseAgent; + typeof(global::CursorAgents.ListRunsResponse), + jsonSerializerContext) as global::CursorAgents.ListRunsResponse; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::CursorAgents.ListAgentsResponseAgent? FromJson( + public static global::CursorAgents.ListRunsResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::CursorAgents.ListAgentsResponseAgent), - jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ListAgentsResponseAgent; + typeof(global::CursorAgents.ListRunsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ListRunsResponse; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.g.cs new file mode 100644 index 0000000..e5f283e --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class ListRunsResponse + { + /// + /// Runs for this agent, newest first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("items")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Items { get; set; } + + /// + /// Cursor for fetching the next page of results, or null when there are no more. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Runs for this agent, newest first. + /// + /// + /// Cursor for fetching the next page of results, or null when there are no more. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListRunsResponse( + global::System.Collections.Generic.IList items, + string? nextCursor) + { + this.Items = items ?? throw new global::System.ArgumentNullException(nameof(items)); + this.NextCursor = nextCursor; + } + + /// + /// Initializes a new instance of the class. + /// + public ListRunsResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelRef.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelRef.Json.g.cs new file mode 100644 index 0000000..bc99e29 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelRef.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class ModelRef + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::CursorAgents.ModelRef? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.ModelRef), + jsonSerializerContext) as global::CursorAgents.ModelRef; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::CursorAgents.ModelRef? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::CursorAgents.ModelRef), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ModelRef; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.DeleteAgentResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelRef.g.cs similarity index 64% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.DeleteAgentResponse.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.ModelRef.g.cs index 588a421..88a0ad8 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.DeleteAgentResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelRef.g.cs @@ -6,13 +6,13 @@ namespace CursorAgents /// /// /// - public sealed partial class DeleteAgentResponse + public sealed partial class ModelRef { /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 + /// Explicit model ID returned by GET /v1/models. Omit `model` from the request to use the configured default.
+ /// Example: composer-2 ///
- /// bc_abc123 + /// composer-2 [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] public required string Id { get; set; } @@ -24,25 +24,25 @@ public sealed partial class DeleteAgentResponse public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// - /// Unique identifier for the cloud agent
- /// Example: bc_abc123 + /// Explicit model ID returned by GET /v1/models. Omit `model` from the request to use the configured default.
+ /// Example: composer-2 /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public DeleteAgentResponse( + public ModelRef( string id) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public DeleteAgentResponse() + public ModelRef() { } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.Json.g.cs new file mode 100644 index 0000000..e91ad2f --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class RepoConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::CursorAgents.RepoConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.RepoConfig), + jsonSerializerContext) as global::CursorAgents.RepoConfig; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::CursorAgents.RepoConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::CursorAgents.RepoConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.RepoConfig; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestSource.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.g.cs similarity index 62% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestSource.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.g.cs index c21720f..fbb1830 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestSource.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.g.cs @@ -6,26 +6,26 @@ namespace CursorAgents /// /// /// - public sealed partial class CreateAgentRequestSource + public sealed partial class RepoConfig { /// - /// The GitHub repository URL. Required unless prUrl is provided.
+ /// GitHub repository URL. Required unless `prUrl` is provided.
/// Example: https://github.com/your-org/your-repo ///
/// https://github.com/your-org/your-repo - [global::System.Text.Json.Serialization.JsonPropertyName("repository")] - public string? Repository { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } /// - /// Git ref (branch/tag) to use as the base branch
+ /// Branch, tag, or commit hash to use as the starting point.
/// Example: main ///
/// main - [global::System.Text.Json.Serialization.JsonPropertyName("ref")] - public string? Ref { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("startingRef")] + public string? StartingRef { get; set; } /// - /// GitHub pull request URL. When provided, the agent works on this PR's repository and branches. Mutually exclusive with repository/ref.
+ /// GitHub pull request URL. When provided, the agent works on this PR's repository and branches; `url` and `startingRef` are ignored.
/// Example: https://github.com/your-org/your-repo/pull/123 ///
/// https://github.com/your-org/your-repo/pull/123 @@ -39,37 +39,37 @@ public sealed partial class CreateAgentRequestSource public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// The GitHub repository URL. Required unless prUrl is provided.
+ /// + /// GitHub repository URL. Required unless `prUrl` is provided.
/// Example: https://github.com/your-org/your-repo /// - /// - /// Git ref (branch/tag) to use as the base branch
+ /// + /// Branch, tag, or commit hash to use as the starting point.
/// Example: main /// /// - /// GitHub pull request URL. When provided, the agent works on this PR's repository and branches. Mutually exclusive with repository/ref.
+ /// GitHub pull request URL. When provided, the agent works on this PR's repository and branches; `url` and `startingRef` are ignored.
/// Example: https://github.com/your-org/your-repo/pull/123 /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public CreateAgentRequestSource( - string? repository, - string? @ref, + public RepoConfig( + string? url, + string? startingRef, string? prUrl) { - this.Repository = repository; - this.Ref = @ref; + this.Url = url; + this.StartingRef = startingRef; this.PrUrl = prUrl; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public CreateAgentRequestSource() + public RepoConfig() { } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Repository.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Repository.Json.g.cs new file mode 100644 index 0000000..6574458 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Repository.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class Repository + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::CursorAgents.Repository? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.Repository), + jsonSerializerContext) as global::CursorAgents.Repository; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::CursorAgents.Repository? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::CursorAgents.Repository), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.Repository; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Repository.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Repository.g.cs new file mode 100644 index 0000000..9df5347 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Repository.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class Repository + { + /// + /// GitHub repository URL.
+ /// Example: https://github.com/your-org/your-repo + ///
+ /// https://github.com/your-org/your-repo + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// GitHub repository URL.
+ /// Example: https://github.com/your-org/your-repo + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Repository( + string url) + { + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + } + + /// + /// Initializes a new instance of the class. + /// + public Repository() + { + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.Json.g.cs new file mode 100644 index 0000000..253f284 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class Run + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::CursorAgents.Run? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.Run), + jsonSerializerContext) as global::CursorAgents.Run; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::CursorAgents.Run? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::CursorAgents.Run), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.Run; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.g.cs new file mode 100644 index 0000000..ffe7e7b --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.g.cs @@ -0,0 +1,97 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class Run + { + /// + /// Unique run identifier.
+ /// Example: run-00000000-0000-0000-0000-000000000001 + ///
+ /// run-00000000-0000-0000-0000-000000000001 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// ID of the agent this run belongs to.
+ /// Example: bc-00000000-0000-0000-0000-000000000001 + ///
+ /// bc-00000000-0000-0000-0000-000000000001 + [global::System.Text.Json.Serialization.JsonPropertyName("agentId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AgentId { get; set; } + + /// + /// Current run status. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.RunStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::CursorAgents.RunStatus Status { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique run identifier.
+ /// Example: run-00000000-0000-0000-0000-000000000001 + /// + /// + /// ID of the agent this run belongs to.
+ /// Example: bc-00000000-0000-0000-0000-000000000001 + /// + /// + /// Current run status. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Run( + string id, + string agentId, + global::CursorAgents.RunStatus status, + global::System.DateTime createdAt, + global::System.DateTime updatedAt) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.AgentId = agentId ?? throw new global::System.ArgumentNullException(nameof(agentId)); + this.Status = status; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public Run() + { + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseStatus.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStatus.g.cs similarity index 53% rename from src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseStatus.g.cs rename to src/libs/CursorAgents/Generated/CursorAgents.Models.RunStatus.g.cs index a003fa2..b607d8d 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.GetAgentResponseStatus.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStatus.g.cs @@ -4,11 +4,14 @@ namespace CursorAgents { /// - /// Current status of the cloud agent
- /// Example: RUNNING + /// Current run status. ///
- public enum GetAgentResponseStatus + public enum RunStatus { + /// + /// + /// + Cancelled, /// /// /// @@ -34,35 +37,37 @@ public enum GetAgentResponseStatus /// /// Enum extensions to do fast conversions without the reflection. /// - public static class GetAgentResponseStatusExtensions + public static class RunStatusExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this GetAgentResponseStatus value) + public static string ToValueString(this RunStatus value) { return value switch { - GetAgentResponseStatus.Creating => "CREATING", - GetAgentResponseStatus.Error => "ERROR", - GetAgentResponseStatus.Expired => "EXPIRED", - GetAgentResponseStatus.Finished => "FINISHED", - GetAgentResponseStatus.Running => "RUNNING", + RunStatus.Cancelled => "CANCELLED", + RunStatus.Creating => "CREATING", + RunStatus.Error => "ERROR", + RunStatus.Expired => "EXPIRED", + RunStatus.Finished => "FINISHED", + RunStatus.Running => "RUNNING", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static GetAgentResponseStatus? ToEnum(string value) + public static RunStatus? ToEnum(string value) { return value switch { - "CREATING" => GetAgentResponseStatus.Creating, - "ERROR" => GetAgentResponseStatus.Error, - "EXPIRED" => GetAgentResponseStatus.Expired, - "FINISHED" => GetAgentResponseStatus.Finished, - "RUNNING" => GetAgentResponseStatus.Running, + "CANCELLED" => RunStatus.Cancelled, + "CREATING" => RunStatus.Creating, + "ERROR" => RunStatus.Error, + "EXPIRED" => RunStatus.Expired, + "FINISHED" => RunStatus.Finished, + "RUNNING" => RunStatus.Running, _ => null, }; } diff --git a/src/libs/CursorAgents/openapi.yaml b/src/libs/CursorAgents/openapi.yaml index 880f3e1..9a13dd3 100644 --- a/src/libs/CursorAgents/openapi.yaml +++ b/src/libs/CursorAgents/openapi.yaml @@ -1,8 +1,12 @@ openapi: 3.0.3 info: title: Cursor Cloud Agents API - description: Programmatically create and manage AI-powered coding agents that work autonomously on your repositories - version: 0.1.0 + description: | + Programmatically create and manage Cursor Cloud Agents that work + autonomously on your repositories. v1 separates a durable agent + from one or more runs: each prompt submission creates a run on the + agent. Streaming and cancellation are scoped to the active run. + version: 1.0.0 contact: email: background-agent-feedback@cursor.com @@ -11,14 +15,16 @@ servers: description: Production server security: - - bearerAuth: [] + - basicAuth: [] components: securitySchemes: - bearerAuth: + basicAuth: type: http - scheme: bearer - description: API key from Cursor Dashboard + scheme: basic + description: | + API key from Cursor Dashboard, supplied as the Basic + Authentication username with an empty password. schemas: ImageDimension: @@ -30,11 +36,11 @@ components: width: type: integer minimum: 1 - description: Width must be a positive integer + description: Width in pixels height: type: integer minimum: 1 - description: Height must be a positive integer + description: Height in pixels Image: type: object @@ -44,16 +50,154 @@ components: data: type: string minLength: 1 - description: Base64 encoded image data + description: Base64 encoded image data (max 15 MB) example: 'iVBORw0KGgoAAAANSUhEUgAA...' dimension: $ref: '#/components/schemas/ImageDimension' + ModelRef: + type: object + required: + - id + properties: + id: + type: string + minLength: 1 + description: Explicit model ID returned by GET /v1/models. Omit `model` from the request to use the configured default. + example: 'composer-2' + + RepoConfig: + type: object + properties: + url: + type: string + minLength: 1 + description: GitHub repository URL. Required unless `prUrl` is provided. + example: 'https://github.com/your-org/your-repo' + startingRef: + type: string + minLength: 1 + description: Branch, tag, or commit hash to use as the starting point. + example: 'main' + prUrl: + type: string + format: uri + description: GitHub pull request URL. When provided, the agent works on this PR's repository and branches; `url` and `startingRef` are ignored. + example: 'https://github.com/your-org/your-repo/pull/123' + + AgentEnv: + type: object + required: + - type + properties: + type: + type: string + description: Execution environment type. + example: 'cloud' + + AgentSummary: + type: object + required: + - id + - name + - status + - env + - url + - createdAt + - updatedAt + properties: + id: + type: string + description: Unique agent identifier. + example: 'bc-00000000-0000-0000-0000-000000000001' + name: + type: string + description: Auto-derived agent name. + example: 'Add README with setup instructions' + status: + type: string + enum: ['ACTIVE', 'ARCHIVED'] + description: Agent lifecycle state. Execution status lives on runs. + env: + $ref: '#/components/schemas/AgentEnv' + url: + type: string + format: uri + description: URL to view the agent in Cursor Web. + example: 'https://cursor.com/agents?id=bc-00000000-0000-0000-0000-000000000001' + createdAt: + type: string + format: date-time + description: When the agent was created. + updatedAt: + type: string + format: date-time + description: When the agent was last updated. + latestRunId: + type: string + description: ID of the most recent run on this agent, if any. + example: 'run-00000000-0000-0000-0000-000000000001' + + Agent: + allOf: + - $ref: '#/components/schemas/AgentSummary' + - type: object + properties: + repos: + type: array + description: Repository configuration. v1 currently supports one entry. + items: + $ref: '#/components/schemas/RepoConfig' + branchName: + type: string + description: Branch the agent works on. + example: 'cursor/add-readme' + autoGenerateBranch: + type: boolean + description: Whether the branch was auto-generated. + example: true + autoCreatePR: + type: boolean + description: Whether Cursor opens a pull request when the run completes. + example: true + skipReviewerRequest: + type: boolean + description: Whether to skip requesting the user as a reviewer when Cursor opens a PR. + + Run: + type: object + required: + - id + - agentId + - status + - createdAt + - updatedAt + properties: + id: + type: string + description: Unique run identifier. + example: 'run-00000000-0000-0000-0000-000000000001' + agentId: + type: string + description: ID of the agent this run belongs to. + example: 'bc-00000000-0000-0000-0000-000000000001' + status: + type: string + enum: + ['CREATING', 'RUNNING', 'FINISHED', 'ERROR', 'CANCELLED', 'EXPIRED'] + description: Current run status. + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + CreateAgentRequest: type: object required: - prompt - - source + - repos properties: prompt: type: object @@ -63,134 +207,156 @@ components: text: type: string minLength: 1 - description: The task or instructions for the agent to execute - example: 'Add a README.md file with installation instructions' + description: Task instruction for the agent. + example: 'Add a README with setup instructions' images: type: array maxItems: 5 items: $ref: '#/components/schemas/Image' - description: Optional array of base64 encoded images (max 5) - example: - [ - { - 'data': 'iVBORw0KGgoAAAANSUhEUgAA...', - 'dimension': { 'width': 1024, 'height': 768 }, - }, - ] + description: Optional base64-encoded images. Maximum 5 images, 15 MB each. model: + $ref: '#/components/schemas/ModelRef' + repos: + type: array + minItems: 1 + maxItems: 1 + description: Repository configuration. v1 currently supports one entry. + items: + $ref: '#/components/schemas/RepoConfig' + branchName: type: string minLength: 1 - description: Set to an explicit model ID for launch requests, or use "default" to use the configured default model. When omitted, Cursor resolves your user default model, then your team default model, then a system default. - example: 'claude-4-sonnet' - source: - type: object - properties: - repository: - type: string - minLength: 1 - description: The GitHub repository URL. Required unless prUrl is provided. - example: 'https://github.com/your-org/your-repo' - ref: - type: string - minLength: 1 - description: Git ref (branch/tag) to use as the base branch - example: 'main' - prUrl: - type: string - format: uri - description: GitHub pull request URL. When provided, the agent works on this PR's repository and branches. Mutually exclusive with repository/ref. - example: 'https://github.com/your-org/your-repo/pull/123' - target: - type: object - properties: - autoCreatePr: - type: boolean - description: Whether to automatically create a pull request when the agent completes - default: false - openAsCursorGithubApp: - type: boolean - description: Whether to open the pull request as the Cursor GitHub App instead of as the user. Only applies if autoCreatePr is true. - default: false - skipReviewerRequest: - type: boolean - description: Whether to skip adding the user as a reviewer to the pull request. Only applies if autoCreatePr is true and the PR is opened as the Cursor GitHub App. - default: false - branchName: - type: string - minLength: 1 - description: Custom branch name for the agent to create - example: 'feature/add-readme' - autoBranch: - type: boolean - description: Whether to create a new branch (true) or use the PR's existing head branch (false). Only applies when source.prUrl is provided. - default: true - webhook: + description: Custom branch name for the agent to create. + example: 'feature/add-readme' + autoGenerateBranch: + type: boolean + description: Whether to create a new branch (true) or push to an existing head branch (false). Only applies when `repos[0].prUrl` is provided. + default: true + autoCreatePR: + type: boolean + description: Whether Cursor should open a pull request when the run completes. + default: false + skipReviewerRequest: + type: boolean + description: Whether to skip requesting the user as a reviewer when Cursor opens a PR. Only applies when `autoCreatePR` is true. + default: false + + CreateRunRequest: + type: object + required: + - prompt + properties: + prompt: type: object required: - - url + - text properties: - url: - type: string - format: uri - maxLength: 2048 - description: URL to receive webhook notifications about agent status changes - example: 'https://example.com/webhooks/cursor-agent' - secret: + text: type: string - minLength: 32 - maxLength: 256 - description: Secret key for webhook payload verification - example: 'your-webhook-secret-key-minimum-32-characters' + minLength: 1 + description: Follow-up instruction text. + example: 'Also add troubleshooting steps' + images: + type: array + maxItems: 5 + items: + $ref: '#/components/schemas/Image' + description: Optional base64-encoded images. Maximum 5 images, 15 MB each. - Error: + CreateAgentResponse: type: object + required: + - agent + - run properties: - error: - type: object - properties: - message: - type: string - description: Human-readable error message - code: - type: string - description: Machine-readable error code + agent: + $ref: '#/components/schemas/Agent' + run: + $ref: '#/components/schemas/Run' + + CreateRunResponse: + type: object + required: + - run + properties: + run: + $ref: '#/components/schemas/Run' + + ListAgentsResponse: + type: object + required: + - items + properties: + items: + type: array + description: Agents, newest first. + items: + $ref: '#/components/schemas/AgentSummary' + nextCursor: + type: string + nullable: true + description: Cursor for fetching the next page of results, or null when there are no more. + example: 'bc-00000000-0000-0000-0000-000000000002' + + ListRunsResponse: + type: object + required: + - items + properties: + items: + type: array + description: Runs for this agent, newest first. + items: + $ref: '#/components/schemas/Run' + nextCursor: + type: string + nullable: true + description: Cursor for fetching the next page of results, or null when there are no more. + + IdResponse: + type: object + required: + - id + properties: + id: + type: string + description: Identifier of the affected resource. Artifact: type: object required: - - absolutePath + - path - sizeBytes - updatedAt properties: - absolutePath: + path: type: string minLength: 1 - description: Absolute artifact path in the cloud agent environment - example: '/opt/cursor/artifacts/screenshot.png' + description: Artifact path relative to the workspace's `artifacts/` directory. + example: 'artifacts/screenshot.png' sizeBytes: type: integer minimum: 0 - description: Artifact file size in bytes + description: File size in bytes. example: 12345 updatedAt: type: string format: date-time - description: Last modified timestamp for the artifact - example: '2024-01-15T11:02:00.000Z' + description: Last modified timestamp. ListArtifactsResponse: type: object required: - - artifacts + - items properties: - artifacts: + items: type: array - description: Artifacts generated by the cloud agent. Returns at most 100 artifacts. + description: Artifacts produced by the agent. Returns at most 100 artifacts. items: $ref: '#/components/schemas/Artifact' - GetArtifactResponse: + DownloadArtifactResponse: type: object required: - url @@ -199,19 +365,167 @@ components: url: type: string format: uri - description: Temporary 15-minute presigned S3 URL for downloading the artifact + description: Temporary 15-minute presigned S3 URL for downloading the artifact. example: 'https://cloud-agent-artifacts.s3.us-east-1.amazonaws.com/...' expiresAt: type: string format: date-time - description: When the presigned download URL expires - example: '2026-03-04T22:30:00.000Z' + description: When the presigned URL expires. + + ApiKeyInfo: + type: object + required: + - apiKeyName + - createdAt + - userEmail + properties: + apiKeyName: + type: string + example: 'Production API Key' + createdAt: + type: string + format: date-time + userEmail: + type: string + format: email + example: 'developer@example.com' + + ListModelsResponse: + type: object + required: + - items + properties: + items: + type: array + description: Recommended set of explicit model IDs you can pass to the `model.id` field on POST /v1/agents. + items: + type: string + example: ['composer-2', 'gpt-5.5', 'claude-4.6-sonnet-thinking'] + + Repository: + type: object + required: + - url + properties: + url: + type: string + format: uri + description: GitHub repository URL. + example: 'https://github.com/your-org/your-repo' + + ListRepositoriesResponse: + type: object + required: + - items + properties: + items: + type: array + items: + $ref: '#/components/schemas/Repository' + + Error: + type: object + required: + - error + properties: + error: + type: object + required: + - code + - message + properties: + code: + type: string + description: | + Machine-readable error code. Possible values include + `unauthorized`, `api_key_not_found`, `plan_required`, + `role_forbidden`, `feature_unavailable`, + `validation_error`, `missing_body`, `agent_not_found`, + `run_not_found`, `agent_busy`, `agent_archived`, + `run_not_cancellable`, `rate_limit_exceeded`, + `stream_expired`, `stream_unavailable`, + `invalid_last_event_id`, `upstream_error`, and + `internal_error`. + message: + type: string + description: Human-readable error message. + + parameters: + AgentId: + name: id + in: path + required: true + description: Unique identifier for the agent. + schema: + type: string + example: 'bc-00000000-0000-0000-0000-000000000001' + RunId: + name: runId + in: path + required: true + description: Unique identifier for the run. + schema: + type: string + example: 'run-00000000-0000-0000-0000-000000000001' + + responses: + BadRequest: + description: Validation error or malformed request body. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + Unauthorized: + description: Invalid or missing API key. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + Forbidden: + description: Authenticated but insufficient permissions, plan required, or feature unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + NotFound: + description: Agent or run not found. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + Conflict: + description: Resource state conflict (`agent_busy`, `agent_archived`, or `run_not_cancellable`). + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + Gone: + description: Stream retention window has elapsed (`stream_expired`). + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + RateLimited: + description: Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + InternalError: + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' paths: - /v0/agents: + /v1/agents: post: - summary: Launch an agent - description: Start a new cloud agent to work on your repository + summary: Create an agent + description: | + Create a Cloud Agent and immediately enqueue its initial run. + The response contains both the durable `agent` and the initial + `run`. operationId: createAgent requestBody: required: true @@ -221,118 +535,30 @@ paths: $ref: '#/components/schemas/CreateAgentRequest' responses: '201': - description: Agent created successfully + description: Agent created and initial run enqueued. content: application/json: schema: - type: object - required: - - id - - name - - status - - source - - target - - createdAt - properties: - id: - type: string - description: Unique identifier for the cloud agent - example: 'bc_abc123' - name: - type: string - description: Name for the agent - example: 'Add README Documentation' - status: - type: string - enum: ['CREATING'] - description: Initial status of the newly created agent - example: 'CREATING' - source: - type: object - required: - - repository - properties: - repository: - type: string - description: The GitHub repository URL - example: 'https://github.com/your-org/your-repo' - ref: - type: string - description: Git ref (branch/tag) used as the base branch - example: 'main' - target: - type: object - required: - - url - properties: - branchName: - type: string - description: The Git branch name where the agent is working - example: 'cursor/add-readme-1234' - url: - type: string - description: URL to view the agent in Cursor Web - example: 'https://cursor.com/agents?id=bc_abc123' - prUrl: - type: string - description: URL of the pull request, if agent was created from a PR - example: 'https://github.com/your-org/your-repo/pull/123' - autoCreatePr: - type: boolean - description: Whether a pull request will be automatically created - example: false - openAsCursorGithubApp: - type: boolean - description: Whether the pull request will be opened as the Cursor GitHub App - example: false - skipReviewerRequest: - type: boolean - description: Whether to skip adding the user as a reviewer to the pull request - example: false - createdAt: - type: string - format: date-time - description: When the agent was created - example: '2024-01-15T10:30:00Z' + $ref: '#/components/schemas/CreateAgentResponse' '400': - description: Invalid request - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/BadRequest' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions, plan limits exceeded, or storage full - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/InternalError' get: summary: List agents - description: List all cloud agents for the authenticated user + description: List agents for the authenticated user, newest first. operationId: listAgents parameters: - name: limit in: query required: false - description: Number of cloud agents to return + description: Number of agents to return. schema: type: integer minimum: 1 @@ -341,882 +567,454 @@ paths: - name: cursor in: query required: false - description: Pagination cursor from the previous response + description: Pagination cursor from the previous response. schema: type: string minLength: 1 - example: 'bc_xyz789' - name: prUrl in: query required: false - description: Filter agents by pull request URL + description: Filter agents by GitHub pull request URL. schema: type: string format: uri - example: 'https://github.com/your-org/your-repo/pull/123' + - name: includeArchived + in: query + required: false + description: Whether to include archived agents. + schema: + type: boolean + default: true responses: '200': - description: Agents retrieved successfully + description: Agents retrieved successfully. content: application/json: schema: - type: object - required: - - agents - properties: - agents: - type: array - description: List of agents - items: - type: object - required: - - id - - name - - status - - source - - target - - createdAt - properties: - id: - type: string - description: Unique identifier for the cloud agent - example: 'bc_abc123' - name: - type: string - description: Name for the agent - example: 'Add README Documentation' - status: - type: string - enum: - [ - 'RUNNING', - 'FINISHED', - 'ERROR', - 'CREATING', - 'EXPIRED', - ] - description: Current status of the cloud agent - example: 'RUNNING' - source: - type: object - properties: - repository: - type: string - description: The GitHub repository URL - example: 'https://github.com/your-org/your-repo' - ref: - type: string - description: Git ref (branch/tag) used as the base branch - example: 'main' - target: - type: object - required: - - url - properties: - branchName: - type: string - description: The Git branch name where the agent is working - example: 'cursor/add-readme-1234' - url: - type: string - description: URL to view the agent in Cursor Web - example: 'https://cursor.com/agents?id=bc_abc123' - prUrl: - type: string - description: URL to view the pull request in GitHub, if any - example: 'https://github.com/your-org/your-repo/pull/1234' - autoCreatePr: - type: boolean - description: Whether a pull request will be automatically created - example: false - openAsCursorGithubApp: - type: boolean - description: Whether the pull request will be opened as the Cursor GitHub App - example: false - skipReviewerRequest: - type: boolean - description: Whether to skip adding the user as a reviewer to the pull request - example: false - summary: - type: string - description: Summary of the agent's work - example: 'Added README.md with installation instructions and usage examples' - createdAt: - type: string - format: date-time - description: When the agent was created - example: '2024-01-15T10:30:00Z' - nextCursor: - type: string - description: Cursor for fetching the next page of results - example: 'bc_def456' + $ref: '#/components/schemas/ListAgentsResponse' '400': - description: Invalid request - bad query parameters - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/BadRequest' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/InternalError' - /v0/agents/{id}: + /v1/agents/{id}: get: - summary: Agent status - description: Retrieve the current status and results of a cloud agent + summary: Get an agent + description: Retrieve durable metadata for an agent. Execution status lives on runs. operationId: getAgent parameters: - - name: id - in: path - required: true - description: Unique identifier for the cloud agent - schema: - type: string - example: 'bc_abc123' + - $ref: '#/components/parameters/AgentId' responses: '200': - description: Agent details retrieved successfully + description: Agent retrieved successfully. content: application/json: schema: - type: object - required: - - id - - name - - status - - source - - target - - createdAt - properties: - id: - type: string - description: Unique identifier for the cloud agent - example: 'bc_abc123' - name: - type: string - description: Name for the agent - example: 'Add README Documentation' - status: - type: string - enum: - ['RUNNING', 'FINISHED', 'ERROR', 'CREATING', 'EXPIRED'] - description: Current status of the cloud agent - example: 'RUNNING' - source: - type: object - properties: - repository: - type: string - description: The GitHub repository URL - example: 'https://github.com/your-org/your-repo' - ref: - type: string - description: Git ref (branch/tag) used as the base branch - example: 'main' - target: - type: object - required: - - url - properties: - branchName: - type: string - description: The Git branch name where the agent is working - example: 'cursor/add-readme-1234' - url: - type: string - description: URL to view the agent in Cursor Web - example: 'https://cursor.com/agents?id=bc_abc123' - prUrl: - type: string - description: URL to view the pull request in GitHub, if any - example: 'https://github.com/your-org/your-repo/pull/1234' - autoCreatePr: - type: boolean - description: Whether a pull request will be automatically created - example: false - openAsCursorGithubApp: - type: boolean - description: Whether the pull request will be opened as the Cursor GitHub App - example: false - skipReviewerRequest: - type: boolean - description: Whether to skip adding the user as a reviewer to the pull request - example: false - summary: - type: string - description: Summary of the agent's work - example: 'Added README.md with installation instructions and usage examples' - createdAt: - type: string - format: date-time - description: When the agent was created - example: '2024-01-15T10:30:00Z' - '400': - description: Invalid request - bad agent ID format - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Agent' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '404': - description: Agent not found or access denied - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/NotFound' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/InternalError' delete: - summary: Delete an agent - description: Delete a cloud agent. This action is permanent and cannot be undone. + summary: Delete an agent permanently + description: Permanently delete an agent. This action is irreversible. Use POST /v1/agents/{id}/archive for reversible removal. operationId: deleteAgent parameters: - - name: id - in: path - required: true - description: Unique identifier for the cloud agent - schema: - type: string - example: 'bc_abc123' + - $ref: '#/components/parameters/AgentId' responses: '200': - description: Agent deleted successfully + description: Agent deleted successfully. content: application/json: schema: - type: object - required: - - id - properties: - id: - type: string - description: Unique identifier for the cloud agent - example: 'bc_abc123' - '400': - description: Invalid request - bad agent ID format - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/IdResponse' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '404': - description: Agent not found or access denied - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: Conflict - agent is deleted or archived - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/NotFound' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/InternalError' - /v0/agents/{id}/followup: + /v1/agents/{id}/runs: post: - summary: Add followup - description: Add a followup instruction to an existing cloud agent - operationId: addFollowup + summary: Create a run + description: | + Send a follow-up prompt to an existing active agent. The new + run uses the agent's current conversation and workspace state. + Only one run can be active per agent at a time. + operationId: createRun parameters: - - name: id - in: path - required: true - description: Unique identifier for the cloud agent - schema: - type: string - example: 'bc_abc123' + - $ref: '#/components/parameters/AgentId' requestBody: required: true content: application/json: schema: - type: object - required: - - prompt - properties: - prompt: - type: object - required: - - text - properties: - text: - type: string - minLength: 1 - description: The followup instruction for the agent - example: 'Also add a section about troubleshooting' - images: - type: array - maxItems: 5 - items: - $ref: '#/components/schemas/Image' - description: Optional array of base64 encoded images (max 5) - example: - [ - { - 'data': 'iVBORw0KGgoAAAANSUhEUgAA...', - 'dimension': { 'width': 1024, 'height': 768 }, - }, - ] + $ref: '#/components/schemas/CreateRunRequest' responses: - '200': - description: Followup added successfully + '201': + description: Run created and enqueued. content: application/json: schema: - type: object - required: - - id - properties: - id: - type: string - description: Unique identifier for the cloud agent - example: 'bc_abc123' + $ref: '#/components/schemas/CreateRunResponse' '400': - description: Invalid request - bad agent ID format or invalid request body - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/BadRequest' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '404': - description: Agent not found or access denied - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/NotFound' '409': - description: Conflict - agent is deleted or archived - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Conflict' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - - /v0/agents/{id}/stop: - post: - summary: Stop an agent - description: Stop a running cloud agent. This pauses the agent's execution without deleting it. Stopped agents cannot be resumed. - operationId: stopAgent + $ref: '#/components/responses/InternalError' + get: + summary: List runs + description: List runs for an agent, newest first. + operationId: listRuns parameters: - - name: id - in: path - required: true - description: Unique identifier for the cloud agent + - $ref: '#/components/parameters/AgentId' + - name: limit + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 20 + - name: cursor + in: query + required: false + description: Pagination cursor from the previous response. schema: type: string - example: 'bc_abc123' + minLength: 1 responses: '200': - description: Agent stopped successfully - content: - application/json: - schema: - type: object - required: - - id - properties: - id: - type: string - description: Unique identifier for the cloud agent - example: 'bc_abc123' - '400': - description: Invalid request - bad agent ID format + description: Runs retrieved successfully. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/ListRunsResponse' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '404': - description: Agent not found or access denied - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: Conflict - agent is deleted or archived - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/NotFound' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error + $ref: '#/components/responses/InternalError' + + /v1/agents/{id}/runs/{runId}: + get: + summary: Get a run + description: Retrieve status and timestamps for a specific run. + operationId: getRun + parameters: + - $ref: '#/components/parameters/AgentId' + - $ref: '#/components/parameters/RunId' + responses: + '200': + description: Run retrieved successfully. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Run' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/RateLimited' + '500': + $ref: '#/components/responses/InternalError' - /v0/agents/{id}/conversation: + /v1/agents/{id}/runs/{runId}/stream: get: - summary: Get agent conversation - description: Retrieve the conversation history of a cloud agent, including all user prompts and assistant responses - operationId: getAgentConversation + summary: Stream a run + description: | + Stream Server-Sent Events for one run. Event types include + `status`, `assistant`, `thinking`, `tool_call`, `heartbeat`, + `result`, `error`, and `done`. Reconnect with the + `Last-Event-ID` header to resume after a disconnect; the event + ID must belong to the requested run. Responses include the + `X-Cursor-Stream-Retention-Seconds` header. After the + retention window the endpoint may return `410 stream_expired`. + operationId: streamRun parameters: - - name: id - in: path - required: true - description: Unique identifier for the cloud agent + - $ref: '#/components/parameters/AgentId' + - $ref: '#/components/parameters/RunId' + - name: Last-Event-ID + in: header + required: false + description: Resume from a previously received event ID for this run. schema: type: string - example: 'bc_abc123' responses: '200': - description: Conversation retrieved successfully - content: - application/json: + description: SSE stream of run events. + headers: + X-Cursor-Stream-Retention-Seconds: + description: Server-side stream retention window in seconds. schema: - type: object - required: - - id - - messages - properties: - id: - type: string - description: Unique identifier for the cloud agent - example: 'bc_abc123' - messages: - type: array - description: Array of conversation messages ordered chronologically - items: - type: object - required: - - id - - type - - text - properties: - id: - type: string - description: Unique identifier for the message - example: 'msg_123' - type: - type: string - enum: ['user_message', 'assistant_message'] - description: Type of message - either from the user or the model - example: 'user_message' - text: - type: string - description: The content of the message - example: 'Add a README.md file with installation instructions' - '400': - description: Invalid request - bad agent ID format + type: integer content: - application/json: + text/event-stream: schema: - $ref: '#/components/schemas/Error' + type: string + '400': + $ref: '#/components/responses/BadRequest' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '404': - description: Agent not found or access denied + $ref: '#/components/responses/NotFound' + '410': + $ref: '#/components/responses/Gone' + '429': + $ref: '#/components/responses/RateLimited' + '500': + $ref: '#/components/responses/InternalError' + + /v1/agents/{id}/runs/{runId}/cancel: + post: + summary: Cancel a run + description: | + Cancel the active run for an agent. Cancellation is terminal — + the run transitions to `CANCELLED`. Cancelling a run that is + already terminal or was never active returns + `409 run_not_cancellable`. To continue the conversation, + create a new run on the same agent. + operationId: cancelRun + parameters: + - $ref: '#/components/parameters/AgentId' + - $ref: '#/components/parameters/RunId' + responses: + '200': + description: Run cancelled successfully. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/IdResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' '409': - description: Conflict - agent is deleted or archived - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Conflict' '429': - description: Rate limit exceeded + $ref: '#/components/responses/RateLimited' + '500': + $ref: '#/components/responses/InternalError' + + /v1/agents/{id}/archive: + post: + summary: Archive an agent + description: Archive an agent. Archived agents remain readable but cannot accept new runs until unarchived. + operationId: archiveAgent + parameters: + - $ref: '#/components/parameters/AgentId' + responses: + '200': + description: Agent archived successfully. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/IdResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error + $ref: '#/components/responses/InternalError' + + /v1/agents/{id}/unarchive: + post: + summary: Unarchive an agent + description: Unarchive an agent so it can accept new runs again. + operationId: unarchiveAgent + parameters: + - $ref: '#/components/parameters/AgentId' + responses: + '200': + description: Agent unarchived successfully. content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/IdResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/RateLimited' + '500': + $ref: '#/components/responses/InternalError' - /v0/agents/{id}/artifacts: + /v1/agents/{id}/artifacts: get: - summary: List agent artifacts - description: List artifacts generated by a cloud agent created within the last 6 months. Returns at most 100 artifacts. - operationId: listAgentArtifacts + summary: List artifacts + description: | + List artifacts produced by an agent. Each artifact's `path` is + relative to the workspace's `artifacts/` directory. Pass that + `path` to GET /v1/agents/{id}/artifacts/download to obtain a + presigned download URL. + operationId: listArtifacts parameters: - - name: id - in: path - required: true - description: Unique identifier for the cloud agent - schema: - type: string - example: 'bc-00000000-0000-0000-0000-000000000001' + - $ref: '#/components/parameters/AgentId' responses: '200': - description: Artifacts retrieved successfully + description: Artifacts retrieved successfully. content: application/json: schema: $ref: '#/components/schemas/ListArtifactsResponse' - '400': - description: Invalid request - bad agent ID format or artifacts expired for an agent older than 6 months - content: - application/json: - schema: - $ref: '#/components/schemas/Error' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '404': - description: Agent not found or access denied - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/NotFound' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/InternalError' - /v0/agents/{id}/artifacts/download: + /v1/agents/{id}/artifacts/download: get: summary: Download an artifact - description: Retrieve a temporary 15-minute presigned S3 URL for a specific artifact from an agent created within the last 6 months. The response includes both the URL and its expiration time. - operationId: getAgentArtifact + description: | + Retrieve a temporary 15-minute presigned S3 URL for an + artifact. The `path` query parameter must be a relative path + under `artifacts/` returned by GET /v1/agents/{id}/artifacts. + operationId: downloadArtifact parameters: - - name: id - in: path - required: true - description: Unique identifier for the cloud agent - schema: - type: string - example: 'bc-00000000-0000-0000-0000-000000000001' + - $ref: '#/components/parameters/AgentId' - name: path in: query required: true - description: Absolute artifact path from the list artifacts response + description: Relative artifact path under `artifacts/`. schema: type: string minLength: 1 - example: '/opt/cursor/artifacts/screenshot.png' + example: 'artifacts/screenshot.png' responses: '200': - description: Artifact URL retrieved successfully + description: Presigned URL retrieved successfully. content: application/json: schema: - $ref: '#/components/schemas/GetArtifactResponse' + $ref: '#/components/schemas/DownloadArtifactResponse' '400': - description: Invalid request - bad agent ID format, missing path query parameter, or artifacts expired for an agent older than 6 months - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/BadRequest' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '403': - description: Forbidden - insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Forbidden' '404': - description: Agent or artifact not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/NotFound' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/InternalError' - /v0/me: + /v1/me: get: summary: API key info - description: Retrieve information about the API key being used for authentication - operationId: getMe + description: Retrieve information about the API key being used for authentication. + operationId: getApiKeyInfo responses: '200': - description: API key information retrieved successfully + description: API key info retrieved successfully. content: application/json: schema: - type: object - required: - - apiKeyName - - createdAt - properties: - apiKeyName: - type: string - description: The name of the API key - example: 'Production API Key' - createdAt: - type: string - format: date-time - description: When the API key was created - example: '2024-01-15T10:30:00Z' - userEmail: - type: string - format: email - description: Email address of the user who owns the API key (if available) - example: 'developer@example.com' + $ref: '#/components/schemas/ApiKeyInfo' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '404': - description: API key not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /v0/models: + $ref: '#/components/responses/InternalError' + + /v1/models: get: - summary: List available models - description: Returns a recommended set of explicit model IDs for launch requests. This list excludes "default". + summary: List models + description: | + Returns a recommended set of explicit model IDs you can pass + to the `model.id` field on POST /v1/agents. To use the + configured default model, omit the `model` field from the + request body entirely. operationId: listModels responses: '200': - description: Models retrieved successfully + description: Models retrieved successfully. content: application/json: schema: - type: object - required: - - models - properties: - models: - type: array - description: Array of recommended explicit model IDs - items: - type: string - minLength: 1 - example: - [ - 'claude-4-sonnet-thinking', - 'gpt-5.2', - 'claude-4.5-sonnet-thinking', - ] + $ref: '#/components/schemas/ListModelsResponse' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /v0/repositories: + $ref: '#/components/responses/InternalError' + + /v1/repositories: get: summary: List GitHub repositories - description: Retrieve a list of GitHub repositories accessible to the authenticated user + description: | + List GitHub repositories accessible to the authenticated user + through Cursor's GitHub App installation. This endpoint has + very strict rate limits (1 request per user per minute, 30 + per user per hour) and can take tens of seconds to respond + for users with access to many repositories. Cache responses + aggressively and handle this information not being available + gracefully. operationId: listRepositories responses: '200': - description: Repositories retrieved successfully + description: Repositories retrieved successfully. content: application/json: schema: - type: object - required: - - repositories - properties: - repositories: - type: array - description: Array of GitHub repositories the user has access to - items: - type: object - required: - - owner - - name - - repository - properties: - owner: - type: string - description: The owner of the repository (user or organization) - example: 'your-org' - name: - type: string - description: The name of the repository - example: 'your-repo' - repository: - type: string - format: uri - description: The full URL to the GitHub repository - example: 'https://github.com/your-org/your-repo' + $ref: '#/components/schemas/ListRepositoriesResponse' '401': - description: Unauthorized - invalid or missing API key - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/Unauthorized' '429': - description: Rate limit exceeded - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/RateLimited' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/responses/InternalError'