diff --git a/src/libs/Phoenix/Generated/Phoenix.JsonConverters.ChatContext.g.cs b/src/libs/Phoenix/Generated/Phoenix.JsonConverters.ChatContext.g.cs index d454152..9e085d7 100644 --- a/src/libs/Phoenix/Generated/Phoenix.JsonConverters.ChatContext.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.JsonConverters.ChatContext.g.cs @@ -56,6 +56,13 @@ public class ChatContextJsonConverter : global::System.Text.Json.Serialization.J throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Phoenix.PlaygroundContext)}"); playground = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::Phoenix.GraphQLContext? graphql = default; + if (discriminator?.Type == global::Phoenix.ChatContextDiscriminatorType.Graphql) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Phoenix.GraphQLContext), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Phoenix.GraphQLContext)}"); + graphql = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } var __value = new global::Phoenix.ChatContext( discriminator?.Type, @@ -67,7 +74,9 @@ public class ChatContextJsonConverter : global::System.Text.Json.Serialization.J span, - playground + playground, + + graphql ); return __value; @@ -112,6 +121,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Phoenix.PlaygroundContext).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Playground!, typeInfo); } + else if (value.IsGraphql) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Phoenix.GraphQLContext), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Phoenix.GraphQLContext).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Graphql!, typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/Phoenix/Generated/Phoenix.JsonSerializerContext.g.cs b/src/libs/Phoenix/Generated/Phoenix.JsonSerializerContext.g.cs index 2976096..c9de8b9 100644 --- a/src/libs/Phoenix/Generated/Phoenix.JsonSerializerContext.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.JsonSerializerContext.g.cs @@ -434,8 +434,6 @@ namespace Phoenix typeof(global::Phoenix.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.JsonSerializerContextTypes))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.AgentCapabilities))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.AgentSpanContext))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] @@ -510,10 +508,12 @@ namespace Phoenix [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.ProjectContext))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.TraceContext))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.PlaygroundContext))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.GraphQLContext))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.ChatContextDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.ChatContextDiscriminatorType), TypeInfoPropertyName = "ChatContextDiscriminatorType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.ChatRegenerateMessage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.Model), TypeInfoPropertyName = "Model2_3")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.CustomProviderModelSelection))] diff --git a/src/libs/Phoenix/Generated/Phoenix.JsonSerializerContextTypes.g.cs b/src/libs/Phoenix/Generated/Phoenix.JsonSerializerContextTypes.g.cs index 1725c47..a18f3d9 100644 --- a/src/libs/Phoenix/Generated/Phoenix.JsonSerializerContextTypes.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.JsonSerializerContextTypes.g.cs @@ -28,315 +28,315 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Phoenix.AgentCapabilities? Type0 { get; set; } + public global::Phoenix.AgentSpanContext? Type0 { get; set; } /// /// /// - public bool? Type1 { get; set; } + public string? Type1 { get; set; } /// /// /// - public global::Phoenix.AgentSpanContext? Type2 { get; set; } + public object? Type2 { get; set; } /// /// /// - public string? Type3 { get; set; } + public global::Phoenix.AnnotateSessionsRequestBody? Type3 { get; set; } /// /// /// - public object? Type4 { get; set; } + public global::System.Collections.Generic.IList? Type4 { get; set; } /// /// /// - public global::Phoenix.AnnotateSessionsRequestBody? Type5 { get; set; } + public global::Phoenix.SessionAnnotationData? Type5 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type6 { get; set; } + public global::Phoenix.AnnotateSessionsResponseBody? Type6 { get; set; } /// /// /// - public global::Phoenix.SessionAnnotationData? Type7 { get; set; } + public global::System.Collections.Generic.IList? Type7 { get; set; } /// /// /// - public global::Phoenix.AnnotateSessionsResponseBody? Type8 { get; set; } + public global::Phoenix.InsertedSessionAnnotation? Type8 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type9 { get; set; } + public global::Phoenix.AnnotateSpanDocumentsRequestBody? Type9 { get; set; } /// /// /// - public global::Phoenix.InsertedSessionAnnotation? Type10 { get; set; } + public global::System.Collections.Generic.IList? Type10 { get; set; } /// /// /// - public global::Phoenix.AnnotateSpanDocumentsRequestBody? Type11 { get; set; } + public global::Phoenix.SpanDocumentAnnotationData? Type11 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type12 { get; set; } + public global::Phoenix.AnnotateSpanDocumentsResponseBody? Type12 { get; set; } /// /// /// - public global::Phoenix.SpanDocumentAnnotationData? Type13 { get; set; } + public global::System.Collections.Generic.IList? Type13 { get; set; } /// /// /// - public global::Phoenix.AnnotateSpanDocumentsResponseBody? Type14 { get; set; } + public global::Phoenix.InsertedSpanDocumentAnnotation? Type14 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type15 { get; set; } + public global::Phoenix.AnnotateSpansRequestBody? Type15 { get; set; } /// /// /// - public global::Phoenix.InsertedSpanDocumentAnnotation? Type16 { get; set; } + public global::System.Collections.Generic.IList? Type16 { get; set; } /// /// /// - public global::Phoenix.AnnotateSpansRequestBody? Type17 { get; set; } + public global::Phoenix.SpanAnnotationData? Type17 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type18 { get; set; } + public global::Phoenix.AnnotateSpansResponseBody? Type18 { get; set; } /// /// /// - public global::Phoenix.SpanAnnotationData? Type19 { get; set; } + public global::System.Collections.Generic.IList? Type19 { get; set; } /// /// /// - public global::Phoenix.AnnotateSpansResponseBody? Type20 { get; set; } + public global::Phoenix.InsertedSpanAnnotation? Type20 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type21 { get; set; } + public global::Phoenix.AnnotateTracesRequestBody? Type21 { get; set; } /// /// /// - public global::Phoenix.InsertedSpanAnnotation? Type22 { get; set; } + public global::System.Collections.Generic.IList? Type22 { get; set; } /// /// /// - public global::Phoenix.AnnotateTracesRequestBody? Type23 { get; set; } + public global::Phoenix.TraceAnnotationData? Type23 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type24 { get; set; } + public global::Phoenix.AnnotateTracesResponseBody? Type24 { get; set; } /// /// /// - public global::Phoenix.TraceAnnotationData? Type25 { get; set; } + public global::System.Collections.Generic.IList? Type25 { get; set; } /// /// /// - public global::Phoenix.AnnotateTracesResponseBody? Type26 { get; set; } + public global::Phoenix.InsertedTraceAnnotation? Type26 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type27 { get; set; } + public global::Phoenix.AnnotationResult? Type27 { get; set; } /// /// /// - public global::Phoenix.InsertedTraceAnnotation? Type28 { get; set; } + public double? Type28 { get; set; } /// /// /// - public global::Phoenix.AnnotationResult? Type29 { get; set; } + public global::Phoenix.AnonymousUser? Type29 { get; set; } /// /// /// - public double? Type30 { get; set; } + public global::Phoenix.AppContext? Type30 { get; set; } /// /// /// - public global::Phoenix.AnonymousUser? Type31 { get; set; } + public global::Phoenix.AssistantMessageMetadata? Type31 { get; set; } /// /// /// - public global::Phoenix.AppContext? Type32 { get; set; } + public global::Phoenix.AssistantMessageMetadataTraceIds? Type32 { get; set; } /// /// /// - public global::Phoenix.AssistantMessageMetadata? Type33 { get; set; } + public global::Phoenix.AssistantMessageMetadataUsage2? Type33 { get; set; } /// /// /// - public global::Phoenix.AssistantMessageMetadataTraceIds? Type34 { get; set; } + public global::Phoenix.AssistantMessageMetadataUsageTokens? Type34 { get; set; } /// /// /// - public global::Phoenix.AssistantMessageMetadataUsage2? Type35 { get; set; } + public global::Phoenix.AssistantMessageMetadataUsageTokenDetails? Type35 { get; set; } /// /// /// - public global::Phoenix.AssistantMessageMetadataUsageTokens? Type36 { get; set; } + public int? Type36 { get; set; } /// /// /// - public global::Phoenix.AssistantMessageMetadataUsageTokenDetails? Type37 { get; set; } + public global::Phoenix.AssistantMetadataUIMessage? Type37 { get; set; } /// /// /// - public int? Type38 { get; set; } + public global::Phoenix.AssistantMetadataUIMessageRole? Type38 { get; set; } /// /// /// - public global::Phoenix.AssistantMetadataUIMessage? Type39 { get; set; } + public global::Phoenix.TextUIPart? Type39 { get; set; } /// /// /// - public global::Phoenix.AssistantMetadataUIMessageRole? Type40 { get; set; } + public global::Phoenix.ReasoningUIPart? Type40 { get; set; } /// /// /// - public global::Phoenix.TextUIPart? Type41 { get; set; } + public global::Phoenix.ToolInputStreamingPart? Type41 { get; set; } /// /// /// - public global::Phoenix.ReasoningUIPart? Type42 { get; set; } + public global::Phoenix.ToolInputAvailablePart? Type42 { get; set; } /// /// /// - public global::Phoenix.ToolInputStreamingPart? Type43 { get; set; } + public global::Phoenix.ToolOutputAvailablePart? Type43 { get; set; } /// /// /// - public global::Phoenix.ToolInputAvailablePart? Type44 { get; set; } + public global::Phoenix.ToolOutputErrorPart? Type44 { get; set; } /// /// /// - public global::Phoenix.ToolOutputAvailablePart? Type45 { get; set; } + public global::Phoenix.ToolApprovalRequestedPart? Type45 { get; set; } /// /// /// - public global::Phoenix.ToolOutputErrorPart? Type46 { get; set; } + public global::Phoenix.ToolApprovalRespondedPart? Type46 { get; set; } /// /// /// - public global::Phoenix.ToolApprovalRequestedPart? Type47 { get; set; } + public global::Phoenix.ToolOutputDeniedPart? Type47 { get; set; } /// /// /// - public global::Phoenix.ToolApprovalRespondedPart? Type48 { get; set; } + public global::Phoenix.DynamicToolInputStreamingPart? Type48 { get; set; } /// /// /// - public global::Phoenix.ToolOutputDeniedPart? Type49 { get; set; } + public global::Phoenix.DynamicToolInputAvailablePart? Type49 { get; set; } /// /// /// - public global::Phoenix.DynamicToolInputStreamingPart? Type50 { get; set; } + public global::Phoenix.DynamicToolOutputAvailablePart? Type50 { get; set; } /// /// /// - public global::Phoenix.DynamicToolInputAvailablePart? Type51 { get; set; } + public global::Phoenix.DynamicToolOutputErrorPart? Type51 { get; set; } /// /// /// - public global::Phoenix.DynamicToolOutputAvailablePart? Type52 { get; set; } + public global::Phoenix.DynamicToolApprovalRequestedPart? Type52 { get; set; } /// /// /// - public global::Phoenix.DynamicToolOutputErrorPart? Type53 { get; set; } + public global::Phoenix.DynamicToolApprovalRespondedPart? Type53 { get; set; } /// /// /// - public global::Phoenix.DynamicToolApprovalRequestedPart? Type54 { get; set; } + public global::Phoenix.DynamicToolOutputDeniedPart? Type54 { get; set; } /// /// /// - public global::Phoenix.DynamicToolApprovalRespondedPart? Type55 { get; set; } + public global::Phoenix.SourceUrlUIPart? Type55 { get; set; } /// /// /// - public global::Phoenix.DynamicToolOutputDeniedPart? Type56 { get; set; } + public global::Phoenix.SourceDocumentUIPart? Type56 { get; set; } /// /// /// - public global::Phoenix.SourceUrlUIPart? Type57 { get; set; } + public global::Phoenix.FileUIPart? Type57 { get; set; } /// /// /// - public global::Phoenix.SourceDocumentUIPart? Type58 { get; set; } + public global::Phoenix.DataUIPart? Type58 { get; set; } /// /// /// - public global::Phoenix.FileUIPart? Type59 { get; set; } + public global::Phoenix.StepStartUIPart? Type59 { get; set; } /// /// /// - public global::Phoenix.DataUIPart? Type60 { get; set; } + public global::Phoenix.BuiltInProviderModelSelection? Type60 { get; set; } /// /// /// - public global::Phoenix.StepStartUIPart? Type61 { get; set; } + public global::Phoenix.ModelProvider? Type61 { get; set; } /// /// /// - public global::Phoenix.BuiltInProviderModelSelection? Type62 { get; set; } + public global::Phoenix.BuiltInProviderModelSelectionOpenaiApiType? Type62 { get; set; } /// /// /// - public global::Phoenix.ModelProvider? Type63 { get; set; } + public global::Phoenix.CategoricalAnnotationConfig? Type63 { get; set; } /// /// /// - public global::Phoenix.BuiltInProviderModelSelectionOpenaiApiType? Type64 { get; set; } + public global::Phoenix.OptimizationDirection? Type64 { get; set; } /// /// /// - public global::Phoenix.CategoricalAnnotationConfig? Type65 { get; set; } + public global::System.Collections.Generic.IList? Type65 { get; set; } /// /// /// - public global::Phoenix.OptimizationDirection? Type66 { get; set; } + public global::Phoenix.CategoricalAnnotationValue? Type66 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type67 { get; set; } + public global::Phoenix.CategoricalAnnotationConfigData? Type67 { get; set; } /// /// /// - public global::Phoenix.CategoricalAnnotationValue? Type68 { get; set; } + public global::Phoenix.ChatContext? Type68 { get; set; } /// /// /// - public global::Phoenix.CategoricalAnnotationConfigData? Type69 { get; set; } + public global::Phoenix.ProjectContext? Type69 { get; set; } /// /// /// - public global::Phoenix.ChatContext? Type70 { get; set; } + public global::Phoenix.TraceContext? Type70 { get; set; } /// /// /// - public global::Phoenix.ProjectContext? Type71 { get; set; } + public global::Phoenix.PlaygroundContext? Type71 { get; set; } /// /// /// - public global::Phoenix.TraceContext? Type72 { get; set; } + public global::Phoenix.GraphQLContext? Type72 { get; set; } /// /// /// - public global::Phoenix.PlaygroundContext? Type73 { get; set; } + public global::Phoenix.ChatContextDiscriminator? Type73 { get; set; } /// /// /// - public global::Phoenix.ChatContextDiscriminator? Type74 { get; set; } + public global::Phoenix.ChatContextDiscriminatorType? Type74 { get; set; } /// /// /// - public global::Phoenix.ChatContextDiscriminatorType? Type75 { get; set; } + public global::Phoenix.ChatRegenerateMessage? Type75 { get; set; } /// /// /// - public global::Phoenix.ChatRegenerateMessage? Type76 { get; set; } + public global::System.Collections.Generic.IList? Type76 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type77 { get; set; } + public bool? Type77 { get; set; } /// /// /// diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.AgentCapabilities.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.AgentCapabilities.g.cs deleted file mode 100644 index c3e9cd7..0000000 --- a/src/libs/Phoenix/Generated/Phoenix.Models.AgentCapabilities.g.cs +++ /dev/null @@ -1,68 +0,0 @@ - -#nullable enable - -namespace Phoenix -{ - /// - /// Runtime capability state sent by the browser for a chat turn. - /// - public sealed partial class AgentCapabilities - { - /// - /// Default Value: false - /// - [global::System.Text.Json.Serialization.JsonPropertyName("bash.retainInactiveSessions")] - public bool? BashRetainInactiveSessions { get; set; } - - /// - /// Default Value: false - /// - [global::System.Text.Json.Serialization.JsonPropertyName("graphql.mutations")] - public bool? GraphqlMutations { get; set; } - - /// - /// Default Value: false - /// - [global::System.Text.Json.Serialization.JsonPropertyName("session.storeSessions")] - public bool? SessionStoreSessions { 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. - /// - /// - /// Default Value: false - /// - /// - /// Default Value: false - /// - /// - /// Default Value: false - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public AgentCapabilities( - bool? bashRetainInactiveSessions, - bool? graphqlMutations, - bool? sessionStoreSessions) - { - this.BashRetainInactiveSessions = bashRetainInactiveSessions; - this.GraphqlMutations = graphqlMutations; - this.SessionStoreSessions = sessionStoreSessions; - } - - /// - /// Initializes a new instance of the class. - /// - public AgentCapabilities() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ChatContext.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ChatContext.g.cs index 4cb9751..1f821d9 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ChatContext.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ChatContext.g.cs @@ -5,10 +5,7 @@ namespace Phoenix { /// - /// Discriminated union of every UI-state context the agent understands.
- /// Wrapped in ``RootModel`` so the generated OpenAPI schema exposes a single
- /// named ``ChatContext`` component instead of inlining the ``oneOf`` at every
- /// reference site. The actual member is accessible via ``.root``. + /// Discriminated union of every UI-state context the agent understands. ///
public readonly partial struct ChatContext : global::System.IEquatable { @@ -211,6 +208,46 @@ public bool TryPickPlayground( public global::Phoenix.PlaygroundContext PickPlayground() => IsPlayground ? Playground! : throw new global::System.InvalidOperationException($"Expected union variant 'Playground' but the value was {ToString()}."); + + /// + /// GraphQL runtime state.
+ /// Unlike the other contexts this one always emits a block — when no instance
+ /// is present the policy defaults to ``disabled`` (the safe default). Callers
+ /// in the absent case should use :meth:`render_disabled_default`. + ///
+#if NET6_0_OR_GREATER + public global::Phoenix.GraphQLContext? Graphql { get; init; } +#else + public global::Phoenix.GraphQLContext? Graphql { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Graphql))] +#endif + public bool IsGraphql => Graphql != null; + + /// + /// + /// + public bool TryPickGraphql( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Phoenix.GraphQLContext? value) + { + value = Graphql; + return IsGraphql; + } + + /// + /// + /// + public global::Phoenix.GraphQLContext PickGraphql() => IsGraphql + ? Graphql! + : throw new global::System.InvalidOperationException($"Expected union variant 'Graphql' but the value was {ToString()}."); /// /// /// @@ -326,6 +363,29 @@ public ChatContext(global::Phoenix.PlaygroundContext? value) /// public static ChatContext FromPlayground(global::Phoenix.PlaygroundContext? value) => new ChatContext(value); + /// + /// + /// + public static implicit operator ChatContext(global::Phoenix.GraphQLContext value) => new ChatContext((global::Phoenix.GraphQLContext?)value); + + /// + /// + /// + public static implicit operator global::Phoenix.GraphQLContext?(ChatContext @this) => @this.Graphql; + + /// + /// + /// + public ChatContext(global::Phoenix.GraphQLContext? value) + { + Graphql = value; + } + + /// + /// + /// + public static ChatContext FromGraphql(global::Phoenix.GraphQLContext? value) => new ChatContext(value); + /// /// /// @@ -335,7 +395,8 @@ public ChatContext( global::Phoenix.ProjectContext? project, global::Phoenix.TraceContext? trace, global::Phoenix.AgentSpanContext? span, - global::Phoenix.PlaygroundContext? playground + global::Phoenix.PlaygroundContext? playground, + global::Phoenix.GraphQLContext? graphql ) { Type = type; @@ -345,12 +406,14 @@ public ChatContext( Trace = trace; Span = span; Playground = playground; + Graphql = graphql; } /// /// /// public object? Object => + Graphql as object ?? Playground as object ?? Span as object ?? Trace as object ?? @@ -366,7 +429,8 @@ App as object Project?.ToString() ?? Trace?.ToString() ?? Span?.ToString() ?? - Playground?.ToString() + Playground?.ToString() ?? + Graphql?.ToString() ; /// @@ -374,7 +438,7 @@ App as object /// public bool Validate() { - return IsApp && !IsProject && !IsTrace && !IsSpan && !IsPlayground || !IsApp && IsProject && !IsTrace && !IsSpan && !IsPlayground || !IsApp && !IsProject && IsTrace && !IsSpan && !IsPlayground || !IsApp && !IsProject && !IsTrace && IsSpan && !IsPlayground || !IsApp && !IsProject && !IsTrace && !IsSpan && IsPlayground; + return IsApp && !IsProject && !IsTrace && !IsSpan && !IsPlayground && !IsGraphql || !IsApp && IsProject && !IsTrace && !IsSpan && !IsPlayground && !IsGraphql || !IsApp && !IsProject && IsTrace && !IsSpan && !IsPlayground && !IsGraphql || !IsApp && !IsProject && !IsTrace && IsSpan && !IsPlayground && !IsGraphql || !IsApp && !IsProject && !IsTrace && !IsSpan && IsPlayground && !IsGraphql || !IsApp && !IsProject && !IsTrace && !IsSpan && !IsPlayground && IsGraphql; } /// @@ -386,6 +450,7 @@ public bool Validate() global::System.Func? trace = null, global::System.Func? span = null, global::System.Func? playground = null, + global::System.Func? graphql = null, bool validate = true) { if (validate) @@ -413,6 +478,10 @@ public bool Validate() { return playground(Playground!); } + else if (IsGraphql && graphql != null) + { + return graphql(Graphql!); + } return default(TResult); } @@ -430,6 +499,8 @@ public void Match( global::System.Action? span = null, global::System.Action? playground = null, + + global::System.Action? graphql = null, bool validate = true) { if (validate) @@ -457,6 +528,10 @@ public void Match( { playground?.Invoke(Playground!); } + else if (IsGraphql) + { + graphql?.Invoke(Graphql!); + } } /// @@ -468,6 +543,7 @@ public void Switch( global::System.Action? trace = null, global::System.Action? span = null, global::System.Action? playground = null, + global::System.Action? graphql = null, bool validate = true) { if (validate) @@ -495,6 +571,10 @@ public void Switch( { playground?.Invoke(Playground!); } + else if (IsGraphql) + { + graphql?.Invoke(Graphql!); + } } /// @@ -514,6 +594,8 @@ public override int GetHashCode() typeof(global::Phoenix.AgentSpanContext), Playground, typeof(global::Phoenix.PlaygroundContext), + Graphql, + typeof(global::Phoenix.GraphQLContext), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -534,7 +616,8 @@ public bool Equals(ChatContext other) global::System.Collections.Generic.EqualityComparer.Default.Equals(Project, other.Project) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Trace, other.Trace) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Span, other.Span) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Playground, other.Playground) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Playground, other.Playground) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Graphql, other.Graphql) ; } diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ChatContextDiscriminatorType.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ChatContextDiscriminatorType.g.cs index 20a5bc6..39699a0 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ChatContextDiscriminatorType.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ChatContextDiscriminatorType.g.cs @@ -15,6 +15,10 @@ public enum ChatContextDiscriminatorType /// /// /// + Graphql, + /// + /// + /// Playground, /// /// @@ -43,6 +47,7 @@ public static string ToValueString(this ChatContextDiscriminatorType value) return value switch { ChatContextDiscriminatorType.App => "app", + ChatContextDiscriminatorType.Graphql => "graphql", ChatContextDiscriminatorType.Playground => "playground", ChatContextDiscriminatorType.Project => "project", ChatContextDiscriminatorType.Span => "span", @@ -58,6 +63,7 @@ public static string ToValueString(this ChatContextDiscriminatorType value) return value switch { "app" => ChatContextDiscriminatorType.App, + "graphql" => ChatContextDiscriminatorType.Graphql, "playground" => ChatContextDiscriminatorType.Playground, "project" => ChatContextDiscriminatorType.Project, "span" => ChatContextDiscriminatorType.Span, diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ChatRegenerateMessage.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ChatRegenerateMessage.g.cs index fc19711..fd8ca49 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ChatRegenerateMessage.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ChatRegenerateMessage.g.cs @@ -53,12 +53,6 @@ public sealed partial class ChatRegenerateMessage [global::System.Text.Json.Serialization.JsonPropertyName("contexts")] public global::System.Collections.Generic.IList? Contexts { get; set; } - /// - /// Runtime capability state sent by the browser for a chat turn. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("capabilities")] - public global::Phoenix.AgentCapabilities? Capabilities { get; set; } - /// /// /// @@ -87,9 +81,6 @@ public sealed partial class ChatRegenerateMessage /// Default Value: false /// /// - /// - /// Runtime capability state sent by the browser for a chat turn. - /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -102,7 +93,6 @@ public ChatRegenerateMessage( bool? ingestTraces, bool? exportRemoteTraces, global::System.Collections.Generic.IList? contexts, - global::Phoenix.AgentCapabilities? capabilities, string trigger = "regenerate-message") { this.Trigger = trigger; @@ -112,7 +102,6 @@ public ChatRegenerateMessage( this.IngestTraces = ingestTraces; this.ExportRemoteTraces = exportRemoteTraces; this.Contexts = contexts; - this.Capabilities = capabilities; this.Model = model; } diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.ChatSubmitMessage.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.ChatSubmitMessage.g.cs index c4e1d47..97c806a 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.ChatSubmitMessage.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.ChatSubmitMessage.g.cs @@ -46,12 +46,6 @@ public sealed partial class ChatSubmitMessage [global::System.Text.Json.Serialization.JsonPropertyName("contexts")] public global::System.Collections.Generic.IList? Contexts { get; set; } - /// - /// Runtime capability state sent by the browser for a chat turn. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("capabilities")] - public global::Phoenix.AgentCapabilities? Capabilities { get; set; } - /// /// /// @@ -82,9 +76,6 @@ public sealed partial class ChatSubmitMessage /// Default Value: false /// /// - /// - /// Runtime capability state sent by the browser for a chat turn. - /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -95,8 +86,7 @@ public ChatSubmitMessage( string? trigger, bool? ingestTraces, bool? exportRemoteTraces, - global::System.Collections.Generic.IList? contexts, - global::Phoenix.AgentCapabilities? capabilities) + global::System.Collections.Generic.IList? contexts) { this.Trigger = trigger; this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); @@ -104,7 +94,6 @@ public ChatSubmitMessage( this.IngestTraces = ingestTraces; this.ExportRemoteTraces = exportRemoteTraces; this.Contexts = contexts; - this.Capabilities = capabilities; this.Model = model; } diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.AgentCapabilities.Json.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.GraphQLContext.Json.g.cs similarity index 87% rename from src/libs/Phoenix/Generated/Phoenix.Models.AgentCapabilities.Json.g.cs rename to src/libs/Phoenix/Generated/Phoenix.Models.GraphQLContext.Json.g.cs index 11e4b3e..04f5a41 100644 --- a/src/libs/Phoenix/Generated/Phoenix.Models.AgentCapabilities.Json.g.cs +++ b/src/libs/Phoenix/Generated/Phoenix.Models.GraphQLContext.Json.g.cs @@ -2,7 +2,7 @@ namespace Phoenix { - public sealed partial class AgentCapabilities + public sealed partial class GraphQLContext { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Phoenix.AgentCapabilities? FromJson( + public static global::Phoenix.GraphQLContext? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Phoenix.AgentCapabilities), - jsonSerializerContext) as global::Phoenix.AgentCapabilities; + typeof(global::Phoenix.GraphQLContext), + jsonSerializerContext) as global::Phoenix.GraphQLContext; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Phoenix.AgentCapabilities? FromJson( + public static global::Phoenix.GraphQLContext? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Phoenix.AgentCapabilities), - jsonSerializerContext).ConfigureAwait(false)) as global::Phoenix.AgentCapabilities; + typeof(global::Phoenix.GraphQLContext), + jsonSerializerContext).ConfigureAwait(false)) as global::Phoenix.GraphQLContext; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Phoenix/Generated/Phoenix.Models.GraphQLContext.g.cs b/src/libs/Phoenix/Generated/Phoenix.Models.GraphQLContext.g.cs new file mode 100644 index 0000000..5898479 --- /dev/null +++ b/src/libs/Phoenix/Generated/Phoenix.Models.GraphQLContext.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Phoenix +{ + /// + /// GraphQL runtime state.
+ /// Unlike the other contexts this one always emits a block — when no instance
+ /// is present the policy defaults to ``disabled`` (the safe default). Callers
+ /// in the absent case should use :meth:`render_disabled_default`. + ///
+ public sealed partial class GraphQLContext + { + /// + /// + /// + /// "graphql" + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = "graphql"; + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mutationsEnabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool MutationsEnabled { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GraphQLContext( + bool mutationsEnabled, + string type = "graphql") + { + this.Type = type; + this.MutationsEnabled = mutationsEnabled; + } + + /// + /// Initializes a new instance of the class. + /// + public GraphQLContext() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static GraphQLContext FromMutationsEnabled(bool mutationsEnabled) + { + return new GraphQLContext + { + MutationsEnabled = mutationsEnabled, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/Phoenix/openapi.json b/src/libs/Phoenix/openapi.json index 9bc6b42..878d374 100644 --- a/src/libs/Phoenix/openapi.json +++ b/src/libs/Phoenix/openapi.json @@ -6663,28 +6663,6 @@ }, "components": { "schemas": { - "AgentCapabilities": { - "properties": { - "bash.retainInactiveSessions": { - "type": "boolean", - "title": "Bash.Retaininactivesessions", - "default": false - }, - "graphql.mutations": { - "type": "boolean", - "title": "Graphql.Mutations", - "default": false - }, - "session.storeSessions": { - "type": "boolean", - "title": "Session.Storesessions", - "default": false - } - }, - "type": "object", - "title": "AgentCapabilities", - "description": "Runtime capability state sent by the browser for a chat turn." - }, "AgentSpanContext": { "properties": { "type": { @@ -7327,14 +7305,18 @@ }, { "$ref": "#/components/schemas/PlaygroundContext" + }, + { + "$ref": "#/components/schemas/GraphQLContext" } ], "title": "ChatContext", - "description": "Discriminated union of every UI-state context the agent understands.\n\nWrapped in ``RootModel`` so the generated OpenAPI schema exposes a single\nnamed ``ChatContext`` component instead of inlining the ``oneOf`` at every\nreference site. The actual member is accessible via ``.root``.", + "description": "Discriminated union of every UI-state context the agent understands.", "discriminator": { "propertyName": "type", "mapping": { "app": "#/components/schemas/AppContext", + "graphql": "#/components/schemas/GraphQLContext", "playground": "#/components/schemas/PlaygroundContext", "project": "#/components/schemas/ProjectContext", "span": "#/components/schemas/AgentSpanContext", @@ -7388,9 +7370,6 @@ "type": "array", "title": "Contexts" }, - "capabilities": { - "$ref": "#/components/schemas/AgentCapabilities" - }, "model": { "oneOf": [ { @@ -7476,9 +7455,6 @@ "type": "array", "title": "Contexts" }, - "capabilities": { - "$ref": "#/components/schemas/AgentCapabilities" - }, "model": { "oneOf": [ { @@ -9634,6 +9610,26 @@ ], "title": "GetViewerResponseBody" }, + "GraphQLContext": { + "properties": { + "type": { + "type": "string", + "const": "graphql", + "title": "Type" + }, + "mutationsEnabled": { + "type": "boolean", + "title": "Mutationsenabled" + } + }, + "type": "object", + "required": [ + "type", + "mutationsEnabled" + ], + "title": "GraphQLContext", + "description": "GraphQL runtime state.\n\nUnlike the other contexts this one always emits a block — when no instance\nis present the policy defaults to ``disabled`` (the safe default). Callers\nin the absent case should use :meth:`render_disabled_default`." + }, "HTTPValidationError": { "properties": { "detail": {