Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 148 additions & 170 deletions java/scripts/codegen/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions java/scripts/codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"generate:java": "tsx java.ts"
},
"dependencies": {
"@github/copilot": "^1.0.52-1",
"@github/copilot": "^1.0.54",
"json-schema": "^0.4.0",
"tsx": "^4.20.6"
"tsx": "^4.22.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public record AssistantMessageEventData(
@JsonProperty("interactionId") String interactionId,
/** GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs */
@JsonProperty("requestId") String requestId,
/** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */
@JsonProperty("serviceRequestId") String serviceRequestId,
/** Raw Anthropic content array with advisor blocks (server_tool_use, advisor_tool_result) for verbatim round-tripping */
@JsonProperty("anthropicAdvisorBlocks") List<Object> anthropicAdvisorBlocks,
/** Anthropic advisor model ID used for this response, for timeline display on replay */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public record AssistantUsageEventData(
@JsonProperty("apiCallId") String apiCallId,
/** GitHub request tracing ID (x-github-request-id header) for server-side log correlation */
@JsonProperty("providerCallId") String providerCallId,
/** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */
@JsonProperty("serviceRequestId") String serviceRequestId,
/** API endpoint used for this model call, matching CAPI supported_endpoints vocabulary */
@JsonProperty("apiEndpoint") AssistantUsageApiEndpoint apiEndpoint,
/** Parent tool call ID when this usage originates from a sub-agent */
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/**
* Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding.
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
public enum CanvasOpenedAvailability {
/** The {@code ready} variant. */
READY("ready"),
/** The {@code stale} variant. */
STALE("stale");

private final String value;
CanvasOpenedAvailability(String value) { this.value = value; }
@com.fasterxml.jackson.annotation.JsonValue
public String getValue() { return value; }
@com.fasterxml.jackson.annotation.JsonCreator
public static CanvasOpenedAvailability fromValue(String value) {
for (CanvasOpenedAvailability v : values()) {
if (v.value.equals(value)) return v;
}
throw new IllegalArgumentException("Unknown CanvasOpenedAvailability value: " + value);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*---------------------------------------------------------------------------------------------
* 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 java.util.Map;
import javax.annotation.processing.Generated;

/**
* Schema for the `CanvasRegistryChangedCanvas` type.
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record CanvasRegistryChangedCanvas(
/** Owning provider identifier */
@JsonProperty("extensionId") String extensionId,
/** Owning extension display name, when available */
@JsonProperty("extensionName") String extensionName,
/** Provider-local canvas identifier */
@JsonProperty("canvasId") String canvasId,
/** Human-readable canvas name */
@JsonProperty("displayName") String displayName,
/** Short, single-sentence description shown to the agent in canvas catalogs. */
@JsonProperty("description") String description,
/** JSON Schema for canvas open input */
@JsonProperty("inputSchema") Map<String, Object> inputSchema,
/** Actions the agent or host may invoke */
@JsonProperty("actions") List<CanvasRegistryChangedCanvasAction> actions
) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*---------------------------------------------------------------------------------------------
* 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.Map;
import javax.annotation.processing.Generated;

/**
* Schema for the `CanvasRegistryChangedCanvasAction` type.
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record CanvasRegistryChangedCanvasAction(
/** Action name */
@JsonProperty("name") String name,
/** Action description */
@JsonProperty("description") String description,
/** JSON Schema for action input */
@JsonProperty("inputSchema") Map<String, Object> inputSchema
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public record CapabilitiesChangedUI(
/** Whether elicitation is now supported */
@JsonProperty("elicitation") Boolean elicitation
@JsonProperty("elicitation") Boolean elicitation,
/** Whether MCP Apps (SEP-1865) UI passthrough is now supported */
@JsonProperty("mcpApps") Boolean mcpApps,
/** Whether canvas rendering is now supported */
@JsonProperty("canvases") Boolean canvases
) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/

// AUTO-GENERATED FILE - DO NOT EDIT
// Generated from: session-events.schema.json

package com.github.copilot.generated;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.processing.Generated;

/**
* Set when the underlying tools/call threw an error before returning a CallToolResult
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record McpAppToolCallCompleteError(
/** Human-readable error message */
@JsonProperty("message") String message
) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------------------------
* 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.Map;
import javax.annotation.processing.Generated;

/**
* Session event "mcp_app.tool_call_complete". MCP App view called a tool on a connected MCP server (SEP-1865)
*
* @since 1.0.0
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@javax.annotation.processing.Generated("copilot-sdk-codegen")
public final class McpAppToolCallCompleteEvent extends SessionEvent {

@Override
public String getType() { return "mcp_app.tool_call_complete"; }

@JsonProperty("data")
private McpAppToolCallCompleteEventData data;

public McpAppToolCallCompleteEventData getData() { return data; }
public void setData(McpAppToolCallCompleteEventData data) { this.data = data; }

/** Data payload for {@link McpAppToolCallCompleteEvent}. */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public record McpAppToolCallCompleteEventData(
/** Name of the MCP server hosting the tool */
@JsonProperty("serverName") String serverName,
/** MCP tool name that was invoked */
@JsonProperty("toolName") String toolName,
/** Arguments passed to the tool by the app view, if any */
@JsonProperty("arguments") Map<String, Object> arguments,
/** True when the call completed without throwing AND the MCP CallToolResult did not set isError */
@JsonProperty("success") Boolean success,
/** Wall-clock duration of the underlying tools/call in milliseconds */
@JsonProperty("durationMs") Double durationMs,
/** Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. */
@JsonProperty("result") Map<String, Object> result,
/** Set when the underlying tools/call threw an error before returning a CallToolResult */
@JsonProperty("error") McpAppToolCallCompleteError error,
/** The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. */
@JsonProperty("toolMeta") McpAppToolCallCompleteToolMeta toolMeta
) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/

// AUTO-GENERATED FILE - DO NOT EDIT
// Generated from: session-events.schema.json

package com.github.copilot.generated;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.processing.Generated;

/**
* The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record McpAppToolCallCompleteToolMeta(
/** Schema for the `McpAppToolCallCompleteToolMetaUI` type. */
@JsonProperty("ui") McpAppToolCallCompleteToolMetaUI ui
) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/

