Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ partial void ProcessCreateAgentResponseContent(
/// <param name="envVars">
/// 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.
/// </param>
/// <param name="mode">
/// Initial conversation mode for the agent's first run.<br/>
/// Default Value: agent
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
Expand All @@ -675,6 +679,7 @@ partial void ProcessCreateAgentResponseContent(
bool? autoCreatePR = default,
bool? skipReviewerRequest = default,
global::System.Collections.Generic.Dictionary<string, string>? envVars = default,
global::CursorAgents.AgentMode? mode = default,
global::CursorAgents.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand All @@ -689,6 +694,7 @@ partial void ProcessCreateAgentResponseContent(
AutoCreatePR = autoCreatePR,
SkipReviewerRequest = skipReviewerRequest,
EnvVars = envVars,
Mode = mode,
};

return await CreateAgentAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,18 +730,23 @@ partial void ProcessCreateRunResponseContent(
/// Example: bc-00000000-0000-0000-0000-000000000001
/// </param>
/// <param name="prompt"></param>
/// <param name="mode">
/// Conversation mode. `plan` explores and drafts a plan before coding; `agent` implements changes directly. On follow-up runs, omit to keep the conversation's current mode; set explicitly to switch modes for that run.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::CursorAgents.CreateRunResponse> CreateRunAsync(
string id,
global::CursorAgents.CreateRunRequestPrompt prompt,
global::CursorAgents.AgentMode? mode = default,
global::CursorAgents.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::CursorAgents.CreateRunRequest
{
Prompt = prompt,
Mode = mode,
};

return await CreateRunAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public partial interface ICursorAgentsClient
/// <param name="envVars">
/// 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.
/// </param>
/// <param name="mode">
/// Initial conversation mode for the agent's first run.<br/>
/// Default Value: agent
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
Expand All @@ -78,6 +82,7 @@ public partial interface ICursorAgentsClient
bool? autoCreatePR = default,
bool? skipReviewerRequest = default,
global::System.Collections.Generic.Dictionary<string, string>? envVars = default,
global::CursorAgents.AgentMode? mode = default,
global::CursorAgents.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ public partial interface ICursorAgentsClient
/// Example: bc-00000000-0000-0000-0000-000000000001
/// </param>
/// <param name="prompt"></param>
/// <param name="mode">
/// Conversation mode. `plan` explores and drafts a plan before coding; `agent` implements changes directly. On follow-up runs, omit to keep the conversation's current mode; set explicitly to switch modes for that run.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::CursorAgents.CreateRunResponse> CreateRunAsync(
string id,
global::CursorAgents.CreateRunRequestPrompt prompt,
global::CursorAgents.AgentMode? mode = default,
global::CursorAgents.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace CursorAgents.JsonConverters
{
/// <inheritdoc />
public sealed class AgentModeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::CursorAgents.AgentMode>
{
/// <inheritdoc />
public override global::CursorAgents.AgentMode 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.AgentModeExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::CursorAgents.AgentMode)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::CursorAgents.AgentMode);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::CursorAgents.AgentMode value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::CursorAgents.AgentModeExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace CursorAgents.JsonConverters
{
/// <inheritdoc />
public sealed class AgentModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::CursorAgents.AgentMode?>
{
/// <inheritdoc />
public override global::CursorAgents.AgentMode? 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.AgentModeExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::CursorAgents.AgentMode)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::CursorAgents.AgentMode?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::CursorAgents.AgentMode? 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.AgentModeExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ namespace CursorAgents

typeof(global::CursorAgents.JsonConverters.RunStatusNullableJsonConverter),

typeof(global::CursorAgents.JsonConverters.AgentModeJsonConverter),

typeof(global::CursorAgents.JsonConverters.AgentModeNullableJsonConverter),

typeof(global::CursorAgents.JsonConverters.AgentJsonConverter),

typeof(global::CursorAgents.JsonConverters.UnixTimestampJsonConverter),
Expand Down Expand Up @@ -53,6 +57,7 @@ namespace CursorAgents
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentRequestPrompt))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::CursorAgents.Image>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary<string, string>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.AgentMode), TypeInfoPropertyName = "AgentMode2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateRunRequest))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateRunRequestPrompt))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateAgentResponse))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,103 +120,107 @@ public sealed partial class JsonSerializerContextTypes
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateRunRequest? Type23 { get; set; }
public global::CursorAgents.AgentMode? Type23 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateRunRequestPrompt? Type24 { get; set; }
public global::CursorAgents.CreateRunRequest? Type24 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateAgentResponse? Type25 { get; set; }
public global::CursorAgents.CreateRunRequestPrompt? Type25 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateRunResponse? Type26 { get; set; }
public global::CursorAgents.CreateAgentResponse? Type26 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListAgentsResponse? Type27 { get; set; }
public global::CursorAgents.CreateRunResponse? Type27 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.AgentSummary>? Type28 { get; set; }
public global::CursorAgents.ListAgentsResponse? Type28 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListRunsResponse? Type29 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.AgentSummary>? Type29 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.Run>? Type30 { get; set; }
public global::CursorAgents.ListRunsResponse? Type30 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.IdResponse? Type31 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.Run>? Type31 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Artifact? Type32 { get; set; }
public global::CursorAgents.IdResponse? Type32 { get; set; }
/// <summary>
///
/// </summary>
public long? Type33 { get; set; }
public global::CursorAgents.Artifact? Type33 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListArtifactsResponse? Type34 { get; set; }
public long? Type34 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.Artifact>? Type35 { get; set; }
public global::CursorAgents.ListArtifactsResponse? Type35 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.DownloadArtifactResponse? Type36 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.Artifact>? Type36 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ApiKeyInfo? Type37 { get; set; }
public global::CursorAgents.DownloadArtifactResponse? Type37 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListModelsResponse? Type38 { get; set; }
public global::CursorAgents.ApiKeyInfo? Type38 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<string>? Type39 { get; set; }
public global::CursorAgents.ListModelsResponse? Type39 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Repository? Type40 { get; set; }
public global::System.Collections.Generic.IList<string>? Type40 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ListRepositoriesResponse? Type41 { get; set; }
public global::CursorAgents.Repository? Type41 { get; set; }
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::CursorAgents.Repository>? Type42 { get; set; }
public global::CursorAgents.ListRepositoriesResponse? Type42 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenRequest? Type43 { get; set; }
public global::System.Collections.Generic.IList<global::CursorAgents.Repository>? Type43 { get; set; }
/// <summary>
///
/// </summary>
public object? Type44 { get; set; }
public global::CursorAgents.CreateSubTokenRequest? Type44 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.CreateSubTokenResponse? Type45 { get; set; }
public object? Type45 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.Error? Type46 { get; set; }
public global::CursorAgents.CreateSubTokenResponse? Type46 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ErrorError1? Type47 { get; set; }
public global::CursorAgents.Error? Type47 { get; set; }
/// <summary>
///
/// </summary>
public global::CursorAgents.ErrorError1? Type48 { get; set; }

/// <summary>
///
Expand Down
Loading