diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs index 7996f5e..1dea051 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs @@ -465,7 +465,7 @@ partial void ProcessCancelRunResponseContent( h => h.Value), }; } - // Resource state conflict (`agent_busy`, `agent_archived`, or `run_not_cancellable`). + // Resource state conflict (`agent_busy`, `agent_archived`, `agent_id_conflict`, or `run_not_cancellable`). if ((int)__response.StatusCode == 409) { string? __content_409 = null; diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs index 2b929ef..5b2e13e 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs @@ -455,6 +455,44 @@ partial void ProcessCreateAgentResponseContent( h => h.Value), }; } + // Resource state conflict (`agent_busy`, `agent_archived`, `agent_id_conflict`, 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) { @@ -639,17 +677,27 @@ partial void ProcessCreateAgentResponseContent( /// /// /// + /// + /// Display name for the agent. Auto-derived from the prompt when omitted.
+ /// Example: Add README with setup instructions + /// + /// + /// Optional client-supplied agent identifier in `bc-<uuid>` form. Re-POSTing the same `agentId` returns `409 agent_id_conflict` instead of creating a duplicate. Cannot be combined with `envVars`; omit `agentId` so the server mints one when you need session secrets.
+ /// Example: bc-00000000-0000-0000-0000-000000000001 + /// /// /// - /// Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` to start a no-repo agent. + /// Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` (or pass `repos: []`) to start a no-repo agent. /// - /// - /// 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 + /// + /// When `false` (the default), Cursor pushes commits to a new
+ /// auto-generated branch (`cursor/...`) based on
+ /// `repos[0].startingRef` (or the PR base ref when `prUrl`
+ /// is set). When `true`, Cursor pushes directly to that
+ /// starting ref — for a non-PR create, that's the branch you
+ /// passed in `startingRef`; for a `prUrl` create, that's the
+ /// PR's head branch.
+ /// Default Value: false /// /// /// Whether Cursor should open a pull request when the run completes.
@@ -660,11 +708,24 @@ partial void ProcessCreateAgentResponseContent( /// Default Value: false /// /// - /// Session-scoped environment variables for the cloud agent. Values are encrypted at rest, injected into the agent's shell, and deleted with the agent. Names must be non-empty, 1024 bytes or less, and cannot start with `CURSOR_`. Values must be non-empty and 4096 bytes or less. + /// Session-scoped environment variables for the cloud agent.
+ /// Values are encrypted at rest, injected into the agent's
+ /// shell, and deleted with the agent. Names must be non-empty,
+ /// 255 bytes or less, and cannot start with `CURSOR_`. Values
+ /// must be non-empty and 4096 bytes or less. Cannot be
+ /// combined with a client-supplied `agentId`.
+ /// Beta: `envVars` is rolling out. If it isn't enabled for
+ /// your account yet, the field is silently ignored on create
+ /// rather than failing the request — verify the values are
+ /// present on a first run before relying on them in
+ /// production. /// /// /// Inline MCP server definitions available to the initial run. Remote servers support `headers` or OAuth `auth`; stdio servers run inside the cloud agent VM and can receive `env`. Server names must be unique. /// + /// + /// Custom subagents the main agent can delegate to. Names must be unique and not collide with built-ins. + /// /// /// Initial conversation mode for the agent's first run.
/// Default Value: agent @@ -675,14 +736,16 @@ partial void ProcessCreateAgentResponseContent( public async global::System.Threading.Tasks.Task CreateAgentAsync( global::CursorAgents.CreateAgentRequestPrompt prompt, global::CursorAgents.ModelRef? model = default, + string? name = default, + string? agentId = default, global::CursorAgents.AgentEnv? env = default, global::System.Collections.Generic.IList? repos = default, - string? branchName = default, - bool? autoGenerateBranch = default, + bool? workOnCurrentBranch = default, bool? autoCreatePR = default, bool? skipReviewerRequest = default, global::System.Collections.Generic.Dictionary? envVars = default, global::System.Collections.Generic.IList? mcpServers = default, + global::System.Collections.Generic.IList? customSubagents = default, global::CursorAgents.AgentMode? mode = default, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -691,14 +754,16 @@ partial void ProcessCreateAgentResponseContent( { Prompt = prompt, Model = model, + Name = name, + AgentId = agentId, Env = env, Repos = repos, - BranchName = branchName, - AutoGenerateBranch = autoGenerateBranch, + WorkOnCurrentBranch = workOnCurrentBranch, AutoCreatePR = autoCreatePR, SkipReviewerRequest = skipReviewerRequest, EnvVars = envVars, McpServers = mcpServers, + CustomSubagents = customSubagents, Mode = mode, }; diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs index 163b221..3ebc8ee 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs @@ -506,7 +506,7 @@ partial void ProcessCreateRunResponseContent( h => h.Value), }; } - // Resource state conflict (`agent_busy`, `agent_archived`, or `run_not_cancellable`). + // Resource state conflict (`agent_busy`, `agent_archived`, `agent_id_conflict`, or `run_not_cancellable`). if ((int)__response.StatusCode == 409) { string? __content_409 = null; diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs index 3944e45..76f0b8b 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs @@ -42,14 +42,27 @@ partial void ProcessStreamRunResponse( /// /// 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`.
- /// `tool_call` event data uses the `RunStreamToolCallData` schema. + /// Stream Server-Sent Events for one run. Event types are
+ /// `status`, `assistant`, `thinking`, `tool_call`,
+ /// `interaction_update`, `heartbeat`, `result`, `error`, and
+ /// `done`.
+ /// - `status` carries `{ runId, status }`. It has no `id` line
+ /// and is replayed at the top of every reconnect.
+ /// - `result` carries `{ runId, status, text?, durationMs?,
+ /// git? }`; `text` is the final assistant reply, `durationMs`
+ /// the wall-clock duration, and `git` mirrors `Run.git`.
+ /// - `interaction_update` carries the richer SDK-shape update
+ /// used by the TypeScript SDK and is emitted alongside the
+ /// simplified events that share the same event id. Use this if
+ /// you want the full SDK stream; otherwise handle the simplified
+ /// events and ignore it.
+ /// Reconnect with the `Last-Event-ID` header to resume after a
+ /// disconnect; the event ID must belong to the requested run
+ /// otherwise the endpoint returns `400 invalid_last_event_id`.
+ /// Responses include the `X-Cursor-Stream-Retention-Seconds`
+ /// header; after the retention window the endpoint may return
+ /// `410 stream_expired`. `tool_call` event data uses the
+ /// `RunStreamToolCallData` schema. ///
/// /// Example: bc-00000000-0000-0000-0000-000000000001 diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateAgent.g.cs index 06e75db..bd89bdf 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.CreateAgent.g.cs @@ -42,17 +42,27 @@ public partial interface ICursorAgentsClient /// /// /// + /// + /// Display name for the agent. Auto-derived from the prompt when omitted.
+ /// Example: Add README with setup instructions + /// + /// + /// Optional client-supplied agent identifier in `bc-<uuid>` form. Re-POSTing the same `agentId` returns `409 agent_id_conflict` instead of creating a duplicate. Cannot be combined with `envVars`; omit `agentId` so the server mints one when you need session secrets.
+ /// Example: bc-00000000-0000-0000-0000-000000000001 + /// /// /// - /// Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` to start a no-repo agent. - /// - /// - /// Custom branch name for the agent to create.
- /// Example: feature/add-readme + /// Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` (or pass `repos: []`) to start a no-repo agent. /// - /// - /// 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 + /// + /// When `false` (the default), Cursor pushes commits to a new
+ /// auto-generated branch (`cursor/...`) based on
+ /// `repos[0].startingRef` (or the PR base ref when `prUrl`
+ /// is set). When `true`, Cursor pushes directly to that
+ /// starting ref — for a non-PR create, that's the branch you
+ /// passed in `startingRef`; for a `prUrl` create, that's the
+ /// PR's head branch.
+ /// Default Value: false /// /// /// Whether Cursor should open a pull request when the run completes.
@@ -63,11 +73,24 @@ public partial interface ICursorAgentsClient /// Default Value: false /// /// - /// Session-scoped environment variables for the cloud agent. Values are encrypted at rest, injected into the agent's shell, and deleted with the agent. Names must be non-empty, 1024 bytes or less, and cannot start with `CURSOR_`. Values must be non-empty and 4096 bytes or less. + /// Session-scoped environment variables for the cloud agent.
+ /// Values are encrypted at rest, injected into the agent's
+ /// shell, and deleted with the agent. Names must be non-empty,
+ /// 255 bytes or less, and cannot start with `CURSOR_`. Values
+ /// must be non-empty and 4096 bytes or less. Cannot be
+ /// combined with a client-supplied `agentId`.
+ /// Beta: `envVars` is rolling out. If it isn't enabled for
+ /// your account yet, the field is silently ignored on create
+ /// rather than failing the request — verify the values are
+ /// present on a first run before relying on them in
+ /// production. /// /// /// Inline MCP server definitions available to the initial run. Remote servers support `headers` or OAuth `auth`; stdio servers run inside the cloud agent VM and can receive `env`. Server names must be unique. /// + /// + /// Custom subagents the main agent can delegate to. Names must be unique and not collide with built-ins. + /// /// /// Initial conversation mode for the agent's first run.
/// Default Value: agent @@ -78,14 +101,16 @@ public partial interface ICursorAgentsClient global::System.Threading.Tasks.Task CreateAgentAsync( global::CursorAgents.CreateAgentRequestPrompt prompt, global::CursorAgents.ModelRef? model = default, + string? name = default, + string? agentId = default, global::CursorAgents.AgentEnv? env = default, global::System.Collections.Generic.IList? repos = default, - string? branchName = default, - bool? autoGenerateBranch = default, + bool? workOnCurrentBranch = default, bool? autoCreatePR = default, bool? skipReviewerRequest = default, global::System.Collections.Generic.Dictionary? envVars = default, global::System.Collections.Generic.IList? mcpServers = default, + global::System.Collections.Generic.IList? customSubagents = default, global::CursorAgents.AgentMode? mode = default, global::CursorAgents.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs index e957a0e..6af3b6d 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs @@ -6,14 +6,27 @@ 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`.
- /// `tool_call` event data uses the `RunStreamToolCallData` schema. + /// Stream Server-Sent Events for one run. Event types are
+ /// `status`, `assistant`, `thinking`, `tool_call`,
+ /// `interaction_update`, `heartbeat`, `result`, `error`, and
+ /// `done`.
+ /// - `status` carries `{ runId, status }`. It has no `id` line
+ /// and is replayed at the top of every reconnect.
+ /// - `result` carries `{ runId, status, text?, durationMs?,
+ /// git? }`; `text` is the final assistant reply, `durationMs`
+ /// the wall-clock duration, and `git` mirrors `Run.git`.
+ /// - `interaction_update` carries the richer SDK-shape update
+ /// used by the TypeScript SDK and is emitted alongside the
+ /// simplified events that share the same event id. Use this if
+ /// you want the full SDK stream; otherwise handle the simplified
+ /// events and ignore it.
+ /// Reconnect with the `Last-Event-ID` header to resume after a
+ /// disconnect; the event ID must belong to the requested run
+ /// otherwise the endpoint returns `400 invalid_last_event_id`.
+ /// Responses include the `X-Cursor-Stream-Retention-Seconds`
+ /// header; after the retention window the endpoint may return
+ /// `410 stream_expired`. `tool_call` event data uses the
+ /// `RunStreamToolCallData` schema. ///
/// /// Example: bc-00000000-0000-0000-0000-000000000001 diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.Agent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.Agent.g.cs index 56c6b0d..30805bd 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.Agent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.Agent.g.cs @@ -47,10 +47,10 @@ public class AgentJsonConverter : global::System.Text.Json.Serialization.JsonCon 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("customSubagents")) __score1++; if (__jsonProps.Contains("repos")) __score1++; if (__jsonProps.Contains("skipReviewerRequest")) __score1++; + if (__jsonProps.Contains("workOnCurrentBranch")) __score1++; var __bestScore = 0; var __bestIndex = -1; if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CustomSubagentModel.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CustomSubagentModel.g.cs new file mode 100644 index 0000000..4eb7406 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CustomSubagentModel.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace CursorAgents.JsonConverters +{ + /// + public sealed class CustomSubagentModelJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::CursorAgents.CustomSubagentModel 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.CustomSubagentModelExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::CursorAgents.CustomSubagentModel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::CursorAgents.CustomSubagentModel); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::CursorAgents.CustomSubagentModel value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::CursorAgents.CustomSubagentModelExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CustomSubagentModelNullable.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CustomSubagentModelNullable.g.cs new file mode 100644 index 0000000..d077dfa --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.CustomSubagentModelNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace CursorAgents.JsonConverters +{ + /// + public sealed class CustomSubagentModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::CursorAgents.CustomSubagentModel? 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.CustomSubagentModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::CursorAgents.CustomSubagentModel)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::CursorAgents.CustomSubagentModel?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::CursorAgents.CustomSubagentModel? 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.CustomSubagentModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.OneOf3.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.OneOf3.g.cs new file mode 100644 index 0000000..96ffbe7 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.OneOf3.g.cs @@ -0,0 +1,216 @@ +#nullable enable + +namespace CursorAgents.JsonConverters +{ + /// + public class OneOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::CursorAgents.OneOf 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); + } + } + + var __score0 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score0++; + } + } + } + var __score1 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score1++; + } + } + } + var __score2 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score2++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + + T1? value1 = default; + T2? value2 = default; + T3? value3 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = 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(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 2) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (value1 == null && value2 == null && value3 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::CursorAgents.OneOf( + value1, + + value2, + + value3 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::CursorAgents.OneOf 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.IsValue1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo); + } + else if (value.IsValue2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo); + } + else if (value.IsValue3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs index deee1a7..7c04278 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs @@ -41,6 +41,10 @@ namespace CursorAgents typeof(global::CursorAgents.JsonConverters.RunStreamToolCallEventEventNullableJsonConverter), + typeof(global::CursorAgents.JsonConverters.CustomSubagentModelJsonConverter), + + typeof(global::CursorAgents.JsonConverters.CustomSubagentModelNullableJsonConverter), + typeof(global::CursorAgents.JsonConverters.AgentModeJsonConverter), typeof(global::CursorAgents.JsonConverters.AgentModeNullableJsonConverter), @@ -51,6 +55,8 @@ namespace CursorAgents typeof(global::CursorAgents.JsonConverters.JsonValueJsonConverter), + typeof(global::CursorAgents.JsonConverters.OneOfJsonConverter), + typeof(global::CursorAgents.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.JsonSerializerContextTypes))] @@ -58,6 +64,7 @@ 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(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelRef))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelRefParam))] @@ -79,17 +86,23 @@ namespace CursorAgents [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::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CustomSubagent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunGitBranch))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunGit))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [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.RunStreamToolCallTruncation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.JsonValue), TypeInfoPropertyName = "JsonValue2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunStreamToolCallData))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunStreamToolCallDataStatus), TypeInfoPropertyName = "RunStreamToolCallDataStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunStreamToolCallEvent))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunStreamToolCallEventEvent), TypeInfoPropertyName = "RunStreamToolCallEventEvent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.OneOf), TypeInfoPropertyName = "OneOfCustomSubagentModelStringModelRef2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CustomSubagentModel), TypeInfoPropertyName = "CustomSubagentModel2")] [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))] @@ -110,7 +123,17 @@ namespace CursorAgents [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [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.ModelParameterValueDefinition))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelParameterDefinition))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelVariant))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelVariantParam))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ModelListItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [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))] @@ -121,12 +144,19 @@ namespace CursorAgents [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))] [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 a5047ec..678ddf2 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs @@ -44,243 +44,311 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::CursorAgents.ModelRef? Type4 { get; set; } + public object? Type4 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type5 { get; set; } + public global::CursorAgents.ModelRef? Type5 { get; set; } /// /// /// - public global::CursorAgents.ModelRefParam? Type6 { get; set; } + public global::System.Collections.Generic.IList? Type6 { get; set; } /// /// /// - public global::CursorAgents.RepoConfig? Type7 { get; set; } + public global::CursorAgents.ModelRefParam? Type7 { get; set; } /// /// /// - public global::CursorAgents.AgentEnv? Type8 { get; set; } + public global::CursorAgents.RepoConfig? Type8 { get; set; } /// /// /// - public global::CursorAgents.AgentEnvType? Type9 { get; set; } + public global::CursorAgents.AgentEnv? Type9 { get; set; } /// /// /// - public global::CursorAgents.McpAuth? Type10 { get; set; } + public global::CursorAgents.AgentEnvType? Type10 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type11 { get; set; } + public global::CursorAgents.McpAuth? Type11 { get; set; } /// /// /// - public global::CursorAgents.StdioMcpServer? Type12 { get; set; } + public global::System.Collections.Generic.IList? Type12 { get; set; } /// /// /// - public global::CursorAgents.StdioMcpServerType? Type13 { get; set; } + public global::CursorAgents.StdioMcpServer? Type13 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type14 { get; set; } + public global::CursorAgents.StdioMcpServerType? Type14 { get; set; } /// /// /// - public global::CursorAgents.RemoteMcpServer? Type15 { get; set; } + public global::System.Collections.Generic.Dictionary? Type15 { get; set; } /// /// /// - public global::CursorAgents.RemoteMcpServerType? Type16 { get; set; } + public global::CursorAgents.RemoteMcpServer? Type16 { get; set; } /// /// /// - public global::CursorAgents.McpServer? Type17 { get; set; } + public global::CursorAgents.RemoteMcpServerType? Type17 { get; set; } /// /// /// - public global::CursorAgents.AgentSummary? Type18 { get; set; } + public global::CursorAgents.McpServer? Type18 { get; set; } /// /// /// - public global::CursorAgents.AgentSummaryStatus? Type19 { get; set; } + public global::CursorAgents.AgentSummary? Type19 { get; set; } /// /// /// - public global::System.DateTime? Type20 { get; set; } + public global::CursorAgents.AgentSummaryStatus? Type20 { get; set; } /// /// /// - public global::CursorAgents.Agent? Type21 { get; set; } + public global::System.DateTime? Type21 { get; set; } /// /// /// - public global::CursorAgents.AgentVariant2? Type22 { get; set; } + public global::CursorAgents.Agent? Type22 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type23 { get; set; } + public global::CursorAgents.AgentVariant2? Type23 { get; set; } /// /// /// - public bool? Type24 { get; set; } + public global::System.Collections.Generic.IList? Type24 { get; set; } /// /// /// - public global::CursorAgents.Run? Type25 { get; set; } + public bool? Type25 { get; set; } /// /// /// - public global::CursorAgents.RunStatus? Type26 { get; set; } + public global::System.Collections.Generic.IList? Type26 { get; set; } /// /// /// - public global::CursorAgents.RunStreamToolCallTruncation? Type27 { get; set; } + public global::CursorAgents.CustomSubagent? Type27 { get; set; } /// /// /// - public global::CursorAgents.JsonValue? Type28 { get; set; } + public global::CursorAgents.RunGitBranch? Type28 { get; set; } /// /// /// - public double? Type29 { get; set; } + public global::CursorAgents.RunGit? Type29 { get; set; } /// /// /// - public object? Type30 { get; set; } + public global::System.Collections.Generic.IList? Type30 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type31 { get; set; } + public global::CursorAgents.Run? Type31 { get; set; } /// /// /// - public global::CursorAgents.RunStreamToolCallData? Type32 { get; set; } + public global::CursorAgents.RunStatus? Type32 { get; set; } /// /// /// - public global::CursorAgents.RunStreamToolCallDataStatus? Type33 { get; set; } + public global::CursorAgents.RunStreamToolCallTruncation? Type33 { get; set; } /// /// /// - public global::CursorAgents.RunStreamToolCallEvent? Type34 { get; set; } + public global::CursorAgents.JsonValue? Type34 { get; set; } /// /// /// - public global::CursorAgents.RunStreamToolCallEventEvent? Type35 { get; set; } + public double? Type35 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentRequest? Type36 { get; set; } + public global::System.Collections.Generic.IList? Type36 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentRequestPrompt? Type37 { get; set; } + public global::CursorAgents.RunStreamToolCallData? Type37 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type38 { get; set; } + public global::CursorAgents.RunStreamToolCallDataStatus? Type38 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type39 { get; set; } + public global::CursorAgents.RunStreamToolCallEvent? Type39 { get; set; } /// /// /// - public global::CursorAgents.AgentMode? Type40 { get; set; } + public global::CursorAgents.RunStreamToolCallEventEvent? Type40 { get; set; } /// /// /// - public global::CursorAgents.CreateRunRequest? Type41 { get; set; } + public global::CursorAgents.OneOf? Type41 { get; set; } /// /// /// - public global::CursorAgents.CreateRunRequestPrompt? Type42 { get; set; } + public global::CursorAgents.CustomSubagentModel? Type42 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentResponse? Type43 { get; set; } + public global::CursorAgents.CreateAgentRequest? Type43 { get; set; } /// /// /// - public global::CursorAgents.CreateRunResponse? Type44 { get; set; } + public global::CursorAgents.CreateAgentRequestPrompt? Type44 { get; set; } /// /// /// - public global::CursorAgents.ListAgentsResponse? Type45 { get; set; } + public global::System.Collections.Generic.IList? Type45 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type46 { get; set; } + public global::System.Collections.Generic.IList? Type46 { get; set; } /// /// /// - public global::CursorAgents.ListRunsResponse? Type47 { get; set; } + public global::CursorAgents.AgentMode? Type47 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type48 { get; set; } + public global::CursorAgents.CreateRunRequest? Type48 { get; set; } /// /// /// - public global::CursorAgents.IdResponse? Type49 { get; set; } + public global::CursorAgents.CreateRunRequestPrompt? Type49 { get; set; } /// /// /// - public global::CursorAgents.Artifact? Type50 { get; set; } + public global::CursorAgents.CreateAgentResponse? Type50 { get; set; } /// /// /// - public long? Type51 { get; set; } + public global::CursorAgents.CreateRunResponse? Type51 { get; set; } /// /// /// - public global::CursorAgents.ListArtifactsResponse? Type52 { get; set; } + public global::CursorAgents.ListAgentsResponse? Type52 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type53 { get; set; } + public global::System.Collections.Generic.IList? Type53 { get; set; } /// /// /// - public global::CursorAgents.DownloadArtifactResponse? Type54 { get; set; } + public global::CursorAgents.ListRunsResponse? Type54 { get; set; } /// /// /// - public global::CursorAgents.ApiKeyInfo? Type55 { get; set; } + public global::System.Collections.Generic.IList? Type55 { get; set; } /// /// /// - public global::CursorAgents.ListModelsResponse? Type56 { get; set; } + public global::CursorAgents.IdResponse? Type56 { get; set; } /// /// /// - public global::CursorAgents.Repository? Type57 { get; set; } + public global::CursorAgents.Artifact? Type57 { get; set; } /// /// /// - public global::CursorAgents.ListRepositoriesResponse? Type58 { get; set; } + public long? Type58 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type59 { get; set; } + public global::CursorAgents.ListArtifactsResponse? Type59 { get; set; } /// /// /// - public global::CursorAgents.CreateSubTokenRequest? Type60 { get; set; } + public global::System.Collections.Generic.IList? Type60 { get; set; } /// /// /// - public global::CursorAgents.CreateSubTokenResponse? Type61 { get; set; } + public global::CursorAgents.DownloadArtifactResponse? Type61 { get; set; } /// /// /// - public global::CursorAgents.Error? Type62 { get; set; } + public global::CursorAgents.ApiKeyInfo? Type62 { get; set; } /// /// /// - public global::CursorAgents.ErrorError1? Type63 { get; set; } + public global::CursorAgents.ModelParameterValueDefinition? Type63 { get; set; } + /// + /// + /// + public global::CursorAgents.ModelParameterDefinition? Type64 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type65 { get; set; } + /// + /// + /// + public global::CursorAgents.ModelVariant? Type66 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type67 { get; set; } + /// + /// + /// + public global::CursorAgents.ModelVariantParam? Type68 { get; set; } + /// + /// + /// + public global::CursorAgents.ModelListItem? Type69 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type70 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type71 { get; set; } + /// + /// + /// + public global::CursorAgents.ListModelsResponse? Type72 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type73 { get; set; } + /// + /// + /// + public global::CursorAgents.Repository? Type74 { get; set; } + /// + /// + /// + public global::CursorAgents.ListRepositoriesResponse? Type75 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type76 { get; set; } + /// + /// + /// + public global::CursorAgents.CreateSubTokenRequest? Type77 { get; set; } + /// + /// + /// + public global::CursorAgents.CreateSubTokenResponse? Type78 { get; set; } + /// + /// + /// + public global::CursorAgents.Error? Type79 { get; set; } + /// + /// + /// + public global::CursorAgents.ErrorError1? Type80 { get; set; } /// /// @@ -297,30 +365,58 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - 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? ListType5 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType6 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType7 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType8 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType9 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType10 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType4 { get; set; } + public global::System.Collections.Generic.List? ListType11 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType5 { get; set; } + public global::System.Collections.Generic.List? ListType12 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType6 { get; set; } + public global::System.Collections.Generic.List? ListType13 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType7 { get; set; } + public global::System.Collections.Generic.List? ListType14 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType8 { get; set; } + public global::System.Collections.Generic.List? ListType15 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType16 { get; set; } } } \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.g.cs index a1a20cc..545550c 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentSummary.g.cs @@ -18,13 +18,12 @@ public sealed partial class AgentSummary public required string Id { get; set; } /// - /// Auto-derived agent name.
+ /// Display name. Auto-derived from the prompt when not supplied at create time. Omitted when no name has been set.
/// 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; } + public string? Name { get; set; } /// /// Agent lifecycle state. Execution status lives on runs. @@ -43,9 +42,9 @@ public sealed partial class AgentSummary /// /// URL to view the agent in Cursor Web.
- /// Example: https://cursor.com/agents?id=bc-00000000-0000-0000-0000-000000000001 + /// Example: https://cursor.com/agents/bc-00000000-0000-0000-0000-000000000001 ///
- /// https://cursor.com/agents?id=bc-00000000-0000-0000-0000-000000000001 + /// https://cursor.com/agents/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; } @@ -85,17 +84,13 @@ public sealed partial class AgentSummary /// 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 + /// Example: https://cursor.com/agents/bc-00000000-0000-0000-0000-000000000001 /// /// /// When the agent was created. @@ -103,6 +98,10 @@ public sealed partial class AgentSummary /// /// When the agent was last updated. /// + /// + /// Display name. Auto-derived from the prompt when not supplied at create time. Omitted when no name has been set.
+ /// Example: Add README with setup instructions + /// /// /// ID of the most recent run on this agent, if any.
/// Example: run-00000000-0000-0000-0000-000000000001 @@ -112,16 +111,16 @@ public sealed partial class AgentSummary #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? name, string? latestRunId) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Name = name; this.Status = status; this.Env = env ?? throw new global::System.ArgumentNullException(nameof(env)); this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.g.cs index 9bc60d0..a5465c7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.AgentVariant2.g.cs @@ -15,20 +15,12 @@ public sealed partial class AgentVariant2 public global::System.Collections.Generic.IList? Repos { get; set; } /// - /// Branch the agent works on.
- /// Example: cursor/add-readme + /// When `false` (the default), Cursor pushes commits to a new auto-generated branch. When `true`, commits land on the existing head branch.
+ /// Example: false ///
- /// 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; } + /// false + [global::System.Text.Json.Serialization.JsonPropertyName("workOnCurrentBranch")] + public bool? WorkOnCurrentBranch { get; set; } /// /// Whether Cursor opens a pull request when the run completes.
@@ -44,6 +36,12 @@ public sealed partial class AgentVariant2 [global::System.Text.Json.Serialization.JsonPropertyName("skipReviewerRequest")] public bool? SkipReviewerRequest { get; set; } + /// + /// Custom subagents defined at create time. Omitted when none were provided. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("customSubagents")] + public global::System.Collections.Generic.IList? CustomSubagents { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -56,13 +54,9 @@ public sealed partial class AgentVariant2 /// /// Repository configuration. Empty for no-repo agents. /// - /// - /// Branch the agent works on.
- /// Example: cursor/add-readme - /// - /// - /// Whether the branch was auto-generated.
- /// Example: true + /// + /// When `false` (the default), Cursor pushes commits to a new auto-generated branch. When `true`, commits land on the existing head branch.
+ /// Example: false /// /// /// Whether Cursor opens a pull request when the run completes.
@@ -71,21 +65,24 @@ public sealed partial class AgentVariant2 /// /// Whether to skip requesting the user as a reviewer when Cursor opens a PR. /// + /// + /// Custom subagents defined at create time. Omitted when none were provided. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public AgentVariant2( global::System.Collections.Generic.IList? repos, - string? branchName, - bool? autoGenerateBranch, + bool? workOnCurrentBranch, bool? autoCreatePR, - bool? skipReviewerRequest) + bool? skipReviewerRequest, + global::System.Collections.Generic.IList? customSubagents) { this.Repos = repos; - this.BranchName = branchName; - this.AutoGenerateBranch = autoGenerateBranch; + this.WorkOnCurrentBranch = workOnCurrentBranch; this.AutoCreatePR = autoCreatePR; this.SkipReviewerRequest = skipReviewerRequest; + this.CustomSubagents = customSubagents; } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.g.cs index 89bac8e..ce9b603 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ApiKeyInfo.g.cs @@ -9,6 +9,7 @@ namespace CursorAgents public sealed partial class ApiKeyInfo { /// + /// Display name of the API key.
/// Example: Production API Key ///
/// Production API Key @@ -17,19 +18,43 @@ public sealed partial class ApiKeyInfo public required string ApiKeyName { get; set; } /// - /// + /// When the API key was created. /// [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.DateTime CreatedAt { get; set; } /// + /// Numeric Cursor user ID of the API key's owner. Omitted for service-account / team API keys, which aren't tied to a specific user.
+ /// Example: 42 + ///
+ /// 42 + [global::System.Text.Json.Serialization.JsonPropertyName("userId")] + public int? UserId { get; set; } + + /// + /// Email of the API key's owner. Omitted for service-account / team API keys.
/// Example: developer@example.com ///
/// developer@example.com [global::System.Text.Json.Serialization.JsonPropertyName("userEmail")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string UserEmail { get; set; } + public string? UserEmail { get; set; } + + /// + /// First name of the API key's owner, when populated.
+ /// Example: Alex + ///
+ /// Alex + [global::System.Text.Json.Serialization.JsonPropertyName("userFirstName")] + public string? UserFirstName { get; set; } + + /// + /// Last name of the API key's owner, when populated.
+ /// Example: Rivera + ///
+ /// Rivera + [global::System.Text.Json.Serialization.JsonPropertyName("userLastName")] + public string? UserLastName { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -41,23 +66,45 @@ public sealed partial class ApiKeyInfo /// Initializes a new instance of the class. /// /// + /// Display name of the API key.
/// Example: Production API Key /// - /// + /// + /// When the API key was created. + /// + /// + /// Numeric Cursor user ID of the API key's owner. Omitted for service-account / team API keys, which aren't tied to a specific user.
+ /// Example: 42 + /// /// + /// Email of the API key's owner. Omitted for service-account / team API keys.
/// Example: developer@example.com /// + /// + /// First name of the API key's owner, when populated.
+ /// Example: Alex + /// + /// + /// Last name of the API key's owner, when populated.
+ /// Example: Rivera + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ApiKeyInfo( string apiKeyName, global::System.DateTime createdAt, - string userEmail) + int? userId, + string? userEmail, + string? userFirstName, + string? userLastName) { this.ApiKeyName = apiKeyName ?? throw new global::System.ArgumentNullException(nameof(apiKeyName)); this.CreatedAt = createdAt; - this.UserEmail = userEmail ?? throw new global::System.ArgumentNullException(nameof(userEmail)); + this.UserId = userId; + this.UserEmail = userEmail; + this.UserFirstName = userFirstName; + this.UserLastName = userLastName; } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequest.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequest.g.cs index 305d9a8..ae12936 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequest.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequest.g.cs @@ -21,6 +21,22 @@ public sealed partial class CreateAgentRequest [global::System.Text.Json.Serialization.JsonPropertyName("model")] public global::CursorAgents.ModelRef? Model { get; set; } + /// + /// Display name for the agent. Auto-derived from the prompt when omitted.
+ /// Example: Add README with setup instructions + ///
+ /// Add README with setup instructions + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Optional client-supplied agent identifier in `bc-<uuid>` form. Re-POSTing the same `agentId` returns `409 agent_id_conflict` instead of creating a duplicate. Cannot be combined with `envVars`; omit `agentId` so the server mints one when you need session secrets.
+ /// Example: bc-00000000-0000-0000-0000-000000000001 + ///
+ /// bc-00000000-0000-0000-0000-000000000001 + [global::System.Text.Json.Serialization.JsonPropertyName("agentId")] + public string? AgentId { get; set; } + /// /// /// @@ -28,25 +44,23 @@ public sealed partial class CreateAgentRequest public global::CursorAgents.AgentEnv? Env { get; set; } /// - /// Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` to start a no-repo agent. + /// Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` (or pass `repos: []`) to start a no-repo agent. /// [global::System.Text.Json.Serialization.JsonPropertyName("repos")] public global::System.Collections.Generic.IList? Repos { 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 push to an existing head branch (false). Only applies when `repos[0].prUrl` is provided.
- /// Default Value: true + /// When `false` (the default), Cursor pushes commits to a new
+ /// auto-generated branch (`cursor/...`) based on
+ /// `repos[0].startingRef` (or the PR base ref when `prUrl`
+ /// is set). When `true`, Cursor pushes directly to that
+ /// starting ref — for a non-PR create, that's the branch you
+ /// passed in `startingRef`; for a `prUrl` create, that's the
+ /// PR's head branch.
+ /// Default Value: false ///
- [global::System.Text.Json.Serialization.JsonPropertyName("autoGenerateBranch")] - public bool? AutoGenerateBranch { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("workOnCurrentBranch")] + public bool? WorkOnCurrentBranch { get; set; } /// /// Whether Cursor should open a pull request when the run completes.
@@ -63,7 +77,17 @@ public sealed partial class CreateAgentRequest public bool? SkipReviewerRequest { get; set; } /// - /// Session-scoped environment variables for the cloud agent. Values are encrypted at rest, injected into the agent's shell, and deleted with the agent. Names must be non-empty, 1024 bytes or less, and cannot start with `CURSOR_`. Values must be non-empty and 4096 bytes or less. + /// Session-scoped environment variables for the cloud agent.
+ /// Values are encrypted at rest, injected into the agent's
+ /// shell, and deleted with the agent. Names must be non-empty,
+ /// 255 bytes or less, and cannot start with `CURSOR_`. Values
+ /// must be non-empty and 4096 bytes or less. Cannot be
+ /// combined with a client-supplied `agentId`.
+ /// Beta: `envVars` is rolling out. If it isn't enabled for
+ /// your account yet, the field is silently ignored on create
+ /// rather than failing the request — verify the values are
+ /// present on a first run before relying on them in
+ /// production. ///
[global::System.Text.Json.Serialization.JsonPropertyName("envVars")] public global::System.Collections.Generic.Dictionary? EnvVars { get; set; } @@ -74,6 +98,12 @@ public sealed partial class CreateAgentRequest [global::System.Text.Json.Serialization.JsonPropertyName("mcpServers")] public global::System.Collections.Generic.IList? McpServers { get; set; } + /// + /// Custom subagents the main agent can delegate to. Names must be unique and not collide with built-ins. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("customSubagents")] + public global::System.Collections.Generic.IList? CustomSubagents { get; set; } + /// /// Initial conversation mode for the agent's first run.
/// Default Value: agent @@ -93,17 +123,27 @@ public sealed partial class CreateAgentRequest ///
/// /// + /// + /// Display name for the agent. Auto-derived from the prompt when omitted.
+ /// Example: Add README with setup instructions + /// + /// + /// Optional client-supplied agent identifier in `bc-<uuid>` form. Re-POSTing the same `agentId` returns `409 agent_id_conflict` instead of creating a duplicate. Cannot be combined with `envVars`; omit `agentId` so the server mints one when you need session secrets.
+ /// Example: bc-00000000-0000-0000-0000-000000000001 + /// /// /// - /// Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` to start a no-repo agent. - /// - /// - /// Custom branch name for the agent to create.
- /// Example: feature/add-readme + /// Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` (or pass `repos: []`) to start a no-repo agent. /// - /// - /// 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 + /// + /// When `false` (the default), Cursor pushes commits to a new
+ /// auto-generated branch (`cursor/...`) based on
+ /// `repos[0].startingRef` (or the PR base ref when `prUrl`
+ /// is set). When `true`, Cursor pushes directly to that
+ /// starting ref — for a non-PR create, that's the branch you
+ /// passed in `startingRef`; for a `prUrl` create, that's the
+ /// PR's head branch.
+ /// Default Value: false /// /// /// Whether Cursor should open a pull request when the run completes.
@@ -114,11 +154,24 @@ public sealed partial class CreateAgentRequest /// Default Value: false /// /// - /// Session-scoped environment variables for the cloud agent. Values are encrypted at rest, injected into the agent's shell, and deleted with the agent. Names must be non-empty, 1024 bytes or less, and cannot start with `CURSOR_`. Values must be non-empty and 4096 bytes or less. + /// Session-scoped environment variables for the cloud agent.
+ /// Values are encrypted at rest, injected into the agent's
+ /// shell, and deleted with the agent. Names must be non-empty,
+ /// 255 bytes or less, and cannot start with `CURSOR_`. Values
+ /// must be non-empty and 4096 bytes or less. Cannot be
+ /// combined with a client-supplied `agentId`.
+ /// Beta: `envVars` is rolling out. If it isn't enabled for
+ /// your account yet, the field is silently ignored on create
+ /// rather than failing the request — verify the values are
+ /// present on a first run before relying on them in
+ /// production. /// /// /// Inline MCP server definitions available to the initial run. Remote servers support `headers` or OAuth `auth`; stdio servers run inside the cloud agent VM and can receive `env`. Server names must be unique. /// + /// + /// Custom subagents the main agent can delegate to. Names must be unique and not collide with built-ins. + /// /// /// Initial conversation mode for the agent's first run.
/// Default Value: agent @@ -129,26 +182,30 @@ public sealed partial class CreateAgentRequest public CreateAgentRequest( global::CursorAgents.CreateAgentRequestPrompt prompt, global::CursorAgents.ModelRef? model, + string? name, + string? agentId, global::CursorAgents.AgentEnv? env, global::System.Collections.Generic.IList? repos, - string? branchName, - bool? autoGenerateBranch, + bool? workOnCurrentBranch, bool? autoCreatePR, bool? skipReviewerRequest, global::System.Collections.Generic.Dictionary? envVars, global::System.Collections.Generic.IList? mcpServers, + global::System.Collections.Generic.IList? customSubagents, global::CursorAgents.AgentMode? mode) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.Model = model; + this.Name = name; + this.AgentId = agentId; this.Env = env; this.Repos = repos; - this.BranchName = branchName; - this.AutoGenerateBranch = autoGenerateBranch; + this.WorkOnCurrentBranch = workOnCurrentBranch; this.AutoCreatePR = autoCreatePR; this.SkipReviewerRequest = skipReviewerRequest; this.EnvVars = envVars; this.McpServers = mcpServers; + this.CustomSubagents = customSubagents; this.Mode = mode; } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestEnvVars.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestEnvVars.g.cs index c548719..59359d7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestEnvVars.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestEnvVars.g.cs @@ -4,7 +4,17 @@ namespace CursorAgents { /// - /// Session-scoped environment variables for the cloud agent. Values are encrypted at rest, injected into the agent's shell, and deleted with the agent. Names must be non-empty, 1024 bytes or less, and cannot start with `CURSOR_`. Values must be non-empty and 4096 bytes or less. + /// Session-scoped environment variables for the cloud agent.
+ /// Values are encrypted at rest, injected into the agent's
+ /// shell, and deleted with the agent. Names must be non-empty,
+ /// 255 bytes or less, and cannot start with `CURSOR_`. Values
+ /// must be non-empty and 4096 bytes or less. Cannot be
+ /// combined with a client-supplied `agentId`.
+ /// Beta: `envVars` is rolling out. If it isn't enabled for
+ /// your account yet, the field is silently ignored on create
+ /// rather than failing the request — verify the values are
+ /// present on a first run before relying on them in
+ /// production. ///
public sealed partial class CreateAgentRequestEnvVars { diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestPrompt.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestPrompt.g.cs index c23c762..7a798f8 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestPrompt.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateAgentRequestPrompt.g.cs @@ -18,7 +18,7 @@ public sealed partial class CreateAgentRequestPrompt public required string Text { get; set; } /// - /// Optional base64-encoded images. Maximum 5 images, 15 MB each. + /// Image inputs. Each entry must provide either `data` (with required `mimeType`) or `url`. Maximum 5 images, 15 MB each. /// [global::System.Text.Json.Serialization.JsonPropertyName("images")] public global::System.Collections.Generic.IList? Images { get; set; } @@ -37,7 +37,7 @@ public sealed partial class CreateAgentRequestPrompt /// Example: Add a README with setup instructions /// /// - /// Optional base64-encoded images. Maximum 5 images, 15 MB each. + /// Image inputs. Each entry must provide either `data` (with required `mimeType`) or `url`. 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.CreateRunRequestPrompt.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.g.cs index 39f658b..eee9253 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CreateRunRequestPrompt.g.cs @@ -18,7 +18,7 @@ public sealed partial class CreateRunRequestPrompt public required string Text { get; set; } /// - /// Optional base64-encoded images. Maximum 5 images, 15 MB each. + /// Image inputs for the follow-up. Each entry must provide either `data` (with required `mimeType`) or `url`. Maximum 5 images, 15 MB each. /// [global::System.Text.Json.Serialization.JsonPropertyName("images")] public global::System.Collections.Generic.IList? Images { get; set; } @@ -37,7 +37,7 @@ public sealed partial class CreateRunRequestPrompt /// Example: Also add troubleshooting steps /// /// - /// Optional base64-encoded images. Maximum 5 images, 15 MB each. + /// Image inputs for the follow-up. Each entry must provide either `data` (with required `mimeType`) or `url`. 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.CustomSubagent.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CustomSubagent.Json.g.cs new file mode 100644 index 0000000..6f76fc6 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CustomSubagent.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class CustomSubagent + { + /// + /// 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.CustomSubagent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.CustomSubagent), + jsonSerializerContext) as global::CursorAgents.CustomSubagent; + } + + /// + /// 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.CustomSubagent? 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.CustomSubagent), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.CustomSubagent; + } + + /// + /// 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.CustomSubagent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CustomSubagent.g.cs new file mode 100644 index 0000000..67f40d4 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CustomSubagent.g.cs @@ -0,0 +1,84 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class CustomSubagent + { + /// + /// Subagent name. Must be unique within `customSubagents` and cannot collide with built-ins (for example, `explore`, `shell`, `debug`, `computerUse`, `cursorGuide`).
+ /// Example: frontend-reviewer + ///
+ /// frontend-reviewer + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Short summary used by the main agent to decide when to delegate. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Description { get; set; } + + /// + /// System prompt the subagent receives when invoked. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.OneOfJsonConverter))] + public global::CursorAgents.OneOf? Model { 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. + /// + /// + /// Subagent name. Must be unique within `customSubagents` and cannot collide with built-ins (for example, `explore`, `shell`, `debug`, `computerUse`, `cursorGuide`).
+ /// Example: frontend-reviewer + /// + /// + /// Short summary used by the main agent to decide when to delegate. + /// + /// + /// System prompt the subagent receives when invoked. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CustomSubagent( + string name, + string description, + string prompt, + global::CursorAgents.OneOf? model) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description ?? throw new global::System.ArgumentNullException(nameof(description)); + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Model = model; + } + + /// + /// Initializes a new instance of the class. + /// + public CustomSubagent() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.CustomSubagentModel.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.CustomSubagentModel.g.cs new file mode 100644 index 0000000..8b98915 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.CustomSubagentModel.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// Use the parent agent's model selection. + /// + public enum CustomSubagentModel + { + /// + /// + /// + Inherit, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class CustomSubagentModelExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this CustomSubagentModel value) + { + return value switch + { + CustomSubagentModel.Inherit => "inherit", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static CustomSubagentModel? ToEnum(string value) + { + return value switch + { + "inherit" => CustomSubagentModel.Inherit, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ErrorError1.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ErrorError1.g.cs index 1a6e8cd..f042ad6 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ErrorError1.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ErrorError1.g.cs @@ -12,11 +12,17 @@ public sealed partial class ErrorError1 /// 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`,
+ /// `integration_not_connected`, `validation_error`,
+ /// `missing_body`, `invalid_model`, `invalid_branch_name`,
+ /// `repository_required`, `repository_access`,
+ /// `pr_resolution_failed`, `artifact_not_found`,
+ /// `service_account_required`, `agent_not_found`,
/// `run_not_found`, `agent_busy`, `agent_archived`,
- /// `run_not_cancellable`, `rate_limit_exceeded`,
+ /// `agent_id_conflict`, `run_not_cancellable`,
+ /// `rate_limit_exceeded`, `usage_limit_exceeded`,
/// `stream_expired`, `stream_unavailable`,
- /// `invalid_last_event_id`, `upstream_error`, and
+ /// `invalid_last_event_id`, `client_cancelled`,
+ /// `not_implemented`, `upstream_error`, and
/// `internal_error`. ///
[global::System.Text.Json.Serialization.JsonPropertyName("code")] @@ -30,6 +36,18 @@ public sealed partial class ErrorError1 [global::System.Text.Json.Serialization.JsonRequired] public required string Message { get; set; } + /// + /// Optional follow-up link. Populated for codes like `integration_not_connected`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("helpUrl")] + public string? HelpUrl { get; set; } + + /// + /// Optional provider identifier. Populated for codes like `integration_not_connected`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + public string? Provider { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -43,25 +61,41 @@ public sealed partial class ErrorError1 /// 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`,
+ /// `integration_not_connected`, `validation_error`,
+ /// `missing_body`, `invalid_model`, `invalid_branch_name`,
+ /// `repository_required`, `repository_access`,
+ /// `pr_resolution_failed`, `artifact_not_found`,
+ /// `service_account_required`, `agent_not_found`,
/// `run_not_found`, `agent_busy`, `agent_archived`,
- /// `run_not_cancellable`, `rate_limit_exceeded`,
+ /// `agent_id_conflict`, `run_not_cancellable`,
+ /// `rate_limit_exceeded`, `usage_limit_exceeded`,
/// `stream_expired`, `stream_unavailable`,
- /// `invalid_last_event_id`, `upstream_error`, and
+ /// `invalid_last_event_id`, `client_cancelled`,
+ /// `not_implemented`, `upstream_error`, and
/// `internal_error`. /// /// /// Human-readable error message. /// + /// + /// Optional follow-up link. Populated for codes like `integration_not_connected`. + /// + /// + /// Optional provider identifier. Populated for codes like `integration_not_connected`. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ErrorError1( string code, - string message) + string message, + string? helpUrl, + string? provider) { this.Code = code ?? throw new global::System.ArgumentNullException(nameof(code)); this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.HelpUrl = helpUrl; + this.Provider = provider; } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Image.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Image.g.cs index 7414db0..53c0459 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.Image.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Image.g.cs @@ -4,18 +4,36 @@ namespace CursorAgents { /// - /// + /// An image input. Provide exactly one of `data` or `url`. When
+ /// `data` is provided, `mimeType` is required. When `url` is
+ /// provided, Cursor fetches the image and `mimeType` must be
+ /// omitted. ///
public sealed partial class Image { /// - /// Base64 encoded image data (max 15 MB)
+ /// Base64 encoded image bytes (max 15 MB). Mutually exclusive with `url`.
/// Example: iVBORw0KGgoAAAANSUhEUgAA... ///
/// iVBORw0KGgoAAAANSUhEUgAA... [global::System.Text.Json.Serialization.JsonPropertyName("data")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Data { get; set; } + public string? Data { get; set; } + + /// + /// HTTP or HTTPS URL Cursor fetches. Mutually exclusive with `data`.
+ /// Example: https://example.com/screenshot.png + ///
+ /// https://example.com/screenshot.png + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// MIME type of the image bytes. Required when `data` is provided; must be omitted when `url` is provided. Supported types are `image/png`, `image/jpeg`, `image/gif`, and `image/webp`.
+ /// Example: image/png + ///
+ /// image/png + [global::System.Text.Json.Serialization.JsonPropertyName("mimeType")] + public string? MimeType { get; set; } /// /// @@ -33,18 +51,30 @@ public sealed partial class Image /// Initializes a new instance of the class. /// /// - /// Base64 encoded image data (max 15 MB)
+ /// Base64 encoded image bytes (max 15 MB). Mutually exclusive with `url`.
/// Example: iVBORw0KGgoAAAANSUhEUgAA... /// + /// + /// HTTP or HTTPS URL Cursor fetches. Mutually exclusive with `data`.
+ /// Example: https://example.com/screenshot.png + /// + /// + /// MIME type of the image bytes. Required when `data` is provided; must be omitted when `url` is provided. Supported types are `image/png`, `image/jpeg`, `image/gif`, and `image/webp`.
+ /// Example: image/png + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public Image( - string data, + string? data, + string? url, + string? mimeType, global::CursorAgents.ImageDimension? dimension) { - this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Data = data; + this.Url = url; + this.MimeType = mimeType; this.Dimension = dimension; } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant1.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant1.Json.g.cs new file mode 100644 index 0000000..deee100 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant1.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class ImageVariant1 + { + /// + /// 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.ImageVariant1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.ImageVariant1), + jsonSerializerContext) as global::CursorAgents.ImageVariant1; + } + + /// + /// 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.ImageVariant1? 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.ImageVariant1), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ImageVariant1; + } + + /// + /// 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.ImageVariant1.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant1.g.cs new file mode 100644 index 0000000..e30764d --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant1.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class ImageVariant1 + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant2.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant2.Json.g.cs new file mode 100644 index 0000000..3c5b1ab --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class ImageVariant2 + { + /// + /// 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.ImageVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.ImageVariant2), + jsonSerializerContext) as global::CursorAgents.ImageVariant2; + } + + /// + /// 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.ImageVariant2? 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.ImageVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ImageVariant2; + } + + /// + /// 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.ImageVariant2.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant2.g.cs new file mode 100644 index 0000000..a3d8f9d --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ImageVariant2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class ImageVariant2 + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponse.g.cs index 8fee405..0765c7e 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListAgentsResponse.g.cs @@ -16,7 +16,7 @@ public sealed partial class ListAgentsResponse 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.
+ /// Cursor for fetching the next page of results. Omitted (not `null`) when there are no more pages.
/// Example: bc-00000000-0000-0000-0000-000000000002 ///
/// bc-00000000-0000-0000-0000-000000000002 @@ -36,7 +36,7 @@ public sealed partial class ListAgentsResponse /// Agents, newest first. /// /// - /// Cursor for fetching the next page of results, or null when there are no more.
+ /// Cursor for fetching the next page of results. Omitted (not `null`) when there are no more pages.
/// Example: bc-00000000-0000-0000-0000-000000000002 /// #if NET7_0_OR_GREATER diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListModelsResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListModelsResponse.g.cs index e0a804e..0e9114b 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListModelsResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListModelsResponse.g.cs @@ -9,13 +9,11 @@ namespace CursorAgents public sealed partial class ListModelsResponse { /// - /// 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] + /// Recommended models. Use `id` (and optionally `params`) when creating an agent. ///
- /// [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 Items { get; set; } + public required global::System.Collections.Generic.IList Items { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -27,14 +25,13 @@ public sealed partial class ListModelsResponse /// Initializes a new instance of the class. /// /// - /// 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] + /// Recommended models. Use `id` (and optionally `params`) when creating an agent. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ListModelsResponse( - global::System.Collections.Generic.IList items) + global::System.Collections.Generic.IList items) { this.Items = items ?? throw new global::System.ArgumentNullException(nameof(items)); } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.g.cs index 06f07b9..e5ab88b 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ListRunsResponse.g.cs @@ -16,7 +16,7 @@ public sealed partial class ListRunsResponse 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. + /// Cursor for fetching the next page of results. Omitted (not `null`) when there are no more pages. /// [global::System.Text.Json.Serialization.JsonPropertyName("nextCursor")] public string? NextCursor { get; set; } @@ -34,7 +34,7 @@ public sealed partial class ListRunsResponse /// Runs for this agent, newest first. /// /// - /// Cursor for fetching the next page of results, or null when there are no more. + /// Cursor for fetching the next page of results. Omitted (not `null`) when there are no more pages. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelListItem.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelListItem.Json.g.cs new file mode 100644 index 0000000..68b6e2f --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelListItem.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class ModelListItem + { + /// + /// 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.ModelListItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.ModelListItem), + jsonSerializerContext) as global::CursorAgents.ModelListItem; + } + + /// + /// 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.ModelListItem? 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.ModelListItem), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ModelListItem; + } + + /// + /// 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.ModelListItem.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelListItem.g.cs new file mode 100644 index 0000000..a8678d6 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelListItem.g.cs @@ -0,0 +1,110 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class ModelListItem + { + /// + /// Pass this value as `model.id` when creating an agent.
+ /// Example: composer-2 + ///
+ /// composer-2 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Human-readable model name.
+ /// Example: Composer 2 + ///
+ /// Composer 2 + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DisplayName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Alternate IDs that resolve to the same model.
+ /// Example: [composer-latest, composer] + ///
+ /// [composer-latest, composer] + [global::System.Text.Json.Serialization.JsonPropertyName("aliases")] + public global::System.Collections.Generic.IList? Aliases { get; set; } + + /// + /// Per-model parameter definitions, when the model accepts parameters. Use these to populate `model.params`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("parameters")] + public global::System.Collections.Generic.IList? Parameters { get; set; } + + /// + /// Concrete `id`+`params` combinations the model accepts. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("variants")] + public global::System.Collections.Generic.IList? Variants { 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. + /// + /// + /// Pass this value as `model.id` when creating an agent.
+ /// Example: composer-2 + /// + /// + /// Human-readable model name.
+ /// Example: Composer 2 + /// + /// + /// + /// Alternate IDs that resolve to the same model.
+ /// Example: [composer-latest, composer] + /// + /// + /// Per-model parameter definitions, when the model accepts parameters. Use these to populate `model.params`. + /// + /// + /// Concrete `id`+`params` combinations the model accepts. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelListItem( + string id, + string displayName, + string? description, + global::System.Collections.Generic.IList? aliases, + global::System.Collections.Generic.IList? parameters, + global::System.Collections.Generic.IList? variants) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.DisplayName = displayName ?? throw new global::System.ArgumentNullException(nameof(displayName)); + this.Description = description; + this.Aliases = aliases; + this.Parameters = parameters; + this.Variants = variants; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelListItem() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterDefinition.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterDefinition.Json.g.cs new file mode 100644 index 0000000..3ab8eb0 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterDefinition.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class ModelParameterDefinition + { + /// + /// 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.ModelParameterDefinition? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.ModelParameterDefinition), + jsonSerializerContext) as global::CursorAgents.ModelParameterDefinition; + } + + /// + /// 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.ModelParameterDefinition? 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.ModelParameterDefinition), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ModelParameterDefinition; + } + + /// + /// 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.ModelParameterDefinition.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterDefinition.g.cs new file mode 100644 index 0000000..d474816 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterDefinition.g.cs @@ -0,0 +1,76 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class ModelParameterDefinition + { + /// + /// Parameter identifier. Pass as `model.params[].id`.
+ /// Example: fast + ///
+ /// fast + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Human-readable label for the parameter.
+ /// Example: Fast + ///
+ /// Fast + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// + /// Permitted values for this parameter. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("values")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Values { 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. + /// + /// + /// Parameter identifier. Pass as `model.params[].id`.
+ /// Example: fast + /// + /// + /// Permitted values for this parameter. + /// + /// + /// Human-readable label for the parameter.
+ /// Example: Fast + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelParameterDefinition( + string id, + global::System.Collections.Generic.IList values, + string? displayName) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.DisplayName = displayName; + this.Values = values ?? throw new global::System.ArgumentNullException(nameof(values)); + } + + /// + /// Initializes a new instance of the class. + /// + public ModelParameterDefinition() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterValueDefinition.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterValueDefinition.Json.g.cs new file mode 100644 index 0000000..a8d63a7 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterValueDefinition.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class ModelParameterValueDefinition + { + /// + /// 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.ModelParameterValueDefinition? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.ModelParameterValueDefinition), + jsonSerializerContext) as global::CursorAgents.ModelParameterValueDefinition; + } + + /// + /// 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.ModelParameterValueDefinition? 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.ModelParameterValueDefinition), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ModelParameterValueDefinition; + } + + /// + /// 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.ModelParameterValueDefinition.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterValueDefinition.g.cs new file mode 100644 index 0000000..86e1e88 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelParameterValueDefinition.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class ModelParameterValueDefinition + { + /// + /// Permitted value for the parameter.
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Value { get; set; } + + /// + /// Human-readable label for the value.
+ /// Example: Fast + ///
+ /// Fast + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + public string? DisplayName { 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. + /// + /// + /// Permitted value for the parameter.
+ /// Example: true + /// + /// + /// Human-readable label for the value.
+ /// Example: Fast + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelParameterValueDefinition( + string value, + string? displayName) + { + this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); + this.DisplayName = displayName; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelParameterValueDefinition() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariant.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariant.Json.g.cs new file mode 100644 index 0000000..c51090c --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariant.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class ModelVariant + { + /// + /// 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.ModelVariant? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.ModelVariant), + jsonSerializerContext) as global::CursorAgents.ModelVariant; + } + + /// + /// 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.ModelVariant? 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.ModelVariant), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ModelVariant; + } + + /// + /// 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.ModelVariant.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariant.g.cs new file mode 100644 index 0000000..a2f77b9 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariant.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class ModelVariant + { + /// + /// Concrete parameter values that, combined with the parent model `id`, form a valid model selection. May be empty. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("params")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Params { get; set; } + + /// + /// Human-readable label for this variant. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("displayName")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DisplayName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// True for the variant Cursor selects when the user picks this model without explicit `params`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("isDefault")] + public bool? IsDefault { 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. + /// + /// + /// Concrete parameter values that, combined with the parent model `id`, form a valid model selection. May be empty. + /// + /// + /// Human-readable label for this variant. + /// + /// + /// + /// True for the variant Cursor selects when the user picks this model without explicit `params`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelVariant( + global::System.Collections.Generic.IList @params, + string displayName, + string? description, + bool? isDefault) + { + this.Params = @params ?? throw new global::System.ArgumentNullException(nameof(@params)); + this.DisplayName = displayName ?? throw new global::System.ArgumentNullException(nameof(displayName)); + this.Description = description; + this.IsDefault = isDefault; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelVariant() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariantParam.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariantParam.Json.g.cs new file mode 100644 index 0000000..818faa5 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariantParam.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class ModelVariantParam + { + /// + /// 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.ModelVariantParam? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.ModelVariantParam), + jsonSerializerContext) as global::CursorAgents.ModelVariantParam; + } + + /// + /// 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.ModelVariantParam? 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.ModelVariantParam), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.ModelVariantParam; + } + + /// + /// 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.ModelVariantParam.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariantParam.g.cs new file mode 100644 index 0000000..2a564ca --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.ModelVariantParam.g.cs @@ -0,0 +1,55 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class ModelVariantParam + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Value { 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 ModelVariantParam( + string id, + string value) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); + } + + /// + /// Initializes a new instance of the class. + /// + public ModelVariantParam() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.g.cs index 0033e87..6a545fa 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RepoConfig.g.cs @@ -9,15 +9,16 @@ namespace CursorAgents public sealed partial class RepoConfig { /// - /// GitHub repository URL. Required unless `prUrl` is provided.
+ /// GitHub repository URL. Required on every repo entry, including when `prUrl` is provided.
/// Example: https://github.com/your-org/your-repo ///
/// https://github.com/your-org/your-repo [global::System.Text.Json.Serialization.JsonPropertyName("url")] - public string? Url { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } /// - /// Branch, tag, or commit hash to use as the starting point.
+ /// Branch, tag, or commit hash to use as the starting point. Ignored when `prUrl` is provided.
/// Example: main ///
/// main @@ -25,7 +26,7 @@ public sealed partial class RepoConfig public string? StartingRef { get; set; } /// - /// GitHub pull request URL. When provided, the agent works on this PR's repository and branches; `url` and `startingRef` are ignored.
+ /// GitHub pull request URL. When provided, the agent works on this PR's repository and branches; `startingRef` is ignored. `url` must still be set on the same entry.
/// Example: https://github.com/your-org/your-repo/pull/123 ///
/// https://github.com/your-org/your-repo/pull/123 @@ -42,26 +43,26 @@ public sealed partial class RepoConfig /// Initializes a new instance of the class. ///
/// - /// GitHub repository URL. Required unless `prUrl` is provided.
+ /// GitHub repository URL. Required on every repo entry, including when `prUrl` is provided.
/// Example: https://github.com/your-org/your-repo /// /// - /// Branch, tag, or commit hash to use as the starting point.
+ /// Branch, tag, or commit hash to use as the starting point. Ignored when `prUrl` is provided.
/// Example: main /// /// - /// GitHub pull request URL. When provided, the agent works on this PR's repository and branches; `url` and `startingRef` are ignored.
+ /// GitHub pull request URL. When provided, the agent works on this PR's repository and branches; `startingRef` is ignored. `url` must still be set on the same entry.
/// Example: https://github.com/your-org/your-repo/pull/123 /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public RepoConfig( - string? url, + string url, string? startingRef, string? prUrl) { - this.Url = url; + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); this.StartingRef = startingRef; this.PrUrl = prUrl; } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.g.cs index 96537dc..b1aabca 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.Run.g.cs @@ -48,6 +48,28 @@ public sealed partial class Run [global::System.Text.Json.Serialization.JsonRequired] public required global::System.DateTime UpdatedAt { get; set; } + /// + /// Wall-clock duration of the run in milliseconds. Populated once the run reaches a terminal status (`FINISHED`, `ERROR`, `CANCELLED`, `EXPIRED`).
+ /// Example: 12357 + ///
+ /// 12357 + [global::System.Text.Json.Serialization.JsonPropertyName("durationMs")] + public int? DurationMs { get; set; } + + /// + /// Final assistant reply text. Populated once the run terminates.
+ /// Example: Added README.md with installation instructions. + ///
+ /// Added README.md with installation instructions. + [global::System.Text.Json.Serialization.JsonPropertyName("result")] + public string? Result { get; set; } + + /// + /// The agent's pushed branches and PRs. Populated once the agent has pushed at least one branch. Per-agent state, not per-run. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("git")] + public global::CursorAgents.RunGit? Git { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -70,6 +92,17 @@ public sealed partial class Run /// /// /// + /// + /// Wall-clock duration of the run in milliseconds. Populated once the run reaches a terminal status (`FINISHED`, `ERROR`, `CANCELLED`, `EXPIRED`).
+ /// Example: 12357 + /// + /// + /// Final assistant reply text. Populated once the run terminates.
+ /// Example: Added README.md with installation instructions. + /// + /// + /// The agent's pushed branches and PRs. Populated once the agent has pushed at least one branch. Per-agent state, not per-run. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -78,13 +111,19 @@ public Run( string agentId, global::CursorAgents.RunStatus status, global::System.DateTime createdAt, - global::System.DateTime updatedAt) + global::System.DateTime updatedAt, + int? durationMs, + string? result, + global::CursorAgents.RunGit? git) { 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; + this.DurationMs = durationMs; + this.Result = result; + this.Git = git; } /// diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGit.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGit.Json.g.cs new file mode 100644 index 0000000..3412545 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGit.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class RunGit + { + /// + /// 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.RunGit? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.RunGit), + jsonSerializerContext) as global::CursorAgents.RunGit; + } + + /// + /// 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.RunGit? 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.RunGit), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.RunGit; + } + + /// + /// 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.RunGit.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGit.g.cs new file mode 100644 index 0000000..9d583e2 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGit.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// The agent's current pushed branches and pull requests. This is
+ /// per-agent state — every run on the same agent returns the same
+ /// `git` snapshot rather than only that run's contributions. Use
+ /// the agent's `latestRunId` or the SSE stream to attribute work
+ /// to a specific run. + ///
+ public sealed partial class RunGit + { + /// + /// Branches the agent has pushed. Stacked agents return one entry per branch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("branches")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Branches { 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. + /// + /// + /// Branches the agent has pushed. Stacked agents return one entry per branch. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RunGit( + global::System.Collections.Generic.IList branches) + { + this.Branches = branches ?? throw new global::System.ArgumentNullException(nameof(branches)); + } + + /// + /// Initializes a new instance of the class. + /// + public RunGit() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGitBranch.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGitBranch.Json.g.cs new file mode 100644 index 0000000..807e4d2 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGitBranch.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class RunGitBranch + { + /// + /// 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.RunGitBranch? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.RunGitBranch), + jsonSerializerContext) as global::CursorAgents.RunGitBranch; + } + + /// + /// 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.RunGitBranch? 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.RunGitBranch), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.RunGitBranch; + } + + /// + /// 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.RunGitBranch.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGitBranch.g.cs new file mode 100644 index 0000000..d6f4641 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunGitBranch.g.cs @@ -0,0 +1,78 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class RunGitBranch + { + /// + /// Repository URL the agent pushed to. Returned without the scheme (for example, `github.com/your-org/your-repo`).
+ /// Example: github.com/your-org/your-repo + ///
+ /// github.com/your-org/your-repo + [global::System.Text.Json.Serialization.JsonPropertyName("repoUrl")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string RepoUrl { get; set; } + + /// + /// Branch name the agent pushed.
+ /// Example: cursor/add-readme-a1b2 + ///
+ /// cursor/add-readme-a1b2 + [global::System.Text.Json.Serialization.JsonPropertyName("branch")] + public string? Branch { get; set; } + + /// + /// Pull request URL, when Cursor opened 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; } + + /// + /// 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 URL the agent pushed to. Returned without the scheme (for example, `github.com/your-org/your-repo`).
+ /// Example: github.com/your-org/your-repo + /// + /// + /// Branch name the agent pushed.
+ /// Example: cursor/add-readme-a1b2 + /// + /// + /// Pull request URL, when Cursor opened a PR.
+ /// Example: https://github.com/your-org/your-repo/pull/123 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RunGitBranch( + string repoUrl, + string? branch, + string? prUrl) + { + this.RepoUrl = repoUrl ?? throw new global::System.ArgumentNullException(nameof(repoUrl)); + this.Branch = branch; + this.PrUrl = prUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public RunGitBranch() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.g.cs index 2b1498c..d2bbd3a 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.g.cs @@ -16,7 +16,7 @@ public sealed partial class RunStreamToolCallEvent public global::CursorAgents.RunStreamToolCallEventEvent Event { get; set; } /// - /// SSE event id used with the `Last-Event-ID` resume header.
+ /// Opaque SSE event id passed back via `Last-Event-ID` to resume the stream. Do not parse — the format is implementation-defined.
/// Example: 1713033006000-0 ///
/// 1713033006000-0 @@ -42,7 +42,7 @@ public sealed partial class RunStreamToolCallEvent /// /// /// - /// SSE event id used with the `Last-Event-ID` resume header.
+ /// Opaque SSE event id passed back via `Last-Event-ID` to resume the stream. Do not parse — the format is implementation-defined.
/// Example: 1713033006000-0 /// #if NET7_0_OR_GREATER diff --git a/src/libs/CursorAgents/Generated/CursorAgents.OneOf.3.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.OneOf.3.Json.g.cs new file mode 100644 index 0000000..df10056 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.OneOf.3.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public readonly partial struct OneOf + { + /// + /// 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.OneOf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.OneOf), + jsonSerializerContext) as global::CursorAgents.OneOf?; + } + + /// + /// 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.OneOf? 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.OneOf), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.OneOf?; + } + + /// + /// 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.OneOf.3.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.OneOf.3.g.cs new file mode 100644 index 0000000..cb0e7be --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.OneOf.3.g.cs @@ -0,0 +1,377 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public readonly partial struct OneOf : global::System.IEquatable> + { + /// + /// + /// +#if NET6_0_OR_GREATER + public T1? Value1 { get; init; } +#else + public T1? Value1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] +#endif + public bool IsValue1 => Value1 != null; + + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T2? Value2 { get; init; } +#else + public T2? Value2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] +#endif + public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T3? Value3 { get; init; } +#else + public T3? Value3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] +#endif + public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(OneOf @this) => @this.Value1; + + /// + /// + /// + public OneOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T2 value) => new OneOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(OneOf @this) => @this.Value2; + + /// + /// + /// + public OneOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T3 value) => new OneOf((T3?)value); + + /// + /// + /// + public static implicit operator T3?(OneOf @this) => @this.Value3; + + /// + /// + /// + public OneOf(T3? value) + { + Value3 = value; + } + + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + + /// + /// + /// + public OneOf( + T1? value1, + T2? value2, + T3? value3 + ) + { + Value1 = value1; + Value2 = value2; + Value3 = value3; + } + + /// + /// + /// + public object? Object => + Value3 as object ?? + Value2 as object ?? + Value1 as object + ; + + /// + /// + /// + public override string? ToString() => + Value1?.ToString() ?? + Value2?.ToString() ?? + Value3?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 && !IsValue2 && !IsValue3 || !IsValue1 && IsValue2 && !IsValue3 || !IsValue1 && !IsValue2 && IsValue3; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + global::System.Func? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + else if (IsValue3 && value3 != null) + { + return value3(Value3!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + Value3, + typeof(T3), + }; + 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(OneOf other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) + ; + } + + /// + /// + /// + public static bool operator ==(OneOf obj1, OneOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(OneOf obj1, OneOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is OneOf o && Equals(o); + } + } +} diff --git a/src/libs/CursorAgents/Generated/autosdk.generated-examples.json b/src/libs/CursorAgents/Generated/autosdk.generated-examples.json index 42c9d7c..e888814 100644 --- a/src/libs/CursorAgents/Generated/autosdk.generated-examples.json +++ b/src/libs/CursorAgents/Generated/autosdk.generated-examples.json @@ -15,7 +15,7 @@ "Order": 2, "Title": "Stream a run", "Slug": "streamrun", - "Description": "Stream Server-Sent Events for one run. Event types include\n\u0060status\u0060, \u0060assistant\u0060, \u0060thinking\u0060, \u0060tool_call\u0060, \u0060heartbeat\u0060,\n\u0060result\u0060, \u0060error\u0060, and \u0060done\u0060. Reconnect with the\n\u0060Last-Event-ID\u0060 header to resume after a disconnect; the event\nID must belong to the requested run. Responses include the\n\u0060X-Cursor-Stream-Retention-Seconds\u0060 header. After the\nretention window the endpoint may return \u0060410 stream_expired\u0060.\n\u0060tool_call\u0060 event data uses the \u0060RunStreamToolCallData\u0060 schema.", + "Description": "Stream Server-Sent Events for one run. Event types are\n\u0060status\u0060, \u0060assistant\u0060, \u0060thinking\u0060, \u0060tool_call\u0060,\n\u0060interaction_update\u0060, \u0060heartbeat\u0060, \u0060result\u0060, \u0060error\u0060, and\n\u0060done\u0060.\n\n- \u0060status\u0060 carries \u0060{ runId, status }\u0060. It has no \u0060id\u0060 line\n and is replayed at the top of every reconnect.\n- \u0060result\u0060 carries \u0060{ runId, status, text?, durationMs?,\n git? }\u0060; \u0060text\u0060 is the final assistant reply, \u0060durationMs\u0060\n the wall-clock duration, and \u0060git\u0060 mirrors \u0060Run.git\u0060.\n- \u0060interaction_update\u0060 carries the richer SDK-shape update\n used by the TypeScript SDK and is emitted alongside the\n simplified events that share the same event id. Use this if\n you want the full SDK stream; otherwise handle the simplified\n events and ignore it.\n\nReconnect with the \u0060Last-Event-ID\u0060 header to resume after a\ndisconnect; the event ID must belong to the requested run\notherwise the endpoint returns \u0060400 invalid_last_event_id\u0060.\nResponses include the \u0060X-Cursor-Stream-Retention-Seconds\u0060\nheader; after the retention window the endpoint may return\n\u0060410 stream_expired\u0060. \u0060tool_call\u0060 event data uses the\n\u0060RunStreamToolCallData\u0060 schema.", "Language": "http", "Code": "### Stream a run\n# @name streamRun\nGET {{host}}/v1/agents/{{id}}/runs/{{runId}}/stream\nAuthorization: Bearer {{token}}\nLast-Event-ID: {{Last-Event-ID}}\nAccept: application/json, text/event-stream\n\n## Responses\n# 200\n# Description: SSE stream of run events.\n# Content-Type: text/event-stream\n# 400\n# Description: Validation error or malformed request body.\n# Content-Type: application/json\n# 401\n# Description: Invalid or missing API key.\n# Content-Type: application/json\n# 403\n# Description: Authenticated but insufficient permissions, plan required, or feature unavailable.\n# Content-Type: application/json\n# 404\n# Description: Agent or run not found.\n# Content-Type: application/json\n# 410\n# Description: Stream retention window has elapsed (\u0060stream_expired\u0060).\n# Content-Type: application/json\n# 429\n# Description: Rate limit exceeded. Response includes \u0060Retry-After\u0060, \u0060X-RateLimit-Limit\u0060, \u0060X-RateLimit-Remaining\u0060, and \u0060X-RateLimit-Reset\u0060 headers.\n# Content-Type: application/json\n# 500\n# Description: Internal server error.\n# Content-Type: application/json", "Format": "http", diff --git a/src/libs/CursorAgents/openapi.yaml b/src/libs/CursorAgents/openapi.yaml index 7ffccd4..2ea184f 100644 --- a/src/libs/CursorAgents/openapi.yaml +++ b/src/libs/CursorAgents/openapi.yaml @@ -16,6 +16,7 @@ servers: security: - basicAuth: [] + - bearerAuth: [] components: securitySchemes: @@ -25,6 +26,12 @@ components: description: | API key from Cursor Dashboard, supplied as the Basic Authentication username with an empty password. + bearerAuth: + type: http + scheme: bearer + description: | + API key from Cursor Dashboard, supplied via + `Authorization: Bearer `. Equivalent to Basic Auth. schemas: ImageDimension: @@ -44,16 +51,38 @@ components: Image: type: object - required: - - data + description: | + An image input. Provide exactly one of `data` or `url`. When + `data` is provided, `mimeType` is required. When `url` is + provided, Cursor fetches the image and `mimeType` must be + omitted. properties: data: type: string minLength: 1 - description: Base64 encoded image data (max 15 MB) + description: Base64 encoded image bytes (max 15 MB). Mutually exclusive with `url`. example: 'iVBORw0KGgoAAAANSUhEUgAA...' + url: + type: string + format: uri + description: HTTP or HTTPS URL Cursor fetches. Mutually exclusive with `data`. + example: 'https://example.com/screenshot.png' + mimeType: + type: string + minLength: 1 + description: MIME type of the image bytes. Required when `data` is provided; must be omitted when `url` is provided. Supported types are `image/png`, `image/jpeg`, `image/gif`, and `image/webp`. + example: 'image/png' dimension: $ref: '#/components/schemas/ImageDimension' + oneOf: + - required: [data, mimeType] + not: + required: [url] + - required: [url] + not: + anyOf: + - required: [data] + - required: [mimeType] ModelRef: type: object @@ -85,21 +114,23 @@ components: RepoConfig: type: object + required: + - url properties: url: type: string minLength: 1 - description: GitHub repository URL. Required unless `prUrl` is provided. + description: GitHub repository URL. Required on every repo entry, including when `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. + description: Branch, tag, or commit hash to use as the starting point. Ignored when `prUrl` is provided. 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. + description: GitHub pull request URL. When provided, the agent works on this PR's repository and branches; `startingRef` is ignored. `url` must still be set on the same entry. example: 'https://github.com/your-org/your-repo/pull/123' AgentEnv: @@ -218,7 +249,6 @@ components: type: object required: - id - - name - status - env - url @@ -231,7 +261,7 @@ components: example: 'bc-00000000-0000-0000-0000-000000000001' name: type: string - description: Auto-derived agent name. + description: Display name. Auto-derived from the prompt when not supplied at create time. Omitted when no name has been set. example: 'Add README with setup instructions' status: type: string @@ -243,7 +273,7 @@ components: 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' + example: 'https://cursor.com/agents/bc-00000000-0000-0000-0000-000000000001' createdAt: type: string format: date-time @@ -267,14 +297,10 @@ components: description: Repository configuration. Empty for no-repo agents. items: $ref: '#/components/schemas/RepoConfig' - branchName: - type: string - description: Branch the agent works on. - example: 'cursor/add-readme' - autoGenerateBranch: + workOnCurrentBranch: type: boolean - description: Whether the branch was auto-generated. - example: true + description: When `false` (the default), Cursor pushes commits to a new auto-generated branch. When `true`, commits land on the existing head branch. + example: false autoCreatePR: type: boolean description: Whether Cursor opens a pull request when the run completes. @@ -282,6 +308,49 @@ components: skipReviewerRequest: type: boolean description: Whether to skip requesting the user as a reviewer when Cursor opens a PR. + customSubagents: + type: array + description: Custom subagents defined at create time. Omitted when none were provided. + items: + $ref: '#/components/schemas/CustomSubagent' + + RunGitBranch: + type: object + required: + - repoUrl + properties: + repoUrl: + type: string + minLength: 1 + description: Repository URL the agent pushed to. Returned without the scheme (for example, `github.com/your-org/your-repo`). + example: 'github.com/your-org/your-repo' + branch: + type: string + minLength: 1 + description: Branch name the agent pushed. + example: 'cursor/add-readme-a1b2' + prUrl: + type: string + format: uri + description: Pull request URL, when Cursor opened a PR. + example: 'https://github.com/your-org/your-repo/pull/123' + + RunGit: + type: object + description: | + The agent's current pushed branches and pull requests. This is + per-agent state — every run on the same agent returns the same + `git` snapshot rather than only that run's contributions. Use + the agent's `latestRunId` or the SSE stream to attribute work + to a specific run. + required: + - branches + properties: + branches: + type: array + description: Branches the agent has pushed. Stacked agents return one entry per branch. + items: + $ref: '#/components/schemas/RunGitBranch' Run: type: object @@ -311,6 +380,20 @@ components: updatedAt: type: string format: date-time + durationMs: + type: integer + minimum: 0 + description: Wall-clock duration of the run in milliseconds. Populated once the run reaches a terminal status (`FINISHED`, `ERROR`, `CANCELLED`, `EXPIRED`). + example: 12357 + result: + type: string + minLength: 1 + description: Final assistant reply text. Populated once the run terminates. + example: 'Added README.md with installation instructions.' + git: + allOf: + - $ref: '#/components/schemas/RunGit' + description: The agent's pushed branches and PRs. Populated once the agent has pushed at least one branch. Per-agent state, not per-run. RunStreamToolCallTruncation: type: object @@ -391,11 +474,46 @@ components: enum: ['tool_call'] id: type: string - description: SSE event id used with the `Last-Event-ID` resume header. + description: Opaque SSE event id passed back via `Last-Event-ID` to resume the stream. Do not parse — the format is implementation-defined. example: '1713033006000-0' data: $ref: '#/components/schemas/RunStreamToolCallData' + CustomSubagent: + type: object + additionalProperties: false + required: + - name + - description + - prompt + properties: + name: + type: string + minLength: 1 + maxLength: 100 + description: Subagent name. Must be unique within `customSubagents` and cannot collide with built-ins (for example, `explore`, `shell`, `debug`, `computerUse`, `cursorGuide`). + example: 'frontend-reviewer' + description: + type: string + minLength: 1 + maxLength: 1000 + description: Short summary used by the main agent to decide when to delegate. + prompt: + type: string + minLength: 1 + maxLength: 8192 + description: System prompt the subagent receives when invoked. + model: + oneOf: + - type: string + enum: ['inherit'] + description: Use the parent agent's model selection. + - type: string + minLength: 1 + description: An explicit model ID. + example: 'claude-4.6-sonnet-thinking' + - $ref: '#/components/schemas/ModelRef' + CreateAgentRequest: type: object required: @@ -416,26 +534,40 @@ components: maxItems: 5 items: $ref: '#/components/schemas/Image' - description: Optional base64-encoded images. Maximum 5 images, 15 MB each. + description: Image inputs. Each entry must provide either `data` (with required `mimeType`) or `url`. Maximum 5 images, 15 MB each. model: $ref: '#/components/schemas/ModelRef' + name: + type: string + minLength: 1 + maxLength: 100 + description: Display name for the agent. Auto-derived from the prompt when omitted. + example: 'Add README with setup instructions' + agentId: + type: string + minLength: 1 + pattern: '^bc-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$' + description: Optional client-supplied agent identifier in `bc-` form. Re-POSTing the same `agentId` returns `409 agent_id_conflict` instead of creating a duplicate. Cannot be combined with `envVars`; omit `agentId` so the server mints one when you need session secrets. + example: 'bc-00000000-0000-0000-0000-000000000001' env: $ref: '#/components/schemas/AgentEnv' repos: type: array maxItems: 20 - description: Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` to start a no-repo agent. + description: 'Repository configuration. Mutually exclusive with a named cloud environment. Omit both `repos` and `env` (or pass `repos: []`) to start a no-repo agent.' items: $ref: '#/components/schemas/RepoConfig' - branchName: - type: string - minLength: 1 - description: Custom branch name for the agent to create. - example: 'feature/add-readme' - autoGenerateBranch: + workOnCurrentBranch: 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 + description: | + When `false` (the default), Cursor pushes commits to a new + auto-generated branch (`cursor/...`) based on + `repos[0].startingRef` (or the PR base ref when `prUrl` + is set). When `true`, Cursor pushes directly to that + starting ref — for a non-PR create, that's the branch you + passed in `startingRef`; for a `prUrl` create, that's the + PR's head branch. + default: false autoCreatePR: type: boolean description: Whether Cursor should open a pull request when the run completes. @@ -447,7 +579,19 @@ components: envVars: type: object maxProperties: 50 - description: Session-scoped environment variables for the cloud agent. Values are encrypted at rest, injected into the agent's shell, and deleted with the agent. Names must be non-empty, 1024 bytes or less, and cannot start with `CURSOR_`. Values must be non-empty and 4096 bytes or less. + description: | + Session-scoped environment variables for the cloud agent. + Values are encrypted at rest, injected into the agent's + shell, and deleted with the agent. Names must be non-empty, + 255 bytes or less, and cannot start with `CURSOR_`. Values + must be non-empty and 4096 bytes or less. Cannot be + combined with a client-supplied `agentId`. + + Beta: `envVars` is rolling out. If it isn't enabled for + your account yet, the field is silently ignored on create + rather than failing the request — verify the values are + present on a first run before relying on them in + production. additionalProperties: type: string minLength: 1 @@ -458,6 +602,12 @@ components: description: Inline MCP server definitions available to the initial run. Remote servers support `headers` or OAuth `auth`; stdio servers run inside the cloud agent VM and can receive `env`. Server names must be unique. items: $ref: '#/components/schemas/McpServer' + customSubagents: + type: array + maxItems: 20 + description: Custom subagents the main agent can delegate to. Names must be unique and not collide with built-ins. + items: + $ref: '#/components/schemas/CustomSubagent' mode: allOf: - $ref: '#/components/schemas/AgentMode' @@ -484,7 +634,7 @@ components: maxItems: 5 items: $ref: '#/components/schemas/Image' - description: Optional base64-encoded images. Maximum 5 images, 15 MB each. + description: Image inputs for the follow-up. Each entry must provide either `data` (with required `mimeType`) or `url`. Maximum 5 images, 15 MB each. mcpServers: type: array maxItems: 50 @@ -536,8 +686,8 @@ components: $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. + minLength: 1 + description: Cursor for fetching the next page of results. Omitted (not `null`) when there are no more pages. example: 'bc-00000000-0000-0000-0000-000000000002' ListRunsResponse: @@ -552,8 +702,8 @@ components: $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. + minLength: 1 + description: Cursor for fetching the next page of results. Omitted (not `null`) when there are no more pages. IdResponse: type: object @@ -618,18 +768,143 @@ components: required: - apiKeyName - createdAt - - userEmail properties: apiKeyName: type: string + description: Display name of the API key. example: 'Production API Key' createdAt: type: string format: date-time + description: When the API key was created. + userId: + type: integer + minimum: 0 + description: Numeric Cursor user ID of the API key's owner. Omitted for service-account / team API keys, which aren't tied to a specific user. + example: 42 userEmail: type: string format: email + description: Email of the API key's owner. Omitted for service-account / team API keys. example: 'developer@example.com' + userFirstName: + type: string + minLength: 1 + description: First name of the API key's owner, when populated. + example: 'Alex' + userLastName: + type: string + minLength: 1 + description: Last name of the API key's owner, when populated. + example: 'Rivera' + + ModelParameterValueDefinition: + type: object + required: + - value + properties: + value: + type: string + minLength: 1 + description: Permitted value for the parameter. + example: 'true' + displayName: + type: string + minLength: 1 + description: Human-readable label for the value. + example: 'Fast' + + ModelParameterDefinition: + type: object + required: + - id + - values + properties: + id: + type: string + minLength: 1 + description: Parameter identifier. Pass as `model.params[].id`. + example: 'fast' + displayName: + type: string + minLength: 1 + description: Human-readable label for the parameter. + example: 'Fast' + values: + type: array + minItems: 1 + description: Permitted values for this parameter. + items: + $ref: '#/components/schemas/ModelParameterValueDefinition' + + ModelVariant: + type: object + required: + - params + - displayName + properties: + params: + type: array + description: Concrete parameter values that, combined with the parent model `id`, form a valid model selection. May be empty. + items: + type: object + required: + - id + - value + properties: + id: + type: string + minLength: 1 + value: + type: string + minLength: 1 + displayName: + type: string + minLength: 1 + description: Human-readable label for this variant. + description: + type: string + minLength: 1 + isDefault: + type: boolean + description: True for the variant Cursor selects when the user picks this model without explicit `params`. + + ModelListItem: + type: object + required: + - id + - displayName + properties: + id: + type: string + minLength: 1 + description: Pass this value as `model.id` when creating an agent. + example: 'composer-2' + displayName: + type: string + minLength: 1 + description: Human-readable model name. + example: 'Composer 2' + description: + type: string + minLength: 1 + aliases: + type: array + description: Alternate IDs that resolve to the same model. + items: + type: string + minLength: 1 + example: ['composer-latest', 'composer'] + parameters: + type: array + description: Per-model parameter definitions, when the model accepts parameters. Use these to populate `model.params`. + items: + $ref: '#/components/schemas/ModelParameterDefinition' + variants: + type: array + description: Concrete `id`+`params` combinations the model accepts. + items: + $ref: '#/components/schemas/ModelVariant' ListModelsResponse: type: object @@ -638,10 +913,9 @@ components: properties: items: type: array - description: Recommended set of explicit model IDs you can pass to the `model.id` field on POST /v1/agents. + description: Recommended models. Use `id` (and optionally `params`) when creating an agent. items: - type: string - example: ['composer-2', 'gpt-5.5', 'claude-4.6-sonnet-thinking'] + $ref: '#/components/schemas/ModelListItem' Repository: type: object @@ -731,15 +1005,29 @@ components: 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`, + `integration_not_connected`, `validation_error`, + `missing_body`, `invalid_model`, `invalid_branch_name`, + `repository_required`, `repository_access`, + `pr_resolution_failed`, `artifact_not_found`, + `service_account_required`, `agent_not_found`, `run_not_found`, `agent_busy`, `agent_archived`, - `run_not_cancellable`, `rate_limit_exceeded`, + `agent_id_conflict`, `run_not_cancellable`, + `rate_limit_exceeded`, `usage_limit_exceeded`, `stream_expired`, `stream_unavailable`, - `invalid_last_event_id`, `upstream_error`, and + `invalid_last_event_id`, `client_cancelled`, + `not_implemented`, `upstream_error`, and `internal_error`. message: type: string description: Human-readable error message. + helpUrl: + type: string + format: uri + description: Optional follow-up link. Populated for codes like `integration_not_connected`. + provider: + type: string + minLength: 1 + description: Optional provider identifier. Populated for codes like `integration_not_connected`. parameters: AgentId: @@ -785,7 +1073,7 @@ components: schema: $ref: '#/components/schemas/Error' Conflict: - description: Resource state conflict (`agent_busy`, `agent_archived`, or `run_not_cancellable`). + description: Resource state conflict (`agent_busy`, `agent_archived`, `agent_id_conflict`, or `run_not_cancellable`). content: application/json: schema: @@ -837,6 +1125,8 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + '409': + $ref: '#/components/responses/Conflict' '429': $ref: '#/components/responses/RateLimited' '500': @@ -1048,14 +1338,29 @@ paths: get: 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`. - `tool_call` event data uses the `RunStreamToolCallData` schema. + Stream Server-Sent Events for one run. Event types are + `status`, `assistant`, `thinking`, `tool_call`, + `interaction_update`, `heartbeat`, `result`, `error`, and + `done`. + + - `status` carries `{ runId, status }`. It has no `id` line + and is replayed at the top of every reconnect. + - `result` carries `{ runId, status, text?, durationMs?, + git? }`; `text` is the final assistant reply, `durationMs` + the wall-clock duration, and `git` mirrors `Run.git`. + - `interaction_update` carries the richer SDK-shape update + used by the TypeScript SDK and is emitted alongside the + simplified events that share the same event id. Use this if + you want the full SDK stream; otherwise handle the simplified + events and ignore it. + + Reconnect with the `Last-Event-ID` header to resume after a + disconnect; the event ID must belong to the requested run + otherwise the endpoint returns `400 invalid_last_event_id`. + Responses include the `X-Cursor-Stream-Retention-Seconds` + header; after the retention window the endpoint may return + `410 stream_expired`. `tool_call` event data uses the + `RunStreamToolCallData` schema. operationId: streamRun parameters: - $ref: '#/components/parameters/AgentId'