From d179f9bd9cba5a4a3bc55ab84c1cab75e1ca6151 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 20 May 2026 03:43:25 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...orAgents.CursorAgentsClient.StreamRun.g.cs | 3 +- ...rAgents.ICursorAgentsClient.StreamRun.g.cs | 3 +- ...CursorAgents.JsonConverters.JsonValue.g.cs | 327 ++++++++++++ ...onverters.RunStreamToolCallDataStatus.g.cs | 53 ++ ...s.RunStreamToolCallDataStatusNullable.g.cs | 60 +++ ...onverters.RunStreamToolCallEventEvent.g.cs | 53 ++ ...s.RunStreamToolCallEventEventNullable.g.cs | 60 +++ .../CursorAgents.JsonSerializerContext.g.cs | 21 +- ...rsorAgents.JsonSerializerContextTypes.g.cs | 106 ++-- .../CursorAgents.Models.JsonValue.Json.g.cs | 92 ++++ .../CursorAgents.Models.JsonValue.g.cs | 498 ++++++++++++++++++ ...rAgents.Models.JsonValueVariant4.Json.g.cs | 92 ++++ ...CursorAgents.Models.JsonValueVariant4.g.cs | 19 + ...nts.Models.JsonValueVariant5Item.Json.g.cs | 92 ++++ ...orAgents.Models.JsonValueVariant5Item.g.cs | 19 + ...nts.Models.RunStreamToolCallData.Json.g.cs | 92 ++++ ...orAgents.Models.RunStreamToolCallData.g.cs | 120 +++++ ...ts.Models.RunStreamToolCallDataStatus.g.cs | 52 ++ ...ts.Models.RunStreamToolCallEvent.Json.g.cs | 92 ++++ ...rAgents.Models.RunStreamToolCallEvent.g.cs | 69 +++ ...ts.Models.RunStreamToolCallEventEvent.g.cs | 45 ++ ...dels.RunStreamToolCallTruncation.Json.g.cs | 92 ++++ ...ts.Models.RunStreamToolCallTruncation.g.cs | 63 +++ .../Generated/autosdk.generated-examples.json | 11 + src/libs/CursorAgents/openapi.yaml | 96 ++++ 25 files changed, 2192 insertions(+), 38 deletions(-) create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.JsonValue.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallDataStatus.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallDataStatusNullable.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallEventEvent.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallEventEventNullable.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValue.Json.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValue.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant4.Json.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant4.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant5Item.Json.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant5Item.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallData.Json.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallData.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallDataStatus.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.Json.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEventEvent.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallTruncation.Json.g.cs create mode 100644 src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallTruncation.g.cs diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs index eed8e7a..3944e45 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs @@ -48,7 +48,8 @@ partial void ProcessStreamRunResponse( /// `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`. + /// 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.StreamRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs index cb8d5ff..e957a0e 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.ICursorAgentsClient.StreamRun.g.cs @@ -12,7 +12,8 @@ public partial interface ICursorAgentsClient /// `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`. + /// 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.JsonValue.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.JsonValue.g.cs new file mode 100644 index 0000000..b771a22 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.JsonValue.g.cs @@ -0,0 +1,327 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace CursorAgents.JsonConverters +{ + /// + public class JsonValueJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::CursorAgents.JsonValue 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(string), 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(double), 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(bool), 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 __score3 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(object), 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)) __score3++; + } + } + } + var __score4 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList), 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)) __score4++; + } + } + } + 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; } + if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } + if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; } + + string? jsonValueVariant1 = default; + double? jsonValueVariant2 = default; + bool? jsonValueVariant3 = default; + object? jsonValueVariant4 = default; + global::System.Collections.Generic.IList? jsonValueVariant5 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}"); + jsonValueVariant1 = 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(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}"); + jsonValueVariant2 = 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(bool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(bool).Name}"); + jsonValueVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 3) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + jsonValueVariant4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 4) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::System.Collections.Generic.IList).Name}"); + jsonValueVariant5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (jsonValueVariant1 == null && jsonValueVariant2 == null && jsonValueVariant3 == null && jsonValueVariant4 == null && jsonValueVariant5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}"); + jsonValueVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (jsonValueVariant1 == null && jsonValueVariant2 == null && jsonValueVariant3 == null && jsonValueVariant4 == null && jsonValueVariant5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}"); + jsonValueVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (jsonValueVariant1 == null && jsonValueVariant2 == null && jsonValueVariant3 == null && jsonValueVariant4 == null && jsonValueVariant5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(bool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(bool).Name}"); + jsonValueVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (jsonValueVariant1 == null && jsonValueVariant2 == null && jsonValueVariant3 == null && jsonValueVariant4 == null && jsonValueVariant5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + jsonValueVariant4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (jsonValueVariant1 == null && jsonValueVariant2 == null && jsonValueVariant3 == null && jsonValueVariant4 == null && jsonValueVariant5 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::System.Collections.Generic.IList).Name}"); + jsonValueVariant5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::CursorAgents.JsonValue( + jsonValueVariant1, + + jsonValueVariant2, + + jsonValueVariant3, + + jsonValueVariant4, + + jsonValueVariant5 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::CursorAgents.JsonValue 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.IsJsonValueVariant1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.JsonValueVariant1!, typeInfo); + } + else if (value.IsJsonValueVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(double), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(double).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.JsonValueVariant2!.Value, typeInfo); + } + else if (value.IsJsonValueVariant3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(bool), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(bool).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.JsonValueVariant3!.Value, typeInfo); + } + else if (value.IsJsonValueVariant4) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.JsonValueVariant4!, typeInfo); + } + else if (value.IsJsonValueVariant5) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo?> ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::System.Collections.Generic.IList).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.JsonValueVariant5!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallDataStatus.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallDataStatus.g.cs new file mode 100644 index 0000000..789172d --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallDataStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace CursorAgents.JsonConverters +{ + /// + public sealed class RunStreamToolCallDataStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + 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; + } + + /// + 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)); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallDataStatusNullable.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallDataStatusNullable.g.cs new file mode 100644 index 0000000..8eb8ec1 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallDataStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace CursorAgents.JsonConverters +{ + /// + public sealed class RunStreamToolCallDataStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + 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; + } + + /// + 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)); + } + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallEventEvent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallEventEvent.g.cs new file mode 100644 index 0000000..844f889 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallEventEvent.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace CursorAgents.JsonConverters +{ + /// + public sealed class RunStreamToolCallEventEventJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + 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; + } + + /// + 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)); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallEventEventNullable.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallEventEventNullable.g.cs new file mode 100644 index 0000000..fafb7ee --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonConverters.RunStreamToolCallEventEventNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace CursorAgents.JsonConverters +{ + /// + public sealed class RunStreamToolCallEventEventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + 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; + } + + /// + 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)); + } + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs index c24094d..deee1a7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContext.g.cs @@ -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), @@ -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))] @@ -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))] + [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))] @@ -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::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::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))] diff --git a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs index 30ccae1..a5047ec 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.JsonSerializerContextTypes.g.cs @@ -136,119 +136,151 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::CursorAgents.CreateAgentRequest? Type27 { get; set; } + public global::CursorAgents.RunStreamToolCallTruncation? Type27 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentRequestPrompt? Type28 { get; set; } + public global::CursorAgents.JsonValue? Type28 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type29 { get; set; } + public double? Type29 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type30 { get; set; } + public object? Type30 { get; set; } /// /// /// - public global::CursorAgents.AgentMode? Type31 { get; set; } + public global::System.Collections.Generic.IList? Type31 { get; set; } /// /// /// - public global::CursorAgents.CreateRunRequest? Type32 { get; set; } + public global::CursorAgents.RunStreamToolCallData? Type32 { get; set; } /// /// /// - public global::CursorAgents.CreateRunRequestPrompt? Type33 { get; set; } + public global::CursorAgents.RunStreamToolCallDataStatus? Type33 { get; set; } /// /// /// - public global::CursorAgents.CreateAgentResponse? Type34 { get; set; } + public global::CursorAgents.RunStreamToolCallEvent? Type34 { get; set; } /// /// /// - public global::CursorAgents.CreateRunResponse? Type35 { get; set; } + public global::CursorAgents.RunStreamToolCallEventEvent? Type35 { get; set; } /// /// /// - public global::CursorAgents.ListAgentsResponse? Type36 { get; set; } + public global::CursorAgents.CreateAgentRequest? Type36 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type37 { get; set; } + public global::CursorAgents.CreateAgentRequestPrompt? Type37 { get; set; } /// /// /// - public global::CursorAgents.ListRunsResponse? Type38 { get; set; } + public global::System.Collections.Generic.IList? Type38 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type39 { get; set; } + public global::System.Collections.Generic.IList? Type39 { get; set; } /// /// /// - public global::CursorAgents.IdResponse? Type40 { get; set; } + public global::CursorAgents.AgentMode? Type40 { get; set; } /// /// /// - public global::CursorAgents.Artifact? Type41 { get; set; } + public global::CursorAgents.CreateRunRequest? Type41 { get; set; } /// /// /// - public long? Type42 { get; set; } + public global::CursorAgents.CreateRunRequestPrompt? Type42 { get; set; } /// /// /// - public global::CursorAgents.ListArtifactsResponse? Type43 { get; set; } + public global::CursorAgents.CreateAgentResponse? Type43 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type44 { get; set; } + public global::CursorAgents.CreateRunResponse? Type44 { get; set; } /// /// /// - public global::CursorAgents.DownloadArtifactResponse? Type45 { get; set; } + public global::CursorAgents.ListAgentsResponse? Type45 { get; set; } /// /// /// - public global::CursorAgents.ApiKeyInfo? Type46 { get; set; } + public global::System.Collections.Generic.IList? Type46 { get; set; } /// /// /// - public global::CursorAgents.ListModelsResponse? Type47 { get; set; } + public global::CursorAgents.ListRunsResponse? Type47 { get; set; } /// /// /// - public global::CursorAgents.Repository? Type48 { get; set; } + public global::System.Collections.Generic.IList? Type48 { get; set; } /// /// /// - public global::CursorAgents.ListRepositoriesResponse? Type49 { get; set; } + public global::CursorAgents.IdResponse? Type49 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type50 { get; set; } + public global::CursorAgents.Artifact? Type50 { get; set; } /// /// /// - public global::CursorAgents.CreateSubTokenRequest? Type51 { get; set; } + public long? Type51 { get; set; } /// /// /// - public object? Type52 { get; set; } + public global::CursorAgents.ListArtifactsResponse? Type52 { get; set; } /// /// /// - public global::CursorAgents.CreateSubTokenResponse? Type53 { get; set; } + public global::System.Collections.Generic.IList? Type53 { get; set; } /// /// /// - public global::CursorAgents.Error? Type54 { get; set; } + public global::CursorAgents.DownloadArtifactResponse? Type54 { get; set; } /// /// /// - public global::CursorAgents.ErrorError1? Type55 { get; set; } + public global::CursorAgents.ApiKeyInfo? Type55 { get; set; } + /// + /// + /// + public global::CursorAgents.ListModelsResponse? Type56 { get; set; } + /// + /// + /// + public global::CursorAgents.Repository? Type57 { get; set; } + /// + /// + /// + public global::CursorAgents.ListRepositoriesResponse? Type58 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type59 { get; set; } + /// + /// + /// + public global::CursorAgents.CreateSubTokenRequest? Type60 { get; set; } + /// + /// + /// + public global::CursorAgents.CreateSubTokenResponse? Type61 { get; set; } + /// + /// + /// + public global::CursorAgents.Error? Type62 { get; set; } + /// + /// + /// + public global::CursorAgents.ErrorError1? Type63 { get; set; } /// /// @@ -265,26 +297,30 @@ 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? ListType4 { get; set; } + public global::System.Collections.Generic.List? ListType5 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType5 { get; set; } + public global::System.Collections.Generic.List? ListType6 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType6 { get; set; } + public global::System.Collections.Generic.List? ListType7 { 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? ListType8 { get; set; } + public global::System.Collections.Generic.List? ListType9 { get; set; } } } \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValue.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValue.Json.g.cs new file mode 100644 index 0000000..fb1ebd3 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValue.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public readonly partial struct JsonValue + { + /// + /// 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.JsonValue? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.JsonValue), + jsonSerializerContext) as global::CursorAgents.JsonValue?; + } + + /// + /// 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.JsonValue? 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.JsonValue), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.JsonValue?; + } + + /// + /// 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.JsonValue.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValue.g.cs new file mode 100644 index 0000000..ea072e4 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValue.g.cs @@ -0,0 +1,498 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace CursorAgents +{ + /// + /// Any JSON value. + /// + public readonly partial struct JsonValue : global::System.IEquatable + { + /// + /// + /// +#if NET6_0_OR_GREATER + public string? JsonValueVariant1 { get; init; } +#else + public string? JsonValueVariant1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonValueVariant1))] +#endif + public bool IsJsonValueVariant1 => JsonValueVariant1 != null; + + /// + /// + /// + public bool TryPickJsonValueVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = JsonValueVariant1; + return IsJsonValueVariant1; + } + + /// + /// + /// + public string PickJsonValueVariant1() => IsJsonValueVariant1 + ? JsonValueVariant1! + : throw new global::System.InvalidOperationException($"Expected union variant 'JsonValueVariant1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public double? JsonValueVariant2 { get; init; } +#else + public double? JsonValueVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonValueVariant2))] +#endif + public bool IsJsonValueVariant2 => JsonValueVariant2 != null; + + /// + /// + /// + public bool TryPickJsonValueVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out double? value) + { + value = JsonValueVariant2; + return IsJsonValueVariant2; + } + + /// + /// + /// + public double PickJsonValueVariant2() => IsJsonValueVariant2 + ? JsonValueVariant2!.Value + : throw new global::System.InvalidOperationException($"Expected union variant 'JsonValueVariant2' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public bool? JsonValueVariant3 { get; init; } +#else + public bool? JsonValueVariant3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonValueVariant3))] +#endif + public bool IsJsonValueVariant3 => JsonValueVariant3 != null; + + /// + /// + /// + public bool TryPickJsonValueVariant3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out bool? value) + { + value = JsonValueVariant3; + return IsJsonValueVariant3; + } + + /// + /// + /// + public bool PickJsonValueVariant3() => IsJsonValueVariant3 + ? JsonValueVariant3!.Value + : throw new global::System.InvalidOperationException($"Expected union variant 'JsonValueVariant3' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public object? JsonValueVariant4 { get; init; } +#else + public object? JsonValueVariant4 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonValueVariant4))] +#endif + public bool IsJsonValueVariant4 => JsonValueVariant4 != null; + + /// + /// + /// + public bool TryPickJsonValueVariant4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = JsonValueVariant4; + return IsJsonValueVariant4; + } + + /// + /// + /// + public object PickJsonValueVariant4() => IsJsonValueVariant4 + ? JsonValueVariant4! + : throw new global::System.InvalidOperationException($"Expected union variant 'JsonValueVariant4' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::System.Collections.Generic.IList? JsonValueVariant5 { get; init; } +#else + public global::System.Collections.Generic.IList? JsonValueVariant5 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(JsonValueVariant5))] +#endif + public bool IsJsonValueVariant5 => JsonValueVariant5 != null; + + /// + /// + /// + public bool TryPickJsonValueVariant5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::System.Collections.Generic.IList? value) + { + value = JsonValueVariant5; + return IsJsonValueVariant5; + } + + /// + /// + /// + public global::System.Collections.Generic.IList PickJsonValueVariant5() => IsJsonValueVariant5 + ? JsonValueVariant5! + : throw new global::System.InvalidOperationException($"Expected union variant 'JsonValueVariant5' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator JsonValue(string value) => new JsonValue((string?)value); + + /// + /// + /// + public static implicit operator string?(JsonValue @this) => @this.JsonValueVariant1; + + /// + /// + /// + public JsonValue(string? value) + { + JsonValueVariant1 = value; + } + + /// + /// + /// + public static JsonValue FromJsonValueVariant1(string? value) => new JsonValue(value); + + /// + /// + /// + public static implicit operator JsonValue(double value) => new JsonValue((double?)value); + + /// + /// + /// + public static implicit operator double?(JsonValue @this) => @this.JsonValueVariant2; + + /// + /// + /// + public JsonValue(double? value) + { + JsonValueVariant2 = value; + } + + /// + /// + /// + public static JsonValue FromJsonValueVariant2(double? value) => new JsonValue(value); + + /// + /// + /// + public static implicit operator JsonValue(bool value) => new JsonValue((bool?)value); + + /// + /// + /// + public static implicit operator bool?(JsonValue @this) => @this.JsonValueVariant3; + + /// + /// + /// + public JsonValue(bool? value) + { + JsonValueVariant3 = value; + } + + /// + /// + /// + public static JsonValue FromJsonValueVariant3(bool? value) => new JsonValue(value); + + /// + /// + /// + public JsonValue( + string? jsonValueVariant1, + double? jsonValueVariant2, + bool? jsonValueVariant3, + object? jsonValueVariant4, + global::System.Collections.Generic.IList? jsonValueVariant5 + ) + { + JsonValueVariant1 = jsonValueVariant1; + JsonValueVariant2 = jsonValueVariant2; + JsonValueVariant3 = jsonValueVariant3; + JsonValueVariant4 = jsonValueVariant4; + JsonValueVariant5 = jsonValueVariant5; + } + + /// + /// + /// + public object? Object => + JsonValueVariant5 as object ?? + JsonValueVariant4 as object ?? + JsonValueVariant3 as object ?? + JsonValueVariant2 as object ?? + JsonValueVariant1 as object + ; + + /// + /// + /// + public override string? ToString() => + JsonValueVariant1?.ToString() ?? + JsonValueVariant2?.ToString() ?? + JsonValueVariant3?.ToString().ToLowerInvariant() ?? + JsonValueVariant4?.ToString() ?? + JsonValueVariant5?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsJsonValueVariant1 && !IsJsonValueVariant2 && !IsJsonValueVariant3 && !IsJsonValueVariant4 && !IsJsonValueVariant5 || !IsJsonValueVariant1 && IsJsonValueVariant2 && !IsJsonValueVariant3 && !IsJsonValueVariant4 && !IsJsonValueVariant5 || !IsJsonValueVariant1 && !IsJsonValueVariant2 && IsJsonValueVariant3 && !IsJsonValueVariant4 && !IsJsonValueVariant5 || !IsJsonValueVariant1 && !IsJsonValueVariant2 && !IsJsonValueVariant3 && IsJsonValueVariant4 && !IsJsonValueVariant5 || !IsJsonValueVariant1 && !IsJsonValueVariant2 && !IsJsonValueVariant3 && !IsJsonValueVariant4 && IsJsonValueVariant5; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? jsonValueVariant1 = null, + global::System.Func? jsonValueVariant2 = null, + global::System.Func? jsonValueVariant3 = null, + global::System.Func? jsonValueVariant4 = null, + global::System.Func, TResult>? jsonValueVariant5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsJsonValueVariant1 && jsonValueVariant1 != null) + { + return jsonValueVariant1(JsonValueVariant1!); + } + else if (IsJsonValueVariant2 && jsonValueVariant2 != null) + { + return jsonValueVariant2(JsonValueVariant2!); + } + else if (IsJsonValueVariant3 && jsonValueVariant3 != null) + { + return jsonValueVariant3(JsonValueVariant3!); + } + else if (IsJsonValueVariant4 && jsonValueVariant4 != null) + { + return jsonValueVariant4(JsonValueVariant4!); + } + else if (IsJsonValueVariant5 && jsonValueVariant5 != null) + { + return jsonValueVariant5(JsonValueVariant5!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? jsonValueVariant1 = null, + + global::System.Action? jsonValueVariant2 = null, + + global::System.Action? jsonValueVariant3 = null, + + global::System.Action? jsonValueVariant4 = null, + + global::System.Action>? jsonValueVariant5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsJsonValueVariant1) + { + jsonValueVariant1?.Invoke(JsonValueVariant1!); + } + else if (IsJsonValueVariant2) + { + jsonValueVariant2?.Invoke(JsonValueVariant2!); + } + else if (IsJsonValueVariant3) + { + jsonValueVariant3?.Invoke(JsonValueVariant3!); + } + else if (IsJsonValueVariant4) + { + jsonValueVariant4?.Invoke(JsonValueVariant4!); + } + else if (IsJsonValueVariant5) + { + jsonValueVariant5?.Invoke(JsonValueVariant5!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? jsonValueVariant1 = null, + global::System.Action? jsonValueVariant2 = null, + global::System.Action? jsonValueVariant3 = null, + global::System.Action? jsonValueVariant4 = null, + global::System.Action>? jsonValueVariant5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsJsonValueVariant1) + { + jsonValueVariant1?.Invoke(JsonValueVariant1!); + } + else if (IsJsonValueVariant2) + { + jsonValueVariant2?.Invoke(JsonValueVariant2!); + } + else if (IsJsonValueVariant3) + { + jsonValueVariant3?.Invoke(JsonValueVariant3!); + } + else if (IsJsonValueVariant4) + { + jsonValueVariant4?.Invoke(JsonValueVariant4!); + } + else if (IsJsonValueVariant5) + { + jsonValueVariant5?.Invoke(JsonValueVariant5!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + JsonValueVariant1, + typeof(string), + JsonValueVariant2, + typeof(double), + JsonValueVariant3, + typeof(bool), + JsonValueVariant4, + typeof(object), + JsonValueVariant5, + typeof(global::System.Collections.Generic.IList), + }; + 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(JsonValue other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(JsonValueVariant1, other.JsonValueVariant1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(JsonValueVariant2, other.JsonValueVariant2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(JsonValueVariant3, other.JsonValueVariant3) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(JsonValueVariant4, other.JsonValueVariant4) && + global::System.Collections.Generic.EqualityComparer?>.Default.Equals(JsonValueVariant5, other.JsonValueVariant5) + ; + } + + /// + /// + /// + public static bool operator ==(JsonValue obj1, JsonValue obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(JsonValue obj1, JsonValue obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is JsonValue o && Equals(o); + } + } +} diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant4.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant4.Json.g.cs new file mode 100644 index 0000000..92cd0cc --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant4.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class JsonValueVariant4 + { + /// + /// 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.JsonValueVariant4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.JsonValueVariant4), + jsonSerializerContext) as global::CursorAgents.JsonValueVariant4; + } + + /// + /// 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.JsonValueVariant4? 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.JsonValueVariant4), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.JsonValueVariant4; + } + + /// + /// 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.JsonValueVariant4.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant4.g.cs new file mode 100644 index 0000000..5ed7eab --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class JsonValueVariant4 + { + + /// + /// 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.JsonValueVariant5Item.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant5Item.Json.g.cs new file mode 100644 index 0000000..4b0c8b7 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant5Item.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class JsonValueVariant5Item + { + /// + /// 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.JsonValueVariant5Item? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.JsonValueVariant5Item), + jsonSerializerContext) as global::CursorAgents.JsonValueVariant5Item; + } + + /// + /// 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.JsonValueVariant5Item? 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.JsonValueVariant5Item), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.JsonValueVariant5Item; + } + + /// + /// 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.JsonValueVariant5Item.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant5Item.g.cs new file mode 100644 index 0000000..0d295c3 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.JsonValueVariant5Item.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class JsonValueVariant5Item + { + + /// + /// 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.RunStreamToolCallData.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallData.Json.g.cs new file mode 100644 index 0000000..0ad5934 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallData.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class RunStreamToolCallData + { + /// + /// 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.RunStreamToolCallData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.RunStreamToolCallData), + jsonSerializerContext) as global::CursorAgents.RunStreamToolCallData; + } + + /// + /// 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.RunStreamToolCallData? 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.RunStreamToolCallData), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.RunStreamToolCallData; + } + + /// + /// 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.RunStreamToolCallData.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallData.g.cs new file mode 100644 index 0000000..583f25a --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallData.g.cs @@ -0,0 +1,120 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class RunStreamToolCallData + { + /// + /// Stable identifier for one tool invocation across updates.
+ /// Example: call-1 + ///
+ /// call-1 + [global::System.Text.Json.Serialization.JsonPropertyName("callId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CallId { get; set; } + + /// + /// Public tool name, such as `read_file`, `run_terminal_cmd`, or `mcp`.
+ /// Example: read_file + ///
+ /// read_file + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Tool invocation lifecycle status.
+ /// Example: completed + ///
+ /// completed + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.RunStreamToolCallDataStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::CursorAgents.RunStreamToolCallDataStatus Status { get; set; } + + /// + /// Tool-specific JSON arguments, when available.
+ /// Example: {"path":"README.md"} + ///
+ /// {"path":"README.md"} + [global::System.Text.Json.Serialization.JsonPropertyName("args")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.JsonValueJsonConverter))] + public global::CursorAgents.JsonValue? Args { get; set; } + + /// + /// Tool-specific JSON result, when available.
+ /// Example: {"success":{"content":"# Project","totalLines":1,"fileSize":9,"path":"README.md"}} + ///
+ /// {"success":{"content":"# Project","totalLines":1,"fileSize":9,"path":"README.md"}} + [global::System.Text.Json.Serialization.JsonPropertyName("result")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.JsonValueJsonConverter))] + public global::CursorAgents.JsonValue? Result { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("truncated")] + public global::CursorAgents.RunStreamToolCallTruncation? Truncated { 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. + /// + /// + /// Stable identifier for one tool invocation across updates.
+ /// Example: call-1 + /// + /// + /// Public tool name, such as `read_file`, `run_terminal_cmd`, or `mcp`.
+ /// Example: read_file + /// + /// + /// Tool invocation lifecycle status.
+ /// Example: completed + /// + /// + /// Tool-specific JSON arguments, when available.
+ /// Example: {"path":"README.md"} + /// + /// + /// Tool-specific JSON result, when available.
+ /// Example: {"success":{"content":"# Project","totalLines":1,"fileSize":9,"path":"README.md"}} + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RunStreamToolCallData( + string callId, + string name, + global::CursorAgents.RunStreamToolCallDataStatus status, + global::CursorAgents.JsonValue? args, + global::CursorAgents.JsonValue? result, + global::CursorAgents.RunStreamToolCallTruncation? truncated) + { + this.CallId = callId ?? throw new global::System.ArgumentNullException(nameof(callId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Status = status; + this.Args = args; + this.Result = result; + this.Truncated = truncated; + } + + /// + /// Initializes a new instance of the class. + /// + public RunStreamToolCallData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallDataStatus.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallDataStatus.g.cs new file mode 100644 index 0000000..5473137 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallDataStatus.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// Tool invocation lifecycle status.
+ /// Example: completed + ///
+ public enum RunStreamToolCallDataStatus + { + /// + /// + /// + Completed, + /// + /// + /// + Running, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RunStreamToolCallDataStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RunStreamToolCallDataStatus value) + { + return value switch + { + RunStreamToolCallDataStatus.Completed => "completed", + RunStreamToolCallDataStatus.Running => "running", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RunStreamToolCallDataStatus? ToEnum(string value) + { + return value switch + { + "completed" => RunStreamToolCallDataStatus.Completed, + "running" => RunStreamToolCallDataStatus.Running, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.Json.g.cs new file mode 100644 index 0000000..b5a0ce3 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class RunStreamToolCallEvent + { + /// + /// 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.RunStreamToolCallEvent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.RunStreamToolCallEvent), + jsonSerializerContext) as global::CursorAgents.RunStreamToolCallEvent; + } + + /// + /// 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.RunStreamToolCallEvent? 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.RunStreamToolCallEvent), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.RunStreamToolCallEvent; + } + + /// + /// 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.RunStreamToolCallEvent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.g.cs new file mode 100644 index 0000000..2b1498c --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEvent.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class RunStreamToolCallEvent + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("event")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::CursorAgents.JsonConverters.RunStreamToolCallEventEventJsonConverter))] + public global::CursorAgents.RunStreamToolCallEventEvent Event { get; set; } + + /// + /// SSE event id used with the `Last-Event-ID` resume header.
+ /// Example: 1713033006000-0 + ///
+ /// 1713033006000-0 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::CursorAgents.RunStreamToolCallData Data { 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. + /// + /// + /// + /// + /// SSE event id used with the `Last-Event-ID` resume header.
+ /// Example: 1713033006000-0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RunStreamToolCallEvent( + global::CursorAgents.RunStreamToolCallData data, + global::CursorAgents.RunStreamToolCallEventEvent @event, + string? id) + { + this.Event = @event; + this.Id = id; + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public RunStreamToolCallEvent() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEventEvent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEventEvent.g.cs new file mode 100644 index 0000000..f46a543 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallEventEvent.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public enum RunStreamToolCallEventEvent + { + /// + /// + /// + ToolCall, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RunStreamToolCallEventEventExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RunStreamToolCallEventEvent value) + { + return value switch + { + RunStreamToolCallEventEvent.ToolCall => "tool_call", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RunStreamToolCallEventEvent? ToEnum(string value) + { + return value switch + { + "tool_call" => RunStreamToolCallEventEvent.ToolCall, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallTruncation.Json.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallTruncation.Json.g.cs new file mode 100644 index 0000000..3c239d7 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallTruncation.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace CursorAgents +{ + public sealed partial class RunStreamToolCallTruncation + { + /// + /// 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.RunStreamToolCallTruncation? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::CursorAgents.RunStreamToolCallTruncation), + jsonSerializerContext) as global::CursorAgents.RunStreamToolCallTruncation; + } + + /// + /// 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.RunStreamToolCallTruncation? 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.RunStreamToolCallTruncation), + jsonSerializerContext).ConfigureAwait(false)) as global::CursorAgents.RunStreamToolCallTruncation; + } + + /// + /// 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.RunStreamToolCallTruncation.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallTruncation.g.cs new file mode 100644 index 0000000..4f7d039 --- /dev/null +++ b/src/libs/CursorAgents/Generated/CursorAgents.Models.RunStreamToolCallTruncation.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace CursorAgents +{ + /// + /// + /// + public sealed partial class RunStreamToolCallTruncation + { + /// + /// Present and true when the tool arguments were too large to include in the stream.
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("args")] + public bool? Args { get; set; } + + /// + /// Present and true when the tool result was too large to include in the stream.
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("result")] + public bool? Result { 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. + /// + /// + /// Present and true when the tool arguments were too large to include in the stream.
+ /// Example: true + /// + /// + /// Present and true when the tool result was too large to include in the stream.
+ /// Example: true + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RunStreamToolCallTruncation( + bool? args, + bool? result) + { + this.Args = args; + this.Result = result; + } + + /// + /// Initializes a new instance of the class. + /// + public RunStreamToolCallTruncation() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/CursorAgents/Generated/autosdk.generated-examples.json b/src/libs/CursorAgents/Generated/autosdk.generated-examples.json index ee95402..42c9d7c 100644 --- a/src/libs/CursorAgents/Generated/autosdk.generated-examples.json +++ b/src/libs/CursorAgents/Generated/autosdk.generated-examples.json @@ -10,6 +10,17 @@ "Format": "sdk", "OperationId": "createSubToken", "Setup": "This example assumes \u0060using CursorAgents;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "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.", + "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", + "OperationId": "streamRun", + "Setup": null } ] } \ No newline at end of file diff --git a/src/libs/CursorAgents/openapi.yaml b/src/libs/CursorAgents/openapi.yaml index 0167c83..7ffccd4 100644 --- a/src/libs/CursorAgents/openapi.yaml +++ b/src/libs/CursorAgents/openapi.yaml @@ -312,6 +312,90 @@ components: type: string format: date-time + RunStreamToolCallTruncation: + type: object + additionalProperties: false + properties: + args: + type: boolean + description: Present and true when the tool arguments were too large to include in the stream. + example: true + result: + type: boolean + description: Present and true when the tool result was too large to include in the stream. + example: true + + JsonValue: + description: Any JSON value. + nullable: true + oneOf: + - type: string + - type: number + - type: boolean + - type: object + additionalProperties: true + - type: array + items: {} + + RunStreamToolCallData: + type: object + additionalProperties: false + required: + - callId + - name + - status + properties: + callId: + type: string + minLength: 1 + description: Stable identifier for one tool invocation across updates. + example: 'call-1' + name: + type: string + minLength: 1 + description: Public tool name, such as `read_file`, `run_terminal_cmd`, or `mcp`. + example: 'read_file' + status: + type: string + enum: ['running', 'completed'] + description: Tool invocation lifecycle status. + example: 'completed' + args: + allOf: + - $ref: '#/components/schemas/JsonValue' + description: Tool-specific JSON arguments, when available. + example: + path: 'README.md' + result: + allOf: + - $ref: '#/components/schemas/JsonValue' + description: Tool-specific JSON result, when available. + example: + success: + content: '# Project' + totalLines: 1 + fileSize: 9 + path: 'README.md' + truncated: + $ref: '#/components/schemas/RunStreamToolCallTruncation' + + RunStreamToolCallEvent: + type: object + additionalProperties: false + required: + - event + - data + properties: + event: + type: string + enum: ['tool_call'] + id: + type: string + description: SSE event id used with the `Last-Event-ID` resume header. + example: '1713033006000-0' + data: + $ref: '#/components/schemas/RunStreamToolCallData' + CreateAgentRequest: type: object required: @@ -971,6 +1055,7 @@ paths: 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. operationId: streamRun parameters: - $ref: '#/components/parameters/AgentId' @@ -993,6 +1078,17 @@ paths: text/event-stream: schema: type: string + examples: + toolCall: + summary: Tool call events + value: | + id: 1713033005000-0 + event: tool_call + data: {"callId":"call-1","name":"read_file","status":"running","args":{"path":"README.md"}} + + id: 1713033006000-0 + event: tool_call + data: {"callId":"call-1","name":"read_file","status":"completed","args":{"path":"README.md"},"result":{"success":{"content":"# Project","totalLines":1,"fileSize":9,"path":"README.md"}}} '400': $ref: '#/components/responses/BadRequest' '401':