Skip to content
Closed
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
84 changes: 48 additions & 36 deletions java/scripts/codegen/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion java/scripts/codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"generate:java": "tsx java.ts"
},
"dependencies": {
"@github/copilot": "^1.0.64-3",
"@github/copilot": "^1.0.64",
"json-schema": "^0.4.0",
"tsx": "^4.22.4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public record AssistantUsageQuotaSnapshot(
/** Percentage of quota remaining (0 to 100) */
@JsonProperty("remainingPercentage") Double remainingPercentage,
/** Date when the quota resets */
@JsonProperty("resetDate") OffsetDateTime resetDate
@JsonProperty("resetDate") OffsetDateTime resetDate,
/** Whether the user currently has quota available for use */
@JsonProperty("hasQuota") Boolean hasQuota,
/** Whether this snapshot uses token-based billing (AI-credits allocation) */
@JsonProperty("tokenBasedBilling") Boolean tokenBasedBilling,
/** Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value */
@JsonProperty("overageEntitlement") Double overageEntitlement
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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;

/**
Expand Down Expand Up @@ -58,6 +59,8 @@ public record ModelCallFailureEventData(
@JsonProperty("errorCode") String errorCode,
/** For HTTP 400 failures only: the `type` from the CAPI error envelope (e.g. 'websocket_error'), a coarser companion to errorCode for envelopes that carry no code. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures. */
@JsonProperty("errorType") String errorType,
/** Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure. */
@JsonProperty("quotaSnapshots") Map<String, AssistantUsageQuotaSnapshot> quotaSnapshots,
/** Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures. */
@JsonProperty("requestFingerprint") ModelCallFailureRequestFingerprint requestFingerprint
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
@JsonSubTypes.Type(value = SessionTitleChangedEvent.class, name = "session.title_changed"),
@JsonSubTypes.Type(value = SessionScheduleCreatedEvent.class, name = "session.schedule_created"),
@JsonSubTypes.Type(value = SessionScheduleCancelledEvent.class, name = "session.schedule_cancelled"),
@JsonSubTypes.Type(value = SessionScheduleRearmedEvent.class, name = "session.schedule_rearmed"),
@JsonSubTypes.Type(value = SessionAutopilotObjectiveChangedEvent.class, name = "session.autopilot_objective_changed"),
@JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"),
@JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"),
Expand Down Expand Up @@ -127,6 +128,7 @@ public abstract sealed class SessionEvent permits
SessionTitleChangedEvent,
SessionScheduleCreatedEvent,
SessionScheduleCancelledEvent,
SessionScheduleRearmedEvent,
SessionAutopilotObjectiveChangedEvent,
SessionInfoEvent,
SessionWarningEvent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public record SessionScheduleCreatedEventData(
@JsonProperty("prompt") String prompt,
/** Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) */
@JsonProperty("recurring") Boolean recurring,
/** True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed. */
@JsonProperty("selfPaced") Boolean selfPaced,
/** Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion) */
@JsonProperty("displayPrompt") String displayPrompt
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 javax.annotation.processing.Generated;

/**
* Session event "session.schedule_rearmed". Self-paced schedule re-armed for its next run
* @since 1.0.0
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@javax.annotation.processing.Generated("copilot-sdk-codegen")
public final class SessionScheduleRearmedEvent extends SessionEvent {

@Override
public String getType() { return "session.schedule_rearmed"; }

@JsonProperty("data")
private SessionScheduleRearmedEventData data;

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

/** Data payload for {@link SessionScheduleRearmedEvent}. */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public record SessionScheduleRearmedEventData(
/** Id of the self-paced schedule that was re-armed */
@JsonProperty("id") Long id,
/** Absolute time (epoch milliseconds) the model armed the next run to fire */
@JsonProperty("nextRunAt") Long nextRunAt
) {
}
}
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: 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;

/**
* Options scoped to the built-in CAPI (Copilot API) provider.
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record CapiSessionOptions(
/** Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable. */
@JsonProperty("enableWebSocketResponses") Boolean enableWebSocketResponses
) {
}
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: api.schema.json

package com.github.copilot.generated.rpc;

import javax.annotation.processing.Generated;

/**
* OAuth grant type override for this login.
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
public enum McpOauthLoginGrantType {
/** The {@code authorization_code} variant. */
AUTHORIZATION_CODE("authorization_code"),
/** The {@code client_credentials} variant. */
CLIENT_CREDENTIALS("client_credentials");

private final String value;
McpOauthLoginGrantType(String value) { this.value = value; }
@com.fasterxml.jackson.annotation.JsonValue
public String getValue() { return value; }
@com.fasterxml.jackson.annotation.JsonCreator
public static McpOauthLoginGrantType fromValue(String value) {
for (McpOauthLoginGrantType v : values()) {
if (v.value.equals(value)) return v;
}
throw new IllegalArgumentException("Unknown McpOauthLoginGrantType value: " + value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public record NamedProviderConfig(
@JsonProperty("type") ProviderConfigType type,
/** Wire API format (openai/azure only). Defaults to "completions". */
@JsonProperty("wireApi") ProviderConfigWireApi wireApi,
/** Provider transport. Defaults to "http". */
@JsonProperty("transport") ProviderConfigTransport transport,
/** API endpoint URL. */
@JsonProperty("baseUrl") String baseUrl,
/** API key. Optional for local providers like Ollama. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public record ProviderConfig(
@JsonProperty("type") ProviderConfigType type,
/** Wire API format (openai/azure only). Defaults to "completions". */
@JsonProperty("wireApi") ProviderConfigWireApi wireApi,
/** Provider transport. Defaults to "http". */
@JsonProperty("transport") ProviderConfigTransport transport,
/** API endpoint URL. */
@JsonProperty("baseUrl") String baseUrl,
/** API key. Optional for local providers like Ollama. */
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: api.schema.json

package com.github.copilot.generated.rpc;

import javax.annotation.processing.Generated;

/**
* Provider transport. Defaults to "http".
*
* @since 1.0.0
*/
@javax.annotation.processing.Generated("copilot-sdk-codegen")
public enum ProviderConfigTransport {
/** The {@code http} variant. */
HTTP("http"),
/** The {@code websockets} variant. */
WEBSOCKETS("websockets");

private final String value;
ProviderConfigTransport(String value) { this.value = value; }
@com.fasterxml.jackson.annotation.JsonValue
public String getValue() { return value; }
@com.fasterxml.jackson.annotation.JsonCreator
public static ProviderConfigTransport fromValue(String value) {
for (ProviderConfigTransport v : values()) {
if (v.value.equals(value)) return v;
}
throw new IllegalArgumentException("Unknown ProviderConfigTransport value: " + value);
}
}
Loading