diff --git a/.github/aw/actions-lock.json b/.github/aw/actions-lock.json index 1b8b4b56b..11e06d9b9 100644 --- a/.github/aw/actions-lock.json +++ b/.github/aw/actions-lock.json @@ -20,6 +20,11 @@ "version": "v4", "sha": "49933ea5288caeca8642d1e84afbd3f7d6820020" }, + "github/gh-aw-actions/setup-cli@v0.68.3": { + "repo": "github/gh-aw-actions/setup-cli", + "version": "v0.68.3", + "sha": "ba90f2186d7ad780ec640f364005fa24e797b360" + }, "github/gh-aw-actions/setup@v0.68.3": { "repo": "github/gh-aw-actions/setup", "version": "v0.68.3", diff --git a/.github/workflows/agentics-maintenance.yml b/.github/workflows/agentics-maintenance.yml index bb7a31d5d..aa47e2f9b 100644 --- a/.github/workflows/agentics-maintenance.yml +++ b/.github/workflows/agentics-maintenance.yml @@ -1,4 +1,3 @@ -# # ___ _ _ # / _ \ | | (_) # | |_| | __ _ ___ _ __ | |_ _ ___ @@ -13,7 +12,7 @@ # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ # -# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.51.6). DO NOT EDIT. +# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.68.3). DO NOT EDIT. # # To regenerate this workflow, run: # gh aw compile @@ -37,12 +36,52 @@ on: schedule: - cron: "37 0 * * *" # Daily (based on minimum expires: 6 days) workflow_dispatch: + inputs: + operation: + description: 'Optional maintenance operation to run' + required: false + type: choice + default: '' + options: + - '' + - 'disable' + - 'enable' + - 'update' + - 'upgrade' + - 'safe_outputs' + - 'create_labels' + - 'clean_cache_memories' + - 'validate' + run_url: + description: 'Run URL or run ID to replay safe outputs from (e.g. https://github.com/owner/repo/actions/runs/12345 or 12345). Required when operation is safe_outputs.' + required: false + type: string + default: '' + workflow_call: + inputs: + operation: + description: 'Optional maintenance operation to run (disable, enable, update, upgrade, safe_outputs, create_labels, clean_cache_memories, validate)' + required: false + type: string + default: '' + run_url: + description: 'Run URL or run ID to replay safe outputs from (e.g. https://github.com/owner/repo/actions/runs/12345 or 12345). Required when operation is safe_outputs.' + required: false + type: string + default: '' + outputs: + operation_completed: + description: 'The maintenance operation that was completed (empty when none ran or a scheduled job ran)' + value: ${{ jobs.run_operation.outputs.operation || inputs.operation }} + applied_run_url: + description: 'The run URL that safe outputs were applied from' + value: ${{ jobs.apply_safe_outputs.outputs.run_url }} permissions: {} jobs: close-expired-entities: - if: ${{ !github.event.repository.fork }} + if: ${{ (!(github.event.repository.fork)) && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '') }} runs-on: ubuntu-slim permissions: discussions: write @@ -50,33 +89,245 @@ jobs: pull-requests: write steps: - name: Setup Scripts - uses: github/gh-aw/actions/setup@33cd6c7f1fee588654ef19def2e6a4174be66197 # v0.51.6 + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 with: - destination: /opt/gh-aw/actions + destination: ${{ runner.temp }}/gh-aw/actions - name: Close expired discussions - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 with: script: | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('/opt/gh-aw/actions/close_expired_discussions.cjs'); + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_discussions.cjs'); await main(); - name: Close expired issues - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 with: script: | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('/opt/gh-aw/actions/close_expired_issues.cjs'); + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_issues.cjs'); await main(); - name: Close expired pull requests - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/close_expired_pull_requests.cjs'); + await main(); + + cleanup-cache-memory: + if: ${{ (!(github.event.repository.fork)) && (github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' || inputs.operation == '' || inputs.operation == 'clean_cache_memories') }} + runs-on: ubuntu-slim + permissions: + actions: write + steps: + - name: Setup Scripts + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + + - name: Cleanup outdated cache-memory entries + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/cleanup_cache_memory.cjs'); + await main(); + + run_operation: + if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation != '' && inputs.operation != 'safe_outputs' && inputs.operation != 'create_labels' && inputs.operation != 'clean_cache_memories' && inputs.operation != 'validate' && (!(github.event.repository.fork)) }} + runs-on: ubuntu-slim + permissions: + actions: write + contents: write + pull-requests: write + outputs: + operation: ${{ steps.record.outputs.operation }} + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Setup Scripts + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + + - name: Check admin/maintainer permissions + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); + await main(); + + - name: Install gh-aw + uses: github/gh-aw-actions/setup-cli@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + version: v0.68.3 + + - name: Run operation + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_AW_OPERATION: ${{ inputs.operation }} + GH_AW_CMD_PREFIX: gh aw + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/run_operation_update_upgrade.cjs'); + await main(); + + - name: Record outputs + id: record + run: echo "operation=${{ inputs.operation }}" >> "$GITHUB_OUTPUT" + + apply_safe_outputs: + if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'safe_outputs' && (!(github.event.repository.fork)) }} + runs-on: ubuntu-slim + permissions: + actions: read + contents: write + discussions: write + issues: write + pull-requests: write + outputs: + run_url: ${{ steps.record.outputs.run_url }} + steps: + - name: Checkout actions folder + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout: | + actions + persist-credentials: false + + - name: Setup Scripts + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + + - name: Check admin/maintainer permissions + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); + await main(); + + - name: Apply Safe Outputs + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_AW_RUN_URL: ${{ inputs.run_url }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/apply_safe_outputs_replay.cjs'); + await main(); + + - name: Record outputs + id: record + run: echo "run_url=${{ inputs.run_url }}" >> "$GITHUB_OUTPUT" + + create_labels: + if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'create_labels' && (!(github.event.repository.fork)) }} + runs-on: ubuntu-slim + permissions: + contents: read + issues: write + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Setup Scripts + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + + - name: Check admin/maintainer permissions + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); + await main(); + + - name: Install gh-aw + uses: github/gh-aw-actions/setup-cli@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + version: v0.68.3 + + - name: Create missing labels + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_CMD_PREFIX: gh aw + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/create_labels.cjs'); + await main(); + + validate_workflows: + if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'validate' && (!(github.event.repository.fork)) }} + runs-on: ubuntu-latest + permissions: + contents: read + issues: write + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Setup Scripts + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + + - name: Check admin/maintainer permissions + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs'); + await main(); + + - name: Install gh-aw + uses: github/gh-aw-actions/setup-cli@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + version: v0.68.3 + + - name: Validate workflows and file issue on findings + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_CMD_PREFIX: gh aw with: + github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('/opt/gh-aw/actions/close_expired_pull_requests.cjs'); + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/run_validate_workflows.cjs'); await main(); diff --git a/.github/workflows/codegen-agentic-fix.md b/.github/workflows/codegen-agentic-fix.md index ec0e43f52..eb93e1095 100644 --- a/.github/workflows/codegen-agentic-fix.md +++ b/.github/workflows/codegen-agentic-fix.md @@ -33,9 +33,9 @@ tools: toolsets: [context, repos] safe-outputs: - push-to-pull-request-branch: + push_to_pull_request_branch: max: 3 - add-comment: + add_comment: target: "*" max: 5 noop: @@ -47,7 +47,9 @@ You are an automation agent that fixes Java compilation and test failures caused ## Context -A code generation step updated files under `src/generated/java/` and `mvn verify` subsequently failed. Your job is to fix the **handwritten** source code so it compiles and passes tests with the new generated code. +A Dependabot PR bumped the `@github/copilot` npm dependency in `scripts/codegen/package.json`. The `codegen-check` workflow ran the code generator (`scripts/codegen/java.ts`) against the new schemas and `mvn verify` subsequently failed. Your job is to fix **both** the code generator script (if needed) and the handwritten SDK/test source code so the build passes. + +**❌❌❌ YOU MUST NEVER EDIT any of the java source code in `src/generated/` directly.** ✅✅Rather, the way to affect changes in these files is to change the code generator script and re-generate the classes in `src/generated`. The branch to fix is: `${{ inputs.branch }}` The PR number is: `${{ inputs.pr_number }}` @@ -57,9 +59,21 @@ The error summary from the failing build is: ${{ inputs.error_summary }} ``` +## Architecture overview + +The code generator (`scripts/codegen/java.ts`) reads JSON schemas from `node_modules/@github/copilot/schemas/` and produces Java source files under `src/generated/java/`. These generated types are consumed by handwritten code in `src/main/java/` (primarily `CopilotSession.java`) and tested by handwritten tests in `src/test/java/`. + +When `@github/copilot` is bumped, the schemas may change in ways the code generator does not yet handle. Common schema changes include: + +- **`$ref` references**: Inline nested type definitions replaced with `$ref` pointers to `#/definitions/` entries. The code generator must resolve these references and emit standalone Java types instead of nested records. +- **Field type changes**: Numeric fields changing between `double`, `Long`, `int`, etc. +- **Renamed fields/properties**: JSON property names changing (e.g. `input` → `inputTokens`). +- **New types or events**: Entirely new schemas or event types added. +- **Structural changes**: Properties moving between objects, new required fields, changed enum values. + ## Instructions -Follow these steps exactly. You have a maximum of **3 attempts** to fix the build. +Follow these steps exactly. You have a maximum of **3 attempts** to get `mvn verify` passing. ### Step 0: Setup @@ -70,11 +84,18 @@ git checkout "${{ inputs.branch }}" git pull origin "${{ inputs.branch }}" ``` -Set up the Java 17 environment and verify Maven is available: +Set up the Java 17 environment and verify Maven and Node.js are available: ```bash java -version mvn --version +node --version +``` + +Install codegen dependencies: + +```bash +cd scripts/codegen && npm ci && cd ../.. ``` ### Step 1: Reproduce the failure @@ -89,7 +110,59 @@ Review the full log at `/tmp/mvn-verify.log` if the tail output is insufficient. If `mvn verify` succeeds (exit code 0), there is nothing to fix. Call the `noop` safe-output with message "mvn verify already passes on branch ${{ inputs.branch }}. No fixes needed." and stop. -### Step 2: Analyze and fix (up to 3 attempts) +### Step 2: Diagnose the root cause + +Before making fixes, determine whether the failure is caused by: + +**(A) The code generator not handling new schema patterns.** Signs: +- Generated types are missing fields that the handwritten code references +- Generated types have wrong field types (e.g. `double` instead of `Long`) +- Types that used to be nested records are now missing (because `$ref` moved them to `#/definitions/`) +- New schemas exist but no corresponding Java types were generated + +**(B) Handwritten code referencing old generated type names/shapes.** Signs: +- Compilation errors in `src/main/java/` or `src/test/java/` referencing types that no longer exist +- Test data using old JSON field names + +Often **both** (A) and (B) apply: the codegen needs fixing first, then handwritten code needs updating. + +To diagnose, compare the current schemas with the generated output: + +```bash +# List available schemas +ls node_modules/@github/copilot/schemas/ + +# Check for $ref usage in schemas (indicates the codegen may need $ref resolution) +grep -r '"$ref"' node_modules/@github/copilot/schemas/ | head -20 + +# Look at a specific schema that relates to failing types +cat node_modules/@github/copilot/schemas/.json | head -80 +``` + +### Step 3: Fix the code generator (if needed) + +If the diagnosis shows the code generator does not handle the new schema format: + +1. **Read `scripts/codegen/java.ts`** to understand the current generation logic. + +2. **Fix `scripts/codegen/java.ts`** to handle the new schema patterns. Common fixes include: + - Adding `$ref` resolution to dereference `#/definitions/` pointers + - Generating standalone types for definitions instead of nested records + - Fixing type mappings for changed field types + +3. **Re-run code generation** to produce updated generated files: + ```bash + cd scripts/codegen && npm run generate && cd ../.. + ``` + +4. **Verify the generated output** looks reasonable: + ```bash + git diff --stat src/generated/java/ + ``` + +**You may ONLY modify `scripts/codegen/java.ts`.** Do not modify `package.json`, `package-lock.json`, or any other file under `scripts/codegen/`. + +### Step 4: Fix handwritten code (up to 3 attempts) For each attempt: @@ -98,49 +171,58 @@ For each attempt: - Test failures (assertion errors, runtime exceptions) - The specific files and line numbers mentioned in the errors -2. **Fix the affected source files.** You may modify files under: +2. **Read the generated types** to understand what changed. Check the generated files that the handwritten code references: + ```bash + # Example: check what a generated type looks like now + cat src/generated/java/com/github/copilot/sdk/generated/rpc/.java + ``` + +3. **Fix the affected source files.** You may modify files under: - `src/main/java/` — handwritten SDK source code - `src/test/java/` — handwritten test code - **CRITICAL: NEVER modify files under `src/generated/java/`.** Those files are auto-generated and must not be hand-edited. If the error appears to be in generated code, the fix must be in the handwritten code that consumes it. - - **CRITICAL: NEVER modify `pom.xml`.** The build configuration is not in scope. + Common fixes: + - Update type references from old nested types to new standalone types (e.g. `SessionMcpListResultServersItem` → `McpServer`) + - Fix constructor arguments for changed field types (`double` → `Long`) + - Update JSON keys in test data to match renamed schema properties + - Add/remove imports for renamed/relocated types -3. **Run formatting after making changes:** +4. **Run formatting after making changes:** ```bash mvn spotless:apply ``` -4. **Verify the fix:** +5. **Verify the fix:** ```bash mvn verify 2>&1 | tee /tmp/mvn-verify.log ``` If the output is long, check `/tmp/mvn-verify.log` for the full error details — root causes often appear early in the log. -5. If `mvn verify` passes, proceed to Step 3. +6. If `mvn verify` passes, proceed to Step 5. If it fails and you have attempts remaining, go back to sub-step 1. -### Step 3: Push fixes +### Step 5: Push fixes -After `mvn verify` passes, commit the changes and use the `push_to_pull_request_branch` safe-output tool to push to PR #${{ inputs.pr_number }}: +After `mvn verify` passes, commit all changes and use the `push_to_pull_request_branch` safe-output tool to push to PR #${{ inputs.pr_number }}: ```bash git add -A -git commit -m "Fix build failures after codegen update +git commit -m "Fix codegen and build failures after @github/copilot update Automated fix applied by codegen-agentic-fix workflow." ``` Then call the `push_to_pull_request_branch` tool to push your commits to the PR branch. -### Step 4: Failure handling +### Step 6: Failure handling If all 3 attempts fail: 1. Call the `add_comment` tool on PR #${{ inputs.pr_number }} explaining: - What errors remain - What fixes were attempted + - Whether the issue is in the code generator or handwritten code - That manual intervention is needed 2. Call the `noop` safe-output with a message summarizing the failure. @@ -149,10 +231,12 @@ Do **NOT** push broken code. ## Important constraints -- **NEVER** modify files under `src/generated/java/` — these are auto-generated +- **NEVER** hand-edit files under `src/generated/java/` — these are auto-generated. They are updated by running `cd scripts/codegen && npm run generate`. - **NEVER** modify `pom.xml` — build config is not in scope -- **NEVER** modify files under `scripts/codegen/` — codegen scripts are not in scope +- **NEVER** modify `scripts/codegen/package.json` or `scripts/codegen/package-lock.json` — dependency versions are not in scope - **NEVER** modify files under `.github/` — workflow files are not in scope +- You **MAY** modify `scripts/codegen/java.ts` to fix the code generator +- You **MAY** modify files under `src/main/java/` and `src/test/java/` to fix handwritten code - Always run `mvn spotless:apply` before committing to ensure code formatting - Maximum 3 fix attempts before reporting failure via `noop` - Only push if `mvn verify` passes diff --git a/scripts/codegen/java.ts b/scripts/codegen/java.ts index 7c2ea7091..909fe296c 100644 --- a/scripts/codegen/java.ts +++ b/scripts/codegen/java.ts @@ -97,6 +97,29 @@ interface JavaTypeResult { imports: Set; } +// Module-level state for $ref resolution during codegen. +// Set before each schema generation pass; used by schemaTypeToJava and helpers. +let currentDefinitions: Record = {}; +const pendingStandaloneTypes = new Map(); + +/** + * Resolve a $ref in a JSON Schema against the current definitions. + * Returns the resolved schema, or the original if no $ref is present. + */ +function resolveRef(schema: JSONSchema7 | undefined): JSONSchema7 | undefined { + if (!schema) return schema; + if (schema.$ref) { + const name = schema.$ref.replace(/^#\/definitions\//, ""); + const resolved = currentDefinitions[name]; + if (!resolved) { + console.warn(`[codegen] Unresolved $ref: ${schema.$ref}`); + return schema; + } + return resolved; + } + return schema; +} + function schemaTypeToJava( schema: JSONSchema7, required: boolean, @@ -106,6 +129,25 @@ function schemaTypeToJava( ): JavaTypeResult { const imports = new Set(); + // Resolve $ref first — register standalone types for generation + if (schema.$ref) { + const name = schema.$ref.replace(/^#\/definitions\//, ""); + const resolved = currentDefinitions[name]; + if (resolved) { + // Enum or object types → register for standalone generation, return ref name + if ((resolved.type === "string" && resolved.enum) || + (resolved.type === "object" && resolved.properties)) { + pendingStandaloneTypes.set(name, resolved); + return { javaType: name, imports }; + } + // Other types (primitives, arrays, maps, anyOf unions) → resolve and recurse + return schemaTypeToJava(resolved, required, context, propName, nestedTypes); + } + // Unresolved $ref — return name as-is + console.warn(`[codegen] Unresolved $ref: ${schema.$ref}`); + return { javaType: name, imports }; + } + 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"); @@ -206,11 +248,6 @@ function schemaTypeToJava( 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 }; } @@ -235,21 +272,34 @@ interface EventVariant { } function extractEventVariants(schema: JSONSchema7): EventVariant[] { - const sessionEvent = (schema.definitions as Record)?.SessionEvent; + const definitions = schema.definitions as Record; + const sessionEvent = definitions?.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; + // Resolve $ref if present (1.0.35+ schema uses $ref to named definitions) + let resolved = variant; + if (variant.$ref) { + const refName = variant.$ref.replace(/^#\/definitions\//, ""); + resolved = definitions[refName]; + if (!resolved) throw new Error(`Unresolved $ref: ${variant.$ref}`); + } + const typeSchema = resolved.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; + let dataSchema = resolved.properties?.data as JSONSchema7 | undefined; + // Resolve $ref on data schema if present + if (dataSchema?.$ref) { + const dataRefName = dataSchema.$ref.replace(/^#\/definitions\//, ""); + dataSchema = definitions[dataRefName]; + } return { typeName, className: `${baseName}Event`, dataSchema: dataSchema ?? null, - description: variant.description, + description: resolved.description, }; }) .filter((v) => !EXCLUDED_EVENT_TYPES.has(v.typeName)); @@ -260,6 +310,10 @@ async function generateSessionEvents(schemaPath: string): Promise { const schemaContent = await fs.readFile(schemaPath, "utf-8"); const schema = JSON.parse(schemaContent) as JSONSchema7; + // Set module-level definitions for $ref resolution + currentDefinitions = (schema.definitions ?? {}) as Record; + pendingStandaloneTypes.clear(); + const variants = extractEventVariants(schema); const packageName = "com.github.copilot.sdk.generated"; const packageDir = `src/generated/java/com/github/copilot/sdk/generated`; @@ -272,6 +326,9 @@ async function generateSessionEvents(schemaPath: string): Promise { await generateEventVariantClass(variant, packageName, packageDir); } + // Generate standalone types discovered via $ref resolution + await generatePendingStandaloneTypes(packageName, packageDir, GENERATED_FROM_SESSION_EVENTS); + console.log(`✅ Generated ${variants.length + 1} session event files`); } @@ -597,6 +654,141 @@ async function generateEventVariantClass( await writeGeneratedFile(`${packageDir}/${variant.className}.java`, lines.join("\n")); } +// ── Standalone $ref type generation ────────────────────────────────────────── + +/** + * Generate all pending standalone types discovered via $ref resolution. + * Iterates until no new types are discovered (handles transitive $ref chains). + */ +async function generatePendingStandaloneTypes( + packageName: string, + packageDir: string, + headerComment: string +): Promise { + const generated = new Set(); + + while (true) { + const batch: [string, JSONSchema7][] = []; + for (const [name, schema] of pendingStandaloneTypes) { + if (!generated.has(name)) { + batch.push([name, schema]); + generated.add(name); + } + } + pendingStandaloneTypes.clear(); + + if (batch.length === 0) break; + + for (const [name, schema] of batch) { + if (schema.type === "string" && schema.enum) { + await generateStandaloneEnum(name, schema, packageName, packageDir, headerComment); + } else if (schema.type === "object" && schema.properties) { + await generateStandaloneRecord(name, schema, packageName, packageDir, headerComment); + } else { + console.warn(`[codegen] Cannot generate standalone type for ${name}: type=${schema.type}`); + } + } + // Generating records may have discovered more $ref targets — loop again + } +} + +async function generateStandaloneEnum( + name: string, + schema: JSONSchema7, + packageName: string, + packageDir: string, + headerComment: string +): Promise { + const values = schema.enum as string[]; + const lines: string[] = []; + lines.push(COPYRIGHT); + lines.push(""); + lines.push(AUTO_GENERATED_HEADER); + lines.push(headerComment); + lines.push(""); + lines.push(`package ${packageName};`); + lines.push(""); + lines.push(`import javax.annotation.processing.Generated;`); + lines.push(""); + if (schema.description) { + lines.push(`/**`); + lines.push(` * ${schema.description}`); + lines.push(` *`); + lines.push(` * @since 1.0.0`); + lines.push(` */`); + } + lines.push(GENERATED_ANNOTATION); + lines.push(`public enum ${name} {`); + for (let i = 0; i < values.length; i++) { + const v = values[i]; + const comma = i < values.length - 1 ? "," : ";"; + lines.push(` /** The {@code ${v}} variant. */`); + lines.push(` ${toEnumConstant(v)}("${v}")${comma}`); + } + lines.push(""); + lines.push(` private final String value;`); + lines.push(` ${name}(String value) { this.value = value; }`); + lines.push(` @com.fasterxml.jackson.annotation.JsonValue`); + lines.push(` public String getValue() { return value; }`); + lines.push(` @com.fasterxml.jackson.annotation.JsonCreator`); + lines.push(` public static ${name} fromValue(String value) {`); + lines.push(` for (${name} v : values()) {`); + lines.push(` if (v.value.equals(value)) return v;`); + lines.push(` }`); + lines.push(` throw new IllegalArgumentException("Unknown ${name} value: " + value);`); + lines.push(` }`); + lines.push(`}`); + lines.push(""); + + await writeGeneratedFile(`${packageDir}/${name}.java`, lines.join("\n")); +} + +async function generateStandaloneRecord( + name: string, + schema: JSONSchema7, + packageName: string, + packageDir: string, + headerComment: string +): Promise { + const nestedTypes = new Map(); + const { code, imports } = generateRpcClass(name, schema, nestedTypes, packageName); + + const lines: string[] = []; + lines.push(COPYRIGHT); + lines.push(""); + lines.push(AUTO_GENERATED_HEADER); + lines.push(headerComment); + 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(` */`); + } + lines.push(GENERATED_ANNOTATION); + lines.push(code); + lines.push(""); + + await writeGeneratedFile(`${packageDir}/${name}.java`, lines.join("\n")); +} + // ── RPC types codegen ───────────────────────────────────────────────────────── interface RpcMethod { @@ -685,8 +877,13 @@ async function generateRpcTypes(schemaPath: string): Promise { server?: Record; session?: Record; clientSession?: Record; + definitions?: Record; }; + // Set module-level definitions for $ref resolution + currentDefinitions = (schema.definitions ?? {}) as Record; + pendingStandaloneTypes.clear(); + const packageName = "com.github.copilot.sdk.generated.rpc"; const packageDir = `src/generated/java/com/github/copilot/sdk/generated/rpc`; @@ -704,26 +901,33 @@ async function generateRpcTypes(schemaPath: string): Promise { 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) { + // Generate params class — resolve $ref if params is a reference + let paramsSchema = method.params as JSONSchema7 | null; + if (paramsSchema?.$ref) paramsSchema = resolveRef(paramsSchema) as JSONSchema7; + if (paramsSchema && typeof paramsSchema === "object" && paramsSchema.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")); + allFiles.push(await generateRpcDataClass(paramsClassName, paramsSchema, packageName, packageDir, method.rpcMethod, "params")); } } - // Generate result class - if (method.result && typeof method.result === "object" && (method.result as JSONSchema7).properties) { + // Generate result class — resolve $ref if result is a reference + let resultSchema = method.result as JSONSchema7 | null; + if (resultSchema?.$ref) resultSchema = resolveRef(resultSchema) as JSONSchema7; + if (resultSchema && typeof resultSchema === "object" && resultSchema.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")); + allFiles.push(await generateRpcDataClass(resultClassName, resultSchema, packageName, packageDir, method.rpcMethod, "result")); } } } } + // Generate standalone types discovered via $ref resolution + await generatePendingStandaloneTypes(packageName, packageDir, GENERATED_FROM_API); + console.log(`✅ Generated ${allFiles.length} RPC type files`); } @@ -835,11 +1039,13 @@ function apiClassName(prefix: string, path: string[]): string { * If the result schema has no properties we use Void; if no result schema we also use Void. */ function wrapperResultClassName(method: RpcMethodNode): string { + let result = method.result; + if (result?.$ref) result = resolveRef(result) as JSONSchema7; if ( - method.result && - typeof method.result === "object" && - method.result.properties && - Object.keys(method.result.properties).length > 0 + result && + typeof result === "object" && + result.properties && + Object.keys(result.properties).length > 0 ) { return rpcMethodToClassName(method.rpcMethod) + "Result"; } @@ -851,8 +1057,10 @@ function wrapperResultClassName(method: RpcMethodNode): string { * other than sessionId (i.e. there are user-supplied parameters). */ function wrapperParamsClassName(method: RpcMethodNode): string | null { - if (!method.params || typeof method.params !== "object") return null; - const props = method.params.properties ?? {}; + let params = method.params; + if (params?.$ref) params = resolveRef(params) as JSONSchema7; + if (!params || typeof params !== "object") return null; + const props = params.properties ?? {}; const userProps = Object.keys(props).filter((k) => k !== "sessionId"); if (userProps.length === 0) return null; return rpcMethodToClassName(method.rpcMethod) + "Params"; @@ -860,7 +1068,9 @@ function wrapperParamsClassName(method: RpcMethodNode): string | null { /** True if the method's params schema contains a "sessionId" property */ function methodHasSessionId(method: RpcMethodNode): boolean { - return !!method.params?.properties && "sessionId" in method.params.properties; + let params = method.params; + if (params?.$ref) params = resolveRef(params) as JSONSchema7; + return !!params?.properties && "sessionId" in params.properties; } /** @@ -1290,8 +1500,12 @@ async function generateRpcWrappers(schemaPath: string): Promise { server?: Record; session?: Record; clientSession?: Record; + definitions?: Record; }; + // Set module-level definitions for $ref resolution in wrapper helpers + currentDefinitions = (schema.definitions ?? {}) as Record; + const packageName = "com.github.copilot.sdk.generated.rpc"; const packageDir = `src/generated/java/com/github/copilot/sdk/generated/rpc`; diff --git a/scripts/codegen/package-lock.json b/scripts/codegen/package-lock.json index 4a3705f36..cbe41f202 100644 --- a/scripts/codegen/package-lock.json +++ b/scripts/codegen/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "copilot-sdk-java-codegen", "dependencies": { - "@github/copilot": "1.0.24", + "@github/copilot": "^1.0.35", "json-schema": "^0.4.0", "tsx": "^4.20.6" } @@ -428,26 +428,26 @@ } }, "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==", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.35.tgz", + "integrity": "sha512-O1nUy8DXOTE+v86b/FTkyu09EMrDy+vj+2rhmUOcmsXGe0RE5ECyESsasUTUoHK/CSgAExFTziNxbubUoiMMfg==", "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" + "@github/copilot-darwin-arm64": "1.0.35", + "@github/copilot-darwin-x64": "1.0.35", + "@github/copilot-linux-arm64": "1.0.35", + "@github/copilot-linux-x64": "1.0.35", + "@github/copilot-win32-arm64": "1.0.35", + "@github/copilot-win32-x64": "1.0.35" } }, "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==", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.35.tgz", + "integrity": "sha512-NNZE0TOz0HOlv7eqlh6EcQbNkhtnIHReBLieW6pfDUUTKkgsqbUu1MOitF8m+LUQk3ml1T0MQ5MOfad1HSa/MQ==", "cpu": [ "arm64" ], @@ -461,9 +461,9 @@ } }, "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==", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.35.tgz", + "integrity": "sha512-XCv/mfdv0rnrtrNVOluio/N/kyCge0uG2hghvtlgO/+z6EjvzFygkpXXS1gVxiXhWc3lX232cTXQU3zklC/8Ng==", "cpu": [ "x64" ], @@ -477,9 +477,9 @@ } }, "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==", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.35.tgz", + "integrity": "sha512-mbaadATfJPzmXq2SD1TWocIG/GobcYC6OvNFhCG8UXMsiXY5cevhszl5ujuayhPJBxS77Yj5uvIFjNQ1Kf5V8Q==", "cpu": [ "arm64" ], @@ -493,9 +493,9 @@ } }, "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==", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.35.tgz", + "integrity": "sha512-NrZ0VjztdBbJ5qAmuUtuKsWkimOaqzjDV+ZGUv1FxSxoys40kiiakQ5WbnMFDzaIFaf47zDi++6ixgQzq7Jk5A==", "cpu": [ "x64" ], @@ -509,9 +509,9 @@ } }, "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==", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.35.tgz", + "integrity": "sha512-KQN7Q7+oPyglmvUEiMp6SYWjl30VSu91T0dUpNHbUs/xRM3qgnCymLPPUyBZGWHog/FueUAsRkhisMHWQVnO+g==", "cpu": [ "arm64" ], @@ -525,9 +525,9 @@ } }, "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==", + "version": "1.0.35", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.35.tgz", + "integrity": "sha512-J0XhXO2FmlFr8pGa970xEd4tr1rqFiZxoaPW5WvkJYZoZUHbBhFcGasp5/yEeJ71b3vI4PHm/mSZZebD3ALMKQ==", "cpu": [ "x64" ], diff --git a/scripts/codegen/package.json b/scripts/codegen/package.json index 38dd5fc1f..5cf9c687c 100644 --- a/scripts/codegen/package.json +++ b/scripts/codegen/package.json @@ -7,7 +7,7 @@ "generate:java": "tsx java.ts" }, "dependencies": { - "@github/copilot": "1.0.24", + "@github/copilot": "^1.0.35", "json-schema": "^0.4.0", "tsx": "^4.20.6" } diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java index 78ccbf42f..a6d75a8f6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java @@ -41,7 +41,7 @@ public record AssistantMessageEventData( /** The assistant's text response content */ @JsonProperty("content") String content, /** Tool invocations requested by the assistant in this message */ - @JsonProperty("toolRequests") List toolRequests, + @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 */ @@ -59,46 +59,5 @@ public record AssistantMessageEventData( /** 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/AssistantMessageToolRequest.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequest.java new file mode 100644 index 000000000..d45803b66 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequest.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * A tool invocation request from the assistant + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record AssistantMessageToolRequest( + /** 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") AssistantMessageToolRequestType 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 +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequestType.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequestType.java new file mode 100644 index 000000000..024b845d6 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequestType.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AssistantMessageToolRequestType { + /** The {@code function} variant. */ + FUNCTION("function"), + /** The {@code custom} variant. */ + CUSTOM("custom"); + + private final String value; + AssistantMessageToolRequestType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AssistantMessageToolRequestType fromValue(String value) { + for (AssistantMessageToolRequestType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AssistantMessageToolRequestType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsage.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsage.java new file mode 100644 index 000000000..4bb8aa92c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsage.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * Per-request cost and usage data from the CAPI copilot_usage response field + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record AssistantUsageCopilotUsage( + /** Itemized token usage breakdown */ + @JsonProperty("tokenDetails") List tokenDetails, + /** Total cost in nano-AIU (AI Units) for this request */ + @JsonProperty("totalNanoAiu") Double totalNanoAiu +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsageTokenDetail.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsageTokenDetail.java new file mode 100644 index 000000000..895f19030 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsageTokenDetail.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Token usage detail for a single billing category + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record AssistantUsageCopilotUsageTokenDetail( + /** 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/AssistantUsageEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageEvent.java index 65f47bfad..4613d520e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageEvent.java @@ -10,8 +10,6 @@ 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; @@ -67,59 +65,11 @@ public record AssistantUsageEventData( /** 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, + @JsonProperty("quotaSnapshots") Map quotaSnapshots, /** Per-request cost and usage data from the CAPI copilot_usage response field */ - @JsonProperty("copilotUsage") AssistantUsageEventDataCopilotUsage copilotUsage, + @JsonProperty("copilotUsage") AssistantUsageCopilotUsage 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/AssistantUsageQuotaSnapshot.java b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageQuotaSnapshot.java new file mode 100644 index 000000000..0986f67d7 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageQuotaSnapshot.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record AssistantUsageQuotaSnapshot( + /** 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 +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchCompletedEvent.java new file mode 100644 index 000000000..a6d994d6b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchCompletedEvent.java @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * 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 auto_mode_switch.completed} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AutoModeSwitchCompletedEvent extends SessionEvent { + + @Override + public String getType() { return "auto_mode_switch.completed"; } + + @JsonProperty("data") + private AutoModeSwitchCompletedEventData data; + + public AutoModeSwitchCompletedEventData getData() { return data; } + public void setData(AutoModeSwitchCompletedEventData data) { this.data = data; } + + /** Data payload for {@link AutoModeSwitchCompletedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AutoModeSwitchCompletedEventData( + /** Request ID of the resolved request; clients should dismiss any UI for this request */ + @JsonProperty("requestId") String requestId, + /** The user's choice: 'yes', 'yes_always', or 'no' */ + @JsonProperty("response") String response + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchRequestedEvent.java new file mode 100644 index 000000000..8ad1a2da8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchRequestedEvent.java @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * 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 auto_mode_switch.requested} session event. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class AutoModeSwitchRequestedEvent extends SessionEvent { + + @Override + public String getType() { return "auto_mode_switch.requested"; } + + @JsonProperty("data") + private AutoModeSwitchRequestedEventData data; + + public AutoModeSwitchRequestedEventData getData() { return data; } + public void setData(AutoModeSwitchRequestedEventData data) { this.data = data; } + + /** Data payload for {@link AutoModeSwitchRequestedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record AutoModeSwitchRequestedEventData( + /** Unique identifier for this request; used to respond via session.respondToAutoModeSwitch() */ + @JsonProperty("requestId") String requestId, + /** The rate limit error code that triggered this request */ + @JsonProperty("errorCode") String errorCode + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java index fbf14f8ec..6ee7768fb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java @@ -36,16 +36,7 @@ public final class CapabilitiesChangedEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record CapabilitiesChangedEventData( /** UI capability changes */ - @JsonProperty("ui") CapabilitiesChangedEventDataUi ui + @JsonProperty("ui") CapabilitiesChangedUI 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/CapabilitiesChangedUI.java b/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedUI.java new file mode 100644 index 000000000..828733b04 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedUI.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * UI capability changes + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CapabilitiesChangedUI( + /** Whether elicitation is now supported */ + @JsonProperty("elicitation") Boolean elicitation +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedCommand.java b/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedCommand.java new file mode 100644 index 000000000..30c8e9962 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedCommand.java @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CommandsChangedCommand( + @JsonProperty("name") String name, + @JsonProperty("description") String description +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java index a7704b6c8..48576c314 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java @@ -37,15 +37,7 @@ public final class CommandsChangedEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record CommandsChangedEventData( /** Current list of registered SDK commands */ - @JsonProperty("commands") List 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/CompactionCompleteCompactionTokensUsed.java b/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsed.java new file mode 100644 index 000000000..440979392 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsed.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * Token usage breakdown for the compaction LLM call (aligned with assistant.usage format) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CompactionCompleteCompactionTokensUsed( + /** Input tokens consumed by the compaction LLM call */ + @JsonProperty("inputTokens") Double inputTokens, + /** Output tokens produced by the compaction LLM call */ + @JsonProperty("outputTokens") Double outputTokens, + /** Cached input tokens reused in the compaction LLM call */ + @JsonProperty("cacheReadTokens") Double cacheReadTokens, + /** Tokens written to prompt cache in the compaction LLM call */ + @JsonProperty("cacheWriteTokens") Double cacheWriteTokens, + /** Per-request cost and usage data from the CAPI copilot_usage response field */ + @JsonProperty("copilotUsage") CompactionCompleteCompactionTokensUsedCopilotUsage copilotUsage, + /** Duration of the compaction LLM call in milliseconds */ + @JsonProperty("duration") Double duration, + /** Model identifier used for the compaction LLM call */ + @JsonProperty("model") String model +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java b/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java new file mode 100644 index 000000000..7e02e4f77 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * Per-request cost and usage data from the CAPI copilot_usage response field + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CompactionCompleteCompactionTokensUsedCopilotUsage( + /** Itemized token usage breakdown */ + @JsonProperty("tokenDetails") List tokenDetails, + /** Total cost in nano-AIU (AI Units) for this request */ + @JsonProperty("totalNanoAiu") Double totalNanoAiu +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java b/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java new file mode 100644 index 000000000..3c7fde8ad --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Token usage detail for a single billing category + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail( + /** 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/CustomAgentsUpdatedAgent.java b/src/generated/java/com/github/copilot/sdk/generated/CustomAgentsUpdatedAgent.java new file mode 100644 index 000000000..74637aaa8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/CustomAgentsUpdatedAgent.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CustomAgentsUpdatedAgent( + /** 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/ElicitationCompletedAction.java b/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedAction.java new file mode 100644 index 000000000..32e4723e5 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedAction.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ElicitationCompletedAction { + /** The {@code accept} variant. */ + ACCEPT("accept"), + /** The {@code decline} variant. */ + DECLINE("decline"), + /** The {@code cancel} variant. */ + CANCEL("cancel"); + + private final String value; + ElicitationCompletedAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ElicitationCompletedAction fromValue(String value) { + for (ElicitationCompletedAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ElicitationCompletedAction value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java index 45cbf54c7..ae94b6bf3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java @@ -39,31 +39,9 @@ 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, + @JsonProperty("action") ElicitationCompletedAction 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 index 838afbc50..fd5773df6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedEvent.java @@ -10,8 +10,6 @@ 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; /** @@ -46,44 +44,11 @@ public record ElicitationRequestedEventData( /** 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, + @JsonProperty("mode") ElicitationRequestedMode mode, /** JSON Schema describing the form fields to present to the user (form mode only) */ - @JsonProperty("requestedSchema") ElicitationRequestedEventDataRequestedSchema requestedSchema, + @JsonProperty("requestedSchema") ElicitationRequestedSchema 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/ElicitationRequestedMode.java b/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedMode.java new file mode 100644 index 000000000..ffe24b56f --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedMode.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ElicitationRequestedMode { + /** The {@code form} variant. */ + FORM("form"), + /** The {@code url} variant. */ + URL("url"); + + private final String value; + ElicitationRequestedMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ElicitationRequestedMode fromValue(String value) { + for (ElicitationRequestedMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ElicitationRequestedMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedSchema.java b/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedSchema.java new file mode 100644 index 000000000..4234867ad --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedSchema.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * JSON Schema describing the form fields to present to the user (form mode only) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ElicitationRequestedSchema( + /** 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/ExtensionsLoadedExtension.java b/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtension.java new file mode 100644 index 000000000..366ea550c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtension.java @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ExtensionsLoadedExtension( + /** 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") ExtensionsLoadedExtensionSource source, + /** Current status: running, disabled, failed, or starting */ + @JsonProperty("status") ExtensionsLoadedExtensionStatus status +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionSource.java b/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionSource.java new file mode 100644 index 000000000..d6409caf4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionSource.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Discovery source + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ExtensionsLoadedExtensionSource { + /** The {@code project} variant. */ + PROJECT("project"), + /** The {@code user} variant. */ + USER("user"); + + private final String value; + ExtensionsLoadedExtensionSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ExtensionsLoadedExtensionSource fromValue(String value) { + for (ExtensionsLoadedExtensionSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ExtensionsLoadedExtensionSource value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionStatus.java b/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionStatus.java new file mode 100644 index 000000000..a4ef8de99 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionStatus.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Current status: running, disabled, failed, or starting + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ExtensionsLoadedExtensionStatus { + /** 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; + ExtensionsLoadedExtensionStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ExtensionsLoadedExtensionStatus fromValue(String value) { + for (ExtensionsLoadedExtensionStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ExtensionsLoadedExtensionStatus value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/HandoffRepository.java b/src/generated/java/com/github/copilot/sdk/generated/HandoffRepository.java new file mode 100644 index 000000000..a87002c9e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/HandoffRepository.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Repository context for the handed-off session + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record HandoffRepository( + /** 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/HandoffSourceType.java b/src/generated/java/com/github/copilot/sdk/generated/HandoffSourceType.java new file mode 100644 index 000000000..06f39c214 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/HandoffSourceType.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Origin type of the session being handed off + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HandoffSourceType { + /** The {@code remote} variant. */ + REMOTE("remote"), + /** The {@code local} variant. */ + LOCAL("local"); + + private final String value; + HandoffSourceType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HandoffSourceType fromValue(String value) { + for (HandoffSourceType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HandoffSourceType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/HookEndError.java b/src/generated/java/com/github/copilot/sdk/generated/HookEndError.java new file mode 100644 index 000000000..bbf992536 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/HookEndError.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Error details when the hook failed + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record HookEndError( + /** 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/HookEndEvent.java b/src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java index 51de160c1..c2a80b0f3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java @@ -44,18 +44,7 @@ public record HookEndEventData( /** Whether the hook completed successfully */ @JsonProperty("success") Boolean success, /** Error details when the hook failed */ - @JsonProperty("error") HookEndEventDataError error + @JsonProperty("error") HookEndError 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/McpOauthRequiredEvent.java b/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java index 748cdfc9b..c7ef7a12a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java @@ -42,18 +42,7 @@ public record McpOauthRequiredEventData( /** 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 + @JsonProperty("staticClientConfig") McpOauthRequiredStaticClientConfig 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/McpOauthRequiredStaticClientConfig.java b/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredStaticClientConfig.java new file mode 100644 index 000000000..b8c0dd93d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredStaticClientConfig.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Static OAuth client configuration, if the server specifies one + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpOauthRequiredStaticClientConfig( + /** 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/McpServerStatusChangedStatus.java b/src/generated/java/com/github/copilot/sdk/generated/McpServerStatusChangedStatus.java new file mode 100644 index 000000000..c0a6d989d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/McpServerStatusChangedStatus.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 javax.annotation.processing.Generated; + +/** + * New connection status: connected, failed, needs-auth, pending, disabled, or not_configured + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpServerStatusChangedStatus { + /** 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; + McpServerStatusChangedStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpServerStatusChangedStatus fromValue(String value) { + for (McpServerStatusChangedStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpServerStatusChangedStatus value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServer.java b/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServer.java new file mode 100644 index 000000000..9e17180de --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServer.java @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpServersLoadedServer( + /** Server name (config key) */ + @JsonProperty("name") String name, + /** Connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + @JsonProperty("status") McpServersLoadedServerStatus status, + /** Configuration source: user, workspace, plugin, or builtin */ + @JsonProperty("source") String source, + /** Error message if the server failed to connect */ + @JsonProperty("error") String error +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServerStatus.java b/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServerStatus.java new file mode 100644 index 000000000..4d09fe2a3 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServerStatus.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 javax.annotation.processing.Generated; + +/** + * Connection status: connected, failed, needs-auth, pending, disabled, or not_configured + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpServersLoadedServerStatus { + /** 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; + McpServersLoadedServerStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpServersLoadedServerStatus fromValue(String value) { + for (McpServersLoadedServerStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpServersLoadedServerStatus value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java index 06300a5ae..0045393c1 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java @@ -37,45 +37,10 @@ public final class PermissionCompletedEvent extends SessionEvent { public record PermissionCompletedEventData( /** Request ID of the resolved permission request; clients should dismiss any UI for this request */ @JsonProperty("requestId") String requestId, + /** Optional tool call ID associated with this permission prompt; clients may use it to correlate UI created from tool-scoped prompts */ + @JsonProperty("toolCallId") String toolCallId, /** The result of the permission request */ - @JsonProperty("result") PermissionCompletedEventDataResult result + @JsonProperty("result") PermissionCompletedResult 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/PermissionCompletedKind.java b/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedKind.java new file mode 100644 index 000000000..c02f221fd --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedKind.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 javax.annotation.processing.Generated; + +/** + * The outcome of the permission request + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PermissionCompletedKind { + /** The {@code approved} variant. */ + APPROVED("approved"), + /** The {@code approved-for-session} variant. */ + APPROVED_FOR_SESSION("approved-for-session"), + /** The {@code approved-for-location} variant. */ + APPROVED_FOR_LOCATION("approved-for-location"), + /** 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; + PermissionCompletedKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionCompletedKind fromValue(String value) { + for (PermissionCompletedKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionCompletedKind value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedResult.java b/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedResult.java new file mode 100644 index 000000000..4a180001c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedResult.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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 result of the permission request + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PermissionCompletedResult( + /** The outcome of the permission request */ + @JsonProperty("kind") PermissionCompletedKind kind +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java index 83a1967c7..7892d3afe 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java @@ -39,6 +39,8 @@ public record PermissionRequestedEventData( @JsonProperty("requestId") String requestId, /** Details of the permission being requested */ @JsonProperty("permissionRequest") Object permissionRequest, + /** Derived user-facing permission prompt details for UI consumers */ + @JsonProperty("promptRequest") Object promptRequest, /** 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/PlanChangedOperation.java b/src/generated/java/com/github/copilot/sdk/generated/PlanChangedOperation.java new file mode 100644 index 000000000..cd52d7ec1 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/PlanChangedOperation.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * The type of operation performed on the plan file + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PlanChangedOperation { + /** The {@code create} variant. */ + CREATE("create"), + /** The {@code update} variant. */ + UPDATE("update"), + /** The {@code delete} variant. */ + DELETE("delete"); + + private final String value; + PlanChangedOperation(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PlanChangedOperation fromValue(String value) { + for (PlanChangedOperation v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PlanChangedOperation value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java index 14728cf20..5f3798098 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java @@ -55,8 +55,8 @@ public record SessionCompactionCompleteEventData( @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, + /** Token usage breakdown for the compaction LLM call (aligned with assistant.usage format) */ + @JsonProperty("compactionTokensUsed") CompactionCompleteCompactionTokensUsed 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 */ @@ -66,18 +66,5 @@ public record SessionCompactionCompleteEventData( /** 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/SessionContextChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java index 5399860a2..0eb9e7e34 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java @@ -42,7 +42,9 @@ public record SessionContextChangedEventData( /** 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, + @JsonProperty("hostType") WorkingDirectoryContextHostType hostType, + /** Raw host string from the git remote URL (e.g. "github.com", "mycompany.ghe.com", "dev.azure.com") */ + @JsonProperty("repositoryHost") String repositoryHost, /** Current git branch name */ @JsonProperty("branch") String branch, /** Head commit of current git branch at session start time */ @@ -50,25 +52,5 @@ public record SessionContextChangedEventData( /** 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 index 0a0c3f761..be5e15e91 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionCustomAgentsUpdatedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionCustomAgentsUpdatedEvent.java @@ -37,33 +37,11 @@ public final class SessionCustomAgentsUpdatedEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionCustomAgentsUpdatedEventData( /** Array of loaded custom agent metadata */ - @JsonProperty("agents") List agents, + @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/SessionEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java index 1b63b238e..85c62a241 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java @@ -88,6 +88,8 @@ @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 = AutoModeSwitchRequestedEvent.class, name = "auto_mode_switch.requested"), + @JsonSubTypes.Type(value = AutoModeSwitchCompletedEvent.class, name = "auto_mode_switch.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"), @@ -165,6 +167,8 @@ public abstract sealed class SessionEvent permits CommandQueuedEvent, CommandExecuteEvent, CommandCompletedEvent, + AutoModeSwitchRequestedEvent, + AutoModeSwitchCompletedEvent, CommandsChangedEvent, CapabilitiesChangedEvent, ExitPlanModeRequestedEvent, diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java index 969851a78..4d3420174 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java @@ -37,65 +37,7 @@ public final class SessionExtensionsLoadedEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionExtensionsLoadedEventData( /** Array of discovered extensions and their status */ - @JsonProperty("extensions") List extensions + @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 index 431108733..86706272f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionHandoffEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionHandoffEvent.java @@ -39,9 +39,9 @@ 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, + @JsonProperty("sourceType") HandoffSourceType sourceType, /** Repository context for the handed-off session */ - @JsonProperty("repository") SessionHandoffEventDataRepository repository, + @JsonProperty("repository") HandoffRepository repository, /** Additional context information for the handoff */ @JsonProperty("context") String context, /** Summary of the work done in the source session */ @@ -51,38 +51,5 @@ public record SessionHandoffEventData( /** 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/SessionMcpServerStatusChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java index 7bf09f7f5..c422bf29a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java @@ -38,35 +38,7 @@ 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 + @JsonProperty("status") McpServerStatusChangedStatus 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 index e6ab5f25d..be2d4cf74 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServersLoadedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServersLoadedEvent.java @@ -37,49 +37,7 @@ public final class SessionMcpServersLoadedEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionMcpServersLoadedEventData( /** Array of MCP server status summaries */ - @JsonProperty("servers") List servers + @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/SessionPlanChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java index 0ea80289a..4677d1cdb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java @@ -36,29 +36,7 @@ public final class SessionPlanChangedEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionPlanChangedEventData( /** The type of operation performed on the plan file */ - @JsonProperty("operation") SessionPlanChangedEventDataOperation operation + @JsonProperty("operation") PlanChangedOperation 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/SessionResumeEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java index e132a1c9f..7973e7d17 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java @@ -45,52 +45,11 @@ public record SessionResumeEventData( /** 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, + @JsonProperty("context") WorkingDirectoryContext 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 index 929d7eb79..39b6cfcfa 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionShutdownEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionShutdownEvent.java @@ -10,7 +10,6 @@ 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; @@ -38,7 +37,7 @@ public final class SessionShutdownEvent extends SessionEvent { @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, + @JsonProperty("shutdownType") ShutdownType shutdownType, /** Error description when shutdownType is "error" */ @JsonProperty("errorReason") String errorReason, /** Total number of premium API requests used during the session */ @@ -48,9 +47,9 @@ public record SessionShutdownEventData( /** Unix timestamp (milliseconds) when the session started */ @JsonProperty("sessionStartTime") Double sessionStartTime, /** Aggregate code change metrics for the session */ - @JsonProperty("codeChanges") SessionShutdownEventDataCodeChanges codeChanges, + @JsonProperty("codeChanges") ShutdownCodeChanges codeChanges, /** Per-model usage breakdown, keyed by model identifier */ - @JsonProperty("modelMetrics") Map modelMetrics, + @JsonProperty("modelMetrics") Map modelMetrics, /** Model that was selected at the time of shutdown */ @JsonProperty("currentModel") String currentModel, /** Total tokens in context window at shutdown */ @@ -62,76 +61,5 @@ public record SessionShutdownEventData( /** 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 index e1a2857cd..b5e64465d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionSkillsLoadedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionSkillsLoadedEvent.java @@ -37,25 +37,7 @@ public final class SessionSkillsLoadedEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionSkillsLoadedEventData( /** Array of resolved skill metadata */ - @JsonProperty("skills") List skills + @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/SessionStartEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java index 2db2d3fe7..6d83575e8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java @@ -51,52 +51,11 @@ public record SessionStartEventData( /** 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, + @JsonProperty("context") WorkingDirectoryContext 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/SessionWorkspaceFileChangedEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java index ea2245adf..9dedc7a5e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java @@ -38,27 +38,7 @@ 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 + @JsonProperty("operation") WorkspaceFileChangedOperation 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/ShutdownCodeChanges.java b/src/generated/java/com/github/copilot/sdk/generated/ShutdownCodeChanges.java new file mode 100644 index 000000000..1afb58b69 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ShutdownCodeChanges.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * Aggregate code change metrics for the session + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ShutdownCodeChanges( + /** 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 +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetric.java b/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetric.java new file mode 100644 index 000000000..e5cae1476 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetric.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 com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ShutdownModelMetric( + /** Request count and cost metrics */ + @JsonProperty("requests") ShutdownModelMetricRequests requests, + /** Token usage breakdown */ + @JsonProperty("usage") ShutdownModelMetricUsage usage +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricRequests.java b/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricRequests.java new file mode 100644 index 000000000..1872a6603 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricRequests.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Request count and cost metrics + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ShutdownModelMetricRequests( + /** 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 +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricUsage.java b/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricUsage.java new file mode 100644 index 000000000..bd47eaeb5 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricUsage.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * Token usage breakdown + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ShutdownModelMetricUsage( + /** 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/ShutdownType.java b/src/generated/java/com/github/copilot/sdk/generated/ShutdownType.java new file mode 100644 index 000000000..fbc627df8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ShutdownType.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Whether the session ended normally ("routine") or due to a crash/fatal error ("error") + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ShutdownType { + /** The {@code routine} variant. */ + ROUTINE("routine"), + /** The {@code error} variant. */ + ERROR("error"); + + private final String value; + ShutdownType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ShutdownType fromValue(String value) { + for (ShutdownType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ShutdownType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SkillsLoadedSkill.java b/src/generated/java/com/github/copilot/sdk/generated/SkillsLoadedSkill.java new file mode 100644 index 000000000..2183dad5c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SkillsLoadedSkill.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SkillsLoadedSkill( + /** 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/SystemMessageEvent.java b/src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java index 8df24f3a6..07ae27000 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java @@ -10,7 +10,6 @@ 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; /** @@ -36,45 +35,14 @@ public final class SystemMessageEvent extends SessionEvent { @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public record SystemMessageEventData( - /** The system or developer prompt text */ + /** The system or developer prompt text sent as model input */ @JsonProperty("content") String content, /** Message role: "system" for system prompts, "developer" for developer-injected instructions */ - @JsonProperty("role") SystemMessageEventDataRole role, + @JsonProperty("role") SystemMessageRole role, /** Optional name identifier for the message source */ @JsonProperty("name") String name, /** Metadata about the prompt template and its construction */ - @JsonProperty("metadata") SystemMessageEventDataMetadata metadata + @JsonProperty("metadata") SystemMessageMetadata 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/SystemMessageMetadata.java b/src/generated/java/com/github/copilot/sdk/generated/SystemMessageMetadata.java new file mode 100644 index 000000000..2b054dc94 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SystemMessageMetadata.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * Metadata about the prompt template and its construction + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SystemMessageMetadata( + /** 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/SystemMessageRole.java b/src/generated/java/com/github/copilot/sdk/generated/SystemMessageRole.java new file mode 100644 index 000000000..921b69ec0 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/SystemMessageRole.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Message role: "system" for system prompts, "developer" for developer-injected instructions + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SystemMessageRole { + /** The {@code system} variant. */ + SYSTEM("system"), + /** The {@code developer} variant. */ + DEVELOPER("developer"); + + private final String value; + SystemMessageRole(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SystemMessageRole fromValue(String value) { + for (SystemMessageRole v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SystemMessageRole value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteError.java b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteError.java new file mode 100644 index 000000000..dbdc99ba7 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteError.java @@ -0,0 +1,29 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Error details when the tool execution failed + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteError( + /** 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/ToolExecutionCompleteEvent.java b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java index 41ca020ff..6481374d1 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java @@ -10,7 +10,6 @@ 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; @@ -48,37 +47,13 @@ public record ToolExecutionCompleteEventData( /** 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, + @JsonProperty("result") ToolExecutionCompleteResult result, /** Error details when the tool execution failed */ - @JsonProperty("error") ToolExecutionCompleteEventDataError error, + @JsonProperty("error") ToolExecutionCompleteError 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/ToolExecutionCompleteResult.java b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteResult.java new file mode 100644 index 000000000..8f2830541 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteResult.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.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; + +/** + * Tool execution result on success + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteResult( + /** 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 +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserMessageAgentMode.java b/src/generated/java/com/github/copilot/sdk/generated/UserMessageAgentMode.java new file mode 100644 index 000000000..6c1710602 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/UserMessageAgentMode.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * The agent mode that was active when this message was sent + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum UserMessageAgentMode { + /** 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; + UserMessageAgentMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static UserMessageAgentMode fromValue(String value) { + for (UserMessageAgentMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown UserMessageAgentMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java b/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java index e3efe4088..5d156082d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java +++ b/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java @@ -42,36 +42,16 @@ public record UserMessageEventData( @JsonProperty("transformedContent") String transformedContent, /** Files, selections, or GitHub references attached to the message */ @JsonProperty("attachments") List attachments, + /** Normalized document MIME types that were sent natively instead of through tagged_files XML */ + @JsonProperty("supportedNativeDocumentMimeTypes") List supportedNativeDocumentMimeTypes, + /** Path-backed native document attachments that stayed on the tagged_files path flow because native upload would exceed the request size limit */ + @JsonProperty("nativeDocumentPathFallbackPaths") List nativeDocumentPathFallbackPaths, /** 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, + @JsonProperty("agentMode") UserMessageAgentMode 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/WorkingDirectoryContext.java b/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContext.java new file mode 100644 index 000000000..b023859e2 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContext.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; + +/** + * Working directory and git context at session start + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record WorkingDirectoryContext( + /** 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") WorkingDirectoryContextHostType hostType, + /** Raw host string from the git remote URL (e.g. "github.com", "mycompany.ghe.com", "dev.azure.com") */ + @JsonProperty("repositoryHost") String repositoryHost, + /** 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 +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContextHostType.java b/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContextHostType.java new file mode 100644 index 000000000..4786b8bc0 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContextHostType.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Hosting platform type of the repository (github or ado) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum WorkingDirectoryContextHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + WorkingDirectoryContextHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static WorkingDirectoryContextHostType fromValue(String value) { + for (WorkingDirectoryContextHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown WorkingDirectoryContextHostType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/WorkspaceFileChangedOperation.java b/src/generated/java/com/github/copilot/sdk/generated/WorkspaceFileChangedOperation.java new file mode 100644 index 000000000..7e21ec548 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/WorkspaceFileChangedOperation.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.sdk.generated; + +import javax.annotation.processing.Generated; + +/** + * Whether the file was newly created or updated + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum WorkspaceFileChangedOperation { + /** The {@code create} variant. */ + CREATE("create"), + /** The {@code update} variant. */ + UPDATE("update"); + + private final String value; + WorkspaceFileChangedOperation(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static WorkspaceFileChangedOperation fromValue(String value) { + for (WorkspaceFileChangedOperation v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown WorkspaceFileChangedOperation 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 index 29ebfa7e3..47e3b55ee 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountGetQuotaResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountGetQuotaResult.java @@ -23,24 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record AccountGetQuotaResult( /** Quota snapshots keyed by type (e.g., chat, completions, premium_interactions) */ - @JsonProperty("quotaSnapshots") Map quotaSnapshots + @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/AccountQuotaSnapshot.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountQuotaSnapshot.java new file mode 100644 index 000000000..c6d814930 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountQuotaSnapshot.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record AccountQuotaSnapshot( + /** Whether the user has an unlimited usage entitlement */ + @JsonProperty("isUnlimitedEntitlement") Boolean isUnlimitedEntitlement, + /** Number of requests included in the entitlement */ + @JsonProperty("entitlementRequests") Long entitlementRequests, + /** Number of requests used so far this period */ + @JsonProperty("usedRequests") Long usedRequests, + /** Whether usage is still permitted after quota exhaustion */ + @JsonProperty("usageAllowedWithExhaustedQuota") Boolean usageAllowedWithExhaustedQuota, + /** Percentage of entitlement remaining */ + @JsonProperty("remainingPercentage") Double remainingPercentage, + /** Number of overage requests made this period */ + @JsonProperty("overage") Double overage, + /** Whether overage is allowed when quota is exhausted */ + @JsonProperty("overageAllowedWithExhaustedQuota") Boolean overageAllowedWithExhaustedQuota, + /** Date when the quota resets (ISO 8601 string) */ + @JsonProperty("resetDate") String resetDate +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/AgentInfo.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/AgentInfo.java new file mode 100644 index 000000000..edd34eb94 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/AgentInfo.java @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record AgentInfo( + /** 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/AuthInfoType.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/AuthInfoType.java new file mode 100644 index 000000000..89c5db85c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/AuthInfoType.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 javax.annotation.processing.Generated; + +/** + * Authentication type + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AuthInfoType { + /** The {@code hmac} variant. */ + HMAC("hmac"), + /** The {@code env} variant. */ + ENV("env"), + /** The {@code user} variant. */ + USER("user"), + /** The {@code gh-cli} variant. */ + GH_CLI("gh-cli"), + /** The {@code api-key} variant. */ + API_KEY("api-key"), + /** The {@code token} variant. */ + TOKEN("token"), + /** The {@code copilot-api-token} variant. */ + COPILOT_API_TOKEN("copilot-api-token"); + + private final String value; + AuthInfoType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AuthInfoType fromValue(String value) { + for (AuthInfoType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AuthInfoType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServer.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServer.java new file mode 100644 index 000000000..0429b26e1 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServer.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 javax.annotation.processing.Generated; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record DiscoveredMcpServer( + /** Server name (config key) */ + @JsonProperty("name") String name, + /** Server transport type: stdio, http, sse, or memory (local configs are normalized to stdio) */ + @JsonProperty("type") DiscoveredMcpServerType type, + /** Configuration source */ + @JsonProperty("source") DiscoveredMcpServerSource source, + /** Whether the server is enabled (not in the disabled list) */ + @JsonProperty("enabled") Boolean enabled +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerSource.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerSource.java new file mode 100644 index 000000000..6bc451b34 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerSource.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 javax.annotation.processing.Generated; + +/** + * Configuration source + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum DiscoveredMcpServerSource { + /** 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; + DiscoveredMcpServerSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static DiscoveredMcpServerSource fromValue(String value) { + for (DiscoveredMcpServerSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown DiscoveredMcpServerSource value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerType.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerType.java new file mode 100644 index 000000000..1ed552021 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerType.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 javax.annotation.processing.Generated; + +/** + * Server transport type: stdio, http, sse, or memory (local configs are normalized to stdio) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum DiscoveredMcpServerType { + /** The {@code stdio} variant. */ + STDIO("stdio"), + /** The {@code http} variant. */ + HTTP("http"), + /** The {@code sse} variant. */ + SSE("sse"), + /** The {@code memory} variant. */ + MEMORY("memory"); + + private final String value; + DiscoveredMcpServerType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static DiscoveredMcpServerType fromValue(String value) { + for (DiscoveredMcpServerType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown DiscoveredMcpServerType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/Extension.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/Extension.java new file mode 100644 index 000000000..14af4c77d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/Extension.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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record Extension( + /** 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") ExtensionSource source, + /** Current status: running, disabled, failed, or starting */ + @JsonProperty("status") ExtensionStatus status, + /** Process ID if the extension is running */ + @JsonProperty("pid") Long pid +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionSource.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionSource.java new file mode 100644 index 000000000..2ec3da397 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionSource.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 javax.annotation.processing.Generated; + +/** + * Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ExtensionSource { + /** The {@code project} variant. */ + PROJECT("project"), + /** The {@code user} variant. */ + USER("user"); + + private final String value; + ExtensionSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ExtensionSource fromValue(String value) { + for (ExtensionSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ExtensionSource value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionStatus.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionStatus.java new file mode 100644 index 000000000..241a5cd60 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionStatus.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 javax.annotation.processing.Generated; + +/** + * Current status: running, disabled, failed, or starting + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ExtensionStatus { + /** 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; + ExtensionStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ExtensionStatus fromValue(String value) { + for (ExtensionStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ExtensionStatus value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/HistoryCompactContextWindow.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/HistoryCompactContextWindow.java new file mode 100644 index 000000000..4ac1a8fa9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/HistoryCompactContextWindow.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Post-compaction context window usage breakdown + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record HistoryCompactContextWindow( + /** Maximum token count for the model's context window */ + @JsonProperty("tokenLimit") Long tokenLimit, + /** Current total tokens in the context window (system + conversation + tool definitions) */ + @JsonProperty("currentTokens") Long currentTokens, + /** Current number of messages in the conversation */ + @JsonProperty("messagesLength") Long messagesLength, + /** Token count from system message(s) */ + @JsonProperty("systemTokens") Long systemTokens, + /** Token count from non-system messages (user, assistant, tool) */ + @JsonProperty("conversationTokens") Long conversationTokens, + /** Token count from tool definitions */ + @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSources.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSources.java new file mode 100644 index 000000000..7ca267a1b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSources.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record InstructionsSources( + /** Unique identifier for this source (used for toggling) */ + @JsonProperty("id") String id, + /** Human-readable label */ + @JsonProperty("label") String label, + /** File path relative to repo or absolute for home */ + @JsonProperty("sourcePath") String sourcePath, + /** Raw content of the instruction file */ + @JsonProperty("content") String content, + /** Category of instruction source — used for merge logic */ + @JsonProperty("type") InstructionsSourcesType type, + /** Where this source lives — used for UI grouping */ + @JsonProperty("location") InstructionsSourcesLocation location, + /** Glob pattern from frontmatter — when set, this instruction applies only to matching files */ + @JsonProperty("applyTo") String applyTo, + /** Short description (body after frontmatter) for use in instruction tables */ + @JsonProperty("description") String description +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesLocation.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesLocation.java new file mode 100644 index 000000000..01b702cfe --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesLocation.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * Where this source lives — used for UI grouping + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum InstructionsSourcesLocation { + /** The {@code user} variant. */ + USER("user"), + /** The {@code repository} variant. */ + REPOSITORY("repository"), + /** The {@code working-directory} variant. */ + WORKING_DIRECTORY("working-directory"); + + private final String value; + InstructionsSourcesLocation(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static InstructionsSourcesLocation fromValue(String value) { + for (InstructionsSourcesLocation v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown InstructionsSourcesLocation value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesType.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesType.java new file mode 100644 index 000000000..8de131942 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesType.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * Category of instruction source — used for merge logic + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum InstructionsSourcesType { + /** The {@code home} variant. */ + HOME("home"), + /** The {@code repo} variant. */ + REPO("repo"), + /** The {@code model} variant. */ + MODEL("model"), + /** The {@code vscode} variant. */ + VSCODE("vscode"), + /** The {@code nested-agents} variant. */ + NESTED_AGENTS("nested-agents"), + /** The {@code child-instructions} variant. */ + CHILD_INSTRUCTIONS("child-instructions"); + + private final String value; + InstructionsSourcesType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static InstructionsSourcesType fromValue(String value) { + for (InstructionsSourcesType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown InstructionsSourcesType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigDisableParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigDisableParams.java new file mode 100644 index 000000000..cef02e1ae --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigDisableParams.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; + +/** + * Request parameters for the {@code mcp.config.disable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpConfigDisableParams( + /** Names of MCP servers to disable. Each server is added to the persisted disabled list so new sessions skip it. Already-disabled names are ignored. Active sessions keep their current connections until they end. */ + @JsonProperty("names") List names +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigEnableParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigEnableParams.java new file mode 100644 index 000000000..78ba76b7b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigEnableParams.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; + +/** + * Request parameters for the {@code mcp.config.enable} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpConfigEnableParams( + /** Names of MCP servers to enable. Each server is removed from the persisted disabled list so new sessions spawn it. Unknown or already-enabled names are ignored. */ + @JsonProperty("names") List names +) { +} 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 index 01561b9f4..3f107275b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverResult.java @@ -23,44 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record McpDiscoverResult( /** MCP servers discovered from all sources */ - @JsonProperty("servers") List servers + @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/McpServer.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServer.java new file mode 100644 index 000000000..2f4b2b36e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServer.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 javax.annotation.processing.Generated; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpServer( + /** Server name (config key) */ + @JsonProperty("name") String name, + /** Connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + @JsonProperty("status") McpServerStatus status, + /** Configuration source: user, workspace, plugin, or builtin */ + @JsonProperty("source") McpServerSource source, + /** Error message if the server failed to connect */ + @JsonProperty("error") String error +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerSource.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerSource.java new file mode 100644 index 000000000..3ffe4b797 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerSource.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 javax.annotation.processing.Generated; + +/** + * Configuration source: user, workspace, plugin, or builtin + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpServerSource { + /** 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; + McpServerSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpServerSource fromValue(String value) { + for (McpServerSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpServerSource value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerStatus.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerStatus.java new file mode 100644 index 000000000..06bec4f30 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerStatus.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * Connection status: connected, failed, needs-auth, pending, disabled, or not_configured + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpServerStatus { + /** 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; + McpServerStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpServerStatus fromValue(String value) { + for (McpServerStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpServerStatus value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/Model.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/Model.java new file mode 100644 index 000000000..9ba457cec --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/Model.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 java.util.List; +import javax.annotation.processing.Generated; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record Model( + /** Model identifier (e.g., "claude-sonnet-4.5") */ + @JsonProperty("id") String id, + /** Display name */ + @JsonProperty("name") String name, + /** Model capabilities and limits */ + @JsonProperty("capabilities") ModelCapabilities capabilities, + /** Policy state (if applicable) */ + @JsonProperty("policy") ModelPolicy policy, + /** Billing information */ + @JsonProperty("billing") ModelBilling 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 +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBilling.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBilling.java new file mode 100644 index 000000000..656f5383d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBilling.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; + +/** + * Billing information + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelBilling( + /** Billing cost multiplier relative to the base rate */ + @JsonProperty("multiplier") Double multiplier +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilities.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilities.java new file mode 100644 index 000000000..4c6b5e3af --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilities.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; + +/** + * Model capabilities and limits + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelCapabilities( + /** Feature flags indicating what the model supports */ + @JsonProperty("supports") ModelCapabilitiesSupports supports, + /** Token limits for prompts, outputs, and context window */ + @JsonProperty("limits") ModelCapabilitiesLimits limits +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimits.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimits.java new file mode 100644 index 000000000..8adf6812b --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimits.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; + +/** + * Token limits for prompts, outputs, and context window + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelCapabilitiesLimits( + /** Maximum number of prompt/input tokens */ + @JsonProperty("max_prompt_tokens") Long maxPromptTokens, + /** Maximum number of output/completion tokens */ + @JsonProperty("max_output_tokens") Long maxOutputTokens, + /** Maximum total context window size in tokens */ + @JsonProperty("max_context_window_tokens") Long maxContextWindowTokens, + /** Vision-specific limits */ + @JsonProperty("vision") ModelCapabilitiesLimitsVision vision +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimitsVision.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimitsVision.java new file mode 100644 index 000000000..cbfc7c3b8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimitsVision.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +/** + * Vision-specific limits + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelCapabilitiesLimitsVision( + /** MIME types the model accepts */ + @JsonProperty("supported_media_types") List supportedMediaTypes, + /** Maximum number of images per prompt */ + @JsonProperty("max_prompt_images") Long maxPromptImages, + /** Maximum image size in bytes */ + @JsonProperty("max_prompt_image_size") Long maxPromptImageSize +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverride.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverride.java new file mode 100644 index 000000000..1ec67824e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverride.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; + +/** + * Override individual model capabilities resolved by the runtime + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelCapabilitiesOverride( + /** Feature flags indicating what the model supports */ + @JsonProperty("supports") ModelCapabilitiesOverrideSupports supports, + /** Token limits for prompts, outputs, and context window */ + @JsonProperty("limits") ModelCapabilitiesOverrideLimits limits +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimits.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimits.java new file mode 100644 index 000000000..8794ae258 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimits.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; + +/** + * Token limits for prompts, outputs, and context window + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelCapabilitiesOverrideLimits( + @JsonProperty("max_prompt_tokens") Long maxPromptTokens, + @JsonProperty("max_output_tokens") Long maxOutputTokens, + /** Maximum total context window size in tokens */ + @JsonProperty("max_context_window_tokens") Long maxContextWindowTokens, + @JsonProperty("vision") ModelCapabilitiesOverrideLimitsVision vision +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimitsVision.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimitsVision.java new file mode 100644 index 000000000..5d53ca6b8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimitsVision.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 java.util.List; +import javax.annotation.processing.Generated; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelCapabilitiesOverrideLimitsVision( + /** MIME types the model accepts */ + @JsonProperty("supported_media_types") List supportedMediaTypes, + /** Maximum number of images per prompt */ + @JsonProperty("max_prompt_images") Long maxPromptImages, + /** Maximum image size in bytes */ + @JsonProperty("max_prompt_image_size") Long maxPromptImageSize +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideSupports.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideSupports.java new file mode 100644 index 000000000..bc8e3f495 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideSupports.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; + +/** + * Feature flags indicating what the model supports + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelCapabilitiesOverrideSupports( + @JsonProperty("vision") Boolean vision, + @JsonProperty("reasoningEffort") Boolean reasoningEffort +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesSupports.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesSupports.java new file mode 100644 index 000000000..f898f130f --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesSupports.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; + +/** + * Feature flags indicating what the model supports + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelCapabilitiesSupports( + /** Whether this model supports vision/image input */ + @JsonProperty("vision") Boolean vision, + /** Whether this model supports reasoning effort configuration */ + @JsonProperty("reasoningEffort") Boolean reasoningEffort +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPolicy.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPolicy.java new file mode 100644 index 000000000..d3d218bec --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPolicy.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; + +/** + * Policy state (if applicable) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelPolicy( + /** Current policy state for this model */ + @JsonProperty("state") String state, + /** Usage terms or conditions for this model */ + @JsonProperty("terms") String terms +) { +} 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 index 6b233a737..a56eeb9d6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelsListResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelsListResult.java @@ -23,96 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record ModelsListResult( /** List of available models with full metadata */ - @JsonProperty("models") List models + @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/PingResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.java index 30ff8c58a..b91b2fb02 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.java @@ -24,8 +24,8 @@ public record PingResult( /** Echoed message (or default greeting) */ @JsonProperty("message") String message, /** Server timestamp in milliseconds */ - @JsonProperty("timestamp") Double timestamp, + @JsonProperty("timestamp") Long timestamp, /** Server protocol version number */ - @JsonProperty("protocolVersion") Double protocolVersion + @JsonProperty("protocolVersion") Long protocolVersion ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/Plugin.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/Plugin.java new file mode 100644 index 000000000..64edf086e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/Plugin.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 javax.annotation.processing.Generated; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record Plugin( + /** 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/ServerMcpConfigApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpConfigApi.java index 0153b2baf..9e9677e42 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpConfigApi.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpConfigApi.java @@ -57,4 +57,20 @@ public CompletableFuture remove(McpConfigRemoveParams params) { return caller.invoke("mcp.config.remove", params, Void.class); } + /** + * Invokes {@code mcp.config.enable}. + * @since 1.0.0 + */ + public CompletableFuture enable(McpConfigEnableParams params) { + return caller.invoke("mcp.config.enable", params, Void.class); + } + + /** + * Invokes {@code mcp.config.disable}. + * @since 1.0.0 + */ + public CompletableFuture disable(McpConfigDisableParams params) { + return caller.invoke("mcp.config.disable", params, Void.class); + } + } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerRpc.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerRpc.java index 0f0e5804c..d2e316100 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerRpc.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerRpc.java @@ -32,6 +32,8 @@ public final class ServerRpc { public final ServerAccountApi account; /** API methods for the {@code mcp} namespace. */ public final ServerMcpApi mcp; + /** API methods for the {@code skills} namespace. */ + public final ServerSkillsApi skills; /** API methods for the {@code sessionFs} namespace. */ public final ServerSessionFsApi sessionFs; /** API methods for the {@code sessions} namespace. */ @@ -48,6 +50,7 @@ public ServerRpc(RpcCaller caller) { this.tools = new ServerToolsApi(caller); this.account = new ServerAccountApi(caller); this.mcp = new ServerMcpApi(caller); + this.skills = new ServerSkillsApi(caller); this.sessionFs = new ServerSessionFsApi(caller); this.sessions = new ServerSessionsApi(caller); } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkill.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkill.java new file mode 100644 index 000000000..6cb432717 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkill.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ServerSkill( + /** 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-copilot, plugin, builtin) */ + @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 (based on global config) */ + @JsonProperty("enabled") Boolean enabled, + /** Absolute path to the skill file */ + @JsonProperty("path") String path, + /** The project path this skill belongs to (only for project/inherited skills) */ + @JsonProperty("projectPath") String projectPath +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsApi.java new file mode 100644 index 000000000..943f68258 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsApi.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 java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code skills} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ServerSkillsApi { + + private final RpcCaller caller; + + /** API methods for the {@code skills.config} sub-namespace. */ + public final ServerSkillsConfigApi config; + + /** @param caller the RPC transport function */ + ServerSkillsApi(RpcCaller caller) { + this.caller = caller; + this.config = new ServerSkillsConfigApi(caller); + } + + /** + * Invokes {@code skills.discover}. + * @since 1.0.0 + */ + public CompletableFuture discover(SkillsDiscoverParams params) { + return caller.invoke("skills.discover", params, SkillsDiscoverResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsConfigApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsConfigApi.java new file mode 100644 index 000000000..41eaeab01 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsConfigApi.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * 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 java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code skills.config} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ServerSkillsConfigApi { + + private final RpcCaller caller; + + /** @param caller the RPC transport function */ + ServerSkillsConfigApi(RpcCaller caller) { + this.caller = caller; + } + + /** + * Invokes {@code skills.config.setDisabledSkills}. + * @since 1.0.0 + */ + public CompletableFuture setDisabledSkills(SkillsConfigSetDisabledSkillsParams params) { + return caller.invoke("skills.config.setDisabledSkills", params, Void.class); + } + +} 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 index b26fa1bbb..fea4e47b6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentResult.java @@ -22,18 +22,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionAgentGetCurrentResult( /** Currently selected custom agent, or null if using the default agent */ - @JsonProperty("agent") SessionAgentGetCurrentResultAgent agent + @JsonProperty("agent") AgentInfo 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/SessionAgentListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.java index 98bff9a15..f572bf9ae 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.java @@ -23,18 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionAgentListResult( /** Available custom agents */ - @JsonProperty("agents") List 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/SessionAgentReloadResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.java index 2b1d7395a..32928e53a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.java @@ -23,18 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionAgentReloadResult( /** Reloaded custom agents */ - @JsonProperty("agents") List 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/SessionAgentSelectResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.java index 2eff0778e..ab9637568 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.java @@ -22,19 +22,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionAgentSelectResult( /** The newly selected custom agent */ - @JsonProperty("agent") SessionAgentSelectResultAgent agent + @JsonProperty("agent") AgentInfo 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/SessionAuthApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthApi.java new file mode 100644 index 000000000..93624213e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthApi.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * 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 java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code auth} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionAuthApi { + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionAuthApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Invokes {@code session.auth.getStatus}. + * @since 1.0.0 + */ + public CompletableFuture getStatus() { + return caller.invoke("session.auth.getStatus", java.util.Map.of("sessionId", this.sessionId), SessionAuthGetStatusResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusParams.java new file mode 100644 index 000000000..059833d37 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusParams.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.auth.getStatus} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAuthGetStatusParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusResult.java new file mode 100644 index 000000000..737c2ae9e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusResult.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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.auth.getStatus} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAuthGetStatusResult( + /** Whether the session has resolved authentication */ + @JsonProperty("isAuthenticated") Boolean isAuthenticated, + /** Authentication type */ + @JsonProperty("authType") AuthInfoType authType, + /** Authentication host URL */ + @JsonProperty("host") String host, + /** Authenticated login/username, if available */ + @JsonProperty("login") String login, + /** Human-readable authentication status description */ + @JsonProperty("statusMessage") String statusMessage, + /** Copilot plan tier (e.g., individual_pro, business) */ + @JsonProperty("copilotPlan") String copilotPlan +) { +} 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 index 0f6e91d82..9ace814e0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListResult.java @@ -23,66 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionExtensionsListResult( /** Discovered extensions and their current status */ - @JsonProperty("extensions") List extensions + @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/SessionFsAppendFileParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.java index f50b670ee..273031f17 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.java @@ -28,6 +28,6 @@ public record SessionFsAppendFileParams( /** Content to append */ @JsonProperty("content") String content, /** Optional POSIX-style mode for newly created files */ - @JsonProperty("mode") Double mode + @JsonProperty("mode") Long mode ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsError.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsError.java new file mode 100644 index 000000000..a78aa5374 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsError.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; + +/** + * Describes a filesystem error. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsError( + /** Error classification */ + @JsonProperty("code") SessionFsErrorCode code, + /** Free-form detail about the error, for logging/diagnostics */ + @JsonProperty("message") String message +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsErrorCode.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsErrorCode.java new file mode 100644 index 000000000..099ff1236 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsErrorCode.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 javax.annotation.processing.Generated; + +/** + * Error classification + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionFsErrorCode { + /** The {@code ENOENT} variant. */ + ENOENT("ENOENT"), + /** The {@code UNKNOWN} variant. */ + UNKNOWN("UNKNOWN"); + + private final String value; + SessionFsErrorCode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionFsErrorCode fromValue(String value) { + for (SessionFsErrorCode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionFsErrorCode value: " + value); + } +} 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 index 53fc35f25..33ca53d0f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsMkdirParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsMkdirParams.java @@ -28,6 +28,6 @@ public record SessionFsMkdirParams( /** Create parent directories as needed */ @JsonProperty("recursive") Boolean recursive, /** Optional POSIX-style mode for newly created directories */ - @JsonProperty("mode") Double mode + @JsonProperty("mode") Long mode ) { } 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 index c03673538..d222f8867 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileResult.java @@ -22,6 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionFsReadFileResult( /** File content as UTF-8 string */ - @JsonProperty("content") String content + @JsonProperty("content") String content, + /** Describes a filesystem error. */ + @JsonProperty("error") SessionFsError error ) { } 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 index 3079b9813..3f2201d2d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirResult.java @@ -23,6 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionFsReaddirResult( /** Entry names in the directory */ - @JsonProperty("entries") List entries + @JsonProperty("entries") List entries, + /** Describes a filesystem error. */ + @JsonProperty("error") SessionFsError error ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntry.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntry.java new file mode 100644 index 000000000..ff44088d4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntry.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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsReaddirWithTypesEntry( + /** Entry name */ + @JsonProperty("name") String name, + /** Entry type */ + @JsonProperty("type") SessionFsReaddirWithTypesEntryType type +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntryType.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntryType.java new file mode 100644 index 000000000..71640ec34 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntryType.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 javax.annotation.processing.Generated; + +/** + * Entry type + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionFsReaddirWithTypesEntryType { + /** The {@code file} variant. */ + FILE("file"), + /** The {@code directory} variant. */ + DIRECTORY("directory"); + + private final String value; + SessionFsReaddirWithTypesEntryType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionFsReaddirWithTypesEntryType fromValue(String value) { + for (SessionFsReaddirWithTypesEntryType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionFsReaddirWithTypesEntryType value: " + value); + } +} 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 index 0e8dc3587..0fecb6349 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesResult.java @@ -23,36 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionFsReaddirWithTypesResult( /** Directory entries with type information */ - @JsonProperty("entries") List entries + @JsonProperty("entries") List entries, + /** Describes a filesystem error. */ + @JsonProperty("error") SessionFsError error ) { - - @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/SessionFsSetProviderConventions.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderConventions.java new file mode 100644 index 000000000..ac669a189 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderConventions.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 javax.annotation.processing.Generated; + +/** + * Path conventions used by this filesystem + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionFsSetProviderConventions { + /** The {@code windows} variant. */ + WINDOWS("windows"), + /** The {@code posix} variant. */ + POSIX("posix"); + + private final String value; + SessionFsSetProviderConventions(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionFsSetProviderConventions fromValue(String value) { + for (SessionFsSetProviderConventions v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionFsSetProviderConventions value: " + value); + } +} 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 index bbab3b934..e0c893db0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderParams.java @@ -26,26 +26,6 @@ public record SessionFsSetProviderParams( /** 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 + @JsonProperty("conventions") SessionFsSetProviderConventions 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/SessionFsStatResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.java index 39b40a913..28bb3a9fb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.java @@ -10,6 +10,7 @@ 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; /** @@ -26,10 +27,12 @@ public record SessionFsStatResult( /** Whether the path is a directory */ @JsonProperty("isDirectory") Boolean isDirectory, /** File size in bytes */ - @JsonProperty("size") Double size, + @JsonProperty("size") Long size, /** ISO 8601 timestamp of last modification */ - @JsonProperty("mtime") String mtime, + @JsonProperty("mtime") OffsetDateTime mtime, /** ISO 8601 timestamp of creation */ - @JsonProperty("birthtime") String birthtime + @JsonProperty("birthtime") OffsetDateTime birthtime, + /** Describes a filesystem error. */ + @JsonProperty("error") SessionFsError error ) { } 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 index 02e1dea77..1c03df8a7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsWriteFileParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsWriteFileParams.java @@ -28,6 +28,6 @@ public record SessionFsWriteFileParams( /** Content to write */ @JsonProperty("content") String content, /** Optional POSIX-style mode for newly created files */ - @JsonProperty("mode") Double mode + @JsonProperty("mode") Long mode ) { } 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 index b20e2c449..060b97f48 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactResult.java @@ -24,29 +24,10 @@ public record SessionHistoryCompactResult( /** Whether compaction completed successfully */ @JsonProperty("success") Boolean success, /** Number of tokens freed by compaction */ - @JsonProperty("tokensRemoved") Double tokensRemoved, + @JsonProperty("tokensRemoved") Long tokensRemoved, /** Number of messages removed during compaction */ - @JsonProperty("messagesRemoved") Double messagesRemoved, + @JsonProperty("messagesRemoved") Long messagesRemoved, /** Post-compaction context window usage breakdown */ - @JsonProperty("contextWindow") SessionHistoryCompactResultContextWindow contextWindow + @JsonProperty("contextWindow") HistoryCompactContextWindow 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/SessionHistoryTruncateResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.java index 65f71d4c8..a295cd1bd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.java @@ -22,6 +22,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionHistoryTruncateResult( /** Number of events that were removed */ - @JsonProperty("eventsRemoved") Double eventsRemoved + @JsonProperty("eventsRemoved") Long eventsRemoved ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsApi.java new file mode 100644 index 000000000..145841950 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsApi.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * 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 java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code instructions} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionInstructionsApi { + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionInstructionsApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Invokes {@code session.instructions.getSources}. + * @since 1.0.0 + */ + public CompletableFuture getSources() { + return caller.invoke("session.instructions.getSources", java.util.Map.of("sessionId", this.sessionId), SessionInstructionsGetSourcesResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesParams.java new file mode 100644 index 000000000..5fbe01602 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesParams.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.instructions.getSources} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionInstructionsGetSourcesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesResult.java new file mode 100644 index 000000000..66ff52bd2 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesResult.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.instructions.getSources} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionInstructionsGetSourcesResult( + /** Instruction sources for the session */ + @JsonProperty("sources") List sources +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogLevel.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogLevel.java new file mode 100644 index 000000000..7ec7361a7 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogLevel.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionLogLevel { + /** The {@code info} variant. */ + INFO("info"), + /** The {@code warning} variant. */ + WARNING("warning"), + /** The {@code error} variant. */ + ERROR("error"); + + private final String value; + SessionLogLevel(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionLogLevel fromValue(String value) { + for (SessionLogLevel v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionLogLevel value: " + value); + } +} 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 index c87fb78eb..111e58cf5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogParams.java @@ -26,32 +26,10 @@ public record SessionLogParams( /** 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, + @JsonProperty("level") SessionLogLevel 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/SessionMcpApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpApi.java index d6fe3a7eb..2998ea662 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpApi.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpApi.java @@ -23,10 +23,14 @@ public final class SessionMcpApi { private final RpcCaller caller; private final String sessionId; + /** API methods for the {@code mcp.oauth} sub-namespace. */ + public final SessionMcpOauthApi oauth; + /** @param caller the RPC transport function */ SessionMcpApi(RpcCaller caller, String sessionId) { this.caller = caller; this.sessionId = sessionId; + this.oauth = new SessionMcpOauthApi(caller, 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 index 25f747162..8128229a0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListResult.java @@ -23,48 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionMcpListResult( /** Configured MCP servers */ - @JsonProperty("servers") List 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/SessionMcpOauthApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthApi.java new file mode 100644 index 000000000..4a864468e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthApi.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * 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 java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code mcp.oauth} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpOauthApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionMcpOauthApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Invokes {@code session.mcp.oauth.login}. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture login(SessionMcpOauthLoginParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.oauth.login", _p, SessionMcpOauthLoginResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginParams.java new file mode 100644 index 000000000..ef336408d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginParams.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; + +/** + * Request parameters for the {@code session.mcp.oauth.login} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpOauthLoginParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the remote MCP server to authenticate */ + @JsonProperty("serverName") String serverName, + /** When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck. */ + @JsonProperty("forceReauth") Boolean forceReauth, + /** Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees. */ + @JsonProperty("clientName") String clientName, + /** Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return. */ + @JsonProperty("callbackSuccessMessage") String callbackSuccessMessage +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginResult.java new file mode 100644 index 000000000..e46ab39ef --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginResult.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.mcp.oauth.login} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpOauthLoginResult( + /** URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed. */ + @JsonProperty("authorizationUrl") String authorizationUrl +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMode.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMode.java new file mode 100644 index 000000000..5b246bcb5 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMode.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * The agent mode. Valid values: "interactive", "plan", "autopilot". + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionMode { + /** The {@code interactive} variant. */ + INTERACTIVE("interactive"), + /** The {@code plan} variant. */ + PLAN("plan"), + /** The {@code autopilot} variant. */ + AUTOPILOT("autopilot"); + + private final String value; + SessionMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionMode fromValue(String value) { + for (SessionMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeApi.java index 7fd8eff73..bf20ad088 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeApi.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeApi.java @@ -30,11 +30,11 @@ public final class SessionModeApi { } /** - * Invokes {@code session.mode.get}. + * The agent mode. Valid values: "interactive", "plan", "autopilot". * @since 1.0.0 */ - public CompletableFuture get() { - return caller.invoke("session.mode.get", java.util.Map.of("sessionId", this.sessionId), SessionModeGetResult.class); + public CompletableFuture get() { + return caller.invoke("session.mode.get", java.util.Map.of("sessionId", this.sessionId), Void.class); } /** @@ -44,10 +44,10 @@ public CompletableFuture get() { * by the session-scoped wrapper; any value provided is ignored. * @since 1.0.0 */ - public CompletableFuture set(SessionModeSetParams params) { + public CompletableFuture set(SessionModeSetParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.mode.set", _p, SessionModeSetResult.class); + return caller.invoke("session.mode.set", _p, Void.class); } } 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 index dfbae5cac..4153014e5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetParams.java @@ -23,29 +23,7 @@ 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 agent mode. Valid values: "interactive", "plan", "autopilot". */ + @JsonProperty("mode") SessionMode 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/SessionModelSwitchToParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java index 994b3f53b..4d69219fe 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java @@ -10,7 +10,6 @@ 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; /** @@ -29,50 +28,6 @@ public record SessionModelSwitchToParams( /** Reasoning effort level to use for the model */ @JsonProperty("reasoningEffort") String reasoningEffort, /** Override individual model capabilities resolved by the runtime */ - @JsonProperty("modelCapabilities") SessionModelSwitchToParamsModelCapabilities modelCapabilities + @JsonProperty("modelCapabilities") ModelCapabilitiesOverride 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/SessionNameApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameApi.java new file mode 100644 index 000000000..1700becb9 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameApi.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 java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code name} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionNameApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionNameApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Invokes {@code session.name.get}. + * @since 1.0.0 + */ + public CompletableFuture get() { + return caller.invoke("session.name.get", java.util.Map.of("sessionId", this.sessionId), SessionNameGetResult.class); + } + + /** + * Invokes {@code session.name.set}. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * @since 1.0.0 + */ + public CompletableFuture set(SessionNameSetParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.name.set", _p, Void.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetParams.java new file mode 100644 index 000000000..59b638e4c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetParams.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.name.get} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionNameGetParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetResult.java new file mode 100644 index 000000000..9e516b45a --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetResult.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.name.get} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionNameGetResult( + /** The session name, falling back to the auto-generated summary, or null if neither exists */ + @JsonProperty("name") String name +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameSetParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameSetParams.java new file mode 100644 index 000000000..45e93db45 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameSetParams.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.name.set} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionNameSetParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** New session name (1–100 characters, trimmed of leading/trailing whitespace) */ + @JsonProperty("name") String name +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsApi.java index 38c2dd4fc..31edf36b7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsApi.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsApi.java @@ -42,4 +42,25 @@ public CompletableFuture return caller.invoke("session.permissions.handlePendingPermissionRequest", _p, SessionPermissionsHandlePendingPermissionRequestResult.class); } + /** + * Invokes {@code session.permissions.setApproveAll}. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * @since 1.0.0 + */ + public CompletableFuture setApproveAll(SessionPermissionsSetApproveAllParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.setApproveAll", _p, SessionPermissionsSetApproveAllResult.class); + } + + /** + * Invokes {@code session.permissions.resetSessionApprovals}. + * @since 1.0.0 + */ + public CompletableFuture resetSessionApprovals() { + return caller.invoke("session.permissions.resetSessionApprovals", java.util.Map.of("sessionId", this.sessionId), SessionPermissionsResetSessionApprovalsResult.class); + } + } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java new file mode 100644 index 000000000..6fa1b0310 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsParams.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.permissions.resetSessionApprovals} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsResetSessionApprovalsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsResult.java new file mode 100644 index 000000000..91fa4c782 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsResult.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.resetSessionApprovals} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsResetSessionApprovalsResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllParams.java new file mode 100644 index 000000000..cd6ad254c --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllParams.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.permissions.setApproveAll} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsSetApproveAllParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Whether to auto-approve all tool permission requests */ + @JsonProperty("enabled") Boolean enabled +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllResult.java new file mode 100644 index 000000000..be5966246 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllResult.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.setApproveAll} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsSetApproveAllResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} 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 index d6008318d..501e8760d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListResult.java @@ -23,20 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionPluginsListResult( /** Installed plugins */ - @JsonProperty("plugins") List 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/SessionRpc.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRpc.java index 9faf4612d..39ab121b6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRpc.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRpc.java @@ -28,14 +28,20 @@ public final class SessionRpc { private final RpcCaller caller; private final String sessionId; + /** API methods for the {@code auth} namespace. */ + public final SessionAuthApi auth; /** API methods for the {@code model} namespace. */ public final SessionModelApi model; /** API methods for the {@code mode} namespace. */ public final SessionModeApi mode; + /** API methods for the {@code name} namespace. */ + public final SessionNameApi name; /** API methods for the {@code plan} namespace. */ public final SessionPlanApi plan; - /** API methods for the {@code workspace} namespace. */ - public final SessionWorkspaceApi workspace; + /** API methods for the {@code workspaces} namespace. */ + public final SessionWorkspacesApi workspaces; + /** API methods for the {@code instructions} namespace. */ + public final SessionInstructionsApi instructions; /** API methods for the {@code fleet} namespace. */ public final SessionFleetApi fleet; /** API methods for the {@code agent} namespace. */ @@ -72,10 +78,13 @@ public final class SessionRpc { public SessionRpc(RpcCaller caller, String sessionId) { this.caller = caller; this.sessionId = sessionId; + this.auth = new SessionAuthApi(caller, sessionId); this.model = new SessionModelApi(caller, sessionId); this.mode = new SessionModeApi(caller, sessionId); + this.name = new SessionNameApi(caller, sessionId); this.plan = new SessionPlanApi(caller, sessionId); - this.workspace = new SessionWorkspaceApi(caller, sessionId); + this.workspaces = new SessionWorkspacesApi(caller, sessionId); + this.instructions = new SessionInstructionsApi(caller, sessionId); this.fleet = new SessionFleetApi(caller, sessionId); this.agent = new SessionAgentApi(caller, sessionId); this.skills = new SessionSkillsApi(caller, sessionId); 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 index 9e9d93e99..3aeeebff0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecParams.java @@ -28,6 +28,6 @@ public record SessionShellExecParams( /** Working directory (defaults to session working directory) */ @JsonProperty("cwd") String cwd, /** Timeout in milliseconds (default: 30000) */ - @JsonProperty("timeout") Double timeout + @JsonProperty("timeout") Long timeout ) { } 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 index 19569dd0e..cb0e128b6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillParams.java @@ -26,28 +26,6 @@ public record SessionShellKillParams( /** Process identifier returned by shell.exec */ @JsonProperty("processId") String processId, /** Signal to send (default: SIGTERM) */ - @JsonProperty("signal") SessionShellKillParamsSignal signal + @JsonProperty("signal") ShellKillSignal 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/SessionSkillsListResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java index dc6ba023e..cd8e8ea8c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java @@ -23,24 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionSkillsListResult( /** Available skills */ - @JsonProperty("skills") List 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/SessionUiApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiApi.java index a987bd627..d6c1e3b4d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiApi.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiApi.java @@ -30,7 +30,7 @@ public final class SessionUiApi { } /** - * Invokes {@code session.ui.elicitation}. + * The elicitation response (accept with form values, decline, or cancel) *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. 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 index d1df4daea..315a857f5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationParams.java @@ -10,8 +10,6 @@ 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; /** @@ -28,19 +26,6 @@ public record SessionUiElicitationParams( /** 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 + @JsonProperty("requestedSchema") UIElicitationSchema 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 index 92ea41778..4be941e08 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationResult.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.ui.elicitation} RPC method. + * The elicitation response (accept with form values, decline, or cancel) * * @since 1.0.0 */ @@ -23,30 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionUiElicitationResult( /** The user's response: accept (submitted), decline (rejected), or cancel (dismissed) */ - @JsonProperty("action") SessionUiElicitationResultAction action, + @JsonProperty("action") UIElicitationResponseAction 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 index e890fffbd..23fd0759d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationParams.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationParams.java @@ -10,7 +10,6 @@ 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; /** @@ -27,39 +26,6 @@ public record SessionUiHandlePendingElicitationParams( /** 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 + @JsonProperty("result") UIElicitationResponse 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/SessionUsageGetMetricsResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java index 5a98516d4..9cfdbcfc8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java @@ -31,9 +31,9 @@ public record SessionUsageGetMetricsResult( /** Session start timestamp (epoch milliseconds) */ @JsonProperty("sessionStartTime") Long sessionStartTime, /** Aggregated code change metrics */ - @JsonProperty("codeChanges") SessionUsageGetMetricsResultCodeChanges codeChanges, + @JsonProperty("codeChanges") UsageMetricsCodeChanges codeChanges, /** Per-model token and request metrics, keyed by model identifier */ - @JsonProperty("modelMetrics") Map modelMetrics, + @JsonProperty("modelMetrics") Map modelMetrics, /** Currently active model identifier */ @JsonProperty("currentModel") String currentModel, /** Input tokens from the most recent main-agent API call */ @@ -41,55 +41,4 @@ public record SessionUsageGetMetricsResult( /** 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/SessionWorkspacesApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesApi.java new file mode 100644 index 000000000..b9a5238fa --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesApi.java @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * 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 java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code workspaces} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionWorkspacesApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionWorkspacesApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Invokes {@code session.workspaces.getWorkspace}. + * @since 1.0.0 + */ + public CompletableFuture getWorkspace() { + return caller.invoke("session.workspaces.getWorkspace", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesGetWorkspaceResult.class); + } + + /** + * Invokes {@code session.workspaces.listFiles}. + * @since 1.0.0 + */ + public CompletableFuture listFiles() { + return caller.invoke("session.workspaces.listFiles", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesListFilesResult.class); + } + + /** + * Invokes {@code session.workspaces.readFile}. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * @since 1.0.0 + */ + public CompletableFuture readFile(SessionWorkspacesReadFileParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.readFile", _p, SessionWorkspacesReadFileResult.class); + } + + /** + * Invokes {@code session.workspaces.createFile}. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * @since 1.0.0 + */ + public CompletableFuture createFile(SessionWorkspacesCreateFileParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.createFile", _p, Void.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesCreateFileParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesCreateFileParams.java new file mode 100644 index 000000000..def2ffe37 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesCreateFileParams.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.workspaces.createFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesCreateFileParams( + /** 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/SessionWorkspacesGetWorkspaceParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceParams.java new file mode 100644 index 000000000..c2f0e5a16 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceParams.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.workspaces.getWorkspace} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesGetWorkspaceParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceResult.java new file mode 100644 index 000000000..2a2260db8 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceResult.java @@ -0,0 +1,92 @@ +/*--------------------------------------------------------------------------------------------- + * 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.time.OffsetDateTime; +import java.util.UUID; +import javax.annotation.processing.Generated; + +/** + * Result for the {@code session.workspaces.getWorkspace} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesGetWorkspaceResult( + /** Current workspace metadata, or null if not available */ + @JsonProperty("workspace") SessionWorkspacesGetWorkspaceResultWorkspace workspace +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionWorkspacesGetWorkspaceResultWorkspace( + @JsonProperty("id") UUID id, + @JsonProperty("cwd") String cwd, + @JsonProperty("git_root") String gitRoot, + @JsonProperty("repository") String repository, + @JsonProperty("host_type") SessionWorkspacesGetWorkspaceResultWorkspaceHostType hostType, + @JsonProperty("branch") String branch, + @JsonProperty("summary") String summary, + @JsonProperty("name") String name, + @JsonProperty("summary_count") Long summaryCount, + @JsonProperty("created_at") OffsetDateTime createdAt, + @JsonProperty("updated_at") OffsetDateTime updatedAt, + @JsonProperty("remote_steerable") Boolean remoteSteerable, + @JsonProperty("mc_task_id") String mcTaskId, + @JsonProperty("mc_session_id") String mcSessionId, + @JsonProperty("mc_last_event_id") String mcLastEventId, + @JsonProperty("session_sync_level") SessionWorkspacesGetWorkspaceResultWorkspaceSessionSyncLevel sessionSyncLevel, + @JsonProperty("chronicle_sync_dismissed") Boolean chronicleSyncDismissed + ) { + + public enum SessionWorkspacesGetWorkspaceResultWorkspaceHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + SessionWorkspacesGetWorkspaceResultWorkspaceHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionWorkspacesGetWorkspaceResultWorkspaceHostType fromValue(String value) { + for (SessionWorkspacesGetWorkspaceResultWorkspaceHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionWorkspacesGetWorkspaceResultWorkspaceHostType value: " + value); + } + } + + public enum SessionWorkspacesGetWorkspaceResultWorkspaceSessionSyncLevel { + /** The {@code local} variant. */ + LOCAL("local"), + /** The {@code user} variant. */ + USER("user"), + /** The {@code repo_and_user} variant. */ + REPO_AND_USER("repo_and_user"); + + private final String value; + SessionWorkspacesGetWorkspaceResultWorkspaceSessionSyncLevel(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionWorkspacesGetWorkspaceResultWorkspaceSessionSyncLevel fromValue(String value) { + for (SessionWorkspacesGetWorkspaceResultWorkspaceSessionSyncLevel v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionWorkspacesGetWorkspaceResultWorkspaceSessionSyncLevel value: " + value); + } + } + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesParams.java new file mode 100644 index 000000000..7bcee441e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesParams.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.workspaces.listFiles} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesListFilesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesResult.java new file mode 100644 index 000000000..26064cde4 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesResult.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.workspaces.listFiles} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesListFilesResult( + /** Relative file paths in the workspace files directory */ + @JsonProperty("files") List files +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileParams.java new file mode 100644 index 000000000..40b277854 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileParams.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.workspaces.readFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesReadFileParams( + /** 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/SessionWorkspacesReadFileResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileResult.java new file mode 100644 index 000000000..c0ce5e7c7 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileResult.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.workspaces.readFile} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesReadFileResult( + /** File content as a UTF-8 string */ + @JsonProperty("content") String content +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ShellKillSignal.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/ShellKillSignal.java new file mode 100644 index 000000000..92700c5c0 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ShellKillSignal.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * Signal to send (default: SIGTERM) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ShellKillSignal { + /** The {@code SIGTERM} variant. */ + SIGTERM("SIGTERM"), + /** The {@code SIGKILL} variant. */ + SIGKILL("SIGKILL"), + /** The {@code SIGINT} variant. */ + SIGINT("SIGINT"); + + private final String value; + ShellKillSignal(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ShellKillSignal fromValue(String value) { + for (ShellKillSignal v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ShellKillSignal value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/Skill.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/Skill.java new file mode 100644 index 000000000..7f3c2a401 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/Skill.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * 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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record Skill( + /** 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/SkillsConfigSetDisabledSkillsParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsConfigSetDisabledSkillsParams.java new file mode 100644 index 000000000..94a32b573 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsConfigSetDisabledSkillsParams.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; + +/** + * Request parameters for the {@code skills.config.setDisabledSkills} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SkillsConfigSetDisabledSkillsParams( + /** List of skill names to disable */ + @JsonProperty("disabledSkills") List disabledSkills +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverParams.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverParams.java new file mode 100644 index 000000000..053d42585 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverParams.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 java.util.List; +import javax.annotation.processing.Generated; + +/** + * Request parameters for the {@code skills.discover} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SkillsDiscoverParams( + /** Optional list of project directory paths to scan for project-scoped skills */ + @JsonProperty("projectPaths") List projectPaths, + /** Optional list of additional skill directory paths to include */ + @JsonProperty("skillDirectories") List skillDirectories +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverResult.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverResult.java new file mode 100644 index 000000000..a2f0efe97 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverResult.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 skills.discover} RPC method. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SkillsDiscoverResult( + /** All discovered skills across all sources */ + @JsonProperty("skills") List skills +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/Tool.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/Tool.java new file mode 100644 index 000000000..53fbdcb8e --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/Tool.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 java.util.Map; +import javax.annotation.processing.Generated; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record Tool( + /** 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 +) { +} 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 index d56ef7e7c..3a1b7c29d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListResult.java +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListResult.java @@ -11,7 +11,6 @@ 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; /** @@ -24,22 +23,6 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record ToolsListResult( /** List of available built-in tools with metadata */ - @JsonProperty("tools") List tools + @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 - ) { - } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponse.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponse.java new file mode 100644 index 000000000..058a68c0d --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponse.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 java.util.Map; +import javax.annotation.processing.Generated; + +/** + * The elicitation response (accept with form values, decline, or cancel) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UIElicitationResponse( + /** The user's response: accept (submitted), decline (rejected), or cancel (dismissed) */ + @JsonProperty("action") UIElicitationResponseAction action, + /** The form values submitted by the user (present when action is 'accept') */ + @JsonProperty("content") Map content +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponseAction.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponseAction.java new file mode 100644 index 000000000..e4811ef95 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponseAction.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * 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 javax.annotation.processing.Generated; + +/** + * The user's response: accept (submitted), decline (rejected), or cancel (dismissed) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum UIElicitationResponseAction { + /** The {@code accept} variant. */ + ACCEPT("accept"), + /** The {@code decline} variant. */ + DECLINE("decline"), + /** The {@code cancel} variant. */ + CANCEL("cancel"); + + private final String value; + UIElicitationResponseAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static UIElicitationResponseAction fromValue(String value) { + for (UIElicitationResponseAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown UIElicitationResponseAction value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationSchema.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationSchema.java new file mode 100644 index 000000000..171f5c688 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationSchema.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 java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * JSON Schema describing the form fields to present to the user + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UIElicitationSchema( + /** 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/UsageMetricsCodeChanges.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsCodeChanges.java new file mode 100644 index 000000000..442c88da2 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsCodeChanges.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; + +/** + * Aggregated code change metrics + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UsageMetricsCodeChanges( + /** 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 +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetric.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetric.java new file mode 100644 index 000000000..8334872cb --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetric.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; + +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UsageMetricsModelMetric( + /** Request count and cost metrics for this model */ + @JsonProperty("requests") UsageMetricsModelMetricRequests requests, + /** Token usage metrics for this model */ + @JsonProperty("usage") UsageMetricsModelMetricUsage usage +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricRequests.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricRequests.java new file mode 100644 index 000000000..ac18ded85 --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricRequests.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 count and cost metrics for this model + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UsageMetricsModelMetricRequests( + /** Number of API requests made with this model */ + @JsonProperty("count") Long count, + /** User-initiated premium request cost (with multiplier applied) */ + @JsonProperty("cost") Double cost +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricUsage.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricUsage.java new file mode 100644 index 000000000..f7c556a0f --- /dev/null +++ b/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricUsage.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; + +/** + * Token usage metrics for this model + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UsageMetricsModelMetricUsage( + /** 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/main/java/com/github/copilot/sdk/CopilotSession.java b/src/main/java/com/github/copilot/sdk/CopilotSession.java index b54b2cbf3..75e5768f1 100644 --- a/src/main/java/com/github/copilot/sdk/CopilotSession.java +++ b/src/main/java/com/github/copilot/sdk/CopilotSession.java @@ -32,15 +32,19 @@ import com.github.copilot.sdk.generated.AssistantMessageEvent; import com.github.copilot.sdk.generated.rpc.SessionCommandsHandlePendingCommandParams; import com.github.copilot.sdk.generated.rpc.SessionLogParams; +import com.github.copilot.sdk.generated.rpc.SessionLogLevel; +import com.github.copilot.sdk.generated.rpc.ModelCapabilitiesOverride; +import com.github.copilot.sdk.generated.rpc.ModelCapabilitiesOverrideLimits; +import com.github.copilot.sdk.generated.rpc.ModelCapabilitiesOverrideSupports; import com.github.copilot.sdk.generated.rpc.SessionModelSwitchToParams; import com.github.copilot.sdk.generated.rpc.SessionPermissionsHandlePendingPermissionRequestParams; import com.github.copilot.sdk.generated.rpc.SessionRpc; import com.github.copilot.sdk.generated.rpc.SessionToolsHandlePendingToolCallParams; import com.github.copilot.sdk.generated.rpc.SessionUiElicitationParams; -import com.github.copilot.sdk.generated.rpc.SessionUiElicitationResult; import com.github.copilot.sdk.generated.rpc.SessionUiHandlePendingElicitationParams; -import com.github.copilot.sdk.generated.rpc.SessionUiHandlePendingElicitationParams.SessionUiHandlePendingElicitationParamsResult; -import com.github.copilot.sdk.generated.rpc.SessionUiHandlePendingElicitationParams.SessionUiHandlePendingElicitationParamsResult.SessionUiHandlePendingElicitationParamsResultAction; +import com.github.copilot.sdk.generated.rpc.UIElicitationResponse; +import com.github.copilot.sdk.generated.rpc.UIElicitationResponseAction; +import com.github.copilot.sdk.generated.rpc.UIElicitationSchema; import com.github.copilot.sdk.generated.CapabilitiesChangedEvent; import com.github.copilot.sdk.generated.CommandExecuteEvent; import com.github.copilot.sdk.generated.ElicitationRequestedEvent; @@ -880,8 +884,7 @@ private void executeToolAndRespondAsync(String requestId, String toolName, Strin * future completes exceptionally. */ private SessionUiHandlePendingElicitationParams buildElicitationCancelParams(String requestId) { - var cancelResult = new SessionUiHandlePendingElicitationParamsResult( - SessionUiHandlePendingElicitationParamsResultAction.CANCEL, null); + var cancelResult = new UIElicitationResponse(UIElicitationResponseAction.CANCEL, null); return new SessionUiHandlePendingElicitationParams(sessionId, requestId, cancelResult); } @@ -1037,9 +1040,8 @@ private void handleElicitationRequestAsync(ElicitationContext context, String re String actionStr = result.getAction() != null ? result.getAction().getValue() : ElicitationResultAction.CANCEL.getValue(); - var parsedAction = SessionUiHandlePendingElicitationParamsResultAction.fromValue(actionStr); - var elicitationResult = new SessionUiHandlePendingElicitationParamsResult(parsedAction, - result.getContent()); + var parsedAction = UIElicitationResponseAction.fromValue(actionStr); + var elicitationResult = new UIElicitationResponse(parsedAction, result.getContent()); getRpc().ui.handlePendingElicitation( new SessionUiHandlePendingElicitationParams(sessionId, requestId, elicitationResult)); } catch (Exception e) { @@ -1095,9 +1097,8 @@ private final class SessionUiApiImpl implements SessionUiApi { public CompletableFuture elicitation(ElicitationParams params) { assertElicitation(); return getRpc().ui.elicitation(new SessionUiElicitationParams(sessionId, params.getMessage(), - new SessionUiElicitationParams.SessionUiElicitationParamsRequestedSchema( - params.getRequestedSchema().getType(), params.getRequestedSchema().getProperties(), - params.getRequestedSchema().getRequired()))) + new UIElicitationSchema(params.getRequestedSchema().getType(), + params.getRequestedSchema().getProperties(), params.getRequestedSchema().getRequired()))) .thenApply(resp -> { var result = new ElicitationResult(); if (resp.action() != null) { @@ -1120,14 +1121,10 @@ public CompletableFuture elicitation(ElicitationParams params public CompletableFuture confirm(String message) { assertElicitation(); var field = Map.of("type", "boolean", "default", (Object) true); - return getRpc().ui - .elicitation( - new SessionUiElicitationParams(sessionId, message, - new SessionUiElicitationParams.SessionUiElicitationParamsRequestedSchema("object", - Map.of("confirmed", (Object) field), List.of("confirmed")))) + return getRpc().ui.elicitation(new SessionUiElicitationParams(sessionId, message, + new UIElicitationSchema("object", Map.of("confirmed", (Object) field), List.of("confirmed")))) .thenApply(resp -> { - if (resp.action() == SessionUiElicitationResult.SessionUiElicitationResultAction.ACCEPT - && resp.content() != null) { + if (resp.action() == UIElicitationResponseAction.ACCEPT && resp.content() != null) { Object val = resp.content().get("confirmed"); if (val instanceof Boolean b) { return b; @@ -1147,14 +1144,10 @@ public CompletableFuture confirm(String message) { public CompletableFuture select(String message, String[] options) { assertElicitation(); var field = Map.of("type", (Object) "string", "enum", (Object) options); - return getRpc().ui - .elicitation( - new SessionUiElicitationParams(sessionId, message, - new SessionUiElicitationParams.SessionUiElicitationParamsRequestedSchema("object", - Map.of("selection", (Object) field), List.of("selection")))) + return getRpc().ui.elicitation(new SessionUiElicitationParams(sessionId, message, + new UIElicitationSchema("object", Map.of("selection", (Object) field), List.of("selection")))) .thenApply(resp -> { - if (resp.action() == SessionUiElicitationResult.SessionUiElicitationResultAction.ACCEPT - && resp.content() != null) { + if (resp.action() == UIElicitationResponseAction.ACCEPT && resp.content() != null) { Object val = resp.content().get("selection"); return val != null ? val.toString() : null; } @@ -1181,12 +1174,11 @@ public CompletableFuture input(String message, InputOptions options) { if (options.getDefaultValue() != null) field.put("default", options.getDefaultValue()); } - return getRpc().ui.elicitation(new SessionUiElicitationParams(sessionId, message, - new SessionUiElicitationParams.SessionUiElicitationParamsRequestedSchema("object", - Map.of("value", (Object) field), List.of("value")))) + return getRpc().ui + .elicitation(new SessionUiElicitationParams(sessionId, message, + new UIElicitationSchema("object", Map.of("value", (Object) field), List.of("value")))) .thenApply(resp -> { - if (resp.action() == SessionUiElicitationResult.SessionUiElicitationResultAction.ACCEPT - && resp.content() != null) { + if (resp.action() == UIElicitationResponseAction.ACCEPT && resp.content() != null) { Object val = resp.content().get("value"); return val != null ? val.toString() : null; } @@ -1582,21 +1574,19 @@ public CompletableFuture setModel(String model, String reasoningEffort) { public CompletableFuture setModel(String model, String reasoningEffort, com.github.copilot.sdk.json.ModelCapabilitiesOverride modelCapabilities) { ensureNotTerminated(); - SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities generatedCapabilities = null; + ModelCapabilitiesOverride generatedCapabilities = null; if (modelCapabilities != null) { - SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities.SessionModelSwitchToParamsModelCapabilitiesSupports supports = null; + ModelCapabilitiesOverrideSupports supports = null; if (modelCapabilities.getSupports() != null) { var s = modelCapabilities.getSupports(); - supports = new SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities.SessionModelSwitchToParamsModelCapabilitiesSupports( - s.getVision(), s.getReasoningEffort()); + supports = new ModelCapabilitiesOverrideSupports(s.getVision(), s.getReasoningEffort()); } - SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities.SessionModelSwitchToParamsModelCapabilitiesLimits limits = null; + ModelCapabilitiesOverrideLimits limits = null; if (modelCapabilities.getLimits() != null) { limits = new ObjectMapper().convertValue(modelCapabilities.getLimits(), - SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities.SessionModelSwitchToParamsModelCapabilitiesLimits.class); + ModelCapabilitiesOverrideLimits.class); } - generatedCapabilities = new SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities(supports, - limits); + generatedCapabilities = new ModelCapabilitiesOverride(supports, limits); } return getRpc().model .switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, generatedCapabilities)) @@ -1658,12 +1648,12 @@ public CompletableFuture setModel(String model) { */ public CompletableFuture log(String message, String level, Boolean ephemeral, String url) { ensureNotTerminated(); - SessionLogParams.SessionLogParamsLevel rpcLevel = null; + SessionLogLevel rpcLevel = null; if (level != null) { try { - rpcLevel = SessionLogParams.SessionLogParamsLevel.fromValue(level); + rpcLevel = SessionLogLevel.fromValue(level); } catch (IllegalArgumentException e) { - rpcLevel = SessionLogParams.SessionLogParamsLevel.INFO; + rpcLevel = SessionLogLevel.INFO; } } return getRpc().log(new SessionLogParams(sessionId, message, rpcLevel, ephemeral, url)).thenApply(r -> null); diff --git a/src/test/java/com/github/copilot/sdk/RpcWrappersTest.java b/src/test/java/com/github/copilot/sdk/RpcWrappersTest.java index 7d7b0dca4..519f9ebd4 100644 --- a/src/test/java/com/github/copilot/sdk/RpcWrappersTest.java +++ b/src/test/java/com/github/copilot/sdk/RpcWrappersTest.java @@ -145,7 +145,7 @@ void sessionRpc_instantiates_with_all_namespace_fields() { assertNotNull(session.model); assertNotNull(session.mode); assertNotNull(session.plan); - assertNotNull(session.workspace); + assertNotNull(session.workspaces); assertNotNull(session.fleet); assertNotNull(session.agent); assertNotNull(session.skills); diff --git a/src/test/java/com/github/copilot/sdk/SessionEventDeserializationTest.java b/src/test/java/com/github/copilot/sdk/SessionEventDeserializationTest.java index baa572f35..2da778358 100644 --- a/src/test/java/com/github/copilot/sdk/SessionEventDeserializationTest.java +++ b/src/test/java/com/github/copilot/sdk/SessionEventDeserializationTest.java @@ -791,8 +791,7 @@ void testParseSessionShutdownEvent() throws Exception { assertEquals("session.shutdown", event.getType()); var shutdownEvent = (SessionShutdownEvent) event; - assertEquals(SessionShutdownEvent.SessionShutdownEventData.SessionShutdownEventDataShutdownType.ROUTINE, - shutdownEvent.getData().shutdownType()); + assertEquals(ShutdownType.ROUTINE, shutdownEvent.getData().shutdownType()); assertEquals(5.0, shutdownEvent.getData().totalPremiumRequests()); assertEquals("gpt-4", shutdownEvent.getData().currentModel()); assertNotNull(shutdownEvent.getData().codeChanges()); @@ -1148,8 +1147,7 @@ void testSessionHandoffEventAllFields() throws Exception { assertNotNull(event); var data = event.getData(); assertNotNull(data.handoffTime()); - assertEquals(SessionHandoffEvent.SessionHandoffEventData.SessionHandoffEventDataSourceType.REMOTE, - data.sourceType()); + assertEquals(HandoffSourceType.REMOTE, data.sourceType()); assertEquals("additional context", data.context()); assertEquals("handoff summary", data.summary()); assertEquals("remote-sess-1", data.remoteSessionId()); @@ -1228,9 +1226,9 @@ void testSessionCompactionCompleteEventAllFields() throws Exception { "checkpointNumber": 3.0, "checkpointPath": "/checkpoints/3", "compactionTokensUsed": { - "input": 1000, - "output": 500, - "cachedInput": 200 + "inputTokens": 1000, + "outputTokens": 500, + "cacheReadTokens": 200 }, "requestId": "req-compact-1" } @@ -1254,9 +1252,9 @@ void testSessionCompactionCompleteEventAllFields() throws Exception { var tokens = data.compactionTokensUsed(); assertNotNull(tokens); - assertEquals(1000.0, tokens.input()); - assertEquals(500.0, tokens.output()); - assertEquals(200.0, tokens.cachedInput()); + assertEquals(1000.0, tokens.inputTokens()); + assertEquals(500.0, tokens.outputTokens()); + assertEquals(200.0, tokens.cacheReadTokens()); } @Test @@ -1288,8 +1286,7 @@ void testSessionShutdownEventAllFields() throws Exception { var event = (SessionShutdownEvent) parseJson(json); assertNotNull(event); var data = event.getData(); - assertEquals(SessionShutdownEvent.SessionShutdownEventData.SessionShutdownEventDataShutdownType.ERROR, - data.shutdownType()); + assertEquals(ShutdownType.ERROR, data.shutdownType()); assertEquals("OOM", data.errorReason()); assertEquals(10.0, data.totalPremiumRequests()); assertEquals(5000.5, data.totalApiDurationMs()); @@ -2149,8 +2146,7 @@ void testParseJsonNodeSessionShutdownWithCodeChanges() throws Exception { var event = (SessionShutdownEvent) parseJson(json); assertNotNull(event); - assertEquals(SessionShutdownEvent.SessionShutdownEventData.SessionShutdownEventDataShutdownType.ROUTINE, - event.getData().shutdownType()); + assertEquals(ShutdownType.ROUTINE, event.getData().shutdownType()); assertEquals(100.0, event.getData().codeChanges().linesAdded()); assertEquals(1, event.getData().codeChanges().filesModified().size()); } @@ -2279,9 +2275,7 @@ void testParsePermissionCompletedEvent() throws Exception { assertNotNull(event); assertEquals("permission.completed", event.getType()); assertEquals("perm-req-456", event.getData().requestId()); - assertEquals( - PermissionCompletedEvent.PermissionCompletedEventData.PermissionCompletedEventDataResult.PermissionCompletedEventDataResultKind.APPROVED, - event.getData().result().kind()); + assertEquals(PermissionCompletedKind.APPROVED, event.getData().result().kind()); } @Test @@ -2404,8 +2398,7 @@ void testParseCapabilitiesChangedEvent() throws Exception { assertTrue(castedEvent.getData().ui().elicitation()); // Verify setData round-trip - var newData = new CapabilitiesChangedEvent.CapabilitiesChangedEventData( - new CapabilitiesChangedEvent.CapabilitiesChangedEventData.CapabilitiesChangedEventDataUi(false)); + var newData = new CapabilitiesChangedEvent.CapabilitiesChangedEventData(new CapabilitiesChangedUI(false)); castedEvent.setData(newData); assertFalse(castedEvent.getData().ui().elicitation()); } @@ -2475,8 +2468,7 @@ void testParseElicitationRequestedEvent() throws Exception { assertEquals("tc-123", castedEvent.getData().toolCallId()); assertEquals("mcp_tool", castedEvent.getData().elicitationSource()); assertEquals("Please provide your name", castedEvent.getData().message()); - assertEquals(ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode.FORM, - castedEvent.getData().mode()); + assertEquals(ElicitationRequestedMode.FORM, castedEvent.getData().mode()); assertNotNull(castedEvent.getData().requestedSchema()); assertEquals("object", castedEvent.getData().requestedSchema().type()); assertNotNull(castedEvent.getData().requestedSchema().properties()); @@ -2484,13 +2476,10 @@ void testParseElicitationRequestedEvent() throws Exception { assertTrue(castedEvent.getData().requestedSchema().required().contains("name")); // Verify setData round-trip - castedEvent.setData( - new ElicitationRequestedEvent.ElicitationRequestedEventData("elix-002", null, null, "Enter URL", - ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode.URL, - null, "https://example.com")); + castedEvent.setData(new ElicitationRequestedEvent.ElicitationRequestedEventData("elix-002", null, null, + "Enter URL", ElicitationRequestedMode.URL, null, "https://example.com")); assertEquals("elix-002", castedEvent.getData().requestId()); - assertEquals(ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode.URL, - castedEvent.getData().mode()); + assertEquals(ElicitationRequestedMode.URL, castedEvent.getData().mode()); } @Test diff --git a/src/test/java/com/github/copilot/sdk/generated/GeneratedEventTypesCoverageTest.java b/src/test/java/com/github/copilot/sdk/generated/GeneratedEventTypesCoverageTest.java index 72642cd74..2e0b2ed09 100644 --- a/src/test/java/com/github/copilot/sdk/generated/GeneratedEventTypesCoverageTest.java +++ b/src/test/java/com/github/copilot/sdk/generated/GeneratedEventTypesCoverageTest.java @@ -153,8 +153,7 @@ void testParseElicitationRequestedEvent() throws Exception { var typed = (ElicitationRequestedEvent) event; assertEquals("elicit-1", typed.getData().requestId()); assertEquals("Please enter your name", typed.getData().message()); - assertEquals(ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode.FORM, - typed.getData().mode()); + assertEquals(ElicitationRequestedMode.FORM, typed.getData().mode()); } @Test @@ -165,8 +164,7 @@ void testParseElicitationRequestedEventUrlMode() throws Exception { """); assertInstanceOf(ElicitationRequestedEvent.class, event); var typed = (ElicitationRequestedEvent) event; - assertEquals(ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode.URL, - typed.getData().mode()); + assertEquals(ElicitationRequestedMode.URL, typed.getData().mode()); assertEquals("https://example.com", typed.getData().url()); } @@ -182,8 +180,7 @@ void testParseElicitationCompletedEvent() throws Exception { assertEquals("elicitation.completed", event.getType()); var typed = (ElicitationCompletedEvent) event; assertEquals("elicit-1", typed.getData().requestId()); - assertEquals(ElicitationCompletedEvent.ElicitationCompletedEventData.ElicitationCompletedEventDataAction.ACCEPT, - typed.getData().action()); + assertEquals(ElicitationCompletedAction.ACCEPT, typed.getData().action()); assertEquals("Alice", typed.getData().content().get("name")); } @@ -194,9 +191,7 @@ void testParseElicitationCompletedEventDecline() throws Exception { """); assertInstanceOf(ElicitationCompletedEvent.class, event); var typed = (ElicitationCompletedEvent) event; - assertEquals( - ElicitationCompletedEvent.ElicitationCompletedEventData.ElicitationCompletedEventDataAction.DECLINE, - typed.getData().action()); + assertEquals(ElicitationCompletedAction.DECLINE, typed.getData().action()); } @Test @@ -206,8 +201,7 @@ void testParseElicitationCompletedEventCancel() throws Exception { """); assertInstanceOf(ElicitationCompletedEvent.class, event); var typed = (ElicitationCompletedEvent) event; - assertEquals(ElicitationCompletedEvent.ElicitationCompletedEventData.ElicitationCompletedEventDataAction.CANCEL, - typed.getData().action()); + assertEquals(ElicitationCompletedAction.CANCEL, typed.getData().action()); } // ── ExitPlanModeRequestedEvent ───────────────────────────────────────── @@ -402,9 +396,7 @@ void testParseSessionContextChangedEvent() throws Exception { var typed = (SessionContextChangedEvent) event; assertEquals("/workspace", typed.getData().cwd()); assertEquals("myorg/myrepo", typed.getData().repository()); - assertEquals( - SessionContextChangedEvent.SessionContextChangedEventData.SessionContextChangedEventDataHostType.GITHUB, - typed.getData().hostType()); + assertEquals(WorkingDirectoryContextHostType.GITHUB, typed.getData().hostType()); assertEquals("main", typed.getData().branch()); } @@ -415,9 +407,7 @@ void testParseSessionContextChangedEventAdoHostType() throws Exception { """); assertInstanceOf(SessionContextChangedEvent.class, event); var typed = (SessionContextChangedEvent) event; - assertEquals( - SessionContextChangedEvent.SessionContextChangedEventData.SessionContextChangedEventDataHostType.ADO, - typed.getData().hostType()); + assertEquals(WorkingDirectoryContextHostType.ADO, typed.getData().hostType()); } // ── SessionCustomAgentsUpdatedEvent ──────────────────────────────────── @@ -474,9 +464,7 @@ void testParseSessionMcpServersLoadedEvent() throws Exception { assertNotNull(typed.getData().servers()); assertEquals(1, typed.getData().servers().size()); assertEquals("mcp1", typed.getData().servers().get(0).name()); - assertEquals( - SessionMcpServersLoadedEvent.SessionMcpServersLoadedEventData.SessionMcpServersLoadedEventDataServersItem.SessionMcpServersLoadedEventDataServersItemStatus.CONNECTED, - typed.getData().servers().get(0).status()); + assertEquals(McpServersLoadedServerStatus.CONNECTED, typed.getData().servers().get(0).status()); } @Test @@ -685,56 +673,32 @@ void testParseUserInputCompletedEventFreeform() throws Exception { @Test void testElicitationRequestedEventDataModeEnumValues() { - assertEquals("form", - ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode.FORM - .getValue()); - assertEquals("url", - ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode.URL - .getValue()); + assertEquals("form", ElicitationRequestedMode.FORM.getValue()); + assertEquals("url", ElicitationRequestedMode.URL.getValue()); } @Test void testElicitationRequestedEventDataModeEnumFromValue() { - assertEquals(ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode.FORM, - ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode - .fromValue("form")); - assertThrows(IllegalArgumentException.class, - () -> ElicitationRequestedEvent.ElicitationRequestedEventData.ElicitationRequestedEventDataMode - .fromValue("unknown")); + assertEquals(ElicitationRequestedMode.FORM, ElicitationRequestedMode.fromValue("form")); + assertThrows(IllegalArgumentException.class, () -> ElicitationRequestedMode.fromValue("unknown")); } @Test void testElicitationCompletedEventActionEnumValues() { - assertEquals("accept", - ElicitationCompletedEvent.ElicitationCompletedEventData.ElicitationCompletedEventDataAction.ACCEPT - .getValue()); - assertEquals("decline", - ElicitationCompletedEvent.ElicitationCompletedEventData.ElicitationCompletedEventDataAction.DECLINE - .getValue()); - assertEquals("cancel", - ElicitationCompletedEvent.ElicitationCompletedEventData.ElicitationCompletedEventDataAction.CANCEL - .getValue()); + assertEquals("accept", ElicitationCompletedAction.ACCEPT.getValue()); + assertEquals("decline", ElicitationCompletedAction.DECLINE.getValue()); + assertEquals("cancel", ElicitationCompletedAction.CANCEL.getValue()); } @Test void testSessionContextChangedHostTypeEnumFromValue() { - assertEquals( - SessionContextChangedEvent.SessionContextChangedEventData.SessionContextChangedEventDataHostType.GITHUB, - SessionContextChangedEvent.SessionContextChangedEventData.SessionContextChangedEventDataHostType - .fromValue("github")); - assertEquals( - SessionContextChangedEvent.SessionContextChangedEventData.SessionContextChangedEventDataHostType.ADO, - SessionContextChangedEvent.SessionContextChangedEventData.SessionContextChangedEventDataHostType - .fromValue("ado")); - assertThrows(IllegalArgumentException.class, - () -> SessionContextChangedEvent.SessionContextChangedEventData.SessionContextChangedEventDataHostType - .fromValue("unknown")); + assertEquals(WorkingDirectoryContextHostType.GITHUB, WorkingDirectoryContextHostType.fromValue("github")); + assertEquals(WorkingDirectoryContextHostType.ADO, WorkingDirectoryContextHostType.fromValue("ado")); + assertThrows(IllegalArgumentException.class, () -> WorkingDirectoryContextHostType.fromValue("unknown")); } @Test void testSessionMcpServersLoadedStatusEnumFromValue() { - assertThrows(IllegalArgumentException.class, - () -> SessionMcpServersLoadedEvent.SessionMcpServersLoadedEventData.SessionMcpServersLoadedEventDataServersItem.SessionMcpServersLoadedEventDataServersItemStatus - .fromValue("unknown")); + assertThrows(IllegalArgumentException.class, () -> McpServersLoadedServerStatus.fromValue("unknown")); } } diff --git a/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcApiCoverageTest.java b/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcApiCoverageTest.java index e7f8d55d4..89943e375 100644 --- a/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcApiCoverageTest.java +++ b/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcApiCoverageTest.java @@ -184,10 +184,10 @@ void sessionRpc_workspace_listFiles_injects_sessionId() { var stub = new StubCaller(); var session = new SessionRpc(stub, "sess-ws"); - session.workspace.listFiles(); + session.workspaces.listFiles(); assertEquals(1, stub.calls.size()); - assertEquals("session.workspace.listFiles", stub.calls.get(0).method()); + assertEquals("session.workspaces.listFiles", stub.calls.get(0).method()); var params = (Map) stub.calls.get(0).params(); assertEquals("sess-ws", params.get("sessionId")); } @@ -197,11 +197,11 @@ void sessionRpc_workspace_readFile_merges_sessionId() { var stub = new StubCaller(); var session = new SessionRpc(stub, "sess-ws-rf"); - var rfParams = new SessionWorkspaceReadFileParams(null, "/src/Main.java"); - session.workspace.readFile(rfParams); + var rfParams = new SessionWorkspacesReadFileParams(null, "/src/Main.java"); + session.workspaces.readFile(rfParams); assertEquals(1, stub.calls.size()); - assertEquals("session.workspace.readFile", stub.calls.get(0).method()); + assertEquals("session.workspaces.readFile", stub.calls.get(0).method()); var params = (com.fasterxml.jackson.databind.node.ObjectNode) stub.calls.get(0).params(); assertEquals("sess-ws-rf", params.get("sessionId").asText()); assertEquals("/src/Main.java", params.get("path").asText()); @@ -212,11 +212,11 @@ void sessionRpc_workspace_createFile_merges_sessionId() { var stub = new StubCaller(); var session = new SessionRpc(stub, "sess-ws-cf"); - var cfParams = new SessionWorkspaceCreateFileParams(null, "/new/file.txt", "content"); - session.workspace.createFile(cfParams); + var cfParams = new SessionWorkspacesCreateFileParams(null, "/new/file.txt", "content"); + session.workspaces.createFile(cfParams); assertEquals(1, stub.calls.size()); - assertEquals("session.workspace.createFile", stub.calls.get(0).method()); + assertEquals("session.workspaces.createFile", stub.calls.get(0).method()); var params = (com.fasterxml.jackson.databind.node.ObjectNode) stub.calls.get(0).params(); assertEquals("sess-ws-cf", params.get("sessionId").asText()); } @@ -674,24 +674,20 @@ void sessionAgentDeselectResult_empty_record() { @Test void sessionLogParams_level_enum_values() { - assertEquals("info", SessionLogParams.SessionLogParamsLevel.INFO.getValue()); - assertEquals("warning", SessionLogParams.SessionLogParamsLevel.WARNING.getValue()); - assertEquals("error", SessionLogParams.SessionLogParamsLevel.ERROR.getValue()); + assertEquals("info", SessionLogLevel.INFO.getValue()); + assertEquals("warning", SessionLogLevel.WARNING.getValue()); + assertEquals("error", SessionLogLevel.ERROR.getValue()); } @Test void sessionLogParams_level_enum_fromValue() { - assertEquals(SessionLogParams.SessionLogParamsLevel.INFO, - SessionLogParams.SessionLogParamsLevel.fromValue("info")); - assertEquals(SessionLogParams.SessionLogParamsLevel.WARNING, - SessionLogParams.SessionLogParamsLevel.fromValue("warning")); - assertEquals(SessionLogParams.SessionLogParamsLevel.ERROR, - SessionLogParams.SessionLogParamsLevel.fromValue("error")); + assertEquals(SessionLogLevel.INFO, SessionLogLevel.fromValue("info")); + assertEquals(SessionLogLevel.WARNING, SessionLogLevel.fromValue("warning")); + assertEquals(SessionLogLevel.ERROR, SessionLogLevel.fromValue("error")); } @Test void sessionLogParams_level_enum_fromValue_unknown_throws() { - assertThrows(IllegalArgumentException.class, - () -> SessionLogParams.SessionLogParamsLevel.fromValue("unknown-level")); + assertThrows(IllegalArgumentException.class, () -> SessionLogLevel.fromValue("unknown-level")); } } diff --git a/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcRecordsCoverageTest.java b/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcRecordsCoverageTest.java index e2bf423ff..8e86bddf2 100644 --- a/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcRecordsCoverageTest.java +++ b/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcRecordsCoverageTest.java @@ -32,10 +32,10 @@ void pingParams_record() { @Test void pingResult_record() { - var result = new PingResult("pong", 1234.0, 2.0); + var result = new PingResult("pong", 1234L, 2L); assertEquals("pong", result.message()); - assertEquals(1234.0, result.timestamp()); - assertEquals(2.0, result.protocolVersion()); + assertEquals(1234L, result.timestamp()); + assertEquals(2L, result.protocolVersion()); } @Test @@ -209,12 +209,10 @@ void sessionFsRmParams_record() { @Test void sessionFsSetProviderParams_conventions_enum() { - assertEquals("windows", SessionFsSetProviderParams.SessionFsSetProviderParamsConventions.WINDOWS.getValue()); - assertEquals("posix", SessionFsSetProviderParams.SessionFsSetProviderParamsConventions.POSIX.getValue()); - assertEquals(SessionFsSetProviderParams.SessionFsSetProviderParamsConventions.POSIX, - SessionFsSetProviderParams.SessionFsSetProviderParamsConventions.fromValue("posix")); - assertThrows(IllegalArgumentException.class, - () -> SessionFsSetProviderParams.SessionFsSetProviderParamsConventions.fromValue("unknown")); + assertEquals("windows", SessionFsSetProviderConventions.WINDOWS.getValue()); + assertEquals("posix", SessionFsSetProviderConventions.POSIX.getValue()); + assertEquals(SessionFsSetProviderConventions.POSIX, SessionFsSetProviderConventions.fromValue("posix")); + assertThrows(IllegalArgumentException.class, () -> SessionFsSetProviderConventions.fromValue("unknown")); } @Test @@ -248,20 +246,19 @@ void sessionHistoryTruncateParams_record() { @Test void sessionLogParams_record() { - var params = new SessionLogParams("sess-24", "test message", SessionLogParams.SessionLogParamsLevel.INFO, false, - null); + var params = new SessionLogParams("sess-24", "test message", SessionLogLevel.INFO, false, null); assertEquals("sess-24", params.sessionId()); assertEquals("test message", params.message()); - assertEquals(SessionLogParams.SessionLogParamsLevel.INFO, params.level()); + assertEquals(SessionLogLevel.INFO, params.level()); assertFalse(params.ephemeral()); assertNull(params.url()); } @Test void sessionLogParams_level_enum_all_values() { - for (var level : SessionLogParams.SessionLogParamsLevel.values()) { + for (var level : SessionLogLevel.values()) { assertNotNull(level.getValue()); - assertEquals(level, SessionLogParams.SessionLogParamsLevel.fromValue(level.getValue())); + assertEquals(level, SessionLogLevel.fromValue(level.getValue())); } } @@ -299,21 +296,20 @@ void sessionModeGetParams_record() { @Test void sessionModeSetParams_record() { - var params = new SessionModeSetParams("sess-30", SessionModeSetParams.SessionModeSetParamsMode.PLAN); + var params = new SessionModeSetParams("sess-30", SessionMode.PLAN); assertEquals("sess-30", params.sessionId()); - assertEquals(SessionModeSetParams.SessionModeSetParamsMode.PLAN, params.mode()); + assertEquals(SessionMode.PLAN, params.mode()); } @Test void sessionModeSetParams_mode_enum() { - assertEquals("interactive", SessionModeSetParams.SessionModeSetParamsMode.INTERACTIVE.getValue()); - assertEquals("plan", SessionModeSetParams.SessionModeSetParamsMode.PLAN.getValue()); - assertEquals("autopilot", SessionModeSetParams.SessionModeSetParamsMode.AUTOPILOT.getValue()); - for (var mode : SessionModeSetParams.SessionModeSetParamsMode.values()) { - assertEquals(mode, SessionModeSetParams.SessionModeSetParamsMode.fromValue(mode.getValue())); + assertEquals("interactive", SessionMode.INTERACTIVE.getValue()); + assertEquals("plan", SessionMode.PLAN.getValue()); + assertEquals("autopilot", SessionMode.AUTOPILOT.getValue()); + for (var mode : SessionMode.values()) { + assertEquals(mode, SessionMode.fromValue(mode.getValue())); } - assertThrows(IllegalArgumentException.class, - () -> SessionModeSetParams.SessionModeSetParamsMode.fromValue("unknown-mode")); + assertThrows(IllegalArgumentException.class, () -> SessionMode.fromValue("unknown-mode")); } @Test @@ -366,32 +362,30 @@ void sessionPluginsListParams_record() { @Test void sessionShellExecParams_record() { - var params = new SessionShellExecParams("sess-38", "ls -la", "/workspace", 5000.0); + var params = new SessionShellExecParams("sess-38", "ls -la", "/workspace", 5000L); assertEquals("sess-38", params.sessionId()); assertEquals("ls -la", params.command()); assertEquals("/workspace", params.cwd()); - assertEquals(5000.0, params.timeout()); + assertEquals(5000L, params.timeout()); } @Test void sessionShellKillParams_record() { - var params = new SessionShellKillParams("sess-39", "proc-abc", - SessionShellKillParams.SessionShellKillParamsSignal.SIGTERM); + var params = new SessionShellKillParams("sess-39", "proc-abc", ShellKillSignal.SIGTERM); assertEquals("sess-39", params.sessionId()); assertEquals("proc-abc", params.processId()); - assertEquals(SessionShellKillParams.SessionShellKillParamsSignal.SIGTERM, params.signal()); + assertEquals(ShellKillSignal.SIGTERM, params.signal()); } @Test void sessionShellKillParams_signal_enum() { - assertEquals("SIGTERM", SessionShellKillParams.SessionShellKillParamsSignal.SIGTERM.getValue()); - assertEquals("SIGKILL", SessionShellKillParams.SessionShellKillParamsSignal.SIGKILL.getValue()); - assertEquals("SIGINT", SessionShellKillParams.SessionShellKillParamsSignal.SIGINT.getValue()); - for (var sig : SessionShellKillParams.SessionShellKillParamsSignal.values()) { - assertEquals(sig, SessionShellKillParams.SessionShellKillParamsSignal.fromValue(sig.getValue())); + assertEquals("SIGTERM", ShellKillSignal.SIGTERM.getValue()); + assertEquals("SIGKILL", ShellKillSignal.SIGKILL.getValue()); + assertEquals("SIGINT", ShellKillSignal.SIGINT.getValue()); + for (var sig : ShellKillSignal.values()) { + assertEquals(sig, ShellKillSignal.fromValue(sig.getValue())); } - assertThrows(IllegalArgumentException.class, - () -> SessionShellKillParams.SessionShellKillParamsSignal.fromValue("SIGHUP")); + assertThrows(IllegalArgumentException.class, () -> ShellKillSignal.fromValue("SIGHUP")); } @Test @@ -476,10 +470,10 @@ void sessionWorkspaceReadFileParams_record() { @Test void pingResult_fields() { - var result = new PingResult("pong", 9999.0, 1.0); + var result = new PingResult("pong", 9999L, 1L); assertEquals("pong", result.message()); - assertEquals(9999.0, result.timestamp()); - assertEquals(1.0, result.protocolVersion()); + assertEquals(9999L, result.timestamp()); + assertEquals(1L, result.protocolVersion()); } @Test @@ -489,7 +483,7 @@ void sessionAgentDeselectResult_empty() { @Test void sessionAgentListResult_with_items() { - var item = new SessionAgentListResult.SessionAgentListResultAgentsItem("name1", "Name One", "Desc 1"); + var item = new AgentInfo("name1", "Name One", "Desc 1"); var result = new SessionAgentListResult(List.of(item)); assertEquals(1, result.agents().size()); assertEquals("name1", result.agents().get(0).name()); @@ -499,8 +493,7 @@ void sessionAgentListResult_with_items() { @Test void sessionAgentGetCurrentResult_nested() { - var agent = new SessionAgentGetCurrentResult.SessionAgentGetCurrentResultAgent("agent-1", "Agent One", - "Does things"); + var agent = new AgentInfo("agent-1", "Agent One", "Does things"); var result = new SessionAgentGetCurrentResult(agent); assertEquals("agent-1", result.agent().name()); assertEquals("Agent One", result.agent().displayName()); @@ -515,7 +508,7 @@ void sessionAgentGetCurrentResult_null_agent() { @Test void sessionAgentReloadResult_with_items() { - var item = new SessionAgentReloadResult.SessionAgentReloadResultAgentsItem("a", "A", "Desc"); + var item = new AgentInfo("a", "A", "Desc"); var result = new SessionAgentReloadResult(List.of(item)); assertEquals(1, result.agents().size()); assertEquals("a", result.agents().get(0).name()); @@ -523,8 +516,7 @@ void sessionAgentReloadResult_with_items() { @Test void sessionAgentSelectResult_nested() { - var agent = new SessionAgentSelectResult.SessionAgentSelectResultAgent("selected", "Selected", - "The selected agent"); + var agent = new AgentInfo("selected", "Selected", "The selected agent"); var result = new SessionAgentSelectResult(agent); assertEquals("selected", result.agent().name()); } @@ -548,45 +540,28 @@ void sessionExtensionsEnableResult_empty() { @Test void sessionExtensionsListResult_nested() { - var ext = new SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem("ext-1", "My Extension", - SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemSource.PROJECT, - SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemStatus.RUNNING, - 1234L); + var ext = new Extension("ext-1", "My Extension", ExtensionSource.PROJECT, ExtensionStatus.RUNNING, 1234L); var result = new SessionExtensionsListResult(List.of(ext)); assertEquals(1, result.extensions().size()); assertEquals("ext-1", result.extensions().get(0).id()); assertEquals("My Extension", result.extensions().get(0).name()); - assertEquals( - SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemSource.PROJECT, - result.extensions().get(0).source()); - assertEquals( - SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemStatus.RUNNING, - result.extensions().get(0).status()); + assertEquals(ExtensionSource.PROJECT, result.extensions().get(0).source()); + assertEquals(ExtensionStatus.RUNNING, result.extensions().get(0).status()); assertEquals(1234L, result.extensions().get(0).pid()); } @Test void sessionExtensionsListResult_enums() { - for (var src : SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemSource - .values()) { + for (var src : ExtensionSource.values()) { assertNotNull(src.getValue()); - assertEquals(src, - SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemSource - .fromValue(src.getValue())); + assertEquals(src, ExtensionSource.fromValue(src.getValue())); } - for (var status : SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemStatus - .values()) { + for (var status : ExtensionStatus.values()) { assertNotNull(status.getValue()); - assertEquals(status, - SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemStatus - .fromValue(status.getValue())); + assertEquals(status, ExtensionStatus.fromValue(status.getValue())); } - assertThrows(IllegalArgumentException.class, - () -> SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemSource - .fromValue("unknown")); - assertThrows(IllegalArgumentException.class, - () -> SessionExtensionsListResult.SessionExtensionsListResultExtensionsItem.SessionExtensionsListResultExtensionsItemStatus - .fromValue("unknown")); + assertThrows(IllegalArgumentException.class, () -> ExtensionSource.fromValue("unknown")); + assertThrows(IllegalArgumentException.class, () -> ExtensionStatus.fromValue("unknown")); } @Test @@ -610,42 +585,34 @@ void sessionFsExistsResult_record() { @Test void sessionFsReadFileResult_record() { - var result = new SessionFsReadFileResult("file content here"); + var result = new SessionFsReadFileResult("file content here", null); assertEquals("file content here", result.content()); } @Test void sessionFsReaddirResult_record() { - var result = new SessionFsReaddirResult(List.of("file1.txt", "file2.txt")); + var result = new SessionFsReaddirResult(List.of("file1.txt", "file2.txt"), null); assertEquals(2, result.entries().size()); assertEquals("file1.txt", result.entries().get(0)); } @Test void sessionFsReaddirWithTypesResult_nested() { - var entry = new SessionFsReaddirWithTypesResult.SessionFsReaddirWithTypesResultEntriesItem("myfile.txt", - SessionFsReaddirWithTypesResult.SessionFsReaddirWithTypesResultEntriesItem.SessionFsReaddirWithTypesResultEntriesItemType.FILE); - var result = new SessionFsReaddirWithTypesResult(List.of(entry)); + var entry = new SessionFsReaddirWithTypesEntry("myfile.txt", SessionFsReaddirWithTypesEntryType.FILE); + var result = new SessionFsReaddirWithTypesResult(List.of(entry), null); assertEquals(1, result.entries().size()); assertEquals("myfile.txt", result.entries().get(0).name()); - assertEquals( - SessionFsReaddirWithTypesResult.SessionFsReaddirWithTypesResultEntriesItem.SessionFsReaddirWithTypesResultEntriesItemType.FILE, - result.entries().get(0).type()); + assertEquals(SessionFsReaddirWithTypesEntryType.FILE, result.entries().get(0).type()); assertEquals("file", result.entries().get(0).type().getValue()); } @Test void sessionFsReaddirWithTypesResult_type_enum() { - for (var t : SessionFsReaddirWithTypesResult.SessionFsReaddirWithTypesResultEntriesItem.SessionFsReaddirWithTypesResultEntriesItemType - .values()) { + for (var t : SessionFsReaddirWithTypesEntryType.values()) { assertNotNull(t.getValue()); - assertEquals(t, - SessionFsReaddirWithTypesResult.SessionFsReaddirWithTypesResultEntriesItem.SessionFsReaddirWithTypesResultEntriesItemType - .fromValue(t.getValue())); + assertEquals(t, SessionFsReaddirWithTypesEntryType.fromValue(t.getValue())); } - assertThrows(IllegalArgumentException.class, - () -> SessionFsReaddirWithTypesResult.SessionFsReaddirWithTypesResultEntriesItem.SessionFsReaddirWithTypesResultEntriesItemType - .fromValue("symlink")); + assertThrows(IllegalArgumentException.class, () -> SessionFsReaddirWithTypesEntryType.fromValue("symlink")); } @Test @@ -657,31 +624,30 @@ void sessionFsSetProviderResult_record() { @Test void sessionFsStatResult_record() { - var result = new SessionFsStatResult(true, false, 1024.0, "2026-01-01T00:00:00Z", "2025-12-01T00:00:00Z"); + var result = new SessionFsStatResult(true, false, 1024L, null, null, null); assertTrue(result.isFile()); assertFalse(result.isDirectory()); - assertEquals(1024.0, result.size()); - assertEquals("2026-01-01T00:00:00Z", result.mtime()); - assertEquals("2025-12-01T00:00:00Z", result.birthtime()); + assertEquals(1024L, result.size()); + assertNull(result.mtime()); + assertNull(result.birthtime()); } @Test void sessionHistoryCompactResult_nested() { - var ctx = new SessionHistoryCompactResult.SessionHistoryCompactResultContextWindow(100000.0, 5000.0, 20.0, - 1000.0, 3000.0, 500.0); - var result = new SessionHistoryCompactResult(true, 2000.0, 5.0, ctx); + var ctx = new HistoryCompactContextWindow(100000L, 5000L, 20L, 1000L, 3000L, 500L); + var result = new SessionHistoryCompactResult(true, 2000L, 5L, ctx); assertTrue(result.success()); - assertEquals(2000.0, result.tokensRemoved()); - assertEquals(5.0, result.messagesRemoved()); + assertEquals(2000L, result.tokensRemoved()); + assertEquals(5L, result.messagesRemoved()); assertNotNull(result.contextWindow()); - assertEquals(100000.0, result.contextWindow().tokenLimit()); - assertEquals(5000.0, result.contextWindow().currentTokens()); + assertEquals(100000L, result.contextWindow().tokenLimit()); + assertEquals(5000L, result.contextWindow().currentTokens()); } @Test void sessionHistoryTruncateResult_record() { - var result = new SessionHistoryTruncateResult(3.0); - assertEquals(3.0, result.eventsRemoved()); + var result = new SessionHistoryTruncateResult(3L); + assertEquals(3L, result.eventsRemoved()); } @Test @@ -703,30 +669,21 @@ void sessionMcpEnableResult_empty() { @Test void sessionMcpListResult_nested() { - var server = new SessionMcpListResult.SessionMcpListResultServersItem("my-mcp", - SessionMcpListResult.SessionMcpListResultServersItem.SessionMcpListResultServersItemStatus.CONNECTED, - "user", null); + var server = new McpServer("my-mcp", McpServerStatus.CONNECTED, McpServerSource.USER, null); var result = new SessionMcpListResult(List.of(server)); assertEquals(1, result.servers().size()); assertEquals("my-mcp", result.servers().get(0).name()); - assertEquals( - SessionMcpListResult.SessionMcpListResultServersItem.SessionMcpListResultServersItemStatus.CONNECTED, - result.servers().get(0).status()); - assertEquals("user", result.servers().get(0).source()); + assertEquals(McpServerStatus.CONNECTED, result.servers().get(0).status()); + assertEquals(McpServerSource.USER, result.servers().get(0).source()); } @Test void sessionMcpListResult_status_enum_all_values() { - for (var status : SessionMcpListResult.SessionMcpListResultServersItem.SessionMcpListResultServersItemStatus - .values()) { + for (var status : McpServerStatus.values()) { assertNotNull(status.getValue()); - assertEquals(status, - SessionMcpListResult.SessionMcpListResultServersItem.SessionMcpListResultServersItemStatus - .fromValue(status.getValue())); + assertEquals(status, McpServerStatus.fromValue(status.getValue())); } - assertThrows(IllegalArgumentException.class, - () -> SessionMcpListResult.SessionMcpListResultServersItem.SessionMcpListResultServersItemStatus - .fromValue("unknown-status")); + assertThrows(IllegalArgumentException.class, () -> McpServerStatus.fromValue("unknown-status")); } @Test @@ -792,8 +749,7 @@ void sessionPlanUpdateResult_empty() { @Test void sessionPluginsListResult_nested() { - var plugin = new SessionPluginsListResult.SessionPluginsListResultPluginsItem("my-plugin", "marketplace-x", - "1.2.3", true); + var plugin = new Plugin("my-plugin", "marketplace-x", "1.2.3", true); var result = new SessionPluginsListResult(List.of(plugin)); assertEquals(1, result.plugins().size()); assertEquals("my-plugin", result.plugins().get(0).name()); @@ -827,8 +783,7 @@ void sessionSkillsEnableResult_empty() { @Test void sessionSkillsListResult_nested() { - var item = new SessionSkillsListResult.SessionSkillsListResultSkillsItem("deploy", "Deploy the app", "project", - true, true, "/skills/deploy.md"); + var item = new Skill("deploy", "Deploy the app", "project", true, true, "/skills/deploy.md"); var result = new SessionSkillsListResult(List.of(item)); assertEquals(1, result.skills().size()); assertEquals("deploy", result.skills().get(0).name()); @@ -850,22 +805,20 @@ void sessionToolsHandlePendingToolCallResult_record() { @Test void sessionUiElicitationResult_accept() { - var result = new SessionUiElicitationResult(SessionUiElicitationResult.SessionUiElicitationResultAction.ACCEPT, - Map.of("name", "Alice")); - assertEquals(SessionUiElicitationResult.SessionUiElicitationResultAction.ACCEPT, result.action()); + var result = new SessionUiElicitationResult(UIElicitationResponseAction.ACCEPT, Map.of("name", "Alice")); + assertEquals(UIElicitationResponseAction.ACCEPT, result.action()); assertEquals("Alice", result.content().get("name")); } @Test void sessionUiElicitationResult_action_enum() { - assertEquals("accept", SessionUiElicitationResult.SessionUiElicitationResultAction.ACCEPT.getValue()); - assertEquals("decline", SessionUiElicitationResult.SessionUiElicitationResultAction.DECLINE.getValue()); - assertEquals("cancel", SessionUiElicitationResult.SessionUiElicitationResultAction.CANCEL.getValue()); - for (var a : SessionUiElicitationResult.SessionUiElicitationResultAction.values()) { - assertEquals(a, SessionUiElicitationResult.SessionUiElicitationResultAction.fromValue(a.getValue())); + assertEquals("accept", UIElicitationResponseAction.ACCEPT.getValue()); + assertEquals("decline", UIElicitationResponseAction.DECLINE.getValue()); + assertEquals("cancel", UIElicitationResponseAction.CANCEL.getValue()); + for (var a : UIElicitationResponseAction.values()) { + assertEquals(a, UIElicitationResponseAction.fromValue(a.getValue())); } - assertThrows(IllegalArgumentException.class, - () -> SessionUiElicitationResult.SessionUiElicitationResultAction.fromValue("unknown")); + assertThrows(IllegalArgumentException.class, () -> UIElicitationResponseAction.fromValue("unknown")); } @Test @@ -876,7 +829,7 @@ void sessionUiHandlePendingElicitationResult_record() { @Test void sessionUsageGetMetricsResult_nested() { - var changes = new SessionUsageGetMetricsResult.SessionUsageGetMetricsResultCodeChanges(100L, 50L, 5L); + var changes = new UsageMetricsCodeChanges(100L, 50L, 5L); var result = new SessionUsageGetMetricsResult(0.5, 10L, 2000.0, 1700000000000L, changes, null, "gpt-5", 1000L, 500L); assertEquals(0.5, result.totalPremiumRequestCost()); @@ -916,13 +869,12 @@ void sessionsForkResult_record() { @Test void accountGetQuotaResult_nested() { - var snapshot = new AccountGetQuotaResult.AccountGetQuotaResultQuotaSnapshotsValue(100.0, 40.0, 60.0, 5.0, true, - "2026-05-01"); + var snapshot = new AccountQuotaSnapshot(null, 100L, 40L, null, 60.0, 5.0, true, "2026-05-01"); var result = new AccountGetQuotaResult(Map.of("chat", snapshot)); assertEquals(1, result.quotaSnapshots().size()); var s = result.quotaSnapshots().get("chat"); - assertEquals(100.0, s.entitlementRequests()); - assertEquals(40.0, s.usedRequests()); + assertEquals(100L, s.entitlementRequests()); + assertEquals(40L, s.usedRequests()); assertEquals(60.0, s.remainingPercentage()); assertEquals(5.0, s.overage()); assertTrue(s.overageAllowedWithExhaustedQuota()); @@ -938,41 +890,33 @@ void mcpConfigListResult_record() { @Test void mcpDiscoverResult_nested() { - var server = new McpDiscoverResult.McpDiscoverResultServersItem("discovered-server", "local", - McpDiscoverResult.McpDiscoverResultServersItem.McpDiscoverResultServersItemSource.USER, true); + var server = new DiscoveredMcpServer("discovered-server", DiscoveredMcpServerType.STDIO, + DiscoveredMcpServerSource.USER, true); var result = new McpDiscoverResult(List.of(server)); assertEquals(1, result.servers().size()); assertEquals("discovered-server", result.servers().get(0).name()); - assertEquals("local", result.servers().get(0).type()); - assertEquals(McpDiscoverResult.McpDiscoverResultServersItem.McpDiscoverResultServersItemSource.USER, - result.servers().get(0).source()); + assertEquals(DiscoveredMcpServerType.STDIO, result.servers().get(0).type()); + assertEquals(DiscoveredMcpServerSource.USER, result.servers().get(0).source()); assertTrue(result.servers().get(0).enabled()); } @Test void mcpDiscoverResult_source_enum_all_values() { - for (var src : McpDiscoverResult.McpDiscoverResultServersItem.McpDiscoverResultServersItemSource.values()) { + for (var src : DiscoveredMcpServerSource.values()) { assertNotNull(src.getValue()); - assertEquals(src, McpDiscoverResult.McpDiscoverResultServersItem.McpDiscoverResultServersItemSource - .fromValue(src.getValue())); + assertEquals(src, DiscoveredMcpServerSource.fromValue(src.getValue())); } - assertThrows(IllegalArgumentException.class, - () -> McpDiscoverResult.McpDiscoverResultServersItem.McpDiscoverResultServersItemSource - .fromValue("unknown-source")); + assertThrows(IllegalArgumentException.class, () -> DiscoveredMcpServerSource.fromValue("unknown-source")); } @Test void modelsListResult_nested() { - var supports = new ModelsListResult.ModelsListResultModelsItem.ModelsListResultModelsItemCapabilities.ModelsListResultModelsItemCapabilitiesSupports( - true, false); - var limits = new ModelsListResult.ModelsListResultModelsItem.ModelsListResultModelsItemCapabilities.ModelsListResultModelsItemCapabilitiesLimits( - 100000.0, 8192.0, 128000.0, null); - var capabilities = new ModelsListResult.ModelsListResultModelsItem.ModelsListResultModelsItemCapabilities( - supports, limits); - var policy = new ModelsListResult.ModelsListResultModelsItem.ModelsListResultModelsItemPolicy("active", null); - var billing = new ModelsListResult.ModelsListResultModelsItem.ModelsListResultModelsItemBilling(1.0); - var modelItem = new ModelsListResult.ModelsListResultModelsItem("gpt-5", "GPT-5", capabilities, policy, billing, - null, null); + var supports = new ModelCapabilitiesSupports(true, false); + var limits = new ModelCapabilitiesLimits(100000L, 8192L, 128000L, null); + var capabilities = new ModelCapabilities(supports, limits); + var policy = new ModelPolicy("active", null); + var billing = new ModelBilling(1.0); + var modelItem = new Model("gpt-5", "GPT-5", capabilities, policy, billing, null, null); var result = new ModelsListResult(List.of(modelItem)); assertEquals(1, result.models().size()); @@ -980,15 +924,14 @@ void modelsListResult_nested() { assertEquals("GPT-5", result.models().get(0).name()); assertTrue(result.models().get(0).capabilities().supports().vision()); assertFalse(result.models().get(0).capabilities().supports().reasoningEffort()); - assertEquals(100000.0, result.models().get(0).capabilities().limits().maxPromptTokens()); + assertEquals(100000L, result.models().get(0).capabilities().limits().maxPromptTokens()); assertEquals("active", result.models().get(0).policy().state()); - assertEquals(1.0, result.models().get(0).billing().multiplier()); + assertEquals(Double.valueOf(1.0), result.models().get(0).billing().multiplier()); } @Test void toolsListResult_nested() { - var tool = new ToolsListResult.ToolsListResultToolsItem("bash", "bash", "Run shell commands", - Map.of("type", "object"), "Use for shell commands"); + var tool = new Tool("bash", "bash", "Run shell commands", Map.of("type", "object"), "Use for shell commands"); var result = new ToolsListResult(List.of(tool)); assertEquals(1, result.tools().size()); assertEquals("bash", result.tools().get(0).name()); @@ -1001,20 +944,17 @@ void toolsListResult_nested() { @Test void sessionModelSwitchToParams_nested_records() { - var limitsVision = new SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities.SessionModelSwitchToParamsModelCapabilitiesLimits.SessionModelSwitchToParamsModelCapabilitiesLimitsVision( - List.of("image/png", "image/jpeg"), 10.0, 5000000.0); - var limits = new SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities.SessionModelSwitchToParamsModelCapabilitiesLimits( - 100000.0, 8192.0, 128000.0, limitsVision); - var supports = new SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities.SessionModelSwitchToParamsModelCapabilitiesSupports( - true, true); - var capabilities = new SessionModelSwitchToParams.SessionModelSwitchToParamsModelCapabilities(supports, limits); + var limitsVision = new ModelCapabilitiesOverrideLimitsVision(List.of("image/png", "image/jpeg"), 10L, 5000000L); + var limits = new ModelCapabilitiesOverrideLimits(100000L, 8192L, 128000L, limitsVision); + var supports = new ModelCapabilitiesOverrideSupports(true, true); + var capabilities = new ModelCapabilitiesOverride(supports, limits); var params = new SessionModelSwitchToParams("sess-m", "gpt-5", null, capabilities); assertEquals("gpt-5", params.modelId()); assertNotNull(params.modelCapabilities()); assertTrue(params.modelCapabilities().supports().vision()); assertTrue(params.modelCapabilities().supports().reasoningEffort()); - assertEquals(100000.0, params.modelCapabilities().limits().maxPromptTokens()); + assertEquals(100000L, params.modelCapabilities().limits().maxPromptTokens()); assertEquals(2, params.modelCapabilities().limits().vision().supportedMediaTypes().size()); } @@ -1022,8 +962,7 @@ void sessionModelSwitchToParams_nested_records() { @Test void sessionUiElicitationParams_nested_schema() { - var schema = new SessionUiElicitationParams.SessionUiElicitationParamsRequestedSchema("object", - Map.of("name", Map.of("type", "string")), List.of("name")); + var schema = new UIElicitationSchema("object", Map.of("name", Map.of("type", "string")), List.of("name")); var params = new SessionUiElicitationParams("sess-elicit", "Please fill form", schema); assertEquals("sess-elicit", params.sessionId()); assertEquals("object", params.requestedSchema().type()); @@ -1034,15 +973,10 @@ void sessionUiElicitationParams_nested_schema() { @Test void sessionUiHandlePendingElicitationParamsResult_action_enum() { - for (var action : SessionUiHandlePendingElicitationParams.SessionUiHandlePendingElicitationParamsResult.SessionUiHandlePendingElicitationParamsResultAction - .values()) { + for (var action : UIElicitationResponseAction.values()) { assertNotNull(action.getValue()); - assertEquals(action, - SessionUiHandlePendingElicitationParams.SessionUiHandlePendingElicitationParamsResult.SessionUiHandlePendingElicitationParamsResultAction - .fromValue(action.getValue())); + assertEquals(action, UIElicitationResponseAction.fromValue(action.getValue())); } - assertThrows(IllegalArgumentException.class, - () -> SessionUiHandlePendingElicitationParams.SessionUiHandlePendingElicitationParamsResult.SessionUiHandlePendingElicitationParamsResultAction - .fromValue("unknown")); + assertThrows(IllegalArgumentException.class, () -> UIElicitationResponseAction.fromValue("unknown")); } }