// AUTO-GENERATED FILE - DO NOT EDIT
// Generated from: session-events.schema.json

package com.github.copilot.generated;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import javax.annotation.processing.Generated;

/**
* Schema for the `McpAppToolCallCompleteToolMetaUI` type.
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record McpAppToolCallCompleteToolMetaUI(
/** `ui://` URI declared by the tool's `_meta.ui.resourceUri` */
@JsonProperty("resourceUri") String resourceUri,
/** Tool visibility per SEP-1865 (typically a subset of `["model","app"]`) */
@JsonProperty("visibility") List<String> visibility
) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------------------------
* 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;

/**
* Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
public enum McpServerTransport {
/** The {@code stdio} variant. */
STDIO("stdio"),
/** The {@code http} variant. */
HTTP("http"),
/** The {@code sse} variant. */
SSE("sse"),
/** The {@code memory} variant. */
MEMORY("memory");

private final String value;
McpServerTransport(String value) { this.value = value; }
@com.fasterxml.jackson.annotation.JsonValue
public String getValue() { return value; }
@com.fasterxml.jackson.annotation.JsonCreator
public static McpServerTransport fromValue(String value) {
for (McpServerTransport v : values()) {
if (v.value.equals(value)) return v;
}
throw new IllegalArgumentException("Unknown McpServerTransport value: " + value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public record McpServersLoadedServer(
/** Configuration source: user, workspace, plugin, or builtin */
@JsonProperty("source") McpServerSource source,
/** Error message if the server failed to connect */
@JsonProperty("error") String error
@JsonProperty("error") String error,
/** Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) */
@JsonProperty("transport") McpServerTransport transport,
/** Name of the plugin that supplied the effective MCP server config, only when source is plugin */
@JsonProperty("pluginName") String pluginName,
/** Version of the plugin that supplied the effective MCP server config, only when source is plugin */
@JsonProperty("pluginVersion") String pluginVersion
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public record ModelCallFailureEventData(
@JsonProperty("apiCallId") String apiCallId,
/** GitHub request tracing ID (x-github-request-id header) for server-side log correlation */
@JsonProperty("providerCallId") String providerCallId,
/** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */
@JsonProperty("serviceRequestId") String serviceRequestId,
/** HTTP status code from the failed request */
@JsonProperty("statusCode") Long statusCode,
/** Duration of the failed API call in milliseconds */
Expand Down
Loading