diff --git a/.gitattributes b/.gitattributes index c1965c216..adb3de78e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ -.github/workflows/*.lock.yml linguist-generated=true merge=ours \ No newline at end of file +.github/workflows/*.lock.yml linguist-generated=true merge=ours +src/generated/java/** eol=lf linguist-generated=true diff --git a/.github/workflows/codegen-check.yml b/.github/workflows/codegen-check.yml new file mode 100644 index 000000000..675629c1e --- /dev/null +++ b/.github/workflows/codegen-check.yml @@ -0,0 +1,44 @@ +name: "Codegen Check" + +on: + push: + branches: + - main + pull_request: + paths: + - 'scripts/codegen/**' + - 'src/generated/java/**' + - '.github/workflows/codegen-check.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + check: + name: "Verify generated files are up-to-date" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version: 22 + + - name: Install codegen dependencies + working-directory: ./scripts/codegen + run: npm ci + + - name: Run codegen + working-directory: ./scripts/codegen + run: npm run generate + + - name: Check for uncommitted changes + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "::error::Generated files are out of date. Run 'cd scripts/codegen && npm run generate' and commit the changes." + git diff --stat + git diff + exit 1 + fi + echo "✅ Generated files are up-to-date" diff --git a/.github/workflows/update-copilot-dependency.yml b/.github/workflows/update-copilot-dependency.yml new file mode 100644 index 000000000..42edd01be --- /dev/null +++ b/.github/workflows/update-copilot-dependency.yml @@ -0,0 +1,97 @@ +name: "Update @github/copilot Dependency" + +on: + workflow_dispatch: + inputs: + version: + description: 'Target version of @github/copilot (e.g. 1.0.24)' + required: true + type: string + +permissions: + contents: write + pull-requests: write + +jobs: + update: + name: "Update @github/copilot to ${{ inputs.version }}" + runs-on: ubuntu-latest + steps: + - name: Validate version input + env: + VERSION: ${{ inputs.version }} + run: | + if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9._-]+)?$ ]]; then + echo "::error::Invalid version format '$VERSION'. Expected semver (e.g. 1.0.24)." + exit 1 + fi + + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version: 22 + + - name: Update @github/copilot in scripts/codegen + env: + VERSION: ${{ inputs.version }} + working-directory: ./scripts/codegen + # npm install updates package.json and package-lock.json to the new + # version; npm ci (below) then does a clean, reproducible install from + # the updated lock file. Both steps are required: npm install alone + # leaves leftover packages, while npm ci alone cannot change the pinned + # version in the lock file. + run: npm install "@github/copilot@$VERSION" + + - name: Install codegen dependencies + working-directory: ./scripts/codegen + run: npm ci + + - name: Run codegen + working-directory: ./scripts/codegen + run: npm run generate + + - name: Create pull request + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ inputs.version }} + run: | + BRANCH="update-copilot-$VERSION" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + if git rev-parse --verify "origin/$BRANCH" >/dev/null 2>&1; then + git checkout "$BRANCH" + git reset --hard HEAD + else + git checkout -b "$BRANCH" + fi + + git add -A + + if git diff --cached --quiet; then + echo "No changes detected; skipping commit and PR creation." + exit 0 + fi + + git commit -m "Update @github/copilot to $VERSION + + - Updated @github/copilot in scripts/codegen + - Re-ran Java code generator" + git push origin "$BRANCH" --force-with-lease + + if gh pr view "$BRANCH" >/dev/null 2>&1; then + echo "Pull request for branch '$BRANCH' already exists; updated branch only." + else + gh pr create \ + --title "Update @github/copilot to $VERSION" \ + --body "Automated update of \`@github/copilot\` to version \`$VERSION\`. + + ### Changes + - Updated \`@github/copilot\` in \`scripts/codegen/package.json\` + - Re-ran Java code generator (\`scripts/codegen\`) + + > Created by the **Update @github/copilot Dependency** workflow." \ + --base main \ + --head "$BRANCH" + fi diff --git a/.gitignore b/.gitignore index ddb2508ba..85e604a7f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ changebundle.txt* .classpath .project .settings +scripts/codegen/node_modules/ diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 33c9ac5f2..9a6f3761b 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -11,9 +11,9 @@ - + - + diff --git a/docs/WORKFLOWS.md b/docs/WORKFLOWS.md index 74afbd337..4725ff8f2 100644 --- a/docs/WORKFLOWS.md +++ b/docs/WORKFLOWS.md @@ -5,6 +5,8 @@ | Workflow | Description | Triggers | Schedule | |----------|-------------|----------|----------| | [Build & Test](workflows/build-test.yml) | Builds, lints, and tests the Java SDK | `push` (main), `pull_request`, `merge_group`, `workflow_dispatch` | Sundays at 00:00 UTC | +| [Codegen Check](workflows/codegen-check.yml) | Verifies that generated Java files are up-to-date with the JSON schemas | `push` (main), `pull_request`, `workflow_dispatch` | — | +| [Update @github/copilot Dependency](workflows/update-copilot-dependency.yml) | Updates the `@github/copilot` npm package, re-runs code generation, and opens a PR | `workflow_dispatch` | — | | [Deploy Documentation](workflows/deploy-site.yml) | Generates and deploys versioned docs to GitHub Pages | `workflow_run` (after Build & Test), `release`, `workflow_dispatch` | — | | [Publish to Maven Central](workflows/publish-maven.yml) | Releases the SDK to Maven Central and creates a GitHub Release | `workflow_dispatch` | — | | [Weekly Upstream Sync](workflows/weekly-upstream-sync.yml) | Checks for new upstream commits and creates an issue for Copilot to merge | `workflow_dispatch` | Mondays at 10:00 UTC | @@ -87,6 +89,42 @@ Auto-generated compiled workflow produced by `gh aw compile` from the correspond --- +## Codegen Check + +**File:** [`codegen-check.yml`](workflows/codegen-check.yml) + +Verifies that the generated Java source files in `src/generated/java/` are up-to-date with the JSON schemas distributed in the `@github/copilot` npm package. + +Steps: +1. Installs the codegen dependencies from `scripts/codegen/` +2. Runs the Java code generator (`npm run generate`) +3. Fails with a diff if any generated file differs from what is committed + +Run this locally with: +```bash +cd scripts/codegen && npm ci && npm run generate +``` + +If changes appear, commit the updated generated files. + +--- + +## Update @github/copilot Dependency + +**File:** [`update-copilot-dependency.yml`](workflows/update-copilot-dependency.yml) + +Manual workflow triggered when a new version of the `@github/copilot` npm package is published. Accepts a `version` input (e.g. `1.0.25`). + +Steps: +1. Updates `@github/copilot` in `scripts/codegen/package.json` +2. Re-runs the Java code generator +3. Commits the updated `package.json`, `package-lock.json`, and all regenerated Java files +4. Opens (or updates) a pull request for review + +The resulting PR will be automatically validated by the **Codegen Check** workflow. + +--- + ## Copilot Setup Steps **File:** [`copilot-setup-steps.yml`](workflows/copilot-setup-steps.yml) diff --git a/pom.xml b/pom.xml index b61c36166..95ed2602d 100644 --- a/pom.xml +++ b/pom.xml @@ -255,12 +255,35 @@ + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.1 + + + add-generated-source + generate-sources + + add-source + + + + ${project.basedir}/src/generated/java + + + + + com.diffplug.spotless spotless-maven-plugin 2.44.5 + + src/generated/java/**/*.java + 4.33 diff --git a/scripts/codegen/.gitignore b/scripts/codegen/.gitignore new file mode 100644 index 000000000..c2658d7d1 --- /dev/null +++ b/scripts/codegen/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/scripts/codegen/java.ts b/scripts/codegen/java.ts new file mode 100644 index 000000000..33fae8aad --- /dev/null +++ b/scripts/codegen/java.ts @@ -0,0 +1,797 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +/** + * Java code generator for session-events and RPC types. + * Generates Java source files under src/generated/java/ from JSON Schema files. + */ + +import fs from "fs/promises"; +import path from "path"; +import { fileURLToPath } from "url"; +import type { JSONSchema7 } from "json-schema"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +/** Root of the copilot-sdk-java repo */ +const REPO_ROOT = path.resolve(__dirname, "../.."); + +/** Event types to exclude from generation (internal/legacy types) */ +const EXCLUDED_EVENT_TYPES = new Set(["session.import_legacy"]); + +const AUTO_GENERATED_HEADER = `// AUTO-GENERATED FILE - DO NOT EDIT`; +const GENERATED_FROM_SESSION_EVENTS = `// Generated from: session-events.schema.json`; +const GENERATED_FROM_API = `// Generated from: api.schema.json`; +const GENERATED_ANNOTATION = `@javax.annotation.processing.Generated("copilot-sdk-codegen")`; +const COPYRIGHT = `/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------------------------------------------*/`; + +// ── Naming utilities ───────────────────────────────────────────────────────── + +function toPascalCase(name: string): string { + return name.split(/[-_.]/).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(""); +} + +function toJavaClassName(typeName: string): string { + return typeName.split(/[._]/).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(""); +} + +function toCamelCase(name: string): string { + const pascal = toPascalCase(name); + return pascal.charAt(0).toLowerCase() + pascal.slice(1); +} + +function toEnumConstant(value: string): string { + return value.toUpperCase().replace(/[-. ]/g, "_"); +} + +// ── Schema path resolution ─────────────────────────────────────────────────── + +async function getSessionEventsSchemaPath(): Promise { + const candidates = [ + path.join(REPO_ROOT, "scripts/codegen/node_modules/@github/copilot/schemas/session-events.schema.json"), + path.join(REPO_ROOT, "nodejs/node_modules/@github/copilot/schemas/session-events.schema.json"), + ]; + for (const p of candidates) { + try { + await fs.access(p); + return p; + } catch { + // try next + } + } + throw new Error("session-events.schema.json not found. Run 'npm ci' in scripts/codegen first."); +} + +async function getApiSchemaPath(): Promise { + const candidates = [ + path.join(REPO_ROOT, "scripts/codegen/node_modules/@github/copilot/schemas/api.schema.json"), + path.join(REPO_ROOT, "nodejs/node_modules/@github/copilot/schemas/api.schema.json"), + ]; + for (const p of candidates) { + try { + await fs.access(p); + return p; + } catch { + // try next + } + } + throw new Error("api.schema.json not found. Run 'npm ci' in scripts/codegen first."); +} + +// ── File writing ───────────────────────────────────────────────────────────── + +async function writeGeneratedFile(relativePath: string, content: string): Promise { + const fullPath = path.join(REPO_ROOT, relativePath); + await fs.mkdir(path.dirname(fullPath), { recursive: true }); + await fs.writeFile(fullPath, content, "utf-8"); + console.log(` ✓ ${relativePath}`); + return fullPath; +} + +// ── Java type mapping ───────────────────────────────────────────────────────── + +interface JavaTypeResult { + javaType: string; + imports: Set; +} + +function schemaTypeToJava( + schema: JSONSchema7, + required: boolean, + context: string, + propName: string, + nestedTypes: Map +): JavaTypeResult { + const imports = new Set(); + + if (schema.anyOf) { + const hasNull = schema.anyOf.some((s) => typeof s === "object" && (s as JSONSchema7).type === "null"); + const nonNull = schema.anyOf.filter((s) => typeof s === "object" && (s as JSONSchema7).type !== "null"); + if (nonNull.length === 1) { + const result = schemaTypeToJava(nonNull[0] as JSONSchema7, required && !hasNull, context, propName, nestedTypes); + return result; + } + // When exactly two non-null types and one of them is string, prefer String + // over Object to avoid unnecessary type erasure on common wire-level unions + // (e.g., string | null, string | boolean). For wider unions keep Object. + if (nonNull.length === 2) { + const hasString = nonNull.some((s) => typeof s === "object" && (s as JSONSchema7).type === "string"); + if (hasString) { + return { javaType: "String", imports }; + } + } + console.warn(`[codegen] ${context}.${propName}: anyOf with ${nonNull.length} non-null branches — falling back to Object`); + return { javaType: "Object", imports }; + } + + if (schema.type === "string") { + if (schema.format === "uuid") { + imports.add("java.util.UUID"); + return { javaType: "UUID", imports }; + } + if (schema.format === "date-time") { + imports.add("java.time.OffsetDateTime"); + return { javaType: "OffsetDateTime", imports }; + } + if (schema.enum && Array.isArray(schema.enum)) { + const enumName = `${context}${toPascalCase(propName)}`; + nestedTypes.set(enumName, { + kind: "enum", + name: enumName, + values: schema.enum as string[], + description: schema.description, + }); + return { javaType: enumName, imports }; + } + return { javaType: "String", imports }; + } + + if (Array.isArray(schema.type)) { + const nonNullTypes = schema.type.filter((t) => t !== "null"); + if (nonNullTypes.length === 1) { + const baseSchema = { ...schema, type: nonNullTypes[0] }; + return schemaTypeToJava(baseSchema as JSONSchema7, required, context, propName, nestedTypes); + } + } + + if (schema.type === "integer") { + // JSON Schema "integer" maps to Long (boxed — always used for records). + // Use primitive long for required fields in mutable-bean contexts if needed. + return { javaType: required ? "long" : "Long", imports }; + } + + if (schema.type === "number") { + return { javaType: required ? "double" : "Double", imports }; + } + + if (schema.type === "boolean") { + return { javaType: required ? "boolean" : "Boolean", imports }; + } + + if (schema.type === "array") { + const items = schema.items as JSONSchema7 | undefined; + if (items) { + const itemResult = schemaTypeToJava(items, true, context, propName + "Item", nestedTypes); + imports.add("java.util.List"); + for (const imp of itemResult.imports) imports.add(imp); + return { javaType: `List<${itemResult.javaType}>`, imports }; + } + imports.add("java.util.List"); + return { javaType: "List", imports }; + } + + if (schema.type === "object") { + if (schema.properties && Object.keys(schema.properties).length > 0) { + const nestedName = `${context}${toPascalCase(propName)}`; + if (!nestedTypes.has(nestedName)) { + nestedTypes.set(nestedName, { + kind: "class", + name: nestedName, + schema, + description: schema.description, + }); + } + return { javaType: nestedName, imports }; + } + if (schema.additionalProperties) { + const valueSchema = typeof schema.additionalProperties === "object" + ? schema.additionalProperties as JSONSchema7 + : { type: "object" } as JSONSchema7; + const valueResult = schemaTypeToJava(valueSchema, true, context, propName + "Value", nestedTypes); + imports.add("java.util.Map"); + for (const imp of valueResult.imports) imports.add(imp); + return { javaType: `Map`, imports }; + } + imports.add("java.util.Map"); + return { javaType: "Map", imports }; + } + + if (schema.$ref) { + const refName = schema.$ref.split("/").pop()!; + return { javaType: refName, imports }; + } + + console.warn(`[codegen] ${context}.${propName}: unrecognized schema (type=${JSON.stringify(schema.type)}) — falling back to Object`); + return { javaType: "Object", imports }; +} + +// ── Class definitions ───────────────────────────────────────────────────────── + +interface JavaClassDef { + kind: "class" | "enum"; + name: string; + description?: string; + schema?: JSONSchema7; + values?: string[]; // for enum +} + +// ── Session Events codegen ──────────────────────────────────────────────────── + +interface EventVariant { + typeName: string; + className: string; + dataSchema: JSONSchema7 | null; + description?: string; +} + +function extractEventVariants(schema: JSONSchema7): EventVariant[] { + const sessionEvent = (schema.definitions as Record)?.SessionEvent; + if (!sessionEvent?.anyOf) throw new Error("Schema must have SessionEvent definition with anyOf"); + + return (sessionEvent.anyOf as JSONSchema7[]) + .map((variant) => { + const typeSchema = variant.properties?.type as JSONSchema7; + const typeName = typeSchema?.const as string; + if (!typeName) throw new Error("Variant must have type.const"); + const baseName = toJavaClassName(typeName); + const dataSchema = variant.properties?.data as JSONSchema7 | undefined; + return { + typeName, + className: `${baseName}Event`, + dataSchema: dataSchema ?? null, + description: variant.description, + }; + }) + .filter((v) => !EXCLUDED_EVENT_TYPES.has(v.typeName)); +} + +async function generateSessionEvents(schemaPath: string): Promise { + console.log("\n📋 Generating session event classes..."); + const schemaContent = await fs.readFile(schemaPath, "utf-8"); + const schema = JSON.parse(schemaContent) as JSONSchema7; + + const variants = extractEventVariants(schema); + const packageName = "com.github.copilot.sdk.generated"; + const packageDir = `src/generated/java/com/github/copilot/sdk/generated`; + + // Generate base SessionEvent class + await generateSessionEventBaseClass(variants, packageName, packageDir); + + // Generate one class file per event variant + for (const variant of variants) { + await generateEventVariantClass(variant, packageName, packageDir); + } + + console.log(`✅ Generated ${variants.length + 1} session event files`); +} + +async function generateSessionEventBaseClass( + variants: EventVariant[], + packageName: string, + packageDir: string +): Promise { + const lines: string[] = []; + lines.push(COPYRIGHT); + lines.push(""); + lines.push(AUTO_GENERATED_HEADER); + lines.push(GENERATED_FROM_SESSION_EVENTS); + lines.push(""); + lines.push(`package ${packageName};`); + lines.push(""); + lines.push(`import com.fasterxml.jackson.annotation.JsonIgnoreProperties;`); + lines.push(`import com.fasterxml.jackson.annotation.JsonProperty;`); + lines.push(`import com.fasterxml.jackson.annotation.JsonSubTypes;`); + lines.push(`import com.fasterxml.jackson.annotation.JsonTypeInfo;`); + lines.push(`import java.time.OffsetDateTime;`); + lines.push(`import java.util.UUID;`); + lines.push(`import javax.annotation.processing.Generated;`); + lines.push(""); + lines.push(`/**`); + lines.push(` * Base class for all generated session events.`); + lines.push(` *`); + lines.push(` * @since 1.0.0`); + lines.push(` */`); + lines.push(`@JsonIgnoreProperties(ignoreUnknown = true)`); + lines.push(`@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = UnknownSessionEvent.class)`); + lines.push(`@JsonSubTypes({`); + for (let i = 0; i < variants.length; i++) { + const v = variants[i]; + const comma = i < variants.length - 1 ? "," : ""; + lines.push(` @JsonSubTypes.Type(value = ${v.className}.class, name = "${v.typeName}")${comma}`); + } + lines.push(`})`); + lines.push(GENERATED_ANNOTATION); + + // Build the permits clause (all variant classes + UnknownSessionEvent last) + const allPermitted = [...variants.map((v) => v.className), "UnknownSessionEvent"]; + lines.push(`public abstract sealed class SessionEvent permits`); + for (let i = 0; i < allPermitted.length; i++) { + const comma = i < allPermitted.length - 1 ? "," : " {"; + lines.push(` ${allPermitted[i]}${comma}`); + } + lines.push(""); + lines.push(` /** Unique event identifier (UUID v4), generated when the event is emitted. */`); + lines.push(` @JsonProperty("id")`); + lines.push(` private UUID id;`); + lines.push(""); + lines.push(` /** ISO 8601 timestamp when the event was created. */`); + lines.push(` @JsonProperty("timestamp")`); + lines.push(` private OffsetDateTime timestamp;`); + lines.push(""); + lines.push(` /** ID of the chronologically preceding event in the session. Null for the first event. */`); + lines.push(` @JsonProperty("parentId")`); + lines.push(` private UUID parentId;`); + lines.push(""); + lines.push(` /** When true, the event is transient and not persisted to the session event log on disk. */`); + lines.push(` @JsonProperty("ephemeral")`); + lines.push(` private Boolean ephemeral;`); + lines.push(""); + lines.push(` /**`); + lines.push(` * Returns the event-type discriminator string (e.g., {@code "session.idle"}).`); + lines.push(` *`); + lines.push(` * @return the event type`); + lines.push(` */`); + lines.push(` public abstract String getType();`); + lines.push(""); + lines.push(` public UUID getId() { return id; }`); + lines.push(` public void setId(UUID id) { this.id = id; }`); + lines.push(""); + lines.push(` public OffsetDateTime getTimestamp() { return timestamp; }`); + lines.push(` public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; }`); + lines.push(""); + lines.push(` public UUID getParentId() { return parentId; }`); + lines.push(` public void setParentId(UUID parentId) { this.parentId = parentId; }`); + lines.push(""); + lines.push(` public Boolean getEphemeral() { return ephemeral; }`); + lines.push(` public void setEphemeral(Boolean ephemeral) { this.ephemeral = ephemeral; }`); + lines.push(`}`); + lines.push(""); + + await writeGeneratedFile(`${packageDir}/SessionEvent.java`, lines.join("\n")); + + // Also generate the UnknownSessionEvent fallback + await generateUnknownEventClass(packageName, packageDir); +} + +async function generateUnknownEventClass(packageName: string, packageDir: string): Promise { + const lines: string[] = []; + lines.push(COPYRIGHT); + lines.push(""); + lines.push(AUTO_GENERATED_HEADER); + lines.push(GENERATED_FROM_SESSION_EVENTS); + lines.push(""); + lines.push(`package ${packageName};`); + lines.push(""); + lines.push(`import com.fasterxml.jackson.annotation.JsonIgnoreProperties;`); + lines.push(`import javax.annotation.processing.Generated;`); + lines.push(""); + lines.push(`/**`); + lines.push(` * Fallback for event types not yet known to this SDK version.`); + lines.push(` *`); + lines.push(` * @since 1.0.0`); + lines.push(` */`); + lines.push(`@JsonIgnoreProperties(ignoreUnknown = true)`); + lines.push(GENERATED_ANNOTATION); + lines.push(`public final class UnknownSessionEvent extends SessionEvent {`); + lines.push(""); + lines.push(` @Override`); + lines.push(` public String getType() { return "unknown"; }`); + lines.push(`}`); + lines.push(""); + + await writeGeneratedFile(`${packageDir}/UnknownSessionEvent.java`, lines.join("\n")); +} + +/** Render a nested type (enum or record) indented at the given level. */ +function renderNestedType(nested: JavaClassDef, indentLevel: number, nestedTypes: Map, allImports: Set): string[] { + const ind = " ".repeat(indentLevel); + const lines: string[] = []; + + if (nested.kind === "enum") { + lines.push(""); + if (nested.description) { + lines.push(`${ind}/** ${nested.description} */`); + } + lines.push(`${ind}public enum ${nested.name} {`); + for (let i = 0; i < (nested.values || []).length; i++) { + const v = nested.values![i]; + const comma = i < nested.values!.length - 1 ? "," : ";"; + lines.push(`${ind} /** The {@code ${v}} variant. */`); + lines.push(`${ind} ${toEnumConstant(v)}("${v}")${comma}`); + } + lines.push(""); + lines.push(`${ind} private final String value;`); + lines.push(`${ind} ${nested.name}(String value) { this.value = value; }`); + lines.push(`${ind} @com.fasterxml.jackson.annotation.JsonValue`); + lines.push(`${ind} public String getValue() { return value; }`); + lines.push(`${ind} @com.fasterxml.jackson.annotation.JsonCreator`); + lines.push(`${ind} public static ${nested.name} fromValue(String value) {`); + lines.push(`${ind} for (${nested.name} v : values()) {`); + lines.push(`${ind} if (v.value.equals(value)) return v;`); + lines.push(`${ind} }`); + lines.push(`${ind} throw new IllegalArgumentException("Unknown ${nested.name} value: " + value);`); + lines.push(`${ind} }`); + lines.push(`${ind}}`); + } else if (nested.kind === "class" && nested.schema?.properties) { + const localNestedTypes = new Map(); + const requiredSet = new Set(nested.schema.required || []); + const fields: { jsonName: string; javaName: string; javaType: string; description?: string }[] = []; + + for (const [propName, propSchema] of Object.entries(nested.schema.properties)) { + if (typeof propSchema !== "object") continue; + const prop = propSchema as JSONSchema7; + // Record components are always boxed (nullable by design). + const result = schemaTypeToJava(prop, false, nested.name, propName, localNestedTypes); + for (const imp of result.imports) allImports.add(imp); + fields.push({ jsonName: propName, javaName: toCamelCase(propName), javaType: result.javaType, description: prop.description }); + } + + lines.push(""); + if (nested.description) { + lines.push(`${ind}/** ${nested.description} */`); + } + lines.push(`${ind}@JsonIgnoreProperties(ignoreUnknown = true)`); + lines.push(`${ind}@JsonInclude(JsonInclude.Include.NON_NULL)`); + if (fields.length === 0) { + lines.push(`${ind}public record ${nested.name}() {`); + } else { + lines.push(`${ind}public record ${nested.name}(`); + for (let i = 0; i < fields.length; i++) { + const f = fields[i]; + const comma = i < fields.length - 1 ? "," : ""; + if (f.description) lines.push(`${ind} /** ${f.description} */`); + lines.push(`${ind} @JsonProperty("${f.jsonName}") ${f.javaType} ${f.javaName}${comma}`); + } + lines.push(`${ind}) {`); + } + // Render any further nested types inside this record + for (const [, localNested] of localNestedTypes) { + lines.push(...renderNestedType(localNested, indentLevel + 1, nestedTypes, allImports)); + } + if (lines[lines.length - 1] !== "") lines.push(""); + lines.pop(); // remove trailing blank before closing brace + lines.push(`${ind}}`); + } + + return lines; +} + +async function generateEventVariantClass( + variant: EventVariant, + packageName: string, + packageDir: string +): Promise { + const lines: string[] = []; + const allImports = new Set([ + "com.fasterxml.jackson.annotation.JsonIgnoreProperties", + "com.fasterxml.jackson.annotation.JsonProperty", + "com.fasterxml.jackson.annotation.JsonInclude", + "javax.annotation.processing.Generated", + ]); + const nestedTypes = new Map(); + + // Collect data record fields + interface FieldInfo { + jsonName: string; + javaName: string; + javaType: string; + description?: string; + } + + const dataFields: FieldInfo[] = []; + + if (variant.dataSchema?.properties) { + for (const [propName, propSchema] of Object.entries(variant.dataSchema.properties)) { + if (typeof propSchema !== "object") continue; + const prop = propSchema as JSONSchema7; + // Record components are always boxed (nullable by design). + const result = schemaTypeToJava(prop, false, `${variant.className}Data`, propName, nestedTypes); + for (const imp of result.imports) allImports.add(imp); + dataFields.push({ + jsonName: propName, + javaName: toCamelCase(propName), + javaType: result.javaType, + description: prop.description, + }); + } + } + + // Whether a data record should be emitted (always when dataSchema is present) + const hasDataSchema = variant.dataSchema !== null; + + // Build the file + lines.push(COPYRIGHT); + lines.push(""); + lines.push(AUTO_GENERATED_HEADER); + lines.push(GENERATED_FROM_SESSION_EVENTS); + lines.push(""); + lines.push(`package ${packageName};`); + lines.push(""); + + // Placeholder for imports + const importPlaceholderIdx = lines.length; + lines.push("__IMPORTS__"); + lines.push(""); + + if (variant.description) { + lines.push(`/**`); + lines.push(` * ${variant.description}`); + lines.push(` *`); + lines.push(` * @since 1.0.0`); + lines.push(` */`); + } else { + lines.push(`/**`); + lines.push(` * The {@code ${variant.typeName}} session event.`); + lines.push(` *`); + lines.push(` * @since 1.0.0`); + lines.push(` */`); + } + lines.push(`@JsonIgnoreProperties(ignoreUnknown = true)`); + lines.push(GENERATED_ANNOTATION); + lines.push(`public final class ${variant.className} extends SessionEvent {`); + lines.push(""); + lines.push(` @Override`); + lines.push(` public String getType() { return "${variant.typeName}"; }`); + + if (hasDataSchema) { + lines.push(""); + lines.push(` @JsonProperty("data")`); + lines.push(` private ${variant.className}Data data;`); + lines.push(""); + lines.push(` public ${variant.className}Data getData() { return data; }`); + lines.push(` public void setData(${variant.className}Data data) { this.data = data; }`); + lines.push(""); + // Generate data inner record + lines.push(` /** Data payload for {@link ${variant.className}}. */`); + lines.push(` @JsonIgnoreProperties(ignoreUnknown = true)`); + lines.push(` @JsonInclude(JsonInclude.Include.NON_NULL)`); + if (dataFields.length === 0) { + lines.push(` public record ${variant.className}Data() {`); + } else { + lines.push(` public record ${variant.className}Data(`); + for (let i = 0; i < dataFields.length; i++) { + const field = dataFields[i]; + const comma = i < dataFields.length - 1 ? "," : ""; + if (field.description) { + lines.push(` /** ${field.description} */`); + } + lines.push(` @JsonProperty("${field.jsonName}") ${field.javaType} ${field.javaName}${comma}`); + } + lines.push(` ) {`); + } + // Render nested types inside Data record + for (const [, nested] of nestedTypes) { + lines.push(...renderNestedType(nested, 2, nestedTypes, allImports)); + } + if (nestedTypes.size > 0 && lines[lines.length - 1] === "") lines.pop(); + lines.push(` }`); + } + + lines.push(`}`); + lines.push(""); + + // Replace import placeholder + const sortedImports = [...allImports].sort(); + const importLines = sortedImports.map((i) => `import ${i};`).join("\n"); + lines[importPlaceholderIdx] = importLines; + + await writeGeneratedFile(`${packageDir}/${variant.className}.java`, lines.join("\n")); +} + +// ── RPC types codegen ───────────────────────────────────────────────────────── + +interface RpcMethod { + rpcMethod: string; + params: JSONSchema7 | null; + result: JSONSchema7 | null; + stability?: string; +} + +function isRpcMethod(node: unknown): node is RpcMethod { + return typeof node === "object" && node !== null && "rpcMethod" in node; +} + +function collectRpcMethods(node: Record): [string, RpcMethod][] { + const results: [string, RpcMethod][] = []; + for (const [key, value] of Object.entries(node)) { + if (isRpcMethod(value)) { + results.push([key, value]); + } else if (typeof value === "object" && value !== null) { + results.push(...collectRpcMethods(value as Record)); + } + } + return results; +} + +/** Convert an RPC method name to a Java class name prefix (e.g., "models.list" -> "ModelsList") */ +function rpcMethodToClassName(rpcMethod: string): string { + return rpcMethod.split(/[._-]/).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(""); +} + +/** Generate a Java record for a JSON Schema object type. Returns the class content. */ +function generateRpcClass( + className: string, + schema: JSONSchema7, + _nestedTypes: Map, + _packageName: string, + visibility: "public" | "internal" = "public" +): { code: string; imports: Set } { + const imports = new Set(); + const localNestedTypes = new Map(); + const lines: string[] = []; + const visModifier = visibility === "public" ? "public " : ""; + + const properties = Object.entries(schema.properties || {}); + const fields = properties.flatMap(([propName, propSchema]) => { + if (typeof propSchema !== "object") return []; + const prop = propSchema as JSONSchema7; + // Record components are always boxed (nullable by design). + const result = schemaTypeToJava(prop, false, className, propName, localNestedTypes); + for (const imp of result.imports) imports.add(imp); + return [{ propName, javaName: toCamelCase(propName), javaType: result.javaType, description: prop.description }]; + }); + + lines.push(`@JsonInclude(JsonInclude.Include.NON_NULL)`); + lines.push(`@JsonIgnoreProperties(ignoreUnknown = true)`); + if (fields.length === 0) { + lines.push(`${visModifier}record ${className}() {`); + } else { + lines.push(`${visModifier}record ${className}(`); + for (let i = 0; i < fields.length; i++) { + const f = fields[i]; + const comma = i < fields.length - 1 ? "," : ""; + if (f.description) { + lines.push(` /** ${f.description} */`); + } + lines.push(` @JsonProperty("${f.propName}") ${f.javaType} ${f.javaName}${comma}`); + } + lines.push(`) {`); + } + + // Add nested types as nested records/enums inside this record + for (const [, nested] of localNestedTypes) { + lines.push(...renderNestedType(nested, 1, new Map(), imports)); + } + + if (localNestedTypes.size > 0 && lines[lines.length - 1] === "") lines.pop(); + lines.push(`}`); + + return { code: lines.join("\n"), imports }; +} + +async function generateRpcTypes(schemaPath: string): Promise { + console.log("\n🔌 Generating RPC types..."); + const schemaContent = await fs.readFile(schemaPath, "utf-8"); + const schema = JSON.parse(schemaContent) as Record & { + server?: Record; + session?: Record; + clientSession?: Record; + }; + + const packageName = "com.github.copilot.sdk.generated.rpc"; + const packageDir = `src/generated/java/com/github/copilot/sdk/generated/rpc`; + + // Collect all RPC methods from all sections + const sections: [string, Record][] = []; + if (schema.server) sections.push(["server", schema.server]); + if (schema.session) sections.push(["session", schema.session]); + if (schema.clientSession) sections.push(["clientSession", schema.clientSession]); + + const generatedClasses = new Map(); + const allFiles: string[] = []; + + for (const [, sectionNode] of sections) { + const methods = collectRpcMethods(sectionNode); + for (const [, method] of methods) { + const className = rpcMethodToClassName(method.rpcMethod); + + // Generate params class + if (method.params && typeof method.params === "object" && (method.params as JSONSchema7).properties) { + const paramsClassName = `${className}Params`; + if (!generatedClasses.has(paramsClassName)) { + generatedClasses.set(paramsClassName, true); + allFiles.push(await generateRpcDataClass(paramsClassName, method.params as JSONSchema7, packageName, packageDir, method.rpcMethod, "params")); + } + } + + // Generate result class + if (method.result && typeof method.result === "object" && (method.result as JSONSchema7).properties) { + const resultClassName = `${className}Result`; + if (!generatedClasses.has(resultClassName)) { + generatedClasses.set(resultClassName, true); + allFiles.push(await generateRpcDataClass(resultClassName, method.result as JSONSchema7, packageName, packageDir, method.rpcMethod, "result")); + } + } + } + } + + console.log(`✅ Generated ${allFiles.length} RPC type files`); +} + +async function generateRpcDataClass( + className: string, + schema: JSONSchema7, + packageName: string, + packageDir: string, + rpcMethod: string, + kind: "params" | "result" +): Promise { + const nestedTypes = new Map(); + const { code, imports } = generateRpcClass(className, schema, nestedTypes, packageName); + + const lines: string[] = []; + lines.push(COPYRIGHT); + lines.push(""); + lines.push(AUTO_GENERATED_HEADER); + lines.push(GENERATED_FROM_API); + lines.push(""); + lines.push(`package ${packageName};`); + lines.push(""); + + const allImports = new Set([ + "com.fasterxml.jackson.annotation.JsonIgnoreProperties", + "com.fasterxml.jackson.annotation.JsonProperty", + "com.fasterxml.jackson.annotation.JsonInclude", + "javax.annotation.processing.Generated", + ...imports, + ]); + const sortedImports = [...allImports].sort(); + for (const imp of sortedImports) { + lines.push(`import ${imp};`); + } + lines.push(""); + + if (schema.description) { + lines.push(`/**`); + lines.push(` * ${schema.description}`); + lines.push(` *`); + lines.push(` * @since 1.0.0`); + lines.push(` */`); + } else { + lines.push(`/**`); + lines.push(` * ${kind === "params" ? "Request parameters" : "Result"} for the {@code ${rpcMethod}} RPC method.`); + lines.push(` *`); + lines.push(` * @since 1.0.0`); + lines.push(` */`); + } + lines.push(GENERATED_ANNOTATION); + lines.push(code); + lines.push(""); + + await writeGeneratedFile(`${packageDir}/${className}.java`, lines.join("\n")); + return className; +} + +// ── Main entry point ────────────────────────────────────────────────────────── + +async function main(): Promise { + console.log("🚀 Java SDK code generator"); + console.log("============================"); + + const sessionEventsSchemaPath = await getSessionEventsSchemaPath(); + console.log(`📄 Session events schema: ${sessionEventsSchemaPath}`); + const apiSchemaPath = await getApiSchemaPath(); + console.log(`📄 API schema: ${apiSchemaPath}`); + + await generateSessionEvents(sessionEventsSchemaPath); + await generateRpcTypes(apiSchemaPath); + + console.log("\n✅ Java code generation complete!"); +} + +main().catch((err) => { + console.error("❌ Code generation failed:", err); + process.exit(1); +}); diff --git a/scripts/codegen/package-lock.json b/scripts/codegen/package-lock.json new file mode 100644 index 000000000..4a3705f36 --- /dev/null +++ b/scripts/codegen/package-lock.json @@ -0,0 +1,645 @@ +{ + "name": "copilot-sdk-java-codegen", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "copilot-sdk-java-codegen", + "dependencies": { + "@github/copilot": "1.0.24", + "json-schema": "^0.4.0", + "tsx": "^4.20.6" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@github/copilot": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.24.tgz", + "integrity": "sha512-/nZ2GwhaGq0HeI3W+6LE0JGw25/bipC6tYVa+oQ5tIvAafBazuNt10CXkeaor+u9oBWLZtPbdTyAzE2tjy9NpQ==", + "license": "SEE LICENSE IN LICENSE.md", + "bin": { + "copilot": "npm-loader.js" + }, + "optionalDependencies": { + "@github/copilot-darwin-arm64": "1.0.24", + "@github/copilot-darwin-x64": "1.0.24", + "@github/copilot-linux-arm64": "1.0.24", + "@github/copilot-linux-x64": "1.0.24", + "@github/copilot-win32-arm64": "1.0.24", + "@github/copilot-win32-x64": "1.0.24" + } + }, + "node_modules/@github/copilot-darwin-arm64": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.24.tgz", + "integrity": "sha512-lejn6KV+09rZEICX3nRx9a58DQFQ2kK3NJ3EICfVLngUCWIUmwn1BLezjeTQc9YNasHltA1hulvfsWqX+VjlMw==", + "cpu": [ + "arm64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "copilot-darwin-arm64": "copilot" + } + }, + "node_modules/@github/copilot-darwin-x64": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.24.tgz", + "integrity": "sha512-r2F3keTvr4Bunz3V+waRAvsHgqsVQGyIZFBebsNPWxBX1eh3IXgtBqxCR7vXTFyZonQ8VaiJH3YYEfAhyKsk9g==", + "cpu": [ + "x64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "copilot-darwin-x64": "copilot" + } + }, + "node_modules/@github/copilot-linux-arm64": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.24.tgz", + "integrity": "sha512-B3oANXKKKLhnKYozXa/W+DxfCQAHJCs0QKR5rBwNrwJbf656twNgALSxWTSJk+1rEP6MrHCswUAcwjwZL7Q+FQ==", + "cpu": [ + "arm64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "linux" + ], + "bin": { + "copilot-linux-arm64": "copilot" + } + }, + "node_modules/@github/copilot-linux-x64": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.24.tgz", + "integrity": "sha512-NGTldizY54B+4Sfhu/GWoEQNMwqqUNgMwbSgBshFv+Hqy1EwuvNWKVov1Y0Vzhp4qAHc6ZxBk/OPIW8Ato9FUg==", + "cpu": [ + "x64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "linux" + ], + "bin": { + "copilot-linux-x64": "copilot" + } + }, + "node_modules/@github/copilot-win32-arm64": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.24.tgz", + "integrity": "sha512-/pd/kgef7/HIIg1SQq4q8fext39pDSC44jHB10KkhfgG1WaDFhQbc/aSSMQfxeldkRbQh6VANp8WtGQdwtMCBA==", + "cpu": [ + "arm64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "win32" + ], + "bin": { + "copilot-win32-arm64": "copilot.exe" + } + }, + "node_modules/@github/copilot-win32-x64": { + "version": "1.0.24", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.24.tgz", + "integrity": "sha512-RDvOiSvyEJwELqErwANJTrdRuMIHkwPE4QK7Le7WsmaSKxiuS4H1Pa8Yxnd2FWrMsCHEbase23GJlymbnGYLXQ==", + "cpu": [ + "x64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "win32" + ], + "bin": { + "copilot-win32-x64": "copilot.exe" + } + }, + "node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.13.7", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.7.tgz", + "integrity": "sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q==", + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/tsx": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", + "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", + "license": "MIT", + "dependencies": { + "esbuild": "~0.27.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + } + } +} diff --git a/scripts/codegen/package.json b/scripts/codegen/package.json new file mode 100644 index 000000000..38dd5fc1f --- /dev/null +++ b/scripts/codegen/package.json @@ -0,0 +1,14 @@ +{ + "name": "copilot-sdk-java-codegen", + "private": true, + "type": "module", + "scripts": { + "generate": "tsx java.ts", + "generate:java": "tsx java.ts" + }, + "dependencies": { + "@github/copilot": "1.0.24", + "json-schema": "^0.4.0", + "tsx": "^4.20.6" + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AbortEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AbortEvent.java new file mode 100644 index 000000000..b492236bf --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AbortEvent.java @@ -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.sdk.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 {@code abort} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AbortEvent extends SessionEvent { + + @Override + public String getType() { return "abort"; } + + @JsonProperty("data") + private AbortEventData data; + + public AbortEventData getData() { return data; } + public void setData(AbortEventData data) { this.data = data; } + + /** Data payload for {@link AbortEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AbortEventData( + /** Reason the current turn was aborted (e.g., "user initiated") */ + @JsonProperty("reason") String reason + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantIntentEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantIntentEvent.java new file mode 100644 index 000000000..2a33a8019 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantIntentEvent.java @@ -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.sdk.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 {@code assistant.intent} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantIntentEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.intent"; } + + @JsonProperty("data") + private AssistantIntentEventData data; + + public AssistantIntentEventData getData() { return data; } + public void setData(AssistantIntentEventData data) { this.data = data; } + + /** Data payload for {@link AssistantIntentEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantIntentEventData( + /** Short description of what the agent is currently doing or planning to do */ + @JsonProperty("intent") String intent + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageDeltaEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageDeltaEvent.java new file mode 100644 index 000000000..0a9f58dcc --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageDeltaEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code assistant.message_delta} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantMessageDeltaEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.message_delta"; } + + @JsonProperty("data") + private AssistantMessageDeltaEventData data; + + public AssistantMessageDeltaEventData getData() { return data; } + public void setData(AssistantMessageDeltaEventData data) { this.data = data; } + + /** Data payload for {@link AssistantMessageDeltaEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantMessageDeltaEventData( + /** Message ID this delta belongs to, matching the corresponding assistant.message event */ + @JsonProperty("messageId") String messageId, + /** Incremental text chunk to append to the message content */ + @JsonProperty("deltaContent") String deltaContent, + /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ + @JsonProperty("parentToolCallId") String parentToolCallId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java new file mode 100644 index 000000000..d62bbbee9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java @@ -0,0 +1,103 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code assistant.message} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantMessageEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.message"; } + + @JsonProperty("data") + private AssistantMessageEventData data; + + public AssistantMessageEventData getData() { return data; } + public void setData(AssistantMessageEventData data) { this.data = data; } + + /** Data payload for {@link AssistantMessageEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantMessageEventData( + /** Unique identifier for this assistant message */ + @JsonProperty("messageId") String messageId, + /** The assistant's text response content */ + @JsonProperty("content") String content, + /** Tool invocations requested by the assistant in this message */ + @JsonProperty("toolRequests") List toolRequests, + /** Opaque/encrypted extended thinking data from Anthropic models. Session-bound and stripped on resume. */ + @JsonProperty("reasoningOpaque") String reasoningOpaque, + /** Readable reasoning text from the model's extended thinking */ + @JsonProperty("reasoningText") String reasoningText, + /** Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume. */ + @JsonProperty("encryptedContent") String encryptedContent, + /** Generation phase for phased-output models (e.g., thinking vs. response phases) */ + @JsonProperty("phase") String phase, + /** Actual output token count from the API response (completion_tokens), used for accurate token accounting */ + @JsonProperty("outputTokens") Double outputTokens, + /** CAPI interaction ID for correlating this message with upstream telemetry */ + @JsonProperty("interactionId") String interactionId, + /** GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs */ + @JsonProperty("requestId") String requestId, + /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ + @JsonProperty("parentToolCallId") String parentToolCallId + ) { + + /** A tool invocation request from the assistant */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantMessageEventDataToolRequestsItem( + /** Unique identifier for this tool call */ + @JsonProperty("toolCallId") String toolCallId, + /** Name of the tool being invoked */ + @JsonProperty("name") String name, + /** Arguments to pass to the tool, format depends on the tool */ + @JsonProperty("arguments") Object arguments, + /** Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. */ + @JsonProperty("type") AssistantMessageEventDataToolRequestsItemType type, + /** Human-readable display title for the tool */ + @JsonProperty("toolTitle") String toolTitle, + /** Name of the MCP server hosting this tool, when the tool is an MCP tool */ + @JsonProperty("mcpServerName") String mcpServerName, + /** Resolved intention summary describing what this specific call does */ + @JsonProperty("intentionSummary") String intentionSummary + ) { + + /** Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. */ + public enum AssistantMessageEventDataToolRequestsItemType { + /** The {@code function} variant. */ + FUNCTION("function"), + /** The {@code custom} variant. */ + CUSTOM("custom"); + + private final String value; + AssistantMessageEventDataToolRequestsItemType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AssistantMessageEventDataToolRequestsItemType fromValue(String value) { + for (AssistantMessageEventDataToolRequestsItemType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AssistantMessageEventDataToolRequestsItemType value: " + value); + } + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningDeltaEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningDeltaEvent.java new file mode 100644 index 000000000..e8d38b23c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningDeltaEvent.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.sdk.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 {@code assistant.reasoning_delta} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantReasoningDeltaEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.reasoning_delta"; } + + @JsonProperty("data") + private AssistantReasoningDeltaEventData data; + + public AssistantReasoningDeltaEventData getData() { return data; } + public void setData(AssistantReasoningDeltaEventData data) { this.data = data; } + + /** Data payload for {@link AssistantReasoningDeltaEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantReasoningDeltaEventData( + /** Reasoning block ID this delta belongs to, matching the corresponding assistant.reasoning event */ + @JsonProperty("reasoningId") String reasoningId, + /** Incremental text chunk to append to the reasoning content */ + @JsonProperty("deltaContent") String deltaContent + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningEvent.java new file mode 100644 index 000000000..b8715a880 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningEvent.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.sdk.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 {@code assistant.reasoning} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantReasoningEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.reasoning"; } + + @JsonProperty("data") + private AssistantReasoningEventData data; + + public AssistantReasoningEventData getData() { return data; } + public void setData(AssistantReasoningEventData data) { this.data = data; } + + /** Data payload for {@link AssistantReasoningEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantReasoningEventData( + /** Unique identifier for this reasoning block */ + @JsonProperty("reasoningId") String reasoningId, + /** The complete extended thinking text from the model */ + @JsonProperty("content") String content + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantStreamingDeltaEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantStreamingDeltaEvent.java new file mode 100644 index 000000000..36050c0fd --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantStreamingDeltaEvent.java @@ -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.sdk.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 {@code assistant.streaming_delta} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantStreamingDeltaEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.streaming_delta"; } + + @JsonProperty("data") + private AssistantStreamingDeltaEventData data; + + public AssistantStreamingDeltaEventData getData() { return data; } + public void setData(AssistantStreamingDeltaEventData data) { this.data = data; } + + /** Data payload for {@link AssistantStreamingDeltaEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantStreamingDeltaEventData( + /** Cumulative total bytes received from the streaming response so far */ + @JsonProperty("totalResponseSizeBytes") Double totalResponseSizeBytes + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnEndEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnEndEvent.java new file mode 100644 index 000000000..7d34cb7af --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnEndEvent.java @@ -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.sdk.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 {@code assistant.turn_end} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantTurnEndEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.turn_end"; } + + @JsonProperty("data") + private AssistantTurnEndEventData data; + + public AssistantTurnEndEventData getData() { return data; } + public void setData(AssistantTurnEndEventData data) { this.data = data; } + + /** Data payload for {@link AssistantTurnEndEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantTurnEndEventData( + /** Identifier of the turn that has ended, matching the corresponding assistant.turn_start event */ + @JsonProperty("turnId") String turnId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnStartEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnStartEvent.java new file mode 100644 index 000000000..f735a71ef --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnStartEvent.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.sdk.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 {@code assistant.turn_start} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantTurnStartEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.turn_start"; } + + @JsonProperty("data") + private AssistantTurnStartEventData data; + + public AssistantTurnStartEventData getData() { return data; } + public void setData(AssistantTurnStartEventData data) { this.data = data; } + + /** Data payload for {@link AssistantTurnStartEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantTurnStartEventData( + /** Identifier for this turn within the agentic loop, typically a stringified turn number */ + @JsonProperty("turnId") String turnId, + /** CAPI interaction ID for correlating this turn with upstream telemetry */ + @JsonProperty("interactionId") String interactionId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageEvent.java new file mode 100644 index 000000000..b2c491aff --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageEvent.java @@ -0,0 +1,124 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * The {@code assistant.usage} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AssistantUsageEvent extends SessionEvent { + + @Override + public String getType() { return "assistant.usage"; } + + @JsonProperty("data") + private AssistantUsageEventData data; + + public AssistantUsageEventData getData() { return data; } + public void setData(AssistantUsageEventData data) { this.data = data; } + + /** Data payload for {@link AssistantUsageEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantUsageEventData( + /** Model identifier used for this API call */ + @JsonProperty("model") String model, + /** Number of input tokens consumed */ + @JsonProperty("inputTokens") Double inputTokens, + /** Number of output tokens produced */ + @JsonProperty("outputTokens") Double outputTokens, + /** Number of tokens read from prompt cache */ + @JsonProperty("cacheReadTokens") Double cacheReadTokens, + /** Number of tokens written to prompt cache */ + @JsonProperty("cacheWriteTokens") Double cacheWriteTokens, + /** Number of output tokens used for reasoning (e.g., chain-of-thought) */ + @JsonProperty("reasoningTokens") Double reasoningTokens, + /** Model multiplier cost for billing purposes */ + @JsonProperty("cost") Double cost, + /** Duration of the API call in milliseconds */ + @JsonProperty("duration") Double duration, + /** Time to first token in milliseconds. Only available for streaming requests */ + @JsonProperty("ttftMs") Double ttftMs, + /** Average inter-token latency in milliseconds. Only available for streaming requests */ + @JsonProperty("interTokenLatencyMs") Double interTokenLatencyMs, + /** What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls */ + @JsonProperty("initiator") String initiator, + /** Completion ID from the model provider (e.g., chatcmpl-abc123) */ + @JsonProperty("apiCallId") String apiCallId, + /** GitHub request tracing ID (x-github-request-id header) for server-side log correlation */ + @JsonProperty("providerCallId") String providerCallId, + /** Parent tool call ID when this usage originates from a sub-agent */ + @JsonProperty("parentToolCallId") String parentToolCallId, + /** Per-quota resource usage snapshots, keyed by quota identifier */ + @JsonProperty("quotaSnapshots") Map quotaSnapshots, + /** Per-request cost and usage data from the CAPI copilot_usage response field */ + @JsonProperty("copilotUsage") AssistantUsageEventDataCopilotUsage copilotUsage, + /** Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh") */ + @JsonProperty("reasoningEffort") String reasoningEffort + ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantUsageEventDataQuotaSnapshotsValue( + /** Whether the user has an unlimited usage entitlement */ + @JsonProperty("isUnlimitedEntitlement") Boolean isUnlimitedEntitlement, + /** Total requests allowed by the entitlement */ + @JsonProperty("entitlementRequests") Double entitlementRequests, + /** Number of requests already consumed */ + @JsonProperty("usedRequests") Double usedRequests, + /** Whether usage is still permitted after quota exhaustion */ + @JsonProperty("usageAllowedWithExhaustedQuota") Boolean usageAllowedWithExhaustedQuota, + /** Number of requests over the entitlement limit */ + @JsonProperty("overage") Double overage, + /** Whether overage is allowed when quota is exhausted */ + @JsonProperty("overageAllowedWithExhaustedQuota") Boolean overageAllowedWithExhaustedQuota, + /** Percentage of quota remaining (0.0 to 1.0) */ + @JsonProperty("remainingPercentage") Double remainingPercentage, + /** Date when the quota resets */ + @JsonProperty("resetDate") OffsetDateTime resetDate + ) { + } + + /** Per-request cost and usage data from the CAPI copilot_usage response field */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantUsageEventDataCopilotUsage( + /** Itemized token usage breakdown */ + @JsonProperty("tokenDetails") List tokenDetails, + /** Total cost in nano-AIU (AI Units) for this request */ + @JsonProperty("totalNanoAiu") Double totalNanoAiu + ) { + + /** Token usage detail for a single billing category */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AssistantUsageEventDataCopilotUsageTokenDetailsItem( + /** Number of tokens in this billing batch */ + @JsonProperty("batchSize") Double batchSize, + /** Cost per batch of tokens */ + @JsonProperty("costPerBatch") Double costPerBatch, + /** Total token count for this entry */ + @JsonProperty("tokenCount") Double tokenCount, + /** Token category (e.g., "input", "output") */ + @JsonProperty("tokenType") String tokenType + ) { + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java new file mode 100644 index 000000000..830e87c91 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code capabilities.changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class CapabilitiesChangedEvent extends SessionEvent { + + @Override + public String getType() { return "capabilities.changed"; } + + @JsonProperty("data") + private CapabilitiesChangedEventData data; + + public CapabilitiesChangedEventData getData() { return data; } + public void setData(CapabilitiesChangedEventData data) { this.data = data; } + + /** Data payload for {@link CapabilitiesChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record CapabilitiesChangedEventData( + /** UI capability changes */ + @JsonProperty("ui") CapabilitiesChangedEventDataUi ui + ) { + + /** UI capability changes */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record CapabilitiesChangedEventDataUi( + /** Whether elicitation is now supported */ + @JsonProperty("elicitation") Boolean elicitation + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/CommandCompletedEvent.java new file mode 100644 index 000000000..c34c0456c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CommandCompletedEvent.java @@ -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.sdk.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 {@code command.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class CommandCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "command.completed"; } + + @JsonProperty("data") + private CommandCompletedEventData data; + + public CommandCompletedEventData getData() { return data; } + public void setData(CommandCompletedEventData data) { this.data = data; } + + /** Data payload for {@link CommandCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record CommandCompletedEventData( + /** Request ID of the resolved command request; clients should dismiss any UI for this request */ + @JsonProperty("requestId") String requestId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandExecuteEvent.java b/src/generated/java/com/github/copilot/sdk/generated/CommandExecuteEvent.java new file mode 100644 index 000000000..9ca4d852d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CommandExecuteEvent.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code command.execute} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class CommandExecuteEvent extends SessionEvent { + + @Override + public String getType() { return "command.execute"; } + + @JsonProperty("data") + private CommandExecuteEventData data; + + public CommandExecuteEventData getData() { return data; } + public void setData(CommandExecuteEventData data) { this.data = data; } + + /** Data payload for {@link CommandExecuteEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record CommandExecuteEventData( + /** Unique identifier; used to respond via session.commands.handlePendingCommand() */ + @JsonProperty("requestId") String requestId, + /** The full command text (e.g., /deploy production) */ + @JsonProperty("command") String command, + /** Command name without leading / */ + @JsonProperty("commandName") String commandName, + /** Raw argument string after the command name */ + @JsonProperty("args") String args + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandQueuedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/CommandQueuedEvent.java new file mode 100644 index 000000000..6cd87fee5 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CommandQueuedEvent.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.sdk.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 {@code command.queued} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class CommandQueuedEvent extends SessionEvent { + + @Override + public String getType() { return "command.queued"; } + + @JsonProperty("data") + private CommandQueuedEventData data; + + public CommandQueuedEventData getData() { return data; } + public void setData(CommandQueuedEventData data) { this.data = data; } + + /** Data payload for {@link CommandQueuedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record CommandQueuedEventData( + /** Unique identifier for this request; used to respond via session.respondToQueuedCommand() */ + @JsonProperty("requestId") String requestId, + /** The slash command text to be executed (e.g., /help, /clear) */ + @JsonProperty("command") String command + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java new file mode 100644 index 000000000..aef44086c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code commands.changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class CommandsChangedEvent extends SessionEvent { + + @Override + public String getType() { return "commands.changed"; } + + @JsonProperty("data") + private CommandsChangedEventData data; + + public CommandsChangedEventData getData() { return data; } + public void setData(CommandsChangedEventData data) { this.data = data; } + + /** Data payload for {@link CommandsChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record CommandsChangedEventData( + /** Current list of registered SDK commands */ + @JsonProperty("commands") List commands + ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record CommandsChangedEventDataCommandsItem( + @JsonProperty("name") String name, + @JsonProperty("description") String description + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java new file mode 100644 index 000000000..617a521f3 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code elicitation.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ElicitationCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "elicitation.completed"; } + + @JsonProperty("data") + private ElicitationCompletedEventData data; + + public ElicitationCompletedEventData getData() { return data; } + public void setData(ElicitationCompletedEventData data) { this.data = data; } + + /** Data payload for {@link ElicitationCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ElicitationCompletedEventData( + /** Request ID of the resolved elicitation request; clients should dismiss any UI for this request */ + @JsonProperty("requestId") String requestId, + /** The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed) */ + @JsonProperty("action") ElicitationCompletedEventDataAction action, + /** The submitted form data when action is 'accept'; keys match the requested schema fields */ + @JsonProperty("content") Map content + ) { + + /** The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed) */ + public enum ElicitationCompletedEventDataAction { + /** The {@code accept} variant. */ + ACCEPT("accept"), + /** The {@code decline} variant. */ + DECLINE("decline"), + /** The {@code cancel} variant. */ + CANCEL("cancel"); + + private final String value; + ElicitationCompletedEventDataAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ElicitationCompletedEventDataAction fromValue(String value) { + for (ElicitationCompletedEventDataAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ElicitationCompletedEventDataAction value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedEvent.java new file mode 100644 index 000000000..acde34992 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedEvent.java @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code elicitation.requested} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ElicitationRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "elicitation.requested"; } + + @JsonProperty("data") + private ElicitationRequestedEventData data; + + public ElicitationRequestedEventData getData() { return data; } + public void setData(ElicitationRequestedEventData data) { this.data = data; } + + /** Data payload for {@link ElicitationRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ElicitationRequestedEventData( + /** Unique identifier for this elicitation request; used to respond via session.respondToElicitation() */ + @JsonProperty("requestId") String requestId, + /** Tool call ID from the LLM completion; used to correlate with CompletionChunk.toolCall.id for remote UIs */ + @JsonProperty("toolCallId") String toolCallId, + /** The source that initiated the request (MCP server name, or absent for agent-initiated) */ + @JsonProperty("elicitationSource") String elicitationSource, + /** Message describing what information is needed from the user */ + @JsonProperty("message") String message, + /** Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. */ + @JsonProperty("mode") ElicitationRequestedEventDataMode mode, + /** JSON Schema describing the form fields to present to the user (form mode only) */ + @JsonProperty("requestedSchema") ElicitationRequestedEventDataRequestedSchema requestedSchema, + /** URL to open in the user's browser (url mode only) */ + @JsonProperty("url") String url + ) { + + /** Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. */ + public enum ElicitationRequestedEventDataMode { + /** The {@code form} variant. */ + FORM("form"), + /** The {@code url} variant. */ + URL("url"); + + private final String value; + ElicitationRequestedEventDataMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ElicitationRequestedEventDataMode fromValue(String value) { + for (ElicitationRequestedEventDataMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ElicitationRequestedEventDataMode value: " + value); + } + } + + /** JSON Schema describing the form fields to present to the user (form mode only) */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ElicitationRequestedEventDataRequestedSchema( + /** Schema type indicator (always 'object') */ + @JsonProperty("type") String type, + /** Form field definitions, keyed by field name */ + @JsonProperty("properties") Map properties, + /** List of required field names */ + @JsonProperty("required") List required + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeCompletedEvent.java new file mode 100644 index 000000000..ce788c405 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeCompletedEvent.java @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code exit_plan_mode.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ExitPlanModeCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "exit_plan_mode.completed"; } + + @JsonProperty("data") + private ExitPlanModeCompletedEventData data; + + public ExitPlanModeCompletedEventData getData() { return data; } + public void setData(ExitPlanModeCompletedEventData data) { this.data = data; } + + /** Data payload for {@link ExitPlanModeCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ExitPlanModeCompletedEventData( + /** Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request */ + @JsonProperty("requestId") String requestId, + /** Whether the plan was approved by the user */ + @JsonProperty("approved") Boolean approved, + /** Which action the user selected (e.g. 'autopilot', 'interactive', 'exit_only') */ + @JsonProperty("selectedAction") String selectedAction, + /** Whether edits should be auto-approved without confirmation */ + @JsonProperty("autoApproveEdits") Boolean autoApproveEdits, + /** Free-form feedback from the user if they requested changes to the plan */ + @JsonProperty("feedback") String feedback + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeRequestedEvent.java new file mode 100644 index 000000000..1b87efeb7 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeRequestedEvent.java @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code exit_plan_mode.requested} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ExitPlanModeRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "exit_plan_mode.requested"; } + + @JsonProperty("data") + private ExitPlanModeRequestedEventData data; + + public ExitPlanModeRequestedEventData getData() { return data; } + public void setData(ExitPlanModeRequestedEventData data) { this.data = data; } + + /** Data payload for {@link ExitPlanModeRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ExitPlanModeRequestedEventData( + /** Unique identifier for this request; used to respond via session.respondToExitPlanMode() */ + @JsonProperty("requestId") String requestId, + /** Summary of the plan that was created */ + @JsonProperty("summary") String summary, + /** Full content of the plan file */ + @JsonProperty("planContent") String planContent, + /** Available actions the user can take (e.g., approve, edit, reject) */ + @JsonProperty("actions") List actions, + /** The recommended action for the user to take */ + @JsonProperty("recommendedAction") String recommendedAction + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExternalToolCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ExternalToolCompletedEvent.java new file mode 100644 index 000000000..589e424c4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ExternalToolCompletedEvent.java @@ -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.sdk.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 {@code external_tool.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ExternalToolCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "external_tool.completed"; } + + @JsonProperty("data") + private ExternalToolCompletedEventData data; + + public ExternalToolCompletedEventData getData() { return data; } + public void setData(ExternalToolCompletedEventData data) { this.data = data; } + + /** Data payload for {@link ExternalToolCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ExternalToolCompletedEventData( + /** Request ID of the resolved external tool request; clients should dismiss any UI for this request */ + @JsonProperty("requestId") String requestId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExternalToolRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ExternalToolRequestedEvent.java new file mode 100644 index 000000000..55ba2c90f --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ExternalToolRequestedEvent.java @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code external_tool.requested} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ExternalToolRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "external_tool.requested"; } + + @JsonProperty("data") + private ExternalToolRequestedEventData data; + + public ExternalToolRequestedEventData getData() { return data; } + public void setData(ExternalToolRequestedEventData data) { this.data = data; } + + /** Data payload for {@link ExternalToolRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ExternalToolRequestedEventData( + /** Unique identifier for this request; used to respond via session.respondToExternalTool() */ + @JsonProperty("requestId") String requestId, + /** Session ID that this external tool request belongs to */ + @JsonProperty("sessionId") String sessionId, + /** Tool call ID assigned to this external tool invocation */ + @JsonProperty("toolCallId") String toolCallId, + /** Name of the external tool to invoke */ + @JsonProperty("toolName") String toolName, + /** Arguments to pass to the external tool */ + @JsonProperty("arguments") Object arguments, + /** W3C Trace Context traceparent header for the execute_tool span */ + @JsonProperty("traceparent") String traceparent, + /** W3C Trace Context tracestate header for the execute_tool span */ + @JsonProperty("tracestate") String tracestate + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java b/src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java new file mode 100644 index 000000000..5b11cff0b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code hook.end} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class HookEndEvent extends SessionEvent { + + @Override + public String getType() { return "hook.end"; } + + @JsonProperty("data") + private HookEndEventData data; + + public HookEndEventData getData() { return data; } + public void setData(HookEndEventData data) { this.data = data; } + + /** Data payload for {@link HookEndEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record HookEndEventData( + /** Identifier matching the corresponding hook.start event */ + @JsonProperty("hookInvocationId") String hookInvocationId, + /** Type of hook that was invoked (e.g., "preToolUse", "postToolUse", "sessionStart") */ + @JsonProperty("hookType") String hookType, + /** Output data produced by the hook */ + @JsonProperty("output") Object output, + /** Whether the hook completed successfully */ + @JsonProperty("success") Boolean success, + /** Error details when the hook failed */ + @JsonProperty("error") HookEndEventDataError error + ) { + + /** Error details when the hook failed */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record HookEndEventDataError( + /** Human-readable error message */ + @JsonProperty("message") String message, + /** Error stack trace, when available */ + @JsonProperty("stack") String stack + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/HookStartEvent.java b/src/generated/java/com/github/copilot/sdk/generated/HookStartEvent.java new file mode 100644 index 000000000..21cee060f --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/HookStartEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code hook.start} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class HookStartEvent extends SessionEvent { + + @Override + public String getType() { return "hook.start"; } + + @JsonProperty("data") + private HookStartEventData data; + + public HookStartEventData getData() { return data; } + public void setData(HookStartEventData data) { this.data = data; } + + /** Data payload for {@link HookStartEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record HookStartEventData( + /** Unique identifier for this hook invocation */ + @JsonProperty("hookInvocationId") String hookInvocationId, + /** Type of hook being invoked (e.g., "preToolUse", "postToolUse", "sessionStart") */ + @JsonProperty("hookType") String hookType, + /** Input data passed to the hook */ + @JsonProperty("input") Object input + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpOauthCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/McpOauthCompletedEvent.java new file mode 100644 index 000000000..4d0521ce3 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/McpOauthCompletedEvent.java @@ -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.sdk.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 {@code mcp.oauth_completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class McpOauthCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "mcp.oauth_completed"; } + + @JsonProperty("data") + private McpOauthCompletedEventData data; + + public McpOauthCompletedEventData getData() { return data; } + public void setData(McpOauthCompletedEventData data) { this.data = data; } + + /** Data payload for {@link McpOauthCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record McpOauthCompletedEventData( + /** Request ID of the resolved OAuth request */ + @JsonProperty("requestId") String requestId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java b/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java new file mode 100644 index 000000000..f64bb5e80 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java @@ -0,0 +1,58 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code mcp.oauth_required} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class McpOauthRequiredEvent extends SessionEvent { + + @Override + public String getType() { return "mcp.oauth_required"; } + + @JsonProperty("data") + private McpOauthRequiredEventData data; + + public McpOauthRequiredEventData getData() { return data; } + public void setData(McpOauthRequiredEventData data) { this.data = data; } + + /** Data payload for {@link McpOauthRequiredEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record McpOauthRequiredEventData( + /** Unique identifier for this OAuth request; used to respond via session.respondToMcpOAuth() */ + @JsonProperty("requestId") String requestId, + /** Display name of the MCP server that requires OAuth */ + @JsonProperty("serverName") String serverName, + /** URL of the MCP server that requires OAuth */ + @JsonProperty("serverUrl") String serverUrl, + /** Static OAuth client configuration, if the server specifies one */ + @JsonProperty("staticClientConfig") McpOauthRequiredEventDataStaticClientConfig staticClientConfig + ) { + + /** Static OAuth client configuration, if the server specifies one */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record McpOauthRequiredEventDataStaticClientConfig( + /** OAuth client ID for the server */ + @JsonProperty("clientId") String clientId, + /** Whether this is a public OAuth client */ + @JsonProperty("publicClient") Boolean publicClient + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/PendingMessagesModifiedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/PendingMessagesModifiedEvent.java new file mode 100644 index 000000000..2f8b4d008 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/PendingMessagesModifiedEvent.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code pending_messages.modified} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class PendingMessagesModifiedEvent extends SessionEvent { + + @Override + public String getType() { return "pending_messages.modified"; } + + @JsonProperty("data") + private PendingMessagesModifiedEventData data; + + public PendingMessagesModifiedEventData getData() { return data; } + public void setData(PendingMessagesModifiedEventData data) { this.data = data; } + + /** Data payload for {@link PendingMessagesModifiedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record PendingMessagesModifiedEventData() { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java new file mode 100644 index 000000000..aa6085288 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java @@ -0,0 +1,80 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code permission.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class PermissionCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "permission.completed"; } + + @JsonProperty("data") + private PermissionCompletedEventData data; + + public PermissionCompletedEventData getData() { return data; } + public void setData(PermissionCompletedEventData data) { this.data = data; } + + /** Data payload for {@link PermissionCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record PermissionCompletedEventData( + /** Request ID of the resolved permission request; clients should dismiss any UI for this request */ + @JsonProperty("requestId") String requestId, + /** The result of the permission request */ + @JsonProperty("result") PermissionCompletedEventDataResult result + ) { + + /** The result of the permission request */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record PermissionCompletedEventDataResult( + /** The outcome of the permission request */ + @JsonProperty("kind") PermissionCompletedEventDataResultKind kind + ) { + + /** The outcome of the permission request */ + public enum PermissionCompletedEventDataResultKind { + /** The {@code approved} variant. */ + APPROVED("approved"), + /** The {@code denied-by-rules} variant. */ + DENIED_BY_RULES("denied-by-rules"), + /** The {@code denied-no-approval-rule-and-could-not-request-from-user} variant. */ + DENIED_NO_APPROVAL_RULE_AND_COULD_NOT_REQUEST_FROM_USER("denied-no-approval-rule-and-could-not-request-from-user"), + /** The {@code denied-interactively-by-user} variant. */ + DENIED_INTERACTIVELY_BY_USER("denied-interactively-by-user"), + /** The {@code denied-by-content-exclusion-policy} variant. */ + DENIED_BY_CONTENT_EXCLUSION_POLICY("denied-by-content-exclusion-policy"), + /** The {@code denied-by-permission-request-hook} variant. */ + DENIED_BY_PERMISSION_REQUEST_HOOK("denied-by-permission-request-hook"); + + private final String value; + PermissionCompletedEventDataResultKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionCompletedEventDataResultKind fromValue(String value) { + for (PermissionCompletedEventDataResultKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionCompletedEventDataResultKind value: " + value); + } + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java new file mode 100644 index 000000000..58ce5815d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code permission.requested} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class PermissionRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "permission.requested"; } + + @JsonProperty("data") + private PermissionRequestedEventData data; + + public PermissionRequestedEventData getData() { return data; } + public void setData(PermissionRequestedEventData data) { this.data = data; } + + /** Data payload for {@link PermissionRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record PermissionRequestedEventData( + /** Unique identifier for this permission request; used to respond via session.respondToPermission() */ + @JsonProperty("requestId") String requestId, + /** Details of the permission being requested */ + @JsonProperty("permissionRequest") Object permissionRequest, + /** When true, this permission was already resolved by a permissionRequest hook and requires no client action */ + @JsonProperty("resolvedByHook") Boolean resolvedByHook + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SamplingCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SamplingCompletedEvent.java new file mode 100644 index 000000000..9fa1f3d5b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SamplingCompletedEvent.java @@ -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.sdk.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 {@code sampling.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SamplingCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "sampling.completed"; } + + @JsonProperty("data") + private SamplingCompletedEventData data; + + public SamplingCompletedEventData getData() { return data; } + public void setData(SamplingCompletedEventData data) { this.data = data; } + + /** Data payload for {@link SamplingCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SamplingCompletedEventData( + /** Request ID of the resolved sampling request; clients should dismiss any UI for this request */ + @JsonProperty("requestId") String requestId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SamplingRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SamplingRequestedEvent.java new file mode 100644 index 000000000..7cf5e562b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SamplingRequestedEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code sampling.requested} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SamplingRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "sampling.requested"; } + + @JsonProperty("data") + private SamplingRequestedEventData data; + + public SamplingRequestedEventData getData() { return data; } + public void setData(SamplingRequestedEventData data) { this.data = data; } + + /** Data payload for {@link SamplingRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SamplingRequestedEventData( + /** Unique identifier for this sampling request; used to respond via session.respondToSampling() */ + @JsonProperty("requestId") String requestId, + /** Name of the MCP server that initiated the sampling request */ + @JsonProperty("serverName") String serverName, + /** The JSON-RPC request ID from the MCP protocol */ + @JsonProperty("mcpRequestId") Object mcpRequestId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionBackgroundTasksChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionBackgroundTasksChangedEvent.java new file mode 100644 index 000000000..e5b9d1fff --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionBackgroundTasksChangedEvent.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.background_tasks_changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionBackgroundTasksChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.background_tasks_changed"; } + + @JsonProperty("data") + private SessionBackgroundTasksChangedEventData data; + + public SessionBackgroundTasksChangedEventData getData() { return data; } + public void setData(SessionBackgroundTasksChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionBackgroundTasksChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionBackgroundTasksChangedEventData() { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java new file mode 100644 index 000000000..0bc3a7935 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java @@ -0,0 +1,82 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.compaction_complete} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCompactionCompleteEvent extends SessionEvent { + + @Override + public String getType() { return "session.compaction_complete"; } + + @JsonProperty("data") + private SessionCompactionCompleteEventData data; + + public SessionCompactionCompleteEventData getData() { return data; } + public void setData(SessionCompactionCompleteEventData data) { this.data = data; } + + /** Data payload for {@link SessionCompactionCompleteEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCompactionCompleteEventData( + /** Whether compaction completed successfully */ + @JsonProperty("success") Boolean success, + /** Error message if compaction failed */ + @JsonProperty("error") String error, + /** Total tokens in conversation before compaction */ + @JsonProperty("preCompactionTokens") Double preCompactionTokens, + /** Total tokens in conversation after compaction */ + @JsonProperty("postCompactionTokens") Double postCompactionTokens, + /** Number of messages before compaction */ + @JsonProperty("preCompactionMessagesLength") Double preCompactionMessagesLength, + /** Number of messages removed during compaction */ + @JsonProperty("messagesRemoved") Double messagesRemoved, + /** Number of tokens removed during compaction */ + @JsonProperty("tokensRemoved") Double tokensRemoved, + /** LLM-generated summary of the compacted conversation history */ + @JsonProperty("summaryContent") String summaryContent, + /** Checkpoint snapshot number created for recovery */ + @JsonProperty("checkpointNumber") Double checkpointNumber, + /** File path where the checkpoint was stored */ + @JsonProperty("checkpointPath") String checkpointPath, + /** Token usage breakdown for the compaction LLM call */ + @JsonProperty("compactionTokensUsed") SessionCompactionCompleteEventDataCompactionTokensUsed compactionTokensUsed, + /** GitHub request tracing ID (x-github-request-id header) for the compaction LLM call */ + @JsonProperty("requestId") String requestId, + /** Token count from system message(s) after compaction */ + @JsonProperty("systemTokens") Double systemTokens, + /** Token count from non-system messages (user, assistant, tool) after compaction */ + @JsonProperty("conversationTokens") Double conversationTokens, + /** Token count from tool definitions after compaction */ + @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens + ) { + + /** Token usage breakdown for the compaction LLM call */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCompactionCompleteEventDataCompactionTokensUsed( + /** Input tokens consumed by the compaction LLM call */ + @JsonProperty("input") Double input, + /** Output tokens produced by the compaction LLM call */ + @JsonProperty("output") Double output, + /** Cached input tokens reused in the compaction LLM call */ + @JsonProperty("cachedInput") Double cachedInput + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionStartEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionStartEvent.java new file mode 100644 index 000000000..71a3c39e3 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionStartEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.compaction_start} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCompactionStartEvent extends SessionEvent { + + @Override + public String getType() { return "session.compaction_start"; } + + @JsonProperty("data") + private SessionCompactionStartEventData data; + + public SessionCompactionStartEventData getData() { return data; } + public void setData(SessionCompactionStartEventData data) { this.data = data; } + + /** Data payload for {@link SessionCompactionStartEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCompactionStartEventData( + /** Token count from system message(s) at compaction start */ + @JsonProperty("systemTokens") Double systemTokens, + /** Token count from non-system messages (user, assistant, tool) at compaction start */ + @JsonProperty("conversationTokens") Double conversationTokens, + /** Token count from tool definitions at compaction start */ + @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java new file mode 100644 index 000000000..e8db49c95 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.context_changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionContextChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.context_changed"; } + + @JsonProperty("data") + private SessionContextChangedEventData data; + + public SessionContextChangedEventData getData() { return data; } + public void setData(SessionContextChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionContextChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionContextChangedEventData( + /** Current working directory path */ + @JsonProperty("cwd") String cwd, + /** Root directory of the git repository, resolved via git rev-parse */ + @JsonProperty("gitRoot") String gitRoot, + /** Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps) */ + @JsonProperty("repository") String repository, + /** Hosting platform type of the repository (github or ado) */ + @JsonProperty("hostType") SessionContextChangedEventDataHostType hostType, + /** Current git branch name */ + @JsonProperty("branch") String branch, + /** Head commit of current git branch at session start time */ + @JsonProperty("headCommit") String headCommit, + /** Base commit of current git branch at session start time */ + @JsonProperty("baseCommit") String baseCommit + ) { + + /** Hosting platform type of the repository (github or ado) */ + public enum SessionContextChangedEventDataHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + SessionContextChangedEventDataHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionContextChangedEventDataHostType fromValue(String value) { + for (SessionContextChangedEventDataHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionContextChangedEventDataHostType value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionCustomAgentsUpdatedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionCustomAgentsUpdatedEvent.java new file mode 100644 index 000000000..14b34eb28 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionCustomAgentsUpdatedEvent.java @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code session.custom_agents_updated} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCustomAgentsUpdatedEvent extends SessionEvent { + + @Override + public String getType() { return "session.custom_agents_updated"; } + + @JsonProperty("data") + private SessionCustomAgentsUpdatedEventData data; + + public SessionCustomAgentsUpdatedEventData getData() { return data; } + public void setData(SessionCustomAgentsUpdatedEventData data) { this.data = data; } + + /** Data payload for {@link SessionCustomAgentsUpdatedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCustomAgentsUpdatedEventData( + /** Array of loaded custom agent metadata */ + @JsonProperty("agents") List agents, + /** Non-fatal warnings from agent loading */ + @JsonProperty("warnings") List warnings, + /** Fatal errors from agent loading */ + @JsonProperty("errors") List errors + ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCustomAgentsUpdatedEventDataAgentsItem( + /** Unique identifier for the agent */ + @JsonProperty("id") String id, + /** Internal name of the agent */ + @JsonProperty("name") String name, + /** Human-readable display name */ + @JsonProperty("displayName") String displayName, + /** Description of what the agent does */ + @JsonProperty("description") String description, + /** Source location: user, project, inherited, remote, or plugin */ + @JsonProperty("source") String source, + /** List of tool names available to this agent */ + @JsonProperty("tools") List tools, + /** Whether the agent can be selected by the user */ + @JsonProperty("userInvocable") Boolean userInvocable, + /** Model override for this agent, if set */ + @JsonProperty("model") String model + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionErrorEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionErrorEvent.java new file mode 100644 index 000000000..57e483282 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionErrorEvent.java @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.error} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionErrorEvent extends SessionEvent { + + @Override + public String getType() { return "session.error"; } + + @JsonProperty("data") + private SessionErrorEventData data; + + public SessionErrorEventData getData() { return data; } + public void setData(SessionErrorEventData data) { this.data = data; } + + /** Data payload for {@link SessionErrorEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionErrorEventData( + /** Category of error (e.g., "authentication", "authorization", "quota", "rate_limit", "context_limit", "query") */ + @JsonProperty("errorType") String errorType, + /** Human-readable error message */ + @JsonProperty("message") String message, + /** Error stack trace, when available */ + @JsonProperty("stack") String stack, + /** HTTP status code from the upstream request, if applicable */ + @JsonProperty("statusCode") Long statusCode, + /** GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs */ + @JsonProperty("providerCallId") String providerCallId, + /** Optional URL associated with this error that the user can open in a browser */ + @JsonProperty("url") String url + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java new file mode 100644 index 000000000..6b456d3b8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java @@ -0,0 +1,213 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.time.OffsetDateTime; +import java.util.UUID; +import javax.annotation.processing.Generated; + +/** + * Base class for all generated session events. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = UnknownSessionEvent.class) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SessionStartEvent.class, name = "session.start"), + @JsonSubTypes.Type(value = SessionResumeEvent.class, name = "session.resume"), + @JsonSubTypes.Type(value = SessionRemoteSteerableChangedEvent.class, name = "session.remote_steerable_changed"), + @JsonSubTypes.Type(value = SessionErrorEvent.class, name = "session.error"), + @JsonSubTypes.Type(value = SessionIdleEvent.class, name = "session.idle"), + @JsonSubTypes.Type(value = SessionTitleChangedEvent.class, name = "session.title_changed"), + @JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"), + @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), + @JsonSubTypes.Type(value = SessionModelChangeEvent.class, name = "session.model_change"), + @JsonSubTypes.Type(value = SessionModeChangedEvent.class, name = "session.mode_changed"), + @JsonSubTypes.Type(value = SessionPlanChangedEvent.class, name = "session.plan_changed"), + @JsonSubTypes.Type(value = SessionWorkspaceFileChangedEvent.class, name = "session.workspace_file_changed"), + @JsonSubTypes.Type(value = SessionHandoffEvent.class, name = "session.handoff"), + @JsonSubTypes.Type(value = SessionTruncationEvent.class, name = "session.truncation"), + @JsonSubTypes.Type(value = SessionSnapshotRewindEvent.class, name = "session.snapshot_rewind"), + @JsonSubTypes.Type(value = SessionShutdownEvent.class, name = "session.shutdown"), + @JsonSubTypes.Type(value = SessionContextChangedEvent.class, name = "session.context_changed"), + @JsonSubTypes.Type(value = SessionUsageInfoEvent.class, name = "session.usage_info"), + @JsonSubTypes.Type(value = SessionCompactionStartEvent.class, name = "session.compaction_start"), + @JsonSubTypes.Type(value = SessionCompactionCompleteEvent.class, name = "session.compaction_complete"), + @JsonSubTypes.Type(value = SessionTaskCompleteEvent.class, name = "session.task_complete"), + @JsonSubTypes.Type(value = UserMessageEvent.class, name = "user.message"), + @JsonSubTypes.Type(value = PendingMessagesModifiedEvent.class, name = "pending_messages.modified"), + @JsonSubTypes.Type(value = AssistantTurnStartEvent.class, name = "assistant.turn_start"), + @JsonSubTypes.Type(value = AssistantIntentEvent.class, name = "assistant.intent"), + @JsonSubTypes.Type(value = AssistantReasoningEvent.class, name = "assistant.reasoning"), + @JsonSubTypes.Type(value = AssistantReasoningDeltaEvent.class, name = "assistant.reasoning_delta"), + @JsonSubTypes.Type(value = AssistantStreamingDeltaEvent.class, name = "assistant.streaming_delta"), + @JsonSubTypes.Type(value = AssistantMessageEvent.class, name = "assistant.message"), + @JsonSubTypes.Type(value = AssistantMessageDeltaEvent.class, name = "assistant.message_delta"), + @JsonSubTypes.Type(value = AssistantTurnEndEvent.class, name = "assistant.turn_end"), + @JsonSubTypes.Type(value = AssistantUsageEvent.class, name = "assistant.usage"), + @JsonSubTypes.Type(value = AbortEvent.class, name = "abort"), + @JsonSubTypes.Type(value = ToolUserRequestedEvent.class, name = "tool.user_requested"), + @JsonSubTypes.Type(value = ToolExecutionStartEvent.class, name = "tool.execution_start"), + @JsonSubTypes.Type(value = ToolExecutionPartialResultEvent.class, name = "tool.execution_partial_result"), + @JsonSubTypes.Type(value = ToolExecutionProgressEvent.class, name = "tool.execution_progress"), + @JsonSubTypes.Type(value = ToolExecutionCompleteEvent.class, name = "tool.execution_complete"), + @JsonSubTypes.Type(value = SkillInvokedEvent.class, name = "skill.invoked"), + @JsonSubTypes.Type(value = SubagentStartedEvent.class, name = "subagent.started"), + @JsonSubTypes.Type(value = SubagentCompletedEvent.class, name = "subagent.completed"), + @JsonSubTypes.Type(value = SubagentFailedEvent.class, name = "subagent.failed"), + @JsonSubTypes.Type(value = SubagentSelectedEvent.class, name = "subagent.selected"), + @JsonSubTypes.Type(value = SubagentDeselectedEvent.class, name = "subagent.deselected"), + @JsonSubTypes.Type(value = HookStartEvent.class, name = "hook.start"), + @JsonSubTypes.Type(value = HookEndEvent.class, name = "hook.end"), + @JsonSubTypes.Type(value = SystemMessageEvent.class, name = "system.message"), + @JsonSubTypes.Type(value = SystemNotificationEvent.class, name = "system.notification"), + @JsonSubTypes.Type(value = PermissionRequestedEvent.class, name = "permission.requested"), + @JsonSubTypes.Type(value = PermissionCompletedEvent.class, name = "permission.completed"), + @JsonSubTypes.Type(value = UserInputRequestedEvent.class, name = "user_input.requested"), + @JsonSubTypes.Type(value = UserInputCompletedEvent.class, name = "user_input.completed"), + @JsonSubTypes.Type(value = ElicitationRequestedEvent.class, name = "elicitation.requested"), + @JsonSubTypes.Type(value = ElicitationCompletedEvent.class, name = "elicitation.completed"), + @JsonSubTypes.Type(value = SamplingRequestedEvent.class, name = "sampling.requested"), + @JsonSubTypes.Type(value = SamplingCompletedEvent.class, name = "sampling.completed"), + @JsonSubTypes.Type(value = McpOauthRequiredEvent.class, name = "mcp.oauth_required"), + @JsonSubTypes.Type(value = McpOauthCompletedEvent.class, name = "mcp.oauth_completed"), + @JsonSubTypes.Type(value = ExternalToolRequestedEvent.class, name = "external_tool.requested"), + @JsonSubTypes.Type(value = ExternalToolCompletedEvent.class, name = "external_tool.completed"), + @JsonSubTypes.Type(value = CommandQueuedEvent.class, name = "command.queued"), + @JsonSubTypes.Type(value = CommandExecuteEvent.class, name = "command.execute"), + @JsonSubTypes.Type(value = CommandCompletedEvent.class, name = "command.completed"), + @JsonSubTypes.Type(value = CommandsChangedEvent.class, name = "commands.changed"), + @JsonSubTypes.Type(value = CapabilitiesChangedEvent.class, name = "capabilities.changed"), + @JsonSubTypes.Type(value = ExitPlanModeRequestedEvent.class, name = "exit_plan_mode.requested"), + @JsonSubTypes.Type(value = ExitPlanModeCompletedEvent.class, name = "exit_plan_mode.completed"), + @JsonSubTypes.Type(value = SessionToolsUpdatedEvent.class, name = "session.tools_updated"), + @JsonSubTypes.Type(value = SessionBackgroundTasksChangedEvent.class, name = "session.background_tasks_changed"), + @JsonSubTypes.Type(value = SessionSkillsLoadedEvent.class, name = "session.skills_loaded"), + @JsonSubTypes.Type(value = SessionCustomAgentsUpdatedEvent.class, name = "session.custom_agents_updated"), + @JsonSubTypes.Type(value = SessionMcpServersLoadedEvent.class, name = "session.mcp_servers_loaded"), + @JsonSubTypes.Type(value = SessionMcpServerStatusChangedEvent.class, name = "session.mcp_server_status_changed"), + @JsonSubTypes.Type(value = SessionExtensionsLoadedEvent.class, name = "session.extensions_loaded") +}) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public abstract sealed class SessionEvent permits + SessionStartEvent, + SessionResumeEvent, + SessionRemoteSteerableChangedEvent, + SessionErrorEvent, + SessionIdleEvent, + SessionTitleChangedEvent, + SessionInfoEvent, + SessionWarningEvent, + SessionModelChangeEvent, + SessionModeChangedEvent, + SessionPlanChangedEvent, + SessionWorkspaceFileChangedEvent, + SessionHandoffEvent, + SessionTruncationEvent, + SessionSnapshotRewindEvent, + SessionShutdownEvent, + SessionContextChangedEvent, + SessionUsageInfoEvent, + SessionCompactionStartEvent, + SessionCompactionCompleteEvent, + SessionTaskCompleteEvent, + UserMessageEvent, + PendingMessagesModifiedEvent, + AssistantTurnStartEvent, + AssistantIntentEvent, + AssistantReasoningEvent, + AssistantReasoningDeltaEvent, + AssistantStreamingDeltaEvent, + AssistantMessageEvent, + AssistantMessageDeltaEvent, + AssistantTurnEndEvent, + AssistantUsageEvent, + AbortEvent, + ToolUserRequestedEvent, + ToolExecutionStartEvent, + ToolExecutionPartialResultEvent, + ToolExecutionProgressEvent, + ToolExecutionCompleteEvent, + SkillInvokedEvent, + SubagentStartedEvent, + SubagentCompletedEvent, + SubagentFailedEvent, + SubagentSelectedEvent, + SubagentDeselectedEvent, + HookStartEvent, + HookEndEvent, + SystemMessageEvent, + SystemNotificationEvent, + PermissionRequestedEvent, + PermissionCompletedEvent, + UserInputRequestedEvent, + UserInputCompletedEvent, + ElicitationRequestedEvent, + ElicitationCompletedEvent, + SamplingRequestedEvent, + SamplingCompletedEvent, + McpOauthRequiredEvent, + McpOauthCompletedEvent, + ExternalToolRequestedEvent, + ExternalToolCompletedEvent, + CommandQueuedEvent, + CommandExecuteEvent, + CommandCompletedEvent, + CommandsChangedEvent, + CapabilitiesChangedEvent, + ExitPlanModeRequestedEvent, + ExitPlanModeCompletedEvent, + SessionToolsUpdatedEvent, + SessionBackgroundTasksChangedEvent, + SessionSkillsLoadedEvent, + SessionCustomAgentsUpdatedEvent, + SessionMcpServersLoadedEvent, + SessionMcpServerStatusChangedEvent, + SessionExtensionsLoadedEvent, + UnknownSessionEvent { + + /** Unique event identifier (UUID v4), generated when the event is emitted. */ + @JsonProperty("id") + private UUID id; + + /** ISO 8601 timestamp when the event was created. */ + @JsonProperty("timestamp") + private OffsetDateTime timestamp; + + /** ID of the chronologically preceding event in the session. Null for the first event. */ + @JsonProperty("parentId") + private UUID parentId; + + /** When true, the event is transient and not persisted to the session event log on disk. */ + @JsonProperty("ephemeral") + private Boolean ephemeral; + + /** + * Returns the event-type discriminator string (e.g., {@code "session.idle"}). + * + * @return the event type + */ + public abstract String getType(); + + public UUID getId() { return id; } + public void setId(UUID id) { this.id = id; } + + public OffsetDateTime getTimestamp() { return timestamp; } + public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; } + + public UUID getParentId() { return parentId; } + public void setParentId(UUID parentId) { this.parentId = parentId; } + + public Boolean getEphemeral() { return ephemeral; } + public void setEphemeral(Boolean ephemeral) { this.ephemeral = ephemeral; } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java new file mode 100644 index 000000000..da571f5f3 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java @@ -0,0 +1,100 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code session.extensions_loaded} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionExtensionsLoadedEvent extends SessionEvent { + + @Override + public String getType() { return "session.extensions_loaded"; } + + @JsonProperty("data") + private SessionExtensionsLoadedEventData data; + + public SessionExtensionsLoadedEventData getData() { return data; } + public void setData(SessionExtensionsLoadedEventData data) { this.data = data; } + + /** Data payload for {@link SessionExtensionsLoadedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionExtensionsLoadedEventData( + /** Array of discovered extensions and their status */ + @JsonProperty("extensions") List extensions + ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionExtensionsLoadedEventDataExtensionsItem( + /** Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper') */ + @JsonProperty("id") String id, + /** Extension name (directory name) */ + @JsonProperty("name") String name, + /** Discovery source */ + @JsonProperty("source") SessionExtensionsLoadedEventDataExtensionsItemSource source, + /** Current status: running, disabled, failed, or starting */ + @JsonProperty("status") SessionExtensionsLoadedEventDataExtensionsItemStatus status + ) { + + /** Discovery source */ + public enum SessionExtensionsLoadedEventDataExtensionsItemSource { + /** The {@code project} variant. */ + PROJECT("project"), + /** The {@code user} variant. */ + USER("user"); + + private final String value; + SessionExtensionsLoadedEventDataExtensionsItemSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionExtensionsLoadedEventDataExtensionsItemSource fromValue(String value) { + for (SessionExtensionsLoadedEventDataExtensionsItemSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionExtensionsLoadedEventDataExtensionsItemSource value: " + value); + } + } + + /** Current status: running, disabled, failed, or starting */ + public enum SessionExtensionsLoadedEventDataExtensionsItemStatus { + /** The {@code running} variant. */ + RUNNING("running"), + /** The {@code disabled} variant. */ + DISABLED("disabled"), + /** The {@code failed} variant. */ + FAILED("failed"), + /** The {@code starting} variant. */ + STARTING("starting"); + + private final String value; + SessionExtensionsLoadedEventDataExtensionsItemStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionExtensionsLoadedEventDataExtensionsItemStatus fromValue(String value) { + for (SessionExtensionsLoadedEventDataExtensionsItemStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionExtensionsLoadedEventDataExtensionsItemStatus value: " + value); + } + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionHandoffEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionHandoffEvent.java new file mode 100644 index 000000000..a9055020d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionHandoffEvent.java @@ -0,0 +1,87 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * The {@code session.handoff} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionHandoffEvent extends SessionEvent { + + @Override + public String getType() { return "session.handoff"; } + + @JsonProperty("data") + private SessionHandoffEventData data; + + public SessionHandoffEventData getData() { return data; } + public void setData(SessionHandoffEventData data) { this.data = data; } + + /** Data payload for {@link SessionHandoffEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionHandoffEventData( + /** ISO 8601 timestamp when the handoff occurred */ + @JsonProperty("handoffTime") OffsetDateTime handoffTime, + /** Origin type of the session being handed off */ + @JsonProperty("sourceType") SessionHandoffEventDataSourceType sourceType, + /** Repository context for the handed-off session */ + @JsonProperty("repository") SessionHandoffEventDataRepository repository, + /** Additional context information for the handoff */ + @JsonProperty("context") String context, + /** Summary of the work done in the source session */ + @JsonProperty("summary") String summary, + /** Session ID of the remote session being handed off */ + @JsonProperty("remoteSessionId") String remoteSessionId, + /** GitHub host URL for the source session (e.g., https://github.com or https://tenant.ghe.com) */ + @JsonProperty("host") String host + ) { + + /** Origin type of the session being handed off */ + public enum SessionHandoffEventDataSourceType { + /** The {@code remote} variant. */ + REMOTE("remote"), + /** The {@code local} variant. */ + LOCAL("local"); + + private final String value; + SessionHandoffEventDataSourceType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionHandoffEventDataSourceType fromValue(String value) { + for (SessionHandoffEventDataSourceType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionHandoffEventDataSourceType value: " + value); + } + } + + /** Repository context for the handed-off session */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionHandoffEventDataRepository( + /** Repository owner (user or organization) */ + @JsonProperty("owner") String owner, + /** Repository name */ + @JsonProperty("name") String name, + /** Git branch name, if applicable */ + @JsonProperty("branch") String branch + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionIdleEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionIdleEvent.java new file mode 100644 index 000000000..e199f9379 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionIdleEvent.java @@ -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.sdk.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 {@code session.idle} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionIdleEvent extends SessionEvent { + + @Override + public String getType() { return "session.idle"; } + + @JsonProperty("data") + private SessionIdleEventData data; + + public SessionIdleEventData getData() { return data; } + public void setData(SessionIdleEventData data) { this.data = data; } + + /** Data payload for {@link SessionIdleEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionIdleEventData( + /** True when the preceding agentic loop was cancelled via abort signal */ + @JsonProperty("aborted") Boolean aborted + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionInfoEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionInfoEvent.java new file mode 100644 index 000000000..0308f7ecf --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionInfoEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.info} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionInfoEvent extends SessionEvent { + + @Override + public String getType() { return "session.info"; } + + @JsonProperty("data") + private SessionInfoEventData data; + + public SessionInfoEventData getData() { return data; } + public void setData(SessionInfoEventData data) { this.data = data; } + + /** Data payload for {@link SessionInfoEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionInfoEventData( + /** Category of informational message (e.g., "notification", "timing", "context_window", "mcp", "snapshot", "configuration", "authentication", "model") */ + @JsonProperty("infoType") String infoType, + /** Human-readable informational message for display in the timeline */ + @JsonProperty("message") String message, + /** Optional URL associated with this message that the user can open in a browser */ + @JsonProperty("url") String url + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java new file mode 100644 index 000000000..af0415272 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java @@ -0,0 +1,71 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.mcp_server_status_changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpServerStatusChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.mcp_server_status_changed"; } + + @JsonProperty("data") + private SessionMcpServerStatusChangedEventData data; + + public SessionMcpServerStatusChangedEventData getData() { return data; } + public void setData(SessionMcpServerStatusChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionMcpServerStatusChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMcpServerStatusChangedEventData( + /** Name of the MCP server whose status changed */ + @JsonProperty("serverName") String serverName, + /** New connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + @JsonProperty("status") SessionMcpServerStatusChangedEventDataStatus status + ) { + + /** New connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + public enum SessionMcpServerStatusChangedEventDataStatus { + /** The {@code connected} variant. */ + CONNECTED("connected"), + /** The {@code failed} variant. */ + FAILED("failed"), + /** The {@code needs-auth} variant. */ + NEEDS_AUTH("needs-auth"), + /** The {@code pending} variant. */ + PENDING("pending"), + /** The {@code disabled} variant. */ + DISABLED("disabled"), + /** The {@code not_configured} variant. */ + NOT_CONFIGURED("not_configured"); + + private final String value; + SessionMcpServerStatusChangedEventDataStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionMcpServerStatusChangedEventDataStatus fromValue(String value) { + for (SessionMcpServerStatusChangedEventDataStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionMcpServerStatusChangedEventDataStatus value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServersLoadedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServersLoadedEvent.java new file mode 100644 index 000000000..16a6b3716 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServersLoadedEvent.java @@ -0,0 +1,84 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code session.mcp_servers_loaded} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpServersLoadedEvent extends SessionEvent { + + @Override + public String getType() { return "session.mcp_servers_loaded"; } + + @JsonProperty("data") + private SessionMcpServersLoadedEventData data; + + public SessionMcpServersLoadedEventData getData() { return data; } + public void setData(SessionMcpServersLoadedEventData data) { this.data = data; } + + /** Data payload for {@link SessionMcpServersLoadedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMcpServersLoadedEventData( + /** Array of MCP server status summaries */ + @JsonProperty("servers") List servers + ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMcpServersLoadedEventDataServersItem( + /** Server name (config key) */ + @JsonProperty("name") String name, + /** Connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + @JsonProperty("status") SessionMcpServersLoadedEventDataServersItemStatus status, + /** Configuration source: user, workspace, plugin, or builtin */ + @JsonProperty("source") String source, + /** Error message if the server failed to connect */ + @JsonProperty("error") String error + ) { + + /** Connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + public enum SessionMcpServersLoadedEventDataServersItemStatus { + /** The {@code connected} variant. */ + CONNECTED("connected"), + /** The {@code failed} variant. */ + FAILED("failed"), + /** The {@code needs-auth} variant. */ + NEEDS_AUTH("needs-auth"), + /** The {@code pending} variant. */ + PENDING("pending"), + /** The {@code disabled} variant. */ + DISABLED("disabled"), + /** The {@code not_configured} variant. */ + NOT_CONFIGURED("not_configured"); + + private final String value; + SessionMcpServersLoadedEventDataServersItemStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionMcpServersLoadedEventDataServersItemStatus fromValue(String value) { + for (SessionMcpServersLoadedEventDataServersItemStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionMcpServersLoadedEventDataServersItemStatus value: " + value); + } + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionModeChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionModeChangedEvent.java new file mode 100644 index 000000000..d7896675f --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionModeChangedEvent.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.sdk.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 {@code session.mode_changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionModeChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.mode_changed"; } + + @JsonProperty("data") + private SessionModeChangedEventData data; + + public SessionModeChangedEventData getData() { return data; } + public void setData(SessionModeChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionModeChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionModeChangedEventData( + /** Agent mode before the change (e.g., "interactive", "plan", "autopilot") */ + @JsonProperty("previousMode") String previousMode, + /** Agent mode after the change (e.g., "interactive", "plan", "autopilot") */ + @JsonProperty("newMode") String newMode + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionModelChangeEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionModelChangeEvent.java new file mode 100644 index 000000000..fff9e21ac --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionModelChangeEvent.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.model_change} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionModelChangeEvent extends SessionEvent { + + @Override + public String getType() { return "session.model_change"; } + + @JsonProperty("data") + private SessionModelChangeEventData data; + + public SessionModelChangeEventData getData() { return data; } + public void setData(SessionModelChangeEventData data) { this.data = data; } + + /** Data payload for {@link SessionModelChangeEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionModelChangeEventData( + /** Model that was previously selected, if any */ + @JsonProperty("previousModel") String previousModel, + /** Newly selected model identifier */ + @JsonProperty("newModel") String newModel, + /** Reasoning effort level before the model change, if applicable */ + @JsonProperty("previousReasoningEffort") String previousReasoningEffort, + /** Reasoning effort level after the model change, if applicable */ + @JsonProperty("reasoningEffort") String reasoningEffort + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java new file mode 100644 index 000000000..c17d75ab9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.plan_changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionPlanChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.plan_changed"; } + + @JsonProperty("data") + private SessionPlanChangedEventData data; + + public SessionPlanChangedEventData getData() { return data; } + public void setData(SessionPlanChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionPlanChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionPlanChangedEventData( + /** The type of operation performed on the plan file */ + @JsonProperty("operation") SessionPlanChangedEventDataOperation operation + ) { + + /** The type of operation performed on the plan file */ + public enum SessionPlanChangedEventDataOperation { + /** The {@code create} variant. */ + CREATE("create"), + /** The {@code update} variant. */ + UPDATE("update"), + /** The {@code delete} variant. */ + DELETE("delete"); + + private final String value; + SessionPlanChangedEventDataOperation(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionPlanChangedEventDataOperation fromValue(String value) { + for (SessionPlanChangedEventDataOperation v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionPlanChangedEventDataOperation value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionRemoteSteerableChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionRemoteSteerableChangedEvent.java new file mode 100644 index 000000000..f1bcc29c0 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionRemoteSteerableChangedEvent.java @@ -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.sdk.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 {@code session.remote_steerable_changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionRemoteSteerableChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.remote_steerable_changed"; } + + @JsonProperty("data") + private SessionRemoteSteerableChangedEventData data; + + public SessionRemoteSteerableChangedEventData getData() { return data; } + public void setData(SessionRemoteSteerableChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionRemoteSteerableChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionRemoteSteerableChangedEventData( + /** Whether this session now supports remote steering via Mission Control */ + @JsonProperty("remoteSteerable") Boolean remoteSteerable + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java new file mode 100644 index 000000000..de93ccca9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java @@ -0,0 +1,95 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * The {@code session.resume} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionResumeEvent extends SessionEvent { + + @Override + public String getType() { return "session.resume"; } + + @JsonProperty("data") + private SessionResumeEventData data; + + public SessionResumeEventData getData() { return data; } + public void setData(SessionResumeEventData data) { this.data = data; } + + /** Data payload for {@link SessionResumeEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionResumeEventData( + /** ISO 8601 timestamp when the session was resumed */ + @JsonProperty("resumeTime") OffsetDateTime resumeTime, + /** Total number of persisted events in the session at the time of resume */ + @JsonProperty("eventCount") Double eventCount, + /** Model currently selected at resume time */ + @JsonProperty("selectedModel") String selectedModel, + /** Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh") */ + @JsonProperty("reasoningEffort") String reasoningEffort, + /** Updated working directory and git context at resume time */ + @JsonProperty("context") SessionResumeEventDataContext context, + /** Whether the session was already in use by another client at resume time */ + @JsonProperty("alreadyInUse") Boolean alreadyInUse, + /** Whether this session supports remote steering via Mission Control */ + @JsonProperty("remoteSteerable") Boolean remoteSteerable + ) { + + /** Updated working directory and git context at resume time */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionResumeEventDataContext( + /** Current working directory path */ + @JsonProperty("cwd") String cwd, + /** Root directory of the git repository, resolved via git rev-parse */ + @JsonProperty("gitRoot") String gitRoot, + /** Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps) */ + @JsonProperty("repository") String repository, + /** Hosting platform type of the repository (github or ado) */ + @JsonProperty("hostType") SessionResumeEventDataContextHostType hostType, + /** Current git branch name */ + @JsonProperty("branch") String branch, + /** Head commit of current git branch at session start time */ + @JsonProperty("headCommit") String headCommit, + /** Base commit of current git branch at session start time */ + @JsonProperty("baseCommit") String baseCommit + ) { + + /** Hosting platform type of the repository (github or ado) */ + public enum SessionResumeEventDataContextHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + SessionResumeEventDataContextHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionResumeEventDataContextHostType fromValue(String value) { + for (SessionResumeEventDataContextHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionResumeEventDataContextHostType value: " + value); + } + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionShutdownEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionShutdownEvent.java new file mode 100644 index 000000000..849cf91c9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionShutdownEvent.java @@ -0,0 +1,136 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code session.shutdown} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionShutdownEvent extends SessionEvent { + + @Override + public String getType() { return "session.shutdown"; } + + @JsonProperty("data") + private SessionShutdownEventData data; + + public SessionShutdownEventData getData() { return data; } + public void setData(SessionShutdownEventData data) { this.data = data; } + + /** Data payload for {@link SessionShutdownEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionShutdownEventData( + /** Whether the session ended normally ("routine") or due to a crash/fatal error ("error") */ + @JsonProperty("shutdownType") SessionShutdownEventDataShutdownType shutdownType, + /** Error description when shutdownType is "error" */ + @JsonProperty("errorReason") String errorReason, + /** Total number of premium API requests used during the session */ + @JsonProperty("totalPremiumRequests") Double totalPremiumRequests, + /** Cumulative time spent in API calls during the session, in milliseconds */ + @JsonProperty("totalApiDurationMs") Double totalApiDurationMs, + /** Unix timestamp (milliseconds) when the session started */ + @JsonProperty("sessionStartTime") Double sessionStartTime, + /** Aggregate code change metrics for the session */ + @JsonProperty("codeChanges") SessionShutdownEventDataCodeChanges codeChanges, + /** Per-model usage breakdown, keyed by model identifier */ + @JsonProperty("modelMetrics") Map modelMetrics, + /** Model that was selected at the time of shutdown */ + @JsonProperty("currentModel") String currentModel, + /** Total tokens in context window at shutdown */ + @JsonProperty("currentTokens") Double currentTokens, + /** System message token count at shutdown */ + @JsonProperty("systemTokens") Double systemTokens, + /** Non-system message token count at shutdown */ + @JsonProperty("conversationTokens") Double conversationTokens, + /** Tool definitions token count at shutdown */ + @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens + ) { + + /** Whether the session ended normally ("routine") or due to a crash/fatal error ("error") */ + public enum SessionShutdownEventDataShutdownType { + /** The {@code routine} variant. */ + ROUTINE("routine"), + /** The {@code error} variant. */ + ERROR("error"); + + private final String value; + SessionShutdownEventDataShutdownType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionShutdownEventDataShutdownType fromValue(String value) { + for (SessionShutdownEventDataShutdownType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionShutdownEventDataShutdownType value: " + value); + } + } + + /** Aggregate code change metrics for the session */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionShutdownEventDataCodeChanges( + /** Total number of lines added during the session */ + @JsonProperty("linesAdded") Double linesAdded, + /** Total number of lines removed during the session */ + @JsonProperty("linesRemoved") Double linesRemoved, + /** List of file paths that were modified during the session */ + @JsonProperty("filesModified") List filesModified + ) { + } + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionShutdownEventDataModelMetricsValue( + /** Request count and cost metrics */ + @JsonProperty("requests") SessionShutdownEventDataModelMetricsValueRequests requests, + /** Token usage breakdown */ + @JsonProperty("usage") SessionShutdownEventDataModelMetricsValueUsage usage + ) { + + /** Request count and cost metrics */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionShutdownEventDataModelMetricsValueRequests( + /** Total number of API requests made to this model */ + @JsonProperty("count") Double count, + /** Cumulative cost multiplier for requests to this model */ + @JsonProperty("cost") Double cost + ) { + } + + /** Token usage breakdown */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionShutdownEventDataModelMetricsValueUsage( + /** Total input tokens consumed across all requests to this model */ + @JsonProperty("inputTokens") Double inputTokens, + /** Total output tokens produced across all requests to this model */ + @JsonProperty("outputTokens") Double outputTokens, + /** Total tokens read from prompt cache across all requests */ + @JsonProperty("cacheReadTokens") Double cacheReadTokens, + /** Total tokens written to prompt cache across all requests */ + @JsonProperty("cacheWriteTokens") Double cacheWriteTokens, + /** Total reasoning tokens produced across all requests to this model */ + @JsonProperty("reasoningTokens") Double reasoningTokens + ) { + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionSkillsLoadedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionSkillsLoadedEvent.java new file mode 100644 index 000000000..e7567588d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionSkillsLoadedEvent.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code session.skills_loaded} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionSkillsLoadedEvent extends SessionEvent { + + @Override + public String getType() { return "session.skills_loaded"; } + + @JsonProperty("data") + private SessionSkillsLoadedEventData data; + + public SessionSkillsLoadedEventData getData() { return data; } + public void setData(SessionSkillsLoadedEventData data) { this.data = data; } + + /** Data payload for {@link SessionSkillsLoadedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionSkillsLoadedEventData( + /** Array of resolved skill metadata */ + @JsonProperty("skills") List skills + ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionSkillsLoadedEventDataSkillsItem( + /** Unique identifier for the skill */ + @JsonProperty("name") String name, + /** Description of what the skill does */ + @JsonProperty("description") String description, + /** Source location type of the skill (e.g., project, personal, plugin) */ + @JsonProperty("source") String source, + /** Whether the skill can be invoked by the user as a slash command */ + @JsonProperty("userInvocable") Boolean userInvocable, + /** Whether the skill is currently enabled */ + @JsonProperty("enabled") Boolean enabled, + /** Absolute path to the skill file, if available */ + @JsonProperty("path") String path + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionSnapshotRewindEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionSnapshotRewindEvent.java new file mode 100644 index 000000000..b3ce26f66 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionSnapshotRewindEvent.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.sdk.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 {@code session.snapshot_rewind} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionSnapshotRewindEvent extends SessionEvent { + + @Override + public String getType() { return "session.snapshot_rewind"; } + + @JsonProperty("data") + private SessionSnapshotRewindEventData data; + + public SessionSnapshotRewindEventData getData() { return data; } + public void setData(SessionSnapshotRewindEventData data) { this.data = data; } + + /** Data payload for {@link SessionSnapshotRewindEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionSnapshotRewindEventData( + /** Event ID that was rewound to; this event and all after it were removed */ + @JsonProperty("upToEventId") String upToEventId, + /** Number of events that were removed by the rewind */ + @JsonProperty("eventsRemoved") Double eventsRemoved + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java new file mode 100644 index 000000000..348c00f60 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java @@ -0,0 +1,101 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * The {@code session.start} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionStartEvent extends SessionEvent { + + @Override + public String getType() { return "session.start"; } + + @JsonProperty("data") + private SessionStartEventData data; + + public SessionStartEventData getData() { return data; } + public void setData(SessionStartEventData data) { this.data = data; } + + /** Data payload for {@link SessionStartEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionStartEventData( + /** Unique identifier for the session */ + @JsonProperty("sessionId") String sessionId, + /** Schema version number for the session event format */ + @JsonProperty("version") Double version, + /** Identifier of the software producing the events (e.g., "copilot-agent") */ + @JsonProperty("producer") String producer, + /** Version string of the Copilot application */ + @JsonProperty("copilotVersion") String copilotVersion, + /** ISO 8601 timestamp when the session was created */ + @JsonProperty("startTime") OffsetDateTime startTime, + /** Model selected at session creation time, if any */ + @JsonProperty("selectedModel") String selectedModel, + /** Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh") */ + @JsonProperty("reasoningEffort") String reasoningEffort, + /** Working directory and git context at session start */ + @JsonProperty("context") SessionStartEventDataContext context, + /** Whether the session was already in use by another client at start time */ + @JsonProperty("alreadyInUse") Boolean alreadyInUse, + /** Whether this session supports remote steering via Mission Control */ + @JsonProperty("remoteSteerable") Boolean remoteSteerable + ) { + + /** Working directory and git context at session start */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionStartEventDataContext( + /** Current working directory path */ + @JsonProperty("cwd") String cwd, + /** Root directory of the git repository, resolved via git rev-parse */ + @JsonProperty("gitRoot") String gitRoot, + /** Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps) */ + @JsonProperty("repository") String repository, + /** Hosting platform type of the repository (github or ado) */ + @JsonProperty("hostType") SessionStartEventDataContextHostType hostType, + /** Current git branch name */ + @JsonProperty("branch") String branch, + /** Head commit of current git branch at session start time */ + @JsonProperty("headCommit") String headCommit, + /** Base commit of current git branch at session start time */ + @JsonProperty("baseCommit") String baseCommit + ) { + + /** Hosting platform type of the repository (github or ado) */ + public enum SessionStartEventDataContextHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + SessionStartEventDataContextHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionStartEventDataContextHostType fromValue(String value) { + for (SessionStartEventDataContextHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionStartEventDataContextHostType value: " + value); + } + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionTaskCompleteEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionTaskCompleteEvent.java new file mode 100644 index 000000000..bcd2b4d47 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionTaskCompleteEvent.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.sdk.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 {@code session.task_complete} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionTaskCompleteEvent extends SessionEvent { + + @Override + public String getType() { return "session.task_complete"; } + + @JsonProperty("data") + private SessionTaskCompleteEventData data; + + public SessionTaskCompleteEventData getData() { return data; } + public void setData(SessionTaskCompleteEventData data) { this.data = data; } + + /** Data payload for {@link SessionTaskCompleteEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionTaskCompleteEventData( + /** Summary of the completed task, provided by the agent */ + @JsonProperty("summary") String summary, + /** Whether the tool call succeeded. False when validation failed (e.g., invalid arguments) */ + @JsonProperty("success") Boolean success + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionTitleChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionTitleChangedEvent.java new file mode 100644 index 000000000..dee8412cb --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionTitleChangedEvent.java @@ -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.sdk.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 {@code session.title_changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionTitleChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.title_changed"; } + + @JsonProperty("data") + private SessionTitleChangedEventData data; + + public SessionTitleChangedEventData getData() { return data; } + public void setData(SessionTitleChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionTitleChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionTitleChangedEventData( + /** The new display title for the session */ + @JsonProperty("title") String title + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionToolsUpdatedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionToolsUpdatedEvent.java new file mode 100644 index 000000000..38156d138 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionToolsUpdatedEvent.java @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.tools_updated} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionToolsUpdatedEvent extends SessionEvent { + + @Override + public String getType() { return "session.tools_updated"; } + + @JsonProperty("data") + private SessionToolsUpdatedEventData data; + + public SessionToolsUpdatedEventData getData() { return data; } + public void setData(SessionToolsUpdatedEventData data) { this.data = data; } + + /** Data payload for {@link SessionToolsUpdatedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionToolsUpdatedEventData( + @JsonProperty("model") String model + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionTruncationEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionTruncationEvent.java new file mode 100644 index 000000000..7bb5b3f24 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionTruncationEvent.java @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.truncation} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionTruncationEvent extends SessionEvent { + + @Override + public String getType() { return "session.truncation"; } + + @JsonProperty("data") + private SessionTruncationEventData data; + + public SessionTruncationEventData getData() { return data; } + public void setData(SessionTruncationEventData data) { this.data = data; } + + /** Data payload for {@link SessionTruncationEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionTruncationEventData( + /** Maximum token count for the model's context window */ + @JsonProperty("tokenLimit") Double tokenLimit, + /** Total tokens in conversation messages before truncation */ + @JsonProperty("preTruncationTokensInMessages") Double preTruncationTokensInMessages, + /** Number of conversation messages before truncation */ + @JsonProperty("preTruncationMessagesLength") Double preTruncationMessagesLength, + /** Total tokens in conversation messages after truncation */ + @JsonProperty("postTruncationTokensInMessages") Double postTruncationTokensInMessages, + /** Number of conversation messages after truncation */ + @JsonProperty("postTruncationMessagesLength") Double postTruncationMessagesLength, + /** Number of tokens removed by truncation */ + @JsonProperty("tokensRemovedDuringTruncation") Double tokensRemovedDuringTruncation, + /** Number of messages removed by truncation */ + @JsonProperty("messagesRemovedDuringTruncation") Double messagesRemovedDuringTruncation, + /** Identifier of the component that performed truncation (e.g., "BasicTruncator") */ + @JsonProperty("performedBy") String performedBy + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionUsageInfoEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionUsageInfoEvent.java new file mode 100644 index 000000000..a8ae4082e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionUsageInfoEvent.java @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.usage_info} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionUsageInfoEvent extends SessionEvent { + + @Override + public String getType() { return "session.usage_info"; } + + @JsonProperty("data") + private SessionUsageInfoEventData data; + + public SessionUsageInfoEventData getData() { return data; } + public void setData(SessionUsageInfoEventData data) { this.data = data; } + + /** Data payload for {@link SessionUsageInfoEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionUsageInfoEventData( + /** Maximum token count for the model's context window */ + @JsonProperty("tokenLimit") Double tokenLimit, + /** Current number of tokens in the context window */ + @JsonProperty("currentTokens") Double currentTokens, + /** Current number of messages in the conversation */ + @JsonProperty("messagesLength") Double messagesLength, + /** Token count from system message(s) */ + @JsonProperty("systemTokens") Double systemTokens, + /** Token count from non-system messages (user, assistant, tool) */ + @JsonProperty("conversationTokens") Double conversationTokens, + /** Token count from tool definitions */ + @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens, + /** Whether this is the first usage_info event emitted in this session */ + @JsonProperty("isInitial") Boolean isInitial + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionWarningEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionWarningEvent.java new file mode 100644 index 000000000..8e3b59baa --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionWarningEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.warning} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionWarningEvent extends SessionEvent { + + @Override + public String getType() { return "session.warning"; } + + @JsonProperty("data") + private SessionWarningEventData data; + + public SessionWarningEventData getData() { return data; } + public void setData(SessionWarningEventData data) { this.data = data; } + + /** Data payload for {@link SessionWarningEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionWarningEventData( + /** Category of warning (e.g., "subscription", "policy", "mcp") */ + @JsonProperty("warningType") String warningType, + /** Human-readable warning message for display in the timeline */ + @JsonProperty("message") String message, + /** Optional URL associated with this warning that the user can open in a browser */ + @JsonProperty("url") String url + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java new file mode 100644 index 000000000..d2e7075ea --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code session.workspace_file_changed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionWorkspaceFileChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.workspace_file_changed"; } + + @JsonProperty("data") + private SessionWorkspaceFileChangedEventData data; + + public SessionWorkspaceFileChangedEventData getData() { return data; } + public void setData(SessionWorkspaceFileChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionWorkspaceFileChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionWorkspaceFileChangedEventData( + /** Relative path within the session workspace files directory */ + @JsonProperty("path") String path, + /** Whether the file was newly created or updated */ + @JsonProperty("operation") SessionWorkspaceFileChangedEventDataOperation operation + ) { + + /** Whether the file was newly created or updated */ + public enum SessionWorkspaceFileChangedEventDataOperation { + /** The {@code create} variant. */ + CREATE("create"), + /** The {@code update} variant. */ + UPDATE("update"); + + private final String value; + SessionWorkspaceFileChangedEventDataOperation(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionWorkspaceFileChangedEventDataOperation fromValue(String value) { + for (SessionWorkspaceFileChangedEventDataOperation v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionWorkspaceFileChangedEventDataOperation value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SkillInvokedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SkillInvokedEvent.java new file mode 100644 index 000000000..e86e51897 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SkillInvokedEvent.java @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code skill.invoked} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SkillInvokedEvent extends SessionEvent { + + @Override + public String getType() { return "skill.invoked"; } + + @JsonProperty("data") + private SkillInvokedEventData data; + + public SkillInvokedEventData getData() { return data; } + public void setData(SkillInvokedEventData data) { this.data = data; } + + /** Data payload for {@link SkillInvokedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SkillInvokedEventData( + /** Name of the invoked skill */ + @JsonProperty("name") String name, + /** File path to the SKILL.md definition */ + @JsonProperty("path") String path, + /** Full content of the skill file, injected into the conversation for the model */ + @JsonProperty("content") String content, + /** Tool names that should be auto-approved when this skill is active */ + @JsonProperty("allowedTools") List allowedTools, + /** Name of the plugin this skill originated from, when applicable */ + @JsonProperty("pluginName") String pluginName, + /** Version of the plugin this skill originated from, when applicable */ + @JsonProperty("pluginVersion") String pluginVersion, + /** Description of the skill from its SKILL.md frontmatter */ + @JsonProperty("description") String description + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SubagentCompletedEvent.java new file mode 100644 index 000000000..323507c1b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SubagentCompletedEvent.java @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code subagent.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SubagentCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "subagent.completed"; } + + @JsonProperty("data") + private SubagentCompletedEventData data; + + public SubagentCompletedEventData getData() { return data; } + public void setData(SubagentCompletedEventData data) { this.data = data; } + + /** Data payload for {@link SubagentCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SubagentCompletedEventData( + /** Tool call ID of the parent tool invocation that spawned this sub-agent */ + @JsonProperty("toolCallId") String toolCallId, + /** Internal name of the sub-agent */ + @JsonProperty("agentName") String agentName, + /** Human-readable display name of the sub-agent */ + @JsonProperty("agentDisplayName") String agentDisplayName, + /** Model used by the sub-agent */ + @JsonProperty("model") String model, + /** Total number of tool calls made by the sub-agent */ + @JsonProperty("totalToolCalls") Double totalToolCalls, + /** Total tokens (input + output) consumed by the sub-agent */ + @JsonProperty("totalTokens") Double totalTokens, + /** Wall-clock duration of the sub-agent execution in milliseconds */ + @JsonProperty("durationMs") Double durationMs + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentDeselectedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SubagentDeselectedEvent.java new file mode 100644 index 000000000..92edef70f --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SubagentDeselectedEvent.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code subagent.deselected} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SubagentDeselectedEvent extends SessionEvent { + + @Override + public String getType() { return "subagent.deselected"; } + + @JsonProperty("data") + private SubagentDeselectedEventData data; + + public SubagentDeselectedEventData getData() { return data; } + public void setData(SubagentDeselectedEventData data) { this.data = data; } + + /** Data payload for {@link SubagentDeselectedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SubagentDeselectedEventData() { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentFailedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SubagentFailedEvent.java new file mode 100644 index 000000000..6b816704c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SubagentFailedEvent.java @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code subagent.failed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SubagentFailedEvent extends SessionEvent { + + @Override + public String getType() { return "subagent.failed"; } + + @JsonProperty("data") + private SubagentFailedEventData data; + + public SubagentFailedEventData getData() { return data; } + public void setData(SubagentFailedEventData data) { this.data = data; } + + /** Data payload for {@link SubagentFailedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SubagentFailedEventData( + /** Tool call ID of the parent tool invocation that spawned this sub-agent */ + @JsonProperty("toolCallId") String toolCallId, + /** Internal name of the sub-agent */ + @JsonProperty("agentName") String agentName, + /** Human-readable display name of the sub-agent */ + @JsonProperty("agentDisplayName") String agentDisplayName, + /** Error message describing why the sub-agent failed */ + @JsonProperty("error") String error, + /** Model used by the sub-agent (if any model calls succeeded before failure) */ + @JsonProperty("model") String model, + /** Total number of tool calls made before the sub-agent failed */ + @JsonProperty("totalToolCalls") Double totalToolCalls, + /** Total tokens (input + output) consumed before the sub-agent failed */ + @JsonProperty("totalTokens") Double totalTokens, + /** Wall-clock duration of the sub-agent execution in milliseconds */ + @JsonProperty("durationMs") Double durationMs + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentSelectedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SubagentSelectedEvent.java new file mode 100644 index 000000000..0c1d0eed4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SubagentSelectedEvent.java @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code subagent.selected} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SubagentSelectedEvent extends SessionEvent { + + @Override + public String getType() { return "subagent.selected"; } + + @JsonProperty("data") + private SubagentSelectedEventData data; + + public SubagentSelectedEventData getData() { return data; } + public void setData(SubagentSelectedEventData data) { this.data = data; } + + /** Data payload for {@link SubagentSelectedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SubagentSelectedEventData( + /** Internal name of the selected custom agent */ + @JsonProperty("agentName") String agentName, + /** Human-readable display name of the selected custom agent */ + @JsonProperty("agentDisplayName") String agentDisplayName, + /** List of tool names available to this agent, or null for all tools */ + @JsonProperty("tools") List tools + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentStartedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SubagentStartedEvent.java new file mode 100644 index 000000000..b444ae114 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SubagentStartedEvent.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code subagent.started} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SubagentStartedEvent extends SessionEvent { + + @Override + public String getType() { return "subagent.started"; } + + @JsonProperty("data") + private SubagentStartedEventData data; + + public SubagentStartedEventData getData() { return data; } + public void setData(SubagentStartedEventData data) { this.data = data; } + + /** Data payload for {@link SubagentStartedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SubagentStartedEventData( + /** Tool call ID of the parent tool invocation that spawned this sub-agent */ + @JsonProperty("toolCallId") String toolCallId, + /** Internal name of the sub-agent */ + @JsonProperty("agentName") String agentName, + /** Human-readable display name of the sub-agent */ + @JsonProperty("agentDisplayName") String agentDisplayName, + /** Description of what the sub-agent does */ + @JsonProperty("agentDescription") String agentDescription + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java new file mode 100644 index 000000000..0df5b8a60 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java @@ -0,0 +1,79 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code system.message} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SystemMessageEvent extends SessionEvent { + + @Override + public String getType() { return "system.message"; } + + @JsonProperty("data") + private SystemMessageEventData data; + + public SystemMessageEventData getData() { return data; } + public void setData(SystemMessageEventData data) { this.data = data; } + + /** Data payload for {@link SystemMessageEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SystemMessageEventData( + /** The system or developer prompt text */ + @JsonProperty("content") String content, + /** Message role: "system" for system prompts, "developer" for developer-injected instructions */ + @JsonProperty("role") SystemMessageEventDataRole role, + /** Optional name identifier for the message source */ + @JsonProperty("name") String name, + /** Metadata about the prompt template and its construction */ + @JsonProperty("metadata") SystemMessageEventDataMetadata metadata + ) { + + /** Message role: "system" for system prompts, "developer" for developer-injected instructions */ + public enum SystemMessageEventDataRole { + /** The {@code system} variant. */ + SYSTEM("system"), + /** The {@code developer} variant. */ + DEVELOPER("developer"); + + private final String value; + SystemMessageEventDataRole(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SystemMessageEventDataRole fromValue(String value) { + for (SystemMessageEventDataRole v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SystemMessageEventDataRole value: " + value); + } + } + + /** Metadata about the prompt template and its construction */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SystemMessageEventDataMetadata( + /** Version identifier of the prompt template used */ + @JsonProperty("promptVersion") String promptVersion, + /** Template variables used when constructing the prompt */ + @JsonProperty("variables") Map variables + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SystemNotificationEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SystemNotificationEvent.java new file mode 100644 index 000000000..d599cd3ba --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SystemNotificationEvent.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.sdk.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 {@code system.notification} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SystemNotificationEvent extends SessionEvent { + + @Override + public String getType() { return "system.notification"; } + + @JsonProperty("data") + private SystemNotificationEventData data; + + public SystemNotificationEventData getData() { return data; } + public void setData(SystemNotificationEventData data) { this.data = data; } + + /** Data payload for {@link SystemNotificationEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SystemNotificationEventData( + /** The notification text, typically wrapped in XML tags */ + @JsonProperty("content") String content, + /** Structured metadata identifying what triggered this notification */ + @JsonProperty("kind") Object kind + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java new file mode 100644 index 000000000..f8a9c89aa --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code tool.execution_complete} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ToolExecutionCompleteEvent extends SessionEvent { + + @Override + public String getType() { return "tool.execution_complete"; } + + @JsonProperty("data") + private ToolExecutionCompleteEventData data; + + public ToolExecutionCompleteEventData getData() { return data; } + public void setData(ToolExecutionCompleteEventData data) { this.data = data; } + + /** Data payload for {@link ToolExecutionCompleteEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ToolExecutionCompleteEventData( + /** Unique identifier for the completed tool call */ + @JsonProperty("toolCallId") String toolCallId, + /** Whether the tool execution completed successfully */ + @JsonProperty("success") Boolean success, + /** Model identifier that generated this tool call */ + @JsonProperty("model") String model, + /** CAPI interaction ID for correlating this tool execution with upstream telemetry */ + @JsonProperty("interactionId") String interactionId, + /** Whether this tool call was explicitly requested by the user rather than the assistant */ + @JsonProperty("isUserRequested") Boolean isUserRequested, + /** Tool execution result on success */ + @JsonProperty("result") ToolExecutionCompleteEventDataResult result, + /** Error details when the tool execution failed */ + @JsonProperty("error") ToolExecutionCompleteEventDataError error, + /** Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts) */ + @JsonProperty("toolTelemetry") Map toolTelemetry, + /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ + @JsonProperty("parentToolCallId") String parentToolCallId + ) { + + /** Tool execution result on success */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ToolExecutionCompleteEventDataResult( + /** Concise tool result text sent to the LLM for chat completion, potentially truncated for token efficiency */ + @JsonProperty("content") String content, + /** Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent. */ + @JsonProperty("detailedContent") String detailedContent, + /** Structured content blocks (text, images, audio, resources) returned by the tool in their native format */ + @JsonProperty("contents") List contents + ) { + } + + /** Error details when the tool execution failed */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ToolExecutionCompleteEventDataError( + /** Human-readable error message */ + @JsonProperty("message") String message, + /** Machine-readable error code */ + @JsonProperty("code") String code + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionPartialResultEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionPartialResultEvent.java new file mode 100644 index 000000000..d76cfcd97 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionPartialResultEvent.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.sdk.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 {@code tool.execution_partial_result} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ToolExecutionPartialResultEvent extends SessionEvent { + + @Override + public String getType() { return "tool.execution_partial_result"; } + + @JsonProperty("data") + private ToolExecutionPartialResultEventData data; + + public ToolExecutionPartialResultEventData getData() { return data; } + public void setData(ToolExecutionPartialResultEventData data) { this.data = data; } + + /** Data payload for {@link ToolExecutionPartialResultEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ToolExecutionPartialResultEventData( + /** Tool call ID this partial result belongs to */ + @JsonProperty("toolCallId") String toolCallId, + /** Incremental output chunk from the running tool */ + @JsonProperty("partialOutput") String partialOutput + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionProgressEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionProgressEvent.java new file mode 100644 index 000000000..bc876c4eb --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionProgressEvent.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.sdk.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 {@code tool.execution_progress} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ToolExecutionProgressEvent extends SessionEvent { + + @Override + public String getType() { return "tool.execution_progress"; } + + @JsonProperty("data") + private ToolExecutionProgressEventData data; + + public ToolExecutionProgressEventData getData() { return data; } + public void setData(ToolExecutionProgressEventData data) { this.data = data; } + + /** Data payload for {@link ToolExecutionProgressEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ToolExecutionProgressEventData( + /** Tool call ID this progress notification belongs to */ + @JsonProperty("toolCallId") String toolCallId, + /** Human-readable progress status message (e.g., from an MCP server) */ + @JsonProperty("progressMessage") String progressMessage + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionStartEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionStartEvent.java new file mode 100644 index 000000000..e6f869327 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionStartEvent.java @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code tool.execution_start} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ToolExecutionStartEvent extends SessionEvent { + + @Override + public String getType() { return "tool.execution_start"; } + + @JsonProperty("data") + private ToolExecutionStartEventData data; + + public ToolExecutionStartEventData getData() { return data; } + public void setData(ToolExecutionStartEventData data) { this.data = data; } + + /** Data payload for {@link ToolExecutionStartEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ToolExecutionStartEventData( + /** Unique identifier for this tool call */ + @JsonProperty("toolCallId") String toolCallId, + /** Name of the tool being executed */ + @JsonProperty("toolName") String toolName, + /** Arguments passed to the tool */ + @JsonProperty("arguments") Object arguments, + /** 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 */ + @JsonProperty("mcpToolName") String mcpToolName, + /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ + @JsonProperty("parentToolCallId") String parentToolCallId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolUserRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ToolUserRequestedEvent.java new file mode 100644 index 000000000..fd02c94d7 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ToolUserRequestedEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code tool.user_requested} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ToolUserRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "tool.user_requested"; } + + @JsonProperty("data") + private ToolUserRequestedEventData data; + + public ToolUserRequestedEventData getData() { return data; } + public void setData(ToolUserRequestedEventData data) { this.data = data; } + + /** Data payload for {@link ToolUserRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ToolUserRequestedEventData( + /** Unique identifier for this tool call */ + @JsonProperty("toolCallId") String toolCallId, + /** Name of the tool the user wants to invoke */ + @JsonProperty("toolName") String toolName, + /** Arguments for the tool invocation */ + @JsonProperty("arguments") Object arguments + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/UnknownSessionEvent.java b/src/generated/java/com/github/copilot/sdk/generated/UnknownSessionEvent.java new file mode 100644 index 000000000..5bcb5e452 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/UnknownSessionEvent.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import javax.annotation.processing.Generated; + +/** + * Fallback for event types not yet known to this SDK version. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class UnknownSessionEvent extends SessionEvent { + + @Override + public String getType() { return "unknown"; } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserInputCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/UserInputCompletedEvent.java new file mode 100644 index 000000000..1251f79bc --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/UserInputCompletedEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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 {@code user_input.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class UserInputCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "user_input.completed"; } + + @JsonProperty("data") + private UserInputCompletedEventData data; + + public UserInputCompletedEventData getData() { return data; } + public void setData(UserInputCompletedEventData data) { this.data = data; } + + /** Data payload for {@link UserInputCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record UserInputCompletedEventData( + /** Request ID of the resolved user input request; clients should dismiss any UI for this request */ + @JsonProperty("requestId") String requestId, + /** The user's answer to the input request */ + @JsonProperty("answer") String answer, + /** Whether the answer was typed as free-form text rather than selected from choices */ + @JsonProperty("wasFreeform") Boolean wasFreeform + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserInputRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/UserInputRequestedEvent.java new file mode 100644 index 000000000..a2db446d4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/UserInputRequestedEvent.java @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code user_input.requested} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class UserInputRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "user_input.requested"; } + + @JsonProperty("data") + private UserInputRequestedEventData data; + + public UserInputRequestedEventData getData() { return data; } + public void setData(UserInputRequestedEventData data) { this.data = data; } + + /** Data payload for {@link UserInputRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record UserInputRequestedEventData( + /** Unique identifier for this input request; used to respond via session.respondToUserInput() */ + @JsonProperty("requestId") String requestId, + /** The question or prompt to present to the user */ + @JsonProperty("question") String question, + /** Predefined choices for the user to select from, if applicable */ + @JsonProperty("choices") List choices, + /** Whether the user can provide a free-form text response in addition to predefined choices */ + @JsonProperty("allowFreeform") Boolean allowFreeform, + /** The LLM-assigned tool call ID that triggered this request; used by remote UIs to correlate responses */ + @JsonProperty("toolCallId") String toolCallId + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java b/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java new file mode 100644 index 000000000..78fd3eb65 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java @@ -0,0 +1,76 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.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; + +/** + * The {@code user.message} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class UserMessageEvent extends SessionEvent { + + @Override + public String getType() { return "user.message"; } + + @JsonProperty("data") + private UserMessageEventData data; + + public UserMessageEventData getData() { return data; } + public void setData(UserMessageEventData data) { this.data = data; } + + /** Data payload for {@link UserMessageEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record UserMessageEventData( + /** The user's message text as displayed in the timeline */ + @JsonProperty("content") String content, + /** Transformed version of the message sent to the model, with XML wrapping, timestamps, and other augmentations for prompt caching */ + @JsonProperty("transformedContent") String transformedContent, + /** Files, selections, or GitHub references attached to the message */ + @JsonProperty("attachments") List attachments, + /** Origin of this message, used for timeline filtering (e.g., "skill-pdf" for skill-injected messages that should be hidden from the user) */ + @JsonProperty("source") String source, + /** The agent mode that was active when this message was sent */ + @JsonProperty("agentMode") UserMessageEventDataAgentMode agentMode, + /** CAPI interaction ID for correlating this user message with its turn */ + @JsonProperty("interactionId") String interactionId + ) { + + /** The agent mode that was active when this message was sent */ + public enum UserMessageEventDataAgentMode { + /** The {@code interactive} variant. */ + INTERACTIVE("interactive"), + /** The {@code plan} variant. */ + PLAN("plan"), + /** The {@code autopilot} variant. */ + AUTOPILOT("autopilot"), + /** The {@code shell} variant. */ + SHELL("shell"); + + private final String value; + UserMessageEventDataAgentMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static UserMessageEventDataAgentMode fromValue(String value) { + for (UserMessageEventDataAgentMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown UserMessageEventDataAgentMode value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountGetQuotaResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountGetQuotaResult.java new file mode 100644 index 000000000..29ebfa7e3 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountGetQuotaResult.java @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code account.getQuota} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record AccountGetQuotaResult( + /** Quota snapshots keyed by type (e.g., chat, completions, premium_interactions) */ + @JsonProperty("quotaSnapshots") Map quotaSnapshots +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AccountGetQuotaResultQuotaSnapshotsValue( + /** Number of requests included in the entitlement */ + @JsonProperty("entitlementRequests") Double entitlementRequests, + /** Number of requests used so far this period */ + @JsonProperty("usedRequests") Double usedRequests, + /** Percentage of entitlement remaining */ + @JsonProperty("remainingPercentage") Double remainingPercentage, + /** Number of overage requests made this period */ + @JsonProperty("overage") Double overage, + /** Whether pay-per-request usage is allowed when quota is exhausted */ + @JsonProperty("overageAllowedWithExhaustedQuota") Boolean overageAllowedWithExhaustedQuota, + /** Date when the quota resets (ISO 8601) */ + @JsonProperty("resetDate") String resetDate + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigAddParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigAddParams.java new file mode 100644 index 000000000..0f33fdcda --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigAddParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code mcp.config.add} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpConfigAddParams( + /** Unique name for the MCP server */ + @JsonProperty("name") String name, + /** MCP server configuration (local/stdio or remote/http) */ + @JsonProperty("config") Object config +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigListResult.java new file mode 100644 index 000000000..1391b451c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigListResult.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.sdk.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; + +/** + * Result for the {@code mcp.config.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpConfigListResult( + /** All MCP servers from user config, keyed by name */ + @JsonProperty("servers") Map servers +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigRemoveParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigRemoveParams.java new file mode 100644 index 000000000..6c24be431 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigRemoveParams.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.sdk.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; + +/** + * Request parameters for the {@code mcp.config.remove} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpConfigRemoveParams( + /** Name of the MCP server to remove */ + @JsonProperty("name") String name +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigUpdateParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigUpdateParams.java new file mode 100644 index 000000000..327234515 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigUpdateParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code mcp.config.update} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpConfigUpdateParams( + /** Name of the MCP server to update */ + @JsonProperty("name") String name, + /** MCP server configuration (local/stdio or remote/http) */ + @JsonProperty("config") Object config +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverParams.java new file mode 100644 index 000000000..24d52cffc --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverParams.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.sdk.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; + +/** + * Request parameters for the {@code mcp.discover} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpDiscoverParams( + /** Working directory used as context for discovery (e.g., plugin resolution) */ + @JsonProperty("workingDirectory") String workingDirectory +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverResult.java new file mode 100644 index 000000000..01561b9f4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverResult.java @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code mcp.discover} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpDiscoverResult( + /** MCP servers discovered from all sources */ + @JsonProperty("servers") List servers +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record McpDiscoverResultServersItem( + /** Server name (config key) */ + @JsonProperty("name") String name, + /** Server type: local, stdio, http, or sse */ + @JsonProperty("type") String type, + /** Configuration source */ + @JsonProperty("source") McpDiscoverResultServersItemSource source, + /** Whether the server is enabled (not in the disabled list) */ + @JsonProperty("enabled") Boolean enabled + ) { + + /** Configuration source */ + public enum McpDiscoverResultServersItemSource { + /** The {@code user} variant. */ + USER("user"), + /** The {@code workspace} variant. */ + WORKSPACE("workspace"), + /** The {@code plugin} variant. */ + PLUGIN("plugin"), + /** The {@code builtin} variant. */ + BUILTIN("builtin"); + + private final String value; + McpDiscoverResultServersItemSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpDiscoverResultServersItemSource fromValue(String value) { + for (McpDiscoverResultServersItemSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpDiscoverResultServersItemSource value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelsListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelsListResult.java new file mode 100644 index 000000000..6b233a737 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelsListResult.java @@ -0,0 +1,118 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code models.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelsListResult( + /** List of available models with full metadata */ + @JsonProperty("models") List models +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ModelsListResultModelsItem( + /** Model identifier (e.g., "claude-sonnet-4.5") */ + @JsonProperty("id") String id, + /** Display name */ + @JsonProperty("name") String name, + /** Model capabilities and limits */ + @JsonProperty("capabilities") ModelsListResultModelsItemCapabilities capabilities, + /** Policy state (if applicable) */ + @JsonProperty("policy") ModelsListResultModelsItemPolicy policy, + /** Billing information */ + @JsonProperty("billing") ModelsListResultModelsItemBilling billing, + /** Supported reasoning effort levels (only present if model supports reasoning effort) */ + @JsonProperty("supportedReasoningEfforts") List supportedReasoningEfforts, + /** Default reasoning effort level (only present if model supports reasoning effort) */ + @JsonProperty("defaultReasoningEffort") String defaultReasoningEffort + ) { + + /** Model capabilities and limits */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ModelsListResultModelsItemCapabilities( + /** Feature flags indicating what the model supports */ + @JsonProperty("supports") ModelsListResultModelsItemCapabilitiesSupports supports, + /** Token limits for prompts, outputs, and context window */ + @JsonProperty("limits") ModelsListResultModelsItemCapabilitiesLimits limits + ) { + + /** Feature flags indicating what the model supports */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ModelsListResultModelsItemCapabilitiesSupports( + /** Whether this model supports vision/image input */ + @JsonProperty("vision") Boolean vision, + /** Whether this model supports reasoning effort configuration */ + @JsonProperty("reasoningEffort") Boolean reasoningEffort + ) { + } + + /** Token limits for prompts, outputs, and context window */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ModelsListResultModelsItemCapabilitiesLimits( + /** Maximum number of prompt/input tokens */ + @JsonProperty("max_prompt_tokens") Double maxPromptTokens, + /** Maximum number of output/completion tokens */ + @JsonProperty("max_output_tokens") Double maxOutputTokens, + /** Maximum total context window size in tokens */ + @JsonProperty("max_context_window_tokens") Double maxContextWindowTokens, + /** Vision-specific limits */ + @JsonProperty("vision") ModelsListResultModelsItemCapabilitiesLimitsVision vision + ) { + + /** Vision-specific limits */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ModelsListResultModelsItemCapabilitiesLimitsVision( + /** MIME types the model accepts */ + @JsonProperty("supported_media_types") List supportedMediaTypes, + /** Maximum number of images per prompt */ + @JsonProperty("max_prompt_images") Double maxPromptImages, + /** Maximum image size in bytes */ + @JsonProperty("max_prompt_image_size") Double maxPromptImageSize + ) { + } + } + } + + /** Policy state (if applicable) */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ModelsListResultModelsItemPolicy( + /** Current policy state for this model */ + @JsonProperty("state") String state, + /** Usage terms or conditions for this model */ + @JsonProperty("terms") String terms + ) { + } + + /** Billing information */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ModelsListResultModelsItemBilling( + /** Billing cost multiplier relative to the base rate */ + @JsonProperty("multiplier") Double multiplier + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/PingParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/PingParams.java new file mode 100644 index 000000000..892d5cbb2 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/PingParams.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.sdk.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; + +/** + * Request parameters for the {@code ping} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PingParams( + /** Optional message to echo back */ + @JsonProperty("message") String message +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.java new file mode 100644 index 000000000..30ff8c58a --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.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.sdk.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; + +/** + * Result for the {@code ping} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PingResult( + /** Echoed message (or default greeting) */ + @JsonProperty("message") String message, + /** Server timestamp in milliseconds */ + @JsonProperty("timestamp") Double timestamp, + /** Server protocol version number */ + @JsonProperty("protocolVersion") Double protocolVersion +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectParams.java new file mode 100644 index 000000000..cd101194c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectParams.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.sdk.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; + +/** + * Request parameters for the {@code session.agent.deselect} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentDeselectParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectResult.java new file mode 100644 index 000000000..81e2e3ebb --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.agent.deselect} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentDeselectResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentParams.java new file mode 100644 index 000000000..c05e5fa36 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentParams.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.sdk.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; + +/** + * Request parameters for the {@code session.agent.getCurrent} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentGetCurrentParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentResult.java new file mode 100644 index 000000000..b26fa1bbb --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentResult.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.sdk.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; + +/** + * Result for the {@code session.agent.getCurrent} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentGetCurrentResult( + /** Currently selected custom agent, or null if using the default agent */ + @JsonProperty("agent") SessionAgentGetCurrentResultAgent agent +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAgentGetCurrentResultAgent( + /** Unique identifier of the custom agent */ + @JsonProperty("name") String name, + /** Human-readable display name */ + @JsonProperty("displayName") String displayName, + /** Description of the agent's purpose */ + @JsonProperty("description") String description + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListParams.java new file mode 100644 index 000000000..e14ae40c0 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListParams.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.sdk.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; + +/** + * Request parameters for the {@code session.agent.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.java new file mode 100644 index 000000000..98bff9a15 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.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.sdk.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; + +/** + * Result for the {@code session.agent.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentListResult( + /** Available custom agents */ + @JsonProperty("agents") List agents +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAgentListResultAgentsItem( + /** Unique identifier of the custom agent */ + @JsonProperty("name") String name, + /** Human-readable display name */ + @JsonProperty("displayName") String displayName, + /** Description of the agent's purpose */ + @JsonProperty("description") String description + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadParams.java new file mode 100644 index 000000000..ea1b4050b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadParams.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.sdk.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; + +/** + * Request parameters for the {@code session.agent.reload} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentReloadParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.java new file mode 100644 index 000000000..2b1d7395a --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.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.sdk.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; + +/** + * Result for the {@code session.agent.reload} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentReloadResult( + /** Reloaded custom agents */ + @JsonProperty("agents") List agents +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAgentReloadResultAgentsItem( + /** Unique identifier of the custom agent */ + @JsonProperty("name") String name, + /** Human-readable display name */ + @JsonProperty("displayName") String displayName, + /** Description of the agent's purpose */ + @JsonProperty("description") String description + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectParams.java new file mode 100644 index 000000000..61777dde3 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.agent.select} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentSelectParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the custom agent to select */ + @JsonProperty("name") String name +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.java new file mode 100644 index 000000000..2eff0778e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.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.sdk.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; + +/** + * Result for the {@code session.agent.select} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAgentSelectResult( + /** The newly selected custom agent */ + @JsonProperty("agent") SessionAgentSelectResultAgent agent +) { + + /** The newly selected custom agent */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAgentSelectResultAgent( + /** Unique identifier of the custom agent */ + @JsonProperty("name") String name, + /** Human-readable display name */ + @JsonProperty("displayName") String displayName, + /** Description of the agent's purpose */ + @JsonProperty("description") String description + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandParams.java new file mode 100644 index 000000000..e14d29486 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandParams.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.sdk.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; + +/** + * Request parameters for the {@code session.commands.handlePendingCommand} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCommandsHandlePendingCommandParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Request ID from the command invocation event */ + @JsonProperty("requestId") String requestId, + /** Error message if the command handler failed */ + @JsonProperty("error") String error +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandResult.java new file mode 100644 index 000000000..8c79beaae --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandResult.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.sdk.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; + +/** + * Result for the {@code session.commands.handlePendingCommand} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCommandsHandlePendingCommandResult( + /** Whether the command was handled successfully */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableParams.java new file mode 100644 index 000000000..35d68997b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.extensions.disable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsDisableParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Source-qualified extension ID to disable */ + @JsonProperty("id") String id +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableResult.java new file mode 100644 index 000000000..136e858fb --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.extensions.disable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsDisableResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableParams.java new file mode 100644 index 000000000..1161a7a73 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.extensions.enable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsEnableParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Source-qualified extension ID to enable */ + @JsonProperty("id") String id +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableResult.java new file mode 100644 index 000000000..1b7d328e0 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.extensions.enable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsEnableResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListParams.java new file mode 100644 index 000000000..340153ca1 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListParams.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.sdk.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; + +/** + * Request parameters for the {@code session.extensions.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListResult.java new file mode 100644 index 000000000..0f6e91d82 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListResult.java @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.extensions.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsListResult( + /** Discovered extensions and their current status */ + @JsonProperty("extensions") List extensions +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionExtensionsListResultExtensionsItem( + /** Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper') */ + @JsonProperty("id") String id, + /** Extension name (directory name) */ + @JsonProperty("name") String name, + /** Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/) */ + @JsonProperty("source") SessionExtensionsListResultExtensionsItemSource source, + /** Current status: running, disabled, failed, or starting */ + @JsonProperty("status") SessionExtensionsListResultExtensionsItemStatus status, + /** Process ID if the extension is running */ + @JsonProperty("pid") Long pid + ) { + + /** Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/) */ + public enum SessionExtensionsListResultExtensionsItemSource { + /** The {@code project} variant. */ + PROJECT("project"), + /** The {@code user} variant. */ + USER("user"); + + private final String value; + SessionExtensionsListResultExtensionsItemSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionExtensionsListResultExtensionsItemSource fromValue(String value) { + for (SessionExtensionsListResultExtensionsItemSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionExtensionsListResultExtensionsItemSource value: " + value); + } + } + + /** Current status: running, disabled, failed, or starting */ + public enum SessionExtensionsListResultExtensionsItemStatus { + /** The {@code running} variant. */ + RUNNING("running"), + /** The {@code disabled} variant. */ + DISABLED("disabled"), + /** The {@code failed} variant. */ + FAILED("failed"), + /** The {@code starting} variant. */ + STARTING("starting"); + + private final String value; + SessionExtensionsListResultExtensionsItemStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionExtensionsListResultExtensionsItemStatus fromValue(String value) { + for (SessionExtensionsListResultExtensionsItemStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionExtensionsListResultExtensionsItemStatus value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadParams.java new file mode 100644 index 000000000..36d157841 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadParams.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.sdk.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; + +/** + * Request parameters for the {@code session.extensions.reload} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsReloadParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadResult.java new file mode 100644 index 000000000..e4a1a2264 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.extensions.reload} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionExtensionsReloadResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartParams.java new file mode 100644 index 000000000..871239460 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.fleet.start} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFleetStartParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Optional user prompt to combine with fleet instructions */ + @JsonProperty("prompt") String prompt +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartResult.java new file mode 100644 index 000000000..a52813aa0 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartResult.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.sdk.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; + +/** + * Result for the {@code session.fleet.start} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFleetStartResult( + /** Whether fleet mode was successfully activated */ + @JsonProperty("started") Boolean started +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.java new file mode 100644 index 000000000..f50b670ee --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.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.sdk.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; + +/** + * Request parameters for the {@code sessionFs.appendFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsAppendFileParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path, + /** Content to append */ + @JsonProperty("content") String content, + /** Optional POSIX-style mode for newly created files */ + @JsonProperty("mode") Double mode +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsParams.java new file mode 100644 index 000000000..c59031c57 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code sessionFs.exists} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsExistsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsResult.java new file mode 100644 index 000000000..882207465 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsResult.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.sdk.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; + +/** + * Result for the {@code sessionFs.exists} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsExistsResult( + /** Whether the path exists */ + @JsonProperty("exists") Boolean exists +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsMkdirParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsMkdirParams.java new file mode 100644 index 000000000..53fc35f25 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsMkdirParams.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.sdk.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; + +/** + * Request parameters for the {@code sessionFs.mkdir} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsMkdirParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path, + /** Create parent directories as needed */ + @JsonProperty("recursive") Boolean recursive, + /** Optional POSIX-style mode for newly created directories */ + @JsonProperty("mode") Double mode +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileParams.java new file mode 100644 index 000000000..f1cad41ed --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code sessionFs.readFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsReadFileParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileResult.java new file mode 100644 index 000000000..c03673538 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileResult.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.sdk.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; + +/** + * Result for the {@code sessionFs.readFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsReadFileResult( + /** File content as UTF-8 string */ + @JsonProperty("content") String content +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirParams.java new file mode 100644 index 000000000..e3f09c370 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code sessionFs.readdir} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsReaddirParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirResult.java new file mode 100644 index 000000000..3079b9813 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirResult.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.sdk.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; + +/** + * Result for the {@code sessionFs.readdir} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsReaddirResult( + /** Entry names in the directory */ + @JsonProperty("entries") List entries +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesParams.java new file mode 100644 index 000000000..533dbb416 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code sessionFs.readdirWithTypes} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsReaddirWithTypesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesResult.java new file mode 100644 index 000000000..0e8dc3587 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesResult.java @@ -0,0 +1,58 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code sessionFs.readdirWithTypes} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsReaddirWithTypesResult( + /** Directory entries with type information */ + @JsonProperty("entries") List entries +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionFsReaddirWithTypesResultEntriesItem( + /** Entry name */ + @JsonProperty("name") String name, + /** Entry type */ + @JsonProperty("type") SessionFsReaddirWithTypesResultEntriesItemType type + ) { + + /** Entry type */ + public enum SessionFsReaddirWithTypesResultEntriesItemType { + /** The {@code file} variant. */ + FILE("file"), + /** The {@code directory} variant. */ + DIRECTORY("directory"); + + private final String value; + SessionFsReaddirWithTypesResultEntriesItemType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionFsReaddirWithTypesResultEntriesItemType fromValue(String value) { + for (SessionFsReaddirWithTypesResultEntriesItemType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionFsReaddirWithTypesResultEntriesItemType value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRenameParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRenameParams.java new file mode 100644 index 000000000..6a18e80df --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRenameParams.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.sdk.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; + +/** + * Request parameters for the {@code sessionFs.rename} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsRenameParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Source path using SessionFs conventions */ + @JsonProperty("src") String src, + /** Destination path using SessionFs conventions */ + @JsonProperty("dest") String dest +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRmParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRmParams.java new file mode 100644 index 000000000..50661a58e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRmParams.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.sdk.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; + +/** + * Request parameters for the {@code sessionFs.rm} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsRmParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path, + /** Remove directories and their contents recursively */ + @JsonProperty("recursive") Boolean recursive, + /** Ignore errors if the path does not exist */ + @JsonProperty("force") Boolean force +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderParams.java new file mode 100644 index 000000000..bbab3b934 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderParams.java @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code sessionFs.setProvider} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSetProviderParams( + /** Initial working directory for sessions */ + @JsonProperty("initialCwd") String initialCwd, + /** Path within each session's SessionFs where the runtime stores files for that session */ + @JsonProperty("sessionStatePath") String sessionStatePath, + /** Path conventions used by this filesystem */ + @JsonProperty("conventions") SessionFsSetProviderParamsConventions conventions +) { + + /** Path conventions used by this filesystem */ + public enum SessionFsSetProviderParamsConventions { + /** The {@code windows} variant. */ + WINDOWS("windows"), + /** The {@code posix} variant. */ + POSIX("posix"); + + private final String value; + SessionFsSetProviderParamsConventions(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionFsSetProviderParamsConventions fromValue(String value) { + for (SessionFsSetProviderParamsConventions v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionFsSetProviderParamsConventions value: " + value); + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderResult.java new file mode 100644 index 000000000..dcda9e587 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderResult.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.sdk.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; + +/** + * Result for the {@code sessionFs.setProvider} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSetProviderResult( + /** Whether the provider was set successfully */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatParams.java new file mode 100644 index 000000000..5d60281c8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code sessionFs.stat} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsStatParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.java new file mode 100644 index 000000000..39b40a913 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.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.sdk.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; + +/** + * Result for the {@code sessionFs.stat} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsStatResult( + /** Whether the path is a file */ + @JsonProperty("isFile") Boolean isFile, + /** Whether the path is a directory */ + @JsonProperty("isDirectory") Boolean isDirectory, + /** File size in bytes */ + @JsonProperty("size") Double size, + /** ISO 8601 timestamp of last modification */ + @JsonProperty("mtime") String mtime, + /** ISO 8601 timestamp of creation */ + @JsonProperty("birthtime") String birthtime +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsWriteFileParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsWriteFileParams.java new file mode 100644 index 000000000..02e1dea77 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsWriteFileParams.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.sdk.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; + +/** + * Request parameters for the {@code sessionFs.writeFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsWriteFileParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path using SessionFs conventions */ + @JsonProperty("path") String path, + /** Content to write */ + @JsonProperty("content") String content, + /** Optional POSIX-style mode for newly created files */ + @JsonProperty("mode") Double mode +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactParams.java new file mode 100644 index 000000000..4b352cc62 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactParams.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.sdk.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; + +/** + * Request parameters for the {@code session.history.compact} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryCompactParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactResult.java new file mode 100644 index 000000000..b20e2c449 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactResult.java @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.history.compact} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryCompactResult( + /** Whether compaction completed successfully */ + @JsonProperty("success") Boolean success, + /** Number of tokens freed by compaction */ + @JsonProperty("tokensRemoved") Double tokensRemoved, + /** Number of messages removed during compaction */ + @JsonProperty("messagesRemoved") Double messagesRemoved, + /** Post-compaction context window usage breakdown */ + @JsonProperty("contextWindow") SessionHistoryCompactResultContextWindow contextWindow +) { + + /** Post-compaction context window usage breakdown */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionHistoryCompactResultContextWindow( + /** Maximum token count for the model's context window */ + @JsonProperty("tokenLimit") Double tokenLimit, + /** Current total tokens in the context window (system + conversation + tool definitions) */ + @JsonProperty("currentTokens") Double currentTokens, + /** Current number of messages in the conversation */ + @JsonProperty("messagesLength") Double messagesLength, + /** Token count from system message(s) */ + @JsonProperty("systemTokens") Double systemTokens, + /** Token count from non-system messages (user, assistant, tool) */ + @JsonProperty("conversationTokens") Double conversationTokens, + /** Token count from tool definitions */ + @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateParams.java new file mode 100644 index 000000000..09ddf68df --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.history.truncate} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryTruncateParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Event ID to truncate to. This event and all events after it are removed from the session. */ + @JsonProperty("eventId") String eventId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.java new file mode 100644 index 000000000..65f71d4c8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.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.sdk.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; + +/** + * Result for the {@code session.history.truncate} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryTruncateResult( + /** Number of events that were removed */ + @JsonProperty("eventsRemoved") Double eventsRemoved +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogParams.java new file mode 100644 index 000000000..c87fb78eb --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogParams.java @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.log} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionLogParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Human-readable message */ + @JsonProperty("message") String message, + /** Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". */ + @JsonProperty("level") SessionLogParamsLevel level, + /** When true, the message is transient and not persisted to the session event log on disk */ + @JsonProperty("ephemeral") Boolean ephemeral, + /** Optional URL the user can open in their browser for more details */ + @JsonProperty("url") String url +) { + + /** Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". */ + public enum SessionLogParamsLevel { + /** The {@code info} variant. */ + INFO("info"), + /** The {@code warning} variant. */ + WARNING("warning"), + /** The {@code error} variant. */ + ERROR("error"); + + private final String value; + SessionLogParamsLevel(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionLogParamsLevel fromValue(String value) { + for (SessionLogParamsLevel v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionLogParamsLevel value: " + value); + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogResult.java new file mode 100644 index 000000000..7ba330dac --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogResult.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.sdk.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; +import javax.annotation.processing.Generated; + +/** + * Result for the {@code session.log} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionLogResult( + /** The unique identifier of the emitted session event */ + @JsonProperty("eventId") UUID eventId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableParams.java new file mode 100644 index 000000000..ab0892a9c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.mcp.disable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpDisableParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the MCP server to disable */ + @JsonProperty("serverName") String serverName +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableResult.java new file mode 100644 index 000000000..0565cf8d1 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.mcp.disable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpDisableResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableParams.java new file mode 100644 index 000000000..0e6b1cf74 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.mcp.enable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpEnableParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the MCP server to enable */ + @JsonProperty("serverName") String serverName +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableResult.java new file mode 100644 index 000000000..43319c3a9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.mcp.enable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpEnableResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListParams.java new file mode 100644 index 000000000..c3a8a2b8d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListParams.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.sdk.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; + +/** + * Request parameters for the {@code session.mcp.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListResult.java new file mode 100644 index 000000000..25f747162 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListResult.java @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.mcp.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpListResult( + /** Configured MCP servers */ + @JsonProperty("servers") List servers +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMcpListResultServersItem( + /** Server name (config key) */ + @JsonProperty("name") String name, + /** Connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + @JsonProperty("status") SessionMcpListResultServersItemStatus status, + /** Configuration source: user, workspace, plugin, or builtin */ + @JsonProperty("source") String source, + /** Error message if the server failed to connect */ + @JsonProperty("error") String error + ) { + + /** Connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + public enum SessionMcpListResultServersItemStatus { + /** The {@code connected} variant. */ + CONNECTED("connected"), + /** The {@code failed} variant. */ + FAILED("failed"), + /** The {@code needs-auth} variant. */ + NEEDS_AUTH("needs-auth"), + /** The {@code pending} variant. */ + PENDING("pending"), + /** The {@code disabled} variant. */ + DISABLED("disabled"), + /** The {@code not_configured} variant. */ + NOT_CONFIGURED("not_configured"); + + private final String value; + SessionMcpListResultServersItemStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionMcpListResultServersItemStatus fromValue(String value) { + for (SessionMcpListResultServersItemStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionMcpListResultServersItemStatus value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadParams.java new file mode 100644 index 000000000..b3e3ccf28 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadParams.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.sdk.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; + +/** + * Request parameters for the {@code session.mcp.reload} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpReloadParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadResult.java new file mode 100644 index 000000000..80a2c4c26 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.mcp.reload} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpReloadResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetParams.java new file mode 100644 index 000000000..e62ab01d6 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetParams.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.sdk.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; + +/** + * Request parameters for the {@code session.mode.get} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModeGetParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetResult.java new file mode 100644 index 000000000..595dff851 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetResult.java @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.mode.get} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModeGetResult( + /** The current agent mode. */ + @JsonProperty("mode") SessionModeGetResultMode mode +) { + + /** The current agent mode. */ + public enum SessionModeGetResultMode { + /** The {@code interactive} variant. */ + INTERACTIVE("interactive"), + /** The {@code plan} variant. */ + PLAN("plan"), + /** The {@code autopilot} variant. */ + AUTOPILOT("autopilot"); + + private final String value; + SessionModeGetResultMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionModeGetResultMode fromValue(String value) { + for (SessionModeGetResultMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionModeGetResultMode value: " + value); + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetParams.java new file mode 100644 index 000000000..dfbae5cac --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetParams.java @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.mode.set} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModeSetParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The mode to switch to. Valid values: "interactive", "plan", "autopilot". */ + @JsonProperty("mode") SessionModeSetParamsMode mode +) { + + /** The mode to switch to. Valid values: "interactive", "plan", "autopilot". */ + public enum SessionModeSetParamsMode { + /** The {@code interactive} variant. */ + INTERACTIVE("interactive"), + /** The {@code plan} variant. */ + PLAN("plan"), + /** The {@code autopilot} variant. */ + AUTOPILOT("autopilot"); + + private final String value; + SessionModeSetParamsMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionModeSetParamsMode fromValue(String value) { + for (SessionModeSetParamsMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionModeSetParamsMode value: " + value); + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetResult.java new file mode 100644 index 000000000..f4609f671 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetResult.java @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.mode.set} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModeSetResult( + /** The agent mode after switching. */ + @JsonProperty("mode") SessionModeSetResultMode mode +) { + + /** The agent mode after switching. */ + public enum SessionModeSetResultMode { + /** The {@code interactive} variant. */ + INTERACTIVE("interactive"), + /** The {@code plan} variant. */ + PLAN("plan"), + /** The {@code autopilot} variant. */ + AUTOPILOT("autopilot"); + + private final String value; + SessionModeSetResultMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionModeSetResultMode fromValue(String value) { + for (SessionModeSetResultMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionModeSetResultMode value: " + value); + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentParams.java new file mode 100644 index 000000000..e49e4f2df --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentParams.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.sdk.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; + +/** + * Request parameters for the {@code session.model.getCurrent} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelGetCurrentParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentResult.java new file mode 100644 index 000000000..7467fd4e8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentResult.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.sdk.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; + +/** + * Result for the {@code session.model.getCurrent} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelGetCurrentResult( + /** Currently active model identifier */ + @JsonProperty("modelId") String modelId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java new file mode 100644 index 000000000..994b3f53b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.model.switchTo} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelSwitchToParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Model identifier to switch to */ + @JsonProperty("modelId") String modelId, + /** Reasoning effort level to use for the model */ + @JsonProperty("reasoningEffort") String reasoningEffort, + /** Override individual model capabilities resolved by the runtime */ + @JsonProperty("modelCapabilities") SessionModelSwitchToParamsModelCapabilities modelCapabilities +) { + + /** Override individual model capabilities resolved by the runtime */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionModelSwitchToParamsModelCapabilities( + /** Feature flags indicating what the model supports */ + @JsonProperty("supports") SessionModelSwitchToParamsModelCapabilitiesSupports supports, + /** Token limits for prompts, outputs, and context window */ + @JsonProperty("limits") SessionModelSwitchToParamsModelCapabilitiesLimits limits + ) { + + /** Feature flags indicating what the model supports */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionModelSwitchToParamsModelCapabilitiesSupports( + @JsonProperty("vision") Boolean vision, + @JsonProperty("reasoningEffort") Boolean reasoningEffort + ) { + } + + /** Token limits for prompts, outputs, and context window */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionModelSwitchToParamsModelCapabilitiesLimits( + @JsonProperty("max_prompt_tokens") Double maxPromptTokens, + @JsonProperty("max_output_tokens") Double maxOutputTokens, + /** Maximum total context window size in tokens */ + @JsonProperty("max_context_window_tokens") Double maxContextWindowTokens, + @JsonProperty("vision") SessionModelSwitchToParamsModelCapabilitiesLimitsVision vision + ) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionModelSwitchToParamsModelCapabilitiesLimitsVision( + /** MIME types the model accepts */ + @JsonProperty("supported_media_types") List supportedMediaTypes, + /** Maximum number of images per prompt */ + @JsonProperty("max_prompt_images") Double maxPromptImages, + /** Maximum image size in bytes */ + @JsonProperty("max_prompt_image_size") Double maxPromptImageSize + ) { + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToResult.java new file mode 100644 index 000000000..5e93b51ae --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToResult.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.sdk.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; + +/** + * Result for the {@code session.model.switchTo} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelSwitchToResult( + /** Currently active model identifier after the switch */ + @JsonProperty("modelId") String modelId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java new file mode 100644 index 000000000..016d2001c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.permissions.handlePendingPermissionRequest} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsHandlePendingPermissionRequestParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Request ID of the pending permission request */ + @JsonProperty("requestId") String requestId, + @JsonProperty("result") Object result +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.java new file mode 100644 index 000000000..cbbdd075b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.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.sdk.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; + +/** + * Result for the {@code session.permissions.handlePendingPermissionRequest} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsHandlePendingPermissionRequestResult( + /** Whether the permission request was handled successfully */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteParams.java new file mode 100644 index 000000000..ba09c2d66 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteParams.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.sdk.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; + +/** + * Request parameters for the {@code session.plan.delete} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPlanDeleteParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteResult.java new file mode 100644 index 000000000..666109985 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.plan.delete} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPlanDeleteResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadParams.java new file mode 100644 index 000000000..23484403d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadParams.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.sdk.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; + +/** + * Request parameters for the {@code session.plan.read} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPlanReadParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadResult.java new file mode 100644 index 000000000..ddfe1cf5c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadResult.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.sdk.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; + +/** + * Result for the {@code session.plan.read} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPlanReadResult( + /** Whether the plan file exists in the workspace */ + @JsonProperty("exists") Boolean exists, + /** The content of the plan file, or null if it does not exist */ + @JsonProperty("content") String content, + /** Absolute file path of the plan file, or null if workspace is not enabled */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateParams.java new file mode 100644 index 000000000..9bd69e384 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.plan.update} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPlanUpdateParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The new content for the plan file */ + @JsonProperty("content") String content +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateResult.java new file mode 100644 index 000000000..aa6c64aaf --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.plan.update} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPlanUpdateResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListParams.java new file mode 100644 index 000000000..b3407dd52 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListParams.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.sdk.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; + +/** + * Request parameters for the {@code session.plugins.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPluginsListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListResult.java new file mode 100644 index 000000000..d6008318d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListResult.java @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.plugins.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPluginsListResult( + /** Installed plugins */ + @JsonProperty("plugins") List plugins +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionPluginsListResultPluginsItem( + /** Plugin name */ + @JsonProperty("name") String name, + /** Marketplace the plugin came from */ + @JsonProperty("marketplace") String marketplace, + /** Installed version */ + @JsonProperty("version") String version, + /** Whether the plugin is currently enabled */ + @JsonProperty("enabled") Boolean enabled + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecParams.java new file mode 100644 index 000000000..9e9d93e99 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecParams.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.sdk.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; + +/** + * Request parameters for the {@code session.shell.exec} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionShellExecParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Shell command to execute */ + @JsonProperty("command") String command, + /** Working directory (defaults to session working directory) */ + @JsonProperty("cwd") String cwd, + /** Timeout in milliseconds (default: 30000) */ + @JsonProperty("timeout") Double timeout +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecResult.java new file mode 100644 index 000000000..34288630b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecResult.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.sdk.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; + +/** + * Result for the {@code session.shell.exec} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionShellExecResult( + /** Unique identifier for tracking streamed output */ + @JsonProperty("processId") String processId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillParams.java new file mode 100644 index 000000000..19569dd0e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillParams.java @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.shell.kill} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionShellKillParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Process identifier returned by shell.exec */ + @JsonProperty("processId") String processId, + /** Signal to send (default: SIGTERM) */ + @JsonProperty("signal") SessionShellKillParamsSignal signal +) { + + /** Signal to send (default: SIGTERM) */ + public enum SessionShellKillParamsSignal { + /** The {@code SIGTERM} variant. */ + SIGTERM("SIGTERM"), + /** The {@code SIGKILL} variant. */ + SIGKILL("SIGKILL"), + /** The {@code SIGINT} variant. */ + SIGINT("SIGINT"); + + private final String value; + SessionShellKillParamsSignal(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionShellKillParamsSignal fromValue(String value) { + for (SessionShellKillParamsSignal v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionShellKillParamsSignal value: " + value); + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillResult.java new file mode 100644 index 000000000..e786d93c4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillResult.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.sdk.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; + +/** + * Result for the {@code session.shell.kill} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionShellKillResult( + /** Whether the signal was sent successfully */ + @JsonProperty("killed") Boolean killed +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableParams.java new file mode 100644 index 000000000..163df3a0a --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.skills.disable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsDisableParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the skill to disable */ + @JsonProperty("name") String name +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableResult.java new file mode 100644 index 000000000..7f3fe40b8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.skills.disable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsDisableResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableParams.java new file mode 100644 index 000000000..72b1944cd --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.skills.enable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsEnableParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the skill to enable */ + @JsonProperty("name") String name +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableResult.java new file mode 100644 index 000000000..1e7ea4c7f --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.skills.enable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsEnableResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListParams.java new file mode 100644 index 000000000..5575ef478 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListParams.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.sdk.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; + +/** + * Request parameters for the {@code session.skills.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java new file mode 100644 index 000000000..dc6ba023e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.skills.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsListResult( + /** Available skills */ + @JsonProperty("skills") List skills +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionSkillsListResultSkillsItem( + /** Unique identifier for the skill */ + @JsonProperty("name") String name, + /** Description of what the skill does */ + @JsonProperty("description") String description, + /** Source location type (e.g., project, personal, plugin) */ + @JsonProperty("source") String source, + /** Whether the skill can be invoked by the user as a slash command */ + @JsonProperty("userInvocable") Boolean userInvocable, + /** Whether the skill is currently enabled */ + @JsonProperty("enabled") Boolean enabled, + /** Absolute path to the skill file */ + @JsonProperty("path") String path + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadParams.java new file mode 100644 index 000000000..664fd836a --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadParams.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.sdk.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; + +/** + * Request parameters for the {@code session.skills.reload} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsReloadParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadResult.java new file mode 100644 index 000000000..1bfca46e1 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.skills.reload} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsReloadResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallParams.java new file mode 100644 index 000000000..c5ea35fe9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallParams.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.sdk.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; + +/** + * Request parameters for the {@code session.tools.handlePendingToolCall} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionToolsHandlePendingToolCallParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Request ID of the pending tool call */ + @JsonProperty("requestId") String requestId, + /** Tool call result (string or expanded result object) */ + @JsonProperty("result") String result, + /** Error message if the tool call failed */ + @JsonProperty("error") String error +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallResult.java new file mode 100644 index 000000000..3f7a2acc1 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallResult.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.sdk.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; + +/** + * Result for the {@code session.tools.handlePendingToolCall} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionToolsHandlePendingToolCallResult( + /** Whether the tool call result was handled successfully */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationParams.java new file mode 100644 index 000000000..d1df4daea --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationParams.java @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.ui.elicitation} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiElicitationParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Message describing what information is needed from the user */ + @JsonProperty("message") String message, + /** JSON Schema describing the form fields to present to the user */ + @JsonProperty("requestedSchema") SessionUiElicitationParamsRequestedSchema requestedSchema +) { + + /** JSON Schema describing the form fields to present to the user */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionUiElicitationParamsRequestedSchema( + /** Schema type indicator (always 'object') */ + @JsonProperty("type") String type, + /** Form field definitions, keyed by field name */ + @JsonProperty("properties") Map properties, + /** List of required field names */ + @JsonProperty("required") List required + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationResult.java new file mode 100644 index 000000000..92ea41778 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationResult.java @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.ui.elicitation} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiElicitationResult( + /** The user's response: accept (submitted), decline (rejected), or cancel (dismissed) */ + @JsonProperty("action") SessionUiElicitationResultAction action, + /** The form values submitted by the user (present when action is 'accept') */ + @JsonProperty("content") Map content +) { + + /** The user's response: accept (submitted), decline (rejected), or cancel (dismissed) */ + public enum SessionUiElicitationResultAction { + /** The {@code accept} variant. */ + ACCEPT("accept"), + /** The {@code decline} variant. */ + DECLINE("decline"), + /** The {@code cancel} variant. */ + CANCEL("cancel"); + + private final String value; + SessionUiElicitationResultAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionUiElicitationResultAction fromValue(String value) { + for (SessionUiElicitationResultAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionUiElicitationResultAction value: " + value); + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationParams.java new file mode 100644 index 000000000..e890fffbd --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationParams.java @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.ui.handlePendingElicitation} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingElicitationParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The unique request ID from the elicitation.requested event */ + @JsonProperty("requestId") String requestId, + /** The elicitation response (accept with form values, decline, or cancel) */ + @JsonProperty("result") SessionUiHandlePendingElicitationParamsResult result +) { + + /** The elicitation response (accept with form values, decline, or cancel) */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionUiHandlePendingElicitationParamsResult( + /** The user's response: accept (submitted), decline (rejected), or cancel (dismissed) */ + @JsonProperty("action") SessionUiHandlePendingElicitationParamsResultAction action, + /** The form values submitted by the user (present when action is 'accept') */ + @JsonProperty("content") Map content + ) { + + /** The user's response: accept (submitted), decline (rejected), or cancel (dismissed) */ + public enum SessionUiHandlePendingElicitationParamsResultAction { + /** The {@code accept} variant. */ + ACCEPT("accept"), + /** The {@code decline} variant. */ + DECLINE("decline"), + /** The {@code cancel} variant. */ + CANCEL("cancel"); + + private final String value; + SessionUiHandlePendingElicitationParamsResultAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionUiHandlePendingElicitationParamsResultAction fromValue(String value) { + for (SessionUiHandlePendingElicitationParamsResultAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionUiHandlePendingElicitationParamsResultAction value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationResult.java new file mode 100644 index 000000000..549609a87 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationResult.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.sdk.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; + +/** + * Result for the {@code session.ui.handlePendingElicitation} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingElicitationResult( + /** Whether the response was accepted. False if the request was already resolved by another client. */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsParams.java new file mode 100644 index 000000000..4696c7fc9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsParams.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.sdk.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; + +/** + * Request parameters for the {@code session.usage.getMetrics} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUsageGetMetricsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java new file mode 100644 index 000000000..5a98516d4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java @@ -0,0 +1,95 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.usage.getMetrics} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUsageGetMetricsResult( + /** Total user-initiated premium request cost across all models (may be fractional due to multipliers) */ + @JsonProperty("totalPremiumRequestCost") Double totalPremiumRequestCost, + /** Raw count of user-initiated API requests */ + @JsonProperty("totalUserRequests") Long totalUserRequests, + /** Total time spent in model API calls (milliseconds) */ + @JsonProperty("totalApiDurationMs") Double totalApiDurationMs, + /** Session start timestamp (epoch milliseconds) */ + @JsonProperty("sessionStartTime") Long sessionStartTime, + /** Aggregated code change metrics */ + @JsonProperty("codeChanges") SessionUsageGetMetricsResultCodeChanges codeChanges, + /** Per-model token and request metrics, keyed by model identifier */ + @JsonProperty("modelMetrics") Map modelMetrics, + /** Currently active model identifier */ + @JsonProperty("currentModel") String currentModel, + /** Input tokens from the most recent main-agent API call */ + @JsonProperty("lastCallInputTokens") Long lastCallInputTokens, + /** Output tokens from the most recent main-agent API call */ + @JsonProperty("lastCallOutputTokens") Long lastCallOutputTokens +) { + + /** Aggregated code change metrics */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionUsageGetMetricsResultCodeChanges( + /** Total lines of code added */ + @JsonProperty("linesAdded") Long linesAdded, + /** Total lines of code removed */ + @JsonProperty("linesRemoved") Long linesRemoved, + /** Number of distinct files modified */ + @JsonProperty("filesModifiedCount") Long filesModifiedCount + ) { + } + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionUsageGetMetricsResultModelMetricsValue( + /** Request count and cost metrics for this model */ + @JsonProperty("requests") SessionUsageGetMetricsResultModelMetricsValueRequests requests, + /** Token usage metrics for this model */ + @JsonProperty("usage") SessionUsageGetMetricsResultModelMetricsValueUsage usage + ) { + + /** Request count and cost metrics for this model */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionUsageGetMetricsResultModelMetricsValueRequests( + /** Number of API requests made with this model */ + @JsonProperty("count") Long count, + /** User-initiated premium request cost (with multiplier applied) */ + @JsonProperty("cost") Double cost + ) { + } + + /** Token usage metrics for this model */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionUsageGetMetricsResultModelMetricsValueUsage( + /** Total input tokens consumed */ + @JsonProperty("inputTokens") Long inputTokens, + /** Total output tokens produced */ + @JsonProperty("outputTokens") Long outputTokens, + /** Total tokens read from prompt cache */ + @JsonProperty("cacheReadTokens") Long cacheReadTokens, + /** Total tokens written to prompt cache */ + @JsonProperty("cacheWriteTokens") Long cacheWriteTokens, + /** Total output tokens used for reasoning */ + @JsonProperty("reasoningTokens") Long reasoningTokens + ) { + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileParams.java new file mode 100644 index 000000000..c25fdd790 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileParams.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.sdk.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; + +/** + * Request parameters for the {@code session.workspace.createFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspaceCreateFileParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Relative path within the workspace files directory */ + @JsonProperty("path") String path, + /** File content to write as a UTF-8 string */ + @JsonProperty("content") String content +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileResult.java new file mode 100644 index 000000000..e77cf58c5 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileResult.java @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code session.workspace.createFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspaceCreateFileResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesParams.java new file mode 100644 index 000000000..0fb6431c9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesParams.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.sdk.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; + +/** + * Request parameters for the {@code session.workspace.listFiles} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspaceListFilesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesResult.java new file mode 100644 index 000000000..1b46df541 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesResult.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.sdk.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; + +/** + * Result for the {@code session.workspace.listFiles} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspaceListFilesResult( + /** Relative file paths in the workspace files directory */ + @JsonProperty("files") List files +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileParams.java new file mode 100644 index 000000000..ded74763a --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code session.workspace.readFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspaceReadFileParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Relative path within the workspace files directory */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileResult.java new file mode 100644 index 000000000..c8705581e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileResult.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.sdk.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; + +/** + * Result for the {@code session.workspace.readFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspaceReadFileResult( + /** File content as a UTF-8 string */ + @JsonProperty("content") String content +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkParams.java new file mode 100644 index 000000000..06ea46c93 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkParams.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Request parameters for the {@code sessions.fork} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsForkParams( + /** Source session ID to fork from */ + @JsonProperty("sessionId") String sessionId, + /** Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included. */ + @JsonProperty("toEventId") String toEventId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkResult.java new file mode 100644 index 000000000..911574f56 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkResult.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.sdk.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; + +/** + * Result for the {@code sessions.fork} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsForkResult( + /** The new forked session's ID */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListParams.java new file mode 100644 index 000000000..2c5aa5b09 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListParams.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.sdk.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; + +/** + * Request parameters for the {@code tools.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolsListParams( + /** Optional model ID — when provided, the returned tool list reflects model-specific overrides */ + @JsonProperty("model") String model +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListResult.java new file mode 100644 index 000000000..d56ef7e7c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListResult.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.sdk.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; + +/** + * Result for the {@code tools.list} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolsListResult( + /** List of available built-in tools with metadata */ + @JsonProperty("tools") List tools +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record ToolsListResultToolsItem( + /** Tool identifier (e.g., "bash", "grep", "str_replace_editor") */ + @JsonProperty("name") String name, + /** Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP tools) */ + @JsonProperty("namespacedName") String namespacedName, + /** Description of what the tool does */ + @JsonProperty("description") String description, + /** JSON Schema for the tool's input parameters */ + @JsonProperty("parameters") Map parameters, + /** Optional instructions for how to use this tool effectively */ + @JsonProperty("instructions") String instructions + ) { + } +}