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 @@ -48,7 +48,8 @@ partial void ProcessStreamRunResponse(
/// `Last-Event-ID` header to resume after a disconnect; the event<br/>
/// ID must belong to the requested run. Responses include the<br/>
/// `X-Cursor-Stream-Retention-Seconds` header. After the<br/>
/// retention window the endpoint may return `410 stream_expired`.
/// retention window the endpoint may return `410 stream_expired`.<br/>
/// `tool_call` event data uses the `RunStreamToolCallData` schema.
/// </summary>
/// <param name="id">
/// Example: bc-00000000-0000-0000-0000-000000000001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public partial interface ICursorAgentsClient
/// `Last-Event-ID` header to resume after a disconnect; the event<br/>
/// ID must belong to the requested run. Responses include the<br/>
/// `X-Cursor-Stream-Retention-Seconds` header. After the<br/>
/// retention window the endpoint may return `410 stream_expired`.
/// retention window the endpoint may return `410 stream_expired`.<br/>
/// `tool_call` event data uses the `RunStreamToolCallData` schema.
/// </summary>
/// <param name="id">
/// Example: bc-00000000-0000-0000-0000-000000000001
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

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

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

return default;
}

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

writer.WriteStringValue(global::CursorAgents.RunStreamToolCallDataStatusExtensions.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 RunStreamToolCallDataStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::CursorAgents.RunStreamToolCallDataStatus?>
{
/// <inheritdoc />
public override global::CursorAgents.RunStreamToolCallDataStatus? 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.RunStreamToolCallDataStatusExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::CursorAgents.RunStreamToolCallDataStatus? 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.RunStreamToolCallDataStatusExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

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

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

return default;
}

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

writer.WriteStringValue(global::CursorAgents.RunStreamToolCallEventEventExtensions.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 RunStreamToolCallEventEventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::CursorAgents.RunStreamToolCallEventEvent?>
{
/// <inheritdoc />
public override global::CursorAgents.RunStreamToolCallEventEvent? 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.RunStreamToolCallEventEventExtensions.ToEnum(stringValue);
}

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

return default;
}

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

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

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

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

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

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

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

typeof(global::CursorAgents.JsonConverters.AgentModeNullableJsonConverter),
Expand All @@ -41,6 +49,8 @@ namespace CursorAgents

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

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

typeof(global::CursorAgents.JsonConverters.UnixTimestampJsonConverter),
})]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.JsonSerializerContextTypes))]
Expand Down Expand Up @@ -71,6 +81,15 @@ namespace CursorAgents
[global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Run))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.RunStatus), TypeInfoPropertyName = "RunStatus2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.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<object>))]
[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.CreateAgentRequest))]
[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>))]
Expand All @@ -96,13 +115,13 @@ namespace CursorAgents
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ListRepositoriesResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::CursorAgents.Repository>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateSubTokenRequest))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(object))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.CreateSubTokenResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.Error))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::CursorAgents.ErrorError1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.ModelRefParam>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<string>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.RepoConfig>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<object>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.Image>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.McpServer>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::CursorAgents.AgentSummary>))]
Expand Down
Loading