Skip to content

Commit eb50a5d

Browse files
rojiCopilot
andcommitted
Restore Java generated MCP OAuth types
The java-codegen-check auto-commit dropped generated event/RPC types that the MCP OAuth SDK code still references. Restore them and keep the static client secret event field so the Java SDK compiles and the MCP OAuth E2Es pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f68b908 commit eb50a5d

26 files changed

Lines changed: 519 additions & 6 deletions
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 javax.annotation.processing.Generated;
14+
15+
/**
16+
* Session event "assistant.idle". Payload emitted whenever the main agent's processing loop goes idle, including while related background work (running agents or in-flight attached shell commands) is still pending and the session-level idle event is therefore deferred
17+
* @since 1.0.0
18+
*/
19+
@JsonIgnoreProperties(ignoreUnknown = true)
20+
@JsonInclude(JsonInclude.Include.NON_NULL)
21+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
22+
public final class AssistantIdleEvent extends SessionEvent {
23+
24+
@Override
25+
public String getType() { return "assistant.idle"; }
26+
27+
@JsonProperty("data")
28+
private AssistantIdleEventData data;
29+
30+
public AssistantIdleEventData getData() { return data; }
31+
public void setData(AssistantIdleEventData data) { this.data = data; }
32+
33+
/** Data payload for {@link AssistantIdleEvent}. */
34+
@JsonIgnoreProperties(ignoreUnknown = true)
35+
@JsonInclude(JsonInclude.Include.NON_NULL)
36+
public record AssistantIdleEventData(
37+
/** True when the preceding agentic loop was cancelled via abort signal */
38+
@JsonProperty("aborted") Boolean aborted
39+
) {
40+
}
41+
}
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 javax.annotation.processing.Generated;
14+
15+
/**
16+
* Session event "mcp.headers_refresh_completed". MCP headers refresh request completion notification
17+
* @since 1.0.0
18+
*/
19+
@JsonIgnoreProperties(ignoreUnknown = true)
20+
@JsonInclude(JsonInclude.Include.NON_NULL)
21+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
22+
public final class McpHeadersRefreshCompletedEvent extends SessionEvent {
23+
24+
@Override
25+
public String getType() { return "mcp.headers_refresh_completed"; }
26+
27+
@JsonProperty("data")
28+
private McpHeadersRefreshCompletedEventData data;
29+
30+
public McpHeadersRefreshCompletedEventData getData() { return data; }
31+
public void setData(McpHeadersRefreshCompletedEventData data) { this.data = data; }
32+
33+
/** Data payload for {@link McpHeadersRefreshCompletedEvent}. */
34+
@JsonIgnoreProperties(ignoreUnknown = true)
35+
@JsonInclude(JsonInclude.Include.NON_NULL)
36+
public record McpHeadersRefreshCompletedEventData(
37+
/** Request ID of the resolved headers refresh request */
38+
@JsonProperty("requestId") String requestId,
39+
/** How the pending MCP headers refresh request resolved. */
40+
@JsonProperty("outcome") McpHeadersRefreshCompletedOutcome outcome
41+
) {
42+
}
43+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
* How the pending MCP headers refresh request resolved.
14+
*
15+
* @since 1.0.0
16+
*/
17+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
18+
public enum McpHeadersRefreshCompletedOutcome {
19+
/** The {@code headers} variant. */
20+
HEADERS("headers"),
21+
/** The {@code none} variant. */
22+
NONE("none"),
23+
/** The {@code timeout} variant. */
24+
TIMEOUT("timeout");
25+
26+
private final String value;
27+
McpHeadersRefreshCompletedOutcome(String value) { this.value = value; }
28+
@com.fasterxml.jackson.annotation.JsonValue
29+
public String getValue() { return value; }
30+
@com.fasterxml.jackson.annotation.JsonCreator
31+
public static McpHeadersRefreshCompletedOutcome fromValue(String value) {
32+
for (McpHeadersRefreshCompletedOutcome v : values()) {
33+
if (v.value.equals(value)) return v;
34+
}
35+
throw new IllegalArgumentException("Unknown McpHeadersRefreshCompletedOutcome value: " + value);
36+
}
37+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 javax.annotation.processing.Generated;
14+
15+
/**
16+
* Session event "mcp.headers_refresh_required". Dynamic headers refresh request for a remote MCP server
17+
* @since 1.0.0
18+
*/
19+
@JsonIgnoreProperties(ignoreUnknown = true)
20+
@JsonInclude(JsonInclude.Include.NON_NULL)
21+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
22+
public final class McpHeadersRefreshRequiredEvent extends SessionEvent {
23+
24+
@Override
25+
public String getType() { return "mcp.headers_refresh_required"; }
26+
27+
@JsonProperty("data")
28+
private McpHeadersRefreshRequiredEventData data;
29+
30+
public McpHeadersRefreshRequiredEventData getData() { return data; }
31+
public void setData(McpHeadersRefreshRequiredEventData data) { this.data = data; }
32+
33+
/** Data payload for {@link McpHeadersRefreshRequiredEvent}. */
34+
@JsonIgnoreProperties(ignoreUnknown = true)
35+
@JsonInclude(JsonInclude.Include.NON_NULL)
36+
public record McpHeadersRefreshRequiredEventData(
37+
/** Unique identifier for this headers refresh request; used to respond via session.mcp.headers.handlePendingHeadersRefreshRequest() */
38+
@JsonProperty("requestId") String requestId,
39+
/** Display name of the remote MCP server requesting headers */
40+
@JsonProperty("serverName") String serverName,
41+
/** URL of the remote MCP server requesting headers */
42+
@JsonProperty("serverUrl") String serverUrl,
43+
/** Why dynamic headers are being requested. */
44+
@JsonProperty("reason") McpHeadersRefreshRequiredReason reason
45+
) {
46+
}
47+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
* Why dynamic headers are being requested.
14+
*
15+
* @since 1.0.0
16+
*/
17+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
18+
public enum McpHeadersRefreshRequiredReason {
19+
/** The {@code startup} variant. */
20+
STARTUP("startup"),
21+
/** The {@code ttl-expired} variant. */
22+
TTL_EXPIRED("ttl-expired"),
23+
/** The {@code auth-failed} variant. */
24+
AUTH_FAILED("auth-failed");
25+
26+
private final String value;
27+
McpHeadersRefreshRequiredReason(String value) { this.value = value; }
28+
@com.fasterxml.jackson.annotation.JsonValue
29+
public String getValue() { return value; }
30+
@com.fasterxml.jackson.annotation.JsonCreator
31+
public static McpHeadersRefreshRequiredReason fromValue(String value) {
32+
for (McpHeadersRefreshRequiredReason v : values()) {
33+
if (v.value.equals(value)) return v;
34+
}
35+
throw new IllegalArgumentException("Unknown McpHeadersRefreshRequiredReason value: " + value);
36+
}
37+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
* Reason the runtime is requesting host-provided MCP OAuth credentials
14+
*
15+
* @since 1.0.0
16+
*/
17+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
18+
public enum McpOauthRequestReason {
19+
/** The {@code initial} variant. */
20+
INITIAL("initial"),
21+
/** The {@code refresh} variant. */
22+
REFRESH("refresh"),
23+
/** The {@code reauth} variant. */
24+
REAUTH("reauth"),
25+
/** The {@code upscope} variant. */
26+
UPSCOPE("upscope");
27+
28+
private final String value;
29+
McpOauthRequestReason(String value) { this.value = value; }
30+
@com.fasterxml.jackson.annotation.JsonValue
31+
public String getValue() { return value; }
32+
@com.fasterxml.jackson.annotation.JsonCreator
33+
public static McpOauthRequestReason fromValue(String value) {
34+
for (McpOauthRequestReason v : values()) {
35+
if (v.value.equals(value)) return v;
36+
}
37+
throw new IllegalArgumentException("Unknown McpOauthRequestReason value: " + value);
38+
}
39+
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public record McpOauthRequiredEventData(
4545
/** OAuth WWW-Authenticate parameters parsed from the auth challenge, if available */
4646
@JsonProperty("wwwAuthenticateParams") McpOauthWWWAuthenticateParams wwwAuthenticateParams,
4747
/** Raw OAuth protected-resource metadata document fetched for the MCP server, if available */
48-
@JsonProperty("resourceMetadata") String resourceMetadata
48+
@JsonProperty("resourceMetadata") String resourceMetadata,
49+
/** Why the runtime is requesting host-provided OAuth credentials. */
50+
@JsonProperty("reason") McpOauthRequestReason reason
4951
) {
5052
}
5153
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
public record McpOauthRequiredStaticClientConfig(
2424
/** OAuth client ID for the server */
2525
@JsonProperty("clientId") String clientId,
26+
/** Optional OAuth client secret for confidential static clients, when the runtime can resolve one */
27+
@JsonProperty("clientSecret") String clientSecret,
2628
/** Whether this is a public OAuth client */
2729
@JsonProperty("publicClient") Boolean publicClient,
2830
/** Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@JsonInclude(JsonInclude.Include.NON_NULL)
2222
@JsonIgnoreProperties(ignoreUnknown = true)
2323
public record McpOauthWWWAuthenticateParams(
24-
/** Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter */
24+
/** Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter, if present */
2525
@JsonProperty("resourceMetadataUrl") String resourceMetadataUrl,
2626
/** Requested OAuth scopes from the WWW-Authenticate scope parameter, if present */
2727
@JsonProperty("scope") String scope,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 javax.annotation.processing.Generated;
14+
15+
/**
16+
* Optional experimental response budget limits.
17+
*
18+
* @since 1.0.0
19+
*/
20+
@javax.annotation.processing.Generated("copilot-sdk-codegen")
21+
@JsonInclude(JsonInclude.Include.NON_NULL)
22+
@JsonIgnoreProperties(ignoreUnknown = true)
23+
public record ResponseBudgetConfig(
24+
/** Maximum model-call iterations allowed while responding to one top-level user message. */
25+
@JsonProperty("maxModelIterations") Long maxModelIterations,
26+
/** Maximum AI Credits allowed while responding to one top-level user message. */
27+
@JsonProperty("maxAiCredits") Double maxAiCredits
28+
) {
29+
}

0 commit comments

Comments
 (0)