Skip to content

Commit fc2b160

Browse files
edburnsCopilot
andauthored
Java SDK: Update @github/copilot dependency to ^1.0.57 (#1546)
* 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> * Update to Copilot CLI 1.0.57 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e5b73d1 commit fc2b160

44 files changed

Lines changed: 739 additions & 93 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

java/.lastmerge

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
60104052cd914949ddf8c7a31e1856cd6db0a57c
1+
753d4729738c0e1da3fbe767712c829bad0332cd

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
reference-impl-sync workflow and deal with the subsequent
9595
PR.
9696
-->
97-
<readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>^1.0.55-5</readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>
97+
<readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>^1.0.57</readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>
9898

9999
</properties>
100100

java/scripts/codegen/package-lock.json

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/scripts/codegen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"generate:java": "tsx java.ts"
88
},
99
"dependencies": {
10-
"@github/copilot": "^1.0.55-5",
10+
"@github/copilot": "^1.0.57",
1111
"json-schema": "^0.4.0",
1212
"tsx": "^4.20.6"
1313
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
*--------------------------------------------------------------------------------------------*/
4+
5+
// AUTO-GENERATED FILE - DO NOT EDIT
6+
// Generated from: session-events.schema.json
7+
8+
package com.github.copilot.generated;
9+
10+
import javax.annotation.processing.Generated;
11+
12+
/**
13+
* Allowed values for the `ContextTier` enumeration.
14+
*
15+
* @since 1.0.0
16+
*/
17+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
18+
public enum ContextTier {
19+
/** The {@code default} variant. */
20+
DEFAULT("default"),
21+
/** The {@code long_context} variant. */
22+
LONG_CONTEXT("long_context");
23+
24+
private final String value;
25+
ContextTier(String value) { this.value = value; }
26+
@com.fasterxml.jackson.annotation.JsonValue
27+
public String getValue() { return value; }
28+
@com.fasterxml.jackson.annotation.JsonCreator
29+
public static ContextTier fromValue(String value) {
30+
for (ContextTier v : values()) {
31+
if (v.value.equals(value)) return v;
32+
}
33+
throw new IllegalArgumentException("Unknown ContextTier value: " + value);
34+
}
35+
}

java/src/generated/java/com/github/copilot/generated/SessionEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
@JsonSubTypes.Type(value = SessionExtensionsLoadedEvent.class, name = "session.extensions_loaded"),
112112
@JsonSubTypes.Type(value = SessionCanvasOpenedEvent.class, name = "session.canvas.opened"),
113113
@JsonSubTypes.Type(value = SessionCanvasRegistryChangedEvent.class, name = "session.canvas.registry_changed"),
114+
@JsonSubTypes.Type(value = SessionExtensionsAttachmentsPushedEvent.class, name = "session.extensions.attachments_pushed"),
114115
@JsonSubTypes.Type(value = McpAppToolCallCompleteEvent.class, name = "mcp_app.tool_call_complete")
115116
})
116117
@javax.annotation.processing.Generated("copilot-sdk-codegen")
@@ -201,6 +202,7 @@ public abstract sealed class SessionEvent permits
201202
SessionExtensionsLoadedEvent,
202203
SessionCanvasOpenedEvent,
203204
SessionCanvasRegistryChangedEvent,
205+
SessionExtensionsAttachmentsPushedEvent,
204206
McpAppToolCallCompleteEvent,
205207
UnknownSessionEvent {
206208

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
*--------------------------------------------------------------------------------------------*/
4+
5+
// AUTO-GENERATED FILE - DO NOT EDIT
6+
// Generated from: session-events.schema.json
7+
8+
package com.github.copilot.generated;
9+
10+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
11+
import com.fasterxml.jackson.annotation.JsonInclude;
12+
import com.fasterxml.jackson.annotation.JsonProperty;
13+
import java.util.List;
14+
import javax.annotation.processing.Generated;
15+
16+
/**
17+
* Session event "session.extensions.attachments_pushed".
18+
*
19+
* @since 1.0.0
20+
*/
21+
@JsonIgnoreProperties(ignoreUnknown = true)
22+
@JsonInclude(JsonInclude.Include.NON_NULL)
23+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
24+
public final class SessionExtensionsAttachmentsPushedEvent extends SessionEvent {
25+
26+
@Override
27+
public String getType() { return "session.extensions.attachments_pushed"; }
28+
29+
@JsonProperty("data")
30+
private SessionExtensionsAttachmentsPushedEventData data;
31+
32+
public SessionExtensionsAttachmentsPushedEventData getData() { return data; }
33+
public void setData(SessionExtensionsAttachmentsPushedEventData data) { this.data = data; }
34+
35+
/** Data payload for {@link SessionExtensionsAttachmentsPushedEvent}. */
36+
@JsonIgnoreProperties(ignoreUnknown = true)
37+
@JsonInclude(JsonInclude.Include.NON_NULL)
38+
public record SessionExtensionsAttachmentsPushedEventData(
39+
/** Attachments contributed by an extension; the host should surface these as composer pills and forward them via the next session.send call. */
40+
@JsonProperty("attachments") List<Object> attachments
41+
) {
42+
}
43+
}

java/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,9 @@ public record SessionModelChangeEventData(
4848
/** Reasoning summary mode after the model change, if applicable */
4949
@JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary,
5050
/** Context tier after the model change; null explicitly clears a previously selected tier */
51-
@JsonProperty("contextTier") SessionModelChangeEventDataContextTier contextTier,
51+
@JsonProperty("contextTier") ContextTier contextTier,
5252
/** 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. */
5353
@JsonProperty("cause") String cause
5454
) {
55-
56-
public enum SessionModelChangeEventDataContextTier {
57-
/** The {@code default} variant. */
58-
DEFAULT("default"),
59-
/** The {@code long_context} variant. */
60-
LONG_CONTEXT("long_context");
61-
62-
private final String value;
63-
SessionModelChangeEventDataContextTier(String value) { this.value = value; }
64-
@com.fasterxml.jackson.annotation.JsonValue
65-
public String getValue() { return value; }
66-
@com.fasterxml.jackson.annotation.JsonCreator
67-
public static SessionModelChangeEventDataContextTier fromValue(String value) {
68-
for (SessionModelChangeEventDataContextTier v : values()) {
69-
if (v.value.equals(value)) return v;
70-
}
71-
throw new IllegalArgumentException("Unknown SessionModelChangeEventDataContextTier value: " + value);
72-
}
73-
}
7455
}
7556
}

java/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public record SessionResumeEventData(
4646
@JsonProperty("reasoningEffort") String reasoningEffort,
4747
/** Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed") */
4848
@JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary,
49+
/** Context tier currently selected at resume time; null when no tier is active */
50+
@JsonProperty("contextTier") ContextTier contextTier,
4951
/** Updated working directory and git context at resume time */
5052
@JsonProperty("context") WorkingDirectoryContext context,
5153
/** Whether the session was already in use by another client at resume time */

java/src/generated/java/com/github/copilot/generated/SessionStartEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public record SessionStartEventData(
5252
@JsonProperty("reasoningEffort") String reasoningEffort,
5353
/** Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed") */
5454
@JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary,
55+
/** Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model) */
56+
@JsonProperty("contextTier") ContextTier contextTier,
5557
/** Working directory and git context at session start */
5658
@JsonProperty("context") WorkingDirectoryContext context,
5759
/** Whether the session was already in use by another client at start time */

0 commit comments

Comments
 (0)