From 20677d0dfa709dd9d57e8dba4d95dfe76d3d7067 Mon Sep 17 00:00:00 2001 From: Ed Burns Date: Mon, 1 Jun 2026 23:00:49 -0700 Subject: [PATCH 1/2] java: update @github/copilot dependency to ^1.0.57 - Update codegen package.json and lock file to ^1.0.57 - Regenerate Java sources from updated Zod schemas - New types: ContextTier, SessionExtensionsAttachmentsPushedEvent, ServerRuntimeApi, ServerUserApi, SessionCanvasActionApi, and more - Fix compilation: add contextTier param to SessionModelSwitchToParams call sites, suppressCustomAgentPrompt and new trailing fields to SessionOptionsUpdateParams, extra field to SessionStartEventData - Update tests to match new record constructor signatures Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- java/scripts/codegen/package-lock.json | 72 +++++++++---------- java/scripts/codegen/package.json | 2 +- .../github/copilot/generated/ContextTier.java | 35 +++++++++ .../copilot/generated/SessionEvent.java | 2 + ...ssionExtensionsAttachmentsPushedEvent.java | 43 +++++++++++ .../generated/SessionModelChangeEvent.java | 21 +----- .../copilot/generated/SessionResumeEvent.java | 2 + .../copilot/generated/SessionStartEvent.java | 2 + .../generated/ToolExecutionStartEvent.java | 2 + .../rpc/CanvasActionInvokeParams.java | 41 +++++++++++ .../copilot/generated/rpc/ContextTier.java | 35 +++++++++ .../generated/rpc/CurrentToolMetadata.java | 40 +++++++++++ .../rpc/ModelBillingTokenPrices.java | 2 +- .../ModelBillingTokenPricesLongContext.java | 2 +- .../rpc/PermissionsSetAllowAllSource.java | 39 ++++++++++ .../generated/rpc/ServerMcpConfigApi.java | 8 +++ .../copilot/generated/rpc/ServerRpc.java | 6 ++ .../generated/rpc/ServerRuntimeApi.java | 36 ++++++++++ .../copilot/generated/rpc/ServerUserApi.java | 32 +++++++++ .../generated/rpc/ServerUserSettingsApi.java | 36 ++++++++++ .../generated/rpc/SessionCanvasActionApi.java | 47 ++++++++++++ .../rpc/SessionCanvasActionInvokeParams.java | 33 +++++++++ .../rpc/SessionCanvasActionInvokeResult.java | 27 +++++++ .../generated/rpc/SessionCanvasApi.java | 19 ++--- .../generated/rpc/SessionExtensionsApi.java | 15 ++++ ...ensionsSendAttachmentsToMessageParams.java | 32 +++++++++ .../rpc/SessionMetadataContextInfoResult.java | 4 +- .../generated/rpc/SessionModelApi.java | 12 +++- .../rpc/SessionModelGetCurrentResult.java | 6 +- .../generated/rpc/SessionModelListParams.java | 27 +++++++ .../generated/rpc/SessionModelListResult.java | 31 ++++++++ .../rpc/SessionModelSwitchToParams.java | 6 +- .../rpc/SessionOptionsUpdateParams.java | 16 ++++- .../SessionPermissionsSetAllowAllParams.java | 4 +- .../generated/rpc/SessionToolsApi.java | 10 +++ .../SessionToolsGetCurrentMetadataParams.java | 27 +++++++ .../SessionToolsGetCurrentMetadataResult.java | 28 ++++++++ .../com/github/copilot/CopilotClient.java | 9 ++- .../com/github/copilot/CopilotSession.java | 5 +- .../com/github/copilot/RpcWrappersTest.java | 2 +- .../copilot/SessionEventHandlingTest.java | 4 +- .../rpc/GeneratedRpcRecordsCoverageTest.java | 6 +- 42 files changed, 737 insertions(+), 91 deletions(-) create mode 100644 java/src/generated/java/com/github/copilot/generated/ContextTier.java create mode 100644 java/src/generated/java/com/github/copilot/generated/SessionExtensionsAttachmentsPushedEvent.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/CanvasActionInvokeParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ContextTier.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/CurrentToolMetadata.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/PermissionsSetAllowAllSource.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ServerRuntimeApi.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ServerUserApi.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/ServerUserSettingsApi.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionApi.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionInvokeParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionInvokeResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsSendAttachmentsToMessageParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionModelListParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionModelListResult.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataParams.java create mode 100644 java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataResult.java diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index a0c6c648f..71d0f9225 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.55-5", + "@github/copilot": "^1.0.57", "json-schema": "^0.4.0", "tsx": "^4.20.6" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.55-5.tgz", - "integrity": "sha512-n6Vr876Iz41PW8pSpOa7SbrNCqaV+6HDLNf/n8V4gIwwlOlIz7Jb00r/fboXZFIT+0dyAGGLoGgd7xUujVL/Xw==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.57.tgz", + "integrity": "sha512-7dpOu9/qiodmFohZVpTxYmTcjbcXfstWeHof0Ka5RkhguKMkbS3c+sW23a7TTjtlViTV73z+IZFfFW1ru621kw==", "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.55-5", - "@github/copilot-darwin-x64": "1.0.55-5", - "@github/copilot-linux-arm64": "1.0.55-5", - "@github/copilot-linux-x64": "1.0.55-5", - "@github/copilot-linuxmusl-arm64": "1.0.55-5", - "@github/copilot-linuxmusl-x64": "1.0.55-5", - "@github/copilot-win32-arm64": "1.0.55-5", - "@github/copilot-win32-x64": "1.0.55-5" + "@github/copilot-darwin-arm64": "1.0.57", + "@github/copilot-darwin-x64": "1.0.57", + "@github/copilot-linux-arm64": "1.0.57", + "@github/copilot-linux-x64": "1.0.57", + "@github/copilot-linuxmusl-arm64": "1.0.57", + "@github/copilot-linuxmusl-x64": "1.0.57", + "@github/copilot-win32-arm64": "1.0.57", + "@github/copilot-win32-x64": "1.0.57" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.55-5.tgz", - "integrity": "sha512-Mult62GJVnxR3MOP2QNiVU5RRGXPJ+7BpjEMIvkoaMuWX6J7F4bz7N+HUXVHJUiGUp3hnL3M16kjkewWfNdoNg==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.57.tgz", + "integrity": "sha512-ZmsojZbitPSRfgw3W9wBrHGLRDsBvMCjGsGnJ7xXOU6qxeF/IyWHADxEv1WKfDw8BdCM+LE5yITPXB8bcvCdqQ==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.55-5.tgz", - "integrity": "sha512-IfY3WhNvHwXHldI2ARsiAYuPlKWlI07Fo1ALq+SViHhn0Zfp2yIr9laJRofyj0G1EbyUxkbNlqQm7UrXhkEVeg==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.57.tgz", + "integrity": "sha512-F4TFDOdORy4oSHJS4DE+3sTk09uk1lohOloe0jfvoEVxJSU6jdQcJLNGoo+BQljcG7a1HEBrmB04iAWG1UXVfA==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.55-5.tgz", - "integrity": "sha512-UPZ5Y5QotcZvo3f4yFwJVOtAgUT3mq+q2fim82kWa/MA0+EkkADZ3kb+R4OnV1Nqv5EaoZiCFh0Ukk++IMSYwQ==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.57.tgz", + "integrity": "sha512-6apNY/v7CMxKk45CctUZLzQnddBpIG9keSendFKYN+kBIEBSdy//s/Cz/4YQX1iERnklpgZRP7FvcwaKs0/7YA==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.55-5.tgz", - "integrity": "sha512-Fdwiir53Ogg8C9xv6sTc7/C4vFfQHt6VWFB74kojbDgIbYEpm57wNygQVwJvrwtVW3w/b1MLtGGTp7pEvUBACQ==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.57.tgz", + "integrity": "sha512-EOOnU4Y+vZHfxVl8eBAP7JtSTmu5d4ZDUC9wCGpAA5k703lEnpu8UOv04mTHRn8KTzb8gj+ijNhxDWe3Xljbaw==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.55-5.tgz", - "integrity": "sha512-NqPmeAA1+iI8Xd4wJUHNNCmVTmHCl+R3nqdXhEVQDLIau9ouGqGGay/91d2ZIgFXJn7J0UTAEdHbdBcfhbnhvg==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.57.tgz", + "integrity": "sha512-FCAaaJLX5T2ZpMeS1TCNnhQuGqyH9WVZndFdN1VOEnN/iWeSSaVF3lM4TPyRHHnWDVxzZtB+VLqOSjINZntD6g==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.55-5.tgz", - "integrity": "sha512-bOB4vKw1R7Mekn8z34xpNViYUQ4LQAEFzpkyxhc0uOliFmfku/YcIgo42aMWFzf/Bi3iBazBNfCN+L2lz/Jc9A==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.57.tgz", + "integrity": "sha512-AMIBN830yOvNcrj2Q0tGMImqat/V24wZS/4m5BaUssELM7r7KrT9ZBnBs+nWDZYeQaRoblFWL3f4AfxE3t94lQ==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.55-5.tgz", - "integrity": "sha512-pR2KaiXUanjxolaWgRPlFdeTEpb7jcN1Rk8xVnBCD2ORwERXdYrqXaLCyDbgdplI9mI6IjM+kkUbyXzXoWz/HQ==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.57.tgz", + "integrity": "sha512-3TL2bd1/p/sYbNgDIqbnjES//zlXP5b0sPEXKQRrpVF9ZLN3vjQ1tmBWx8Qx7zn2J3oywH2dG7qKjuxWTJRXKA==", "cpu": [ "arm64" ], @@ -562,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.55-5", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.55-5.tgz", - "integrity": "sha512-EuQBgqSnRFjavgeFifbnSYUJ4elTQBLC/kf+WHolrHR2oUGyiqCQZz/cV2DYVSLP1TGxDKAV4AQCM1AdUT1xEA==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.57.tgz", + "integrity": "sha512-zuKqRn0pIF+ZvuiMXbZkYK1AMlrV21kFTpyf5l7gdI1dzJuwHNI0Qfe0gzaZYaU1B4htbzMk9MhEbjR1PQcoJg==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index 6664dd8f2..07348fb1c 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.55-5", + "@github/copilot": "^1.0.57", "json-schema": "^0.4.0", "tsx": "^4.20.6" } diff --git a/java/src/generated/java/com/github/copilot/generated/ContextTier.java b/java/src/generated/java/com/github/copilot/generated/ContextTier.java new file mode 100644 index 000000000..0ecd7319c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/ContextTier.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; + +/** + * Allowed values for the `ContextTier` enumeration. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ContextTier { + /** The {@code default} variant. */ + DEFAULT("default"), + /** The {@code long_context} variant. */ + LONG_CONTEXT("long_context"); + + private final String value; + ContextTier(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ContextTier fromValue(String value) { + for (ContextTier v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ContextTier value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java index 570fe3a9e..724faee03 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -111,6 +111,7 @@ @JsonSubTypes.Type(value = SessionExtensionsLoadedEvent.class, name = "session.extensions_loaded"), @JsonSubTypes.Type(value = SessionCanvasOpenedEvent.class, name = "session.canvas.opened"), @JsonSubTypes.Type(value = SessionCanvasRegistryChangedEvent.class, name = "session.canvas.registry_changed"), + @JsonSubTypes.Type(value = SessionExtensionsAttachmentsPushedEvent.class, name = "session.extensions.attachments_pushed"), @JsonSubTypes.Type(value = McpAppToolCallCompleteEvent.class, name = "mcp_app.tool_call_complete") }) @javax.annotation.processing.Generated("copilot-sdk-codegen") @@ -201,6 +202,7 @@ public abstract sealed class SessionEvent permits SessionExtensionsLoadedEvent, SessionCanvasOpenedEvent, SessionCanvasRegistryChangedEvent, + SessionExtensionsAttachmentsPushedEvent, McpAppToolCallCompleteEvent, UnknownSessionEvent { diff --git a/java/src/generated/java/com/github/copilot/generated/SessionExtensionsAttachmentsPushedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionExtensionsAttachmentsPushedEvent.java new file mode 100644 index 000000000..14eab1530 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionExtensionsAttachmentsPushedEvent.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * 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 java.util.List; +import javax.annotation.processing.Generated; + +/** + * Session event "session.extensions.attachments_pushed". + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionExtensionsAttachmentsPushedEvent extends SessionEvent { + + @Override + public String getType() { return "session.extensions.attachments_pushed"; } + + @JsonProperty("data") + private SessionExtensionsAttachmentsPushedEventData data; + + public SessionExtensionsAttachmentsPushedEventData getData() { return data; } + public void setData(SessionExtensionsAttachmentsPushedEventData data) { this.data = data; } + + /** Data payload for {@link SessionExtensionsAttachmentsPushedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionExtensionsAttachmentsPushedEventData( + /** Attachments contributed by an extension; the host should surface these as composer pills and forward them via the next session.send call. */ + @JsonProperty("attachments") List attachments + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java index e0d8785b9..50f6018b3 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java @@ -48,28 +48,9 @@ public record SessionModelChangeEventData( /** Reasoning summary mode after the model change, if applicable */ @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, /** Context tier after the model change; null explicitly clears a previously selected tier */ - @JsonProperty("contextTier") SessionModelChangeEventDataContextTier contextTier, + @JsonProperty("contextTier") ContextTier contextTier, /** Reason the change happened, when not user-initiated. Currently `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy. */ @JsonProperty("cause") String cause ) { - - public enum SessionModelChangeEventDataContextTier { - /** The {@code default} variant. */ - DEFAULT("default"), - /** The {@code long_context} variant. */ - LONG_CONTEXT("long_context"); - - private final String value; - SessionModelChangeEventDataContextTier(String value) { this.value = value; } - @com.fasterxml.jackson.annotation.JsonValue - public String getValue() { return value; } - @com.fasterxml.jackson.annotation.JsonCreator - public static SessionModelChangeEventDataContextTier fromValue(String value) { - for (SessionModelChangeEventDataContextTier v : values()) { - if (v.value.equals(value)) return v; - } - throw new IllegalArgumentException("Unknown SessionModelChangeEventDataContextTier value: " + value); - } - } } } diff --git a/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java index e27cc2045..bbe07ff1f 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java @@ -46,6 +46,8 @@ public record SessionResumeEventData( @JsonProperty("reasoningEffort") String reasoningEffort, /** Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed") */ @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, + /** Context tier currently selected at resume time; null when no tier is active */ + @JsonProperty("contextTier") ContextTier contextTier, /** Updated working directory and git context at resume time */ @JsonProperty("context") WorkingDirectoryContext context, /** Whether the session was already in use by another client at resume time */ diff --git a/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java index 0bb4b800f..3929868c9 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java @@ -52,6 +52,8 @@ public record SessionStartEventData( @JsonProperty("reasoningEffort") String reasoningEffort, /** Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed") */ @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, + /** Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model) */ + @JsonProperty("contextTier") ContextTier contextTier, /** Working directory and git context at session start */ @JsonProperty("context") WorkingDirectoryContext context, /** Whether the session was already in use by another client at start time */ diff --git a/java/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java b/java/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java index 7a46ea88c..f47e397ad 100644 --- a/java/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java @@ -41,6 +41,8 @@ public record ToolExecutionStartEventData( @JsonProperty("toolName") String toolName, /** Arguments passed to the tool */ @JsonProperty("arguments") Object arguments, + /** Model identifier that generated this tool call */ + @JsonProperty("model") String model, /** Name of the MCP server hosting this tool, when the tool is an MCP tool */ @JsonProperty("mcpServerName") String mcpServerName, /** Original tool name on the MCP server, when the tool is an MCP tool */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/CanvasActionInvokeParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/CanvasActionInvokeParams.java new file mode 100644 index 000000000..e64aec5dd --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/CanvasActionInvokeParams.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Canvas action invocation parameters sent to the provider. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CanvasActionInvokeParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Action name to invoke */ + @JsonProperty("actionName") String actionName, + /** Action input */ + @JsonProperty("input") Object input, + /** Host context supplied by the runtime. */ + @JsonProperty("host") CanvasHostContext host, + /** Session context supplied by the runtime. */ + @JsonProperty("session") CanvasSessionContext session +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ContextTier.java b/java/src/generated/java/com/github/copilot/generated/rpc/ContextTier.java new file mode 100644 index 000000000..fc5e14dc6 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ContextTier.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Context tier for models that support multiple context-window sizes. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ContextTier { + /** The {@code default} variant. */ + DEFAULT("default"), + /** The {@code long_context} variant. */ + LONG_CONTEXT("long_context"); + + private final String value; + ContextTier(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ContextTier fromValue(String value) { + for (ContextTier v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ContextTier value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/CurrentToolMetadata.java b/java/src/generated/java/com/github/copilot/generated/rpc/CurrentToolMetadata.java new file mode 100644 index 000000000..d198c2f94 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/CurrentToolMetadata.java @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * Lightweight metadata for a currently initialized session tool + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CurrentToolMetadata( + /** Model-facing tool name */ + @JsonProperty("name") String name, + /** Optional MCP/config namespaced tool name */ + @JsonProperty("namespacedName") String namespacedName, + /** MCP server name for MCP-backed tools */ + @JsonProperty("mcpServerName") String mcpServerName, + /** Raw MCP tool name for MCP-backed tools */ + @JsonProperty("mcpToolName") String mcpToolName, + /** Tool description */ + @JsonProperty("description") String description, + /** JSON Schema for tool input */ + @JsonProperty("input_schema") Map inputSchema, + /** Whether the tool is loaded on demand via tool search */ + @JsonProperty("deferLoading") Boolean deferLoading +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPrices.java b/java/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPrices.java index 756ccaa02..5cbf0e99a 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPrices.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPrices.java @@ -29,7 +29,7 @@ public record ModelBillingTokenPrices( @JsonProperty("cachePrice") Double cachePrice, /** Number of tokens per standard billing batch */ @JsonProperty("batchSize") Long batchSize, - /** Maximum context window tokens for the default tier */ + /** Prompt token budget (max_prompt_tokens) for the default tier. The total context window is this value plus the model's max_output_tokens. */ @JsonProperty("contextMax") Long contextMax, /** Long context tier pricing (available for models with extended context windows) */ @JsonProperty("longContext") ModelBillingTokenPricesLongContext longContext diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPricesLongContext.java b/java/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPricesLongContext.java index 983742c19..5c2cfe98c 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPricesLongContext.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPricesLongContext.java @@ -27,7 +27,7 @@ public record ModelBillingTokenPricesLongContext( @JsonProperty("outputPrice") Double outputPrice, /** AI Credits cost per billing batch of cached tokens */ @JsonProperty("cachePrice") Double cachePrice, - /** Maximum context window tokens for the long context tier */ + /** Prompt token budget (max_prompt_tokens) for the long context tier. The total context window is this value plus the model's max_output_tokens. */ @JsonProperty("contextMax") Long contextMax ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/PermissionsSetAllowAllSource.java b/java/src/generated/java/com/github/copilot/generated/rpc/PermissionsSetAllowAllSource.java new file mode 100644 index 000000000..a7ff9ae9a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/PermissionsSetAllowAllSource.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PermissionsSetAllowAllSource { + /** The {@code cli_flag} variant. */ + CLI_FLAG("cli_flag"), + /** The {@code slash_command} variant. */ + SLASH_COMMAND("slash_command"), + /** The {@code autopilot_confirmation} variant. */ + AUTOPILOT_CONFIRMATION("autopilot_confirmation"), + /** The {@code rpc} variant. */ + RPC("rpc"); + + private final String value; + PermissionsSetAllowAllSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionsSetAllowAllSource fromValue(String value) { + for (PermissionsSetAllowAllSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionsSetAllowAllSource value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerMcpConfigApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerMcpConfigApi.java index 6f0a2105d..ce5974f5b 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ServerMcpConfigApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerMcpConfigApi.java @@ -73,4 +73,12 @@ public CompletableFuture disable(McpConfigDisableParams params) { return caller.invoke("mcp.config.disable", params, Void.class); } + /** + * Invokes {@code mcp.config.reload}. + * @since 1.0.0 + */ + public CompletableFuture reload() { + return caller.invoke("mcp.config.reload", java.util.Map.of(), Void.class); + } + } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java index 8d9767658..38b76b581 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java @@ -36,6 +36,10 @@ public final class ServerRpc { public final ServerMcpApi mcp; /** API methods for the {@code skills} namespace. */ public final ServerSkillsApi skills; + /** API methods for the {@code user} namespace. */ + public final ServerUserApi user; + /** API methods for the {@code runtime} namespace. */ + public final ServerRuntimeApi runtime; /** API methods for the {@code sessionFs} namespace. */ public final ServerSessionFsApi sessionFs; /** API methods for the {@code sessions} namespace. */ @@ -56,6 +60,8 @@ public ServerRpc(RpcCaller caller) { this.secrets = new ServerSecretsApi(caller); this.mcp = new ServerMcpApi(caller); this.skills = new ServerSkillsApi(caller); + this.user = new ServerUserApi(caller); + this.runtime = new ServerRuntimeApi(caller); this.sessionFs = new ServerSessionFsApi(caller); this.sessions = new ServerSessionsApi(caller); this.agentRegistry = new ServerAgentRegistryApi(caller); diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerRuntimeApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerRuntimeApi.java new file mode 100644 index 000000000..9c98df968 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerRuntimeApi.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code runtime} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ServerRuntimeApi { + + private final RpcCaller caller; + + /** @param caller the RPC transport function */ + ServerRuntimeApi(RpcCaller caller) { + this.caller = caller; + } + + /** + * Invokes {@code runtime.shutdown}. + * @since 1.0.0 + */ + public CompletableFuture shutdown() { + return caller.invoke("runtime.shutdown", java.util.Map.of(), Void.class); + } + +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerUserApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerUserApi.java new file mode 100644 index 000000000..e80155f95 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerUserApi.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code user} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ServerUserApi { + + private final RpcCaller caller; + + /** API methods for the {@code user.settings} sub-namespace. */ + public final ServerUserSettingsApi settings; + + /** @param caller the RPC transport function */ + ServerUserApi(RpcCaller caller) { + this.caller = caller; + this.settings = new ServerUserSettingsApi(caller); + } + +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ServerUserSettingsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/ServerUserSettingsApi.java new file mode 100644 index 000000000..0f11436e3 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ServerUserSettingsApi.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code user.settings} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ServerUserSettingsApi { + + private final RpcCaller caller; + + /** @param caller the RPC transport function */ + ServerUserSettingsApi(RpcCaller caller) { + this.caller = caller; + } + + /** + * Invokes {@code user.settings.reload}. + * @since 1.0.0 + */ + public CompletableFuture reload() { + return caller.invoke("user.settings.reload", java.util.Map.of(), Void.class); + } + +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionApi.java new file mode 100644 index 000000000..2b892b5a6 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionApi.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code canvas.action} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCanvasActionApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionCanvasActionApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Canvas action invocation parameters. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture invoke(SessionCanvasActionInvokeParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.canvas.action.invoke", _p, SessionCanvasActionInvokeResult.class); + } + +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionInvokeParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionInvokeParams.java new file mode 100644 index 000000000..1461d2b83 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionInvokeParams.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Canvas action invocation parameters. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasActionInvokeParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Open canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Action name to invoke */ + @JsonProperty("actionName") String actionName, + /** Action input */ + @JsonProperty("input") Object input +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionInvokeResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionInvokeResult.java new file mode 100644 index 000000000..71d03cf5e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasActionInvokeResult.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Canvas action invocation result. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasActionInvokeResult( + /** Provider-supplied action result */ + @JsonProperty("result") Object result +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasApi.java index 8388c82a2..8bcce72f4 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasApi.java @@ -23,10 +23,14 @@ public final class SessionCanvasApi { private final RpcCaller caller; private final String sessionId; + /** API methods for the {@code canvas.action} sub-namespace. */ + public final SessionCanvasActionApi action; + /** @param caller the RPC transport function */ SessionCanvasApi(RpcCaller caller, String sessionId) { this.caller = caller; this.sessionId = sessionId; + this.action = new SessionCanvasActionApi(caller, sessionId); } /** @@ -79,19 +83,4 @@ public CompletableFuture close(SessionCanvasCloseParams params) { return caller.invoke("session.canvas.close", _p, Void.class); } - /** - * Canvas action invocation parameters. - *

- * Note: the {@code sessionId} field in the params record is overridden - * by the session-scoped wrapper; any value provided is ignored. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - public CompletableFuture invokeAction(SessionCanvasInvokeActionParams params) { - com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); - _p.put("sessionId", this.sessionId); - return caller.invoke("session.canvas.invokeAction", _p, SessionCanvasInvokeActionResult.class); - } - } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsApi.java index 337ba15cc..12741d8c7 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsApi.java @@ -79,4 +79,19 @@ public CompletableFuture reload() { return caller.invoke("session.extensions.reload", java.util.Map.of("sessionId", this.sessionId), Void.class); } + /** + * Parameters for session.extensions.sendAttachmentsToMessage. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture sendAttachmentsToMessage(SessionExtensionsSendAttachmentsToMessageParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.extensions.sendAttachmentsToMessage", _p, Void.class); + } + } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsSendAttachmentsToMessageParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsSendAttachmentsToMessageParams.java new file mode 100644 index 000000000..b1353901f --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsSendAttachmentsToMessageParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Parameters for session.extensions.sendAttachmentsToMessage. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsSendAttachmentsToMessageParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment. */ + @JsonProperty("instanceId") String instanceId, + /** Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape. */ + @JsonProperty("attachments") List attachments +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoResult.java index de9074e8c..a1973f8ee 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoResult.java @@ -37,13 +37,15 @@ public record SessionMetadataContextInfoResultContextInfo( @JsonProperty("conversationTokens") Long conversationTokens, /** Tokens consumed by tool definitions sent to the model (excludes deferred tools) */ @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens, + /** Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools) */ + @JsonProperty("mcpToolsTokens") Long mcpToolsTokens, /** Sum of system, conversation and tool-definition tokens */ @JsonProperty("totalTokens") Long totalTokens, /** Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified) */ @JsonProperty("promptTokenLimit") Long promptTokenLimit, /** Token count at which background compaction starts (configurable percentage of promptTokenLimit) */ @JsonProperty("compactionThreshold") Long compactionThreshold, - /** Total context limit for /context display. promptTokenLimit + min(32k or 64k, outputTokenLimit) depending on model. */ + /** Total context limit for /context display: promptTokenLimit + outputTokenLimit (the model's full max_output_tokens reserved on top of the prompt budget). */ @JsonProperty("limit") Long limit, /** Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%) */ @JsonProperty("bufferTokens") Long bufferTokens diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java index eda751b3e..9aa7ced5f 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java @@ -40,7 +40,7 @@ public CompletableFuture getCurrent() { } /** - * Target model identifier and optional reasoning effort, summary, and capability overrides. + * Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -69,4 +69,14 @@ public CompletableFuture setReasoningEffor return caller.invoke("session.model.setReasoningEffort", _p, SessionModelSetReasoningEffortResult.class); } + /** + * Optional listing options. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture list() { + return caller.invoke("session.model.list", java.util.Map.of("sessionId", this.sessionId), SessionModelListResult.class); + } + } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java index 7bb2f8496..c591ab212 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The currently selected model and reasoning effort for the session. + * The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. * * @since 1.0.0 */ @@ -24,6 +24,8 @@ public record SessionModelGetCurrentResult( /** Currently active model identifier */ @JsonProperty("modelId") String modelId, /** Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. */ - @JsonProperty("reasoningEffort") String reasoningEffort + @JsonProperty("reasoningEffort") String reasoningEffort, + /** Context tier for models that support multiple context-window sizes. */ + @JsonProperty("contextTier") ContextTier contextTier ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelListParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelListParams.java new file mode 100644 index 000000000..9dd6bafff --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelListParams.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Optional listing options. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelListResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelListResult.java new file mode 100644 index 000000000..9cb5552d6 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelListResult.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * The list of models available to this session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelListResult( + /** Available models, ordered with the most preferred default first. */ + @JsonProperty("list") List list, + /** Per-quota snapshots returned alongside the model list, keyed by quota type. */ + @JsonProperty("quotaSnapshots") Map quotaSnapshots +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java index c5c1cbbe0..082c506e4 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Target model identifier and optional reasoning effort, summary, and capability overrides. + * Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. * * @since 1.0.0 */ @@ -30,6 +30,8 @@ public record SessionModelSwitchToParams( /** Reasoning summary mode to request for supported model clients */ @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, /** Override individual model capabilities resolved by the runtime */ - @JsonProperty("modelCapabilities") ModelCapabilitiesOverride modelCapabilities + @JsonProperty("modelCapabilities") ModelCapabilitiesOverride modelCapabilities, + /** Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier. */ + @JsonProperty("contextTier") ContextTier contextTier ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java index 8f9a06a4f..27099d751 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java @@ -71,6 +71,8 @@ public record SessionOptionsUpdateParams( @JsonProperty("installedPlugins") List installedPlugins, /** Whether to default custom agents to local-only execution. */ @JsonProperty("customAgentsLocalOnly") Boolean customAgentsLocalOnly, + /** When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement. */ + @JsonProperty("suppressCustomAgentPrompt") Boolean suppressCustomAgentPrompt, /** Whether to skip loading custom instruction sources. */ @JsonProperty("skipCustomInstructions") Boolean skipCustomInstructions, /** Instruction source IDs to exclude from the system prompt. */ @@ -98,6 +100,18 @@ public record SessionOptionsUpdateParams( /** Additional content-exclusion policies to merge into the session's policy set. Opaque shape; see `ContentExclusionApiResponse` in the runtime. */ @JsonProperty("additionalContentExclusionPolicies") List additionalContentExclusionPolicies, /** Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users). */ - @JsonProperty("manageScheduleEnabled") Boolean manageScheduleEnabled + @JsonProperty("manageScheduleEnabled") Boolean manageScheduleEnabled, + /** Whether to skip embedding retrieval pipeline initialization and execution. */ + @JsonProperty("skipEmbeddingRetrieval") Boolean skipEmbeddingRetrieval, + /** Organization-level custom instructions to inject into the system prompt. */ + @JsonProperty("organizationCustomInstructions") String organizationCustomInstructions, + /** Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism. */ + @JsonProperty("enableFileHooks") Boolean enableFileHooks, + /** Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt). */ + @JsonProperty("enableHostGitOperations") Boolean enableHostGitOperations, + /** Whether to enable cross-session store writes and reads. */ + @JsonProperty("enableSessionStore") Boolean enableSessionStore, + /** Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset. */ + @JsonProperty("enableSkills") Boolean enableSkills ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java index e6335f45b..dd87ad107 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java @@ -24,6 +24,8 @@ public record SessionPermissionsSetAllowAllParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, /** Whether to enable full allow-all permissions */ - @JsonProperty("enabled") Boolean enabled + @JsonProperty("enabled") Boolean enabled, + /** Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. */ + @JsonProperty("source") PermissionsSetAllowAllSource source ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsApi.java index 81c04f2ca..efe108bec 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsApi.java @@ -54,4 +54,14 @@ public CompletableFuture initializeAndValidate() { return caller.invoke("session.tools.initializeAndValidate", java.util.Map.of("sessionId", this.sessionId), Void.class); } + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getCurrentMetadata() { + return caller.invoke("session.tools.getCurrentMetadata", java.util.Map.of("sessionId", this.sessionId), SessionToolsGetCurrentMetadataResult.class); + } + } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataParams.java new file mode 100644 index 000000000..e8f5b0925 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataParams.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionToolsGetCurrentMetadataParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataResult.java new file mode 100644 index 000000000..f72e47e3c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataResult.java @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Current lightweight tool metadata snapshot for the session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionToolsGetCurrentMetadataResult( + /** Current tool metadata, or null when tools have not been initialized yet */ + @JsonProperty("tools") List tools +) { +} diff --git a/java/src/main/java/com/github/copilot/CopilotClient.java b/java/src/main/java/com/github/copilot/CopilotClient.java index 6422c773d..9e4a776ad 100644 --- a/java/src/main/java/com/github/copilot/CopilotClient.java +++ b/java/src/main/java/com/github/copilot/CopilotClient.java @@ -820,6 +820,7 @@ CompletableFuture updateSessionOptionsForMode(CopilotSession session, Bool null, // enableOnDemandInstructionDiscovery patchPlugins, // installedPlugins patchAgents, // customAgentsLocalOnly + null, // suppressCustomAgentPrompt patchSkip, // skipCustomInstructions null, // disabledInstructionSources patchCoauthor, // coauthorEnabled @@ -833,7 +834,13 @@ CompletableFuture updateSessionOptionsForMode(CopilotSession session, Bool null, // agentContext null, // eventsLogDirectory null, // additionalContentExclusionPolicies - patchSchedule // manageScheduleEnabled + patchSchedule, // manageScheduleEnabled + null, // skipEmbeddingRetrieval + null, // organizationCustomInstructions + null, // enableFileHooks + null, // enableHostGitOperations + null, // enableSessionStore + null // enableSkills ); return session.getRpc().options.update(params).thenCompose(result -> { diff --git a/java/src/main/java/com/github/copilot/CopilotSession.java b/java/src/main/java/com/github/copilot/CopilotSession.java index 64c02d8b8..1daa3cd9f 100644 --- a/java/src/main/java/com/github/copilot/CopilotSession.java +++ b/java/src/main/java/com/github/copilot/CopilotSession.java @@ -1697,7 +1697,8 @@ public CompletableFuture abort() { */ public CompletableFuture setModel(String model, String reasoningEffort) { ensureNotTerminated(); - return getRpc().model.switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, null, null)) + return getRpc().model + .switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, null, null, null)) .thenApply(r -> null); } @@ -1778,7 +1779,7 @@ public CompletableFuture setModel(String model, String reasoningEffort, St ? null : com.github.copilot.generated.rpc.ReasoningSummary.fromValue(reasoningSummary); return getRpc().model.switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, - generatedReasoningSummary, generatedCapabilities)).thenApply(r -> null); + generatedReasoningSummary, generatedCapabilities, null)).thenApply(r -> null); } /** diff --git a/java/src/test/java/com/github/copilot/RpcWrappersTest.java b/java/src/test/java/com/github/copilot/RpcWrappersTest.java index f19d3db01..feb78d896 100644 --- a/java/src/test/java/com/github/copilot/RpcWrappersTest.java +++ b/java/src/test/java/com/github/copilot/RpcWrappersTest.java @@ -183,7 +183,7 @@ void sessionRpc_model_switchTo_merges_sessionId_with_extra_params() { var session = new SessionRpc(stub, "sess-xyz"); // switchTo takes extra params beyond sessionId - var switchParams = new SessionModelSwitchToParams(null, "gpt-5", null, null, null); + var switchParams = new SessionModelSwitchToParams(null, "gpt-5", null, null, null, null); session.model.switchTo(switchParams); assertEquals(1, stub.calls.size()); diff --git a/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java b/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java index 8ab6f9bfe..17c2c59cf 100644 --- a/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java +++ b/java/src/test/java/com/github/copilot/SessionEventHandlingTest.java @@ -180,7 +180,7 @@ void testHandlerReceivesCorrectEventData() { SessionStartEvent startEvent = createSessionStartEvent(); startEvent.setData(new SessionStartEvent.SessionStartEventData("my-session-123", null, null, null, null, null, - null, null, null, null, null, null)); + null, null, null, null, null, null, null)); dispatchEvent(startEvent); AssistantMessageEvent msgEvent = createAssistantMessageEvent("Test content"); @@ -857,7 +857,7 @@ private SessionStartEvent createSessionStartEvent() { private SessionStartEvent createSessionStartEvent(String sessionId) { var event = new SessionStartEvent(); var data = new SessionStartEvent.SessionStartEventData(sessionId, null, null, null, null, null, null, null, - null, null, null, null); + null, null, null, null, null); event.setData(data); return event; } diff --git a/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java b/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java index d34fa76b1..ce8238dec 100644 --- a/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java +++ b/java/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java @@ -321,7 +321,7 @@ void sessionModelGetCurrentParams_record() { @Test void sessionModelSwitchToParams_record() { - var params = new SessionModelSwitchToParams("sess-32", "claude-sonnet-4.5", "high", null, null); + var params = new SessionModelSwitchToParams("sess-32", "claude-sonnet-4.5", "high", null, null, null); assertEquals("sess-32", params.sessionId()); assertEquals("claude-sonnet-4.5", params.modelId()); assertEquals("high", params.reasoningEffort()); @@ -720,7 +720,7 @@ void sessionModeSetResult_enum() { @Test void sessionModelGetCurrentResult_record() { - var result = new SessionModelGetCurrentResult("claude-sonnet-4.5", null); + var result = new SessionModelGetCurrentResult("claude-sonnet-4.5", null, null); assertEquals("claude-sonnet-4.5", result.modelId()); } @@ -957,7 +957,7 @@ void sessionModelSwitchToParams_nested_records() { var limits = new ModelCapabilitiesOverrideLimits(100000L, 8192L, 128000L, limitsVision); var supports = new ModelCapabilitiesOverrideSupports(true, true); var capabilities = new ModelCapabilitiesOverride(supports, limits); - var params = new SessionModelSwitchToParams("sess-m", "gpt-5", null, null, capabilities); + var params = new SessionModelSwitchToParams("sess-m", "gpt-5", null, null, capabilities, null); assertEquals("gpt-5", params.modelId()); assertNotNull(params.modelCapabilities()); From 369de4f9a5b034c2a36283d4d5a8489b4a732da8 Mon Sep 17 00:00:00 2001 From: Ed Burns Date: Mon, 1 Jun 2026 23:09:27 -0700 Subject: [PATCH 2/2] Update to Copilot CLI 1.0.57 --- java/.lastmerge | 2 +- java/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/.lastmerge b/java/.lastmerge index 97be84d7e..2a3e1090c 100644 --- a/java/.lastmerge +++ b/java/.lastmerge @@ -1 +1 @@ -60104052cd914949ddf8c7a31e1856cd6db0a57c +753d4729738c0e1da3fbe767712c829bad0332cd diff --git a/java/pom.xml b/java/pom.xml index e5db228ee..797b5070b 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -94,7 +94,7 @@ reference-impl-sync workflow and deal with the subsequent PR. --> - ^1.0.55-5 + ^1.0.57