From 12e4016444999ea1c4b1150b1f08d25311ddc0e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 22:37:42 +0000 Subject: [PATCH 1/3] Update @github/copilot to 1.0.81-12 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code --- dotnet/src/Generated/Rpc.cs | 33 +- dotnet/src/Generated/SessionEvents.cs | 1167 ++++++++++++++++- go/rpc/zrpc.go | 13 +- go/rpc/zsession_encoding.go | 42 + go/rpc/zsession_events.go | 462 ++++++- go/zsession_events.go | 46 + java/pom.xml | 2 +- java/scripts/codegen/package-lock.json | 72 +- java/scripts/codegen/package.json | 2 +- .../AssistantFusionPhaseCompletedEvent.java | 67 + .../AssistantFusionPhaseFailedEvent.java | 63 + .../AssistantFusionPhaseStartedEvent.java | 53 + .../generated/AssistantMessageEvent.java | 4 +- .../generated/AssistantUsageEvent.java | 4 +- .../copilot/generated/FusionAttribution.java | 47 + .../generated/FusionConversationScope.java | 35 + .../generated/FusionFollowUpAction.java | 35 + .../FusionFollowUpRecommendation.java | 29 + .../copilot/generated/FusionPattern.java | 37 + .../copilot/generated/FusionPhaseKind.java | 45 + .../copilot/generated/FusionPhaseStatus.java | 37 + .../copilot/generated/FusionPhaseUsage.java | 37 + .../generated/FusionProjectionMode.java | 37 + .../copilot/generated/FusionScores.java | 33 + .../generated/FusionStagedTerminal.java | 30 + .../copilot/generated/FusionTurnKind.java | 35 + .../generated/ModelCallFailureEvent.java | 4 +- .../generated/ModelCallStartEvent.java | 4 +- .../copilot/generated/SessionEvent.java | 14 + .../SessionFusionCompletedEvent.java | 75 ++ .../generated/SessionFusionResolvedEvent.java | 79 ++ .../SessionFusionRouteFailedEvent.java | 53 + .../SessionFusionRouteStartedEvent.java | 47 + .../generated/ToolExecutionCompleteEvent.java | 4 +- .../generated/ToolExecutionStartEvent.java | 4 +- ...ssionToolsGetBuiltinDescriptorsParams.java | 4 - nodejs/package-lock.json | 54 +- nodejs/package.json | 2 +- nodejs/samples/package-lock.json | 2 +- nodejs/src/generated/rpc.ts | 12 +- nodejs/src/generated/session-events.ts | 788 +++++++++++ python/copilot/generated/rpc.py | 23 +- python/copilot/generated/session_events.py | 823 +++++++++++- rust/src/generated/api_types.rs | 9 +- rust/src/generated/session_events.rs | 769 +++++++++++ test/harness/package-lock.json | 54 +- test/harness/package.json | 2 +- 47 files changed, 5126 insertions(+), 167 deletions(-) create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseCompletedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseFailedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseStartedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionAttribution.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionConversationScope.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionFollowUpAction.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionFollowUpRecommendation.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionPattern.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseKind.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseStatus.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseUsage.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionProjectionMode.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionScores.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionStagedTerminal.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/FusionTurnKind.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionCompletedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionResolvedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionRouteFailedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionRouteStartedEvent.java diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index ba8b844d83..2903338ee1 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -12222,10 +12222,6 @@ internal sealed class ToolsGetBuiltinDescriptorsRequest [JsonPropertyName("includeAuthor")] public bool? IncludeAuthor { get; set; } - /// Whether line numbers should be omitted from the view tool descriptor. - [JsonPropertyName("noViewLineNumbers")] - public bool? NoViewLineNumbers { get; set; } - /// Whether descriptors should favor fewer user-intervention prompts. [JsonPropertyName("reduceUserIntervention")] public bool? ReduceUserIntervention { get; set; } @@ -12234,10 +12230,6 @@ internal sealed class ToolsGetBuiltinDescriptorsRequest [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; - /// Whether shell commands may only run asynchronously. - [JsonPropertyName("shellAsyncOnlyEnabled")] - public bool? ShellAsyncOnlyEnabled { get; set; } - /// Shell-specific names and description lines for shell tools. [JsonPropertyName("shellConfig")] public ToolsShellDescriptorConfig? ShellConfig { get; set; } @@ -12383,6 +12375,11 @@ public partial class ExternalToolTextResultForLlmContentShellExit : ExternalTool [JsonPropertyName("exitCode")] public required long ExitCode { get; set; } + /// Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("outputFilePath")] + public string? OutputFilePath { get; set; } + /// Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("outputPreview")] @@ -33403,22 +33400,20 @@ public async Task ExecuteAsync(string name, object arguments, strin } /// Returns the Rust-owned built-in tool descriptors used to construct the session's offered tool set. - /// Whether line numbers should be omitted from the view tool descriptor. /// Whether descriptors should favor fewer user-intervention prompts. /// Whether tool descriptors should include authoring metadata. /// Whether semantic skill lookup is available. /// Shell-specific names and description lines for shell tools. - /// Whether shell commands may only run asynchronously. /// Whether the configured shell supports PowerShell 7 syntax. /// Default shell timeout in milliseconds. /// Whether background task completion notifications are enabled. /// The to monitor for cancellation requests. The default is . /// Rust-owned built-in tool descriptors for the session. - public async Task GetBuiltinDescriptorsAsync(bool? noViewLineNumbers = null, bool? reduceUserIntervention = null, bool? includeAuthor = null, bool? skillEmbeddingEnabled = null, ToolsShellDescriptorConfig? shellConfig = null, bool? shellAsyncOnlyEnabled = null, bool? shellSupportsPowerShell7Syntax = null, double? shellTimeoutMs = null, bool? backgroundTaskNotificationsEnabled = null, CancellationToken cancellationToken = default) + public async Task GetBuiltinDescriptorsAsync(bool? reduceUserIntervention = null, bool? includeAuthor = null, bool? skillEmbeddingEnabled = null, ToolsShellDescriptorConfig? shellConfig = null, bool? shellSupportsPowerShell7Syntax = null, double? shellTimeoutMs = null, bool? backgroundTaskNotificationsEnabled = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); - var request = new ToolsGetBuiltinDescriptorsRequest { SessionId = _session.SessionId, NoViewLineNumbers = noViewLineNumbers, ReduceUserIntervention = reduceUserIntervention, IncludeAuthor = includeAuthor, SkillEmbeddingEnabled = skillEmbeddingEnabled, ShellConfig = shellConfig, ShellAsyncOnlyEnabled = shellAsyncOnlyEnabled, ShellSupportsPowerShell7Syntax = shellSupportsPowerShell7Syntax, ShellTimeoutMs = shellTimeoutMs, BackgroundTaskNotificationsEnabled = backgroundTaskNotificationsEnabled }; + var request = new ToolsGetBuiltinDescriptorsRequest { SessionId = _session.SessionId, ReduceUserIntervention = reduceUserIntervention, IncludeAuthor = includeAuthor, SkillEmbeddingEnabled = skillEmbeddingEnabled, ShellConfig = shellConfig, ShellSupportsPowerShell7Syntax = shellSupportsPowerShell7Syntax, ShellTimeoutMs = shellTimeoutMs, BackgroundTaskNotificationsEnabled = backgroundTaskNotificationsEnabled }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tools.getBuiltinDescriptors", [request], cancellationToken); } @@ -35472,6 +35467,9 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.AgentInterruptedCancelPhase), TypeInfoPropertyName = "SessionEventsAgentInterruptedCancelPhase")] [JsonSerializable(typeof(GitHub.Copilot.AgentInterruptedData), TypeInfoPropertyName = "SessionEventsAgentInterruptedData")] [JsonSerializable(typeof(GitHub.Copilot.AgentInterruptedEvent), TypeInfoPropertyName = "SessionEventsAgentInterruptedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.AssistantFusionPhaseCompletedEvent), TypeInfoPropertyName = "SessionEventsAssistantFusionPhaseCompletedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.AssistantFusionPhaseFailedEvent), TypeInfoPropertyName = "SessionEventsAssistantFusionPhaseFailedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.AssistantFusionPhaseStartedEvent), TypeInfoPropertyName = "SessionEventsAssistantFusionPhaseStartedEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantIdleData), TypeInfoPropertyName = "SessionEventsAssistantIdleData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantIdleEvent), TypeInfoPropertyName = "SessionEventsAssistantIdleEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantIntentData), TypeInfoPropertyName = "SessionEventsAssistantIntentData")] @@ -35603,6 +35601,17 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.FactoryRunStartedEvent), TypeInfoPropertyName = "SessionEventsFactoryRunStartedEvent")] [JsonSerializable(typeof(GitHub.Copilot.FactoryRunUpdatedData), TypeInfoPropertyName = "SessionEventsFactoryRunUpdatedData")] [JsonSerializable(typeof(GitHub.Copilot.FactoryRunUpdatedEvent), TypeInfoPropertyName = "SessionEventsFactoryRunUpdatedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.FusionAttribution), TypeInfoPropertyName = "SessionEventsFusionAttribution")] +[JsonSerializable(typeof(GitHub.Copilot.FusionConversationScope), TypeInfoPropertyName = "SessionEventsFusionConversationScope")] +[JsonSerializable(typeof(GitHub.Copilot.FusionFollowUpAction), TypeInfoPropertyName = "SessionEventsFusionFollowUpAction")] +[JsonSerializable(typeof(GitHub.Copilot.FusionFollowUpRecommendation), TypeInfoPropertyName = "SessionEventsFusionFollowUpRecommendation")] +[JsonSerializable(typeof(GitHub.Copilot.FusionPattern), TypeInfoPropertyName = "SessionEventsFusionPattern")] +[JsonSerializable(typeof(GitHub.Copilot.FusionPhaseKind), TypeInfoPropertyName = "SessionEventsFusionPhaseKind")] +[JsonSerializable(typeof(GitHub.Copilot.FusionPhaseStatus), TypeInfoPropertyName = "SessionEventsFusionPhaseStatus")] +[JsonSerializable(typeof(GitHub.Copilot.FusionPhaseUsage), TypeInfoPropertyName = "SessionEventsFusionPhaseUsage")] +[JsonSerializable(typeof(GitHub.Copilot.FusionProjectionMode), TypeInfoPropertyName = "SessionEventsFusionProjectionMode")] +[JsonSerializable(typeof(GitHub.Copilot.FusionScores), TypeInfoPropertyName = "SessionEventsFusionScores")] +[JsonSerializable(typeof(GitHub.Copilot.FusionTurnKind), TypeInfoPropertyName = "SessionEventsFusionTurnKind")] [JsonSerializable(typeof(GitHub.Copilot.GitHubMcpToolConfig), TypeInfoPropertyName = "SessionEventsGitHubMcpToolConfig")] [JsonSerializable(typeof(GitHub.Copilot.GitHubRepoRef), TypeInfoPropertyName = "SessionEventsGitHubRepoRef")] [JsonSerializable(typeof(GitHub.Copilot.HandoffRepository), TypeInfoPropertyName = "SessionEventsHandoffRepository")] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index bb2f3f9979..55736fee20 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -26,6 +26,9 @@ namespace GitHub.Copilot; IgnoreUnrecognizedTypeDiscriminators = true)] [JsonDerivedType(typeof(AbortEvent), "abort")] [JsonDerivedType(typeof(AgentInterruptedEvent), "agent.interrupted")] +[JsonDerivedType(typeof(AssistantFusionPhaseCompletedEvent), "assistant.fusion_phase_completed")] +[JsonDerivedType(typeof(AssistantFusionPhaseFailedEvent), "assistant.fusion_phase_failed")] +[JsonDerivedType(typeof(AssistantFusionPhaseStartedEvent), "assistant.fusion_phase_started")] [JsonDerivedType(typeof(AssistantIdleEvent), "assistant.idle")] [JsonDerivedType(typeof(AssistantIntentEvent), "assistant.intent")] [JsonDerivedType(typeof(AssistantMessageEvent), "assistant.message")] @@ -98,6 +101,10 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionErrorEvent), "session.error")] [JsonDerivedType(typeof(SessionExtensionsLoadedEvent), "session.extensions_loaded")] [JsonDerivedType(typeof(SessionExtensionsAttachmentsPushedEvent), "session.extensions.attachments_pushed")] +[JsonDerivedType(typeof(SessionFusionCompletedEvent), "session.fusion_completed")] +[JsonDerivedType(typeof(SessionFusionResolvedEvent), "session.fusion_resolved")] +[JsonDerivedType(typeof(SessionFusionRouteFailedEvent), "session.fusion_route_failed")] +[JsonDerivedType(typeof(SessionFusionRouteStartedEvent), "session.fusion_route_started")] [JsonDerivedType(typeof(SessionHandoffEvent), "session.handoff")] [JsonDerivedType(typeof(SessionIdleEvent), "session.idle")] [JsonDerivedType(typeof(SessionInfoEvent), "session.info")] @@ -579,6 +586,62 @@ public sealed partial class SessionTaskCompleteEvent : SessionEvent public required SessionTaskCompleteData Data { get; set; } } +/// Experimental transient signal that HydraFusion routing has started for an eligible turn. +/// Represents the session.fusion_route_started event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionFusionRouteStartedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.fusion_route_started"; + + /// The session.fusion_route_started event payload. + [JsonPropertyName("data")] + public required SessionFusionRouteStartedData Data { get; set; } +} + +/// Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. +/// Represents the session.fusion_route_failed event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionFusionRouteFailedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.fusion_route_failed"; + + /// The session.fusion_route_failed event payload. + [JsonPropertyName("data")] + public required SessionFusionRouteFailedData Data { get; set; } +} + +/// Experimental durable validated HydraFusion route and turn policy. +/// Represents the session.fusion_resolved event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionFusionResolvedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.fusion_resolved"; + + /// The session.fusion_resolved event payload. + [JsonPropertyName("data")] + public required SessionFusionResolvedData Data { get; set; } +} + +/// Experimental durable aggregate outcome of a HydraFusion turn. +/// Represents the session.fusion_completed event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionFusionCompletedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.fusion_completed"; + + /// The session.fusion_completed event payload. + [JsonPropertyName("data")] + public required SessionFusionCompletedData Data { get; set; } +} + /// Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs. /// Represents the user.message event. public sealed partial class UserMessageEvent : SessionEvent @@ -657,6 +720,48 @@ public sealed partial class AssistantIntentEvent : SessionEvent public required AssistantIntentData Data { get; set; } } +/// Experimental transient HydraFusion phase/model/role signal. +/// Represents the assistant.fusion_phase_started event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class AssistantFusionPhaseStartedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "assistant.fusion_phase_started"; + + /// The assistant.fusion_phase_started event payload. + [JsonPropertyName("data")] + public required AssistantFusionPhaseStartedData Data { get; set; } +} + +/// Experimental durable HydraFusion phase output and lossless replay checkpoint. +/// Represents the assistant.fusion_phase_completed event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class AssistantFusionPhaseCompletedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "assistant.fusion_phase_completed"; + + /// The assistant.fusion_phase_completed event payload. + [JsonPropertyName("data")] + public required AssistantFusionPhaseCompletedData Data { get; set; } +} + +/// Experimental durable typed HydraFusion phase failure and degradation transition. +/// Represents the assistant.fusion_phase_failed event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class AssistantFusionPhaseFailedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "assistant.fusion_phase_failed"; + + /// The assistant.fusion_phase_failed event payload. + [JsonPropertyName("data")] + public required AssistantFusionPhaseFailedData Data { get; set; } +} + /// Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message. /// Represents the assistant.server_tool_progress event. public sealed partial class AssistantServerToolProgressEvent : SessionEvent @@ -2732,6 +2837,237 @@ public sealed partial class SessionTaskCompleteData public string? Summary { get; set; } } +/// Experimental transient signal that HydraFusion routing has started for an eligible turn. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionFusionRouteStartedData +{ + /// Identifier for this routing attempt before a durable Fusion turn exists. + [JsonPropertyName("attemptId")] + public required string AttemptId { get; set; } + + /// HydraFusion routing policy requested for the turn. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("policy")] + public string? Policy { get; set; } + + /// Synthetic HydraFusion model selected for the session. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("syntheticModel")] + public string? SyntheticModel { get; set; } + + /// Kind of turn being routed. + [JsonPropertyName("turnKind")] + public required FusionTurnKind TurnKind { get; set; } +} + +/// Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionFusionRouteFailedData +{ + /// Identifier of the routing attempt that failed. + [JsonPropertyName("attemptId")] + public required string AttemptId { get; set; } + + /// Provider or validation error detail, when available. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// Concrete model selected as the deterministic fallback. + [JsonPropertyName("fallbackModel")] + public required string FallbackModel { get; set; } + + /// HydraFusion routing policy requested for the turn. + [JsonPropertyName("policy")] + public required string Policy { get; set; } + + /// Stable machine-readable reason for the routing failure. + [JsonPropertyName("reason")] + public required string Reason { get; set; } + + /// Elapsed routing time in milliseconds before the failure. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("routingLatencyMs")] + public double? RoutingLatencyMs { get; set; } + + /// Synthetic HydraFusion model selected for the session. + [JsonPropertyName("syntheticModel")] + public required string SyntheticModel { get; set; } +} + +/// Experimental durable validated HydraFusion route and turn policy. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionFusionResolvedData +{ + /// Version of the validated HydraFusion event contract. + [JsonPropertyName("contractVersion")] + public required long ContractVersion { get; set; } + + /// Concrete model used when the planned primary model cannot execute. + [JsonPropertyName("fallbackModel")] + public required string FallbackModel { get; set; } + + /// Router recommendation controlling reuse or rerouting on later turns. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("followUp")] + public FusionFollowUpRecommendation? FollowUp { get; set; } + + /// Concrete model recommended for eligible follow-up turns. + [JsonPropertyName("followUpModel")] + public required string FollowUpModel { get; set; } + + /// Stable identifier for the resolved HydraFusion turn. + [JsonPropertyName("fusionId")] + public required string FusionId { get; set; } + + /// Version of the executable model universe used for selection. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("modelUniverseVersion")] + public string? ModelUniverseVersion { get; set; } + + /// Validated orchestration pattern selected for the turn. + [JsonPropertyName("pattern")] + public required FusionPattern Pattern { get; set; } + + /// Version of the validated execution-plan format. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("planVersion")] + public string? PlanVersion { get; set; } + + /// HydraFusion routing policy used to resolve the plan. + [JsonPropertyName("policy")] + public required string Policy { get; set; } + + /// Version of the local routing policy. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("policyVersion")] + public string? PolicyVersion { get; set; } + + /// Concrete model selected for the primary solver phase. + [JsonPropertyName("primaryModel")] + public required string PrimaryModel { get; set; } + + /// Router implementation that supplied the plan. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("routeSource")] + public string? RouteSource { get; set; } + + /// Elapsed time in milliseconds required to resolve and validate the route. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("routingLatencyMs")] + public double? RoutingLatencyMs { get; set; } + + /// Identifier of the local policy rule that matched. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("ruleId")] + public string? RuleId { get; set; } + + /// Zero-based index of the local policy rule that matched. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("ruleIndex")] + public long? RuleIndex { get; set; } + + /// Human-readable name of the local policy rule that matched. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("ruleName")] + public string? RuleName { get; set; } + + /// Validated capability scores used to select the route. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("scores")] + public FusionScores? Scores { get; set; } + + /// Concrete model selected for the review or judge phase, when required. + [JsonPropertyName("secondaryModel")] + public string? SecondaryModel { get; set; } + + /// Synthetic HydraFusion model selected for the session. + [JsonPropertyName("syntheticModel")] + public required string SyntheticModel { get; set; } + + /// Identifier of the session turn associated with the route. + [JsonPropertyName("turnId")] + public required string TurnId { get; set; } +} + +/// Experimental durable aggregate outcome of a HydraFusion turn. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionFusionCompletedData +{ + /// Total cached input tokens reported across all phases. + [JsonPropertyName("cachedTokens")] + public required long CachedTokens { get; set; } + + /// Total tokens written to prompt cache across all phases. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("cacheWriteTokens")] + public long? CacheWriteTokens { get; set; } + + /// Idempotency identifier for the authoritative final commit. + [JsonPropertyName("commitId")] + public required string CommitId { get; set; } + + /// Reason the turn used a degraded route, when applicable. + [JsonPropertyName("degradedReason")] + public string? DegradedReason { get; set; } + + /// Total elapsed execution time for the HydraFusion turn in milliseconds. + [JsonPropertyName("durationMs")] + public required double DurationMs { get; set; } + + /// Concrete model that supplied the authoritative final content. + [JsonPropertyName("finalSourceModel")] + public string? FinalSourceModel { get; set; } + + /// Phase whose output supplied the authoritative final content. + [JsonPropertyName("finalSourcePhaseId")] + public string? FinalSourcePhaseId { get; set; } + + /// Concrete model recommended for eligible follow-up turns. + [JsonPropertyName("followUpModel")] + public required string FollowUpModel { get; set; } + + /// Stable identifier for the completed HydraFusion turn. + [JsonPropertyName("fusionId")] + public required string FusionId { get; set; } + + /// Total input tokens consumed across all phases. + [JsonPropertyName("inputTokens")] + public required long InputTokens { get; set; } + + /// Stable aggregate outcome of the HydraFusion turn. + [JsonPropertyName("outcome")] + public required string Outcome { get; set; } + + /// Total output tokens produced across all phases. + [JsonPropertyName("outputTokens")] + public required long OutputTokens { get; set; } + + /// HydraFusion orchestration pattern executed for the turn. + [JsonPropertyName("pattern")] + public required FusionPattern Pattern { get; set; } + + /// Number of concrete phases attempted by the turn. + [JsonPropertyName("phaseCount")] + public required long PhaseCount { get; set; } + + /// Total concrete model requests made across all phases. + [JsonPropertyName("requestCount")] + public required long RequestCount { get; set; } + + /// Synthetic HydraFusion model selected for the session. + [JsonPropertyName("syntheticModel")] + public required string SyntheticModel { get; set; } + + /// Total normalized AI-unit cost reported across all phases, in nano-AIU. + [JsonPropertyName("totalNanoAiu")] + public required double TotalNanoAiu { get; set; } + + /// Identifier of the session turn associated with the completion. + [JsonPropertyName("turnId")] + public required string TurnId { get; set; } +} + /// Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs. public sealed partial class UserMessageData { @@ -2912,6 +3248,161 @@ public sealed partial class AssistantIntentData public required string Intent { get; set; } } +/// Experimental transient HydraFusion phase/model/role signal. +[Experimental(Diagnostics.Experimental)] +public sealed partial class AssistantFusionPhaseStartedData +{ + /// Conversation scope in which the phase executes. + [JsonPropertyName("conversationScope")] + public required FusionConversationScope ConversationScope { get; set; } + + /// Identifier of the HydraFusion turn containing the phase. + [JsonPropertyName("fusionId")] + public required string FusionId { get; set; } + + /// Concrete model executing the phase. + [JsonPropertyName("model")] + public required string Model { get; set; } + + /// HydraFusion orchestration pattern containing the phase. + [JsonPropertyName("pattern")] + public required FusionPattern Pattern { get; set; } + + /// Stable identifier for the concrete phase. + [JsonPropertyName("phaseId")] + public required string PhaseId { get; set; } + + /// Kind of phase being executed. + [JsonPropertyName("phaseKind")] + public required FusionPhaseKind PhaseKind { get; set; } + + /// Semantic role assigned to the phase. + [JsonPropertyName("role")] + public required string Role { get; set; } +} + +/// Experimental durable HydraFusion phase output and lossless replay checkpoint. +[Experimental(Diagnostics.Experimental)] +public sealed partial class AssistantFusionPhaseCompletedData +{ + /// Provider-normalized textual output produced by the phase. + [JsonPropertyName("content")] + public required string Content { get; set; } + + /// Conversation scope in which the phase executed. + [JsonPropertyName("conversationScope")] + public required FusionConversationScope ConversationScope { get; set; } + + /// Elapsed execution time for the phase in milliseconds. + [JsonPropertyName("durationMs")] + public required double DurationMs { get; set; } + + /// Identifier of the HydraFusion turn containing the phase. + [JsonPropertyName("fusionId")] + public required string FusionId { get; set; } + + /// Concrete model that executed the phase. + [JsonPropertyName("model")] + public required string Model { get; set; } + + /// Stable identifier for the completed phase. + [JsonPropertyName("phaseId")] + public required string PhaseId { get; set; } + + /// Kind of phase that completed. + [JsonPropertyName("phaseKind")] + public required FusionPhaseKind PhaseKind { get; set; } + + /// Exact provider-normalized message used to reconstruct canonical model history. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("projectionMessage")] + internal JsonElement? ProjectionMessage { get; set; } + + /// Projection action for the exact internal message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("projectionMode")] + internal FusionProjectionMode? ProjectionMode { get; set; } + + /// Semantic role assigned to the completed phase. + [JsonPropertyName("role")] + public required string Role { get; set; } + + /// Terminal request held outside canonical state until selected by the final commit. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("stagedTerminal")] + internal FusionStagedTerminal? StagedTerminal { get; set; } + + /// Durable outcome status of the phase. + [JsonPropertyName("status")] + public required FusionPhaseStatus Status { get; set; } + + /// Aggregate concrete-model usage consumed by the phase. + [JsonPropertyName("usage")] + public required FusionPhaseUsage Usage { get; set; } + + /// Structured judge or critic verdict, when the phase produces one. + [JsonPropertyName("verdict")] + public string? Verdict { get; set; } +} + +/// Experimental durable typed HydraFusion phase failure and degradation transition. +[Experimental(Diagnostics.Experimental)] +public sealed partial class AssistantFusionPhaseFailedData +{ + /// Conversation scope in which the phase executed. + [JsonPropertyName("conversationScope")] + public required FusionConversationScope ConversationScope { get; set; } + + /// Identifier of the fallback phase used to continue the turn after degradation. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("degradedToPhaseId")] + public string? DegradedToPhaseId { get; set; } + + /// Elapsed execution time before the phase failed, in milliseconds. + [JsonPropertyName("durationMs")] + public required double DurationMs { get; set; } + + /// Provider or execution error detail, when available. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("errorMessage")] + public string? ErrorMessage { get; set; } + + /// Identifier of the HydraFusion turn containing the phase. + [JsonPropertyName("fusionId")] + public required string FusionId { get; set; } + + /// Concrete model that attempted the phase. + [JsonPropertyName("model")] + public required string Model { get; set; } + + /// Stable identifier for the failed phase. + [JsonPropertyName("phaseId")] + public required string PhaseId { get; set; } + + /// Kind of phase that failed. + [JsonPropertyName("phaseKind")] + public required FusionPhaseKind PhaseKind { get; set; } + + /// Stable machine-readable reason for the phase failure. + [JsonPropertyName("reason")] + public required string Reason { get; set; } + + /// Semantic role assigned to the failed phase. + [JsonPropertyName("role")] + public required string Role { get; set; } + + /// Durable outcome status of the phase. + [JsonPropertyName("status")] + public required FusionPhaseStatus Status { get; set; } + + /// Aggregate concrete-model usage consumed before the failure. + [JsonPropertyName("usage")] + public required FusionPhaseUsage Usage { get; set; } +} + /// Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message. public sealed partial class AssistantServerToolProgressData { @@ -3025,6 +3516,12 @@ public sealed partial class AssistantMessageData [JsonPropertyName("encryptedContent")] public string? EncryptedContent { get; set; } + /// Experimental HydraFusion source attribution for this ordinary authoritative assistant message. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("fusion")] + public FusionAttribution? Fusion { get; set; } + /// CAPI interaction ID for correlating this message with upstream telemetry. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("interactionId")] @@ -3249,6 +3746,12 @@ public sealed partial class AssistantUsageData [JsonPropertyName("frontierSource")] internal string? FrontierSource { get; set; } + /// Experimental HydraFusion attribution for this concrete model call's usage. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("fusion")] + public FusionAttribution? Fusion { get; set; } + /// What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("initiator")] @@ -3559,6 +4062,12 @@ public sealed partial class ModelCallFailureData [JsonPropertyName("failureKind")] public ModelCallFailureKind? FailureKind { get; set; } + /// Experimental HydraFusion attribution for this failed concrete model call. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("fusion")] + public FusionAttribution? Fusion { get; set; } + /// What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("initiator")] @@ -3674,6 +4183,12 @@ public sealed partial class ModelCallFinishedData /// Model API dispatch metadata for internal telemetry. public sealed partial class ModelCallStartData { + /// Experimental HydraFusion attribution for this concrete model call. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("fusion")] + public FusionAttribution? Fusion { get; set; } + /// Model identifier used for this API call, when known. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] @@ -3728,6 +4243,12 @@ public sealed partial class ToolExecutionStartData [JsonPropertyName("displayVerbatim")] public bool? DisplayVerbatim { get; set; } + /// Experimental HydraFusion attribution for this tool execution. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("fusion")] + public FusionAttribution? Fusion { get; set; } + /// Name of the MCP server hosting this tool, when the tool is an MCP tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mcpServerName")] @@ -3813,6 +4334,12 @@ public sealed partial class ToolExecutionCompleteData [JsonPropertyName("error")] public ToolExecutionCompleteError? Error { get; set; } + /// Experimental HydraFusion attribution for this tool completion. + [Experimental(Diagnostics.Experimental)] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("fusion")] + public FusionAttribution? Fusion { get; set; } + /// CAPI interaction ID for correlating this tool execution with upstream telemetry. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("interactionId")] @@ -5598,6 +6125,42 @@ public sealed partial class CompactionCompleteCompactionTokensUsed public long? OutputTokens { get; set; } } +/// Durable server recommendation for subsequent HydraFusion turns. +/// Nested data type for FusionFollowUpRecommendation. +[Experimental(Diagnostics.Experimental)] +public sealed partial class FusionFollowUpRecommendation +{ + /// Recommended routing action for the next compaction turn. + [JsonPropertyName("compactionTurn")] + public required FusionFollowUpAction CompactionTurn { get; set; } + + /// Recommended routing action for the next user-message turn. + [JsonPropertyName("userTurn")] + public required FusionFollowUpAction UserTurn { get; set; } +} + +/// Validated HydraFusion routing capability scores. +/// Nested data type for FusionScores. +[Experimental(Diagnostics.Experimental)] +public sealed partial class FusionScores +{ + /// Code-generation capability score returned by the authenticated router. + [JsonPropertyName("codeGen")] + public required double CodeGen { get; set; } + + /// Debugging capability score returned by the authenticated router. + [JsonPropertyName("debugging")] + public required double Debugging { get; set; } + + /// Reasoning capability score returned by the authenticated router. + [JsonPropertyName("reasoning")] + public required double Reasoning { get; set; } + + /// Tool-use capability score returned by the authenticated router. + [JsonPropertyName("toolUse")] + public required double ToolUse { get; set; } +} + /// Optional line range to scope the attachment to a specific section of the file. /// Nested data type for AttachmentFileLineRange. public sealed partial class AttachmentFileLineRange @@ -6148,12 +6711,69 @@ public partial class Attachment } -/// A source that backs one or more cited spans in the assistant's response. -/// Nested data type for CitationSource. +/// Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it. +/// Nested data type for FusionStagedTerminal. [Experimental(Diagnostics.Experimental)] -public sealed partial class CitationSource +internal sealed partial class FusionStagedTerminal { - /// Stable, turn-scoped identifier for this source, referenced by CitationReference.sourceId. + /// Gets or sets the arguments value. + [JsonPropertyName("arguments")] + public required string Arguments { get; set; } + + /// Gets or sets the assistantMessage value. + [JsonPropertyName("assistantMessage")] + public required JsonElement AssistantMessage { get; set; } + + /// Gets or sets the phaseId value. + [JsonPropertyName("phaseId")] + public required string PhaseId { get; set; } + + /// Gets or sets the toolCallId value. + [JsonPropertyName("toolCallId")] + public required string ToolCallId { get; set; } + + /// Gets or sets the toolName value. + [JsonPropertyName("toolName")] + public required string ToolName { get; set; } +} + +/// Aggregate concrete-model usage for one HydraFusion phase. +/// Nested data type for FusionPhaseUsage. +[Experimental(Diagnostics.Experimental)] +public sealed partial class FusionPhaseUsage +{ + /// Total cached input tokens reported for the phase. + [JsonPropertyName("cachedTokens")] + public required long CachedTokens { get; set; } + + /// Total tokens written to prompt cache during the phase. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("cacheWriteTokens")] + public long? CacheWriteTokens { get; set; } + + /// Total input tokens consumed by the phase. + [JsonPropertyName("inputTokens")] + public required long InputTokens { get; set; } + + /// Total output tokens produced by the phase. + [JsonPropertyName("outputTokens")] + public required long OutputTokens { get; set; } + + /// Number of concrete model requests made by the phase. + [JsonPropertyName("requestCount")] + public required long RequestCount { get; set; } + + /// Total normalized AI-unit cost reported for the phase, in nano-AIU. + [JsonPropertyName("totalNanoAiu")] + public required double TotalNanoAiu { get; set; } +} + +/// A source that backs one or more cited spans in the assistant's response. +/// Nested data type for CitationSource. +[Experimental(Diagnostics.Experimental)] +public sealed partial class CitationSource +{ + /// Stable, turn-scoped identifier for this source, referenced by CitationReference.sourceId. [JsonPropertyName("id")] public required string Id { get; set; } @@ -6305,6 +6925,63 @@ public sealed partial class Citations public required CitationSpan[] Spans { get; set; } } +/// Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it. +/// Nested data type for FusionAttribution. +[Experimental(Diagnostics.Experimental)] +public sealed partial class FusionAttribution +{ + /// Idempotency identifier for the authoritative commit, when the event belongs to the selected output. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("commitId")] + public string? CommitId { get; set; } + + /// Conversation scope in which the concrete phase executed. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("conversationScope")] + public string? ConversationScope { get; set; } + + /// Stable identifier for the HydraFusion turn that produced the event. + [JsonPropertyName("fusionId")] + public required string FusionId { get; set; } + + /// HydraFusion orchestration pattern selected for the turn. + [JsonPropertyName("pattern")] + public required string Pattern { get; set; } + + /// Identifier of the concrete phase that produced the event. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("phaseId")] + public string? PhaseId { get; set; } + + /// Kind of concrete phase that produced the event. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("phaseKind")] + public string? PhaseKind { get; set; } + + /// HydraFusion routing policy used for the turn. + [JsonPropertyName("policy")] + public required string Policy { get; set; } + + /// Semantic role assigned to the concrete phase. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("role")] + public string? Role { get; set; } + + /// Concrete model that produced the attributed event. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("sourceModel")] + public string? SourceModel { get; set; } + + /// Phase whose output supplied the authoritative content, when different from the executing phase. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("sourcePhaseId")] + public string? SourcePhaseId { get; set; } + + /// Synthetic HydraFusion model selected for the session. + [JsonPropertyName("syntheticModel")] + public required string SyntheticModel { get; set; } +} + /// Neutral provider-tagged reasoning content blocks preserved verbatim for round-tripping. /// Nested data type for AssistantMessageReasoningBlocks. [Experimental(Diagnostics.Experimental)] @@ -6883,6 +7560,11 @@ public sealed partial class ToolExecutionCompleteContentShellExit : ToolExecutio [JsonPropertyName("exitCode")] public required long ExitCode { get; set; } + /// Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("outputFilePath")] + public string? OutputFilePath { get; set; } + /// Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("outputPreview")] @@ -10592,6 +11274,195 @@ public override void Write(Utf8JsonWriter writer, TaskCompletionOutcome value, J } } +/// Kind of turn for which HydraFusion routing is running. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionTurnKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionTurnKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// A user-message turn. + public static FusionTurnKind User { get; } = new("user"); + + /// A conversation-compaction turn. + public static FusionTurnKind Compaction { get; } = new("compaction"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionTurnKind left, FusionTurnKind right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionTurnKind left, FusionTurnKind right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionTurnKind other && Equals(other); + + /// + public bool Equals(FusionTurnKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FusionTurnKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionTurnKind value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionTurnKind)); + } + } +} + +/// Server-recommended routing behavior for a later HydraFusion turn. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionFollowUpAction : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionFollowUpAction(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Reuse the durable primary model without routing. + public static FusionFollowUpAction ReusePrimary { get; } = new("reuse_primary"); + + /// Request a new routing decision. + public static FusionFollowUpAction Reroute { get; } = new("reroute"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionFollowUpAction left, FusionFollowUpAction right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionFollowUpAction left, FusionFollowUpAction right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionFollowUpAction other && Equals(other); + + /// + public bool Equals(FusionFollowUpAction other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FusionFollowUpAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionFollowUpAction value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionFollowUpAction)); + } + } +} + +/// Validated HydraFusion execution pattern. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionPattern : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionPattern(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Run one primary solver phase. + public static FusionPattern Single { get; } = new("single"); + + /// Run a primary phase, a judge, and an optional repair. + public static FusionPattern Cascade { get; } = new("cascade"); + + /// Run a primary draft, a read-only critique, and a revision. + public static FusionPattern Critique { get; } = new("critique"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionPattern left, FusionPattern right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionPattern left, FusionPattern right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionPattern other && Equals(other); + + /// + public bool Equals(FusionPattern other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FusionPattern Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionPattern value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPattern)); + } + } +} + /// The agent mode that was active when this message was sent. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -11037,6 +11908,275 @@ public override void Write(Utf8JsonWriter writer, ModelCallFailureTransport valu } } +/// Conversation scope in which a HydraFusion phase executes. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionConversationScope : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionConversationScope(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Canonical root conversation history. + public static FusionConversationScope Root { get; } = new("root"); + + /// Isolated read-only review history that does not enter the root conversation. + public static FusionConversationScope Review { get; } = new("review"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionConversationScope left, FusionConversationScope right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionConversationScope left, FusionConversationScope right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionConversationScope other && Equals(other); + + /// + public bool Equals(FusionConversationScope other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FusionConversationScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionConversationScope value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionConversationScope)); + } + } +} + +/// HydraFusion phase kind. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionPhaseKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionPhaseKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Primary solver phase. + public static FusionPhaseKind Primary { get; } = new("primary"); + + /// Read-only cascade judge phase. + public static FusionPhaseKind Judge { get; } = new("judge"); + + /// Cascade repair phase. + public static FusionPhaseKind Repair { get; } = new("repair"); + + /// Initial critique-pattern draft phase. + public static FusionPhaseKind Draft { get; } = new("draft"); + + /// Read-only critique phase. + public static FusionPhaseKind Critic { get; } = new("critic"); + + /// Critique-pattern revision phase. + public static FusionPhaseKind Revision { get; } = new("revision"); + + /// Follow-up phase continuing from the resolved model. + public static FusionPhaseKind FollowUp { get; } = new("follow_up"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionPhaseKind left, FusionPhaseKind right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionPhaseKind left, FusionPhaseKind right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionPhaseKind other && Equals(other); + + /// + public bool Equals(FusionPhaseKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FusionPhaseKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionPhaseKind value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPhaseKind)); + } + } +} + +/// How a durable phase checkpoint contributes its exact message to canonical root history. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionProjectionMode : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionProjectionMode(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Append the exact root message immediately. + public static FusionProjectionMode Append { get; } = new("append"); + + /// Hold a terminal message outside canonical history until the final commit selects it. + public static FusionProjectionMode Staged { get; } = new("staged"); + + /// Do not project the checkpoint into root history. + public static FusionProjectionMode None { get; } = new("none"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionProjectionMode left, FusionProjectionMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionProjectionMode left, FusionProjectionMode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionProjectionMode other && Equals(other); + + /// + public bool Equals(FusionProjectionMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FusionProjectionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionProjectionMode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionProjectionMode)); + } + } +} + +/// Durable outcome status of a HydraFusion phase. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct FusionPhaseStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public FusionPhaseStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The phase completed successfully. + public static FusionPhaseStatus Succeeded { get; } = new("succeeded"); + + /// The phase failed. + public static FusionPhaseStatus Failed { get; } = new("failed"); + + /// The phase was cancelled. + public static FusionPhaseStatus Cancelled { get; } = new("cancelled"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(FusionPhaseStatus left, FusionPhaseStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(FusionPhaseStatus left, FusionPhaseStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is FusionPhaseStatus other && Equals(other); + + /// + public bool Equals(FusionPhaseStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override FusionPhaseStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, FusionPhaseStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPhaseStatus)); + } + } +} + /// Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -14208,6 +15348,12 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(AbortEvent))] [JsonSerializable(typeof(AgentInterruptedData))] [JsonSerializable(typeof(AgentInterruptedEvent))] +[JsonSerializable(typeof(AssistantFusionPhaseCompletedData))] +[JsonSerializable(typeof(AssistantFusionPhaseCompletedEvent))] +[JsonSerializable(typeof(AssistantFusionPhaseFailedData))] +[JsonSerializable(typeof(AssistantFusionPhaseFailedEvent))] +[JsonSerializable(typeof(AssistantFusionPhaseStartedData))] +[JsonSerializable(typeof(AssistantFusionPhaseStartedEvent))] [JsonSerializable(typeof(AssistantIdleData))] [JsonSerializable(typeof(AssistantIdleEvent))] [JsonSerializable(typeof(AssistantIntentData))] @@ -14319,6 +15465,11 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(FactoryRunStartedEvent))] [JsonSerializable(typeof(FactoryRunUpdatedData))] [JsonSerializable(typeof(FactoryRunUpdatedEvent))] +[JsonSerializable(typeof(FusionAttribution))] +[JsonSerializable(typeof(FusionFollowUpRecommendation))] +[JsonSerializable(typeof(FusionPhaseUsage))] +[JsonSerializable(typeof(FusionScores))] +[JsonSerializable(typeof(FusionStagedTerminal))] [JsonSerializable(typeof(GitHubMcpToolConfig))] [JsonSerializable(typeof(GitHubRepoRef))] [JsonSerializable(typeof(HandoffRepository))] @@ -14458,6 +15609,14 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SessionExtensionsAttachmentsPushedEvent))] [JsonSerializable(typeof(SessionExtensionsLoadedData))] [JsonSerializable(typeof(SessionExtensionsLoadedEvent))] +[JsonSerializable(typeof(SessionFusionCompletedData))] +[JsonSerializable(typeof(SessionFusionCompletedEvent))] +[JsonSerializable(typeof(SessionFusionResolvedData))] +[JsonSerializable(typeof(SessionFusionResolvedEvent))] +[JsonSerializable(typeof(SessionFusionRouteFailedData))] +[JsonSerializable(typeof(SessionFusionRouteFailedEvent))] +[JsonSerializable(typeof(SessionFusionRouteStartedData))] +[JsonSerializable(typeof(SessionFusionRouteStartedEvent))] [JsonSerializable(typeof(SessionHandoffData))] [JsonSerializable(typeof(SessionHandoffEvent))] [JsonSerializable(typeof(SessionIdleData))] diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 2b3943988d..4aee30d29a 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -2980,6 +2980,9 @@ type ExternalToolTextResultForLlmContentShellExit struct { Cwd *string `json:"cwd,omitempty"` // Exit code from the completed shell command ExitCode int64 `json:"exitCode"` + // Path reported in the shell session's filesystem namespace when shell output exceeded the + // configured large-output threshold. + OutputFilePath *string `json:"outputFilePath,omitempty"` // Output associated with this shell command, if available. May be partial, truncated, or a // preview; not guaranteed to be full output. OutputPreview *string `json:"outputPreview,omitempty"` @@ -14284,12 +14287,8 @@ type ToolsGetBuiltinDescriptorsRequest struct { BackgroundTaskNotificationsEnabled *bool `json:"backgroundTaskNotificationsEnabled,omitempty"` // Whether tool descriptors should include authoring metadata. IncludeAuthor *bool `json:"includeAuthor,omitempty"` - // Whether line numbers should be omitted from the view tool descriptor. - NoViewLineNumbers *bool `json:"noViewLineNumbers,omitempty"` // Whether descriptors should favor fewer user-intervention prompts. ReduceUserIntervention *bool `json:"reduceUserIntervention,omitempty"` - // Whether shell commands may only run asynchronously. - ShellAsyncOnlyEnabled *bool `json:"shellAsyncOnlyEnabled,omitempty"` // Shell-specific names and description lines for shell tools. ShellConfig *ToolsShellDescriptorConfig `json:"shellConfig,omitempty"` // Whether the configured shell supports PowerShell 7 syntax. @@ -25617,15 +25616,9 @@ func (a *ToolsAPI) GetBuiltinDescriptors(ctx context.Context, params *ToolsGetBu if params.IncludeAuthor != nil { req["includeAuthor"] = *params.IncludeAuthor } - if params.NoViewLineNumbers != nil { - req["noViewLineNumbers"] = *params.NoViewLineNumbers - } if params.ReduceUserIntervention != nil { req["reduceUserIntervention"] = *params.ReduceUserIntervention } - if params.ShellAsyncOnlyEnabled != nil { - req["shellAsyncOnlyEnabled"] = *params.ShellAsyncOnlyEnabled - } if params.ShellConfig != nil { req["shellConfig"] = *params.ShellConfig } diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index 5c5d3bca27..b530cd5944 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -47,6 +47,24 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeAssistantFusionPhaseCompleted: + var d AssistantFusionPhaseCompletedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeAssistantFusionPhaseFailed: + var d AssistantFusionPhaseFailedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeAssistantFusionPhaseStarted: + var d AssistantFusionPhaseStartedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeAssistantIdle: var d AssistantIdleData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -467,6 +485,30 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionFusionCompleted: + var d SessionFusionCompletedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeSessionFusionResolved: + var d SessionFusionResolvedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeSessionFusionRouteFailed: + var d SessionFusionRouteFailedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeSessionFusionRouteStarted: + var d SessionFusionRouteStartedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionHandoff: var d SessionHandoffData if err := json.Unmarshal(raw.Data, &d); err != nil { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 2abfd75a66..d909b3d913 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -53,8 +53,17 @@ func (r RawSessionEventData) Type() SessionEventType { type SessionEventType string const ( - SessionEventTypeAbort SessionEventType = "abort" - SessionEventTypeAgentInterrupted SessionEventType = "agent.interrupted" + SessionEventTypeAbort SessionEventType = "abort" + SessionEventTypeAgentInterrupted SessionEventType = "agent.interrupted" + // Experimental: SessionEventTypeAssistantFusionPhaseCompleted identifies an experimental + // event that may change or be removed. + SessionEventTypeAssistantFusionPhaseCompleted SessionEventType = "assistant.fusion_phase_completed" + // Experimental: SessionEventTypeAssistantFusionPhaseFailed identifies an experimental event + // that may change or be removed. + SessionEventTypeAssistantFusionPhaseFailed SessionEventType = "assistant.fusion_phase_failed" + // Experimental: SessionEventTypeAssistantFusionPhaseStarted identifies an experimental + // event that may change or be removed. + SessionEventTypeAssistantFusionPhaseStarted SessionEventType = "assistant.fusion_phase_started" SessionEventTypeAssistantIdle SessionEventType = "assistant.idle" SessionEventTypeAssistantIntent SessionEventType = "assistant.intent" SessionEventTypeAssistantMessage SessionEventType = "assistant.message" @@ -147,11 +156,23 @@ const ( SessionEventTypeSessionError SessionEventType = "session.error" SessionEventTypeSessionExtensionsAttachmentsPushed SessionEventType = "session.extensions.attachments_pushed" SessionEventTypeSessionExtensionsLoaded SessionEventType = "session.extensions_loaded" - SessionEventTypeSessionHandoff SessionEventType = "session.handoff" - SessionEventTypeSessionIdle SessionEventType = "session.idle" - SessionEventTypeSessionInfo SessionEventType = "session.info" - SessionEventTypeSessionLimitsExhaustedCompleted SessionEventType = "session_limits_exhausted.completed" - SessionEventTypeSessionLimitsExhaustedRequested SessionEventType = "session_limits_exhausted.requested" + // Experimental: SessionEventTypeSessionFusionCompleted identifies an experimental event + // that may change or be removed. + SessionEventTypeSessionFusionCompleted SessionEventType = "session.fusion_completed" + // Experimental: SessionEventTypeSessionFusionResolved identifies an experimental event that + // may change or be removed. + SessionEventTypeSessionFusionResolved SessionEventType = "session.fusion_resolved" + // Experimental: SessionEventTypeSessionFusionRouteFailed identifies an experimental event + // that may change or be removed. + SessionEventTypeSessionFusionRouteFailed SessionEventType = "session.fusion_route_failed" + // Experimental: SessionEventTypeSessionFusionRouteStarted identifies an experimental event + // that may change or be removed. + SessionEventTypeSessionFusionRouteStarted SessionEventType = "session.fusion_route_started" + SessionEventTypeSessionHandoff SessionEventType = "session.handoff" + SessionEventTypeSessionIdle SessionEventType = "session.idle" + SessionEventTypeSessionInfo SessionEventType = "session.info" + SessionEventTypeSessionLimitsExhaustedCompleted SessionEventType = "session_limits_exhausted.completed" + SessionEventTypeSessionLimitsExhaustedRequested SessionEventType = "session_limits_exhausted.requested" // Experimental: SessionEventTypeSessionManagedSettingsEnforced identifies an experimental // event that may change or be removed. SessionEventTypeSessionManagedSettingsEnforced SessionEventType = "session.managed_settings_enforced" @@ -327,6 +348,9 @@ type AssistantMessageData struct { Content string `json:"content"` // Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume. EncryptedContent *string `json:"encryptedContent,omitempty"` + // Experimental HydraFusion source attribution for this ordinary authoritative assistant message. + // Experimental: Fusion is part of an experimental API and may change or be removed. + Fusion *FusionAttribution `json:"fusion,omitempty"` // CAPI interaction ID for correlating this message with upstream telemetry InteractionID *string `json:"interactionId,omitempty"` // Unique identifier for this assistant message @@ -853,6 +877,243 @@ type SessionErrorData struct { func (*SessionErrorData) sessionEventData() {} func (*SessionErrorData) Type() SessionEventType { return SessionEventTypeSessionError } +// Experimental durable HydraFusion phase output and lossless replay checkpoint. +// Experimental: AssistantFusionPhaseCompletedData is part of an experimental API and may change or be removed. +type AssistantFusionPhaseCompletedData struct { + // Provider-normalized textual output produced by the phase. + Content string `json:"content"` + // Conversation scope in which the phase executed. + ConversationScope FusionConversationScope `json:"conversationScope"` + // Elapsed execution time for the phase in milliseconds. + DurationMs float64 `json:"durationMs"` + // Identifier of the HydraFusion turn containing the phase. + FusionID string `json:"fusionId"` + // Concrete model that executed the phase. + Model string `json:"model"` + // Stable identifier for the completed phase. + PhaseID string `json:"phaseId"` + // Kind of phase that completed. + PhaseKind FusionPhaseKind `json:"phaseKind"` + // Exact provider-normalized message used to reconstruct canonical model history. + // Internal: ProjectionMessage is part of the SDK's internal API surface and is not intended for external use. + ProjectionMessage any `json:"projectionMessage,omitempty"` + // Projection action for the exact internal message. + // Internal: ProjectionMode is part of the SDK's internal API surface and is not intended for external use. + ProjectionMode *FusionProjectionMode `json:"projectionMode,omitempty"` + // Semantic role assigned to the completed phase. + Role string `json:"role"` + // Terminal request held outside canonical state until selected by the final commit. + // Internal: StagedTerminal is part of the SDK's internal API surface and is not intended for external use. + StagedTerminal *FusionStagedTerminal `json:"stagedTerminal,omitempty"` + // Durable outcome status of the phase. + Status FusionPhaseStatus `json:"status"` + // Aggregate concrete-model usage consumed by the phase. + Usage FusionPhaseUsage `json:"usage"` + // Structured judge or critic verdict, when the phase produces one. + Verdict *string `json:"verdict"` +} + +func (*AssistantFusionPhaseCompletedData) sessionEventData() {} +func (*AssistantFusionPhaseCompletedData) Type() SessionEventType { + return SessionEventTypeAssistantFusionPhaseCompleted +} + +// Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. +// Experimental: SessionFusionRouteFailedData is part of an experimental API and may change or be removed. +type SessionFusionRouteFailedData struct { + // Identifier of the routing attempt that failed. + AttemptID string `json:"attemptId"` + // Provider or validation error detail, when available. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Concrete model selected as the deterministic fallback. + FallbackModel string `json:"fallbackModel"` + // HydraFusion routing policy requested for the turn. + Policy string `json:"policy"` + // Stable machine-readable reason for the routing failure. + Reason string `json:"reason"` + // Elapsed routing time in milliseconds before the failure. + RoutingLatencyMs *float64 `json:"routingLatencyMs,omitempty"` + // Synthetic HydraFusion model selected for the session. + SyntheticModel string `json:"syntheticModel"` +} + +func (*SessionFusionRouteFailedData) sessionEventData() {} +func (*SessionFusionRouteFailedData) Type() SessionEventType { + return SessionEventTypeSessionFusionRouteFailed +} + +// Experimental durable aggregate outcome of a HydraFusion turn. +// Experimental: SessionFusionCompletedData is part of an experimental API and may change or be removed. +type SessionFusionCompletedData struct { + // Total cached input tokens reported across all phases. + CachedTokens int64 `json:"cachedTokens"` + // Total tokens written to prompt cache across all phases. + CacheWriteTokens *int64 `json:"cacheWriteTokens,omitempty"` + // Idempotency identifier for the authoritative final commit. + CommitID string `json:"commitId"` + // Reason the turn used a degraded route, when applicable. + DegradedReason *string `json:"degradedReason"` + // Total elapsed execution time for the HydraFusion turn in milliseconds. + DurationMs float64 `json:"durationMs"` + // Concrete model that supplied the authoritative final content. + FinalSourceModel *string `json:"finalSourceModel"` + // Phase whose output supplied the authoritative final content. + FinalSourcePhaseID *string `json:"finalSourcePhaseId"` + // Concrete model recommended for eligible follow-up turns. + FollowUpModel string `json:"followUpModel"` + // Stable identifier for the completed HydraFusion turn. + FusionID string `json:"fusionId"` + // Total input tokens consumed across all phases. + InputTokens int64 `json:"inputTokens"` + // Stable aggregate outcome of the HydraFusion turn. + Outcome string `json:"outcome"` + // Total output tokens produced across all phases. + OutputTokens int64 `json:"outputTokens"` + // HydraFusion orchestration pattern executed for the turn. + Pattern FusionPattern `json:"pattern"` + // Number of concrete phases attempted by the turn. + PhaseCount int64 `json:"phaseCount"` + // Total concrete model requests made across all phases. + RequestCount int64 `json:"requestCount"` + // Synthetic HydraFusion model selected for the session. + SyntheticModel string `json:"syntheticModel"` + // Total normalized AI-unit cost reported across all phases, in nano-AIU. + TotalNanoAiu float64 `json:"totalNanoAiu"` + // Identifier of the session turn associated with the completion. + TurnID string `json:"turnId"` +} + +func (*SessionFusionCompletedData) sessionEventData() {} +func (*SessionFusionCompletedData) Type() SessionEventType { + return SessionEventTypeSessionFusionCompleted +} + +// Experimental durable typed HydraFusion phase failure and degradation transition. +// Experimental: AssistantFusionPhaseFailedData is part of an experimental API and may change or be removed. +type AssistantFusionPhaseFailedData struct { + // Conversation scope in which the phase executed. + ConversationScope FusionConversationScope `json:"conversationScope"` + // Identifier of the fallback phase used to continue the turn after degradation. + DegradedToPhaseID *string `json:"degradedToPhaseId,omitempty"` + // Elapsed execution time before the phase failed, in milliseconds. + DurationMs float64 `json:"durationMs"` + // Provider or execution error detail, when available. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Identifier of the HydraFusion turn containing the phase. + FusionID string `json:"fusionId"` + // Concrete model that attempted the phase. + Model string `json:"model"` + // Stable identifier for the failed phase. + PhaseID string `json:"phaseId"` + // Kind of phase that failed. + PhaseKind FusionPhaseKind `json:"phaseKind"` + // Stable machine-readable reason for the phase failure. + Reason string `json:"reason"` + // Semantic role assigned to the failed phase. + Role string `json:"role"` + // Durable outcome status of the phase. + Status FusionPhaseStatus `json:"status"` + // Aggregate concrete-model usage consumed before the failure. + Usage FusionPhaseUsage `json:"usage"` +} + +func (*AssistantFusionPhaseFailedData) sessionEventData() {} +func (*AssistantFusionPhaseFailedData) Type() SessionEventType { + return SessionEventTypeAssistantFusionPhaseFailed +} + +// Experimental durable validated HydraFusion route and turn policy. +// Experimental: SessionFusionResolvedData is part of an experimental API and may change or be removed. +type SessionFusionResolvedData struct { + // Version of the validated HydraFusion event contract. + ContractVersion int64 `json:"contractVersion"` + // Concrete model used when the planned primary model cannot execute. + FallbackModel string `json:"fallbackModel"` + // Router recommendation controlling reuse or rerouting on later turns. + FollowUp *FusionFollowUpRecommendation `json:"followUp,omitempty"` + // Concrete model recommended for eligible follow-up turns. + FollowUpModel string `json:"followUpModel"` + // Stable identifier for the resolved HydraFusion turn. + FusionID string `json:"fusionId"` + // Version of the executable model universe used for selection. + ModelUniverseVersion *string `json:"modelUniverseVersion,omitempty"` + // Validated orchestration pattern selected for the turn. + Pattern FusionPattern `json:"pattern"` + // Version of the validated execution-plan format. + PlanVersion *string `json:"planVersion,omitempty"` + // HydraFusion routing policy used to resolve the plan. + Policy string `json:"policy"` + // Version of the local routing policy. + PolicyVersion *string `json:"policyVersion,omitempty"` + // Concrete model selected for the primary solver phase. + PrimaryModel string `json:"primaryModel"` + // Router implementation that supplied the plan. + RouteSource *string `json:"routeSource,omitempty"` + // Elapsed time in milliseconds required to resolve and validate the route. + RoutingLatencyMs *float64 `json:"routingLatencyMs,omitempty"` + // Identifier of the local policy rule that matched. + RuleID *string `json:"ruleId,omitempty"` + // Zero-based index of the local policy rule that matched. + RuleIndex *int64 `json:"ruleIndex,omitempty"` + // Human-readable name of the local policy rule that matched. + RuleName *string `json:"ruleName,omitempty"` + // Validated capability scores used to select the route. + Scores *FusionScores `json:"scores,omitempty"` + // Concrete model selected for the review or judge phase, when required. + SecondaryModel *string `json:"secondaryModel"` + // Synthetic HydraFusion model selected for the session. + SyntheticModel string `json:"syntheticModel"` + // Identifier of the session turn associated with the route. + TurnID string `json:"turnId"` +} + +func (*SessionFusionResolvedData) sessionEventData() {} +func (*SessionFusionResolvedData) Type() SessionEventType { + return SessionEventTypeSessionFusionResolved +} + +// Experimental transient HydraFusion phase/model/role signal. +// Experimental: AssistantFusionPhaseStartedData is part of an experimental API and may change or be removed. +type AssistantFusionPhaseStartedData struct { + // Conversation scope in which the phase executes. + ConversationScope FusionConversationScope `json:"conversationScope"` + // Identifier of the HydraFusion turn containing the phase. + FusionID string `json:"fusionId"` + // Concrete model executing the phase. + Model string `json:"model"` + // HydraFusion orchestration pattern containing the phase. + Pattern FusionPattern `json:"pattern"` + // Stable identifier for the concrete phase. + PhaseID string `json:"phaseId"` + // Kind of phase being executed. + PhaseKind FusionPhaseKind `json:"phaseKind"` + // Semantic role assigned to the phase. + Role string `json:"role"` +} + +func (*AssistantFusionPhaseStartedData) sessionEventData() {} +func (*AssistantFusionPhaseStartedData) Type() SessionEventType { + return SessionEventTypeAssistantFusionPhaseStarted +} + +// Experimental transient signal that HydraFusion routing has started for an eligible turn. +// Experimental: SessionFusionRouteStartedData is part of an experimental API and may change or be removed. +type SessionFusionRouteStartedData struct { + // Identifier for this routing attempt before a durable Fusion turn exists. + AttemptID string `json:"attemptId"` + // HydraFusion routing policy requested for the turn. + Policy *string `json:"policy,omitempty"` + // Synthetic HydraFusion model selected for the session. + SyntheticModel *string `json:"syntheticModel,omitempty"` + // Kind of turn being routed. + TurnKind FusionTurnKind `json:"turnKind"` +} + +func (*SessionFusionRouteStartedData) sessionEventData() {} +func (*SessionFusionRouteStartedData) Type() SessionEventType { + return SessionEventTypeSessionFusionRouteStarted +} + // External tool completion notification signaling UI dismissal type ExternalToolCompletedData struct { // Request ID of the resolved external tool request; clients should dismiss any UI for this request @@ -909,6 +1170,9 @@ type ModelCallFailureData struct { ErrorType *string `json:"errorType,omitempty"` // Whether the failure originated from an API response or the request transport FailureKind *ModelCallFailureKind `json:"failureKind,omitempty"` + // Experimental HydraFusion attribution for this failed concrete model call. + // Experimental: Fusion is part of an experimental API and may change or be removed. + Fusion *FusionAttribution `json:"fusion,omitempty"` // What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls Initiator *string `json:"initiator,omitempty"` // Authoritative interaction classification for the failed call, matching `assistant.usage.interactionType` (for example `conversation-agent`, `conversation-subagent`, or `conversation-sampling`). Absent when the producer cannot classify the interaction. @@ -1048,6 +1312,9 @@ type AssistantUsageData struct { // How the prompt-cache frontier was determined for this call // Internal: FrontierSource is part of the SDK's internal API surface and is not intended for external use. FrontierSource *string `json:"frontierSource,omitempty"` + // Experimental HydraFusion attribution for this concrete model call's usage. + // Experimental: Fusion is part of an experimental API and may change or be removed. + Fusion *FusionAttribution `json:"fusion,omitempty"` // What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls Initiator *string `json:"initiator,omitempty"` // Number of input tokens consumed @@ -1220,6 +1487,9 @@ func (*AgentInterruptedData) Type() SessionEventType { return SessionEventTypeAg // Model API dispatch metadata for internal telemetry type ModelCallStartData struct { + // Experimental HydraFusion attribution for this concrete model call. + // Experimental: Fusion is part of an experimental API and may change or be removed. + Fusion *FusionAttribution `json:"fusion,omitempty"` // Model identifier used for this API call, when known Model *string `json:"model,omitempty"` // Previous response or interaction identifier included in the model request, when present @@ -2249,6 +2519,9 @@ func (*SessionTaskCompleteData) Type() SessionEventType { return SessionEventTyp type ToolExecutionCompleteData struct { // Error details when the tool execution failed Error *ToolExecutionCompleteError `json:"error,omitempty"` + // Experimental HydraFusion attribution for this tool completion. + // Experimental: Fusion is part of an experimental API and may change or be removed. + Fusion *FusionAttribution `json:"fusion,omitempty"` // CAPI interaction ID for correlating this tool execution with upstream telemetry InteractionID *string `json:"interactionId,omitempty"` // Whether this tool call was explicitly requested by the user rather than the assistant @@ -2303,6 +2576,9 @@ type ToolExecutionStartData struct { Arguments any `json:"arguments,omitempty"` // When true, the tool output should be displayed expanded (verbatim) in the CLI timeline DisplayVerbatim *bool `json:"displayVerbatim,omitempty"` + // Experimental HydraFusion attribution for this tool execution. + // Experimental: Fusion is part of an experimental API and may change or be removed. + Fusion *FusionAttribution `json:"fusion,omitempty"` // Name of the MCP server hosting this tool, when the tool is an MCP tool MCPServerName *string `json:"mcpServerName,omitempty"` // Original tool name on the MCP server, when the tool is an MCP tool @@ -2837,6 +3113,83 @@ type FactoryPermissionPhase struct { Title string `json:"title"` } +// Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it. +// Experimental: FusionAttribution is part of an experimental API and may change or be removed. +type FusionAttribution struct { + // Idempotency identifier for the authoritative commit, when the event belongs to the selected output. + CommitID *string `json:"commitId,omitempty"` + // Conversation scope in which the concrete phase executed. + ConversationScope *string `json:"conversationScope,omitempty"` + // Stable identifier for the HydraFusion turn that produced the event. + FusionID string `json:"fusionId"` + // HydraFusion orchestration pattern selected for the turn. + Pattern string `json:"pattern"` + // Identifier of the concrete phase that produced the event. + PhaseID *string `json:"phaseId,omitempty"` + // Kind of concrete phase that produced the event. + PhaseKind *string `json:"phaseKind,omitempty"` + // HydraFusion routing policy used for the turn. + Policy string `json:"policy"` + // Semantic role assigned to the concrete phase. + Role *string `json:"role,omitempty"` + // Concrete model that produced the attributed event. + SourceModel *string `json:"sourceModel,omitempty"` + // Phase whose output supplied the authoritative content, when different from the executing phase. + SourcePhaseID *string `json:"sourcePhaseId,omitempty"` + // Synthetic HydraFusion model selected for the session. + SyntheticModel string `json:"syntheticModel"` +} + +// Durable server recommendation for subsequent HydraFusion turns. +// Experimental: FusionFollowUpRecommendation is part of an experimental API and may change or be removed. +type FusionFollowUpRecommendation struct { + // Recommended routing action for the next compaction turn. + CompactionTurn FusionFollowUpAction `json:"compactionTurn"` + // Recommended routing action for the next user-message turn. + UserTurn FusionFollowUpAction `json:"userTurn"` +} + +// Aggregate concrete-model usage for one HydraFusion phase. +// Experimental: FusionPhaseUsage is part of an experimental API and may change or be removed. +type FusionPhaseUsage struct { + // Total cached input tokens reported for the phase. + CachedTokens int64 `json:"cachedTokens"` + // Total tokens written to prompt cache during the phase. + CacheWriteTokens *int64 `json:"cacheWriteTokens,omitempty"` + // Total input tokens consumed by the phase. + InputTokens int64 `json:"inputTokens"` + // Total output tokens produced by the phase. + OutputTokens int64 `json:"outputTokens"` + // Number of concrete model requests made by the phase. + RequestCount int64 `json:"requestCount"` + // Total normalized AI-unit cost reported for the phase, in nano-AIU. + TotalNanoAiu float64 `json:"totalNanoAiu"` +} + +// Validated HydraFusion routing capability scores. +// Experimental: FusionScores is part of an experimental API and may change or be removed. +type FusionScores struct { + // Code-generation capability score returned by the authenticated router. + CodeGen float64 `json:"codeGen"` + // Debugging capability score returned by the authenticated router. + Debugging float64 `json:"debugging"` + // Reasoning capability score returned by the authenticated router. + Reasoning float64 `json:"reasoning"` + // Tool-use capability score returned by the authenticated router. + ToolUse float64 `json:"toolUse"` +} + +// Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it. +// Experimental: FusionStagedTerminal is part of an experimental API and may change or be removed. +// Internal: FusionStagedTerminal is an internal SDK API and is not part of the public surface. +type FusionStagedTerminal struct { + Arguments string `json:"arguments"` + AssistantMessage any `json:"assistantMessage"` + PhaseID string `json:"phaseId"` + ToolCallID string `json:"toolCallId"` + ToolName string `json:"toolName"` +} + // Per-session configuration for the built-in GitHub MCP server type GitHubMCPToolConfig struct { // Additional GitHub MCP tools requested by the session @@ -4194,6 +4547,8 @@ type ToolExecutionCompleteContentShellExit struct { Cwd *string `json:"cwd,omitempty"` // Exit code from the completed shell command ExitCode int64 `json:"exitCode"` + // Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + OutputFilePath *string `json:"outputFilePath,omitempty"` // Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. OutputPreview *string `json:"outputPreview,omitempty"` // Whether outputPreview is known to be incomplete or truncated @@ -4741,6 +5096,99 @@ const ( FactoryRunSettledStatusHalted FactoryRunSettledStatus = "halted" ) +// Conversation scope in which a HydraFusion phase executes. +// Experimental: FusionConversationScope is part of an experimental API and may change or be removed. +type FusionConversationScope string + +const ( + // Isolated read-only review history that does not enter the root conversation. + FusionConversationScopeReview FusionConversationScope = "review" + // Canonical root conversation history. + FusionConversationScopeRoot FusionConversationScope = "root" +) + +// Server-recommended routing behavior for a later HydraFusion turn. +// Experimental: FusionFollowUpAction is part of an experimental API and may change or be removed. +type FusionFollowUpAction string + +const ( + // Request a new routing decision. + FusionFollowUpActionReroute FusionFollowUpAction = "reroute" + // Reuse the durable primary model without routing. + FusionFollowUpActionReusePrimary FusionFollowUpAction = "reuse_primary" +) + +// Validated HydraFusion execution pattern. +// Experimental: FusionPattern is part of an experimental API and may change or be removed. +type FusionPattern string + +const ( + // Run a primary phase, a judge, and an optional repair. + FusionPatternCascade FusionPattern = "cascade" + // Run a primary draft, a read-only critique, and a revision. + FusionPatternCritique FusionPattern = "critique" + // Run one primary solver phase. + FusionPatternSingle FusionPattern = "single" +) + +// HydraFusion phase kind. +// Experimental: FusionPhaseKind is part of an experimental API and may change or be removed. +type FusionPhaseKind string + +const ( + // Read-only critique phase. + FusionPhaseKindCritic FusionPhaseKind = "critic" + // Initial critique-pattern draft phase. + FusionPhaseKindDraft FusionPhaseKind = "draft" + // Follow-up phase continuing from the resolved model. + FusionPhaseKindFollowUp FusionPhaseKind = "follow_up" + // Read-only cascade judge phase. + FusionPhaseKindJudge FusionPhaseKind = "judge" + // Primary solver phase. + FusionPhaseKindPrimary FusionPhaseKind = "primary" + // Cascade repair phase. + FusionPhaseKindRepair FusionPhaseKind = "repair" + // Critique-pattern revision phase. + FusionPhaseKindRevision FusionPhaseKind = "revision" +) + +// Durable outcome status of a HydraFusion phase. +// Experimental: FusionPhaseStatus is part of an experimental API and may change or be removed. +type FusionPhaseStatus string + +const ( + // The phase was cancelled. + FusionPhaseStatusCancelled FusionPhaseStatus = "cancelled" + // The phase failed. + FusionPhaseStatusFailed FusionPhaseStatus = "failed" + // The phase completed successfully. + FusionPhaseStatusSucceeded FusionPhaseStatus = "succeeded" +) + +// How a durable phase checkpoint contributes its exact message to canonical root history. +// Experimental: FusionProjectionMode is part of an experimental API and may change or be removed. +type FusionProjectionMode string + +const ( + // Append the exact root message immediately. + FusionProjectionModeAppend FusionProjectionMode = "append" + // Do not project the checkpoint into root history. + FusionProjectionModeNone FusionProjectionMode = "none" + // Hold a terminal message outside canonical history until the final commit selects it. + FusionProjectionModeStaged FusionProjectionMode = "staged" +) + +// Kind of turn for which HydraFusion routing is running. +// Experimental: FusionTurnKind is part of an experimental API and may change or be removed. +type FusionTurnKind string + +const ( + // A conversation-compaction turn. + FusionTurnKindCompaction FusionTurnKind = "compaction" + // A user-message turn. + FusionTurnKindUser FusionTurnKind = "user" +) + // Origin type of the session being handed off type HandoffSourceType string diff --git a/go/zsession_events.go b/go/zsession_events.go index 11a1bd666f..1ed498b850 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -12,6 +12,9 @@ type ( AgentInterruptedActivity = rpc.AgentInterruptedActivity AgentInterruptedCancelPhase = rpc.AgentInterruptedCancelPhase AgentInterruptedData = rpc.AgentInterruptedData + AssistantFusionPhaseCompletedData = rpc.AssistantFusionPhaseCompletedData + AssistantFusionPhaseFailedData = rpc.AssistantFusionPhaseFailedData + AssistantFusionPhaseStartedData = rpc.AssistantFusionPhaseStartedData AssistantIdleData = rpc.AssistantIdleData AssistantIntentData = rpc.AssistantIntentData AssistantMessageData = rpc.AssistantMessageData @@ -116,6 +119,16 @@ type ( FactoryRunSettledStatus = rpc.FactoryRunSettledStatus FactoryRunStartedData = rpc.FactoryRunStartedData FactoryRunUpdatedData = rpc.FactoryRunUpdatedData + FusionAttribution = rpc.FusionAttribution + FusionConversationScope = rpc.FusionConversationScope + FusionFollowUpAction = rpc.FusionFollowUpAction + FusionFollowUpRecommendation = rpc.FusionFollowUpRecommendation + FusionPattern = rpc.FusionPattern + FusionPhaseKind = rpc.FusionPhaseKind + FusionPhaseStatus = rpc.FusionPhaseStatus + FusionPhaseUsage = rpc.FusionPhaseUsage + FusionScores = rpc.FusionScores + FusionTurnKind = rpc.FusionTurnKind GitHubRepoRef = rpc.GitHubRepoRef HandoffRepository = rpc.HandoffRepository HandoffSourceType = rpc.HandoffSourceType @@ -260,6 +273,10 @@ type ( SessionEventType = rpc.SessionEventType SessionExtensionsAttachmentsPushedData = rpc.SessionExtensionsAttachmentsPushedData SessionExtensionsLoadedData = rpc.SessionExtensionsLoadedData + SessionFusionCompletedData = rpc.SessionFusionCompletedData + SessionFusionResolvedData = rpc.SessionFusionResolvedData + SessionFusionRouteFailedData = rpc.SessionFusionRouteFailedData + SessionFusionRouteStartedData = rpc.SessionFusionRouteStartedData SessionHandoffData = rpc.SessionHandoffData SessionIdleData = rpc.SessionIdleData SessionInfoData = rpc.SessionInfoData @@ -495,6 +512,28 @@ const ( FactoryRunSettledStatusCompleted = rpc.FactoryRunSettledStatusCompleted FactoryRunSettledStatusError = rpc.FactoryRunSettledStatusError FactoryRunSettledStatusHalted = rpc.FactoryRunSettledStatusHalted + FusionConversationScopeReview = rpc.FusionConversationScopeReview + FusionConversationScopeRoot = rpc.FusionConversationScopeRoot + FusionFollowUpActionReroute = rpc.FusionFollowUpActionReroute + FusionFollowUpActionReusePrimary = rpc.FusionFollowUpActionReusePrimary + FusionPatternCascade = rpc.FusionPatternCascade + FusionPatternCritique = rpc.FusionPatternCritique + FusionPatternSingle = rpc.FusionPatternSingle + FusionPhaseKindCritic = rpc.FusionPhaseKindCritic + FusionPhaseKindDraft = rpc.FusionPhaseKindDraft + FusionPhaseKindFollowUp = rpc.FusionPhaseKindFollowUp + FusionPhaseKindJudge = rpc.FusionPhaseKindJudge + FusionPhaseKindPrimary = rpc.FusionPhaseKindPrimary + FusionPhaseKindRepair = rpc.FusionPhaseKindRepair + FusionPhaseKindRevision = rpc.FusionPhaseKindRevision + FusionPhaseStatusCancelled = rpc.FusionPhaseStatusCancelled + FusionPhaseStatusFailed = rpc.FusionPhaseStatusFailed + FusionPhaseStatusSucceeded = rpc.FusionPhaseStatusSucceeded + FusionProjectionModeAppend = rpc.FusionProjectionModeAppend + FusionProjectionModeNone = rpc.FusionProjectionModeNone + FusionProjectionModeStaged = rpc.FusionProjectionModeStaged + FusionTurnKindCompaction = rpc.FusionTurnKindCompaction + FusionTurnKindUser = rpc.FusionTurnKindUser HandoffSourceTypeLocal = rpc.HandoffSourceTypeLocal HandoffSourceTypeRemote = rpc.HandoffSourceTypeRemote ManagedSettingsEnforcedActionBypassPermissionsBlocked = rpc.ManagedSettingsEnforcedActionBypassPermissionsBlocked @@ -626,6 +665,9 @@ const ( ScheduleOriginUser = rpc.ScheduleOriginUser SessionEventTypeAbort = rpc.SessionEventTypeAbort SessionEventTypeAgentInterrupted = rpc.SessionEventTypeAgentInterrupted + SessionEventTypeAssistantFusionPhaseCompleted = rpc.SessionEventTypeAssistantFusionPhaseCompleted + SessionEventTypeAssistantFusionPhaseFailed = rpc.SessionEventTypeAssistantFusionPhaseFailed + SessionEventTypeAssistantFusionPhaseStarted = rpc.SessionEventTypeAssistantFusionPhaseStarted SessionEventTypeAssistantIdle = rpc.SessionEventTypeAssistantIdle SessionEventTypeAssistantIntent = rpc.SessionEventTypeAssistantIntent SessionEventTypeAssistantMessage = rpc.SessionEventTypeAssistantMessage @@ -696,6 +738,10 @@ const ( SessionEventTypeSessionError = rpc.SessionEventTypeSessionError SessionEventTypeSessionExtensionsAttachmentsPushed = rpc.SessionEventTypeSessionExtensionsAttachmentsPushed SessionEventTypeSessionExtensionsLoaded = rpc.SessionEventTypeSessionExtensionsLoaded + SessionEventTypeSessionFusionCompleted = rpc.SessionEventTypeSessionFusionCompleted + SessionEventTypeSessionFusionResolved = rpc.SessionEventTypeSessionFusionResolved + SessionEventTypeSessionFusionRouteFailed = rpc.SessionEventTypeSessionFusionRouteFailed + SessionEventTypeSessionFusionRouteStarted = rpc.SessionEventTypeSessionFusionRouteStarted SessionEventTypeSessionHandoff = rpc.SessionEventTypeSessionHandoff SessionEventTypeSessionIdle = rpc.SessionEventTypeSessionIdle SessionEventTypeSessionInfo = rpc.SessionEventTypeSessionInfo diff --git a/java/pom.xml b/java/pom.xml index b7618b897a..9dd98643a2 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -63,7 +63,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.81-11 + ^1.0.81-12 true diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index d0b602e846..23762d81ae 100644 --- a/java/scripts/codegen/package-lock.json +++ b/java/scripts/codegen/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "copilot-sdk-java-codegen", "dependencies": { - "@github/copilot": "^1.0.81-11", + "@github/copilot": "^1.0.81-12", "json-schema": "^0.4.0", "tsx": "^4.23.12" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.81-11.tgz", - "integrity": "sha512-F7hZ6G6fhWH4uq862mbs2JE3nL0KIVBOc94/EFOdEjux3oHUQst9a06gKibEJS6VRULaYTXzatA1EAgNC9dzFA==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.81-12.tgz", + "integrity": "sha512-Gs0LB6j8C2D02oagnBaX+g8U03ulT3utomXnW9TrZWdtY4JVMRIu20cr/aMkr24xATX9jUbPbTfGJAwzP7N/gA==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -439,20 +439,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.81-11", - "@github/copilot-darwin-x64": "1.0.81-11", - "@github/copilot-linux-arm64": "1.0.81-11", - "@github/copilot-linux-x64": "1.0.81-11", - "@github/copilot-linuxmusl-arm64": "1.0.81-11", - "@github/copilot-linuxmusl-x64": "1.0.81-11", - "@github/copilot-win32-arm64": "1.0.81-11", - "@github/copilot-win32-x64": "1.0.81-11" + "@github/copilot-darwin-arm64": "1.0.81-12", + "@github/copilot-darwin-x64": "1.0.81-12", + "@github/copilot-linux-arm64": "1.0.81-12", + "@github/copilot-linux-x64": "1.0.81-12", + "@github/copilot-linuxmusl-arm64": "1.0.81-12", + "@github/copilot-linuxmusl-x64": "1.0.81-12", + "@github/copilot-win32-arm64": "1.0.81-12", + "@github/copilot-win32-x64": "1.0.81-12" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.81-11.tgz", - "integrity": "sha512-3eLs71CLnJH9RNnESnv4esipZPeGXMlBxQeKXwZY+crwcW2RAR8YuovQyfoZ/5by1PLPbYrOjXNfQL6kXSisrA==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.81-12.tgz", + "integrity": "sha512-oaJHeCJpvr9ClfrnhFou2AZUd7SqxGrdCkBnVM1tYduUDPzb9xqdFsMcJn2g0hfPM1yO3khjWU6WQxmuQCyJnA==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.81-11.tgz", - "integrity": "sha512-GdFLiUC8UL9k6K+woG8AyL3zBafd0Br1TIPDV5iiZsyBtTe4g67FjL7DGCYDt6AN9G43jWdK0M0InoNDVq1K1A==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.81-12.tgz", + "integrity": "sha512-lYyFpCEA/usTGJSKWx1X5U4a4DiJ9A1A7vXrE0uE+HjS/9eJE2NBR1z3fPUP0V8HL0JUqAsSdM6rPbFfiE1c+Q==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.81-11.tgz", - "integrity": "sha512-C4hcAow5CdaVJITbdtGqFgxWpW7TqwyCPNn8OtcbvdWeiKcfOBDrgkvbsezG98/5Ovs3HWxZRT4oZqCEmGF9Ww==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.81-12.tgz", + "integrity": "sha512-5jV7xuoqGndoQFxeM06IuEe4oEhY03PBIYyghvFVptQWY7Cj/Q3CMogIUaIQ+ugjuV8oRgBpm1JLJmr5Cw4FHA==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.81-11.tgz", - "integrity": "sha512-izu0PwWx+wL4zxacO6cd6r0zMMMQ3pTz+2euWcAd7HCJ/CIR6+YYfjU3TI3TPBZ9zDLZGoxHKYYPfJ1ZbSTzEg==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.81-12.tgz", + "integrity": "sha512-/P0SMTeHQoMlV7MX+GCvIkht2uXZkLroyFMGjum+pD8XG7AsN8aozjILd5+JFEr6uxyhqnPjSOWj/vjmzmMoDA==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.81-11.tgz", - "integrity": "sha512-uWGUjaxOSMu6dKFWcTvXGUUp76vC3OV7nlSupecRkQ7gA3OxdrrB8rXE5/leC606Hk6oe9Wl7wKCH9EwuZ6afg==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.81-12.tgz", + "integrity": "sha512-XN6rK+7nv6K7Hv/fIJ4Wma+FCZFff9KaH5wES2VhWSS4Xfd4QCZQuiIWGHSmdo1MKarqp0ngx9t2VAtDY7lr7Q==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.81-11.tgz", - "integrity": "sha512-BpWKd/iu1tTyuPR2zuPFs1pVOlley4yt/TXkn6/gVwt52VI0rUxEO+n77RVjDcyMxWaUApbad2VNRPIH77guCA==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.81-12.tgz", + "integrity": "sha512-UUyK6Ru8kejqtTMyiiFNTNVFEPk4Qx7kaIznBLRSrR1jgrmelGjTMT6bDUlNTzqWPclUjdWF5kmCmT+urvSuqg==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.81-11.tgz", - "integrity": "sha512-GOK3cACgD96m065uJxbgcXL7MQ1qm+wq1qtvGBpprY0r9wTYJG/rVCtayjYB6B57rnaBwPll3+PQ2J1qgfO57A==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.81-12.tgz", + "integrity": "sha512-ACx+faBJ/z9EzjLaZM+zEbB6+3wmj6nTjel0Q+VPD7eDhTwujSvfYGZ5nv2TMi1JN5NAua+HLE1MGhIdS1wJXw==", "cpu": [ "arm64" ], @@ -562,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.81-11", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.81-11.tgz", - "integrity": "sha512-u4K6UU2iGQJqQwsdHNilJBwiaC48PfMsWVFnTSlJD5lCYp9zCk1odrvrcmB3ARYinE/IcXLUosiHaM/ChR/pdA==", + "version": "1.0.81-12", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.81-12.tgz", + "integrity": "sha512-m3D/9ww1laJLQahHUjd6e0c9ziikJuTPgSotJ0hFqXXkxacrxvAFAiWduhyeotl63IShMZk4M3jz59SHV9un9w==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index d5669c39f0..df70910029 100644 --- a/java/scripts/codegen/package.json +++ b/java/scripts/codegen/package.json @@ -7,7 +7,7 @@ "generate:java": "tsx java.ts" }, "dependencies": { - "@github/copilot": "^1.0.81-11", + "@github/copilot": "^1.0.81-12", "json-schema": "^0.4.0", "tsx": "^4.23.12" } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseCompletedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseCompletedEvent.java new file mode 100644 index 0000000000..5ad9beee17 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseCompletedEvent.java @@ -0,0 +1,67 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "assistant.fusion_phase_completed". Experimental durable HydraFusion phase output and lossless replay checkpoint. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantFusionPhaseCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.fusion_phase_completed"; } + + @JsonProperty("data") + private AssistantFusionPhaseCompletedEventData data; + + public AssistantFusionPhaseCompletedEventData getData() { return data; } + public void setData(AssistantFusionPhaseCompletedEventData data) { this.data = data; } + + /** Data payload for {@link AssistantFusionPhaseCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantFusionPhaseCompletedEventData( + /** Identifier of the HydraFusion turn containing the phase. */ + @JsonProperty("fusionId") String fusionId, + /** Stable identifier for the completed phase. */ + @JsonProperty("phaseId") String phaseId, + /** Kind of phase that completed. */ + @JsonProperty("phaseKind") FusionPhaseKind phaseKind, + /** Semantic role assigned to the completed phase. */ + @JsonProperty("role") String role, + /** Conversation scope in which the phase executed. */ + @JsonProperty("conversationScope") FusionConversationScope conversationScope, + /** Concrete model that executed the phase. */ + @JsonProperty("model") String model, + /** Durable outcome status of the phase. */ + @JsonProperty("status") FusionPhaseStatus status, + /** Provider-normalized textual output produced by the phase. */ + @JsonProperty("content") String content, + /** Structured judge or critic verdict, when the phase produces one. */ + @JsonProperty("verdict") String verdict, + /** Elapsed execution time for the phase in milliseconds. */ + @JsonProperty("durationMs") Double durationMs, + /** Aggregate concrete-model usage consumed by the phase. */ + @JsonProperty("usage") FusionPhaseUsage usage, + /** Exact provider-normalized message used to reconstruct canonical model history. */ + @JsonProperty("projectionMessage") Object projectionMessage, + /** Projection action for the exact internal message. */ + @JsonProperty("projectionMode") FusionProjectionMode projectionMode, + /** Terminal request held outside canonical state until selected by the final commit. */ + @JsonProperty("stagedTerminal") FusionStagedTerminal stagedTerminal + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseFailedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseFailedEvent.java new file mode 100644 index 0000000000..17de3c7190 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseFailedEvent.java @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "assistant.fusion_phase_failed". Experimental durable typed HydraFusion phase failure and degradation transition. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantFusionPhaseFailedEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.fusion_phase_failed"; } + + @JsonProperty("data") + private AssistantFusionPhaseFailedEventData data; + + public AssistantFusionPhaseFailedEventData getData() { return data; } + public void setData(AssistantFusionPhaseFailedEventData data) { this.data = data; } + + /** Data payload for {@link AssistantFusionPhaseFailedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantFusionPhaseFailedEventData( + /** Identifier of the HydraFusion turn containing the phase. */ + @JsonProperty("fusionId") String fusionId, + /** Stable identifier for the failed phase. */ + @JsonProperty("phaseId") String phaseId, + /** Kind of phase that failed. */ + @JsonProperty("phaseKind") FusionPhaseKind phaseKind, + /** Semantic role assigned to the failed phase. */ + @JsonProperty("role") String role, + /** Conversation scope in which the phase executed. */ + @JsonProperty("conversationScope") FusionConversationScope conversationScope, + /** Concrete model that attempted the phase. */ + @JsonProperty("model") String model, + /** Durable outcome status of the phase. */ + @JsonProperty("status") FusionPhaseStatus status, + /** Stable machine-readable reason for the phase failure. */ + @JsonProperty("reason") String reason, + /** Elapsed execution time before the phase failed, in milliseconds. */ + @JsonProperty("durationMs") Double durationMs, + /** Aggregate concrete-model usage consumed before the failure. */ + @JsonProperty("usage") FusionPhaseUsage usage, + /** Provider or execution error detail, when available. */ + @JsonProperty("errorMessage") String errorMessage, + /** Identifier of the fallback phase used to continue the turn after degradation. */ + @JsonProperty("degradedToPhaseId") String degradedToPhaseId + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseStartedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseStartedEvent.java new file mode 100644 index 0000000000..88c4064a73 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantFusionPhaseStartedEvent.java @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "assistant.fusion_phase_started". Experimental transient HydraFusion phase/model/role signal. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantFusionPhaseStartedEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.fusion_phase_started"; } + + @JsonProperty("data") + private AssistantFusionPhaseStartedEventData data; + + public AssistantFusionPhaseStartedEventData getData() { return data; } + public void setData(AssistantFusionPhaseStartedEventData data) { this.data = data; } + + /** Data payload for {@link AssistantFusionPhaseStartedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantFusionPhaseStartedEventData( + /** Identifier of the HydraFusion turn containing the phase. */ + @JsonProperty("fusionId") String fusionId, + /** Stable identifier for the concrete phase. */ + @JsonProperty("phaseId") String phaseId, + /** Kind of phase being executed. */ + @JsonProperty("phaseKind") FusionPhaseKind phaseKind, + /** HydraFusion orchestration pattern containing the phase. */ + @JsonProperty("pattern") FusionPattern pattern, + /** Semantic role assigned to the phase. */ + @JsonProperty("role") String role, + /** Conversation scope in which the phase executes. */ + @JsonProperty("conversationScope") FusionConversationScope conversationScope, + /** Concrete model executing the phase. */ + @JsonProperty("model") String model + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index 41147f3c55..9ba4f05618 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -80,7 +80,9 @@ public record AssistantMessageEventData( /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ @JsonProperty("parentToolCallId") String parentToolCallId, /** Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled. */ - @JsonProperty("citations") Citations citations + @JsonProperty("citations") Citations citations, + /** Experimental HydraFusion source attribution for this ordinary authoritative assistant message. */ + @JsonProperty("fusion") FusionAttribution fusion ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java index ff4cfddec8..d0956f5a77 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java @@ -115,7 +115,9 @@ public record AssistantUsageEventData( /** Finish reason reported by the model for this API call (e.g. "stop", "length", "tool_calls", "content_filter"). Normalized to OpenAI vocabulary; for Anthropic models a "refusal" stop reason maps to "content_filter". */ @JsonProperty("finishReason") String finishReason, /** Whether the model response was blocked or truncated by content filtering (finish_reason === 'content_filter'). For Anthropic models this corresponds to a 'refusal' stop reason. */ - @JsonProperty("contentFilterTriggered") Boolean contentFilterTriggered + @JsonProperty("contentFilterTriggered") Boolean contentFilterTriggered, + /** Experimental HydraFusion attribution for this concrete model call's usage. */ + @JsonProperty("fusion") FusionAttribution fusion ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionAttribution.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionAttribution.java new file mode 100644 index 0000000000..8e4ae7e937 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionAttribution.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FusionAttribution( + /** Stable identifier for the HydraFusion turn that produced the event. */ + @JsonProperty("fusionId") String fusionId, + /** Idempotency identifier for the authoritative commit, when the event belongs to the selected output. */ + @JsonProperty("commitId") String commitId, + /** Synthetic HydraFusion model selected for the session. */ + @JsonProperty("syntheticModel") String syntheticModel, + /** HydraFusion routing policy used for the turn. */ + @JsonProperty("policy") String policy, + /** HydraFusion orchestration pattern selected for the turn. */ + @JsonProperty("pattern") String pattern, + /** Identifier of the concrete phase that produced the event. */ + @JsonProperty("phaseId") String phaseId, + /** Kind of concrete phase that produced the event. */ + @JsonProperty("phaseKind") String phaseKind, + /** Semantic role assigned to the concrete phase. */ + @JsonProperty("role") String role, + /** Concrete model that produced the attributed event. */ + @JsonProperty("sourceModel") String sourceModel, + /** Conversation scope in which the concrete phase executed. */ + @JsonProperty("conversationScope") String conversationScope, + /** Phase whose output supplied the authoritative content, when different from the executing phase. */ + @JsonProperty("sourcePhaseId") String sourcePhaseId +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionConversationScope.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionConversationScope.java new file mode 100644 index 0000000000..d38381ed48 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionConversationScope.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Conversation scope in which a HydraFusion phase executes. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FusionConversationScope { + /** The {@code root} variant. */ + ROOT("root"), + /** The {@code review} variant. */ + REVIEW("review"); + + private final String value; + FusionConversationScope(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FusionConversationScope fromValue(String value) { + for (FusionConversationScope v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FusionConversationScope value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionFollowUpAction.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionFollowUpAction.java new file mode 100644 index 0000000000..e54bf4604f --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionFollowUpAction.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Server-recommended routing behavior for a later HydraFusion turn. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FusionFollowUpAction { + /** The {@code reuse_primary} variant. */ + REUSE_PRIMARY("reuse_primary"), + /** The {@code reroute} variant. */ + REROUTE("reroute"); + + private final String value; + FusionFollowUpAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FusionFollowUpAction fromValue(String value) { + for (FusionFollowUpAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FusionFollowUpAction value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionFollowUpRecommendation.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionFollowUpRecommendation.java new file mode 100644 index 0000000000..101d497fb2 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionFollowUpRecommendation.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Durable server recommendation for subsequent HydraFusion turns. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FusionFollowUpRecommendation( + /** Recommended routing action for the next user-message turn. */ + @JsonProperty("userTurn") FusionFollowUpAction userTurn, + /** Recommended routing action for the next compaction turn. */ + @JsonProperty("compactionTurn") FusionFollowUpAction compactionTurn +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionPattern.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPattern.java new file mode 100644 index 0000000000..d37ef4ee83 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPattern.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Validated HydraFusion execution pattern. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FusionPattern { + /** The {@code single} variant. */ + SINGLE("single"), + /** The {@code cascade} variant. */ + CASCADE("cascade"), + /** The {@code critique} variant. */ + CRITIQUE("critique"); + + private final String value; + FusionPattern(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FusionPattern fromValue(String value) { + for (FusionPattern v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FusionPattern value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseKind.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseKind.java new file mode 100644 index 0000000000..ead79b75fc --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseKind.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * HydraFusion phase kind. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FusionPhaseKind { + /** The {@code primary} variant. */ + PRIMARY("primary"), + /** The {@code judge} variant. */ + JUDGE("judge"), + /** The {@code repair} variant. */ + REPAIR("repair"), + /** The {@code draft} variant. */ + DRAFT("draft"), + /** The {@code critic} variant. */ + CRITIC("critic"), + /** The {@code revision} variant. */ + REVISION("revision"), + /** The {@code follow_up} variant. */ + FOLLOW_UP("follow_up"); + + private final String value; + FusionPhaseKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FusionPhaseKind fromValue(String value) { + for (FusionPhaseKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FusionPhaseKind value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseStatus.java new file mode 100644 index 0000000000..f670332b5c --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseStatus.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Durable outcome status of a HydraFusion phase. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FusionPhaseStatus { + /** The {@code succeeded} variant. */ + SUCCEEDED("succeeded"), + /** The {@code failed} variant. */ + FAILED("failed"), + /** The {@code cancelled} variant. */ + CANCELLED("cancelled"); + + private final String value; + FusionPhaseStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FusionPhaseStatus fromValue(String value) { + for (FusionPhaseStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FusionPhaseStatus value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseUsage.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseUsage.java new file mode 100644 index 0000000000..4a707bb69e --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionPhaseUsage.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Aggregate concrete-model usage for one HydraFusion phase. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FusionPhaseUsage( + /** Number of concrete model requests made by the phase. */ + @JsonProperty("requestCount") Long requestCount, + /** Total input tokens consumed by the phase. */ + @JsonProperty("inputTokens") Long inputTokens, + /** Total output tokens produced by the phase. */ + @JsonProperty("outputTokens") Long outputTokens, + /** Total cached input tokens reported for the phase. */ + @JsonProperty("cachedTokens") Long cachedTokens, + /** Total tokens written to prompt cache during the phase. */ + @JsonProperty("cacheWriteTokens") Long cacheWriteTokens, + /** Total normalized AI-unit cost reported for the phase, in nano-AIU. */ + @JsonProperty("totalNanoAiu") Double totalNanoAiu +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionProjectionMode.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionProjectionMode.java new file mode 100644 index 0000000000..9681efc0ba --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionProjectionMode.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * How a durable phase checkpoint contributes its exact message to canonical root history. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FusionProjectionMode { + /** The {@code append} variant. */ + APPEND("append"), + /** The {@code staged} variant. */ + STAGED("staged"), + /** The {@code none} variant. */ + NONE("none"); + + private final String value; + FusionProjectionMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FusionProjectionMode fromValue(String value) { + for (FusionProjectionMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FusionProjectionMode value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionScores.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionScores.java new file mode 100644 index 0000000000..eefb8190a1 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionScores.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Validated HydraFusion routing capability scores. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FusionScores( + /** Reasoning capability score returned by the authenticated router. */ + @JsonProperty("reasoning") Double reasoning, + /** Code-generation capability score returned by the authenticated router. */ + @JsonProperty("codeGen") Double codeGen, + /** Debugging capability score returned by the authenticated router. */ + @JsonProperty("debugging") Double debugging, + /** Tool-use capability score returned by the authenticated router. */ + @JsonProperty("toolUse") Double toolUse +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionStagedTerminal.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionStagedTerminal.java new file mode 100644 index 0000000000..262c8c664b --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionStagedTerminal.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record FusionStagedTerminal( + @JsonProperty("assistantMessage") Object assistantMessage, + @JsonProperty("toolName") String toolName, + @JsonProperty("toolCallId") String toolCallId, + @JsonProperty("arguments") String arguments, + @JsonProperty("phaseId") String phaseId +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/FusionTurnKind.java b/java/sdk/src/generated/java/com/github/copilot/generated/FusionTurnKind.java new file mode 100644 index 0000000000..24e39b976c --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/FusionTurnKind.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Kind of turn for which HydraFusion routing is running. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum FusionTurnKind { + /** The {@code user} variant. */ + USER("user"), + /** The {@code compaction} variant. */ + COMPACTION("compaction"); + + private final String value; + FusionTurnKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static FusionTurnKind fromValue(String value) { + for (FusionTurnKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown FusionTurnKind value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java index fb1ddcecd4..d3049cd472 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java @@ -82,7 +82,9 @@ public record ModelCallFailureEventData( /** Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure. */ @JsonProperty("quotaSnapshots") Map quotaSnapshots, /** Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures. */ - @JsonProperty("requestFingerprint") ModelCallFailureRequestFingerprint requestFingerprint + @JsonProperty("requestFingerprint") ModelCallFailureRequestFingerprint requestFingerprint, + /** Experimental HydraFusion attribution for this failed concrete model call. */ + @JsonProperty("fusion") FusionAttribution fusion ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/ModelCallStartEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/ModelCallStartEvent.java index 9f00e2ac2f..a68e455420 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/ModelCallStartEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/ModelCallStartEvent.java @@ -39,7 +39,9 @@ public record ModelCallStartEventData( /** Model identifier used for this API call, when known */ @JsonProperty("model") String model, /** Previous response or interaction identifier included in the model request, when present */ - @JsonProperty("previousResponseId") String previousResponseId + @JsonProperty("previousResponseId") String previousResponseId, + /** Experimental HydraFusion attribution for this concrete model call. */ + @JsonProperty("fusion") FusionAttribution fusion ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java index 0acc3df712..e0a9f6a282 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -55,12 +55,19 @@ @JsonSubTypes.Type(value = SessionCompactionStartEvent.class, name = "session.compaction_start"), @JsonSubTypes.Type(value = SessionCompactionCompleteEvent.class, name = "session.compaction_complete"), @JsonSubTypes.Type(value = SessionTaskCompleteEvent.class, name = "session.task_complete"), + @JsonSubTypes.Type(value = SessionFusionRouteStartedEvent.class, name = "session.fusion_route_started"), + @JsonSubTypes.Type(value = SessionFusionRouteFailedEvent.class, name = "session.fusion_route_failed"), + @JsonSubTypes.Type(value = SessionFusionResolvedEvent.class, name = "session.fusion_resolved"), + @JsonSubTypes.Type(value = SessionFusionCompletedEvent.class, name = "session.fusion_completed"), @JsonSubTypes.Type(value = UserMessageEvent.class, name = "user.message"), @JsonSubTypes.Type(value = PendingMessagesModifiedEvent.class, name = "pending_messages.modified"), @JsonSubTypes.Type(value = AssistantTurnStartEvent.class, name = "assistant.turn_start"), @JsonSubTypes.Type(value = AssistantTurnRetryEvent.class, name = "assistant.turn_retry"), @JsonSubTypes.Type(value = AgentInterruptedEvent.class, name = "agent.interrupted"), @JsonSubTypes.Type(value = AssistantIntentEvent.class, name = "assistant.intent"), + @JsonSubTypes.Type(value = AssistantFusionPhaseStartedEvent.class, name = "assistant.fusion_phase_started"), + @JsonSubTypes.Type(value = AssistantFusionPhaseCompletedEvent.class, name = "assistant.fusion_phase_completed"), + @JsonSubTypes.Type(value = AssistantFusionPhaseFailedEvent.class, name = "assistant.fusion_phase_failed"), @JsonSubTypes.Type(value = AssistantServerToolProgressEvent.class, name = "assistant.server_tool_progress"), @JsonSubTypes.Type(value = AssistantReasoningEvent.class, name = "assistant.reasoning"), @JsonSubTypes.Type(value = AssistantReasoningDeltaEvent.class, name = "assistant.reasoning_delta"), @@ -180,12 +187,19 @@ public abstract sealed class SessionEvent permits SessionCompactionStartEvent, SessionCompactionCompleteEvent, SessionTaskCompleteEvent, + SessionFusionRouteStartedEvent, + SessionFusionRouteFailedEvent, + SessionFusionResolvedEvent, + SessionFusionCompletedEvent, UserMessageEvent, PendingMessagesModifiedEvent, AssistantTurnStartEvent, AssistantTurnRetryEvent, AgentInterruptedEvent, AssistantIntentEvent, + AssistantFusionPhaseStartedEvent, + AssistantFusionPhaseCompletedEvent, + AssistantFusionPhaseFailedEvent, AssistantServerToolProgressEvent, AssistantReasoningEvent, AssistantReasoningDeltaEvent, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionCompletedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionCompletedEvent.java new file mode 100644 index 0000000000..6742cdc3e3 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionCompletedEvent.java @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.fusion_completed". Experimental durable aggregate outcome of a HydraFusion turn. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionFusionCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "session.fusion_completed"; } + + @JsonProperty("data") + private SessionFusionCompletedEventData data; + + public SessionFusionCompletedEventData getData() { return data; } + public void setData(SessionFusionCompletedEventData data) { this.data = data; } + + /** Data payload for {@link SessionFusionCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionFusionCompletedEventData( + /** Stable identifier for the completed HydraFusion turn. */ + @JsonProperty("fusionId") String fusionId, + /** Idempotency identifier for the authoritative final commit. */ + @JsonProperty("commitId") String commitId, + /** Identifier of the session turn associated with the completion. */ + @JsonProperty("turnId") String turnId, + /** Synthetic HydraFusion model selected for the session. */ + @JsonProperty("syntheticModel") String syntheticModel, + /** HydraFusion orchestration pattern executed for the turn. */ + @JsonProperty("pattern") FusionPattern pattern, + /** Stable aggregate outcome of the HydraFusion turn. */ + @JsonProperty("outcome") String outcome, + /** Phase whose output supplied the authoritative final content. */ + @JsonProperty("finalSourcePhaseId") String finalSourcePhaseId, + /** Concrete model that supplied the authoritative final content. */ + @JsonProperty("finalSourceModel") String finalSourceModel, + /** Concrete model recommended for eligible follow-up turns. */ + @JsonProperty("followUpModel") String followUpModel, + /** Reason the turn used a degraded route, when applicable. */ + @JsonProperty("degradedReason") String degradedReason, + /** Number of concrete phases attempted by the turn. */ + @JsonProperty("phaseCount") Long phaseCount, + /** Total concrete model requests made across all phases. */ + @JsonProperty("requestCount") Long requestCount, + /** Total input tokens consumed across all phases. */ + @JsonProperty("inputTokens") Long inputTokens, + /** Total output tokens produced across all phases. */ + @JsonProperty("outputTokens") Long outputTokens, + /** Total cached input tokens reported across all phases. */ + @JsonProperty("cachedTokens") Long cachedTokens, + /** Total tokens written to prompt cache across all phases. */ + @JsonProperty("cacheWriteTokens") Long cacheWriteTokens, + /** Total normalized AI-unit cost reported across all phases, in nano-AIU. */ + @JsonProperty("totalNanoAiu") Double totalNanoAiu, + /** Total elapsed execution time for the HydraFusion turn in milliseconds. */ + @JsonProperty("durationMs") Double durationMs + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionResolvedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionResolvedEvent.java new file mode 100644 index 0000000000..7553c6eb43 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionResolvedEvent.java @@ -0,0 +1,79 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.fusion_resolved". Experimental durable validated HydraFusion route and turn policy. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionFusionResolvedEvent extends SessionEvent { + + @Override + public String getType() { return "session.fusion_resolved"; } + + @JsonProperty("data") + private SessionFusionResolvedEventData data; + + public SessionFusionResolvedEventData getData() { return data; } + public void setData(SessionFusionResolvedEventData data) { this.data = data; } + + /** Data payload for {@link SessionFusionResolvedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionFusionResolvedEventData( + /** Stable identifier for the resolved HydraFusion turn. */ + @JsonProperty("fusionId") String fusionId, + /** Identifier of the session turn associated with the route. */ + @JsonProperty("turnId") String turnId, + /** Version of the validated HydraFusion event contract. */ + @JsonProperty("contractVersion") Long contractVersion, + /** Synthetic HydraFusion model selected for the session. */ + @JsonProperty("syntheticModel") String syntheticModel, + /** HydraFusion routing policy used to resolve the plan. */ + @JsonProperty("policy") String policy, + /** Router implementation that supplied the plan. */ + @JsonProperty("routeSource") String routeSource, + /** Version of the validated execution-plan format. */ + @JsonProperty("planVersion") String planVersion, + /** Version of the local routing policy. */ + @JsonProperty("policyVersion") String policyVersion, + /** Version of the executable model universe used for selection. */ + @JsonProperty("modelUniverseVersion") String modelUniverseVersion, + /** Identifier of the local policy rule that matched. */ + @JsonProperty("ruleId") String ruleId, + /** Zero-based index of the local policy rule that matched. */ + @JsonProperty("ruleIndex") Long ruleIndex, + /** Human-readable name of the local policy rule that matched. */ + @JsonProperty("ruleName") String ruleName, + /** Validated capability scores used to select the route. */ + @JsonProperty("scores") FusionScores scores, + /** Validated orchestration pattern selected for the turn. */ + @JsonProperty("pattern") FusionPattern pattern, + /** Concrete model selected for the primary solver phase. */ + @JsonProperty("primaryModel") String primaryModel, + /** Concrete model selected for the review or judge phase, when required. */ + @JsonProperty("secondaryModel") String secondaryModel, + /** Concrete model used when the planned primary model cannot execute. */ + @JsonProperty("fallbackModel") String fallbackModel, + /** Concrete model recommended for eligible follow-up turns. */ + @JsonProperty("followUpModel") String followUpModel, + /** Router recommendation controlling reuse or rerouting on later turns. */ + @JsonProperty("followUp") FusionFollowUpRecommendation followUp, + /** Elapsed time in milliseconds required to resolve and validate the route. */ + @JsonProperty("routingLatencyMs") Double routingLatencyMs + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionRouteFailedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionRouteFailedEvent.java new file mode 100644 index 0000000000..25698b336b --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionRouteFailedEvent.java @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.fusion_route_failed". Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionFusionRouteFailedEvent extends SessionEvent { + + @Override + public String getType() { return "session.fusion_route_failed"; } + + @JsonProperty("data") + private SessionFusionRouteFailedEventData data; + + public SessionFusionRouteFailedEventData getData() { return data; } + public void setData(SessionFusionRouteFailedEventData data) { this.data = data; } + + /** Data payload for {@link SessionFusionRouteFailedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionFusionRouteFailedEventData( + /** Identifier of the routing attempt that failed. */ + @JsonProperty("attemptId") String attemptId, + /** Synthetic HydraFusion model selected for the session. */ + @JsonProperty("syntheticModel") String syntheticModel, + /** HydraFusion routing policy requested for the turn. */ + @JsonProperty("policy") String policy, + /** Stable machine-readable reason for the routing failure. */ + @JsonProperty("reason") String reason, + /** Provider or validation error detail, when available. */ + @JsonProperty("errorMessage") String errorMessage, + /** Concrete model selected as the deterministic fallback. */ + @JsonProperty("fallbackModel") String fallbackModel, + /** Elapsed routing time in milliseconds before the failure. */ + @JsonProperty("routingLatencyMs") Double routingLatencyMs + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionRouteStartedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionRouteStartedEvent.java new file mode 100644 index 0000000000..139cb4f011 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionFusionRouteStartedEvent.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.fusion_route_started". Experimental transient signal that HydraFusion routing has started for an eligible turn. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionFusionRouteStartedEvent extends SessionEvent { + + @Override + public String getType() { return "session.fusion_route_started"; } + + @JsonProperty("data") + private SessionFusionRouteStartedEventData data; + + public SessionFusionRouteStartedEventData getData() { return data; } + public void setData(SessionFusionRouteStartedEventData data) { this.data = data; } + + /** Data payload for {@link SessionFusionRouteStartedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionFusionRouteStartedEventData( + /** Identifier for this routing attempt before a durable Fusion turn exists. */ + @JsonProperty("attemptId") String attemptId, + /** Kind of turn being routed. */ + @JsonProperty("turnKind") FusionTurnKind turnKind, + /** Synthetic HydraFusion model selected for the session. */ + @JsonProperty("syntheticModel") String syntheticModel, + /** HydraFusion routing policy requested for the turn. */ + @JsonProperty("policy") String policy + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java index 574d3aa6b9..4cb949c80b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java @@ -62,7 +62,9 @@ public record ToolExecutionCompleteEventData( /** Whether this tool execution ran inside a sandbox container */ @JsonProperty("sandboxed") Boolean sandboxed, /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ - @JsonProperty("parentToolCallId") String parentToolCallId + @JsonProperty("parentToolCallId") String parentToolCallId, + /** Experimental HydraFusion attribution for this tool completion. */ + @JsonProperty("fusion") FusionAttribution fusion ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java index 1aa69c6c20..36691ca41e 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java @@ -57,7 +57,9 @@ public record ToolExecutionStartEventData( /** Tool definition metadata, present for MCP tools with MCP Apps support */ @JsonProperty("toolDescription") ToolExecutionStartToolDescription toolDescription, /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ - @JsonProperty("parentToolCallId") String parentToolCallId + @JsonProperty("parentToolCallId") String parentToolCallId, + /** Experimental HydraFusion attribution for this tool execution. */ + @JsonProperty("fusion") FusionAttribution fusion ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetBuiltinDescriptorsParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetBuiltinDescriptorsParams.java index 7740409548..43dd20e722 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetBuiltinDescriptorsParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetBuiltinDescriptorsParams.java @@ -26,8 +26,6 @@ public record SessionToolsGetBuiltinDescriptorsParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, - /** Whether line numbers should be omitted from the view tool descriptor. */ - @JsonProperty("noViewLineNumbers") Boolean noViewLineNumbers, /** Whether descriptors should favor fewer user-intervention prompts. */ @JsonProperty("reduceUserIntervention") Boolean reduceUserIntervention, /** Whether tool descriptors should include authoring metadata. */ @@ -36,8 +34,6 @@ public record SessionToolsGetBuiltinDescriptorsParams( @JsonProperty("skillEmbeddingEnabled") Boolean skillEmbeddingEnabled, /** Shell-specific names and description lines for shell tools. */ @JsonProperty("shellConfig") ToolsShellDescriptorConfig shellConfig, - /** Whether shell commands may only run asynchronously. */ - @JsonProperty("shellAsyncOnlyEnabled") Boolean shellAsyncOnlyEnabled, /** Whether the configured shell supports PowerShell 7 syntax. */ @JsonProperty("shellSupportsPowerShell7Syntax") Boolean shellSupportsPowerShell7Syntax, /** Default shell timeout in milliseconds. */ diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 84430ac141..938baf7e81 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.81-11", + "@github/copilot": "^1.0.81-12", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" @@ -658,8 +658,8 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.81-11", - "integrity": "sha512-F7hZ6G6fhWH4uq862mbs2JE3nL0KIVBOc94/EFOdEjux3oHUQst9a06gKibEJS6VRULaYTXzatA1EAgNC9dzFA==", + "version": "1.0.81-12", + "integrity": "sha512-Gs0LB6j8C2D02oagnBaX+g8U03ulT3utomXnW9TrZWdtY4JVMRIu20cr/aMkr24xATX9jUbPbTfGJAwzP7N/gA==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -668,19 +668,19 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.81-11", - "@github/copilot-darwin-x64": "1.0.81-11", - "@github/copilot-linux-arm64": "1.0.81-11", - "@github/copilot-linux-x64": "1.0.81-11", - "@github/copilot-linuxmusl-arm64": "1.0.81-11", - "@github/copilot-linuxmusl-x64": "1.0.81-11", - "@github/copilot-win32-arm64": "1.0.81-11", - "@github/copilot-win32-x64": "1.0.81-11" + "@github/copilot-darwin-arm64": "1.0.81-12", + "@github/copilot-darwin-x64": "1.0.81-12", + "@github/copilot-linux-arm64": "1.0.81-12", + "@github/copilot-linux-x64": "1.0.81-12", + "@github/copilot-linuxmusl-arm64": "1.0.81-12", + "@github/copilot-linuxmusl-x64": "1.0.81-12", + "@github/copilot-win32-arm64": "1.0.81-12", + "@github/copilot-win32-x64": "1.0.81-12" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.81-11", - "integrity": "sha512-3eLs71CLnJH9RNnESnv4esipZPeGXMlBxQeKXwZY+crwcW2RAR8YuovQyfoZ/5by1PLPbYrOjXNfQL6kXSisrA==", + "version": "1.0.81-12", + "integrity": "sha512-oaJHeCJpvr9ClfrnhFou2AZUd7SqxGrdCkBnVM1tYduUDPzb9xqdFsMcJn2g0hfPM1yO3khjWU6WQxmuQCyJnA==", "cpu": [ "arm64" ], @@ -694,8 +694,8 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.81-11", - "integrity": "sha512-GdFLiUC8UL9k6K+woG8AyL3zBafd0Br1TIPDV5iiZsyBtTe4g67FjL7DGCYDt6AN9G43jWdK0M0InoNDVq1K1A==", + "version": "1.0.81-12", + "integrity": "sha512-lYyFpCEA/usTGJSKWx1X5U4a4DiJ9A1A7vXrE0uE+HjS/9eJE2NBR1z3fPUP0V8HL0JUqAsSdM6rPbFfiE1c+Q==", "cpu": [ "x64" ], @@ -709,8 +709,8 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.81-11", - "integrity": "sha512-C4hcAow5CdaVJITbdtGqFgxWpW7TqwyCPNn8OtcbvdWeiKcfOBDrgkvbsezG98/5Ovs3HWxZRT4oZqCEmGF9Ww==", + "version": "1.0.81-12", + "integrity": "sha512-5jV7xuoqGndoQFxeM06IuEe4oEhY03PBIYyghvFVptQWY7Cj/Q3CMogIUaIQ+ugjuV8oRgBpm1JLJmr5Cw4FHA==", "cpu": [ "arm64" ], @@ -724,8 +724,8 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.81-11", - "integrity": "sha512-izu0PwWx+wL4zxacO6cd6r0zMMMQ3pTz+2euWcAd7HCJ/CIR6+YYfjU3TI3TPBZ9zDLZGoxHKYYPfJ1ZbSTzEg==", + "version": "1.0.81-12", + "integrity": "sha512-/P0SMTeHQoMlV7MX+GCvIkht2uXZkLroyFMGjum+pD8XG7AsN8aozjILd5+JFEr6uxyhqnPjSOWj/vjmzmMoDA==", "cpu": [ "x64" ], @@ -739,8 +739,8 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.81-11", - "integrity": "sha512-uWGUjaxOSMu6dKFWcTvXGUUp76vC3OV7nlSupecRkQ7gA3OxdrrB8rXE5/leC606Hk6oe9Wl7wKCH9EwuZ6afg==", + "version": "1.0.81-12", + "integrity": "sha512-XN6rK+7nv6K7Hv/fIJ4Wma+FCZFff9KaH5wES2VhWSS4Xfd4QCZQuiIWGHSmdo1MKarqp0ngx9t2VAtDY7lr7Q==", "cpu": [ "arm64" ], @@ -754,8 +754,8 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.81-11", - "integrity": "sha512-BpWKd/iu1tTyuPR2zuPFs1pVOlley4yt/TXkn6/gVwt52VI0rUxEO+n77RVjDcyMxWaUApbad2VNRPIH77guCA==", + "version": "1.0.81-12", + "integrity": "sha512-UUyK6Ru8kejqtTMyiiFNTNVFEPk4Qx7kaIznBLRSrR1jgrmelGjTMT6bDUlNTzqWPclUjdWF5kmCmT+urvSuqg==", "cpu": [ "x64" ], @@ -769,8 +769,8 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.81-11", - "integrity": "sha512-GOK3cACgD96m065uJxbgcXL7MQ1qm+wq1qtvGBpprY0r9wTYJG/rVCtayjYB6B57rnaBwPll3+PQ2J1qgfO57A==", + "version": "1.0.81-12", + "integrity": "sha512-ACx+faBJ/z9EzjLaZM+zEbB6+3wmj6nTjel0Q+VPD7eDhTwujSvfYGZ5nv2TMi1JN5NAua+HLE1MGhIdS1wJXw==", "cpu": [ "arm64" ], @@ -784,8 +784,8 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.81-11", - "integrity": "sha512-u4K6UU2iGQJqQwsdHNilJBwiaC48PfMsWVFnTSlJD5lCYp9zCk1odrvrcmB3ARYinE/IcXLUosiHaM/ChR/pdA==", + "version": "1.0.81-12", + "integrity": "sha512-m3D/9ww1laJLQahHUjd6e0c9ziikJuTPgSotJ0hFqXXkxacrxvAFAiWduhyeotl63IShMZk4M3jz59SHV9un9w==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index 9f464788ee..1a5e971640 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.81-11", + "@github/copilot": "^1.0.81-12", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index 7c2a1052d8..8ed6dfa7e3 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,7 +18,7 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.81-11", + "@github/copilot": "^1.0.81-12", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 9e7304bde2..40b8ff534e 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -7268,6 +7268,10 @@ export interface ExternalToolTextResultForLlmContentShellExit { * Whether outputPreview is known to be incomplete or truncated */ outputTruncated?: boolean; + /** + * Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + */ + outputFilePath?: string; } /** * Image content block with base64-encoded data @@ -21005,10 +21009,6 @@ export interface ToolsExecuteRequest { */ /** @experimental */ export interface ToolsGetBuiltinDescriptorsRequest { - /** - * Whether line numbers should be omitted from the view tool descriptor. - */ - noViewLineNumbers?: boolean; /** * Whether descriptors should favor fewer user-intervention prompts. */ @@ -21022,10 +21022,6 @@ export interface ToolsGetBuiltinDescriptorsRequest { */ skillEmbeddingEnabled?: boolean; shellConfig?: ToolsShellDescriptorConfig; - /** - * Whether shell commands may only run asynchronously. - */ - shellAsyncOnlyEnabled?: boolean; /** * Whether the configured shell supports PowerShell 7 syntax. */ diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 473a2dbe16..2942405c45 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -40,10 +40,17 @@ export type SessionEvent = | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent + | FusionRouteStartedEvent + | FusionRouteFailedEvent + | FusionResolvedEvent + | FusionCompletedEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent + | AssistantFusionPhaseStartedEvent + | AssistantFusionPhaseCompletedEvent + | AssistantFusionPhaseFailedEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent @@ -298,6 +305,35 @@ export type TaskCompletionOutcome = | "continue" /** Completion cannot proceed without intervention; the active objective is paused when one is identified. */ | "blocked"; +/** + * Kind of turn for which HydraFusion routing is running. + */ +/** @experimental */ +export type FusionTurnKind = + /** A user-message turn. */ + | "user" + /** A conversation-compaction turn. */ + | "compaction"; +/** + * Server-recommended routing behavior for a later HydraFusion turn. + */ +/** @experimental */ +export type FusionFollowUpAction = + /** Reuse the durable primary model without routing. */ + | "reuse_primary" + /** Request a new routing decision. */ + | "reroute"; +/** + * Validated HydraFusion execution pattern. + */ +/** @experimental */ +export type FusionPattern = + /** Run one primary solver phase. */ + | "single" + /** Run a primary phase, a judge, and an optional repair. */ + | "cascade" + /** Run a primary draft, a read-only critique, and a revision. */ + | "critique"; /** * The agent mode that was active when this message was sent */ @@ -357,6 +393,57 @@ export type UserMessageDelivery = | "steering" /** Enqueued while the agent was busy; processed as its own run afterward. */ | "queued"; +/** + * Conversation scope in which a HydraFusion phase executes. + */ +/** @experimental */ +export type FusionConversationScope = + /** Canonical root conversation history. */ + | "root" + /** Isolated read-only review history that does not enter the root conversation. */ + | "review"; +/** + * HydraFusion phase kind. + */ +/** @experimental */ +export type FusionPhaseKind = + /** Primary solver phase. */ + | "primary" + /** Read-only cascade judge phase. */ + | "judge" + /** Cascade repair phase. */ + | "repair" + /** Initial critique-pattern draft phase. */ + | "draft" + /** Read-only critique phase. */ + | "critic" + /** Critique-pattern revision phase. */ + | "revision" + /** Follow-up phase continuing from the resolved model. */ + | "follow_up"; +/** + * How a durable phase checkpoint contributes its exact message to canonical root history. + */ +/** @experimental */ +/** @internal */ +export type FusionProjectionMode = + /** Append the exact root message immediately. */ + | "append" + /** Hold a terminal message outside canonical history until the final commit selects it. */ + | "staged" + /** Do not project the checkpoint into root history. */ + | "none"; +/** + * Durable outcome status of a HydraFusion phase. + */ +/** @experimental */ +export type FusionPhaseStatus = + /** The phase completed successfully. */ + | "succeeded" + /** The phase failed. */ + | "failed" + /** The phase was cancelled. */ + | "cancelled"; /** * Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. */ @@ -2917,6 +3004,365 @@ export interface TaskCompleteData { */ summary?: string; } +/** + * Session event "session.fusion_route_started". Experimental transient signal that HydraFusion routing has started for an eligible turn. + */ +/** @experimental */ +export interface FusionRouteStartedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionRouteStartedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.fusion_route_started". + */ + type: "session.fusion_route_started"; +} +/** + * Experimental transient signal that HydraFusion routing has started for an eligible turn. + */ +/** @experimental */ +export interface FusionRouteStartedData { + /** + * Identifier for this routing attempt before a durable Fusion turn exists. + */ + attemptId: string; + /** + * HydraFusion routing policy requested for the turn. + */ + policy?: string; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel?: string; + turnKind: FusionTurnKind; +} +/** + * Session event "session.fusion_route_failed". Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. + */ +/** @experimental */ +export interface FusionRouteFailedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionRouteFailedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.fusion_route_failed". + */ + type: "session.fusion_route_failed"; +} +/** + * Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. + */ +/** @experimental */ +export interface FusionRouteFailedData { + /** + * Identifier of the routing attempt that failed. + */ + attemptId: string; + /** + * Provider or validation error detail, when available. + */ + errorMessage?: string; + /** + * Concrete model selected as the deterministic fallback. + */ + fallbackModel: string; + /** + * HydraFusion routing policy requested for the turn. + */ + policy: string; + /** + * Stable machine-readable reason for the routing failure. + */ + reason: string; + /** + * Elapsed routing time in milliseconds before the failure. + */ + routingLatencyMs?: number; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel: string; +} +/** + * Session event "session.fusion_resolved". Experimental durable validated HydraFusion route and turn policy. + */ +/** @experimental */ +export interface FusionResolvedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionResolvedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.fusion_resolved". + */ + type: "session.fusion_resolved"; +} +/** + * Experimental durable validated HydraFusion route and turn policy. + */ +/** @experimental */ +export interface FusionResolvedData { + /** + * Version of the validated HydraFusion event contract. + */ + contractVersion: number; + /** + * Concrete model used when the planned primary model cannot execute. + */ + fallbackModel: string; + followUp?: FusionFollowUpRecommendation; + /** + * Concrete model recommended for eligible follow-up turns. + */ + followUpModel: string; + /** + * Stable identifier for the resolved HydraFusion turn. + */ + fusionId: string; + /** + * Version of the executable model universe used for selection. + */ + modelUniverseVersion?: string; + pattern: FusionPattern; + /** + * Version of the validated execution-plan format. + */ + planVersion?: string; + /** + * HydraFusion routing policy used to resolve the plan. + */ + policy: string; + /** + * Version of the local routing policy. + */ + policyVersion?: string; + /** + * Concrete model selected for the primary solver phase. + */ + primaryModel: string; + /** + * Router implementation that supplied the plan. + */ + routeSource?: string; + /** + * Elapsed time in milliseconds required to resolve and validate the route. + */ + routingLatencyMs?: number; + /** + * Identifier of the local policy rule that matched. + */ + ruleId?: string; + /** + * Zero-based index of the local policy rule that matched. + */ + ruleIndex?: number; + /** + * Human-readable name of the local policy rule that matched. + */ + ruleName?: string; + scores?: FusionScores; + /** + * Concrete model selected for the review or judge phase, when required. + */ + secondaryModel: string | null; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel: string; + /** + * Identifier of the session turn associated with the route. + */ + turnId: string; +} +/** + * Durable server recommendation for subsequent HydraFusion turns. + */ +/** @experimental */ +export interface FusionFollowUpRecommendation { + compactionTurn: FusionFollowUpAction; + userTurn: FusionFollowUpAction; +} +/** + * Validated HydraFusion routing capability scores. + */ +/** @experimental */ +export interface FusionScores { + /** + * Code-generation capability score returned by the authenticated router. + */ + codeGen: number; + /** + * Debugging capability score returned by the authenticated router. + */ + debugging: number; + /** + * Reasoning capability score returned by the authenticated router. + */ + reasoning: number; + /** + * Tool-use capability score returned by the authenticated router. + */ + toolUse: number; +} +/** + * Session event "session.fusion_completed". Experimental durable aggregate outcome of a HydraFusion turn. + */ +/** @experimental */ +export interface FusionCompletedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionCompletedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.fusion_completed". + */ + type: "session.fusion_completed"; +} +/** + * Experimental durable aggregate outcome of a HydraFusion turn. + */ +/** @experimental */ +export interface FusionCompletedData { + /** + * Total cached input tokens reported across all phases. + */ + cachedTokens: number; + /** + * Total tokens written to prompt cache across all phases. + */ + cacheWriteTokens?: number; + /** + * Idempotency identifier for the authoritative final commit. + */ + commitId: string; + /** + * Reason the turn used a degraded route, when applicable. + */ + degradedReason: string | null; + /** + * Total elapsed execution time for the HydraFusion turn in milliseconds. + */ + durationMs: number; + /** + * Concrete model that supplied the authoritative final content. + */ + finalSourceModel: string | null; + /** + * Phase whose output supplied the authoritative final content. + */ + finalSourcePhaseId: string | null; + /** + * Concrete model recommended for eligible follow-up turns. + */ + followUpModel: string; + /** + * Stable identifier for the completed HydraFusion turn. + */ + fusionId: string; + /** + * Total input tokens consumed across all phases. + */ + inputTokens: number; + /** + * Stable aggregate outcome of the HydraFusion turn. + */ + outcome: string; + /** + * Total output tokens produced across all phases. + */ + outputTokens: number; + pattern: FusionPattern; + /** + * Number of concrete phases attempted by the turn. + */ + phaseCount: number; + /** + * Total concrete model requests made across all phases. + */ + requestCount: number; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel: string; + /** + * Total normalized AI-unit cost reported across all phases, in nano-AIU. + */ + totalNanoAiu: number; + /** + * Identifier of the session turn associated with the completion. + */ + turnId: string; +} /** * Session event "user.message". Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs. */ @@ -3552,6 +3998,264 @@ export interface AssistantIntentData { */ intent: string; } +/** + * Session event "assistant.fusion_phase_started". Experimental transient HydraFusion phase/model/role signal. + */ +/** @experimental */ +export interface AssistantFusionPhaseStartedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionPhaseStartedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.fusion_phase_started". + */ + type: "assistant.fusion_phase_started"; +} +/** + * Experimental transient HydraFusion phase/model/role signal. + */ +/** @experimental */ +export interface FusionPhaseStartedData { + conversationScope: FusionConversationScope; + /** + * Identifier of the HydraFusion turn containing the phase. + */ + fusionId: string; + /** + * Concrete model executing the phase. + */ + model: string; + pattern: FusionPattern; + /** + * Stable identifier for the concrete phase. + */ + phaseId: string; + phaseKind: FusionPhaseKind; + /** + * Semantic role assigned to the phase. + */ + role: string; +} +/** + * Session event "assistant.fusion_phase_completed". Experimental durable HydraFusion phase output and lossless replay checkpoint. + */ +/** @experimental */ +export interface AssistantFusionPhaseCompletedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionPhaseCompletedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.fusion_phase_completed". + */ + type: "assistant.fusion_phase_completed"; +} +/** + * Experimental durable HydraFusion phase output and lossless replay checkpoint. + */ +/** @experimental */ +export interface FusionPhaseCompletedData { + /** + * Provider-normalized textual output produced by the phase. + */ + content: string; + conversationScope: FusionConversationScope; + /** + * Elapsed execution time for the phase in milliseconds. + */ + durationMs: number; + /** + * Identifier of the HydraFusion turn containing the phase. + */ + fusionId: string; + /** + * Concrete model that executed the phase. + */ + model: string; + /** + * Stable identifier for the completed phase. + */ + phaseId: string; + phaseKind: FusionPhaseKind; + /** + * Exact provider-normalized message used to reconstruct canonical model history. + * + * @internal + */ + projectionMessage?: JsonValue; + /** + * Projection action for the exact internal message. + * + * @internal + */ + projectionMode?: FusionProjectionMode; + /** + * Semantic role assigned to the completed phase. + */ + role: string; + /** + * Terminal request held outside canonical state until selected by the final commit. + * + * @internal + */ + stagedTerminal?: FusionStagedTerminal; + status: FusionPhaseStatus; + usage: FusionPhaseUsage; + /** + * Structured judge or critic verdict, when the phase produces one. + */ + verdict: string | null; +} +/** + * Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it. + */ +/** @experimental */ +/** @internal */ +export interface FusionStagedTerminal { + arguments: string; + assistantMessage: JsonValue; + phaseId: string; + toolCallId: string; + toolName: string; +} +/** + * Aggregate concrete-model usage for one HydraFusion phase. + */ +/** @experimental */ +export interface FusionPhaseUsage { + /** + * Total cached input tokens reported for the phase. + */ + cachedTokens: number; + /** + * Total tokens written to prompt cache during the phase. + */ + cacheWriteTokens?: number; + /** + * Total input tokens consumed by the phase. + */ + inputTokens: number; + /** + * Total output tokens produced by the phase. + */ + outputTokens: number; + /** + * Number of concrete model requests made by the phase. + */ + requestCount: number; + /** + * Total normalized AI-unit cost reported for the phase, in nano-AIU. + */ + totalNanoAiu: number; +} +/** + * Session event "assistant.fusion_phase_failed". Experimental durable typed HydraFusion phase failure and degradation transition. + */ +/** @experimental */ +export interface AssistantFusionPhaseFailedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionPhaseFailedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.fusion_phase_failed". + */ + type: "assistant.fusion_phase_failed"; +} +/** + * Experimental durable typed HydraFusion phase failure and degradation transition. + */ +/** @experimental */ +export interface FusionPhaseFailedData { + conversationScope: FusionConversationScope; + /** + * Identifier of the fallback phase used to continue the turn after degradation. + */ + degradedToPhaseId?: string; + /** + * Elapsed execution time before the phase failed, in milliseconds. + */ + durationMs: number; + /** + * Provider or execution error detail, when available. + */ + errorMessage?: string; + /** + * Identifier of the HydraFusion turn containing the phase. + */ + fusionId: string; + /** + * Concrete model that attempted the phase. + */ + model: string; + /** + * Stable identifier for the failed phase. + */ + phaseId: string; + phaseKind: FusionPhaseKind; + /** + * Stable machine-readable reason for the phase failure. + */ + reason: string; + /** + * Semantic role assigned to the failed phase. + */ + role: string; + status: FusionPhaseStatus; + usage: FusionPhaseUsage; +} /** * Session event "assistant.server_tool_progress". Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message */ @@ -3840,6 +4544,12 @@ export interface AssistantMessageData { * Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume. */ encryptedContent?: string; + /** + * Experimental HydraFusion source attribution for this ordinary authoritative assistant message. + * + * @experimental + */ + fusion?: FusionAttribution; /** * CAPI interaction ID for correlating this message with upstream telemetry */ @@ -4028,6 +4738,56 @@ export interface CitationLocationBlock { */ type: "block"; } +/** + * Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it. + */ +/** @experimental */ +export interface FusionAttribution { + /** + * Idempotency identifier for the authoritative commit, when the event belongs to the selected output. + */ + commitId?: string; + /** + * Conversation scope in which the concrete phase executed. + */ + conversationScope?: string; + /** + * Stable identifier for the HydraFusion turn that produced the event. + */ + fusionId: string; + /** + * HydraFusion orchestration pattern selected for the turn. + */ + pattern: string; + /** + * Identifier of the concrete phase that produced the event. + */ + phaseId?: string; + /** + * Kind of concrete phase that produced the event. + */ + phaseKind?: string; + /** + * HydraFusion routing policy used for the turn. + */ + policy: string; + /** + * Semantic role assigned to the concrete phase. + */ + role?: string; + /** + * Concrete model that produced the attributed event. + */ + sourceModel?: string; + /** + * Phase whose output supplied the authoritative content, when different from the executing phase. + */ + sourcePhaseId?: string; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel: string; +} /** * Neutral provider-tagged reasoning content blocks preserved verbatim for round-tripping */ @@ -4375,6 +5135,12 @@ export interface AssistantUsageData { * @internal */ frontierSource?: string; + /** + * Experimental HydraFusion attribution for this concrete model call's usage. + * + * @experimental + */ + fusion?: FusionAttribution; /** * What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls */ @@ -4648,6 +5414,12 @@ export interface ModelCallFailureData { */ errorType?: string; failureKind?: ModelCallFailureKind; + /** + * Experimental HydraFusion attribution for this failed concrete model call. + * + * @experimental + */ + fusion?: FusionAttribution; /** * What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls */ @@ -4922,6 +5694,12 @@ export interface ToolExecutionStartData { * When true, the tool output should be displayed expanded (verbatim) in the CLI timeline */ displayVerbatim?: boolean; + /** + * Experimental HydraFusion attribution for this tool execution. + * + * @experimental + */ + fusion?: FusionAttribution; /** * Name of the MCP server hosting this tool, when the tool is an MCP tool */ @@ -5131,6 +5909,12 @@ export interface ToolExecutionCompleteEvent { */ export interface ToolExecutionCompleteData { error?: ToolExecutionCompleteError; + /** + * Experimental HydraFusion attribution for this tool completion. + * + * @experimental + */ + fusion?: FusionAttribution; /** * CAPI interaction ID for correlating this tool execution with upstream telemetry */ @@ -5388,6 +6172,10 @@ export interface ToolExecutionCompleteContentShellExit { * Exit code from the completed shell command */ exitCode: number; + /** + * Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + */ + outputFilePath?: string; /** * Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 242e4041ed..075efd8f4d 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -16715,6 +16715,10 @@ class ExternalToolTextResultForLlmContentShellExit: cwd: str | None = None """Working directory where the shell command was executed""" + output_file_path: str | None = None + """Path reported in the shell session's filesystem namespace when shell output exceeded the + configured large-output threshold. + """ output_preview: str | None = None """Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. @@ -16728,9 +16732,10 @@ def from_dict(obj: Any) -> 'ExternalToolTextResultForLlmContentShellExit': exit_code = from_int(obj.get("exitCode")) shell_id = from_str(obj.get("shellId")) cwd = from_union([from_str, from_none], obj.get("cwd")) + output_file_path = from_union([from_str, from_none], obj.get("outputFilePath")) output_preview = from_union([from_str, from_none], obj.get("outputPreview")) output_truncated = from_union([from_bool, from_none], obj.get("outputTruncated")) - return ExternalToolTextResultForLlmContentShellExit(exit_code, shell_id, cwd, output_preview, output_truncated) + return ExternalToolTextResultForLlmContentShellExit(exit_code, shell_id, cwd, output_file_path, output_preview, output_truncated) def to_dict(self) -> dict: result: dict = {} @@ -16739,6 +16744,8 @@ def to_dict(self) -> dict: result["type"] = self.type if self.cwd is not None: result["cwd"] = from_union([from_str, from_none], self.cwd) + if self.output_file_path is not None: + result["outputFilePath"] = from_union([from_str, from_none], self.output_file_path) if self.output_preview is not None: result["outputPreview"] = from_union([from_str, from_none], self.output_preview) if self.output_truncated is not None: @@ -28609,15 +28616,9 @@ class ToolsGetBuiltinDescriptorsRequest: include_author: bool | None = None """Whether tool descriptors should include authoring metadata.""" - no_view_line_numbers: bool | None = None - """Whether line numbers should be omitted from the view tool descriptor.""" - reduce_user_intervention: bool | None = None """Whether descriptors should favor fewer user-intervention prompts.""" - shell_async_only_enabled: bool | None = None - """Whether shell commands may only run asynchronously.""" - shell_config: ToolsShellDescriptorConfig | None = None """Shell-specific names and description lines for shell tools.""" @@ -28635,14 +28636,12 @@ def from_dict(obj: Any) -> 'ToolsGetBuiltinDescriptorsRequest': assert isinstance(obj, dict) background_task_notifications_enabled = from_union([from_bool, from_none], obj.get("backgroundTaskNotificationsEnabled")) include_author = from_union([from_bool, from_none], obj.get("includeAuthor")) - no_view_line_numbers = from_union([from_bool, from_none], obj.get("noViewLineNumbers")) reduce_user_intervention = from_union([from_bool, from_none], obj.get("reduceUserIntervention")) - shell_async_only_enabled = from_union([from_bool, from_none], obj.get("shellAsyncOnlyEnabled")) shell_config = from_union([ToolsShellDescriptorConfig.from_dict, from_none], obj.get("shellConfig")) shell_supports_power_shell7_syntax = from_union([from_bool, from_none], obj.get("shellSupportsPowerShell7Syntax")) shell_timeout_ms = from_union([from_float, from_none], obj.get("shellTimeoutMs")) skill_embedding_enabled = from_union([from_bool, from_none], obj.get("skillEmbeddingEnabled")) - return ToolsGetBuiltinDescriptorsRequest(background_task_notifications_enabled, include_author, no_view_line_numbers, reduce_user_intervention, shell_async_only_enabled, shell_config, shell_supports_power_shell7_syntax, shell_timeout_ms, skill_embedding_enabled) + return ToolsGetBuiltinDescriptorsRequest(background_task_notifications_enabled, include_author, reduce_user_intervention, shell_config, shell_supports_power_shell7_syntax, shell_timeout_ms, skill_embedding_enabled) def to_dict(self) -> dict: result: dict = {} @@ -28650,12 +28649,8 @@ def to_dict(self) -> dict: result["backgroundTaskNotificationsEnabled"] = from_union([from_bool, from_none], self.background_task_notifications_enabled) if self.include_author is not None: result["includeAuthor"] = from_union([from_bool, from_none], self.include_author) - if self.no_view_line_numbers is not None: - result["noViewLineNumbers"] = from_union([from_bool, from_none], self.no_view_line_numbers) if self.reduce_user_intervention is not None: result["reduceUserIntervention"] = from_union([from_bool, from_none], self.reduce_user_intervention) - if self.shell_async_only_enabled is not None: - result["shellAsyncOnlyEnabled"] = from_union([from_bool, from_none], self.shell_async_only_enabled) if self.shell_config is not None: result["shellConfig"] = from_union([lambda x: to_class(ToolsShellDescriptorConfig, x), from_none], self.shell_config) if self.shell_supports_power_shell7_syntax is not None: diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index d4af5f2735..91e54b57d2 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -154,12 +154,26 @@ class SessionEventType(Enum): SESSION_COMPACTION_START = "session.compaction_start" SESSION_COMPACTION_COMPLETE = "session.compaction_complete" SESSION_TASK_COMPLETE = "session.task_complete" + # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_FUSION_ROUTE_STARTED = "session.fusion_route_started" + # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_FUSION_ROUTE_FAILED = "session.fusion_route_failed" + # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_FUSION_RESOLVED = "session.fusion_resolved" + # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_FUSION_COMPLETED = "session.fusion_completed" USER_MESSAGE = "user.message" PENDING_MESSAGES_MODIFIED = "pending_messages.modified" ASSISTANT_TURN_START = "assistant.turn_start" ASSISTANT_TURN_RETRY = "assistant.turn_retry" AGENT_INTERRUPTED = "agent.interrupted" ASSISTANT_INTENT = "assistant.intent" + # Experimental: this event is part of an experimental API and may change or be removed. + ASSISTANT_FUSION_PHASE_STARTED = "assistant.fusion_phase_started" + # Experimental: this event is part of an experimental API and may change or be removed. + ASSISTANT_FUSION_PHASE_COMPLETED = "assistant.fusion_phase_completed" + # Experimental: this event is part of an experimental API and may change or be removed. + ASSISTANT_FUSION_PHASE_FAILED = "assistant.fusion_phase_failed" ASSISTANT_SERVER_TOOL_PROGRESS = "assistant.server_tool_progress" ASSISTANT_REASONING = "assistant.reasoning" ASSISTANT_REASONING_DELTA = "assistant.reasoning_delta" @@ -382,6 +396,194 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class AssistantFusionPhaseCompletedData: + "Experimental durable HydraFusion phase output and lossless replay checkpoint." + content: str + conversation_scope: FusionConversationScope + duration_ms: float + fusion_id: str + model: str + phase_id: str + phase_kind: FusionPhaseKind + role: str + status: FusionPhaseStatus + usage: FusionPhaseUsage + verdict: str | None + # Internal: this field is an internal SDK API and is not part of the public surface. + _projection_message: Any = None + # Internal: this field is an internal SDK API and is not part of the public surface. + _projection_mode: _FusionProjectionMode | None = None + # Internal: this field is an internal SDK API and is not part of the public surface. + _staged_terminal: _FusionStagedTerminal | None = None + + @staticmethod + def from_dict(obj: Any) -> "AssistantFusionPhaseCompletedData": + assert isinstance(obj, dict) + content = from_str(obj.get("content")) + conversation_scope = parse_enum(FusionConversationScope, obj.get("conversationScope")) + duration_ms = from_float(obj.get("durationMs")) + fusion_id = from_str(obj.get("fusionId")) + model = from_str(obj.get("model")) + phase_id = from_str(obj.get("phaseId")) + phase_kind = parse_enum(FusionPhaseKind, obj.get("phaseKind")) + role = from_str(obj.get("role")) + status = parse_enum(FusionPhaseStatus, obj.get("status")) + usage = FusionPhaseUsage.from_dict(obj.get("usage")) + verdict = from_union([from_none, from_str], obj.get("verdict")) + _projection_message = obj.get("projectionMessage") + _projection_mode = from_union([from_none, lambda x: parse_enum(_FusionProjectionMode, x)], obj.get("projectionMode")) + _staged_terminal = from_union([from_none, _FusionStagedTerminal.from_dict], obj.get("stagedTerminal")) + return AssistantFusionPhaseCompletedData( + content=content, + conversation_scope=conversation_scope, + duration_ms=duration_ms, + fusion_id=fusion_id, + model=model, + phase_id=phase_id, + phase_kind=phase_kind, + role=role, + status=status, + usage=usage, + verdict=verdict, + _projection_message=_projection_message, + _projection_mode=_projection_mode, + _staged_terminal=_staged_terminal, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["content"] = from_str(self.content) + result["conversationScope"] = to_enum(FusionConversationScope, self.conversation_scope) + result["durationMs"] = to_float(self.duration_ms) + result["fusionId"] = from_str(self.fusion_id) + result["model"] = from_str(self.model) + result["phaseId"] = from_str(self.phase_id) + result["phaseKind"] = to_enum(FusionPhaseKind, self.phase_kind) + result["role"] = from_str(self.role) + result["status"] = to_enum(FusionPhaseStatus, self.status) + result["usage"] = to_class(FusionPhaseUsage, self.usage) + result["verdict"] = from_union([from_none, from_str], self.verdict) + if self._projection_message is not None: + result["projectionMessage"] = self._projection_message + if self._projection_mode is not None: + result["projectionMode"] = from_union([from_none, lambda x: to_enum(_FusionProjectionMode, x)], self._projection_mode) + if self._staged_terminal is not None: + result["stagedTerminal"] = from_union([from_none, lambda x: to_class(_FusionStagedTerminal, x)], self._staged_terminal) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class AssistantFusionPhaseFailedData: + "Experimental durable typed HydraFusion phase failure and degradation transition." + conversation_scope: FusionConversationScope + duration_ms: float + fusion_id: str + model: str + phase_id: str + phase_kind: FusionPhaseKind + reason: str + role: str + status: FusionPhaseStatus + usage: FusionPhaseUsage + degraded_to_phase_id: str | None = None + error_message: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "AssistantFusionPhaseFailedData": + assert isinstance(obj, dict) + conversation_scope = parse_enum(FusionConversationScope, obj.get("conversationScope")) + duration_ms = from_float(obj.get("durationMs")) + fusion_id = from_str(obj.get("fusionId")) + model = from_str(obj.get("model")) + phase_id = from_str(obj.get("phaseId")) + phase_kind = parse_enum(FusionPhaseKind, obj.get("phaseKind")) + reason = from_str(obj.get("reason")) + role = from_str(obj.get("role")) + status = parse_enum(FusionPhaseStatus, obj.get("status")) + usage = FusionPhaseUsage.from_dict(obj.get("usage")) + degraded_to_phase_id = from_union([from_none, from_str], obj.get("degradedToPhaseId")) + error_message = from_union([from_none, from_str], obj.get("errorMessage")) + return AssistantFusionPhaseFailedData( + conversation_scope=conversation_scope, + duration_ms=duration_ms, + fusion_id=fusion_id, + model=model, + phase_id=phase_id, + phase_kind=phase_kind, + reason=reason, + role=role, + status=status, + usage=usage, + degraded_to_phase_id=degraded_to_phase_id, + error_message=error_message, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["conversationScope"] = to_enum(FusionConversationScope, self.conversation_scope) + result["durationMs"] = to_float(self.duration_ms) + result["fusionId"] = from_str(self.fusion_id) + result["model"] = from_str(self.model) + result["phaseId"] = from_str(self.phase_id) + result["phaseKind"] = to_enum(FusionPhaseKind, self.phase_kind) + result["reason"] = from_str(self.reason) + result["role"] = from_str(self.role) + result["status"] = to_enum(FusionPhaseStatus, self.status) + result["usage"] = to_class(FusionPhaseUsage, self.usage) + if self.degraded_to_phase_id is not None: + result["degradedToPhaseId"] = from_union([from_none, from_str], self.degraded_to_phase_id) + if self.error_message is not None: + result["errorMessage"] = from_union([from_none, from_str], self.error_message) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class AssistantFusionPhaseStartedData: + "Experimental transient HydraFusion phase/model/role signal." + conversation_scope: FusionConversationScope + fusion_id: str + model: str + pattern: FusionPattern + phase_id: str + phase_kind: FusionPhaseKind + role: str + + @staticmethod + def from_dict(obj: Any) -> "AssistantFusionPhaseStartedData": + assert isinstance(obj, dict) + conversation_scope = parse_enum(FusionConversationScope, obj.get("conversationScope")) + fusion_id = from_str(obj.get("fusionId")) + model = from_str(obj.get("model")) + pattern = parse_enum(FusionPattern, obj.get("pattern")) + phase_id = from_str(obj.get("phaseId")) + phase_kind = parse_enum(FusionPhaseKind, obj.get("phaseKind")) + role = from_str(obj.get("role")) + return AssistantFusionPhaseStartedData( + conversation_scope=conversation_scope, + fusion_id=fusion_id, + model=model, + pattern=pattern, + phase_id=phase_id, + phase_kind=phase_kind, + role=role, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["conversationScope"] = to_enum(FusionConversationScope, self.conversation_scope) + result["fusionId"] = from_str(self.fusion_id) + result["model"] = from_str(self.model) + result["pattern"] = to_enum(FusionPattern, self.pattern) + result["phaseId"] = from_str(self.phase_id) + result["phaseKind"] = to_enum(FusionPhaseKind, self.phase_kind) + result["role"] = from_str(self.role) + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class AssistantMessageReasoningBlocks: @@ -907,6 +1109,206 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FusionAttribution: + "Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it." + fusion_id: str + pattern: str + policy: str + synthetic_model: str + commit_id: str | None = None + conversation_scope: str | None = None + phase_id: str | None = None + phase_kind: str | None = None + role: str | None = None + source_model: str | None = None + source_phase_id: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "FusionAttribution": + assert isinstance(obj, dict) + fusion_id = from_str(obj.get("fusionId")) + pattern = from_str(obj.get("pattern")) + policy = from_str(obj.get("policy")) + synthetic_model = from_str(obj.get("syntheticModel")) + commit_id = from_union([from_none, from_str], obj.get("commitId")) + conversation_scope = from_union([from_none, from_str], obj.get("conversationScope")) + phase_id = from_union([from_none, from_str], obj.get("phaseId")) + phase_kind = from_union([from_none, from_str], obj.get("phaseKind")) + role = from_union([from_none, from_str], obj.get("role")) + source_model = from_union([from_none, from_str], obj.get("sourceModel")) + source_phase_id = from_union([from_none, from_str], obj.get("sourcePhaseId")) + return FusionAttribution( + fusion_id=fusion_id, + pattern=pattern, + policy=policy, + synthetic_model=synthetic_model, + commit_id=commit_id, + conversation_scope=conversation_scope, + phase_id=phase_id, + phase_kind=phase_kind, + role=role, + source_model=source_model, + source_phase_id=source_phase_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["fusionId"] = from_str(self.fusion_id) + result["pattern"] = from_str(self.pattern) + result["policy"] = from_str(self.policy) + result["syntheticModel"] = from_str(self.synthetic_model) + if self.commit_id is not None: + result["commitId"] = from_union([from_none, from_str], self.commit_id) + if self.conversation_scope is not None: + result["conversationScope"] = from_union([from_none, from_str], self.conversation_scope) + if self.phase_id is not None: + result["phaseId"] = from_union([from_none, from_str], self.phase_id) + if self.phase_kind is not None: + result["phaseKind"] = from_union([from_none, from_str], self.phase_kind) + if self.role is not None: + result["role"] = from_union([from_none, from_str], self.role) + if self.source_model is not None: + result["sourceModel"] = from_union([from_none, from_str], self.source_model) + if self.source_phase_id is not None: + result["sourcePhaseId"] = from_union([from_none, from_str], self.source_phase_id) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FusionFollowUpRecommendation: + "Durable server recommendation for subsequent HydraFusion turns." + compaction_turn: FusionFollowUpAction + user_turn: FusionFollowUpAction + + @staticmethod + def from_dict(obj: Any) -> "FusionFollowUpRecommendation": + assert isinstance(obj, dict) + compaction_turn = parse_enum(FusionFollowUpAction, obj.get("compactionTurn")) + user_turn = parse_enum(FusionFollowUpAction, obj.get("userTurn")) + return FusionFollowUpRecommendation( + compaction_turn=compaction_turn, + user_turn=user_turn, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["compactionTurn"] = to_enum(FusionFollowUpAction, self.compaction_turn) + result["userTurn"] = to_enum(FusionFollowUpAction, self.user_turn) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FusionPhaseUsage: + "Aggregate concrete-model usage for one HydraFusion phase." + cached_tokens: int + input_tokens: int + output_tokens: int + request_count: int + total_nano_aiu: float + cache_write_tokens: int | None = None + + @staticmethod + def from_dict(obj: Any) -> "FusionPhaseUsage": + assert isinstance(obj, dict) + cached_tokens = from_int(obj.get("cachedTokens")) + input_tokens = from_int(obj.get("inputTokens")) + output_tokens = from_int(obj.get("outputTokens")) + request_count = from_int(obj.get("requestCount")) + total_nano_aiu = from_float(obj.get("totalNanoAiu")) + cache_write_tokens = from_union([from_none, from_int], obj.get("cacheWriteTokens")) + return FusionPhaseUsage( + cached_tokens=cached_tokens, + input_tokens=input_tokens, + output_tokens=output_tokens, + request_count=request_count, + total_nano_aiu=total_nano_aiu, + cache_write_tokens=cache_write_tokens, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["cachedTokens"] = to_int(self.cached_tokens) + result["inputTokens"] = to_int(self.input_tokens) + result["outputTokens"] = to_int(self.output_tokens) + result["requestCount"] = to_int(self.request_count) + result["totalNanoAiu"] = to_float(self.total_nano_aiu) + if self.cache_write_tokens is not None: + result["cacheWriteTokens"] = from_union([from_none, to_int], self.cache_write_tokens) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class FusionScores: + "Validated HydraFusion routing capability scores." + code_gen: float + debugging: float + reasoning: float + tool_use: float + + @staticmethod + def from_dict(obj: Any) -> "FusionScores": + assert isinstance(obj, dict) + code_gen = from_float(obj.get("codeGen")) + debugging = from_float(obj.get("debugging")) + reasoning = from_float(obj.get("reasoning")) + tool_use = from_float(obj.get("toolUse")) + return FusionScores( + code_gen=code_gen, + debugging=debugging, + reasoning=reasoning, + tool_use=tool_use, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["codeGen"] = to_float(self.code_gen) + result["debugging"] = to_float(self.debugging) + result["reasoning"] = to_float(self.reasoning) + result["toolUse"] = to_float(self.tool_use) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class _FusionStagedTerminal: + "Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it." + arguments: str + assistant_message: Any + phase_id: str + tool_call_id: str + tool_name: str + + @staticmethod + def from_dict(obj: Any) -> "_FusionStagedTerminal": + assert isinstance(obj, dict) + arguments = from_str(obj.get("arguments")) + assistant_message = obj.get("assistantMessage") + phase_id = from_str(obj.get("phaseId")) + tool_call_id = from_str(obj.get("toolCallId")) + tool_name = from_str(obj.get("toolName")) + return _FusionStagedTerminal( + arguments=arguments, + assistant_message=assistant_message, + phase_id=phase_id, + tool_call_id=tool_call_id, + tool_name=tool_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["arguments"] = from_str(self.arguments) + result["assistantMessage"] = self.assistant_message + result["phaseId"] = from_str(self.phase_id) + result["toolCallId"] = from_str(self.tool_call_id) + result["toolName"] = from_str(self.tool_name) + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class OmittedBinaryResult: @@ -1274,6 +1676,281 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFusionCompletedData: + "Experimental durable aggregate outcome of a HydraFusion turn." + cached_tokens: int + commit_id: str + degraded_reason: str | None + duration_ms: float + final_source_model: str | None + final_source_phase_id: str | None + follow_up_model: str + fusion_id: str + input_tokens: int + outcome: str + output_tokens: int + pattern: FusionPattern + phase_count: int + request_count: int + synthetic_model: str + total_nano_aiu: float + turn_id: str + cache_write_tokens: int | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionFusionCompletedData": + assert isinstance(obj, dict) + cached_tokens = from_int(obj.get("cachedTokens")) + commit_id = from_str(obj.get("commitId")) + degraded_reason = from_union([from_none, from_str], obj.get("degradedReason")) + duration_ms = from_float(obj.get("durationMs")) + final_source_model = from_union([from_none, from_str], obj.get("finalSourceModel")) + final_source_phase_id = from_union([from_none, from_str], obj.get("finalSourcePhaseId")) + follow_up_model = from_str(obj.get("followUpModel")) + fusion_id = from_str(obj.get("fusionId")) + input_tokens = from_int(obj.get("inputTokens")) + outcome = from_str(obj.get("outcome")) + output_tokens = from_int(obj.get("outputTokens")) + pattern = parse_enum(FusionPattern, obj.get("pattern")) + phase_count = from_int(obj.get("phaseCount")) + request_count = from_int(obj.get("requestCount")) + synthetic_model = from_str(obj.get("syntheticModel")) + total_nano_aiu = from_float(obj.get("totalNanoAiu")) + turn_id = from_str(obj.get("turnId")) + cache_write_tokens = from_union([from_none, from_int], obj.get("cacheWriteTokens")) + return SessionFusionCompletedData( + cached_tokens=cached_tokens, + commit_id=commit_id, + degraded_reason=degraded_reason, + duration_ms=duration_ms, + final_source_model=final_source_model, + final_source_phase_id=final_source_phase_id, + follow_up_model=follow_up_model, + fusion_id=fusion_id, + input_tokens=input_tokens, + outcome=outcome, + output_tokens=output_tokens, + pattern=pattern, + phase_count=phase_count, + request_count=request_count, + synthetic_model=synthetic_model, + total_nano_aiu=total_nano_aiu, + turn_id=turn_id, + cache_write_tokens=cache_write_tokens, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["cachedTokens"] = to_int(self.cached_tokens) + result["commitId"] = from_str(self.commit_id) + result["degradedReason"] = from_union([from_none, from_str], self.degraded_reason) + result["durationMs"] = to_float(self.duration_ms) + result["finalSourceModel"] = from_union([from_none, from_str], self.final_source_model) + result["finalSourcePhaseId"] = from_union([from_none, from_str], self.final_source_phase_id) + result["followUpModel"] = from_str(self.follow_up_model) + result["fusionId"] = from_str(self.fusion_id) + result["inputTokens"] = to_int(self.input_tokens) + result["outcome"] = from_str(self.outcome) + result["outputTokens"] = to_int(self.output_tokens) + result["pattern"] = to_enum(FusionPattern, self.pattern) + result["phaseCount"] = to_int(self.phase_count) + result["requestCount"] = to_int(self.request_count) + result["syntheticModel"] = from_str(self.synthetic_model) + result["totalNanoAiu"] = to_float(self.total_nano_aiu) + result["turnId"] = from_str(self.turn_id) + if self.cache_write_tokens is not None: + result["cacheWriteTokens"] = from_union([from_none, to_int], self.cache_write_tokens) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFusionResolvedData: + "Experimental durable validated HydraFusion route and turn policy." + contract_version: int + fallback_model: str + follow_up_model: str + fusion_id: str + pattern: FusionPattern + policy: str + primary_model: str + secondary_model: str | None + synthetic_model: str + turn_id: str + follow_up: FusionFollowUpRecommendation | None = None + model_universe_version: str | None = None + plan_version: str | None = None + policy_version: str | None = None + route_source: str | None = None + routing_latency_ms: float | None = None + rule_id: str | None = None + rule_index: int | None = None + rule_name: str | None = None + scores: FusionScores | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionFusionResolvedData": + assert isinstance(obj, dict) + contract_version = from_int(obj.get("contractVersion")) + fallback_model = from_str(obj.get("fallbackModel")) + follow_up_model = from_str(obj.get("followUpModel")) + fusion_id = from_str(obj.get("fusionId")) + pattern = parse_enum(FusionPattern, obj.get("pattern")) + policy = from_str(obj.get("policy")) + primary_model = from_str(obj.get("primaryModel")) + secondary_model = from_union([from_none, from_str], obj.get("secondaryModel")) + synthetic_model = from_str(obj.get("syntheticModel")) + turn_id = from_str(obj.get("turnId")) + follow_up = from_union([from_none, FusionFollowUpRecommendation.from_dict], obj.get("followUp")) + model_universe_version = from_union([from_none, from_str], obj.get("modelUniverseVersion")) + plan_version = from_union([from_none, from_str], obj.get("planVersion")) + policy_version = from_union([from_none, from_str], obj.get("policyVersion")) + route_source = from_union([from_none, from_str], obj.get("routeSource")) + routing_latency_ms = from_union([from_none, from_float], obj.get("routingLatencyMs")) + rule_id = from_union([from_none, from_str], obj.get("ruleId")) + rule_index = from_union([from_none, from_int], obj.get("ruleIndex")) + rule_name = from_union([from_none, from_str], obj.get("ruleName")) + scores = from_union([from_none, FusionScores.from_dict], obj.get("scores")) + return SessionFusionResolvedData( + contract_version=contract_version, + fallback_model=fallback_model, + follow_up_model=follow_up_model, + fusion_id=fusion_id, + pattern=pattern, + policy=policy, + primary_model=primary_model, + secondary_model=secondary_model, + synthetic_model=synthetic_model, + turn_id=turn_id, + follow_up=follow_up, + model_universe_version=model_universe_version, + plan_version=plan_version, + policy_version=policy_version, + route_source=route_source, + routing_latency_ms=routing_latency_ms, + rule_id=rule_id, + rule_index=rule_index, + rule_name=rule_name, + scores=scores, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["contractVersion"] = to_int(self.contract_version) + result["fallbackModel"] = from_str(self.fallback_model) + result["followUpModel"] = from_str(self.follow_up_model) + result["fusionId"] = from_str(self.fusion_id) + result["pattern"] = to_enum(FusionPattern, self.pattern) + result["policy"] = from_str(self.policy) + result["primaryModel"] = from_str(self.primary_model) + result["secondaryModel"] = from_union([from_none, from_str], self.secondary_model) + result["syntheticModel"] = from_str(self.synthetic_model) + result["turnId"] = from_str(self.turn_id) + if self.follow_up is not None: + result["followUp"] = from_union([from_none, lambda x: to_class(FusionFollowUpRecommendation, x)], self.follow_up) + if self.model_universe_version is not None: + result["modelUniverseVersion"] = from_union([from_none, from_str], self.model_universe_version) + if self.plan_version is not None: + result["planVersion"] = from_union([from_none, from_str], self.plan_version) + if self.policy_version is not None: + result["policyVersion"] = from_union([from_none, from_str], self.policy_version) + if self.route_source is not None: + result["routeSource"] = from_union([from_none, from_str], self.route_source) + if self.routing_latency_ms is not None: + result["routingLatencyMs"] = from_union([from_none, to_float], self.routing_latency_ms) + if self.rule_id is not None: + result["ruleId"] = from_union([from_none, from_str], self.rule_id) + if self.rule_index is not None: + result["ruleIndex"] = from_union([from_none, to_int], self.rule_index) + if self.rule_name is not None: + result["ruleName"] = from_union([from_none, from_str], self.rule_name) + if self.scores is not None: + result["scores"] = from_union([from_none, lambda x: to_class(FusionScores, x)], self.scores) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFusionRouteFailedData: + "Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn." + attempt_id: str + fallback_model: str + policy: str + reason: str + synthetic_model: str + error_message: str | None = None + routing_latency_ms: float | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionFusionRouteFailedData": + assert isinstance(obj, dict) + attempt_id = from_str(obj.get("attemptId")) + fallback_model = from_str(obj.get("fallbackModel")) + policy = from_str(obj.get("policy")) + reason = from_str(obj.get("reason")) + synthetic_model = from_str(obj.get("syntheticModel")) + error_message = from_union([from_none, from_str], obj.get("errorMessage")) + routing_latency_ms = from_union([from_none, from_float], obj.get("routingLatencyMs")) + return SessionFusionRouteFailedData( + attempt_id=attempt_id, + fallback_model=fallback_model, + policy=policy, + reason=reason, + synthetic_model=synthetic_model, + error_message=error_message, + routing_latency_ms=routing_latency_ms, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["attemptId"] = from_str(self.attempt_id) + result["fallbackModel"] = from_str(self.fallback_model) + result["policy"] = from_str(self.policy) + result["reason"] = from_str(self.reason) + result["syntheticModel"] = from_str(self.synthetic_model) + if self.error_message is not None: + result["errorMessage"] = from_union([from_none, from_str], self.error_message) + if self.routing_latency_ms is not None: + result["routingLatencyMs"] = from_union([from_none, to_float], self.routing_latency_ms) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionFusionRouteStartedData: + "Experimental transient signal that HydraFusion routing has started for an eligible turn." + attempt_id: str + turn_kind: FusionTurnKind + policy: str | None = None + synthetic_model: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionFusionRouteStartedData": + assert isinstance(obj, dict) + attempt_id = from_str(obj.get("attemptId")) + turn_kind = parse_enum(FusionTurnKind, obj.get("turnKind")) + policy = from_union([from_none, from_str], obj.get("policy")) + synthetic_model = from_union([from_none, from_str], obj.get("syntheticModel")) + return SessionFusionRouteStartedData( + attempt_id=attempt_id, + turn_kind=turn_kind, + policy=policy, + synthetic_model=synthetic_model, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["attemptId"] = from_str(self.attempt_id) + result["turnKind"] = to_enum(FusionTurnKind, self.turn_kind) + if self.policy is not None: + result["policy"] = from_union([from_none, from_str], self.policy) + if self.synthetic_model is not None: + result["syntheticModel"] = from_union([from_none, from_str], self.synthetic_model) + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionManagedSettingsEnforcedData: @@ -1589,6 +2266,8 @@ class AssistantMessageData: citations: Citations | None = None client_request_id: str | None = None encrypted_content: str | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + fusion: FusionAttribution | None = None interaction_id: str | None = None model: str | None = None output_tokens: int | None = None @@ -1617,6 +2296,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": citations = from_union([from_none, Citations.from_dict], obj.get("citations")) client_request_id = from_union([from_none, from_str], obj.get("clientRequestId")) encrypted_content = from_union([from_none, from_str], obj.get("encryptedContent")) + fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) interaction_id = from_union([from_none, from_str], obj.get("interactionId")) model = from_union([from_none, from_str], obj.get("model")) output_tokens = from_union([from_none, from_int], obj.get("outputTokens")) @@ -1641,6 +2321,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": citations=citations, client_request_id=client_request_id, encrypted_content=encrypted_content, + fusion=fusion, interaction_id=interaction_id, model=model, output_tokens=output_tokens, @@ -1674,6 +2355,8 @@ def to_dict(self) -> dict: result["clientRequestId"] = from_union([from_none, from_str], self.client_request_id) if self.encrypted_content is not None: result["encryptedContent"] = from_union([from_none, from_str], self.encrypted_content) + if self.fusion is not None: + result["fusion"] = from_union([from_none, lambda x: to_class(FusionAttribution, x)], self.fusion) if self.interaction_id is not None: result["interactionId"] = from_union([from_none, from_str], self.interaction_id) if self.model is not None: @@ -2105,6 +2788,8 @@ class AssistantUsageData: finish_reason: str | None = None # Internal: this field is an internal SDK API and is not part of the public surface. _frontier_source: str | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + fusion: FusionAttribution | None = None initiator: str | None = None input_tokens: int | None = None interaction_type: str | None = None @@ -2154,6 +2839,7 @@ def from_dict(obj: Any) -> "AssistantUsageData": duration = from_union([from_none, from_timedelta], obj.get("duration")) finish_reason = from_union([from_none, from_str], obj.get("finishReason")) _frontier_source = from_union([from_none, from_str], obj.get("frontierSource")) + fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) initiator = from_union([from_none, from_str], obj.get("initiator")) input_tokens = from_union([from_none, from_int], obj.get("inputTokens")) interaction_type = from_union([from_none, from_str], obj.get("interactionType")) @@ -2195,6 +2881,7 @@ def from_dict(obj: Any) -> "AssistantUsageData": duration=duration, finish_reason=finish_reason, _frontier_source=_frontier_source, + fusion=fusion, initiator=initiator, input_tokens=input_tokens, interaction_type=interaction_type, @@ -2254,6 +2941,8 @@ def to_dict(self) -> dict: result["finishReason"] = from_union([from_none, from_str], self.finish_reason) if self._frontier_source is not None: result["frontierSource"] = from_union([from_none, from_str], self._frontier_source) + if self.fusion is not None: + result["fusion"] = from_union([from_none, lambda x: to_class(FusionAttribution, x)], self.fusion) if self.initiator is not None: result["initiator"] = from_union([from_none, from_str], self.initiator) if self.input_tokens is not None: @@ -4487,6 +5176,8 @@ class ModelCallFailureData: error_message: str | None = None error_type: str | None = None failure_kind: ModelCallFailureKind | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + fusion: FusionAttribution | None = None initiator: str | None = None interaction_type: str | None = None is_auto: bool | None = None @@ -4516,6 +5207,7 @@ def from_dict(obj: Any) -> "ModelCallFailureData": error_message = from_union([from_none, from_str], obj.get("errorMessage")) error_type = from_union([from_none, from_str], obj.get("errorType")) failure_kind = from_union([from_none, lambda x: parse_enum(ModelCallFailureKind, x)], obj.get("failureKind")) + fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) initiator = from_union([from_none, from_str], obj.get("initiator")) interaction_type = from_union([from_none, from_str], obj.get("interactionType")) is_auto = from_union([from_none, from_bool], obj.get("isAuto")) @@ -4541,6 +5233,7 @@ def from_dict(obj: Any) -> "ModelCallFailureData": error_message=error_message, error_type=error_type, failure_kind=failure_kind, + fusion=fusion, initiator=initiator, interaction_type=interaction_type, is_auto=is_auto, @@ -4577,6 +5270,8 @@ def to_dict(self) -> dict: result["errorType"] = from_union([from_none, from_str], self.error_type) if self.failure_kind is not None: result["failureKind"] = from_union([from_none, lambda x: to_enum(ModelCallFailureKind, x)], self.failure_kind) + if self.fusion is not None: + result["fusion"] = from_union([from_none, lambda x: to_class(FusionAttribution, x)], self.fusion) if self.initiator is not None: result["initiator"] = from_union([from_none, from_str], self.initiator) if self.interaction_type is not None: @@ -4699,6 +5394,8 @@ def to_dict(self) -> dict: class ModelCallStartData: "Model API dispatch metadata for internal telemetry" turn_id: str + # Experimental: this field is part of an experimental API and may change or be removed. + fusion: FusionAttribution | None = None model: str | None = None # Internal: this field is an internal SDK API and is not part of the public surface. _previous_response_id: str | None = None @@ -4707,10 +5404,12 @@ class ModelCallStartData: def from_dict(obj: Any) -> "ModelCallStartData": assert isinstance(obj, dict) turn_id = from_str(obj.get("turnId")) + fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) model = from_union([from_none, from_str], obj.get("model")) _previous_response_id = from_union([from_none, from_str], obj.get("previousResponseId")) return ModelCallStartData( turn_id=turn_id, + fusion=fusion, model=model, _previous_response_id=_previous_response_id, ) @@ -4718,6 +5417,8 @@ def from_dict(obj: Any) -> "ModelCallStartData": def to_dict(self) -> dict: result: dict = {} result["turnId"] = from_str(self.turn_id) + if self.fusion is not None: + result["fusion"] = from_union([from_none, lambda x: to_class(FusionAttribution, x)], self.fusion) if self.model is not None: result["model"] = from_union([from_none, from_str], self.model) if self._previous_response_id is not None: @@ -9279,6 +9980,7 @@ class ToolExecutionCompleteContentShellExit: shell_id: str type: ClassVar[str] = "shell_exit" cwd: str | None = None + output_file_path: str | None = None output_preview: str | None = None output_truncated: bool | None = None @@ -9288,12 +9990,14 @@ def from_dict(obj: Any) -> "ToolExecutionCompleteContentShellExit": exit_code = from_int(obj.get("exitCode")) shell_id = from_str(obj.get("shellId")) cwd = from_union([from_none, from_str], obj.get("cwd")) + output_file_path = from_union([from_none, from_str], obj.get("outputFilePath")) output_preview = from_union([from_none, from_str], obj.get("outputPreview")) output_truncated = from_union([from_none, from_bool], obj.get("outputTruncated")) return ToolExecutionCompleteContentShellExit( exit_code=exit_code, shell_id=shell_id, cwd=cwd, + output_file_path=output_file_path, output_preview=output_preview, output_truncated=output_truncated, ) @@ -9305,6 +10009,8 @@ def to_dict(self) -> dict: result["type"] = self.type if self.cwd is not None: result["cwd"] = from_union([from_none, from_str], self.cwd) + if self.output_file_path is not None: + result["outputFilePath"] = from_union([from_none, from_str], self.output_file_path) if self.output_preview is not None: result["outputPreview"] = from_union([from_none, from_str], self.output_preview) if self.output_truncated is not None: @@ -9339,6 +10045,8 @@ class ToolExecutionCompleteData: success: bool tool_call_id: str error: ToolExecutionCompleteError | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + fusion: FusionAttribution | None = None interaction_id: str | None = None is_user_requested: bool | None = None # Experimental: this field is part of an experimental API and may change or be removed. @@ -9359,6 +10067,7 @@ def from_dict(obj: Any) -> "ToolExecutionCompleteData": success = from_bool(obj.get("success")) tool_call_id = from_str(obj.get("toolCallId")) error = from_union([from_none, ToolExecutionCompleteError.from_dict], obj.get("error")) + fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) interaction_id = from_union([from_none, from_str], obj.get("interactionId")) is_user_requested = from_union([from_none, from_bool], obj.get("isUserRequested")) mcp_meta = obj.get("mcpMeta") @@ -9374,6 +10083,7 @@ def from_dict(obj: Any) -> "ToolExecutionCompleteData": success=success, tool_call_id=tool_call_id, error=error, + fusion=fusion, interaction_id=interaction_id, is_user_requested=is_user_requested, mcp_meta=mcp_meta, @@ -9393,6 +10103,8 @@ def to_dict(self) -> dict: result["toolCallId"] = from_str(self.tool_call_id) if self.error is not None: result["error"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteError, x)], self.error) + if self.fusion is not None: + result["fusion"] = from_union([from_none, lambda x: to_class(FusionAttribution, x)], self.fusion) if self.interaction_id is not None: result["interactionId"] = from_union([from_none, from_str], self.interaction_id) if self.is_user_requested is not None: @@ -9837,6 +10549,8 @@ class ToolExecutionStartData: tool_name: str arguments: Any = None display_verbatim: bool | None = None + # Experimental: this field is part of an experimental API and may change or be removed. + fusion: FusionAttribution | None = None mcp_server_name: str | None = None mcp_tool_name: str | None = None model: str | None = None @@ -9854,6 +10568,7 @@ def from_dict(obj: Any) -> "ToolExecutionStartData": tool_name = from_str(obj.get("toolName")) arguments = obj.get("arguments") display_verbatim = from_union([from_none, from_bool], obj.get("displayVerbatim")) + fusion = from_union([from_none, FusionAttribution.from_dict], obj.get("fusion")) mcp_server_name = from_union([from_none, from_str], obj.get("mcpServerName")) mcp_tool_name = from_union([from_none, from_str], obj.get("mcpToolName")) model = from_union([from_none, from_str], obj.get("model")) @@ -9867,6 +10582,7 @@ def from_dict(obj: Any) -> "ToolExecutionStartData": tool_name=tool_name, arguments=arguments, display_verbatim=display_verbatim, + fusion=fusion, mcp_server_name=mcp_server_name, mcp_tool_name=mcp_tool_name, model=model, @@ -9885,6 +10601,8 @@ def to_dict(self) -> dict: result["arguments"] = self.arguments if self.display_verbatim is not None: result["displayVerbatim"] = from_union([from_none, from_bool], self.display_verbatim) + if self.fusion is not None: + result["fusion"] = from_union([from_none, lambda x: to_class(FusionAttribution, x)], self.fusion) if self.mcp_server_name is not None: result["mcpServerName"] = from_union([from_none, from_str], self.mcp_server_name) if self.mcp_tool_name is not None: @@ -10706,6 +11424,85 @@ class CitationProvider(Enum): CLIENT = "client" +# Experimental: this enum is part of an experimental API and may change or be removed. +class FusionConversationScope(Enum): + "Conversation scope in which a HydraFusion phase executes." + # Canonical root conversation history. + ROOT = "root" + # Isolated read-only review history that does not enter the root conversation. + REVIEW = "review" + + +# Experimental: this enum is part of an experimental API and may change or be removed. +class FusionFollowUpAction(Enum): + "Server-recommended routing behavior for a later HydraFusion turn." + # Reuse the durable primary model without routing. + REUSE_PRIMARY = "reuse_primary" + # Request a new routing decision. + REROUTE = "reroute" + + +# Experimental: this enum is part of an experimental API and may change or be removed. +class FusionPattern(Enum): + "Validated HydraFusion execution pattern." + # Run one primary solver phase. + SINGLE = "single" + # Run a primary phase, a judge, and an optional repair. + CASCADE = "cascade" + # Run a primary draft, a read-only critique, and a revision. + CRITIQUE = "critique" + + +# Experimental: this enum is part of an experimental API and may change or be removed. +class FusionPhaseKind(Enum): + "HydraFusion phase kind." + # Primary solver phase. + PRIMARY = "primary" + # Read-only cascade judge phase. + JUDGE = "judge" + # Cascade repair phase. + REPAIR = "repair" + # Initial critique-pattern draft phase. + DRAFT = "draft" + # Read-only critique phase. + CRITIC = "critic" + # Critique-pattern revision phase. + REVISION = "revision" + # Follow-up phase continuing from the resolved model. + FOLLOW_UP = "follow_up" + + +# Experimental: this enum is part of an experimental API and may change or be removed. +class FusionPhaseStatus(Enum): + "Durable outcome status of a HydraFusion phase." + # The phase completed successfully. + SUCCEEDED = "succeeded" + # The phase failed. + FAILED = "failed" + # The phase was cancelled. + CANCELLED = "cancelled" + + +# Experimental: this enum is part of an experimental API and may change or be removed. +class _FusionProjectionMode(Enum): + "How a durable phase checkpoint contributes its exact message to canonical root history." + # Append the exact root message immediately. + APPEND = "append" + # Hold a terminal message outside canonical history until the final commit selects it. + STAGED = "staged" + # Do not project the checkpoint into root history. + NONE = "none" + + +# Experimental: this enum is part of an experimental API and may change or be removed. +class FusionTurnKind(Enum): + "Kind of turn for which HydraFusion routing is running." + # A user-message turn. + USER = "user" + # A conversation-compaction turn. + COMPACTION = "compaction" + + # Experimental: this enum is part of an experimental API and may change or be removed. class PermissionMode(Enum): "Permission mode for the session." @@ -11415,7 +12212,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionContextClearedData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AgentInterruptedData | AssistantIntentData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | PromptCacheBreakData | ModelCallFailureData | ModelCallFinishedData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SandboxDecisionData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | UiEphemeralQueryData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | FactoryRunStartedData | FactoryRunSettledData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionContextClearedData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | SessionFusionRouteStartedData | SessionFusionRouteFailedData | SessionFusionResolvedData | SessionFusionCompletedData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AgentInterruptedData | AssistantIntentData | AssistantFusionPhaseStartedData | AssistantFusionPhaseCompletedData | AssistantFusionPhaseFailedData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | PromptCacheBreakData | ModelCallFailureData | ModelCallFinishedData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SandboxDecisionData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | UiEphemeralQueryData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | FactoryRunStartedData | FactoryRunSettledData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -11471,12 +12268,19 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_COMPACTION_START: data = SessionCompactionStartData.from_dict(data_obj) case SessionEventType.SESSION_COMPACTION_COMPLETE: data = SessionCompactionCompleteData.from_dict(data_obj) case SessionEventType.SESSION_TASK_COMPLETE: data = SessionTaskCompleteData.from_dict(data_obj) + case SessionEventType.SESSION_FUSION_ROUTE_STARTED: data = SessionFusionRouteStartedData.from_dict(data_obj) + case SessionEventType.SESSION_FUSION_ROUTE_FAILED: data = SessionFusionRouteFailedData.from_dict(data_obj) + case SessionEventType.SESSION_FUSION_RESOLVED: data = SessionFusionResolvedData.from_dict(data_obj) + case SessionEventType.SESSION_FUSION_COMPLETED: data = SessionFusionCompletedData.from_dict(data_obj) case SessionEventType.USER_MESSAGE: data = UserMessageData.from_dict(data_obj) case SessionEventType.PENDING_MESSAGES_MODIFIED: data = PendingMessagesModifiedData.from_dict(data_obj) case SessionEventType.ASSISTANT_TURN_START: data = AssistantTurnStartData.from_dict(data_obj) case SessionEventType.ASSISTANT_TURN_RETRY: data = AssistantTurnRetryData.from_dict(data_obj) case SessionEventType.AGENT_INTERRUPTED: data = AgentInterruptedData.from_dict(data_obj) case SessionEventType.ASSISTANT_INTENT: data = AssistantIntentData.from_dict(data_obj) + case SessionEventType.ASSISTANT_FUSION_PHASE_STARTED: data = AssistantFusionPhaseStartedData.from_dict(data_obj) + case SessionEventType.ASSISTANT_FUSION_PHASE_COMPLETED: data = AssistantFusionPhaseCompletedData.from_dict(data_obj) + case SessionEventType.ASSISTANT_FUSION_PHASE_FAILED: data = AssistantFusionPhaseFailedData.from_dict(data_obj) case SessionEventType.ASSISTANT_SERVER_TOOL_PROGRESS: data = AssistantServerToolProgressData.from_dict(data_obj) case SessionEventType.ASSISTANT_REASONING: data = AssistantReasoningData.from_dict(data_obj) case SessionEventType.ASSISTANT_REASONING_DELTA: data = AssistantReasoningDeltaData.from_dict(data_obj) @@ -11602,6 +12406,9 @@ def session_event_to_dict(x: SessionEvent) -> Any: "AgentInterruptedActivity", "AgentInterruptedCancelPhase", "AgentInterruptedData", + "AssistantFusionPhaseCompletedData", + "AssistantFusionPhaseFailedData", + "AssistantFusionPhaseStartedData", "AssistantIdleData", "AssistantIntentData", "AssistantMessageData", @@ -11704,6 +12511,16 @@ def session_event_to_dict(x: SessionEvent) -> Any: "FactoryRunSettledStatus", "FactoryRunStartedData", "FactoryRunUpdatedData", + "FusionAttribution", + "FusionConversationScope", + "FusionFollowUpAction", + "FusionFollowUpRecommendation", + "FusionPattern", + "FusionPhaseKind", + "FusionPhaseStatus", + "FusionPhaseUsage", + "FusionScores", + "FusionTurnKind", "GitHubMcpToolConfig", "GitHubRepoRef", "HandoffRepository", @@ -11835,6 +12652,10 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionEventType", "SessionExtensionsAttachmentsPushedData", "SessionExtensionsLoadedData", + "SessionFusionCompletedData", + "SessionFusionResolvedData", + "SessionFusionRouteFailedData", + "SessionFusionRouteStartedData", "SessionHandoffData", "SessionIdleData", "SessionInfoData", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index bdf291e599..e0575d3396 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -4879,6 +4879,9 @@ pub struct ExternalToolTextResultForLlmContentShellExit { pub cwd: Option, /// Exit code from the completed shell command pub exit_code: i64, + /// Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_file_path: Option, /// Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. #[serde(skip_serializing_if = "Option::is_none")] pub output_preview: Option, @@ -19623,15 +19626,9 @@ pub struct ToolsGetBuiltinDescriptorsRequest { /// Whether tool descriptors should include authoring metadata. #[serde(skip_serializing_if = "Option::is_none")] pub include_author: Option, - /// Whether line numbers should be omitted from the view tool descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub no_view_line_numbers: Option, /// Whether descriptors should favor fewer user-intervention prompts. #[serde(skip_serializing_if = "Option::is_none")] pub reduce_user_intervention: Option, - /// Whether shell commands may only run asynchronously. - #[serde(skip_serializing_if = "Option::is_none")] - pub shell_async_only_enabled: Option, /// Shell-specific names and description lines for shell tools. #[serde(skip_serializing_if = "Option::is_none")] pub shell_config: Option, diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index a5b123d3b5..c2336aaf98 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -78,6 +78,42 @@ pub enum SessionEventType { SessionCompactionComplete, #[serde(rename = "session.task_complete")] SessionTaskComplete, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.fusion_route_started")] + SessionFusionRouteStarted, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.fusion_route_failed")] + SessionFusionRouteFailed, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.fusion_resolved")] + SessionFusionResolved, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.fusion_completed")] + SessionFusionCompleted, #[serde(rename = "user.message")] UserMessage, #[serde(rename = "pending_messages.modified")] @@ -90,6 +126,33 @@ pub enum SessionEventType { AgentInterrupted, #[serde(rename = "assistant.intent")] AssistantIntent, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "assistant.fusion_phase_started")] + AssistantFusionPhaseStarted, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "assistant.fusion_phase_completed")] + AssistantFusionPhaseCompleted, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "assistant.fusion_phase_failed")] + AssistantFusionPhaseFailed, #[serde(rename = "assistant.server_tool_progress")] AssistantServerToolProgress, #[serde(rename = "assistant.reasoning")] @@ -439,6 +502,42 @@ pub enum SessionEventData { SessionCompactionComplete(SessionCompactionCompleteData), #[serde(rename = "session.task_complete")] SessionTaskComplete(SessionTaskCompleteData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.fusion_route_started")] + SessionFusionRouteStarted(SessionFusionRouteStartedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.fusion_route_failed")] + SessionFusionRouteFailed(SessionFusionRouteFailedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.fusion_resolved")] + SessionFusionResolved(SessionFusionResolvedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.fusion_completed")] + SessionFusionCompleted(SessionFusionCompletedData), #[serde(rename = "user.message")] UserMessage(UserMessageData), #[serde(rename = "pending_messages.modified")] @@ -451,6 +550,33 @@ pub enum SessionEventData { AgentInterrupted(AgentInterruptedData), #[serde(rename = "assistant.intent")] AssistantIntent(AssistantIntentData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "assistant.fusion_phase_started")] + AssistantFusionPhaseStarted(AssistantFusionPhaseStartedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "assistant.fusion_phase_completed")] + AssistantFusionPhaseCompleted(AssistantFusionPhaseCompletedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "assistant.fusion_phase_failed")] + AssistantFusionPhaseFailed(AssistantFusionPhaseFailedData), #[serde(rename = "assistant.server_tool_progress")] AssistantServerToolProgress(AssistantServerToolProgressData), #[serde(rename = "assistant.reasoning")] @@ -1678,6 +1804,209 @@ pub struct SessionTaskCompleteData { pub summary: Option, } +/// Session event "session.fusion_route_started". Experimental transient signal that HydraFusion routing has started for an eligible turn. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFusionRouteStartedData { + /// Identifier for this routing attempt before a durable Fusion turn exists. + pub attempt_id: String, + /// HydraFusion routing policy requested for the turn. + #[serde(skip_serializing_if = "Option::is_none")] + pub policy: Option, + /// Synthetic HydraFusion model selected for the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub synthetic_model: Option, + /// Kind of turn being routed. + pub turn_kind: FusionTurnKind, +} + +/// Session event "session.fusion_route_failed". Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFusionRouteFailedData { + /// Identifier of the routing attempt that failed. + pub attempt_id: String, + /// Provider or validation error detail, when available. + #[serde(skip_serializing_if = "Option::is_none")] + pub error_message: Option, + /// Concrete model selected as the deterministic fallback. + pub fallback_model: String, + /// HydraFusion routing policy requested for the turn. + pub policy: String, + /// Stable machine-readable reason for the routing failure. + pub reason: String, + /// Elapsed routing time in milliseconds before the failure. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_latency_ms: Option, + /// Synthetic HydraFusion model selected for the session. + pub synthetic_model: String, +} + +/// Durable server recommendation for subsequent HydraFusion turns. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FusionFollowUpRecommendation { + /// Recommended routing action for the next compaction turn. + pub compaction_turn: FusionFollowUpAction, + /// Recommended routing action for the next user-message turn. + pub user_turn: FusionFollowUpAction, +} + +/// Validated HydraFusion routing capability scores. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FusionScores { + /// Code-generation capability score returned by the authenticated router. + pub code_gen: f64, + /// Debugging capability score returned by the authenticated router. + pub debugging: f64, + /// Reasoning capability score returned by the authenticated router. + pub reasoning: f64, + /// Tool-use capability score returned by the authenticated router. + pub tool_use: f64, +} + +/// Session event "session.fusion_resolved". Experimental durable validated HydraFusion route and turn policy. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFusionResolvedData { + /// Version of the validated HydraFusion event contract. + pub contract_version: i64, + /// Concrete model used when the planned primary model cannot execute. + pub fallback_model: String, + /// Router recommendation controlling reuse or rerouting on later turns. + #[serde(skip_serializing_if = "Option::is_none")] + pub follow_up: Option, + /// Concrete model recommended for eligible follow-up turns. + pub follow_up_model: String, + /// Stable identifier for the resolved HydraFusion turn. + pub fusion_id: String, + /// Version of the executable model universe used for selection. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_universe_version: Option, + /// Validated orchestration pattern selected for the turn. + pub pattern: FusionPattern, + /// Version of the validated execution-plan format. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan_version: Option, + /// HydraFusion routing policy used to resolve the plan. + pub policy: String, + /// Version of the local routing policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub policy_version: Option, + /// Concrete model selected for the primary solver phase. + pub primary_model: String, + /// Router implementation that supplied the plan. + #[serde(skip_serializing_if = "Option::is_none")] + pub route_source: Option, + /// Elapsed time in milliseconds required to resolve and validate the route. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_latency_ms: Option, + /// Identifier of the local policy rule that matched. + #[serde(skip_serializing_if = "Option::is_none")] + pub rule_id: Option, + /// Zero-based index of the local policy rule that matched. + #[serde(skip_serializing_if = "Option::is_none")] + pub rule_index: Option, + /// Human-readable name of the local policy rule that matched. + #[serde(skip_serializing_if = "Option::is_none")] + pub rule_name: Option, + /// Validated capability scores used to select the route. + #[serde(skip_serializing_if = "Option::is_none")] + pub scores: Option, + /// Concrete model selected for the review or judge phase, when required. + pub secondary_model: Option, + /// Synthetic HydraFusion model selected for the session. + pub synthetic_model: String, + /// Identifier of the session turn associated with the route. + pub turn_id: String, +} + +/// Session event "session.fusion_completed". Experimental durable aggregate outcome of a HydraFusion turn. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionFusionCompletedData { + /// Total cached input tokens reported across all phases. + pub cached_tokens: i64, + /// Total tokens written to prompt cache across all phases. + #[serde(skip_serializing_if = "Option::is_none")] + pub cache_write_tokens: Option, + /// Idempotency identifier for the authoritative final commit. + pub commit_id: String, + /// Reason the turn used a degraded route, when applicable. + pub degraded_reason: Option, + /// Total elapsed execution time for the HydraFusion turn in milliseconds. + pub duration_ms: f64, + /// Concrete model that supplied the authoritative final content. + pub final_source_model: Option, + /// Phase whose output supplied the authoritative final content. + pub final_source_phase_id: Option, + /// Concrete model recommended for eligible follow-up turns. + pub follow_up_model: String, + /// Stable identifier for the completed HydraFusion turn. + pub fusion_id: String, + /// Total input tokens consumed across all phases. + pub input_tokens: i64, + /// Stable aggregate outcome of the HydraFusion turn. + pub outcome: String, + /// Total output tokens produced across all phases. + pub output_tokens: i64, + /// HydraFusion orchestration pattern executed for the turn. + pub pattern: FusionPattern, + /// Number of concrete phases attempted by the turn. + pub phase_count: i64, + /// Total concrete model requests made across all phases. + pub request_count: i64, + /// Synthetic HydraFusion model selected for the session. + pub synthetic_model: String, + /// Total normalized AI-unit cost reported across all phases, in nano-AIU. + pub total_nano_aiu: f64, + /// Identifier of the session turn associated with the completion. + pub turn_id: String, +} + /// Session event "user.message". Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -1802,6 +2131,163 @@ pub struct AssistantIntentData { pub intent: String, } +/// Session event "assistant.fusion_phase_started". Experimental transient HydraFusion phase/model/role signal. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AssistantFusionPhaseStartedData { + /// Conversation scope in which the phase executes. + pub conversation_scope: FusionConversationScope, + /// Identifier of the HydraFusion turn containing the phase. + pub fusion_id: String, + /// Concrete model executing the phase. + pub model: String, + /// HydraFusion orchestration pattern containing the phase. + pub pattern: FusionPattern, + /// Stable identifier for the concrete phase. + pub phase_id: String, + /// Kind of phase being executed. + pub phase_kind: FusionPhaseKind, + /// Semantic role assigned to the phase. + pub role: String, +} + +/// Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub(crate) struct FusionStagedTerminal { + pub arguments: String, + pub assistant_message: serde_json::Value, + pub phase_id: String, + pub tool_call_id: String, + pub tool_name: String, +} + +/// Aggregate concrete-model usage for one HydraFusion phase. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FusionPhaseUsage { + /// Total cached input tokens reported for the phase. + pub cached_tokens: i64, + /// Total tokens written to prompt cache during the phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub cache_write_tokens: Option, + /// Total input tokens consumed by the phase. + pub input_tokens: i64, + /// Total output tokens produced by the phase. + pub output_tokens: i64, + /// Number of concrete model requests made by the phase. + pub request_count: i64, + /// Total normalized AI-unit cost reported for the phase, in nano-AIU. + pub total_nano_aiu: f64, +} + +/// Session event "assistant.fusion_phase_completed". Experimental durable HydraFusion phase output and lossless replay checkpoint. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AssistantFusionPhaseCompletedData { + /// Provider-normalized textual output produced by the phase. + pub content: String, + /// Conversation scope in which the phase executed. + pub conversation_scope: FusionConversationScope, + /// Elapsed execution time for the phase in milliseconds. + pub duration_ms: f64, + /// Identifier of the HydraFusion turn containing the phase. + pub fusion_id: String, + /// Concrete model that executed the phase. + pub model: String, + /// Stable identifier for the completed phase. + pub phase_id: String, + /// Kind of phase that completed. + pub phase_kind: FusionPhaseKind, + /// Exact provider-normalized message used to reconstruct canonical model history. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) projection_message: Option, + /// Projection action for the exact internal message. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) projection_mode: Option, + /// Semantic role assigned to the completed phase. + pub role: String, + /// Terminal request held outside canonical state until selected by the final commit. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) staged_terminal: Option, + /// Durable outcome status of the phase. + pub status: FusionPhaseStatus, + /// Aggregate concrete-model usage consumed by the phase. + pub usage: FusionPhaseUsage, + /// Structured judge or critic verdict, when the phase produces one. + pub verdict: Option, +} + +/// Session event "assistant.fusion_phase_failed". Experimental durable typed HydraFusion phase failure and degradation transition. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AssistantFusionPhaseFailedData { + /// Conversation scope in which the phase executed. + pub conversation_scope: FusionConversationScope, + /// Identifier of the fallback phase used to continue the turn after degradation. + #[serde(skip_serializing_if = "Option::is_none")] + pub degraded_to_phase_id: Option, + /// Elapsed execution time before the phase failed, in milliseconds. + pub duration_ms: f64, + /// Provider or execution error detail, when available. + #[serde(skip_serializing_if = "Option::is_none")] + pub error_message: Option, + /// Identifier of the HydraFusion turn containing the phase. + pub fusion_id: String, + /// Concrete model that attempted the phase. + pub model: String, + /// Stable identifier for the failed phase. + pub phase_id: String, + /// Kind of phase that failed. + pub phase_kind: FusionPhaseKind, + /// Stable machine-readable reason for the phase failure. + pub reason: String, + /// Semantic role assigned to the failed phase. + pub role: String, + /// Durable outcome status of the phase. + pub status: FusionPhaseStatus, + /// Aggregate concrete-model usage consumed before the failure. + pub usage: FusionPhaseUsage, +} + /// Session event "assistant.server_tool_progress". Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -1947,6 +2433,48 @@ pub struct Citations { pub spans: Vec, } +/// Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FusionAttribution { + /// Idempotency identifier for the authoritative commit, when the event belongs to the selected output. + #[serde(skip_serializing_if = "Option::is_none")] + pub commit_id: Option, + /// Conversation scope in which the concrete phase executed. + #[serde(skip_serializing_if = "Option::is_none")] + pub conversation_scope: Option, + /// Stable identifier for the HydraFusion turn that produced the event. + pub fusion_id: String, + /// HydraFusion orchestration pattern selected for the turn. + pub pattern: String, + /// Identifier of the concrete phase that produced the event. + #[serde(skip_serializing_if = "Option::is_none")] + pub phase_id: Option, + /// Kind of concrete phase that produced the event. + #[serde(skip_serializing_if = "Option::is_none")] + pub phase_kind: Option, + /// HydraFusion routing policy used for the turn. + pub policy: String, + /// Semantic role assigned to the concrete phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub role: Option, + /// Concrete model that produced the attributed event. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_model: Option, + /// Phase whose output supplied the authoritative content, when different from the executing phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_phase_id: Option, + /// Synthetic HydraFusion model selected for the session. + pub synthetic_model: String, +} + /// Neutral provider-tagged reasoning content blocks preserved verbatim for round-tripping /// ///
@@ -2051,6 +2579,16 @@ pub struct AssistantMessageData { /// Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume. #[serde(skip_serializing_if = "Option::is_none")] pub encrypted_content: Option, + /// Experimental HydraFusion source attribution for this ordinary authoritative assistant message. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(skip_serializing_if = "Option::is_none")] + pub fusion: Option, /// CAPI interaction ID for correlating this message with upstream telemetry #[serde(skip_serializing_if = "Option::is_none")] pub interaction_id: Option, @@ -2277,6 +2815,16 @@ pub struct AssistantUsageData { #[doc(hidden)] #[serde(skip_serializing_if = "Option::is_none")] pub(crate) frontier_source: Option, + /// Experimental HydraFusion attribution for this concrete model call's usage. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(skip_serializing_if = "Option::is_none")] + pub fusion: Option, /// What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls #[serde(skip_serializing_if = "Option::is_none")] pub initiator: Option, @@ -2494,6 +3042,16 @@ pub struct ModelCallFailureData { /// Whether the failure originated from an API response or the request transport #[serde(skip_serializing_if = "Option::is_none")] pub failure_kind: Option, + /// Experimental HydraFusion attribution for this failed concrete model call. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(skip_serializing_if = "Option::is_none")] + pub fusion: Option, /// What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls #[serde(skip_serializing_if = "Option::is_none")] pub initiator: Option, @@ -2568,6 +3126,16 @@ pub struct ModelCallFinishedData { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ModelCallStartData { + /// Experimental HydraFusion attribution for this concrete model call. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(skip_serializing_if = "Option::is_none")] + pub fusion: Option, /// Model identifier used for this API call, when known #[serde(skip_serializing_if = "Option::is_none")] pub model: Option, @@ -2665,6 +3233,16 @@ pub struct ToolExecutionStartData { /// When true, the tool output should be displayed expanded (verbatim) in the CLI timeline #[serde(skip_serializing_if = "Option::is_none")] pub display_verbatim: Option, + /// Experimental HydraFusion attribution for this tool execution. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(skip_serializing_if = "Option::is_none")] + pub fusion: Option, /// Name of the MCP server hosting this tool, when the tool is an MCP tool #[serde(skip_serializing_if = "Option::is_none")] pub mcp_server_name: Option, @@ -2863,6 +3441,9 @@ pub struct ToolExecutionCompleteContentShellExit { pub cwd: Option, /// Exit code from the completed shell command pub exit_code: i64, + /// Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + #[serde(skip_serializing_if = "Option::is_none")] + pub output_file_path: Option, /// Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. #[serde(skip_serializing_if = "Option::is_none")] pub output_preview: Option, @@ -3173,6 +3754,16 @@ pub struct ToolExecutionCompleteData { /// Error details when the tool execution failed #[serde(skip_serializing_if = "Option::is_none")] pub error: Option, + /// Experimental HydraFusion attribution for this tool completion. + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(skip_serializing_if = "Option::is_none")] + pub fusion: Option, /// CAPI interaction ID for correlating this tool execution with upstream telemetry #[serde(skip_serializing_if = "Option::is_none")] pub interaction_id: Option, @@ -5999,6 +6590,75 @@ pub enum TaskCompletionOutcome { Unknown, } +/// Kind of turn for which HydraFusion routing is running. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FusionTurnKind { + /// A user-message turn. + #[serde(rename = "user")] + User, + /// A conversation-compaction turn. + #[serde(rename = "compaction")] + Compaction, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Server-recommended routing behavior for a later HydraFusion turn. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FusionFollowUpAction { + /// Reuse the durable primary model without routing. + #[serde(rename = "reuse_primary")] + ReusePrimary, + /// Request a new routing decision. + #[serde(rename = "reroute")] + Reroute, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Validated HydraFusion execution pattern. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FusionPattern { + /// Run one primary solver phase. + #[serde(rename = "single")] + Single, + /// Run a primary phase, a judge, and an optional repair. + #[serde(rename = "cascade")] + Cascade, + /// Run a primary draft, a read-only critique, and a revision. + #[serde(rename = "critique")] + Critique, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// The agent mode that was active when this message was sent #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum UserMessageAgentMode { @@ -6089,6 +6749,115 @@ pub enum ModelCallFailureTransport { Unknown, } +/// Conversation scope in which a HydraFusion phase executes. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FusionConversationScope { + /// Canonical root conversation history. + #[serde(rename = "root")] + Root, + /// Isolated read-only review history that does not enter the root conversation. + #[serde(rename = "review")] + Review, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// HydraFusion phase kind. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FusionPhaseKind { + /// Primary solver phase. + #[serde(rename = "primary")] + Primary, + /// Read-only cascade judge phase. + #[serde(rename = "judge")] + Judge, + /// Cascade repair phase. + #[serde(rename = "repair")] + Repair, + /// Initial critique-pattern draft phase. + #[serde(rename = "draft")] + Draft, + /// Read-only critique phase. + #[serde(rename = "critic")] + Critic, + /// Critique-pattern revision phase. + #[serde(rename = "revision")] + Revision, + /// Follow-up phase continuing from the resolved model. + #[serde(rename = "follow_up")] + FollowUp, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// How a durable phase checkpoint contributes its exact message to canonical root history. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FusionProjectionMode { + /// Append the exact root message immediately. + #[serde(rename = "append")] + Append, + /// Hold a terminal message outside canonical history until the final commit selects it. + #[serde(rename = "staged")] + Staged, + /// Do not project the checkpoint into root history. + #[serde(rename = "none")] + None, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Durable outcome status of a HydraFusion phase. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum FusionPhaseStatus { + /// The phase completed successfully. + #[serde(rename = "succeeded")] + Succeeded, + /// The phase failed. + #[serde(rename = "failed")] + Failed, + /// The phase was cancelled. + #[serde(rename = "cancelled")] + Cancelled, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum AssistantMessageToolRequestType { diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 5566e2e34c..ddcf433694 100644 --- a/test/harness/package-lock.json +++ b/test/harness/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@github/copilot": "^1.0.81-11", + "@github/copilot": "^1.0.81-12", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", @@ -472,8 +472,8 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.81-11", - "integrity": "sha512-F7hZ6G6fhWH4uq862mbs2JE3nL0KIVBOc94/EFOdEjux3oHUQst9a06gKibEJS6VRULaYTXzatA1EAgNC9dzFA==", + "version": "1.0.81-12", + "integrity": "sha512-Gs0LB6j8C2D02oagnBaX+g8U03ulT3utomXnW9TrZWdtY4JVMRIu20cr/aMkr24xATX9jUbPbTfGJAwzP7N/gA==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -483,19 +483,19 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.81-11", - "@github/copilot-darwin-x64": "1.0.81-11", - "@github/copilot-linux-arm64": "1.0.81-11", - "@github/copilot-linux-x64": "1.0.81-11", - "@github/copilot-linuxmusl-arm64": "1.0.81-11", - "@github/copilot-linuxmusl-x64": "1.0.81-11", - "@github/copilot-win32-arm64": "1.0.81-11", - "@github/copilot-win32-x64": "1.0.81-11" + "@github/copilot-darwin-arm64": "1.0.81-12", + "@github/copilot-darwin-x64": "1.0.81-12", + "@github/copilot-linux-arm64": "1.0.81-12", + "@github/copilot-linux-x64": "1.0.81-12", + "@github/copilot-linuxmusl-arm64": "1.0.81-12", + "@github/copilot-linuxmusl-x64": "1.0.81-12", + "@github/copilot-win32-arm64": "1.0.81-12", + "@github/copilot-win32-x64": "1.0.81-12" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.81-11", - "integrity": "sha512-3eLs71CLnJH9RNnESnv4esipZPeGXMlBxQeKXwZY+crwcW2RAR8YuovQyfoZ/5by1PLPbYrOjXNfQL6kXSisrA==", + "version": "1.0.81-12", + "integrity": "sha512-oaJHeCJpvr9ClfrnhFou2AZUd7SqxGrdCkBnVM1tYduUDPzb9xqdFsMcJn2g0hfPM1yO3khjWU6WQxmuQCyJnA==", "cpu": [ "arm64" ], @@ -510,8 +510,8 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.81-11", - "integrity": "sha512-GdFLiUC8UL9k6K+woG8AyL3zBafd0Br1TIPDV5iiZsyBtTe4g67FjL7DGCYDt6AN9G43jWdK0M0InoNDVq1K1A==", + "version": "1.0.81-12", + "integrity": "sha512-lYyFpCEA/usTGJSKWx1X5U4a4DiJ9A1A7vXrE0uE+HjS/9eJE2NBR1z3fPUP0V8HL0JUqAsSdM6rPbFfiE1c+Q==", "cpu": [ "x64" ], @@ -526,8 +526,8 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.81-11", - "integrity": "sha512-C4hcAow5CdaVJITbdtGqFgxWpW7TqwyCPNn8OtcbvdWeiKcfOBDrgkvbsezG98/5Ovs3HWxZRT4oZqCEmGF9Ww==", + "version": "1.0.81-12", + "integrity": "sha512-5jV7xuoqGndoQFxeM06IuEe4oEhY03PBIYyghvFVptQWY7Cj/Q3CMogIUaIQ+ugjuV8oRgBpm1JLJmr5Cw4FHA==", "cpu": [ "arm64" ], @@ -542,8 +542,8 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.81-11", - "integrity": "sha512-izu0PwWx+wL4zxacO6cd6r0zMMMQ3pTz+2euWcAd7HCJ/CIR6+YYfjU3TI3TPBZ9zDLZGoxHKYYPfJ1ZbSTzEg==", + "version": "1.0.81-12", + "integrity": "sha512-/P0SMTeHQoMlV7MX+GCvIkht2uXZkLroyFMGjum+pD8XG7AsN8aozjILd5+JFEr6uxyhqnPjSOWj/vjmzmMoDA==", "cpu": [ "x64" ], @@ -558,8 +558,8 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.81-11", - "integrity": "sha512-uWGUjaxOSMu6dKFWcTvXGUUp76vC3OV7nlSupecRkQ7gA3OxdrrB8rXE5/leC606Hk6oe9Wl7wKCH9EwuZ6afg==", + "version": "1.0.81-12", + "integrity": "sha512-XN6rK+7nv6K7Hv/fIJ4Wma+FCZFff9KaH5wES2VhWSS4Xfd4QCZQuiIWGHSmdo1MKarqp0ngx9t2VAtDY7lr7Q==", "cpu": [ "arm64" ], @@ -574,8 +574,8 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.81-11", - "integrity": "sha512-BpWKd/iu1tTyuPR2zuPFs1pVOlley4yt/TXkn6/gVwt52VI0rUxEO+n77RVjDcyMxWaUApbad2VNRPIH77guCA==", + "version": "1.0.81-12", + "integrity": "sha512-UUyK6Ru8kejqtTMyiiFNTNVFEPk4Qx7kaIznBLRSrR1jgrmelGjTMT6bDUlNTzqWPclUjdWF5kmCmT+urvSuqg==", "cpu": [ "x64" ], @@ -590,8 +590,8 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.81-11", - "integrity": "sha512-GOK3cACgD96m065uJxbgcXL7MQ1qm+wq1qtvGBpprY0r9wTYJG/rVCtayjYB6B57rnaBwPll3+PQ2J1qgfO57A==", + "version": "1.0.81-12", + "integrity": "sha512-ACx+faBJ/z9EzjLaZM+zEbB6+3wmj6nTjel0Q+VPD7eDhTwujSvfYGZ5nv2TMi1JN5NAua+HLE1MGhIdS1wJXw==", "cpu": [ "arm64" ], @@ -606,8 +606,8 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.81-11", - "integrity": "sha512-u4K6UU2iGQJqQwsdHNilJBwiaC48PfMsWVFnTSlJD5lCYp9zCk1odrvrcmB3ARYinE/IcXLUosiHaM/ChR/pdA==", + "version": "1.0.81-12", + "integrity": "sha512-m3D/9ww1laJLQahHUjd6e0c9ziikJuTPgSotJ0hFqXXkxacrxvAFAiWduhyeotl63IShMZk4M3jz59SHV9un9w==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index e8868750a0..97bb969666 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -14,7 +14,7 @@ "node": "^20.19.0 || >=22.12.0" }, "devDependencies": { - "@github/copilot": "^1.0.81-11", + "@github/copilot": "^1.0.81-12", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", From c6b136fbfa6254fcee6a26a985ee3d2ea65b9aac Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 26 Aug 2026 19:39:45 -0300 Subject: [PATCH 2/3] test(dotnet): refresh view replay snapshots Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Carlos Alexandro Becker --- test/snapshots/builtin_tools/should_create_a_new_file.yaml | 2 +- .../builtin_tools/should_edit_a_file_successfully.yaml | 5 +---- .../builtin_tools/should_read_file_with_line_range.yaml | 6 +++--- .../should_use_client_cwd_for_default_workingdirectory.yaml | 2 +- ...events_in_correct_order_for_tool_using_conversation.yaml | 2 +- ...ould_emit_tool_execution_events_with_correct_fields.yaml | 2 +- ...reserve_message_order_in_getmessages_after_tool_use.yaml | 2 +- ...etooluse_and_posttooluse_hooks_for_single_tool_call.yaml | 2 +- ...uld_invoke_posttooluse_hook_after_model_runs_a_tool.yaml | 2 +- ...hould_invoke_pretooluse_hook_when_model_runs_a_tool.yaml | 2 +- ...ould_invoke_permission_handler_for_write_operations.yaml | 4 ++-- .../snapshots/session/should_send_with_file_attachment.yaml | 2 +- .../session_config/should_accept_message_attachments.yaml | 2 +- .../should_apply_workingdirectory_on_session_resume.yaml | 2 +- .../should_use_workingdirectory_for_tool_execution.yaml | 2 +- ...ld_apply_transform_modifications_to_section_content.yaml | 2 +- ...uld_invoke_transform_callbacks_with_section_content.yaml | 2 +- ..._work_with_static_overrides_and_transforms_together.yaml | 2 +- test/snapshots/tools/invokes_built_in_tools.yaml | 2 +- 19 files changed, 22 insertions(+), 25 deletions(-) diff --git a/test/snapshots/builtin_tools/should_create_a_new_file.yaml b/test/snapshots/builtin_tools/should_create_a_new_file.yaml index bf9288cf01..8afe8b38b6 100644 --- a/test/snapshots/builtin_tools/should_create_a_new_file.yaml +++ b/test/snapshots/builtin_tools/should_create_a_new_file.yaml @@ -54,6 +54,6 @@ conversations: arguments: '{"path":"${workdir}/new_file.txt"}' - role: tool tool_call_id: toolcall_2 - content: 1. Created by test + content: Created by test - role: assistant content: ✓ Done! Created `new_file.txt` with content "Created by test" and confirmed the content matches. diff --git a/test/snapshots/builtin_tools/should_edit_a_file_successfully.yaml b/test/snapshots/builtin_tools/should_edit_a_file_successfully.yaml index 0f21418628..78ca3bbbc3 100644 --- a/test/snapshots/builtin_tools/should_edit_a_file_successfully.yaml +++ b/test/snapshots/builtin_tools/should_edit_a_file_successfully.yaml @@ -56,10 +56,7 @@ conversations: arguments: '{"path":"${workdir}/edit_me.txt"}' - role: tool tool_call_id: toolcall_2 - content: |- - 1. Hi Universe - 2. Goodbye World - 3. + content: "Hi Universe\nGoodbye World\n" - role: assistant content: |- Done! The file now contains: diff --git a/test/snapshots/builtin_tools/should_read_file_with_line_range.yaml b/test/snapshots/builtin_tools/should_read_file_with_line_range.yaml index cd17d86708..601ae0f04c 100644 --- a/test/snapshots/builtin_tools/should_read_file_with_line_range.yaml +++ b/test/snapshots/builtin_tools/should_read_file_with_line_range.yaml @@ -45,9 +45,9 @@ conversations: - role: tool tool_call_id: toolcall_1 content: |- - 2. line2 - 3. line3 - 4. line4 + line2 + line3 + line4 - role: assistant content: |- Lines 2 through 4 of 'lines.txt' contain: diff --git a/test/snapshots/client_options/should_use_client_cwd_for_default_workingdirectory.yaml b/test/snapshots/client_options/should_use_client_cwd_for_default_workingdirectory.yaml index 6d9167e94a..469d091288 100644 --- a/test/snapshots/client_options/should_use_client_cwd_for_default_workingdirectory.yaml +++ b/test/snapshots/client_options/should_use_client_cwd_for_default_workingdirectory.yaml @@ -25,6 +25,6 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. I am in the client cwd + content: I am in the client cwd - role: assistant content: 'The file `marker.txt` says: "I am in the client cwd"' diff --git a/test/snapshots/event_fidelity/should_emit_events_in_correct_order_for_tool_using_conversation.yaml b/test/snapshots/event_fidelity/should_emit_events_in_correct_order_for_tool_using_conversation.yaml index 8ce730f0fb..c8f272e6b9 100644 --- a/test/snapshots/event_fidelity/should_emit_events_in_correct_order_for_tool_using_conversation.yaml +++ b/test/snapshots/event_fidelity/should_emit_events_in_correct_order_for_tool_using_conversation.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Hello World + content: Hello World - role: assistant content: |- The file 'hello.txt' contains: diff --git a/test/snapshots/event_fidelity/should_emit_tool_execution_events_with_correct_fields.yaml b/test/snapshots/event_fidelity/should_emit_tool_execution_events_with_correct_fields.yaml index a6583a15ec..46fd7715ab 100644 --- a/test/snapshots/event_fidelity/should_emit_tool_execution_events_with_correct_fields.yaml +++ b/test/snapshots/event_fidelity/should_emit_tool_execution_events_with_correct_fields.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. test data + content: test data - role: assistant content: |- The file `data.txt` contains: diff --git a/test/snapshots/event_fidelity/should_preserve_message_order_in_getmessages_after_tool_use.yaml b/test/snapshots/event_fidelity/should_preserve_message_order_in_getmessages_after_tool_use.yaml index 2799cdec61..1797cc16b1 100644 --- a/test/snapshots/event_fidelity/should_preserve_message_order_in_getmessages_after_tool_use.yaml +++ b/test/snapshots/event_fidelity/should_preserve_message_order_in_getmessages_after_tool_use.yaml @@ -15,6 +15,6 @@ conversations: arguments: '{"path":"order.txt"}' - role: tool tool_call_id: toolcall_0 - content: 1. ORDER_CONTENT_42 + content: ORDER_CONTENT_42 - role: assistant content: The number in 'order.txt' is **42**. diff --git a/test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_single_tool_call.yaml b/test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_single_tool_call.yaml index 6a51857ab0..9ed9431545 100644 --- a/test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_single_tool_call.yaml +++ b/test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_single_tool_call.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Testing both hooks! + content: Testing both hooks! - role: assistant content: |- The file **both.txt** contains: diff --git a/test/snapshots/hooks/should_invoke_posttooluse_hook_after_model_runs_a_tool.yaml b/test/snapshots/hooks/should_invoke_posttooluse_hook_after_model_runs_a_tool.yaml index 18b324f098..2a5f1ae446 100644 --- a/test/snapshots/hooks/should_invoke_posttooluse_hook_after_model_runs_a_tool.yaml +++ b/test/snapshots/hooks/should_invoke_posttooluse_hook_after_model_runs_a_tool.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. World from the test! + content: World from the test! - role: assistant content: |- The file `world.txt` contains: diff --git a/test/snapshots/hooks/should_invoke_pretooluse_hook_when_model_runs_a_tool.yaml b/test/snapshots/hooks/should_invoke_pretooluse_hook_when_model_runs_a_tool.yaml index 1ce0fe67a0..f695c60f3d 100644 --- a/test/snapshots/hooks/should_invoke_pretooluse_hook_when_model_runs_a_tool.yaml +++ b/test/snapshots/hooks/should_invoke_pretooluse_hook_when_model_runs_a_tool.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Hello from the test! + content: Hello from the test! - role: assistant content: |- The file **hello.txt** contains: diff --git a/test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml b/test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml index a4ede6fcb1..3f05a8c6de 100644 --- a/test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml +++ b/test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml @@ -47,7 +47,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. original content + content: original content - role: assistant content: "Now I'll replace 'original' with 'modified':" - role: assistant @@ -82,7 +82,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. original content + content: original content - role: assistant content: "Now I'll replace 'original' with 'modified':" tool_calls: diff --git a/test/snapshots/session/should_send_with_file_attachment.yaml b/test/snapshots/session/should_send_with_file_attachment.yaml index 23e05d946b..2e8e4d1d2d 100644 --- a/test/snapshots/session/should_send_with_file_attachment.yaml +++ b/test/snapshots/session/should_send_with_file_attachment.yaml @@ -58,7 +58,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. FILE_ATTACHMENT_SENTINEL + content: FILE_ATTACHMENT_SENTINEL - role: assistant content: |- The file contains: diff --git a/test/snapshots/session_config/should_accept_message_attachments.yaml b/test/snapshots/session_config/should_accept_message_attachments.yaml index e9fbabb05e..5525d1fb04 100644 --- a/test/snapshots/session_config/should_accept_message_attachments.yaml +++ b/test/snapshots/session_config/should_accept_message_attachments.yaml @@ -61,7 +61,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. This file is attached + content: This file is attached - role: assistant content: |- The attached file contains a single line of text that says: "This file is attached" diff --git a/test/snapshots/session_config/should_apply_workingdirectory_on_session_resume.yaml b/test/snapshots/session_config/should_apply_workingdirectory_on_session_resume.yaml index 52cc114f94..9d3dd78ff1 100644 --- a/test/snapshots/session_config/should_apply_workingdirectory_on_session_resume.yaml +++ b/test/snapshots/session_config/should_apply_workingdirectory_on_session_resume.yaml @@ -25,7 +25,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. I am in the resume working directory + content: I am in the resume working directory - role: assistant content: |- The file `resume-marker.txt` says: diff --git a/test/snapshots/session_config/should_use_workingdirectory_for_tool_execution.yaml b/test/snapshots/session_config/should_use_workingdirectory_for_tool_execution.yaml index 18dfab04e6..40000d491b 100644 --- a/test/snapshots/session_config/should_use_workingdirectory_for_tool_execution.yaml +++ b/test/snapshots/session_config/should_use_workingdirectory_for_tool_execution.yaml @@ -44,6 +44,6 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. I am in the subdirectory + content: I am in the subdirectory - role: assistant content: 'The file marker.txt says: "I am in the subdirectory"' diff --git a/test/snapshots/system_message_transform/should_apply_transform_modifications_to_section_content.yaml b/test/snapshots/system_message_transform/should_apply_transform_modifications_to_section_content.yaml index 4b7c058b27..98e57919c6 100644 --- a/test/snapshots/system_message_transform/should_apply_transform_modifications_to_section_content.yaml +++ b/test/snapshots/system_message_transform/should_apply_transform_modifications_to_section_content.yaml @@ -26,7 +26,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Hello! + content: Hello! - role: assistant content: |- The file **hello.txt** contains: diff --git a/test/snapshots/system_message_transform/should_invoke_transform_callbacks_with_section_content.yaml b/test/snapshots/system_message_transform/should_invoke_transform_callbacks_with_section_content.yaml index 0b1d9755f0..c54f25e2aa 100644 --- a/test/snapshots/system_message_transform/should_invoke_transform_callbacks_with_section_content.yaml +++ b/test/snapshots/system_message_transform/should_invoke_transform_callbacks_with_section_content.yaml @@ -47,6 +47,6 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Hello transform! + content: Hello transform! - role: assistant content: 'The file `test.txt` contains: **"Hello transform!"**' diff --git a/test/snapshots/system_message_transform/should_work_with_static_overrides_and_transforms_together.yaml b/test/snapshots/system_message_transform/should_work_with_static_overrides_and_transforms_together.yaml index 0681b569dd..32d6367390 100644 --- a/test/snapshots/system_message_transform/should_work_with_static_overrides_and_transforms_together.yaml +++ b/test/snapshots/system_message_transform/should_work_with_static_overrides_and_transforms_together.yaml @@ -47,7 +47,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Combo test! + content: Combo test! - role: assistant content: |- The file `combo.txt` contains: diff --git a/test/snapshots/tools/invokes_built_in_tools.yaml b/test/snapshots/tools/invokes_built_in_tools.yaml index 068cc4accf..0fba134424 100644 --- a/test/snapshots/tools/invokes_built_in_tools.yaml +++ b/test/snapshots/tools/invokes_built_in_tools.yaml @@ -15,6 +15,6 @@ conversations: arguments: '{"path":"${workdir}/README.md"}' - role: tool tool_call_id: toolcall_0 - content: "1. # ELIZA, the only chatbot you'll ever need" + content: "# ELIZA, the only chatbot you'll ever need" - role: assistant content: "The first line of README.md is: `# ELIZA, the only chatbot you'll ever need`" From 924e4bfee662fdfef4c90f3266f06e5c113ba06b Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 26 Aug 2026 19:57:01 -0300 Subject: [PATCH 3/3] test: finish view replay snapshot migration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Carlos Alexandro Becker --- .../builtin_tools/should_edit_a_file_successfully.yaml | 4 +++- .../hooks/invoke_both_hooks_for_single_tool_call.yaml | 2 +- .../invoke_post_tool_use_hook_after_model_runs_a_tool.yaml | 2 +- .../invoke_pre_tool_use_hook_when_model_runs_a_tool.yaml | 2 +- ...etooluse_and_posttooluse_hooks_for_a_single_tool_call.yaml | 2 +- ...should_handle_file_creation_then_reading_across_turns.yaml | 2 +- .../should_use_tool_results_from_previous_turns.yaml | 4 ++-- .../permissions/permission_handler_for_write_operations.yaml | 4 ++-- ...ooluse_and_posttooluse_hooks_for_sub_agent_tool_calls.yaml | 2 +- 9 files changed, 13 insertions(+), 11 deletions(-) diff --git a/test/snapshots/builtin_tools/should_edit_a_file_successfully.yaml b/test/snapshots/builtin_tools/should_edit_a_file_successfully.yaml index 78ca3bbbc3..3f4e986906 100644 --- a/test/snapshots/builtin_tools/should_edit_a_file_successfully.yaml +++ b/test/snapshots/builtin_tools/should_edit_a_file_successfully.yaml @@ -56,7 +56,9 @@ conversations: arguments: '{"path":"${workdir}/edit_me.txt"}' - role: tool tool_call_id: toolcall_2 - content: "Hi Universe\nGoodbye World\n" + content: |- + Hi Universe + Goodbye World - role: assistant content: |- Done! The file now contains: diff --git a/test/snapshots/hooks/invoke_both_hooks_for_single_tool_call.yaml b/test/snapshots/hooks/invoke_both_hooks_for_single_tool_call.yaml index 6a51857ab0..9ed9431545 100644 --- a/test/snapshots/hooks/invoke_both_hooks_for_single_tool_call.yaml +++ b/test/snapshots/hooks/invoke_both_hooks_for_single_tool_call.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Testing both hooks! + content: Testing both hooks! - role: assistant content: |- The file **both.txt** contains: diff --git a/test/snapshots/hooks/invoke_post_tool_use_hook_after_model_runs_a_tool.yaml b/test/snapshots/hooks/invoke_post_tool_use_hook_after_model_runs_a_tool.yaml index 18b324f098..2a5f1ae446 100644 --- a/test/snapshots/hooks/invoke_post_tool_use_hook_after_model_runs_a_tool.yaml +++ b/test/snapshots/hooks/invoke_post_tool_use_hook_after_model_runs_a_tool.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. World from the test! + content: World from the test! - role: assistant content: |- The file `world.txt` contains: diff --git a/test/snapshots/hooks/invoke_pre_tool_use_hook_when_model_runs_a_tool.yaml b/test/snapshots/hooks/invoke_pre_tool_use_hook_when_model_runs_a_tool.yaml index 1ce0fe67a0..f695c60f3d 100644 --- a/test/snapshots/hooks/invoke_pre_tool_use_hook_when_model_runs_a_tool.yaml +++ b/test/snapshots/hooks/invoke_pre_tool_use_hook_when_model_runs_a_tool.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Hello from the test! + content: Hello from the test! - role: assistant content: |- The file **hello.txt** contains: diff --git a/test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_a_single_tool_call.yaml b/test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_a_single_tool_call.yaml index 6a51857ab0..9ed9431545 100644 --- a/test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_a_single_tool_call.yaml +++ b/test/snapshots/hooks/should_invoke_both_pretooluse_and_posttooluse_hooks_for_a_single_tool_call.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. Testing both hooks! + content: Testing both hooks! - role: assistant content: |- The file **both.txt** contains: diff --git a/test/snapshots/multi_turn/should_handle_file_creation_then_reading_across_turns.yaml b/test/snapshots/multi_turn/should_handle_file_creation_then_reading_across_turns.yaml index 0d79c3e1ab..583366363a 100644 --- a/test/snapshots/multi_turn/should_handle_file_creation_then_reading_across_turns.yaml +++ b/test/snapshots/multi_turn/should_handle_file_creation_then_reading_across_turns.yaml @@ -83,7 +83,7 @@ conversations: arguments: '{"path":"${workdir}/greeting.txt"}' - role: tool tool_call_id: toolcall_2 - content: 1. Hello from multi-turn test + content: Hello from multi-turn test - role: assistant content: |- The exact contents of `greeting.txt` are: diff --git a/test/snapshots/multi_turn/should_use_tool_results_from_previous_turns.yaml b/test/snapshots/multi_turn/should_use_tool_results_from_previous_turns.yaml index b930bb46ac..96dc365c65 100644 --- a/test/snapshots/multi_turn/should_use_tool_results_from_previous_turns.yaml +++ b/test/snapshots/multi_turn/should_use_tool_results_from_previous_turns.yaml @@ -44,7 +44,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. The magic number is 42. + content: The magic number is 42. - role: assistant content: The magic number is **42**. - messages: @@ -69,7 +69,7 @@ conversations: content: Tool 'report_intent' does not exist. - role: tool tool_call_id: toolcall_1 - content: 1. The magic number is 42. + content: The magic number is 42. - role: assistant content: The magic number is **42**. - role: user diff --git a/test/snapshots/permissions/permission_handler_for_write_operations.yaml b/test/snapshots/permissions/permission_handler_for_write_operations.yaml index a4ede6fcb1..3f05a8c6de 100644 --- a/test/snapshots/permissions/permission_handler_for_write_operations.yaml +++ b/test/snapshots/permissions/permission_handler_for_write_operations.yaml @@ -47,7 +47,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. original content + content: original content - role: assistant content: "Now I'll replace 'original' with 'modified':" - role: assistant @@ -82,7 +82,7 @@ conversations: task. - role: tool tool_call_id: toolcall_1 - content: 1. original content + content: original content - role: assistant content: "Now I'll replace 'original' with 'modified':" tool_calls: diff --git a/test/snapshots/subagent_hooks/should_invoke_pretooluse_and_posttooluse_hooks_for_sub_agent_tool_calls.yaml b/test/snapshots/subagent_hooks/should_invoke_pretooluse_and_posttooluse_hooks_for_sub_agent_tool_calls.yaml index c905726ee3..f920f8705b 100644 --- a/test/snapshots/subagent_hooks/should_invoke_pretooluse_and_posttooluse_hooks_for_sub_agent_tool_calls.yaml +++ b/test/snapshots/subagent_hooks/should_invoke_pretooluse_and_posttooluse_hooks_for_sub_agent_tool_calls.yaml @@ -56,7 +56,7 @@ conversations: arguments: '{"path":"${workdir}/subagent-test.txt"}' - role: tool tool_call_id: toolcall_0 - content: 1. Hello from subagent test! + content: Hello from subagent test! - role: assistant content: |- The complete contents of the file "subagent-test.txt" are: