diff --git a/.github/actions/test-report/action.yml b/.github/actions/test-report/action.yml index 4f807ed911..52a093a68d 100644 --- a/.github/actions/test-report/action.yml +++ b/.github/actions/test-report/action.yml @@ -9,6 +9,10 @@ inputs: description: "Path to the JaCoCo XML report" required: false default: "target/site/jacoco-coverage/jacoco.xml" + jacoco-csv-path: + description: "Path to the JaCoCo CSV report" + required: false + default: "target/site/jacoco-coverage/jacoco.csv" check-name: description: "Name for the check run" required: false @@ -80,6 +84,7 @@ runs: shell: bash run: | JACOCO_XML="${{ inputs.jacoco-path }}" + JACOCO_CSV="${{ inputs.jacoco-csv-path }}" if [ -f "$JACOCO_XML" ]; then echo "" >> $GITHUB_STEP_SUMMARY @@ -139,6 +144,36 @@ runs: echo "| 📏 Lines | ${LINE_COVERED:-0} | ${LINE_MISSED:-0} | ${LINE_PCT}% |" >> $GITHUB_STEP_SUMMARY echo "| 🔧 Methods | ${METHOD_COVERED:-0} | ${METHOD_MISSED:-0} | ${METHOD_PCT}% |" >> $GITHUB_STEP_SUMMARY echo "| 📦 Classes | ${CLASS_COVERED:-0} | ${CLASS_MISSED:-0} | ${CLASS_PCT}% |" >> $GITHUB_STEP_SUMMARY + + if [ -f "$JACOCO_CSV" ]; then + extract_instruction_scope() { + local scope=$1 + awk -F',' -v scope="$scope" -v generated_prefix="com.github.copilot.sdk.generated" ' + NR > 1 { + is_generated = index($2, generated_prefix) == 1 + if ((scope == "generated" && is_generated) || + (scope == "handwritten" && !is_generated)) { + missed += $4 + covered += $5 + } + } + END { print covered + 0 "," missed + 0 } + ' "$JACOCO_CSV" + } + + IFS=, read -r HANDWRITTEN_COVERED HANDWRITTEN_MISSED <<< "$(extract_instruction_scope handwritten)" + IFS=, read -r GENERATED_COVERED GENERATED_MISSED <<< "$(extract_instruction_scope generated)" + HANDWRITTEN_PCT=$(calc_pct "${HANDWRITTEN_COVERED:-0}" "${HANDWRITTEN_MISSED:-0}") + GENERATED_PCT=$(calc_pct "${GENERATED_COVERED:-0}" "${GENERATED_MISSED:-0}") + + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Coverage by Code Origin (Instructions)" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Origin | Covered | Missed | Coverage |" >> $GITHUB_STEP_SUMMARY + echo "|--------|---------|--------|----------|" >> $GITHUB_STEP_SUMMARY + echo "| ✍️ Handwritten | ${HANDWRITTEN_COVERED:-0} | ${HANDWRITTEN_MISSED:-0} | ${HANDWRITTEN_PCT}% |" >> $GITHUB_STEP_SUMMARY + echo "| 🤖 Generated | ${GENERATED_COVERED:-0} | ${GENERATED_MISSED:-0} | ${GENERATED_PCT}% |" >> $GITHUB_STEP_SUMMARY + fi else echo "" >> $GITHUB_STEP_SUMMARY echo "## 📊 Code Coverage" >> $GITHUB_STEP_SUMMARY diff --git a/.github/aw/actions-lock.json b/.github/aw/actions-lock.json index 6a6fa53d9f..71291dd03b 100644 --- a/.github/aw/actions-lock.json +++ b/.github/aw/actions-lock.json @@ -40,10 +40,10 @@ "version": "v7.0.1", "sha": "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a" }, - "github/gh-aw-actions/setup@v0.71.5": { + "github/gh-aw-actions/setup@v0.74.4": { "repo": "github/gh-aw-actions/setup", - "version": "v0.71.5", - "sha": "b8068426813005612b960b5ab0b8bd2c27142323" + "version": "v0.74.4", + "sha": "d3abfe96a194bce3a523ed2093ddedd5704cdf62" }, "github/gh-aw/actions/setup@v0.51.6": { "repo": "github/gh-aw/actions/setup", diff --git a/.github/badges/jacoco-generated.svg b/.github/badges/jacoco-generated.svg new file mode 100644 index 0000000000..9422a5629e --- /dev/null +++ b/.github/badges/jacoco-generated.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + coverage generated + coverage generated + 72.8% + 72.8% + + diff --git a/.github/badges/jacoco-handwritten.svg b/.github/badges/jacoco-handwritten.svg new file mode 100644 index 0000000000..c7f675e6e9 --- /dev/null +++ b/.github/badges/jacoco-handwritten.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + coverage handwritten + coverage handwritten + 82.5% + 82.5% + + diff --git a/.github/badges/jacoco.svg b/.github/badges/jacoco.svg index b90843bcc4..bcfcc44d75 100644 --- a/.github/badges/jacoco.svg +++ b/.github/badges/jacoco.svg @@ -1,18 +1,18 @@ - + - + - - - + + + - coverage - coverage - 81.9% - 81.9% + coverage + coverage + 78.3% + 78.3% diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 7b304f2677..5c5c0ff8ec 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -75,9 +75,9 @@ mvn test -Dtest=CopilotClientTest ### Package Structure -- `com.github.copilot.sdk` - Core classes (CopilotClient, CopilotSession, JsonRpcClient) -- `com.github.copilot.sdk.json` - DTOs, request/response types, handler interfaces (SessionConfig, MessageOptions, ToolDefinition, etc.) -- `com.github.copilot.sdk.generated` - Generated event types for session streaming (SessionEvent, AssistantMessageEvent, SessionIdleEvent, ToolExecutionStartEvent, etc.) +- `com.github.copilot` - Core classes (CopilotClient, CopilotSession, JsonRpcClient) +- `com.github.copilot.rpc` - DTOs, request/response types, handler interfaces (SessionConfig, MessageOptions, ToolDefinition, etc.) +- `com.github.copilot.generated` - Generated event types for session streaming (SessionEvent, AssistantMessageEvent, SessionIdleEvent, ToolExecutionStartEvent, etc.) ### Test Infrastructure diff --git a/.github/prompts/agentic-merge-reference-impl.prompt.md b/.github/prompts/agentic-merge-reference-impl.prompt.md index 88cc2bdfe0..d5c3528b3f 100644 --- a/.github/prompts/agentic-merge-reference-impl.prompt.md +++ b/.github/prompts/agentic-merge-reference-impl.prompt.md @@ -135,11 +135,11 @@ For each change in the reference implementation diff, determine: | reference implementation (.NET) | Java SDK Equivalent | |------------------------------------|--------------------------------------------------------| -| `dotnet/src/Client.cs` | `src/main/java/com/github/copilot/sdk/CopilotClient.java` | -| `dotnet/src/Session.cs` | `src/main/java/com/github/copilot/sdk/CopilotSession.java` | -| `dotnet/src/Types.cs` | `src/main/java/com/github/copilot/sdk/types/*.java` | +| `dotnet/src/Client.cs` | `src/main/java/com/github/copilot/CopilotClient.java` | +| `dotnet/src/Session.cs` | `src/main/java/com/github/copilot/CopilotSession.java` | +| `dotnet/src/Types.cs` | `src/main/java/com/github/copilot/types/*.java` | | `dotnet/src/Generated/*.cs` | ❌ **DO NOT TOUCH** `src/generated/java/**` — see top of this file | -| `dotnet/test/*.cs` | `src/test/java/com/github/copilot/sdk/*Test.java` | +| `dotnet/test/*.cs` | `src/test/java/com/github/copilot/*Test.java` | | `docs/getting-started.md` | `README.md` and `src/site/markdown/*.md` | | `docs/*.md` (new files) | `src/site/markdown/*.md` + update `src/site/site.xml` | | `sdk-protocol-version.json` | (embedded in Java code or resource file) | @@ -209,7 +209,7 @@ This creates a clear history of changes that can be reviewed in the Pull Request Follow the existing Java SDK patterns: - Use Jackson for JSON serialization (`ObjectMapper`) - Use Java records for DTOs where appropriate -- Follow the existing package structure under `com.github.copilot.sdk` +- Follow the existing package structure under `com.github.copilot` - Maintain backward compatibility when possible - **Match the style of surrounding code** - Consistency with existing code is more important than reference implementation patterns - **Prefer existing abstractions** - If the Java SDK already solves a problem differently than .NET, keep the Java approach @@ -230,7 +230,7 @@ git diff "$LAST_REFERENCE_IMPL_COMMIT"..origin/main --stat -- test/snapshots/ For each new or modified test file in `dotnet/test/`: -1. **Create corresponding Java test class** in `src/test/java/com/github/copilot/sdk/` +1. **Create corresponding Java test class** in `src/test/java/com/github/copilot/` 2. **Follow existing test patterns** - Look at existing tests like `PermissionsTest.java` for structure 3. **Use the E2ETestContext** infrastructure for tests that need the test harness 4. **Match snapshot directory names** - Test snapshots in `test/snapshots/` must match the directory name used in `ctx.configureForTest()` @@ -239,10 +239,10 @@ For each new or modified test file in `dotnet/test/`: | reference implementation Test (.NET) | Java SDK Test | |-----------------------------|--------------------------------------------------------| -| `dotnet/test/AskUserTests.cs` | `src/test/java/com/github/copilot/sdk/AskUserTest.java` | -| `dotnet/test/HooksTests.cs` | `src/test/java/com/github/copilot/sdk/HooksTest.java` | -| `dotnet/test/ClientTests.cs` | `src/test/java/com/github/copilot/sdk/CopilotClientTest.java` | -| `dotnet/test/*Tests.cs` | `src/test/java/com/github/copilot/sdk/*Test.java` | +| `dotnet/test/AskUserTests.cs` | `src/test/java/com/github/copilot/AskUserTest.java` | +| `dotnet/test/HooksTests.cs` | `src/test/java/com/github/copilot/HooksTest.java` | +| `dotnet/test/ClientTests.cs` | `src/test/java/com/github/copilot/CopilotClientTest.java` | +| `dotnet/test/*Tests.cs` | `src/test/java/com/github/copilot/*Test.java` | ### Test Snapshot Compatibility @@ -353,7 +353,7 @@ var session = client.createSession( Explain the request/response objects and their properties. -See [FeatureHandler](apidocs/com/github/copilot/sdk/json/FeatureHandler.html) Javadoc for more details. +See [FeatureHandler](apidocs/com/github/copilot/rpc/FeatureHandler.html) Javadoc for more details. ``` ### Verify Documentation Consistency diff --git a/.github/prompts/documentation-coverage.prompt.md b/.github/prompts/documentation-coverage.prompt.md index 80284c6a9c..cc627e1f35 100644 --- a/.github/prompts/documentation-coverage.prompt.md +++ b/.github/prompts/documentation-coverage.prompt.md @@ -17,13 +17,13 @@ Extract all public classes, methods, and features from the SDK: ```bash # List all public classes in core package -grep -l "public class\|public interface\|public enum" src/main/java/com/github/copilot/sdk/*.java +grep -l "public class\|public interface\|public enum" src/main/java/com/github/copilot/*.java # List all public classes in json package (DTOs) -grep -l "public class" src/main/java/com/github/copilot/sdk/json/*.java +grep -l "public class" src/main/java/com/github/copilot/rpc/*.java # List all event types -ls src/main/java/com/github/copilot/sdk/events/ +ls src/main/java/com/github/copilot/events/ ``` ### Step 2: Inventory Documentation @@ -45,7 +45,7 @@ For each major feature area, determine if it's documented: Examine `CopilotClient.java` for public methods: ```bash -grep "public.*(" src/main/java/com/github/copilot/sdk/CopilotClient.java | grep -v "@" +grep "public.*(" src/main/java/com/github/copilot/CopilotClient.java | grep -v "@" ``` | Method | Purpose | Documented In | Status | @@ -66,7 +66,7 @@ grep "public.*(" src/main/java/com/github/copilot/sdk/CopilotClient.java | grep Examine `CopilotSession.java` for public methods: ```bash -grep "public.*(" src/main/java/com/github/copilot/sdk/CopilotSession.java | grep -v "@" +grep "public.*(" src/main/java/com/github/copilot/CopilotSession.java | grep -v "@" ``` | Method | Purpose | Documented In | Status | @@ -83,7 +83,7 @@ grep "public.*(" src/main/java/com/github/copilot/sdk/CopilotSession.java | grep Examine `SessionConfig.java` for configurable options: ```bash -grep "public.*set\|private.*;" src/main/java/com/github/copilot/sdk/json/SessionConfig.java +grep "public.*set\|private.*;" src/main/java/com/github/copilot/rpc/SessionConfig.java ``` | Option | Purpose | Documented | Example Provided | @@ -103,7 +103,7 @@ grep "public.*set\|private.*;" src/main/java/com/github/copilot/sdk/json/Session Check which events are documented: ```bash -grep "TYPE_MAP.put" src/main/java/com/github/copilot/sdk/events/SessionEventParser.java +grep "TYPE_MAP.put" src/main/java/com/github/copilot/events/SessionEventParser.java ``` | Event Type | Event Class | Documented | Example | @@ -118,7 +118,7 @@ grep "TYPE_MAP.put" src/main/java/com/github/copilot/sdk/events/SessionEventPars Check `SessionHooks.java` for hook types: ```bash -grep "private.*Handler" src/main/java/com/github/copilot/sdk/json/SessionHooks.java +grep "private.*Handler" src/main/java/com/github/copilot/rpc/SessionHooks.java ``` | Hook | Handler Interface | Documented | Example | @@ -193,11 +193,11 @@ Topics that warrant dedicated documentation: ## Key Files ### Source Code -- `src/main/java/com/github/copilot/sdk/CopilotClient.java` -- `src/main/java/com/github/copilot/sdk/CopilotSession.java` -- `src/main/java/com/github/copilot/sdk/json/SessionConfig.java` -- `src/main/java/com/github/copilot/sdk/json/SessionHooks.java` -- `src/main/java/com/github/copilot/sdk/events/SessionEventParser.java` +- `src/main/java/com/github/copilot/CopilotClient.java` +- `src/main/java/com/github/copilot/CopilotSession.java` +- `src/main/java/com/github/copilot/rpc/SessionConfig.java` +- `src/main/java/com/github/copilot/rpc/SessionHooks.java` +- `src/main/java/com/github/copilot/events/SessionEventParser.java` ### Documentation - `src/site/markdown/index.md` - Landing page diff --git a/.github/prompts/test-coverage-assessment.prompt.md b/.github/prompts/test-coverage-assessment.prompt.md index c2dc3b0c4d..6233ad099e 100644 --- a/.github/prompts/test-coverage-assessment.prompt.md +++ b/.github/prompts/test-coverage-assessment.prompt.md @@ -17,10 +17,10 @@ First, examine the source code to identify all components that should be tested: ```bash # List all event classes -ls src/main/java/com/github/copilot/sdk/events/ +ls src/main/java/com/github/copilot/events/ # Check the event type mapping in SessionEventParser -grep -n "TYPE_MAP.put" src/main/java/com/github/copilot/sdk/events/SessionEventParser.java +grep -n "TYPE_MAP.put" src/main/java/com/github/copilot/events/SessionEventParser.java ``` Extract the list of all registered event types from `SessionEventParser.java`. @@ -30,7 +30,7 @@ Extract the list of all registered event types from `SessionEventParser.java`. Check `SessionHooks.java` for all available hook handlers: ```bash -grep -E "private.*Handler" src/main/java/com/github/copilot/sdk/json/SessionHooks.java +grep -E "private.*Handler" src/main/java/com/github/copilot/rpc/SessionHooks.java ``` ### Step 3: Analyze Existing Tests @@ -39,13 +39,13 @@ Examine the test files to understand current coverage: ```bash # List all test files -ls src/test/java/com/github/copilot/sdk/ +ls src/test/java/com/github/copilot/ # Check for event-related tests -grep -r "import.*events\." src/test/java/com/github/copilot/sdk/ | grep -v "\.class" +grep -r "import.*events\." src/test/java/com/github/copilot/ | grep -v "\.class" # Check for hook tests -grep -l "SessionHooks\|Hook" src/test/java/com/github/copilot/sdk/*.java +grep -l "SessionHooks\|Hook" src/test/java/com/github/copilot/*.java ``` ### Step 4: Categorize Test Coverage @@ -95,13 +95,13 @@ Prioritized list of tests to add: ## Key Files to Examine -- `src/main/java/com/github/copilot/sdk/events/SessionEventParser.java` - Event type registry -- `src/main/java/com/github/copilot/sdk/json/SessionHooks.java` - Hook definitions -- `src/main/java/com/github/copilot/sdk/CopilotSession.java` - Hook handling logic -- `src/test/java/com/github/copilot/sdk/SessionEventParserTest.java` - Event parsing tests -- `src/test/java/com/github/copilot/sdk/SessionEventsE2ETest.java` - Event E2E tests -- `src/test/java/com/github/copilot/sdk/HooksTest.java` - Hook tests -- `src/test/java/com/github/copilot/sdk/SessionEventHandlingTest.java` - Event handling tests +- `src/main/java/com/github/copilot/events/SessionEventParser.java` - Event type registry +- `src/main/java/com/github/copilot/rpc/SessionHooks.java` - Hook definitions +- `src/main/java/com/github/copilot/CopilotSession.java` - Hook handling logic +- `src/test/java/com/github/copilot/SessionEventParserTest.java` - Event parsing tests +- `src/test/java/com/github/copilot/SessionEventsE2ETest.java` - Event E2E tests +- `src/test/java/com/github/copilot/HooksTest.java` - Hook tests +- `src/test/java/com/github/copilot/SessionEventHandlingTest.java` - Event handling tests ## Verification diff --git a/.github/scripts/generate-coverage-badge.sh b/.github/scripts/generate-coverage-badge.sh index 1d124d9474..324b3194fb 100755 --- a/.github/scripts/generate-coverage-badge.sh +++ b/.github/scripts/generate-coverage-badge.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Generates an SVG coverage badge from a JaCoCo CSV report. +# Generates SVG coverage badges from a JaCoCo CSV report. # # Usage: generate-coverage-badge.sh [jacoco.csv] [output-dir] # jacoco.csv - Path to JaCoCo CSV report (default: target/site/jacoco-coverage/jacoco.csv) @@ -8,39 +8,64 @@ set -euo pipefail CSV="${1:-target/site/jacoco-coverage/jacoco.csv}" BADGES_DIR="${2:-.github/badges}" +GENERATED_PREFIX="com.github.copilot.sdk.generated" if [ ! -f "$CSV" ]; then echo "⚠️ No JaCoCo CSV report found at $CSV" exit 0 fi -# Sum INSTRUCTION_MISSED and INSTRUCTION_COVERED across all rows (skip header) -read -r missed covered <<< "$(awk -F',' 'NR>1 { m+=$4; c+=$5 } END { print m, c }' "$CSV")" -total=$((missed + covered)) -if [ "$total" -eq 0 ]; then - pct="0" -else - pct=$(awk "BEGIN { printf \"%.1f\", ($covered / $total) * 100 }") - # Drop trailing .0 - pct=$(echo "$pct" | sed 's/\.0$//') -fi -echo "Coverage: ${pct}%" +calc_totals() { + local scope=$1 + awk -F',' -v scope="$scope" -v generated_prefix="$GENERATED_PREFIX" ' + NR > 1 { + is_generated = index($2, generated_prefix) == 1 + if (scope == "overall" || + (scope == "generated" && is_generated) || + (scope == "handwritten" && !is_generated)) { + missed += $4 + covered += $5 + } + } + END { print missed + 0, covered + 0 } + ' "$CSV" +} -# Choose badge color based on coverage -color="#e05d44" # red <60 -if awk "BEGIN{exit!($pct>=100)}"; then color="#4c1" # bright green -elif awk "BEGIN{exit!($pct>=90)}"; then color="#97ca00" # green -elif awk "BEGIN{exit!($pct>=80)}"; then color="#a4a61d" # yellow-green -elif awk "BEGIN{exit!($pct>=70)}"; then color="#dfb317" # yellow -elif awk "BEGIN{exit!($pct>=60)}"; then color="#fe7d37" # orange -fi +format_pct() { + local missed=$1 + local covered=$2 + local total=$((missed + covered)) + if [ "$total" -eq 0 ]; then + echo "0" + else + awk "BEGIN { printf \"%.1f\", ($covered / $total) * 100 }" | sed 's/\.0$//' + fi +} -# Generate SVG badge -mkdir -p "$BADGES_DIR" -label="coverage" -value="${pct}%" -lw=62; vw=46; tw=$((lw + vw)) -cat > "${BADGES_DIR}/jacoco.svg" <=100)}"; then color="#4c1" # bright green + elif awk "BEGIN{exit!($pct>=90)}"; then color="#97ca00" # green + elif awk "BEGIN{exit!($pct>=80)}"; then color="#a4a61d" # yellow-green + elif awk "BEGIN{exit!($pct>=70)}"; then color="#dfb317" # yellow + elif awk "BEGIN{exit!($pct>=60)}"; then color="#fe7d37" # orange + fi + echo "$color" +} + +generate_badge() { + local label=$1 + local value=$2 + local output=$3 + local pct=${value%\%} + local color + color=$(pick_color "$pct") + local lw=$(( ${#label} * 7 + 12 )) + local vw=$(( ${#value} * 7 + 16 )) + local tw=$((lw + vw)) + + cat > "$output" < @@ -60,5 +85,24 @@ cat > "${BADGES_DIR}/jacoco.svg" < EOF +} + +mkdir -p "$BADGES_DIR" + +read -r overall_missed overall_covered <<< "$(calc_totals overall)" +read -r handwritten_missed handwritten_covered <<< "$(calc_totals handwritten)" +read -r generated_missed generated_covered <<< "$(calc_totals generated)" + +overall_pct=$(format_pct "$overall_missed" "$overall_covered") +handwritten_pct=$(format_pct "$handwritten_missed" "$handwritten_covered") +generated_pct=$(format_pct "$generated_missed" "$generated_covered") + +echo "Overall coverage: ${overall_pct}%" +echo "Handwritten coverage: ${handwritten_pct}%" +echo "Generated coverage: ${generated_pct}%" + +generate_badge "coverage" "${overall_pct}%" "${BADGES_DIR}/jacoco.svg" +generate_badge "coverage handwritten" "${handwritten_pct}%" "${BADGES_DIR}/jacoco-handwritten.svg" +generate_badge "coverage generated" "${generated_pct}%" "${BADGES_DIR}/jacoco-generated.svg" -echo "Badge generated at ${BADGES_DIR}/jacoco.svg" +echo "Badges generated in ${BADGES_DIR}" diff --git a/.github/workflows/codegen-agentic-fix.md b/.github/workflows/codegen-agentic-fix.md index b4aa0a8f20..948524999e 100644 --- a/.github/workflows/codegen-agentic-fix.md +++ b/.github/workflows/codegen-agentic-fix.md @@ -177,7 +177,7 @@ For each attempt: 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 + cat src/generated/java/com/github/copilot/generated/rpc/.java ``` 3. **Fix the affected source files.** You may modify files under: diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 9522a64923..b53c9e8699 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -24,7 +24,7 @@ jobs: # Install GitHub CLI and gh-aw extension for Copilot Agent interaction - name: Install gh-aw extension - uses: github/gh-aw/actions/setup-cli@4d44d0e89851a877f4ddc0cb6c0197e42b1016c5 # v0.73.0 + uses: github/gh-aw/actions/setup-cli@0feed75a980b06f247abbbf80127f8eb2c19e2c5 # v0.74.8 with: version: v0.68.3 diff --git a/.github/workflows/reference-impl-sync.lock.yml b/.github/workflows/reference-impl-sync.lock.yml index 72ae7105b7..98fd0d0d0b 100644 --- a/.github/workflows/reference-impl-sync.lock.yml +++ b/.github/workflows/reference-impl-sync.lock.yml @@ -1,5 +1,5 @@ -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"54b1896209b363ceadbcb123b6c46dbbcc0118d9140313360c341b09d03bbb96","compiler_version":"v0.71.5","strict":true,"agent_id":"copilot"} -# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_AGENT_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"b8068426813005612b960b5ab0b8bd2c27142323","version":"v0.71.5"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40","digest":"sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40","digest":"sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40","digest":"sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"d3b88eb52d0d4007c7a64118dfa3866bcbba7589a38004bb5c47695bee9e7ac7","compiler_version":"v0.74.4","strict":true,"agent_id":"copilot"} +# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_AGENT_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"d3abfe96a194bce3a523ed2093ddedd5704cdf62","version":"v0.74.4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.46"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.46"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.46"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.9","digest":"sha256:64828b42a4482f58fab16509d7f8f495a6d97c972a98a68aff20543531ac0388","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.9@sha256:64828b42a4482f58fab16509d7f8f495a6d97c972a98a68aff20543531ac0388"},{"image":"ghcr.io/github/github-mcp-server:v1.0.4"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} # ___ _ _ # / _ \ | | (_) # | |_| | __ _ ___ _ __ | |_ _ ___ @@ -14,7 +14,7 @@ # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ # -# This file was automatically generated by gh-aw (v0.71.5). DO NOT EDIT. +# This file was automatically generated by gh-aw (v0.74.4). DO NOT EDIT. # # To update this file, edit the corresponding .md file and run: # gh aw compile @@ -39,21 +39,21 @@ # - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 # - actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 # - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 -# - github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 +# - github/gh-aw-actions/setup@d3abfe96a194bce3a523ed2093ddedd5704cdf62 # v0.74.4 # # Container images used: -# - ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 -# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 -# - ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 -# - ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c -# - ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959 +# - ghcr.io/github/gh-aw-firewall/agent:0.25.46 +# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.46 +# - ghcr.io/github/gh-aw-firewall/squid:0.25.46 +# - ghcr.io/github/gh-aw-mcpg:v0.3.9@sha256:64828b42a4482f58fab16509d7f8f495a6d97c972a98a68aff20543531ac0388 +# - ghcr.io/github/github-mcp-server:v1.0.4 # - node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f name: "Reference Implementation Sync" -"on": +on: schedule: - - cron: "10 16 * * *" - # Friendly format: daily (scattered) + - cron: "25 2 * * 5" + # Friendly format: weekly on friday (scattered) workflow_dispatch: inputs: aw_context: @@ -82,35 +82,38 @@ jobs: lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }} model: ${{ steps.generate_aw_info.outputs.model }} secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }} + setup-parent-span-id: ${{ steps.setup.outputs.parent-span-id || steps.setup.outputs.span-id }} + setup-span-id: ${{ steps.setup.outputs.span-id }} setup-trace-id: ${{ steps.setup.outputs.trace-id }} stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + uses: github/gh-aw-actions/setup@d3abfe96a194bce3a523ed2093ddedd5704cdf62 # v0.74.4 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} env: GH_AW_SETUP_WORKFLOW_NAME: "Reference Implementation Sync" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/reference-impl-sync.lock.yml@${{ github.ref }} - GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_VERSION: "1.0.48" + GH_AW_INFO_ENGINE_ID: "copilot" - name: Generate agentic run info id: generate_aw_info env: GH_AW_INFO_ENGINE_ID: "copilot" GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" GH_AW_INFO_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || 'claude-sonnet-4.6' }} - GH_AW_INFO_VERSION: "1.0.40" - GH_AW_INFO_AGENT_VERSION: "1.0.40" - GH_AW_INFO_CLI_VERSION: "v0.71.5" + GH_AW_INFO_VERSION: "1.0.48" + GH_AW_INFO_AGENT_VERSION: "1.0.48" + GH_AW_INFO_CLI_VERSION: "v0.74.4" GH_AW_INFO_WORKFLOW_NAME: "Reference Implementation Sync" GH_AW_INFO_EXPERIMENTAL: "false" GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" GH_AW_INFO_STAGED: "false" GH_AW_INFO_ALLOWED_DOMAINS: '["defaults","github"]' GH_AW_INFO_FIREWALL_ENABLED: "true" - GH_AW_INFO_AWF_VERSION: "v0.25.40" + GH_AW_INFO_AWF_VERSION: "v0.25.46" GH_AW_INFO_AWMG_VERSION: "" GH_AW_INFO_FIREWALL_TYPE: "squid" GH_AW_COMPILED_STRICT: "true" @@ -162,7 +165,7 @@ jobs: - name: Check compile-agentic version uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - GH_AW_COMPILED_VERSION: "v0.71.5" + GH_AW_COMPILED_VERSION: "v0.74.4" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -173,11 +176,11 @@ jobs: env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ runner.temp }}/gh-aw/safeoutputs/outputs.jsonl + GH_AW_EXPR_1A3A194A: ${{ github.event.discussion.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'discussion' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }} + GH_AW_EXPR_463A214A: ${{ github.event.pull_request.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'pull_request' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }} + GH_AW_EXPR_802A9F6A: ${{ github.event.issue.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'issue' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }} + GH_AW_EXPR_FF1D34CE: ${{ github.event.comment.id || fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').comment_id }} GH_AW_GITHUB_ACTOR: ${{ github.actor }} - GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} - GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} - GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} - GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} @@ -185,54 +188,54 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_c9d6e485c3f68bea_EOF' + cat << 'GH_AW_PROMPT_5937f7f329fed3c9_EOF' - GH_AW_PROMPT_c9d6e485c3f68bea_EOF + GH_AW_PROMPT_5937f7f329fed3c9_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_c9d6e485c3f68bea_EOF' + cat << 'GH_AW_PROMPT_5937f7f329fed3c9_EOF' Tools: add_comment(max:10), create_issue, close_issue(max:10), close_pull_request(max:10), assign_to_agent, missing_tool, missing_data, noop - GH_AW_PROMPT_c9d6e485c3f68bea_EOF + GH_AW_PROMPT_5937f7f329fed3c9_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" - cat << 'GH_AW_PROMPT_c9d6e485c3f68bea_EOF' + cat << 'GH_AW_PROMPT_5937f7f329fed3c9_EOF' The following GitHub context information is available for this workflow: - {{#if __GH_AW_GITHUB_ACTOR__ }} + {{#if github.actor}} - **actor**: __GH_AW_GITHUB_ACTOR__ {{/if}} - {{#if __GH_AW_GITHUB_REPOSITORY__ }} + {{#if github.repository}} - **repository**: __GH_AW_GITHUB_REPOSITORY__ {{/if}} - {{#if __GH_AW_GITHUB_WORKSPACE__ }} + {{#if github.workspace}} - **workspace**: __GH_AW_GITHUB_WORKSPACE__ {{/if}} - {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} - - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{#if github.event.issue.number || (github.aw.context.item_type == 'issue' && github.aw.context.item_number)}} + - **issue-number**: #__GH_AW_EXPR_802A9F6A__ {{/if}} - {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} - - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{#if github.event.discussion.number || (github.aw.context.item_type == 'discussion' && github.aw.context.item_number)}} + - **discussion-number**: #__GH_AW_EXPR_1A3A194A__ {{/if}} - {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} - - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{#if github.event.pull_request.number || (github.aw.context.item_type == 'pull_request' && github.aw.context.item_number)}} + - **pull-request-number**: #__GH_AW_EXPR_463A214A__ {{/if}} - {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} - - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{#if github.event.comment.id || github.aw.context.comment_id}} + - **comment-id**: __GH_AW_EXPR_FF1D34CE__ {{/if}} - {{#if __GH_AW_GITHUB_RUN_ID__ }} + {{#if github.run_id}} - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ {{/if}} - GH_AW_PROMPT_c9d6e485c3f68bea_EOF + GH_AW_PROMPT_5937f7f329fed3c9_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_c9d6e485c3f68bea_EOF' + cat << 'GH_AW_PROMPT_5937f7f329fed3c9_EOF' {{#runtime-import .github/workflows/reference-impl-sync.md}} - GH_AW_PROMPT_c9d6e485c3f68bea_EOF + GH_AW_PROMPT_5937f7f329fed3c9_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -249,11 +252,11 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_EXPR_1A3A194A: ${{ github.event.discussion.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'discussion' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }} + GH_AW_EXPR_463A214A: ${{ github.event.pull_request.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'pull_request' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }} + GH_AW_EXPR_802A9F6A: ${{ github.event.issue.number || (fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_type == 'issue' && fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').item_number) }} + GH_AW_EXPR_FF1D34CE: ${{ github.event.comment.id || fromJSON(github.event.inputs.aw_context || github.event.client_payload.aw_context || '{}').comment_id }} GH_AW_GITHUB_ACTOR: ${{ github.actor }} - GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} - GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} - GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} - GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} @@ -269,11 +272,11 @@ jobs: return await substitutePlaceholders({ file: process.env.GH_AW_PROMPT, substitutions: { + GH_AW_EXPR_1A3A194A: process.env.GH_AW_EXPR_1A3A194A, + GH_AW_EXPR_463A214A: process.env.GH_AW_EXPR_463A214A, + GH_AW_EXPR_802A9F6A: process.env.GH_AW_EXPR_802A9F6A, + GH_AW_EXPR_FF1D34CE: process.env.GH_AW_EXPR_FF1D34CE, GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR, - GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID, - GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER, - GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER, - GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER, GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID, GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE, @@ -299,8 +302,11 @@ jobs: path: | /tmp/gh-aw/aw_info.json /tmp/gh-aw/aw-prompts/prompt.txt + /tmp/gh-aw/aw-prompts/prompt-template.txt + /tmp/gh-aw/aw-prompts/prompt-import-tree.json /tmp/gh-aw/github_rate_limits.jsonl /tmp/gh-aw/base + /tmp/gh-aw/.github/agents if-no-files-found: ignore retention-days: 1 @@ -325,6 +331,7 @@ jobs: agentic_engine_timeout: ${{ steps.detect-copilot-errors.outputs.agentic_engine_timeout || 'false' }} checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }} + effective_tokens_rate_limit_error: ${{ steps.parse-mcp-gateway.outputs.effective_tokens_rate_limit_error || 'false' }} has_patch: ${{ steps.collect_output.outputs.has_patch }} inference_access_error: ${{ steps.detect-copilot-errors.outputs.inference_access_error || 'false' }} mcp_policy_error: ${{ steps.detect-copilot-errors.outputs.mcp_policy_error || 'false' }} @@ -332,19 +339,23 @@ jobs: model_not_supported_error: ${{ steps.detect-copilot-errors.outputs.model_not_supported_error || 'false' }} output: ${{ steps.collect_output.outputs.output }} output_types: ${{ steps.collect_output.outputs.output_types }} + setup-parent-span-id: ${{ steps.setup.outputs.parent-span-id || steps.setup.outputs.span-id }} + setup-span-id: ${{ steps.setup.outputs.span-id }} setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + uses: github/gh-aw-actions/setup@d3abfe96a194bce3a523ed2093ddedd5704cdf62 # v0.74.4 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.activation.outputs.setup-trace-id }} + parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }} env: GH_AW_SETUP_WORKFLOW_NAME: "Reference Implementation Sync" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/reference-impl-sync.lock.yml@${{ github.ref }} - GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_VERSION: "1.0.48" + GH_AW_INFO_ENGINE_ID: "copilot" - name: Set runtime paths id: set-runtime-paths run: | @@ -391,11 +402,11 @@ jobs: const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs'); await main(); - name: Install GitHub Copilot CLI - run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.48 env: GH_HOST: github.com - name: Install AWF binary - run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.46 - name: Determine automatic lockdown mode for GitHub MCP Server id: determine-automatic-lockdown uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 @@ -417,16 +428,21 @@ jobs: GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh" + - name: Restore inline sub-agents from activation artifact + env: + GH_AW_SUB_AGENT_DIR: ".github/agents" + GH_AW_SUB_AGENT_EXT: ".agent.md" + run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_sub_agents.sh" - name: Download container images - run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959 node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.46 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.46 ghcr.io/github/gh-aw-firewall/squid:0.25.46 ghcr.io/github/gh-aw-mcpg:v0.3.9@sha256:64828b42a4482f58fab16509d7f8f495a6d97c972a98a68aff20543531ac0388 ghcr.io/github/github-mcp-server:v1.0.4 node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f - name: Generate Safe Outputs Config run: | mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_06a3a494957bf1f1_EOF' + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_8434d42e1eaff150_EOF' {"add_comment":{"max":10,"target":"*"},"assign_to_agent":{"max":1,"model":"claude-opus-4.6","name":"copilot","target":"*"},"close_issue":{"max":10,"required_labels":["reference-impl-sync"],"target":"*"},"close_pull_request":{"max":10,"target":"*"},"create_issue":{"expires":144,"labels":["reference-impl-sync"],"max":1,"title_prefix":"[reference-impl-sync] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"false"},"report_incomplete":{}} - GH_AW_SAFE_OUTPUTS_CONFIG_06a3a494957bf1f1_EOF + GH_AW_SAFE_OUTPUTS_CONFIG_8434d42e1eaff150_EOF - name: Generate Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -535,6 +551,9 @@ jobs: "sanitize": true, "maxLength": 65000 }, + "fields": { + "type": "array" + }, "labels": { "type": "array", "itemType": "string", @@ -708,17 +727,22 @@ jobs: export GH_AW_ENGINE="copilot" MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0') MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0') - DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') - export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.6' + case "${DOCKER_HOST:-}" in + unix://* ) DOCKER_SOCK_PATH="${DOCKER_HOST#unix://}" ;; + /* ) DOCKER_SOCK_PATH="$DOCKER_HOST" ;; + * ) DOCKER_SOCK_PATH=/var/run/docker.sock ;; + esac + DOCKER_SOCK_GID=$(stat -c '%g' "$DOCKER_SOCK_PATH" 2>/dev/null || echo '0') + export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.9' mkdir -p /home/runner/.copilot GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_03f014fbed5a3560_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_91f5ce417df04baa_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "github": { "type": "stdio", - "container": "ghcr.io/github/github-mcp-server:v1.0.3", + "container": "ghcr.io/github/github-mcp-server:v1.0.4", "env": { "GITHUB_HOST": "\${GITHUB_SERVER_URL}", "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}", @@ -754,7 +778,7 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_03f014fbed5a3560_EOF + GH_AW_MCP_CONFIG_91f5ce417df04baa_EOF - name: Mount MCP servers as CLIs id: mount-mcp-clis continue-on-error: true @@ -782,15 +806,21 @@ jobs: timeout-minutes: 20 run: | set -o pipefail + printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt touch /tmp/gh-aw/agent-step-summary.md GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) export GH_AW_NODE_BIN (umask 177 && touch /tmp/gh-aw/agent-stdio.log) - printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["*.githubusercontent.com","api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","codeload.github.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","docs.github.com","github-cloud.githubusercontent.com","github-cloud.s3.amazonaws.com","github.blog","github.com","github.githubassets.com","host.docker.internal","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","lfs.github.com","objects.githubusercontent.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","raw.githubusercontent.com","registry.npmjs.org","s.symcb.com","s.symcd.com","security.ubuntu.com","telemetry.enterprise.githubcopilot.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"]},"apiProxy":{"enabled":true,"models":{"auto":["large"],"deep-research":["copilot/deep-research*","google/deep-research*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*"],"gpt-4.1":["copilot/gpt-4.1*","openai/gpt-4.1*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"large":["sonnet","gpt-5-pro","gpt-5","gemini-pro"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash"],"opus":["copilot/*opus*","anthropic/*opus*"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"small":["mini"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"]}},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.46/awf-config.schema.json","network":{"allowDomains":["*.githubusercontent.com","api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","codeload.github.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","docs.github.com","github-cloud.githubusercontent.com","github-cloud.s3.amazonaws.com","github.blog","github.com","github.githubassets.com","host.docker.internal","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","lfs.github.com","objects.githubusercontent.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","raw.githubusercontent.com","registry.npmjs.org","s.symcb.com","s.symcd.com","security.ubuntu.com","telemetry.enterprise.githubcopilot.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"]},"apiProxy":{"enabled":true,"enableTokenSteering":true,"maxRuns":500,"maxEffectiveTokens":25000000,"models":{"auto":["large"],"coding":["copilot/gpt-5*codex*","openai/gpt-5*codex*","gpt-5-codex"],"deep-research":["copilot/deep-research*","copilot/o3-deep-research*","copilot/o4-mini-deep-research*","google/deep-research*","gemini/deep-research*","openai/o3-deep-research*","openai/o4-mini-deep-research*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*","gemini/gemini-*flash*"],"gemini-flash-lite":["copilot/gemini-*flash*lite*","google/gemini-*flash*lite*","gemini/gemini-*flash*lite*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*","gemini/gemini-*pro*"],"gemma":["copilot/gemma*","google/gemma*","gemini/gemma*"],"gpt-4.1":["copilot/gpt-4.1*","openai/gpt-4.1*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"large":["sonnet","gpt-5-pro","gpt-5","gemini-pro"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash-lite"],"opus":["copilot/*opus*","anthropic/*opus*"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"small":["mini"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"],"vision":["copilot/gemini-*image*","gemini/gemini-*image*","copilot/gemini-*flash*","gemini/gemini-*flash*"]}},"container":{"imageTag":"0.25.46"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json + GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS="" + if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then + GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS="--docker-host-path-prefix /tmp/gh-aw" + fi # shellcheck disable=SC1003 - sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ - -- /bin/bash -c 'export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" ${GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS} --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log env: + AWF_REFLECT_ENABLED: 1 COPILOT_AGENT_RUNNER_TYPE: STANDALONE COPILOT_API_KEY: dummy-byok-key-for-offline-mode COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} @@ -799,7 +829,7 @@ jobs: GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} - GH_AW_VERSION: v0.71.5 + GH_AW_VERSION: v0.74.4 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows @@ -914,7 +944,7 @@ jobs: run: | # Fix permissions on firewall logs/audit dirs so they can be uploaded as artifacts # AWF runs with sudo, creating files owned by root - sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall 2>/dev/null || true + sudo chmod -R a+rX /tmp/gh-aw/sandbox/firewall 2>/dev/null || true # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step) if command -v awf &> /dev/null; then awf logs summary | tee -a "$GITHUB_STEP_SUMMARY" @@ -991,6 +1021,7 @@ jobs: concurrency: group: "gh-aw-conclusion-reference-impl-sync" cancel-in-progress: false + queue: max outputs: incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }} noop_message: ${{ steps.noop.outputs.noop_message }} @@ -999,15 +1030,17 @@ jobs: steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + uses: github/gh-aw-actions/setup@d3abfe96a194bce3a523ed2093ddedd5704cdf62 # v0.74.4 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.activation.outputs.setup-trace-id }} + parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }} env: GH_AW_SETUP_WORKFLOW_NAME: "Reference Implementation Sync" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/reference-impl-sync.lock.yml@${{ github.ref }} - GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_VERSION: "1.0.48" + GH_AW_INFO_ENGINE_ID: "copilot" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -1097,6 +1130,8 @@ jobs: GH_AW_ENGINE_ID: "copilot" GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} + GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens || '' }} + GH_AW_EFFECTIVE_TOKENS_RATE_LIMIT_ERROR: ${{ needs.agent.outputs.effective_tokens_rate_limit_error || 'false' }} GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} GH_AW_MCP_POLICY_ERROR: ${{ needs.agent.outputs.mcp_policy_error }} GH_AW_AGENTIC_ENGINE_TIMEOUT: ${{ needs.agent.outputs.agentic_engine_timeout }} @@ -1111,6 +1146,7 @@ jobs: GH_AW_MISSING_TOOL_REPORT_AS_FAILURE: "true" GH_AW_MISSING_DATA_REPORT_AS_FAILURE: "true" GH_AW_TIMEOUT_MINUTES: "20" + GH_AW_MAX_EFFECTIVE_TOKENS: "25000000" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | @@ -1135,15 +1171,17 @@ jobs: steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + uses: github/gh-aw-actions/setup@d3abfe96a194bce3a523ed2093ddedd5704cdf62 # v0.74.4 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.activation.outputs.setup-trace-id }} + parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }} env: GH_AW_SETUP_WORKFLOW_NAME: "Reference Implementation Sync" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/reference-impl-sync.lock.yml@${{ github.ref }} - GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_VERSION: "1.0.48" + GH_AW_INFO_ENGINE_ID: "copilot" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -1169,7 +1207,7 @@ jobs: rm -rf /tmp/gh-aw/sandbox/firewall/logs rm -rf /tmp/gh-aw/sandbox/firewall/audit - name: Download container images - run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.46 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.46 ghcr.io/github/gh-aw-firewall/squid:0.25.46 - name: Check if detection needed id: detection_guard if: always() @@ -1228,11 +1266,11 @@ jobs: node-version: '24' package-manager-cache: false - name: Install GitHub Copilot CLI - run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.48 env: GH_HOST: github.com - name: Install AWF binary - run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.46 - name: Execute GitHub Copilot CLI if: always() && steps.detection_guard.outputs.run_detection == 'true' continue-on-error: true @@ -1241,22 +1279,28 @@ jobs: timeout-minutes: 20 run: | set -o pipefail + printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt touch /tmp/gh-aw/agent-step-summary.md GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) export GH_AW_NODE_BIN (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log) - printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","github.com","host.docker.internal","telemetry.enterprise.githubcopilot.com"]},"apiProxy":{"enabled":true},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.46/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","github.com","host.docker.internal","telemetry.enterprise.githubcopilot.com"]},"apiProxy":{"enabled":true,"enableTokenSteering":true,"maxRuns":500,"maxEffectiveTokens":25000000},"container":{"imageTag":"0.25.46"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json + GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS="" + if [[ "${DOCKER_HOST:-}" =~ ^tcp:// ]]; then + GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS="--docker-host-path-prefix /tmp/gh-aw" + fi # shellcheck disable=SC1003 - sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ - -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" ${GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS} --env-all --exclude-env COPILOT_GITHUB_TOKEN --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log env: + AWF_REFLECT_ENABLED: 1 COPILOT_AGENT_RUNNER_TYPE: STANDALONE COPILOT_API_KEY: dummy-byok-key-for-offline-mode COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} COPILOT_MODEL: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || 'claude-sonnet-4.6' }} GH_AW_PHASE: detection GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - GH_AW_VERSION: v0.71.5 + GH_AW_VERSION: v0.74.4 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows @@ -1284,6 +1328,7 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }} + DETECTION_AGENTIC_EXECUTION_OUTCOME: ${{ steps.detection_agentic_execution.outcome }} GH_AW_DETECTION_CONTINUE_ON_ERROR: "true" with: script: | @@ -1294,10 +1339,11 @@ jobs: await main(); } catch (loadErr) { const continueOnError = process.env.GH_AW_DETECTION_CONTINUE_ON_ERROR !== 'false'; + const detectionExecutionFailed = process.env.DETECTION_AGENTIC_EXECUTION_OUTCOME === 'failure'; const msg = 'ERR_SYSTEM: \u274C Unexpected error loading threat detection module: ' + (loadErr && loadErr.message ? loadErr.message : String(loadErr)); core.error(msg); core.setOutput('reason', 'parse_error'); - if (continueOnError) { + if (continueOnError && !detectionExecutionFailed) { core.warning('\u26A0\uFE0F ' + msg); core.setOutput('conclusion', 'warning'); core.setOutput('success', 'false'); @@ -1328,7 +1374,7 @@ jobs: GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }} GH_AW_ENGINE_ID: "copilot" GH_AW_ENGINE_MODEL: ${{ needs.agent.outputs.model }} - GH_AW_ENGINE_VERSION: "1.0.40" + GH_AW_ENGINE_VERSION: "1.0.48" GH_AW_WORKFLOW_ID: "reference-impl-sync" GH_AW_WORKFLOW_NAME: "Reference Implementation Sync" outputs: @@ -1348,15 +1394,17 @@ jobs: steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + uses: github/gh-aw-actions/setup@d3abfe96a194bce3a523ed2093ddedd5704cdf62 # v0.74.4 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.activation.outputs.setup-trace-id }} + parent-span-id: ${{ needs.activation.outputs.setup-parent-span-id || needs.activation.outputs.setup-span-id }} env: GH_AW_SETUP_WORKFLOW_NAME: "Reference Implementation Sync" GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/reference-impl-sync.lock.yml@${{ github.ref }} - GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_VERSION: "1.0.48" + GH_AW_INFO_ENGINE_ID: "copilot" - name: Download agent output artifact id: download-agent-output continue-on-error: true diff --git a/.github/workflows/reference-impl-sync.md b/.github/workflows/reference-impl-sync.md index 20cad89e14..297ef6dbdf 100644 --- a/.github/workflows/reference-impl-sync.md +++ b/.github/workflows/reference-impl-sync.md @@ -4,7 +4,7 @@ description: | Copilot SDK (github/copilot-sdk) and assigns to Copilot to port changes. on: - schedule: daily + schedule: weekly on friday workflow_dispatch: permissions: diff --git a/.github/workflows/update-copilot-dependency.yml b/.github/workflows/update-copilot-dependency.yml index d29da6acb7..e6d76c2125 100644 --- a/.github/workflows/update-copilot-dependency.yml +++ b/.github/workflows/update-copilot-dependency.yml @@ -61,7 +61,7 @@ jobs: cat > /tmp/verify-codegen-prompt.txt << 'PROMPT_EOF' You are running inside the copilot-sdk-java repository. The code generator has just run and produced Java source files under - src/generated/java/com/github/copilot/sdk/generated/rpc/. + src/generated/java/com/github/copilot/generated/rpc/. Your task is to spot-check the generated API classes against the source JSON schema to verify the generator produced correct output. @@ -74,9 +74,9 @@ jobs: scripts/codegen/node_modules/@github/copilot/schemas/api.schema.json 2. Pick these 3 generated API classes to verify: - - src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsApi.java - - src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiApi.java - - src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsApi.java + - src/generated/java/com/github/copilot/generated/rpc/SessionToolsApi.java + - src/generated/java/com/github/copilot/generated/rpc/SessionUiApi.java + - src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsApi.java 3. For each class, verify: - Every RPC method in the schema's corresponding namespace has a diff --git a/.lastmerge b/.lastmerge index 600b63a547..97be84d7ea 100644 --- a/.lastmerge +++ b/.lastmerge @@ -1 +1 @@ -e20f5bef125860accb30c60d1b35109371a77f16 +60104052cd914949ddf8c7a31e1856cd6db0a57c diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e174dd216..03a4e2e804 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] -> **Reference implementation sync:** [`github/copilot-sdk@e20f5be`](https://github.com/github/copilot-sdk/commit/e20f5bef125860accb30c60d1b35109371a77f16) +> **Reference implementation sync:** [`github/copilot-sdk@6010405`](https://github.com/github/copilot-sdk/commit/60104052cd914949ddf8c7a31e1856cd6db0a57c) + +## [1.0.0-beta-8-java.0] - 2026-05-28 +> **Reference implementation sync:** [`github/copilot-sdk@6010405`](https://github.com/github/copilot-sdk/commit/60104052cd914949ddf8c7a31e1856cd6db0a57c) ## [1.0.0-beta-java.4] - 2026-05-16 > **Reference implementation sync:** [`github/copilot-sdk@e20f5be`](https://github.com/github/copilot-sdk/commit/e20f5bef125860accb30c60d1b35109371a77f16) @@ -405,7 +408,7 @@ New types: `GetForegroundSessionResponse`, `SetForegroundSessionResponse` - Advanced usage documentation with comprehensive examples - Getting started guide with Maven and JBang instructions -- Package-info.java files for `com.github.copilot.sdk`, `events`, and `json` packages +- Package-info.java files for `com.github.copilot`, `events`, and `json` packages - `@since` annotations on all public classes - Versioned documentation with version selector on GitHub Pages - Maven resources plugin for site markdown filtering @@ -509,7 +512,8 @@ New types: `GetForegroundSessionResponse`, `SetForegroundSessionResponse` - Pre-commit hook for Spotless code formatting - Comprehensive API documentation -[Unreleased]: https://github.com/github/copilot-sdk-java/compare/v1.0.0-beta-java.4...HEAD +[Unreleased]: https://github.com/github/copilot-sdk-java/compare/v1.0.0-beta-8-java.0...HEAD +[1.0.0-beta-8-java.0]: https://github.com/github/copilot-sdk-java/compare/v1.0.0-beta-java.4...v1.0.0-beta-8-java.0 [1.0.0-beta-java.4]: https://github.com/github/copilot-sdk-java/compare/v1.0.0-beta-java.3...v1.0.0-beta-java.4 [1.0.0-beta-java.3]: https://github.com/github/copilot-sdk-java/compare/v1.0.0-beta-java.2...v1.0.0-beta-java.3 [1.0.0-beta-java.2]: https://github.com/github/copilot-sdk-java/compare/v1.0.0-beta-java.1...v1.0.0-beta-java.2 diff --git a/README.md b/README.md index f2b342dfc3..22b2f29cfc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![Build](https://github.com/github/copilot-sdk-java/actions/workflows/build-test.yml/badge.svg)](https://github.com/github/copilot-sdk-java/actions/workflows/build-test.yml) [![Site](https://github.com/github/copilot-sdk-java/actions/workflows/deploy-site.yml/badge.svg)](https://github.com/github/copilot-sdk-java/actions/workflows/deploy-site.yml) -[![Coverage](.github/badges/jacoco.svg)](https://github.github.io/copilot-sdk-java/snapshot/jacoco/index.html) +[![Handwritten Coverage](.github/badges/jacoco-handwritten.svg)](https://github.github.io/copilot-sdk-java/snapshot/jacoco/index.html) +[![Generated Coverage](.github/badges/jacoco-generated.svg)](https://github.github.io/copilot-sdk-java/snapshot/jacoco/index.html) [![Documentation](https://img.shields.io/badge/docs-online-brightgreen)](https://github.github.io/copilot-sdk-java/) [![Java 17+](https://img.shields.io/badge/Java-17%2B-blue?logo=openjdk&logoColor=white)](https://openjdk.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) @@ -33,7 +34,7 @@ Java SDK for programmatic control of GitHub Copilot CLI, enabling you to build A com.github copilot-sdk-java - 1.0.0-beta-java.4 + 1.0.0-beta-8-java.0 ``` @@ -53,26 +54,26 @@ Snapshot builds of the next development version are published to Maven Central S com.github copilot-sdk-java - 1.0.0-beta-java.5-SNAPSHOT + 1.0.0-beta-8-java.1-SNAPSHOT ``` ### Gradle ```groovy -implementation 'com.github:copilot-sdk-java:1.0.0-beta-java.4' +implementation 'com.github:copilot-sdk-java:1.0.0-beta-8-java.0' ``` ## Quick Start ```java -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionUsageInfoEvent; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionUsageInfoEvent; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; import java.util.concurrent.Executors; @@ -212,4 +213,3 @@ MIT — see [LICENSE](LICENSE) for details. [![Star History Chart](https://api.star-history.com/svg?repos=github/copilot-sdk-java&type=Date)](https://www.star-history.com/#github/copilot-sdk-java&Date) ⭐ Drop a star if you find this useful! - diff --git a/config/spotbugs/spotbugs-exclude.xml b/config/spotbugs/spotbugs-exclude.xml index 1c7d415f65..b0b3628827 100644 --- a/config/spotbugs/spotbugs-exclude.xml +++ b/config/spotbugs/spotbugs-exclude.xml @@ -10,11 +10,11 @@ --> - + - + diff --git a/jbang-example.java b/jbang-example.java index 1c41679cdf..7482eee3df 100644 --- a/jbang-example.java +++ b/jbang-example.java @@ -1,11 +1,11 @@ ///usr/bin/env jbang "$0" "$@" ; exit $? -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionUsageInfoEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionUsageInfoEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; import static java.lang.System.out; diff --git a/pom.xml b/pom.xml index a925a81cfd..ca42b6fefb 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.github copilot-sdk-java - 1.0.0-beta-java.4 + 1.0.0-beta-8-java.0 jar GitHub Copilot SDK :: Java @@ -33,7 +33,7 @@ scm:git:https://github.com/github/copilot-sdk-java.git scm:git:https://github.com/github/copilot-sdk-java.git https://github.com/github/copilot-sdk-java - v1.0.0-beta-java.4 + v1.0.0-beta-8-java.0 @@ -94,7 +94,7 @@ reference-impl-sync workflow and deal with the subsequent PR. --> - ^1.0.48 + ^1.0.55-5 @@ -429,11 +429,11 @@ testExecutionAgentArgs - com/github/copilot/sdk/** + com/github/copilot/** - com/github/copilot/sdk/E2ETestContext* - com/github/copilot/sdk/CapiProxy* + com/github/copilot/E2ETestContext* + com/github/copilot/CapiProxy* @@ -827,7 +827,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.6.2 + 3.6.3 require-schema-version diff --git a/scripts/codegen/java.ts b/scripts/codegen/java.ts index 0a96ab9f14..64fc463a0c 100644 --- a/scripts/codegen/java.ts +++ b/scripts/codegen/java.ts @@ -37,9 +37,25 @@ function toJavaClassName(typeName: string): string { return typeName.split(/[._]/).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(""); } +/** Java reserved keywords and Object method names that cannot be used as record component names. */ +const JAVA_RESERVED_IDENTIFIERS = new Set([ + "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", + "continue", "default", "do", "double", "else", "enum", "extends", "final", "finally", "float", + "for", "goto", "if", "implements", "import", "instanceof", "int", "interface", "long", "native", + "new", "package", "private", "protected", "public", "return", "short", "static", "strictfp", + "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "void", + "volatile", "while", + // Object methods that conflict with record component accessor names + "wait", "notify", "notifyAll", "getClass", "clone", "finalize", "toString", "hashCode", "equals", +]); + function toCamelCase(name: string): string { const pascal = toPascalCase(name); - return pascal.charAt(0).toLowerCase() + pascal.slice(1); + let result = pascal.charAt(0).toLowerCase() + pascal.slice(1); + if (JAVA_RESERVED_IDENTIFIERS.has(result)) { + result = result + "_"; + } + return result; } function toEnumConstant(value: string): string { @@ -102,6 +118,11 @@ interface JavaTypeResult { let currentDefinitions: Record = {}; const pendingStandaloneTypes = new Map(); +// Cross-schema definitions: keyed by schema filename (e.g. "session-events.schema.json"), +// value is the definitions map from that schema. Populated by generateRpcTypes so that +// cross-schema $ref values like "session-events.schema.json#/definitions/Foo" can be resolved. +const crossSchemaDefinitions = 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. @@ -131,6 +152,28 @@ function schemaTypeToJava( // Resolve $ref first — register standalone types for generation if (schema.$ref) { + // Handle cross-schema $ref (e.g. "session-events.schema.json#/definitions/Foo") + const crossSchemaMatch = schema.$ref.match(/^([^#]+)#\/definitions\/(.+)$/); + if (crossSchemaMatch) { + const [, schemaFile, typeName] = crossSchemaMatch; + const externalDefs = crossSchemaDefinitions.get(schemaFile); + if (externalDefs) { + const resolved = externalDefs[typeName]; + if (resolved) { + // Save and swap currentDefinitions so recursive calls resolve against + // the external schema's definitions. + const savedDefs = currentDefinitions; + currentDefinitions = externalDefs; + const result = schemaTypeToJava(resolved, required, context, propName, nestedTypes); + currentDefinitions = savedDefs; + return result; + } + } + // Fallback: extract just the type name and warn + console.warn(`[codegen] Unresolved cross-schema $ref: ${schema.$ref}`); + return { javaType: typeName, imports }; + } + const name = schema.$ref.replace(/^#\/definitions\//, ""); const resolved = currentDefinitions[name]; if (resolved) { @@ -315,8 +358,8 @@ async function generateSessionEvents(schemaPath: string): Promise { pendingStandaloneTypes.clear(); const variants = extractEventVariants(schema); - const packageName = "com.github.copilot.sdk.generated"; - const packageDir = `src/generated/java/com/github/copilot/sdk/generated`; + const packageName = "com.github.copilot.generated"; + const packageDir = `src/generated/java/com/github/copilot/generated`; // Generate base SessionEvent class await generateSessionEventBaseClass(variants, packageName, packageDir); @@ -883,9 +926,22 @@ async function generateRpcTypes(schemaPath: string): Promise { // Set module-level definitions for $ref resolution currentDefinitions = (schema.definitions ?? {}) as Record; pendingStandaloneTypes.clear(); + crossSchemaDefinitions.clear(); + + // Load cross-schema definitions (session-events) so that cross-schema $ref values + // like "session-events.schema.json#/definitions/Foo" can be resolved. + try { + const sessionEventsSchemaPath = await getSessionEventsSchemaPath(); + const sessionEventsContent = await fs.readFile(sessionEventsSchemaPath, "utf-8"); + const sessionEventsSchema = JSON.parse(sessionEventsContent) as JSONSchema7; + crossSchemaDefinitions.set("session-events.schema.json", + (sessionEventsSchema.definitions ?? {}) as Record); + } catch (e) { + console.warn(`[codegen] Could not load session-events schema for cross-ref resolution: ${e}`); + } - const packageName = "com.github.copilot.sdk.generated.rpc"; - const packageDir = `src/generated/java/com/github/copilot/sdk/generated/rpc`; + const packageName = "com.github.copilot.generated.rpc"; + const packageDir = `src/generated/java/com/github/copilot/generated/rpc`; // Collect all RPC methods from all sections const sections: [string, Record][] = []; @@ -1506,8 +1562,8 @@ async function generateRpcWrappers(schemaPath: string): Promise { // 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`; + const packageName = "com.github.copilot.generated.rpc"; + const packageDir = `src/generated/java/com/github/copilot/generated/rpc`; // RpcCaller interface and shared ObjectMapper holder await generateRpcCallerInterface(packageName, packageDir); diff --git a/scripts/codegen/package-lock.json b/scripts/codegen/package-lock.json index 36d7689a71..a0c6c648f0 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.48", + "@github/copilot": "^1.0.55-5", "json-schema": "^0.4.0", "tsx": "^4.20.6" } @@ -428,26 +428,31 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.48.tgz", - "integrity": "sha512-U5SzyTEq376UU9A4Sd3TEKz+Y2nRUd90cLO4Hc1otaB8yFSy9Ur2UVGcI2/wCoodL3a39k6WbdgNzFxr0gWFRQ==", + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.55-5.tgz", + "integrity": "sha512-n6Vr876Iz41PW8pSpOa7SbrNCqaV+6HDLNf/n8V4gIwwlOlIz7Jb00r/fboXZFIT+0dyAGGLoGgd7xUujVL/Xw==", "license": "SEE LICENSE IN LICENSE.md", + "dependencies": { + "detect-libc": "^2.1.2" + }, "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.48", - "@github/copilot-darwin-x64": "1.0.48", - "@github/copilot-linux-arm64": "1.0.48", - "@github/copilot-linux-x64": "1.0.48", - "@github/copilot-win32-arm64": "1.0.48", - "@github/copilot-win32-x64": "1.0.48" + "@github/copilot-darwin-arm64": "1.0.55-5", + "@github/copilot-darwin-x64": "1.0.55-5", + "@github/copilot-linux-arm64": "1.0.55-5", + "@github/copilot-linux-x64": "1.0.55-5", + "@github/copilot-linuxmusl-arm64": "1.0.55-5", + "@github/copilot-linuxmusl-x64": "1.0.55-5", + "@github/copilot-win32-arm64": "1.0.55-5", + "@github/copilot-win32-x64": "1.0.55-5" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.48.tgz", - "integrity": "sha512-82MLoMQwPVVFM8EYssihFxSEPUYtZADE8rMzQ3jG9HgRg2qjQSfnHQS1mKe64dlXswZUK/onw6/8kjnW5I4pPg==", + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.55-5.tgz", + "integrity": "sha512-Mult62GJVnxR3MOP2QNiVU5RRGXPJ+7BpjEMIvkoaMuWX6J7F4bz7N+HUXVHJUiGUp3hnL3M16kjkewWfNdoNg==", "cpu": [ "arm64" ], @@ -461,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.48.tgz", - "integrity": "sha512-1VQ5r5F0h8GwboXmZTcutqcJT+iCpPXAF27QqodmpKEvW9aYfG8g9X2kFJOzDZoX+SA3Uaka9qXdYKF2xT6Uog==", + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.55-5.tgz", + "integrity": "sha512-IfY3WhNvHwXHldI2ARsiAYuPlKWlI07Fo1ALq+SViHhn0Zfp2yIr9laJRofyj0G1EbyUxkbNlqQm7UrXhkEVeg==", "cpu": [ "x64" ], @@ -477,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.48.tgz", - "integrity": "sha512-PmsGnb0DZlI+Bf53l9HM1PAHHkUcMyB4y8v/7tnC/jDOV5dGF124n0HnDNfJLOLiJGiQGodthIif6QtPaAxpeA==", + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.55-5.tgz", + "integrity": "sha512-UPZ5Y5QotcZvo3f4yFwJVOtAgUT3mq+q2fim82kWa/MA0+EkkADZ3kb+R4OnV1Nqv5EaoZiCFh0Ukk++IMSYwQ==", "cpu": [ "arm64" ], @@ -493,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.48.tgz", - "integrity": "sha512-b2cc4euSlke9fYHXXsS2EL9UYbctN0h4lZvtAcKUDY+RCnpYAQOVBZK+c1R9dQrtsT6Z/yUv7PuFPSs8qdtc2Q==", + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.55-5.tgz", + "integrity": "sha512-Fdwiir53Ogg8C9xv6sTc7/C4vFfQHt6VWFB74kojbDgIbYEpm57wNygQVwJvrwtVW3w/b1MLtGGTp7pEvUBACQ==", "cpu": [ "x64" ], @@ -508,10 +513,42 @@ "copilot-linux-x64": "copilot" } }, + "node_modules/@github/copilot-linuxmusl-arm64": { + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.55-5.tgz", + "integrity": "sha512-NqPmeAA1+iI8Xd4wJUHNNCmVTmHCl+R3nqdXhEVQDLIau9ouGqGGay/91d2ZIgFXJn7J0UTAEdHbdBcfhbnhvg==", + "cpu": [ + "arm64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "linux" + ], + "bin": { + "copilot-linuxmusl-arm64": "copilot" + } + }, + "node_modules/@github/copilot-linuxmusl-x64": { + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.55-5.tgz", + "integrity": "sha512-bOB4vKw1R7Mekn8z34xpNViYUQ4LQAEFzpkyxhc0uOliFmfku/YcIgo42aMWFzf/Bi3iBazBNfCN+L2lz/Jc9A==", + "cpu": [ + "x64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "linux" + ], + "bin": { + "copilot-linuxmusl-x64": "copilot" + } + }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.48.tgz", - "integrity": "sha512-VEEOwddtpJ3DTbXGhnK6K8im4ofl9m08q1m/K++sNvWV8wkkOSOQBTiPdyUsuU/TXAoFhb8tZMIJv+6NnMBtMw==", + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.55-5.tgz", + "integrity": "sha512-pR2KaiXUanjxolaWgRPlFdeTEpb7jcN1Rk8xVnBCD2ORwERXdYrqXaLCyDbgdplI9mI6IjM+kkUbyXzXoWz/HQ==", "cpu": [ "arm64" ], @@ -525,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.48.tgz", - "integrity": "sha512-93BzvXLPHTyy1gWBXQY/IWIHor4IAwZuuo7/obG80/Qa6U0WeaN9slz/FBJvrsgVNrrRfEID5Xm3At+S6Kj67Q==", + "version": "1.0.55-5", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.55-5.tgz", + "integrity": "sha512-EuQBgqSnRFjavgeFifbnSYUJ4elTQBLC/kf+WHolrHR2oUGyiqCQZz/cV2DYVSLP1TGxDKAV4AQCM1AdUT1xEA==", "cpu": [ "x64" ], @@ -540,6 +577,15 @@ "copilot-win32-x64": "copilot.exe" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/esbuild": { "version": "0.27.7", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", diff --git a/scripts/codegen/package.json b/scripts/codegen/package.json index 82454e774e..6664dd8f27 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.48", + "@github/copilot": "^1.0.55-5", "json-schema": "^0.4.0", "tsx": "^4.20.6" } diff --git a/scripts/compare-standalone-to-monorepo.sh b/scripts/compare-standalone-to-monorepo.sh new file mode 100755 index 0000000000..ad329fdb1f --- /dev/null +++ b/scripts/compare-standalone-to-monorepo.sh @@ -0,0 +1,310 @@ +#!/bin/sh +# compare-standalone-to-monorepo.sh +# +# Compare POM, Java source, Java properties files, and .lastmerge between the +# standalone copilot-sdk-java repo and the monorepo's java/ directory. +# +# Usage: +# ./scripts/compare-standalone-to-monorepo.sh /path/to/standalone /path/to/monorepo [--diff] +# +# The standalone path should point to the root of copilot-sdk-java. +# The monorepo path should point to the root of copilot-sdk (the java/ subdir +# is appended automatically). +# +# Compatible with macOS zsh and POSIX sh/bash. + +set -e + +# ── Parse arguments ────────────────────────────────────────────────── +SHOW_DIFF=false +STANDALONE="" +MONOREPO="" + +for arg in "$@"; do + case "$arg" in + --diff) + SHOW_DIFF=true + ;; + *) + if [ -z "$STANDALONE" ]; then + STANDALONE="$arg" + elif [ -z "$MONOREPO" ]; then + MONOREPO="$arg" + else + echo "Error: unexpected argument: $arg" >&2 + echo "Usage: $0 [--diff]" >&2 + exit 1 + fi + ;; + esac +done + +if [ -z "$STANDALONE" ] || [ -z "$MONOREPO" ]; then + echo "Usage: $0 [--diff]" >&2 + exit 1 +fi + +MONO_JAVA="${MONOREPO}/java" + +if [ ! -d "$STANDALONE" ]; then + echo "Error: standalone directory does not exist: $STANDALONE" >&2 + exit 1 +fi + +if [ ! -d "$MONO_JAVA" ]; then + echo "Error: monorepo java directory does not exist: $MONO_JAVA" >&2 + exit 1 +fi + +# ── Collect comparable files from the standalone repo ──────────────── +# Excludes: target/, node_modules/, temporary-prompts/, scripts/codegen/ +# (these are build artifacts or standalone-only content) +TMPFILE_STANDALONE=$(mktemp) +TMPFILE_MONO=$(mktemp) +trap 'rm -f "$TMPFILE_STANDALONE" "$TMPFILE_MONO"' EXIT + +(cd "$STANDALONE" && find . -type f \( -name "pom.xml" -o -name "*.java" -o -name "*.properties" \) \ + | grep -v '/target/' \ + | grep -v '/node_modules/' \ + | grep -v '^\./temporary-prompts/' \ + | grep -v '^\./scripts/codegen/' \ + | sed 's|^\./||' \ + | sort) > "$TMPFILE_STANDALONE" + +# ── Collect comparable files from the monorepo ─────────────────────── +# Excludes: target/, node_modules/, scripts/codegen/ +(cd "$MONO_JAVA" && find . -type f \( -name "pom.xml" -o -name "*.java" -o -name "*.properties" \) \ + | grep -v '/target/' \ + | grep -v '/node_modules/' \ + | grep -v '^\./scripts/codegen/' \ + | sed 's|^\./||' \ + | sort) > "$TMPFILE_MONO" + +# ── Compare ────────────────────────────────────────────────────────── +DIFFER_COUNT=0 +MISSING_FROM_MONO_COUNT=0 +MISSING_FROM_STANDALONE_COUNT=0 +SAME_COUNT=0 +DIFFER_LIST="" +MISSING_FROM_MONO_LIST="" +MISSING_FROM_STANDALONE_LIST="" + +# Check standalone files against monorepo +while IFS= read -r relpath; do + standalone_file="${STANDALONE}/${relpath}" + mono_file="${MONO_JAVA}/${relpath}" + + if [ ! -f "$mono_file" ]; then + MISSING_FROM_MONO_COUNT=$((MISSING_FROM_MONO_COUNT + 1)) + MISSING_FROM_MONO_LIST="${MISSING_FROM_MONO_LIST}${relpath} +" + elif ! diff -q "$standalone_file" "$mono_file" >/dev/null 2>&1; then + DIFFER_COUNT=$((DIFFER_COUNT + 1)) + DIFFER_LIST="${DIFFER_LIST}${relpath} +" + else + SAME_COUNT=$((SAME_COUNT + 1)) + fi +done < "$TMPFILE_STANDALONE" + +# Check monorepo files that don't exist in standalone +while IFS= read -r relpath; do + standalone_file="${STANDALONE}/${relpath}" + + if [ ! -f "$standalone_file" ]; then + MISSING_FROM_STANDALONE_COUNT=$((MISSING_FROM_STANDALONE_COUNT + 1)) + MISSING_FROM_STANDALONE_LIST="${MISSING_FROM_STANDALONE_LIST}${relpath} +" + fi +done < "$TMPFILE_MONO" + +# ── Compare scripts/codegen/java.ts ─────────────────────────────────── +JAVATS_STATUS="" +STANDALONE_JAVATS="${STANDALONE}/scripts/codegen/java.ts" +MONO_JAVATS="${MONO_JAVA}/scripts/codegen/java.ts" + +if [ -f "$STANDALONE_JAVATS" ] && [ -f "$MONO_JAVATS" ]; then + if diff -q "$STANDALONE_JAVATS" "$MONO_JAVATS" >/dev/null 2>&1; then + JAVATS_STATUS="identical" + SAME_COUNT=$((SAME_COUNT + 1)) + else + JAVATS_STATUS="differ" + DIFFER_COUNT=$((DIFFER_COUNT + 1)) + DIFFER_LIST="${DIFFER_LIST}scripts/codegen/java.ts +" + fi +elif [ -f "$STANDALONE_JAVATS" ] && [ ! -f "$MONO_JAVATS" ]; then + JAVATS_STATUS="only-standalone" + MISSING_FROM_MONO_COUNT=$((MISSING_FROM_MONO_COUNT + 1)) + MISSING_FROM_MONO_LIST="${MISSING_FROM_MONO_LIST}scripts/codegen/java.ts +" +elif [ ! -f "$STANDALONE_JAVATS" ] && [ -f "$MONO_JAVATS" ]; then + JAVATS_STATUS="only-monorepo" + MISSING_FROM_STANDALONE_COUNT=$((MISSING_FROM_STANDALONE_COUNT + 1)) + MISSING_FROM_STANDALONE_LIST="${MISSING_FROM_STANDALONE_LIST}scripts/codegen/java.ts +" +else + JAVATS_STATUS="missing-both" +fi + +# ── Compare .lastmerge ──────────────────────────────────────────────── +LASTMERGE_STATUS="" +STANDALONE_LASTMERGE="${STANDALONE}/.lastmerge" +MONO_LASTMERGE="${MONO_JAVA}/.lastmerge" + +if [ -f "$STANDALONE_LASTMERGE" ] && [ -f "$MONO_LASTMERGE" ]; then + if diff -q "$STANDALONE_LASTMERGE" "$MONO_LASTMERGE" >/dev/null 2>&1; then + LASTMERGE_STATUS="identical" + SAME_COUNT=$((SAME_COUNT + 1)) + else + LASTMERGE_STATUS="differ" + DIFFER_COUNT=$((DIFFER_COUNT + 1)) + DIFFER_LIST="${DIFFER_LIST}.lastmerge +" + fi +elif [ -f "$STANDALONE_LASTMERGE" ] && [ ! -f "$MONO_LASTMERGE" ]; then + LASTMERGE_STATUS="only-standalone" + MISSING_FROM_MONO_COUNT=$((MISSING_FROM_MONO_COUNT + 1)) + MISSING_FROM_MONO_LIST="${MISSING_FROM_MONO_LIST}.lastmerge +" +elif [ ! -f "$STANDALONE_LASTMERGE" ] && [ -f "$MONO_LASTMERGE" ]; then + LASTMERGE_STATUS="only-monorepo" + MISSING_FROM_STANDALONE_COUNT=$((MISSING_FROM_STANDALONE_COUNT + 1)) + MISSING_FROM_STANDALONE_LIST="${MISSING_FROM_STANDALONE_LIST}.lastmerge +" +else + LASTMERGE_STATUS="missing-both" +fi + +STANDALONE_TOTAL=$(wc -l < "$TMPFILE_STANDALONE" | tr -d ' ') +MONO_TOTAL=$(wc -l < "$TMPFILE_MONO" | tr -d ' ') + +# ── Output ─────────────────────────────────────────────────────────── +echo "Standalone files: ${STANDALONE_TOTAL} Monorepo files: ${MONO_TOTAL}" +echo " Identical: ${SAME_COUNT}" +echo " Differ: ${DIFFER_COUNT}" +echo " Only in standalone (missing from monorepo): ${MISSING_FROM_MONO_COUNT}" +echo " Only in monorepo (missing from standalone): ${MISSING_FROM_STANDALONE_COUNT}" +echo "" + +# .lastmerge status +if [ "$LASTMERGE_STATUS" = "identical" ]; then + echo ".lastmerge: identical" +elif [ "$LASTMERGE_STATUS" = "differ" ]; then + echo ".lastmerge: DIFFERS" + echo " standalone: $(cat "$STANDALONE_LASTMERGE")" + echo " monorepo: $(cat "$MONO_LASTMERGE")" +elif [ "$LASTMERGE_STATUS" = "only-standalone" ]; then + echo ".lastmerge: only in standalone" +elif [ "$LASTMERGE_STATUS" = "only-monorepo" ]; then + echo ".lastmerge: only in monorepo" +else + echo ".lastmerge: not found in either location" +fi + +# scripts/codegen/java.ts status +if [ "$JAVATS_STATUS" = "identical" ]; then + echo "scripts/codegen/java.ts: identical" +elif [ "$JAVATS_STATUS" = "differ" ]; then + echo "scripts/codegen/java.ts: DIFFERS" +elif [ "$JAVATS_STATUS" = "only-standalone" ]; then + echo "scripts/codegen/java.ts: only in standalone" +elif [ "$JAVATS_STATUS" = "only-monorepo" ]; then + echo "scripts/codegen/java.ts: only in monorepo" +else + echo "scripts/codegen/java.ts: not found in either location" +fi +echo "" + +if [ "$DIFFER_COUNT" -gt 0 ]; then + echo "The following files differ between the standalone and monorepo:" + echo "" + printf '%s' "$DIFFER_LIST" | while IFS= read -r f; do + [ -n "$f" ] && echo " $f" + done + echo "" +fi + +if [ "$MISSING_FROM_MONO_COUNT" -gt 0 ]; then + echo "The following files exist in standalone but NOT in monorepo:" + echo "" + printf '%s' "$MISSING_FROM_MONO_LIST" | while IFS= read -r f; do + [ -n "$f" ] && echo " $f" + done + echo "" +fi + +if [ "$MISSING_FROM_STANDALONE_COUNT" -gt 0 ]; then + echo "The following files exist in monorepo but NOT in standalone:" + echo "" + printf '%s' "$MISSING_FROM_STANDALONE_LIST" | while IFS= read -r f; do + [ -n "$f" ] && echo " $f" + done + echo "" +fi + +if [ "$DIFFER_COUNT" -eq 0 ] && [ "$MISSING_FROM_MONO_COUNT" -eq 0 ] && [ "$MISSING_FROM_STANDALONE_COUNT" -eq 0 ]; then + echo "All files are identical." +fi + +# ── Optional unified diffs ─────────────────────────────────────────── +if [ "$SHOW_DIFF" = true ] && [ "$DIFFER_COUNT" -gt 0 ]; then + echo "================================================================================" + echo "Unified diffs for differing files:" + echo "================================================================================" + printf '%s' "$DIFFER_LIST" | while IFS= read -r f; do + if [ -n "$f" ] && [ "$f" != ".lastmerge" ]; then + echo "" + echo "--- standalone/$f" + echo "+++ monorepo/java/$f" + diff -u "${STANDALONE}/${f}" "${MONO_JAVA}/${f}" || true + fi + done +fi + +# ── Optional .lastmerge commit log comparison ──────────────────────── +if [ "$SHOW_DIFF" = true ] && [ "$LASTMERGE_STATUS" = "differ" ]; then + STANDALONE_HASH=$(cat "$STANDALONE_LASTMERGE" | tr -d '[:space:]') + MONO_HASH=$(cat "$MONO_LASTMERGE" | tr -d '[:space:]') + echo "" + echo "================================================================================" + echo ".lastmerge differs — commit log comparison in monorepo:" + echo "================================================================================" + echo "" + echo "--- standalone .lastmerge: ${STANDALONE_HASH}" + (cd "$MONOREPO" && git log --oneline -1 "$STANDALONE_HASH" 2>/dev/null) || echo " (commit not found in monorepo)" + echo "" + echo "+++ monorepo .lastmerge: ${MONO_HASH}" + (cd "$MONOREPO" && git log --oneline -1 "$MONO_HASH" 2>/dev/null) || echo " (commit not found in monorepo)" + echo "" + echo "Commits between standalone and monorepo .lastmerge:" + (cd "$MONOREPO" && git log --oneline "${STANDALONE_HASH}..${MONO_HASH}" 2>/dev/null) || echo " (unable to compute log range)" +fi + +if [ "$SHOW_DIFF" = true ] && [ "$MISSING_FROM_STANDALONE_COUNT" -gt 0 ]; then + echo "" + echo "================================================================================" + echo "Files only in monorepo (new files to port to standalone):" + echo "================================================================================" + printf '%s' "$MISSING_FROM_STANDALONE_LIST" | while IFS= read -r f; do + if [ -n "$f" ]; then + echo "" + echo "+++ monorepo/java/$f" + diff -u /dev/null "${MONO_JAVA}/${f}" || true + fi + done +fi + +if [ "$SHOW_DIFF" = true ] && [ "$MISSING_FROM_MONO_COUNT" -gt 0 ]; then + echo "" + echo "================================================================================" + echo "Files only in standalone (not present in monorepo):" + echo "================================================================================" + printf '%s' "$MISSING_FROM_MONO_LIST" | while IFS= read -r f; do + if [ -n "$f" ]; then + echo "" + echo "--- standalone/$f" + diff -u "${STANDALONE}/${f}" /dev/null || true + fi + done +fi diff --git a/src/generated/java/com/github/copilot/sdk/generated/AbortEvent.java b/src/generated/java/com/github/copilot/generated/AbortEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/AbortEvent.java rename to src/generated/java/com/github/copilot/generated/AbortEvent.java index 16cfabc0e6..e58922aa0d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AbortEvent.java +++ b/src/generated/java/com/github/copilot/generated/AbortEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code abort} session event. + * Session event "abort". Turn abort information including the reason for termination * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AbortReason.java b/src/generated/java/com/github/copilot/generated/AbortReason.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/AbortReason.java rename to src/generated/java/com/github/copilot/generated/AbortReason.java index 2bb93b8865..2ffbdb8d8c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AbortReason.java +++ b/src/generated/java/com/github/copilot/generated/AbortReason.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantIntentEvent.java b/src/generated/java/com/github/copilot/generated/AssistantIntentEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantIntentEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantIntentEvent.java index a1c22edfb1..49de4cda21 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantIntentEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantIntentEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.intent} session event. + * Session event "assistant.intent". Agent intent description for current activity or plan * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageDeltaEvent.java b/src/generated/java/com/github/copilot/generated/AssistantMessageDeltaEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantMessageDeltaEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantMessageDeltaEvent.java index 128608a1e1..cdc0e3e26a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageDeltaEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantMessageDeltaEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.message_delta} session event. + * Session event "assistant.message_delta". Streaming assistant message delta for incremental response updates * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java b/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java index 3ac0b9780a..de966758c3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantMessageEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.message} session event. + * Session event "assistant.message". Assistant response containing text content, optional tool requests, and interaction metadata * * @since 1.0.0 */ @@ -53,11 +53,13 @@ public record AssistantMessageEventData( /** Generation phase for phased-output models (e.g., thinking vs. response phases) */ @JsonProperty("phase") String phase, /** Actual output token count from the API response (completion_tokens), used for accurate token accounting */ - @JsonProperty("outputTokens") Double outputTokens, + @JsonProperty("outputTokens") Long outputTokens, /** CAPI interaction ID for correlating this message with upstream telemetry */ @JsonProperty("interactionId") String interactionId, /** GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs */ @JsonProperty("requestId") String requestId, + /** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */ + @JsonProperty("serviceRequestId") String serviceRequestId, /** Raw Anthropic content array with advisor blocks (server_tool_use, advisor_tool_result) for verbatim round-tripping */ @JsonProperty("anthropicAdvisorBlocks") List anthropicAdvisorBlocks, /** Anthropic advisor model ID used for this response, for timeline display on replay */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageStartEvent.java b/src/generated/java/com/github/copilot/generated/AssistantMessageStartEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantMessageStartEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantMessageStartEvent.java index 8cf1a9c8e7..f85e33b888 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageStartEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantMessageStartEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.message_start} session event. + * Session event "assistant.message_start". Streaming assistant message start metadata * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequest.java b/src/generated/java/com/github/copilot/generated/AssistantMessageToolRequest.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequest.java rename to src/generated/java/com/github/copilot/generated/AssistantMessageToolRequest.java index e185a01fa8..2013734012 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequest.java +++ b/src/generated/java/com/github/copilot/generated/AssistantMessageToolRequest.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequestType.java b/src/generated/java/com/github/copilot/generated/AssistantMessageToolRequestType.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequestType.java rename to src/generated/java/com/github/copilot/generated/AssistantMessageToolRequestType.java index 024b845d62..acf6df7b4f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantMessageToolRequestType.java +++ b/src/generated/java/com/github/copilot/generated/AssistantMessageToolRequestType.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningDeltaEvent.java b/src/generated/java/com/github/copilot/generated/AssistantReasoningDeltaEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningDeltaEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantReasoningDeltaEvent.java index 7c11ad59e7..f9d8b25b44 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningDeltaEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantReasoningDeltaEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.reasoning_delta} session event. + * Session event "assistant.reasoning_delta". Streaming reasoning delta for incremental extended thinking updates * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningEvent.java b/src/generated/java/com/github/copilot/generated/AssistantReasoningEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantReasoningEvent.java index 292b191b14..d84b400582 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantReasoningEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantReasoningEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.reasoning} session event. + * Session event "assistant.reasoning". Assistant reasoning content for timeline display with complete thinking text * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantStreamingDeltaEvent.java b/src/generated/java/com/github/copilot/generated/AssistantStreamingDeltaEvent.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantStreamingDeltaEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantStreamingDeltaEvent.java index 71ec8f4884..e5eae1897f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantStreamingDeltaEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantStreamingDeltaEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.streaming_delta} session event. + * Session event "assistant.streaming_delta". Streaming response progress with cumulative byte count * * @since 1.0.0 */ @@ -36,7 +36,7 @@ public final class AssistantStreamingDeltaEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record AssistantStreamingDeltaEventData( /** Cumulative total bytes received from the streaming response so far */ - @JsonProperty("totalResponseSizeBytes") Double totalResponseSizeBytes + @JsonProperty("totalResponseSizeBytes") Long totalResponseSizeBytes ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnEndEvent.java b/src/generated/java/com/github/copilot/generated/AssistantTurnEndEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantTurnEndEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantTurnEndEvent.java index a8e0b16525..fa245915b6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnEndEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantTurnEndEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.turn_end} session event. + * Session event "assistant.turn_end". Turn completion metadata including the turn identifier * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnStartEvent.java b/src/generated/java/com/github/copilot/generated/AssistantTurnStartEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantTurnStartEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantTurnStartEvent.java index 921623801d..f090117bf7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantTurnStartEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantTurnStartEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.turn_start} session event. + * Session event "assistant.turn_start". Turn initialization metadata including identifier and interaction tracking * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageApiEndpoint.java b/src/generated/java/com/github/copilot/generated/AssistantUsageApiEndpoint.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantUsageApiEndpoint.java rename to src/generated/java/com/github/copilot/generated/AssistantUsageApiEndpoint.java index e69e4ef868..9f94c4a6e9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageApiEndpoint.java +++ b/src/generated/java/com/github/copilot/generated/AssistantUsageApiEndpoint.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsage.java b/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsage.java rename to src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java index ee3e9f9cfb..e9db8a530d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsage.java +++ b/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsage.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsageTokenDetail.java b/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java similarity index 84% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsageTokenDetail.java rename to src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java index 895f19030f..9354568c7c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageCopilotUsageTokenDetail.java +++ b/src/generated/java/com/github/copilot/generated/AssistantUsageCopilotUsageTokenDetail.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,11 +22,11 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record AssistantUsageCopilotUsageTokenDetail( /** Number of tokens in this billing batch */ - @JsonProperty("batchSize") Double batchSize, + @JsonProperty("batchSize") Long batchSize, /** Cost per batch of tokens */ - @JsonProperty("costPerBatch") Double costPerBatch, + @JsonProperty("costPerBatch") Long costPerBatch, /** Total token count for this entry */ - @JsonProperty("tokenCount") Double tokenCount, + @JsonProperty("tokenCount") Long 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/generated/AssistantUsageEvent.java similarity index 80% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantUsageEvent.java rename to src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java index ba97e03958..2c19c150b2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageEvent.java +++ b/src/generated/java/com/github/copilot/generated/AssistantUsageEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code assistant.usage} session event. + * Session event "assistant.usage". LLM API call usage metrics including tokens, costs, quotas, and billing information * * @since 1.0.0 */ @@ -39,21 +39,21 @@ public record AssistantUsageEventData( /** Model identifier used for this API call */ @JsonProperty("model") String model, /** Number of input tokens consumed */ - @JsonProperty("inputTokens") Double inputTokens, + @JsonProperty("inputTokens") Long inputTokens, /** Number of output tokens produced */ - @JsonProperty("outputTokens") Double outputTokens, + @JsonProperty("outputTokens") Long outputTokens, /** Number of tokens read from prompt cache */ - @JsonProperty("cacheReadTokens") Double cacheReadTokens, + @JsonProperty("cacheReadTokens") Long cacheReadTokens, /** Number of tokens written to prompt cache */ - @JsonProperty("cacheWriteTokens") Double cacheWriteTokens, + @JsonProperty("cacheWriteTokens") Long cacheWriteTokens, /** Number of output tokens used for reasoning (e.g., chain-of-thought) */ - @JsonProperty("reasoningTokens") Double reasoningTokens, + @JsonProperty("reasoningTokens") Long reasoningTokens, /** Model multiplier cost for billing purposes */ @JsonProperty("cost") Double cost, /** Duration of the API call in milliseconds */ - @JsonProperty("duration") Double duration, + @JsonProperty("duration") Long duration, /** Time to first token in milliseconds. Only available for streaming requests */ - @JsonProperty("ttftMs") Double ttftMs, + @JsonProperty("timeToFirstTokenMs") Long timeToFirstTokenMs, /** Average inter-token latency in milliseconds. Only available for streaming requests */ @JsonProperty("interTokenLatencyMs") Double interTokenLatencyMs, /** What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls */ @@ -62,6 +62,8 @@ public record AssistantUsageEventData( @JsonProperty("apiCallId") String apiCallId, /** GitHub request tracing ID (x-github-request-id header) for server-side log correlation */ @JsonProperty("providerCallId") String providerCallId, + /** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */ + @JsonProperty("serviceRequestId") String serviceRequestId, /** API endpoint used for this model call, matching CAPI supported_endpoints vocabulary */ @JsonProperty("apiEndpoint") AssistantUsageApiEndpoint apiEndpoint, /** Parent tool call ID when this usage originates from a sub-agent */ @@ -70,7 +72,7 @@ public record AssistantUsageEventData( @JsonProperty("quotaSnapshots") Map quotaSnapshots, /** Per-request cost and usage data from the CAPI copilot_usage response field */ @JsonProperty("copilotUsage") AssistantUsageCopilotUsage copilotUsage, - /** Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh") */ + /** Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") */ @JsonProperty("reasoningEffort") String reasoningEffort ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageQuotaSnapshot.java b/src/generated/java/com/github/copilot/generated/AssistantUsageQuotaSnapshot.java similarity index 77% rename from src/generated/java/com/github/copilot/sdk/generated/AssistantUsageQuotaSnapshot.java rename to src/generated/java/com/github/copilot/generated/AssistantUsageQuotaSnapshot.java index 0986f67d71..167f420408 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AssistantUsageQuotaSnapshot.java +++ b/src/generated/java/com/github/copilot/generated/AssistantUsageQuotaSnapshot.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,6 +13,11 @@ import java.time.OffsetDateTime; import javax.annotation.processing.Generated; +/** + * Schema for the `AssistantUsageQuotaSnapshot` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @@ -20,16 +25,16 @@ 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, + @JsonProperty("entitlementRequests") Long entitlementRequests, /** Number of requests already consumed */ - @JsonProperty("usedRequests") Double usedRequests, + @JsonProperty("usedRequests") Long usedRequests, /** Whether usage is still permitted after quota exhaustion */ @JsonProperty("usageAllowedWithExhaustedQuota") Boolean usageAllowedWithExhaustedQuota, - /** Number of requests over the entitlement limit */ + /** Number of additional usage requests made this period */ @JsonProperty("overage") Double overage, - /** Whether overage is allowed when quota is exhausted */ + /** Whether additional usage is allowed when quota is exhausted */ @JsonProperty("overageAllowedWithExhaustedQuota") Boolean overageAllowedWithExhaustedQuota, - /** Percentage of quota remaining (0.0 to 1.0) */ + /** Percentage of quota remaining (0 to 100) */ @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/generated/AutoModeSwitchCompletedEvent.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/AutoModeSwitchCompletedEvent.java index a6d994d6b8..76a35dbb7d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/AutoModeSwitchCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code auto_mode_switch.completed} session event. + * Session event "auto_mode_switch.completed". Auto mode switch completion notification * * @since 1.0.0 */ @@ -37,8 +37,8 @@ public final class AutoModeSwitchCompletedEvent extends SessionEvent { 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 + /** The user's auto-mode-switch choice */ + @JsonProperty("response") AutoModeSwitchResponse response ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchRequestedEvent.java b/src/generated/java/com/github/copilot/generated/AutoModeSwitchRequestedEvent.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchRequestedEvent.java rename to src/generated/java/com/github/copilot/generated/AutoModeSwitchRequestedEvent.java index e234ccd287..79fc5c3169 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/AutoModeSwitchRequestedEvent.java +++ b/src/generated/java/com/github/copilot/generated/AutoModeSwitchRequestedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code auto_mode_switch.requested} session event. + * Session event "auto_mode_switch.requested". Auto mode switch request notification requiring user approval * * @since 1.0.0 */ @@ -40,7 +40,7 @@ public record AutoModeSwitchRequestedEventData( /** The rate limit error code that triggered this request */ @JsonProperty("errorCode") String errorCode, /** Seconds until the rate limit resets, when known. Lets clients render a humanized reset time alongside the prompt. */ - @JsonProperty("retryAfterSeconds") Double retryAfterSeconds + @JsonProperty("retryAfterSeconds") Long retryAfterSeconds ) { } } diff --git a/src/generated/java/com/github/copilot/generated/AutoModeSwitchResponse.java b/src/generated/java/com/github/copilot/generated/AutoModeSwitchResponse.java new file mode 100644 index 0000000000..46745b66e8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/AutoModeSwitchResponse.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.generated; + +import javax.annotation.processing.Generated; + +/** + * The user's auto-mode-switch choice + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AutoModeSwitchResponse { + /** The {@code yes} variant. */ + YES("yes"), + /** The {@code yes_always} variant. */ + YES_ALWAYS("yes_always"), + /** The {@code no} variant. */ + NO("no"); + + private final String value; + AutoModeSwitchResponse(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AutoModeSwitchResponse fromValue(String value) { + for (AutoModeSwitchResponse v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AutoModeSwitchResponse value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/AutopilotObjectiveChangedOperation.java b/src/generated/java/com/github/copilot/generated/AutopilotObjectiveChangedOperation.java new file mode 100644 index 0000000000..9a6211d491 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/AutopilotObjectiveChangedOperation.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.generated; + +import javax.annotation.processing.Generated; + +/** + * The type of operation performed on the autopilot objective state file + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AutopilotObjectiveChangedOperation { + /** The {@code create} variant. */ + CREATE("create"), + /** The {@code update} variant. */ + UPDATE("update"), + /** The {@code delete} variant. */ + DELETE("delete"); + + private final String value; + AutopilotObjectiveChangedOperation(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AutopilotObjectiveChangedOperation fromValue(String value) { + for (AutopilotObjectiveChangedOperation v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AutopilotObjectiveChangedOperation value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/AutopilotObjectiveChangedStatus.java b/src/generated/java/com/github/copilot/generated/AutopilotObjectiveChangedStatus.java new file mode 100644 index 0000000000..c8b4187f7c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/AutopilotObjectiveChangedStatus.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.generated; + +import javax.annotation.processing.Generated; + +/** + * Current autopilot objective status, if one exists + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AutopilotObjectiveChangedStatus { + /** The {@code active} variant. */ + ACTIVE("active"), + /** The {@code paused} variant. */ + PAUSED("paused"), + /** The {@code cap_reached} variant. */ + CAP_REACHED("cap_reached"), + /** The {@code completed} variant. */ + COMPLETED("completed"); + + private final String value; + AutopilotObjectiveChangedStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AutopilotObjectiveChangedStatus fromValue(String value) { + for (AutopilotObjectiveChangedStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AutopilotObjectiveChangedStatus value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/CanvasOpenedAvailability.java b/src/generated/java/com/github/copilot/generated/CanvasOpenedAvailability.java new file mode 100644 index 0000000000..1e65c1a2de --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/CanvasOpenedAvailability.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.generated; + +import javax.annotation.processing.Generated; + +/** + * Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum CanvasOpenedAvailability { + /** The {@code ready} variant. */ + READY("ready"), + /** The {@code stale} variant. */ + STALE("stale"); + + private final String value; + CanvasOpenedAvailability(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static CanvasOpenedAvailability fromValue(String value) { + for (CanvasOpenedAvailability v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown CanvasOpenedAvailability value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/CanvasRegistryChangedCanvas.java b/src/generated/java/com/github/copilot/generated/CanvasRegistryChangedCanvas.java new file mode 100644 index 0000000000..17d1477c11 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/CanvasRegistryChangedCanvas.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * Schema for the `CanvasRegistryChangedCanvas` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CanvasRegistryChangedCanvas( + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Owning extension display name, when available */ + @JsonProperty("extensionName") String extensionName, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Human-readable canvas name */ + @JsonProperty("displayName") String displayName, + /** Short, single-sentence description shown to the agent in canvas catalogs. */ + @JsonProperty("description") String description, + /** JSON Schema for canvas open input */ + @JsonProperty("inputSchema") Map inputSchema, + /** Actions the agent or host may invoke */ + @JsonProperty("actions") List actions +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServer.java b/src/generated/java/com/github/copilot/generated/CanvasRegistryChangedCanvasAction.java similarity index 60% rename from src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServer.java rename to src/generated/java/com/github/copilot/generated/CanvasRegistryChangedCanvasAction.java index 9e17180ded..34e30d3f24 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServer.java +++ b/src/generated/java/com/github/copilot/generated/CanvasRegistryChangedCanvasAction.java @@ -5,24 +5,28 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; import javax.annotation.processing.Generated; +/** + * Schema for the `CanvasRegistryChangedCanvasAction` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public record McpServersLoadedServer( - /** Server name (config key) */ +public record CanvasRegistryChangedCanvasAction( + /** Action name */ @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 + /** Action description */ + @JsonProperty("description") String description, + /** JSON Schema for action input */ + @JsonProperty("inputSchema") Map inputSchema ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java b/src/generated/java/com/github/copilot/generated/CapabilitiesChangedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java rename to src/generated/java/com/github/copilot/generated/CapabilitiesChangedEvent.java index 6ee7768fbb..8f0d0809f0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/CapabilitiesChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code capabilities.changed} session event. + * Session event "capabilities.changed". Session capability change notification * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/CapabilitiesChangedUI.java b/src/generated/java/com/github/copilot/generated/CapabilitiesChangedUI.java new file mode 100644 index 0000000000..83be6ad092 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/CapabilitiesChangedUI.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.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, + /** Whether MCP Apps (SEP-1865) UI passthrough is now supported */ + @JsonProperty("mcpApps") Boolean mcpApps, + /** Whether canvas rendering is now supported */ + @JsonProperty("canvases") Boolean canvases +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandCompletedEvent.java b/src/generated/java/com/github/copilot/generated/CommandCompletedEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/CommandCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/CommandCompletedEvent.java index d2075f09d3..a334edbb19 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CommandCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/CommandCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code command.completed} session event. + * Session event "command.completed". Queued command completion notification signaling UI dismissal * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandExecuteEvent.java b/src/generated/java/com/github/copilot/generated/CommandExecuteEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/CommandExecuteEvent.java rename to src/generated/java/com/github/copilot/generated/CommandExecuteEvent.java index a9b0608dba..efd840bbd3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CommandExecuteEvent.java +++ b/src/generated/java/com/github/copilot/generated/CommandExecuteEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code command.execute} session event. + * Session event "command.execute". Registered command dispatch request routed to the owning client * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandQueuedEvent.java b/src/generated/java/com/github/copilot/generated/CommandQueuedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/CommandQueuedEvent.java rename to src/generated/java/com/github/copilot/generated/CommandQueuedEvent.java index 6599f4da64..518248aa93 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CommandQueuedEvent.java +++ b/src/generated/java/com/github/copilot/generated/CommandQueuedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code command.queued} session event. + * Session event "command.queued". Queued slash command dispatch request for client execution * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedCommand.java b/src/generated/java/com/github/copilot/generated/CommandsChangedCommand.java similarity index 78% rename from src/generated/java/com/github/copilot/sdk/generated/CommandsChangedCommand.java rename to src/generated/java/com/github/copilot/generated/CommandsChangedCommand.java index 30c8e99627..383f141fcb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedCommand.java +++ b/src/generated/java/com/github/copilot/generated/CommandsChangedCommand.java @@ -5,18 +5,25 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `CommandsChangedCommand` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CommandsChangedCommand( + /** Slash command name without the leading slash. */ @JsonProperty("name") String name, + /** Optional human-readable command description. */ @JsonProperty("description") String description ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java b/src/generated/java/com/github/copilot/generated/CommandsChangedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java rename to src/generated/java/com/github/copilot/generated/CommandsChangedEvent.java index 48576c314a..a3f8fba190 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CommandsChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/CommandsChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code commands.changed} session event. + * Session event "commands.changed". SDK command registration change notification * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsed.java b/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsed.java similarity index 82% rename from src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsed.java rename to src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsed.java index 4409793920..ed454deafd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsed.java +++ b/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsed.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,17 +22,17 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record CompactionCompleteCompactionTokensUsed( /** Input tokens consumed by the compaction LLM call */ - @JsonProperty("inputTokens") Double inputTokens, + @JsonProperty("inputTokens") Long inputTokens, /** Output tokens produced by the compaction LLM call */ - @JsonProperty("outputTokens") Double outputTokens, + @JsonProperty("outputTokens") Long outputTokens, /** Cached input tokens reused in the compaction LLM call */ - @JsonProperty("cacheReadTokens") Double cacheReadTokens, + @JsonProperty("cacheReadTokens") Long cacheReadTokens, /** Tokens written to prompt cache in the compaction LLM call */ - @JsonProperty("cacheWriteTokens") Double cacheWriteTokens, + @JsonProperty("cacheWriteTokens") Long 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, + @JsonProperty("duration") Long 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/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java rename to src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java index 76e5a0ed8f..886229cc69 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java +++ b/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsage.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java b/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java similarity index 84% rename from src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java rename to src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java index 3c7fde8ad8..83209f94c8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java +++ b/src/generated/java/com/github/copilot/generated/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,11 +22,11 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail( /** Number of tokens in this billing batch */ - @JsonProperty("batchSize") Double batchSize, + @JsonProperty("batchSize") Long batchSize, /** Cost per batch of tokens */ - @JsonProperty("costPerBatch") Double costPerBatch, + @JsonProperty("costPerBatch") Long costPerBatch, /** Total token count for this entry */ - @JsonProperty("tokenCount") Double tokenCount, + @JsonProperty("tokenCount") Long 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/generated/CustomAgentsUpdatedAgent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/CustomAgentsUpdatedAgent.java rename to src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java index 0d9dbc295b..642be86944 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CustomAgentsUpdatedAgent.java +++ b/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,6 +13,11 @@ import java.util.List; import javax.annotation.processing.Generated; +/** + * Schema for the `CustomAgentsUpdatedAgent` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedAction.java b/src/generated/java/com/github/copilot/generated/ElicitationCompletedAction.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedAction.java rename to src/generated/java/com/github/copilot/generated/ElicitationCompletedAction.java index 32e4723e58..cc6026f259 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedAction.java +++ b/src/generated/java/com/github/copilot/generated/ElicitationCompletedAction.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java b/src/generated/java/com/github/copilot/generated/ElicitationCompletedEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/ElicitationCompletedEvent.java index ae94b6bf31..454cc43a0c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ElicitationCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/ElicitationCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code elicitation.completed} session event. + * Session event "elicitation.completed". Elicitation request completion with the user's response * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedEvent.java b/src/generated/java/com/github/copilot/generated/ElicitationRequestedEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedEvent.java rename to src/generated/java/com/github/copilot/generated/ElicitationRequestedEvent.java index fd5773df6f..6c8aa2547d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedEvent.java +++ b/src/generated/java/com/github/copilot/generated/ElicitationRequestedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code elicitation.requested} session event. + * Session event "elicitation.requested". Elicitation request; may be form-based (structured input) or URL-based (browser redirect) * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedMode.java b/src/generated/java/com/github/copilot/generated/ElicitationRequestedMode.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedMode.java rename to src/generated/java/com/github/copilot/generated/ElicitationRequestedMode.java index ffe24b56fa..49538450d4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedMode.java +++ b/src/generated/java/com/github/copilot/generated/ElicitationRequestedMode.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedSchema.java b/src/generated/java/com/github/copilot/generated/ElicitationRequestedSchema.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedSchema.java rename to src/generated/java/com/github/copilot/generated/ElicitationRequestedSchema.java index 4234867adc..d6ad62b4b0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ElicitationRequestedSchema.java +++ b/src/generated/java/com/github/copilot/generated/ElicitationRequestedSchema.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/ExitPlanModeAction.java b/src/generated/java/com/github/copilot/generated/ExitPlanModeAction.java new file mode 100644 index 0000000000..6d86641414 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ExitPlanModeAction.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.generated; + +import javax.annotation.processing.Generated; + +/** + * Exit plan mode action + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ExitPlanModeAction { + /** The {@code exit_only} variant. */ + EXIT_ONLY("exit_only"), + /** The {@code interactive} variant. */ + INTERACTIVE("interactive"), + /** The {@code autopilot} variant. */ + AUTOPILOT("autopilot"), + /** The {@code autopilot_fleet} variant. */ + AUTOPILOT_FLEET("autopilot_fleet"); + + private final String value; + ExitPlanModeAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ExitPlanModeAction fromValue(String value) { + for (ExitPlanModeAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ExitPlanModeAction value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeCompletedEvent.java b/src/generated/java/com/github/copilot/generated/ExitPlanModeCompletedEvent.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/ExitPlanModeCompletedEvent.java index 56c2c66813..6056a570e4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/ExitPlanModeCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code exit_plan_mode.completed} session event. + * Session event "exit_plan_mode.completed". Plan mode exit completion with the user's approval decision and optional feedback * * @since 1.0.0 */ @@ -39,8 +39,8 @@ public record ExitPlanModeCompletedEventData( @JsonProperty("requestId") String requestId, /** Whether the plan was approved by the user */ @JsonProperty("approved") Boolean approved, - /** Which action the user selected (e.g. 'autopilot', 'interactive', 'exit_only') */ - @JsonProperty("selectedAction") String selectedAction, + /** Action selected by the user */ + @JsonProperty("selectedAction") ExitPlanModeAction selectedAction, /** Whether edits should be auto-approved without confirmation */ @JsonProperty("autoApproveEdits") Boolean autoApproveEdits, /** Free-form feedback from the user if they requested changes to the plan */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeRequestedEvent.java b/src/generated/java/com/github/copilot/generated/ExitPlanModeRequestedEvent.java similarity index 80% rename from src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeRequestedEvent.java rename to src/generated/java/com/github/copilot/generated/ExitPlanModeRequestedEvent.java index de2bf45a84..134e01cbb9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ExitPlanModeRequestedEvent.java +++ b/src/generated/java/com/github/copilot/generated/ExitPlanModeRequestedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code exit_plan_mode.requested} session event. + * Session event "exit_plan_mode.requested". Plan approval request with plan content and available user actions * * @since 1.0.0 */ @@ -42,10 +42,10 @@ public record ExitPlanModeRequestedEventData( @JsonProperty("summary") String summary, /** Full content of the plan file */ @JsonProperty("planContent") String planContent, - /** Available actions the user can take (e.g., approve, edit, reject) */ - @JsonProperty("actions") List actions, - /** The recommended action for the user to take */ - @JsonProperty("recommendedAction") String recommendedAction + /** Available actions the user can take */ + @JsonProperty("actions") List actions, + /** Recommended action to preselect for the user */ + @JsonProperty("recommendedAction") ExitPlanModeAction recommendedAction ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtension.java b/src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtension.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtension.java rename to src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtension.java index 366ea550cd..b47f308c8e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtension.java +++ b/src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtension.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `ExtensionsLoadedExtension` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionSource.java b/src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtensionSource.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionSource.java rename to src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtensionSource.java index d6409caf45..abf991a01a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionSource.java +++ b/src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtensionSource.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionStatus.java b/src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtensionStatus.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionStatus.java rename to src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtensionStatus.java index a4ef8de991..8f8ca0b65c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ExtensionsLoadedExtensionStatus.java +++ b/src/generated/java/com/github/copilot/generated/ExtensionsLoadedExtensionStatus.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExternalToolCompletedEvent.java b/src/generated/java/com/github/copilot/generated/ExternalToolCompletedEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/ExternalToolCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/ExternalToolCompletedEvent.java index e9526c6faf..cfd9828e70 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ExternalToolCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/ExternalToolCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code external_tool.completed} session event. + * Session event "external_tool.completed". External tool completion notification signaling UI dismissal * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ExternalToolRequestedEvent.java b/src/generated/java/com/github/copilot/generated/ExternalToolRequestedEvent.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/ExternalToolRequestedEvent.java rename to src/generated/java/com/github/copilot/generated/ExternalToolRequestedEvent.java index 8e646c1a5c..39eacd44f2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ExternalToolRequestedEvent.java +++ b/src/generated/java/com/github/copilot/generated/ExternalToolRequestedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code external_tool.requested} session event. + * Session event "external_tool.requested". External tool invocation request for client-side tool execution * * @since 1.0.0 */ @@ -45,6 +45,8 @@ public record ExternalToolRequestedEventData( @JsonProperty("toolName") String toolName, /** Arguments to pass to the external tool */ @JsonProperty("arguments") Object arguments, + /** Active session working directory, when known. */ + @JsonProperty("workingDirectory") String workingDirectory, /** W3C Trace Context traceparent header for the execute_tool span */ @JsonProperty("traceparent") String traceparent, /** W3C Trace Context tracestate header for the execute_tool span */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/HandoffRepository.java b/src/generated/java/com/github/copilot/generated/HandoffRepository.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/HandoffRepository.java rename to src/generated/java/com/github/copilot/generated/HandoffRepository.java index a87002c9e3..e54226a8b3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/HandoffRepository.java +++ b/src/generated/java/com/github/copilot/generated/HandoffRepository.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/HandoffSourceType.java b/src/generated/java/com/github/copilot/generated/HandoffSourceType.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/HandoffSourceType.java rename to src/generated/java/com/github/copilot/generated/HandoffSourceType.java index 06f39c214e..83d6677825 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/HandoffSourceType.java +++ b/src/generated/java/com/github/copilot/generated/HandoffSourceType.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/HookEndError.java b/src/generated/java/com/github/copilot/generated/HookEndError.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/HookEndError.java rename to src/generated/java/com/github/copilot/generated/HookEndError.java index bbf992536a..59646b3cc1 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/HookEndError.java +++ b/src/generated/java/com/github/copilot/generated/HookEndError.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java b/src/generated/java/com/github/copilot/generated/HookEndEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java rename to src/generated/java/com/github/copilot/generated/HookEndEvent.java index c2a80b0f3d..1b90f5fa9e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/HookEndEvent.java +++ b/src/generated/java/com/github/copilot/generated/HookEndEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code hook.end} session event. + * Session event "hook.end". Hook invocation completion details including output, success status, and error information * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/HookProgressEvent.java b/src/generated/java/com/github/copilot/generated/HookProgressEvent.java new file mode 100644 index 0000000000..4ea3bd2eaf --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/HookProgressEvent.java @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "hook.progress". Ephemeral progress update from a running hook process + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class HookProgressEvent extends SessionEvent { + + @Override + public String getType() { return "hook.progress"; } + + @JsonProperty("data") + private HookProgressEventData data; + + public HookProgressEventData getData() { return data; } + public void setData(HookProgressEventData data) { this.data = data; } + + /** Data payload for {@link HookProgressEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record HookProgressEventData( + /** Human-readable progress message from the hook process */ + @JsonProperty("message") String message + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/HookStartEvent.java b/src/generated/java/com/github/copilot/generated/HookStartEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/HookStartEvent.java rename to src/generated/java/com/github/copilot/generated/HookStartEvent.java index ffca1dfe0b..f4605ce257 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/HookStartEvent.java +++ b/src/generated/java/com/github/copilot/generated/HookStartEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code hook.start} session event. + * Session event "hook.start". Hook invocation start details including type and input data * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteError.java b/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteError.java new file mode 100644 index 0000000000..d718d3377e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteError.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Set when the underlying tools/call threw an error before returning a CallToolResult + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpAppToolCallCompleteError( + /** Human-readable error message */ + @JsonProperty("message") String message +) { +} diff --git a/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteEvent.java b/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteEvent.java new file mode 100644 index 0000000000..ea4f517c46 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteEvent.java @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * Session event "mcp_app.tool_call_complete". MCP App view called a tool on a connected MCP server (SEP-1865) + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class McpAppToolCallCompleteEvent extends SessionEvent { + + @Override + public String getType() { return "mcp_app.tool_call_complete"; } + + @JsonProperty("data") + private McpAppToolCallCompleteEventData data; + + public McpAppToolCallCompleteEventData getData() { return data; } + public void setData(McpAppToolCallCompleteEventData data) { this.data = data; } + + /** Data payload for {@link McpAppToolCallCompleteEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record McpAppToolCallCompleteEventData( + /** Name of the MCP server hosting the tool */ + @JsonProperty("serverName") String serverName, + /** MCP tool name that was invoked */ + @JsonProperty("toolName") String toolName, + /** Arguments passed to the tool by the app view, if any */ + @JsonProperty("arguments") Map arguments, + /** True when the call completed without throwing AND the MCP CallToolResult did not set isError */ + @JsonProperty("success") Boolean success, + /** Wall-clock duration of the underlying tools/call in milliseconds */ + @JsonProperty("durationMs") Double durationMs, + /** Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. */ + @JsonProperty("result") Map result, + /** Set when the underlying tools/call threw an error before returning a CallToolResult */ + @JsonProperty("error") McpAppToolCallCompleteError error, + /** The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. */ + @JsonProperty("toolMeta") McpAppToolCallCompleteToolMeta toolMeta + ) { + } +} diff --git a/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteToolMeta.java b/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteToolMeta.java new file mode 100644 index 0000000000..33b9a3725b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteToolMeta.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpAppToolCallCompleteToolMeta( + /** Schema for the `McpAppToolCallCompleteToolMetaUI` type. */ + @JsonProperty("ui") McpAppToolCallCompleteToolMetaUI ui +) { +} diff --git a/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteToolMetaUI.java b/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteToolMetaUI.java new file mode 100644 index 0000000000..eb960434ad --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/McpAppToolCallCompleteToolMetaUI.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Schema for the `McpAppToolCallCompleteToolMetaUI` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpAppToolCallCompleteToolMetaUI( + /** `ui://` URI declared by the tool's `_meta.ui.resourceUri` */ + @JsonProperty("resourceUri") String resourceUri, + /** Tool visibility per SEP-1865 (typically a subset of `["model","app"]`) */ + @JsonProperty("visibility") List visibility +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpOauthCompletedEvent.java b/src/generated/java/com/github/copilot/generated/McpOauthCompletedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/McpOauthCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/McpOauthCompletedEvent.java index 3d410bf2d2..f02c7d42a2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/McpOauthCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/McpOauthCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code mcp.oauth_completed} session event. + * Session event "mcp.oauth_completed". MCP OAuth request completion notification * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java b/src/generated/java/com/github/copilot/generated/McpOauthRequiredEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java rename to src/generated/java/com/github/copilot/generated/McpOauthRequiredEvent.java index c7ef7a12af..c384afcf01 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredEvent.java +++ b/src/generated/java/com/github/copilot/generated/McpOauthRequiredEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code mcp.oauth_required} session event. + * Session event "mcp.oauth_required". OAuth authentication request for an MCP server * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredStaticClientConfig.java b/src/generated/java/com/github/copilot/generated/McpOauthRequiredStaticClientConfig.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredStaticClientConfig.java rename to src/generated/java/com/github/copilot/generated/McpOauthRequiredStaticClientConfig.java index b037b82ac5..764f8b7fc8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/McpOauthRequiredStaticClientConfig.java +++ b/src/generated/java/com/github/copilot/generated/McpOauthRequiredStaticClientConfig.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/McpServerSource.java b/src/generated/java/com/github/copilot/generated/McpServerSource.java new file mode 100644 index 0000000000..63514743ab --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/McpServerSource.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.generated; + +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/generated/McpServerStatus.java b/src/generated/java/com/github/copilot/generated/McpServerStatus.java new file mode 100644 index 0000000000..b5bb080935 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/McpServerStatus.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.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 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/McpServerStatusChangedStatus.java b/src/generated/java/com/github/copilot/generated/McpServerStatusChangedStatus.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/McpServerStatusChangedStatus.java rename to src/generated/java/com/github/copilot/generated/McpServerStatusChangedStatus.java index c0a6d989d2..cc11c8cabf 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/McpServerStatusChangedStatus.java +++ b/src/generated/java/com/github/copilot/generated/McpServerStatusChangedStatus.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/generated/McpServerTransport.java b/src/generated/java/com/github/copilot/generated/McpServerTransport.java new file mode 100644 index 0000000000..21211c4e20 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/McpServerTransport.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.generated; + +import javax.annotation.processing.Generated; + +/** + * Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpServerTransport { + /** The {@code stdio} variant. */ + STDIO("stdio"), + /** The {@code http} variant. */ + HTTP("http"), + /** The {@code sse} variant. */ + SSE("sse"), + /** The {@code memory} variant. */ + MEMORY("memory"); + + private final String value; + McpServerTransport(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpServerTransport fromValue(String value) { + for (McpServerTransport v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpServerTransport value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/McpServersLoadedServer.java b/src/generated/java/com/github/copilot/generated/McpServersLoadedServer.java new file mode 100644 index 0000000000..9c5d520813 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/McpServersLoadedServer.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Schema for the `McpServersLoadedServer` type. + * + * @since 1.0.0 + */ +@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") 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, + /** Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) */ + @JsonProperty("transport") McpServerTransport transport, + /** Name of the plugin that supplied the effective MCP server config, only when source is plugin */ + @JsonProperty("pluginName") String pluginName, + /** Version of the plugin that supplied the effective MCP server config, only when source is plugin */ + @JsonProperty("pluginVersion") String pluginVersion +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServerStatus.java b/src/generated/java/com/github/copilot/generated/McpServersLoadedServerStatus.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServerStatus.java rename to src/generated/java/com/github/copilot/generated/McpServersLoadedServerStatus.java index 4d09fe2a38..af3c97840f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/McpServersLoadedServerStatus.java +++ b/src/generated/java/com/github/copilot/generated/McpServersLoadedServerStatus.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/ModelCallFailureEvent.java b/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/ModelCallFailureEvent.java rename to src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java index 939e49ef55..8a516065b6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ModelCallFailureEvent.java +++ b/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code model.call_failure} session event. + * Session event "model.call_failure". Failed LLM API call metadata for telemetry * * @since 1.0.0 */ @@ -43,10 +43,12 @@ public record ModelCallFailureEventData( @JsonProperty("apiCallId") String apiCallId, /** GitHub request tracing ID (x-github-request-id header) for server-side log correlation */ @JsonProperty("providerCallId") String providerCallId, + /** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */ + @JsonProperty("serviceRequestId") String serviceRequestId, /** HTTP status code from the failed request */ @JsonProperty("statusCode") Long statusCode, /** Duration of the failed API call in milliseconds */ - @JsonProperty("durationMs") Double durationMs, + @JsonProperty("durationMs") Long durationMs, /** Where the failed model call originated */ @JsonProperty("source") ModelCallFailureSource source, /** Raw provider/runtime error message for restricted telemetry */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ModelCallFailureSource.java b/src/generated/java/com/github/copilot/generated/ModelCallFailureSource.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/ModelCallFailureSource.java rename to src/generated/java/com/github/copilot/generated/ModelCallFailureSource.java index 469adaab43..747112c3db 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ModelCallFailureSource.java +++ b/src/generated/java/com/github/copilot/generated/ModelCallFailureSource.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/PendingMessagesModifiedEvent.java b/src/generated/java/com/github/copilot/generated/PendingMessagesModifiedEvent.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/PendingMessagesModifiedEvent.java rename to src/generated/java/com/github/copilot/generated/PendingMessagesModifiedEvent.java index 56f8ed520e..2b7fecee0f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/PendingMessagesModifiedEvent.java +++ b/src/generated/java/com/github/copilot/generated/PendingMessagesModifiedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code pending_messages.modified} session event. + * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java b/src/generated/java/com/github/copilot/generated/PermissionCompletedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/PermissionCompletedEvent.java index 0b8da105e2..e389863d3d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/PermissionCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code permission.completed} session event. + * Session event "permission.completed". Permission request completion notification signaling UI dismissal * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedKind.java b/src/generated/java/com/github/copilot/generated/PermissionCompletedKind.java similarity index 98% rename from src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedKind.java rename to src/generated/java/com/github/copilot/generated/PermissionCompletedKind.java index c02f221fd5..61c770b65f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedKind.java +++ b/src/generated/java/com/github/copilot/generated/PermissionCompletedKind.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedResult.java b/src/generated/java/com/github/copilot/generated/PermissionCompletedResult.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedResult.java rename to src/generated/java/com/github/copilot/generated/PermissionCompletedResult.java index 4a180001ca..1beb805239 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/PermissionCompletedResult.java +++ b/src/generated/java/com/github/copilot/generated/PermissionCompletedResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java b/src/generated/java/com/github/copilot/generated/PermissionRequestedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java rename to src/generated/java/com/github/copilot/generated/PermissionRequestedEvent.java index 7892d3afe5..2d79880622 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/PermissionRequestedEvent.java +++ b/src/generated/java/com/github/copilot/generated/PermissionRequestedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code permission.requested} session event. + * Session event "permission.requested". Permission request notification requiring client approval with request details * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/PlanChangedOperation.java b/src/generated/java/com/github/copilot/generated/PlanChangedOperation.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/PlanChangedOperation.java rename to src/generated/java/com/github/copilot/generated/PlanChangedOperation.java index cd52d7ec1a..35d4fece4f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/PlanChangedOperation.java +++ b/src/generated/java/com/github/copilot/generated/PlanChangedOperation.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/generated/ReasoningSummary.java b/src/generated/java/com/github/copilot/generated/ReasoningSummary.java new file mode 100644 index 0000000000..a2b6d3e02d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ReasoningSummary.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.generated; + +import javax.annotation.processing.Generated; + +/** + * Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed") + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ReasoningSummary { + /** The {@code none} variant. */ + NONE("none"), + /** The {@code concise} variant. */ + CONCISE("concise"), + /** The {@code detailed} variant. */ + DETAILED("detailed"); + + private final String value; + ReasoningSummary(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ReasoningSummary fromValue(String value) { + for (ReasoningSummary v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ReasoningSummary value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SamplingCompletedEvent.java b/src/generated/java/com/github/copilot/generated/SamplingCompletedEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/SamplingCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/SamplingCompletedEvent.java index ae21575094..0cf0e9daa2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SamplingCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SamplingCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code sampling.completed} session event. + * Session event "sampling.completed". Sampling request completion notification signaling UI dismissal * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SamplingRequestedEvent.java b/src/generated/java/com/github/copilot/generated/SamplingRequestedEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/SamplingRequestedEvent.java rename to src/generated/java/com/github/copilot/generated/SamplingRequestedEvent.java index 7b92f5fafe..1982f552cc 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SamplingRequestedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SamplingRequestedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code sampling.requested} session event. + * Session event "sampling.requested". Sampling request from an MCP server; contains the server name and a requestId for correlation * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/SessionAutopilotObjectiveChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionAutopilotObjectiveChangedEvent.java new file mode 100644 index 0000000000..62f49184c5 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/SessionAutopilotObjectiveChangedEvent.java @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.autopilot_objective_changed". Autopilot objective state file operation details indicating what changed + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionAutopilotObjectiveChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.autopilot_objective_changed"; } + + @JsonProperty("data") + private SessionAutopilotObjectiveChangedEventData data; + + public SessionAutopilotObjectiveChangedEventData getData() { return data; } + public void setData(SessionAutopilotObjectiveChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionAutopilotObjectiveChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAutopilotObjectiveChangedEventData( + /** The type of operation performed on the autopilot objective state file */ + @JsonProperty("operation") AutopilotObjectiveChangedOperation operation, + /** Current autopilot objective id, if one exists */ + @JsonProperty("id") Long id, + /** Current autopilot objective status, if one exists */ + @JsonProperty("status") AutopilotObjectiveChangedStatus status + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionBackgroundTasksChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionBackgroundTasksChangedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/SessionBackgroundTasksChangedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionBackgroundTasksChangedEvent.java index fa996cf0e3..2a712ae49a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionBackgroundTasksChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionBackgroundTasksChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.background_tasks_changed} session event. + * Session event "session.background_tasks_changed". * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/SessionCanvasOpenedEvent.java b/src/generated/java/com/github/copilot/generated/SessionCanvasOpenedEvent.java new file mode 100644 index 0000000000..ea32bd4799 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/SessionCanvasOpenedEvent.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.canvas.opened". + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCanvasOpenedEvent extends SessionEvent { + + @Override + public String getType() { return "session.canvas.opened"; } + + @JsonProperty("data") + private SessionCanvasOpenedEventData data; + + public SessionCanvasOpenedEventData getData() { return data; } + public void setData(SessionCanvasOpenedEventData data) { this.data = data; } + + /** Data payload for {@link SessionCanvasOpenedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCanvasOpenedEventData( + /** Stable caller-supplied canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Owning extension display name, when available */ + @JsonProperty("extensionName") String extensionName, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Rendered title */ + @JsonProperty("title") String title, + /** Provider-supplied status text */ + @JsonProperty("status") String status, + /** URL for web-rendered canvases */ + @JsonProperty("url") String url, + /** Input supplied when the instance was opened */ + @JsonProperty("input") Object input, + /** Whether this notification represents an idempotent reopen */ + @JsonProperty("reopen") Boolean reopen, + /** Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. */ + @JsonProperty("availability") CanvasOpenedAvailability availability + ) { + } +} diff --git a/src/generated/java/com/github/copilot/generated/SessionCanvasRegistryChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionCanvasRegistryChangedEvent.java new file mode 100644 index 0000000000..4fb2a034b5 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/SessionCanvasRegistryChangedEvent.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.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; + +/** + * Session event "session.canvas.registry_changed". + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCanvasRegistryChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.canvas.registry_changed"; } + + @JsonProperty("data") + private SessionCanvasRegistryChangedEventData data; + + public SessionCanvasRegistryChangedEventData getData() { return data; } + public void setData(SessionCanvasRegistryChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionCanvasRegistryChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCanvasRegistryChangedEventData( + /** Canvas declarations currently available */ + @JsonProperty("canvases") List canvases + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java b/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java similarity index 69% rename from src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java rename to src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java index 5f37980987..d64979195d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionCompleteEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.compaction_complete} session event. + * Session event "session.compaction_complete". Conversation compaction results including success status, metrics, and optional error details * * @since 1.0.0 */ @@ -40,31 +40,35 @@ public record SessionCompactionCompleteEventData( /** Error message if compaction failed */ @JsonProperty("error") String error, /** Total tokens in conversation before compaction */ - @JsonProperty("preCompactionTokens") Double preCompactionTokens, + @JsonProperty("preCompactionTokens") Long preCompactionTokens, /** Total tokens in conversation after compaction */ - @JsonProperty("postCompactionTokens") Double postCompactionTokens, + @JsonProperty("postCompactionTokens") Long postCompactionTokens, /** Number of messages before compaction */ - @JsonProperty("preCompactionMessagesLength") Double preCompactionMessagesLength, + @JsonProperty("preCompactionMessagesLength") Long preCompactionMessagesLength, /** Number of messages removed during compaction */ - @JsonProperty("messagesRemoved") Double messagesRemoved, + @JsonProperty("messagesRemoved") Long messagesRemoved, /** Number of tokens removed during compaction */ - @JsonProperty("tokensRemoved") Double tokensRemoved, + @JsonProperty("tokensRemoved") Long tokensRemoved, + /** User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text. */ + @JsonProperty("customInstructions") String customInstructions, /** LLM-generated summary of the compacted conversation history */ @JsonProperty("summaryContent") String summaryContent, /** Checkpoint snapshot number created for recovery */ - @JsonProperty("checkpointNumber") Double checkpointNumber, + @JsonProperty("checkpointNumber") Long checkpointNumber, /** File path where the checkpoint was stored */ @JsonProperty("checkpointPath") String checkpointPath, /** 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, + /** Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call */ + @JsonProperty("serviceRequestId") String serviceRequestId, /** Token count from system message(s) after compaction */ - @JsonProperty("systemTokens") Double systemTokens, + @JsonProperty("systemTokens") Long systemTokens, /** Token count from non-system messages (user, assistant, tool) after compaction */ - @JsonProperty("conversationTokens") Double conversationTokens, + @JsonProperty("conversationTokens") Long conversationTokens, /** Token count from tool definitions after compaction */ - @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens + @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionStartEvent.java b/src/generated/java/com/github/copilot/generated/SessionCompactionStartEvent.java similarity index 81% rename from src/generated/java/com/github/copilot/sdk/generated/SessionCompactionStartEvent.java rename to src/generated/java/com/github/copilot/generated/SessionCompactionStartEvent.java index 2e0fb6d6f4..90fcd76b62 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionCompactionStartEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionCompactionStartEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.compaction_start} session event. + * Session event "session.compaction_start". Context window breakdown at the start of LLM-powered conversation compaction * * @since 1.0.0 */ @@ -36,11 +36,11 @@ public final class SessionCompactionStartEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionCompactionStartEventData( /** Token count from system message(s) at compaction start */ - @JsonProperty("systemTokens") Double systemTokens, + @JsonProperty("systemTokens") Long systemTokens, /** Token count from non-system messages (user, assistant, tool) at compaction start */ - @JsonProperty("conversationTokens") Double conversationTokens, + @JsonProperty("conversationTokens") Long conversationTokens, /** Token count from tool definitions at compaction start */ - @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens + @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionContextChangedEvent.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionContextChangedEvent.java index 0eb9e7e34b..1fc5ef0eaf 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionContextChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionContextChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.context_changed} session event. + * Session event "session.context_changed". Updated working directory and git context after the change * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionCustomAgentsUpdatedEvent.java b/src/generated/java/com/github/copilot/generated/SessionCustomAgentsUpdatedEvent.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/SessionCustomAgentsUpdatedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionCustomAgentsUpdatedEvent.java index be5e15e91a..9ceed8c658 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionCustomAgentsUpdatedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionCustomAgentsUpdatedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.custom_agents_updated} session event. + * Session event "session.custom_agents_updated". * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionCustomNotificationEvent.java b/src/generated/java/com/github/copilot/generated/SessionCustomNotificationEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/SessionCustomNotificationEvent.java rename to src/generated/java/com/github/copilot/generated/SessionCustomNotificationEvent.java index 8d3e3b68ac..499d143d4c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionCustomNotificationEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionCustomNotificationEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.custom_notification} session event. + * Session event "session.custom_notification". Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionErrorEvent.java b/src/generated/java/com/github/copilot/generated/SessionErrorEvent.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/SessionErrorEvent.java rename to src/generated/java/com/github/copilot/generated/SessionErrorEvent.java index 5c174c4357..12fa20ac19 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionErrorEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionErrorEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.error} session event. + * Session event "session.error". Error details for timeline display including message and optional diagnostic information * * @since 1.0.0 */ @@ -49,6 +49,8 @@ public record SessionErrorEventData( @JsonProperty("statusCode") Long statusCode, /** GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs */ @JsonProperty("providerCallId") String providerCallId, + /** Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation */ + @JsonProperty("serviceRequestId") String serviceRequestId, /** Optional URL associated with this error that the user can open in a browser */ @JsonProperty("url") String url ) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java b/src/generated/java/com/github/copilot/generated/SessionEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java rename to src/generated/java/com/github/copilot/generated/SessionEvent.java index 2181be1972..570fe3a9ee 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -33,10 +33,12 @@ @JsonSubTypes.Type(value = SessionTitleChangedEvent.class, name = "session.title_changed"), @JsonSubTypes.Type(value = SessionScheduleCreatedEvent.class, name = "session.schedule_created"), @JsonSubTypes.Type(value = SessionScheduleCancelledEvent.class, name = "session.schedule_cancelled"), + @JsonSubTypes.Type(value = SessionAutopilotObjectiveChangedEvent.class, name = "session.autopilot_objective_changed"), @JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"), @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), @JsonSubTypes.Type(value = SessionModelChangeEvent.class, name = "session.model_change"), @JsonSubTypes.Type(value = SessionModeChangedEvent.class, name = "session.mode_changed"), + @JsonSubTypes.Type(value = SessionPermissionsChangedEvent.class, name = "session.permissions_changed"), @JsonSubTypes.Type(value = SessionPlanChangedEvent.class, name = "session.plan_changed"), @JsonSubTypes.Type(value = SessionWorkspaceFileChangedEvent.class, name = "session.workspace_file_changed"), @JsonSubTypes.Type(value = SessionHandoffEvent.class, name = "session.handoff"), @@ -75,6 +77,7 @@ @JsonSubTypes.Type(value = SubagentDeselectedEvent.class, name = "subagent.deselected"), @JsonSubTypes.Type(value = HookStartEvent.class, name = "hook.start"), @JsonSubTypes.Type(value = HookEndEvent.class, name = "hook.end"), + @JsonSubTypes.Type(value = HookProgressEvent.class, name = "hook.progress"), @JsonSubTypes.Type(value = SystemMessageEvent.class, name = "system.message"), @JsonSubTypes.Type(value = SystemNotificationEvent.class, name = "system.notification"), @JsonSubTypes.Type(value = PermissionRequestedEvent.class, name = "permission.requested"), @@ -105,7 +108,10 @@ @JsonSubTypes.Type(value = SessionCustomAgentsUpdatedEvent.class, name = "session.custom_agents_updated"), @JsonSubTypes.Type(value = SessionMcpServersLoadedEvent.class, name = "session.mcp_servers_loaded"), @JsonSubTypes.Type(value = SessionMcpServerStatusChangedEvent.class, name = "session.mcp_server_status_changed"), - @JsonSubTypes.Type(value = SessionExtensionsLoadedEvent.class, name = "session.extensions_loaded") + @JsonSubTypes.Type(value = SessionExtensionsLoadedEvent.class, name = "session.extensions_loaded"), + @JsonSubTypes.Type(value = SessionCanvasOpenedEvent.class, name = "session.canvas.opened"), + @JsonSubTypes.Type(value = SessionCanvasRegistryChangedEvent.class, name = "session.canvas.registry_changed"), + @JsonSubTypes.Type(value = McpAppToolCallCompleteEvent.class, name = "mcp_app.tool_call_complete") }) @javax.annotation.processing.Generated("copilot-sdk-codegen") public abstract sealed class SessionEvent permits @@ -117,10 +123,12 @@ public abstract sealed class SessionEvent permits SessionTitleChangedEvent, SessionScheduleCreatedEvent, SessionScheduleCancelledEvent, + SessionAutopilotObjectiveChangedEvent, SessionInfoEvent, SessionWarningEvent, SessionModelChangeEvent, SessionModeChangedEvent, + SessionPermissionsChangedEvent, SessionPlanChangedEvent, SessionWorkspaceFileChangedEvent, SessionHandoffEvent, @@ -159,6 +167,7 @@ public abstract sealed class SessionEvent permits SubagentDeselectedEvent, HookStartEvent, HookEndEvent, + HookProgressEvent, SystemMessageEvent, SystemNotificationEvent, PermissionRequestedEvent, @@ -190,6 +199,9 @@ public abstract sealed class SessionEvent permits SessionMcpServersLoadedEvent, SessionMcpServerStatusChangedEvent, SessionExtensionsLoadedEvent, + SessionCanvasOpenedEvent, + SessionCanvasRegistryChangedEvent, + McpAppToolCallCompleteEvent, UnknownSessionEvent { /** Unique event identifier (UUID v4), generated when the event is emitted. */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java b/src/generated/java/com/github/copilot/generated/SessionExtensionsLoadedEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionExtensionsLoadedEvent.java index 4d3420174e..0165be5d29 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionExtensionsLoadedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionExtensionsLoadedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.extensions_loaded} session event. + * Session event "session.extensions_loaded". * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionHandoffEvent.java b/src/generated/java/com/github/copilot/generated/SessionHandoffEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/SessionHandoffEvent.java rename to src/generated/java/com/github/copilot/generated/SessionHandoffEvent.java index 86706272f5..7edba44c09 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionHandoffEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionHandoffEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.handoff} session event. + * Session event "session.handoff". Session handoff metadata including source, context, and repository information * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionIdleEvent.java b/src/generated/java/com/github/copilot/generated/SessionIdleEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/SessionIdleEvent.java rename to src/generated/java/com/github/copilot/generated/SessionIdleEvent.java index 86376ae7c1..dc7136c20b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionIdleEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionIdleEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.idle} session event. + * Session event "session.idle". Payload indicating the session is idle with no background agents in flight * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionInfoEvent.java b/src/generated/java/com/github/copilot/generated/SessionInfoEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/SessionInfoEvent.java rename to src/generated/java/com/github/copilot/generated/SessionInfoEvent.java index 01c1e0efbe..2d9ac36905 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionInfoEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionInfoEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.info} session event. + * Session event "session.info". Informational message for timeline display with categorization * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionMcpServerStatusChangedEvent.java similarity index 80% rename from src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionMcpServerStatusChangedEvent.java index c422bf29a9..1567a2f35e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServerStatusChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionMcpServerStatusChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.mcp_server_status_changed} session event. + * Session event "session.mcp_server_status_changed". * * @since 1.0.0 */ @@ -37,8 +37,10 @@ public final class SessionMcpServerStatusChangedEvent extends SessionEvent { 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") McpServerStatusChangedStatus status + /** Connection status: connected, failed, needs-auth, pending, disabled, or not_configured */ + @JsonProperty("status") McpServerStatus status, + /** Error message if the server entered a failed state */ + @JsonProperty("error") String error ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServersLoadedEvent.java b/src/generated/java/com/github/copilot/generated/SessionMcpServersLoadedEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/SessionMcpServersLoadedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionMcpServersLoadedEvent.java index be2d4cf744..d978755131 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionMcpServersLoadedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionMcpServersLoadedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.mcp_servers_loaded} session event. + * Session event "session.mcp_servers_loaded". * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/SessionMode.java b/src/generated/java/com/github/copilot/generated/SessionMode.java new file mode 100644 index 0000000000..ba579b306a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/SessionMode.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.generated; + +import javax.annotation.processing.Generated; + +/** + * The session mode the agent is operating in + * + * @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/SessionModeChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionModeChangedEvent.java similarity index 77% rename from src/generated/java/com/github/copilot/sdk/generated/SessionModeChangedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionModeChangedEvent.java index 82ae9ff39c..28fb3e9e47 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionModeChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionModeChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.mode_changed} session event. + * Session event "session.mode_changed". Agent mode change details including previous and new modes * * @since 1.0.0 */ @@ -35,10 +35,10 @@ public final class SessionModeChangedEvent extends SessionEvent { @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionModeChangedEventData( - /** Agent mode before the change (e.g., "interactive", "plan", "autopilot") */ - @JsonProperty("previousMode") String previousMode, - /** Agent mode after the change (e.g., "interactive", "plan", "autopilot") */ - @JsonProperty("newMode") String newMode + /** The session mode the agent is operating in */ + @JsonProperty("previousMode") SessionMode previousMode, + /** The session mode the agent is operating in */ + @JsonProperty("newMode") SessionMode newMode ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionModelChangeEvent.java b/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java similarity index 57% rename from src/generated/java/com/github/copilot/sdk/generated/SessionModelChangeEvent.java rename to src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java index 812cff0e81..e0d8785b96 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionModelChangeEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.model_change} session event. + * Session event "session.model_change". Model change details including previous and new model identifiers * * @since 1.0.0 */ @@ -43,8 +43,33 @@ public record SessionModelChangeEventData( @JsonProperty("previousReasoningEffort") String previousReasoningEffort, /** Reasoning effort level after the model change, if applicable */ @JsonProperty("reasoningEffort") String reasoningEffort, + /** Reasoning summary mode before the model change, if applicable */ + @JsonProperty("previousReasoningSummary") ReasoningSummary previousReasoningSummary, + /** Reasoning summary mode after the model change, if applicable */ + @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, + /** Context tier after the model change; null explicitly clears a previously selected tier */ + @JsonProperty("contextTier") SessionModelChangeEventDataContextTier contextTier, /** Reason the change happened, when not user-initiated. Currently `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy. */ @JsonProperty("cause") String cause ) { + + public enum SessionModelChangeEventDataContextTier { + /** The {@code default} variant. */ + DEFAULT("default"), + /** The {@code long_context} variant. */ + LONG_CONTEXT("long_context"); + + private final String value; + SessionModelChangeEventDataContextTier(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionModelChangeEventDataContextTier fromValue(String value) { + for (SessionModelChangeEventDataContextTier v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionModelChangeEventDataContextTier value: " + value); + } + } } } diff --git a/src/generated/java/com/github/copilot/generated/SessionPermissionsChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionPermissionsChangedEvent.java new file mode 100644 index 0000000000..91ac1d3c8d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/SessionPermissionsChangedEvent.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.permissions_changed". Permissions change details carrying the aggregate allow-all boolean transition. + * + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionPermissionsChangedEvent extends SessionEvent { + + @Override + public String getType() { return "session.permissions_changed"; } + + @JsonProperty("data") + private SessionPermissionsChangedEventData data; + + public SessionPermissionsChangedEventData getData() { return data; } + public void setData(SessionPermissionsChangedEventData data) { this.data = data; } + + /** Data payload for {@link SessionPermissionsChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionPermissionsChangedEventData( + /** Aggregate allow-all flag before the change */ + @JsonProperty("previousAllowAllPermissions") Boolean previousAllowAllPermissions, + /** Aggregate allow-all flag after the change */ + @JsonProperty("allowAllPermissions") Boolean allowAllPermissions + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionPlanChangedEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionPlanChangedEvent.java index 4677d1cdb3..cf9f4706d0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionPlanChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionPlanChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.plan_changed} session event. + * Session event "session.plan_changed". Plan file operation details indicating what changed * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionRemoteSteerableChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionRemoteSteerableChangedEvent.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/SessionRemoteSteerableChangedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionRemoteSteerableChangedEvent.java index ba752f4c62..adcc3aeb7b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionRemoteSteerableChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionRemoteSteerableChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.remote_steerable_changed} session event. + * Session event "session.remote_steerable_changed". Notifies that the session's remote steering capability has changed * * @since 1.0.0 */ @@ -35,7 +35,7 @@ public final class SessionRemoteSteerableChangedEvent extends SessionEvent { @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionRemoteSteerableChangedEventData( - /** Whether this session now supports remote steering via Mission Control */ + /** Whether this session now supports remote steering via GitHub */ @JsonProperty("remoteSteerable") Boolean remoteSteerable ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java b/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java similarity index 85% rename from src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java rename to src/generated/java/com/github/copilot/generated/SessionResumeEvent.java index 31bd3b4c36..e27cc2045a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionResumeEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionResumeEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.resume} session event. + * Session event "session.resume". Session resume metadata including current context and event count * * @since 1.0.0 */ @@ -39,18 +39,20 @@ public record SessionResumeEventData( /** ISO 8601 timestamp when the session was resumed */ @JsonProperty("resumeTime") OffsetDateTime resumeTime, /** Total number of persisted events in the session at the time of resume */ - @JsonProperty("eventCount") Double eventCount, + @JsonProperty("eventCount") Long eventCount, /** Model currently selected at resume time */ @JsonProperty("selectedModel") String selectedModel, - /** Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh") */ + /** Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") */ @JsonProperty("reasoningEffort") String reasoningEffort, + /** Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed") */ + @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, /** Updated working directory and git context at resume time */ @JsonProperty("context") WorkingDirectoryContext context, /** Whether the session was already in use by another client at resume time */ @JsonProperty("alreadyInUse") Boolean alreadyInUse, /** True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. */ @JsonProperty("sessionWasActive") Boolean sessionWasActive, - /** Whether this session supports remote steering via Mission Control */ + /** Whether this session supports remote steering via GitHub */ @JsonProperty("remoteSteerable") Boolean remoteSteerable, /** When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume. */ @JsonProperty("continuePendingWork") Boolean continuePendingWork diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionScheduleCancelledEvent.java b/src/generated/java/com/github/copilot/generated/SessionScheduleCancelledEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/SessionScheduleCancelledEvent.java rename to src/generated/java/com/github/copilot/generated/SessionScheduleCancelledEvent.java index 01cd6e4619..51aba5d4c9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionScheduleCancelledEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionScheduleCancelledEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.schedule_cancelled} session event. + * Session event "session.schedule_cancelled". Scheduled prompt cancelled from the schedule manager dialog * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionScheduleCreatedEvent.java b/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java similarity index 81% rename from src/generated/java/com/github/copilot/sdk/generated/SessionScheduleCreatedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java index bf0be67caf..2a9cbdeb45 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionScheduleCreatedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.schedule_created} session event. + * Session event "session.schedule_created". Scheduled prompt registered via /every or /after * * @since 1.0.0 */ @@ -42,7 +42,9 @@ public record SessionScheduleCreatedEventData( /** Prompt text that gets enqueued on every tick */ @JsonProperty("prompt") String prompt, /** Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) */ - @JsonProperty("recurring") Boolean recurring + @JsonProperty("recurring") Boolean recurring, + /** Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion) */ + @JsonProperty("displayPrompt") String displayPrompt ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionShutdownEvent.java b/src/generated/java/com/github/copilot/generated/SessionShutdownEvent.java similarity index 83% rename from src/generated/java/com/github/copilot/sdk/generated/SessionShutdownEvent.java rename to src/generated/java/com/github/copilot/generated/SessionShutdownEvent.java index 97d5060d32..03ad8e0275 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionShutdownEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionShutdownEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.shutdown} session event. + * Session event "session.shutdown". Session termination metrics including usage statistics, code changes, and shutdown reason * * @since 1.0.0 */ @@ -47,9 +47,9 @@ public record SessionShutdownEventData( /** Session-wide per-token-type accumulated token counts */ @JsonProperty("tokenDetails") Map tokenDetails, /** Cumulative time spent in API calls during the session, in milliseconds */ - @JsonProperty("totalApiDurationMs") Double totalApiDurationMs, + @JsonProperty("totalApiDurationMs") Long totalApiDurationMs, /** Unix timestamp (milliseconds) when the session started */ - @JsonProperty("sessionStartTime") Double sessionStartTime, + @JsonProperty("sessionStartTime") Long sessionStartTime, /** Aggregate code change metrics for the session */ @JsonProperty("codeChanges") ShutdownCodeChanges codeChanges, /** Per-model usage breakdown, keyed by model identifier */ @@ -57,13 +57,13 @@ public record SessionShutdownEventData( /** Model that was selected at the time of shutdown */ @JsonProperty("currentModel") String currentModel, /** Total tokens in context window at shutdown */ - @JsonProperty("currentTokens") Double currentTokens, + @JsonProperty("currentTokens") Long currentTokens, /** System message token count at shutdown */ - @JsonProperty("systemTokens") Double systemTokens, + @JsonProperty("systemTokens") Long systemTokens, /** Non-system message token count at shutdown */ - @JsonProperty("conversationTokens") Double conversationTokens, + @JsonProperty("conversationTokens") Long conversationTokens, /** Tool definitions token count at shutdown */ - @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens + @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionSkillsLoadedEvent.java b/src/generated/java/com/github/copilot/generated/SessionSkillsLoadedEvent.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/SessionSkillsLoadedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionSkillsLoadedEvent.java index b5e64465df..f041184355 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionSkillsLoadedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionSkillsLoadedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.skills_loaded} session event. + * Session event "session.skills_loaded". * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionSnapshotRewindEvent.java b/src/generated/java/com/github/copilot/generated/SessionSnapshotRewindEvent.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/SessionSnapshotRewindEvent.java rename to src/generated/java/com/github/copilot/generated/SessionSnapshotRewindEvent.java index 8842827fbc..9c7e8765bb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionSnapshotRewindEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionSnapshotRewindEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.snapshot_rewind} session event. + * Session event "session.snapshot_rewind". Session rewind details including target event and count of removed events * * @since 1.0.0 */ @@ -38,7 +38,7 @@ public record SessionSnapshotRewindEventData( /** Event ID that was rewound to; this event and all after it were removed */ @JsonProperty("upToEventId") String upToEventId, /** Number of events that were removed by the rewind */ - @JsonProperty("eventsRemoved") Double eventsRemoved + @JsonProperty("eventsRemoved") Long eventsRemoved ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java b/src/generated/java/com/github/copilot/generated/SessionStartEvent.java similarity index 84% rename from src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java rename to src/generated/java/com/github/copilot/generated/SessionStartEvent.java index f5d6378fcd..0bb4b800fc 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionStartEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionStartEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.start} session event. + * Session event "session.start". Session initialization metadata including context and configuration * * @since 1.0.0 */ @@ -39,7 +39,7 @@ public record SessionStartEventData( /** Unique identifier for the session */ @JsonProperty("sessionId") String sessionId, /** Schema version number for the session event format */ - @JsonProperty("version") Double version, + @JsonProperty("version") Long version, /** Identifier of the software producing the events (e.g., "copilot-agent") */ @JsonProperty("producer") String producer, /** Version string of the Copilot application */ @@ -48,13 +48,15 @@ public record SessionStartEventData( @JsonProperty("startTime") OffsetDateTime startTime, /** Model selected at session creation time, if any */ @JsonProperty("selectedModel") String selectedModel, - /** Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh") */ + /** Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") */ @JsonProperty("reasoningEffort") String reasoningEffort, + /** Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed") */ + @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, /** Working directory and git context at session start */ @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 */ + /** Whether this session supports remote steering via GitHub */ @JsonProperty("remoteSteerable") Boolean remoteSteerable, /** When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id. */ @JsonProperty("detachedFromSpawningParentSessionId") String detachedFromSpawningParentSessionId diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionTaskCompleteEvent.java b/src/generated/java/com/github/copilot/generated/SessionTaskCompleteEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/SessionTaskCompleteEvent.java rename to src/generated/java/com/github/copilot/generated/SessionTaskCompleteEvent.java index 1af7e699bf..097f59c97c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionTaskCompleteEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionTaskCompleteEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.task_complete} session event. + * Session event "session.task_complete". Task completion notification with summary from the agent * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionTitleChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionTitleChangedEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/SessionTitleChangedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionTitleChangedEvent.java index 3093301883..e835e8ae52 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionTitleChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionTitleChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.title_changed} session event. + * Session event "session.title_changed". Session title change payload containing the new display title * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionToolsUpdatedEvent.java b/src/generated/java/com/github/copilot/generated/SessionToolsUpdatedEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/SessionToolsUpdatedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionToolsUpdatedEvent.java index a3b5313cf7..1d80e5b608 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionToolsUpdatedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionToolsUpdatedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.tools_updated} session event. + * Session event "session.tools_updated". * * @since 1.0.0 */ @@ -35,6 +35,7 @@ public final class SessionToolsUpdatedEvent extends SessionEvent { @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionToolsUpdatedEventData( + /** Identifier of the model the resolved tools apply to. */ @JsonProperty("model") String model ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionTruncationEvent.java b/src/generated/java/com/github/copilot/generated/SessionTruncationEvent.java similarity index 72% rename from src/generated/java/com/github/copilot/sdk/generated/SessionTruncationEvent.java rename to src/generated/java/com/github/copilot/generated/SessionTruncationEvent.java index 103d1d0173..0a96601b6f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionTruncationEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionTruncationEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.truncation} session event. + * Session event "session.truncation". Conversation truncation statistics including token counts and removed content metrics * * @since 1.0.0 */ @@ -36,19 +36,19 @@ public final class SessionTruncationEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionTruncationEventData( /** Maximum token count for the model's context window */ - @JsonProperty("tokenLimit") Double tokenLimit, + @JsonProperty("tokenLimit") Long tokenLimit, /** Total tokens in conversation messages before truncation */ - @JsonProperty("preTruncationTokensInMessages") Double preTruncationTokensInMessages, + @JsonProperty("preTruncationTokensInMessages") Long preTruncationTokensInMessages, /** Number of conversation messages before truncation */ - @JsonProperty("preTruncationMessagesLength") Double preTruncationMessagesLength, + @JsonProperty("preTruncationMessagesLength") Long preTruncationMessagesLength, /** Total tokens in conversation messages after truncation */ - @JsonProperty("postTruncationTokensInMessages") Double postTruncationTokensInMessages, + @JsonProperty("postTruncationTokensInMessages") Long postTruncationTokensInMessages, /** Number of conversation messages after truncation */ - @JsonProperty("postTruncationMessagesLength") Double postTruncationMessagesLength, + @JsonProperty("postTruncationMessagesLength") Long postTruncationMessagesLength, /** Number of tokens removed by truncation */ - @JsonProperty("tokensRemovedDuringTruncation") Double tokensRemovedDuringTruncation, + @JsonProperty("tokensRemovedDuringTruncation") Long tokensRemovedDuringTruncation, /** Number of messages removed by truncation */ - @JsonProperty("messagesRemovedDuringTruncation") Double messagesRemovedDuringTruncation, + @JsonProperty("messagesRemovedDuringTruncation") Long messagesRemovedDuringTruncation, /** Identifier of the component that performed truncation (e.g., "BasicTruncator") */ @JsonProperty("performedBy") String performedBy ) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionUsageInfoEvent.java b/src/generated/java/com/github/copilot/generated/SessionUsageInfoEvent.java similarity index 77% rename from src/generated/java/com/github/copilot/sdk/generated/SessionUsageInfoEvent.java rename to src/generated/java/com/github/copilot/generated/SessionUsageInfoEvent.java index f83c360246..70ecfe01a5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionUsageInfoEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionUsageInfoEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.usage_info} session event. + * Session event "session.usage_info". Current context window usage statistics including token and message counts * * @since 1.0.0 */ @@ -36,17 +36,17 @@ public final class SessionUsageInfoEvent extends SessionEvent { @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionUsageInfoEventData( /** Maximum token count for the model's context window */ - @JsonProperty("tokenLimit") Double tokenLimit, + @JsonProperty("tokenLimit") Long tokenLimit, /** Current number of tokens in the context window */ - @JsonProperty("currentTokens") Double currentTokens, + @JsonProperty("currentTokens") Long currentTokens, /** Current number of messages in the conversation */ - @JsonProperty("messagesLength") Double messagesLength, + @JsonProperty("messagesLength") Long messagesLength, /** Token count from system message(s) */ - @JsonProperty("systemTokens") Double systemTokens, + @JsonProperty("systemTokens") Long systemTokens, /** Token count from non-system messages (user, assistant, tool) */ - @JsonProperty("conversationTokens") Double conversationTokens, + @JsonProperty("conversationTokens") Long conversationTokens, /** Token count from tool definitions */ - @JsonProperty("toolDefinitionsTokens") Double toolDefinitionsTokens, + @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens, /** Whether this is the first usage_info event emitted in this session */ @JsonProperty("isInitial") Boolean isInitial ) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionWarningEvent.java b/src/generated/java/com/github/copilot/generated/SessionWarningEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/SessionWarningEvent.java rename to src/generated/java/com/github/copilot/generated/SessionWarningEvent.java index 1870a26e8a..42b2eb8df9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionWarningEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionWarningEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.warning} session event. + * Session event "session.warning". Warning message for timeline display with categorization * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java b/src/generated/java/com/github/copilot/generated/SessionWorkspaceFileChangedEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java rename to src/generated/java/com/github/copilot/generated/SessionWorkspaceFileChangedEvent.java index 9dedc7a5e3..85447d567f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SessionWorkspaceFileChangedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SessionWorkspaceFileChangedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code session.workspace_file_changed} session event. + * Session event "session.workspace_file_changed". Workspace file change details including path and operation type * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownCodeChanges.java b/src/generated/java/com/github/copilot/generated/ShutdownCodeChanges.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/ShutdownCodeChanges.java rename to src/generated/java/com/github/copilot/generated/ShutdownCodeChanges.java index 1afb58b69b..1ca80ad715 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ShutdownCodeChanges.java +++ b/src/generated/java/com/github/copilot/generated/ShutdownCodeChanges.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -23,9 +23,9 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record ShutdownCodeChanges( /** Total number of lines added during the session */ - @JsonProperty("linesAdded") Double linesAdded, + @JsonProperty("linesAdded") Long linesAdded, /** Total number of lines removed during the session */ - @JsonProperty("linesRemoved") Double linesRemoved, + @JsonProperty("linesRemoved") Long 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/generated/ShutdownModelMetric.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetric.java rename to src/generated/java/com/github/copilot/generated/ShutdownModelMetric.java index e7a831ca67..b7eb37fd90 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetric.java +++ b/src/generated/java/com/github/copilot/generated/ShutdownModelMetric.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,6 +13,11 @@ import java.util.Map; import javax.annotation.processing.Generated; +/** + * Schema for the `ShutdownModelMetric` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricRequests.java b/src/generated/java/com/github/copilot/generated/ShutdownModelMetricRequests.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricRequests.java rename to src/generated/java/com/github/copilot/generated/ShutdownModelMetricRequests.java index 1872a66038..ebc58271ee 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricRequests.java +++ b/src/generated/java/com/github/copilot/generated/ShutdownModelMetricRequests.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,7 +22,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record ShutdownModelMetricRequests( /** Total number of API requests made to this model */ - @JsonProperty("count") Double count, + @JsonProperty("count") Long count, /** Cumulative cost multiplier for requests to this model */ @JsonProperty("cost") Double cost ) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricTokenDetail.java b/src/generated/java/com/github/copilot/generated/ShutdownModelMetricTokenDetail.java similarity index 82% rename from src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricTokenDetail.java rename to src/generated/java/com/github/copilot/generated/ShutdownModelMetricTokenDetail.java index 9f7cde6301..fe18de6c69 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricTokenDetail.java +++ b/src/generated/java/com/github/copilot/generated/ShutdownModelMetricTokenDetail.java @@ -5,18 +5,23 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `ShutdownModelMetricTokenDetail` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record ShutdownModelMetricTokenDetail( /** Accumulated token count for this token type */ - @JsonProperty("tokenCount") Double tokenCount + @JsonProperty("tokenCount") Long tokenCount ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricUsage.java b/src/generated/java/com/github/copilot/generated/ShutdownModelMetricUsage.java similarity index 77% rename from src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricUsage.java rename to src/generated/java/com/github/copilot/generated/ShutdownModelMetricUsage.java index bd47eaeb53..09a61920db 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ShutdownModelMetricUsage.java +++ b/src/generated/java/com/github/copilot/generated/ShutdownModelMetricUsage.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,14 +22,14 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record ShutdownModelMetricUsage( /** Total input tokens consumed across all requests to this model */ - @JsonProperty("inputTokens") Double inputTokens, + @JsonProperty("inputTokens") Long inputTokens, /** Total output tokens produced across all requests to this model */ - @JsonProperty("outputTokens") Double outputTokens, + @JsonProperty("outputTokens") Long outputTokens, /** Total tokens read from prompt cache across all requests */ - @JsonProperty("cacheReadTokens") Double cacheReadTokens, + @JsonProperty("cacheReadTokens") Long cacheReadTokens, /** Total tokens written to prompt cache across all requests */ - @JsonProperty("cacheWriteTokens") Double cacheWriteTokens, + @JsonProperty("cacheWriteTokens") Long cacheWriteTokens, /** Total reasoning tokens produced across all requests to this model */ - @JsonProperty("reasoningTokens") Double reasoningTokens + @JsonProperty("reasoningTokens") Long reasoningTokens ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownTokenDetail.java b/src/generated/java/com/github/copilot/generated/ShutdownTokenDetail.java similarity index 83% rename from src/generated/java/com/github/copilot/sdk/generated/ShutdownTokenDetail.java rename to src/generated/java/com/github/copilot/generated/ShutdownTokenDetail.java index ec51804886..75db095c5f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ShutdownTokenDetail.java +++ b/src/generated/java/com/github/copilot/generated/ShutdownTokenDetail.java @@ -5,18 +5,23 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `ShutdownTokenDetail` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record ShutdownTokenDetail( /** Accumulated token count for this token type */ - @JsonProperty("tokenCount") Double tokenCount + @JsonProperty("tokenCount") Long tokenCount ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/ShutdownType.java b/src/generated/java/com/github/copilot/generated/ShutdownType.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/ShutdownType.java rename to src/generated/java/com/github/copilot/generated/ShutdownType.java index fbc627df8f..288d0835f5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ShutdownType.java +++ b/src/generated/java/com/github/copilot/generated/ShutdownType.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/SkillInvokedEvent.java b/src/generated/java/com/github/copilot/generated/SkillInvokedEvent.java similarity index 67% rename from src/generated/java/com/github/copilot/sdk/generated/SkillInvokedEvent.java rename to src/generated/java/com/github/copilot/generated/SkillInvokedEvent.java index e6c696eb0b..681ad3f0ac 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SkillInvokedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SkillInvokedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code skill.invoked} session event. + * Session event "skill.invoked". Skill invocation details including content, allowed tools, and plugin metadata * * @since 1.0.0 */ @@ -44,12 +44,16 @@ public record SkillInvokedEventData( @JsonProperty("content") String content, /** Tool names that should be auto-approved when this skill is active */ @JsonProperty("allowedTools") List allowedTools, + /** Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), personal-claude (~/.claude/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill) */ + @JsonProperty("source") String source, /** Name of the plugin this skill originated from, when applicable */ @JsonProperty("pluginName") String pluginName, /** Version of the plugin this skill originated from, when applicable */ @JsonProperty("pluginVersion") String pluginVersion, /** Description of the skill from its SKILL.md frontmatter */ - @JsonProperty("description") String description + @JsonProperty("description") String description, + /** What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) */ + @JsonProperty("trigger") SkillInvokedTrigger trigger ) { } } diff --git a/src/generated/java/com/github/copilot/generated/SkillInvokedTrigger.java b/src/generated/java/com/github/copilot/generated/SkillInvokedTrigger.java new file mode 100644 index 0000000000..50ce54f7c3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/SkillInvokedTrigger.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.generated; + +import javax.annotation.processing.Generated; + +/** + * What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SkillInvokedTrigger { + /** The {@code user-invoked} variant. */ + USER_INVOKED("user-invoked"), + /** The {@code agent-invoked} variant. */ + AGENT_INVOKED("agent-invoked"), + /** The {@code context-load} variant. */ + CONTEXT_LOAD("context-load"); + + private final String value; + SkillInvokedTrigger(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SkillInvokedTrigger fromValue(String value) { + for (SkillInvokedTrigger v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SkillInvokedTrigger value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/SkillSource.java b/src/generated/java/com/github/copilot/generated/SkillSource.java new file mode 100644 index 0000000000..b681faaae8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/SkillSource.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Source location type (e.g., project, personal-copilot, plugin, builtin) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SkillSource { + /** The {@code project} variant. */ + PROJECT("project"), + /** The {@code inherited} variant. */ + INHERITED("inherited"), + /** The {@code personal-copilot} variant. */ + PERSONAL_COPILOT("personal-copilot"), + /** The {@code personal-agents} variant. */ + PERSONAL_AGENTS("personal-agents"), + /** The {@code plugin} variant. */ + PLUGIN("plugin"), + /** The {@code custom} variant. */ + CUSTOM("custom"), + /** The {@code builtin} variant. */ + BUILTIN("builtin"); + + private final String value; + SkillSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SkillSource fromValue(String value) { + for (SkillSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SkillSource value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/SkillsLoadedSkill.java b/src/generated/java/com/github/copilot/generated/SkillsLoadedSkill.java similarity index 83% rename from src/generated/java/com/github/copilot/sdk/generated/SkillsLoadedSkill.java rename to src/generated/java/com/github/copilot/generated/SkillsLoadedSkill.java index 2183dad5c4..07ce97825e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SkillsLoadedSkill.java +++ b/src/generated/java/com/github/copilot/generated/SkillsLoadedSkill.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `SkillsLoadedSkill` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @@ -20,8 +25,8 @@ public record SkillsLoadedSkill( @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, + /** Source location type (e.g., project, personal-copilot, plugin, builtin) */ + @JsonProperty("source") SkillSource source, /** Whether the skill can be invoked by the user as a slash command */ @JsonProperty("userInvocable") Boolean userInvocable, /** Whether the skill is currently enabled */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentCompletedEvent.java b/src/generated/java/com/github/copilot/generated/SubagentCompletedEvent.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/SubagentCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/SubagentCompletedEvent.java index b2cce20c31..98924809fa 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SubagentCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SubagentCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code subagent.completed} session event. + * Session event "subagent.completed". Sub-agent completion details for successful execution * * @since 1.0.0 */ @@ -44,11 +44,11 @@ public record SubagentCompletedEventData( /** Model used by the sub-agent */ @JsonProperty("model") String model, /** Total number of tool calls made by the sub-agent */ - @JsonProperty("totalToolCalls") Double totalToolCalls, + @JsonProperty("totalToolCalls") Long totalToolCalls, /** Total tokens (input + output) consumed by the sub-agent */ - @JsonProperty("totalTokens") Double totalTokens, + @JsonProperty("totalTokens") Long totalTokens, /** Wall-clock duration of the sub-agent execution in milliseconds */ - @JsonProperty("durationMs") Double durationMs + @JsonProperty("durationMs") Long durationMs ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentDeselectedEvent.java b/src/generated/java/com/github/copilot/generated/SubagentDeselectedEvent.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/SubagentDeselectedEvent.java rename to src/generated/java/com/github/copilot/generated/SubagentDeselectedEvent.java index 3db9429dbf..2274ba66e0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SubagentDeselectedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SubagentDeselectedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code subagent.deselected} session event. + * Session event "subagent.deselected". Empty payload; the event signals that the custom agent was deselected, returning to the default agent * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentFailedEvent.java b/src/generated/java/com/github/copilot/generated/SubagentFailedEvent.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/SubagentFailedEvent.java rename to src/generated/java/com/github/copilot/generated/SubagentFailedEvent.java index 490532fc38..9264b5b0ee 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SubagentFailedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SubagentFailedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code subagent.failed} session event. + * Session event "subagent.failed". Sub-agent failure details including error message and agent information * * @since 1.0.0 */ @@ -46,11 +46,11 @@ public record SubagentFailedEventData( /** Model used by the sub-agent (if any model calls succeeded before failure) */ @JsonProperty("model") String model, /** Total number of tool calls made before the sub-agent failed */ - @JsonProperty("totalToolCalls") Double totalToolCalls, + @JsonProperty("totalToolCalls") Long totalToolCalls, /** Total tokens (input + output) consumed before the sub-agent failed */ - @JsonProperty("totalTokens") Double totalTokens, + @JsonProperty("totalTokens") Long totalTokens, /** Wall-clock duration of the sub-agent execution in milliseconds */ - @JsonProperty("durationMs") Double durationMs + @JsonProperty("durationMs") Long durationMs ) { } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentSelectedEvent.java b/src/generated/java/com/github/copilot/generated/SubagentSelectedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/SubagentSelectedEvent.java rename to src/generated/java/com/github/copilot/generated/SubagentSelectedEvent.java index e910bc9c27..7eb82019b1 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SubagentSelectedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SubagentSelectedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code subagent.selected} session event. + * Session event "subagent.selected". Custom agent selection details including name and available tools * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SubagentStartedEvent.java b/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/SubagentStartedEvent.java rename to src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java index 4bc945c9c0..647bc824d0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SubagentStartedEvent.java +++ b/src/generated/java/com/github/copilot/generated/SubagentStartedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code subagent.started} session event. + * Session event "subagent.started". Sub-agent startup details including parent tool call and agent information * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java b/src/generated/java/com/github/copilot/generated/SystemMessageEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java rename to src/generated/java/com/github/copilot/generated/SystemMessageEvent.java index 07ae27000b..09d39a1992 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SystemMessageEvent.java +++ b/src/generated/java/com/github/copilot/generated/SystemMessageEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code system.message} session event. + * Session event "system.message". System/developer instruction content with role and optional template metadata * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/SystemMessageMetadata.java b/src/generated/java/com/github/copilot/generated/SystemMessageMetadata.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/SystemMessageMetadata.java rename to src/generated/java/com/github/copilot/generated/SystemMessageMetadata.java index 2b054dc943..f7f5fcbf24 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SystemMessageMetadata.java +++ b/src/generated/java/com/github/copilot/generated/SystemMessageMetadata.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/SystemMessageRole.java b/src/generated/java/com/github/copilot/generated/SystemMessageRole.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/SystemMessageRole.java rename to src/generated/java/com/github/copilot/generated/SystemMessageRole.java index 921b69ec06..3ccd8c31d6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SystemMessageRole.java +++ b/src/generated/java/com/github/copilot/generated/SystemMessageRole.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/SystemNotificationEvent.java b/src/generated/java/com/github/copilot/generated/SystemNotificationEvent.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/SystemNotificationEvent.java rename to src/generated/java/com/github/copilot/generated/SystemNotificationEvent.java index 877b3db984..5a8a0fdfbc 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/SystemNotificationEvent.java +++ b/src/generated/java/com/github/copilot/generated/SystemNotificationEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code system.notification} session event. + * Session event "system.notification". System-generated notification for runtime events like background task completion * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteError.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteError.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteError.java rename to src/generated/java/com/github/copilot/generated/ToolExecutionCompleteError.java index dbdc99ba7e..ac4c7d843d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteError.java +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteError.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java similarity index 85% rename from src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java rename to src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java index a1deeeab56..3cfa451895 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteEvent.java +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code tool.execution_complete} session event. + * Session event "tool.execution_complete". Tool execution completion results including success status, detailed output, and error information * * @since 1.0.0 */ @@ -54,6 +54,10 @@ public record ToolExecutionCompleteEventData( @JsonProperty("toolTelemetry") Map toolTelemetry, /** Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event */ @JsonProperty("turnId") String turnId, + /** Tool definition metadata, present for MCP tools with MCP Apps support */ + @JsonProperty("toolDescription") ToolExecutionCompleteToolDescription toolDescription, + /** Whether this tool execution ran inside a sandbox container */ + @JsonProperty("sandboxed") Boolean sandboxed, /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ @JsonProperty("parentToolCallId") String parentToolCallId ) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteResult.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteResult.java similarity index 84% rename from src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteResult.java rename to src/generated/java/com/github/copilot/generated/ToolExecutionCompleteResult.java index 8f2830541f..4ff3d2de00 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionCompleteResult.java +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -27,6 +27,8 @@ public record ToolExecutionCompleteResult( /** 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 + @JsonProperty("contents") List contents, + /** MCP Apps UI resource content for rendering in a sandboxed iframe */ + @JsonProperty("uiResource") ToolExecutionCompleteUIResource uiResource ) { } diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescription.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescription.java new file mode 100644 index 0000000000..53e614454b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescription.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Tool definition metadata, present for MCP tools with MCP Apps support + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteToolDescription( + /** Tool name */ + @JsonProperty("name") String name, + /** Tool description */ + @JsonProperty("description") String description, + /** MCP Apps metadata for UI resource association */ + @JsonProperty("_meta") ToolExecutionCompleteToolDescriptionMeta meta +) { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMeta.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMeta.java new file mode 100644 index 0000000000..563358cfa3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMeta.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * MCP Apps metadata for UI resource association + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteToolDescriptionMeta( + /** Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. */ + @JsonProperty("ui") ToolExecutionCompleteToolDescriptionMetaUI ui +) { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMetaUI.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMetaUI.java new file mode 100644 index 0000000000..9acf435bc7 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMetaUI.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteToolDescriptionMetaUI( + /** URI of the UI resource */ + @JsonProperty("resourceUri") String resourceUri, + /** Who can access this tool */ + @JsonProperty("visibility") List visibility +) { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMetaUIVisibility.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMetaUIVisibility.java new file mode 100644 index 0000000000..2510ddc0b1 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteToolDescriptionMetaUIVisibility.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.generated; + +import javax.annotation.processing.Generated; + +/** + * Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ToolExecutionCompleteToolDescriptionMetaUIVisibility { + /** The {@code model} variant. */ + MODEL("model"), + /** The {@code app} variant. */ + APP("app"); + + private final String value; + ToolExecutionCompleteToolDescriptionMetaUIVisibility(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ToolExecutionCompleteToolDescriptionMetaUIVisibility fromValue(String value) { + for (ToolExecutionCompleteToolDescriptionMetaUIVisibility v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ToolExecutionCompleteToolDescriptionMetaUIVisibility value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResource.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResource.java new file mode 100644 index 0000000000..0d29bd4004 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResource.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * MCP Apps UI resource content for rendering in a sandboxed iframe + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteUIResource( + /** The ui:// URI of the resource */ + @JsonProperty("uri") String uri, + /** MIME type of the content */ + @JsonProperty("mimeType") String mimeType, + /** HTML content as a string */ + @JsonProperty("text") String text, + /** Base64-encoded HTML content */ + @JsonProperty("blob") String blob, + /** Resource-level UI metadata (CSP, permissions, visual preferences) */ + @JsonProperty("_meta") ToolExecutionCompleteUIResourceMeta meta +) { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMeta.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMeta.java new file mode 100644 index 0000000000..6375222cc3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMeta.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Resource-level UI metadata (CSP, permissions, visual preferences) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteUIResourceMeta( + /** Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. */ + @JsonProperty("ui") ToolExecutionCompleteUIResourceMetaUI ui +) { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUI.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUI.java new file mode 100644 index 0000000000..3b9548a8ce --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUI.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteUIResourceMetaUI( + /** Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. */ + @JsonProperty("csp") ToolExecutionCompleteUIResourceMetaUICsp csp, + /** Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. */ + @JsonProperty("permissions") ToolExecutionCompleteUIResourceMetaUIPermissions permissions, + @JsonProperty("domain") String domain, + @JsonProperty("prefersBorder") Boolean prefersBorder +) { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUICsp.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUICsp.java new file mode 100644 index 0000000000..0ccb8a3dbc --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUICsp.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteUIResourceMetaUICsp( + @JsonProperty("connectDomains") List connectDomains, + @JsonProperty("resourceDomains") List resourceDomains, + @JsonProperty("frameDomains") List frameDomains, + @JsonProperty("baseUriDomains") List baseUriDomains +) { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissions.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissions.java new file mode 100644 index 0000000000..8b1fc5dc9a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissions.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteUIResourceMetaUIPermissions( + /** Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. */ + @JsonProperty("camera") ToolExecutionCompleteUIResourceMetaUIPermissionsCamera camera, + /** Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. */ + @JsonProperty("microphone") ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone microphone, + /** Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. */ + @JsonProperty("geolocation") ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation geolocation, + /** Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. */ + @JsonProperty("clipboardWrite") ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite clipboardWrite +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedUI.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsCamera.java similarity index 77% rename from src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedUI.java rename to src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsCamera.java index 828733b046..300967e8ce 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/CapabilitiesChangedUI.java +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsCamera.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,15 +13,12 @@ import javax.annotation.processing.Generated; /** - * UI capability changes + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. * * @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 -) { +public record ToolExecutionCompleteUIResourceMetaUIPermissionsCamera() { } diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite.java new file mode 100644 index 0000000000..485a6946ce --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite() { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation.java new file mode 100644 index 0000000000..30ed9bb545 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation() { +} diff --git a/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone.java b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone.java new file mode 100644 index 0000000000..1748ccb487 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone.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.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionPartialResultEvent.java b/src/generated/java/com/github/copilot/generated/ToolExecutionPartialResultEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/ToolExecutionPartialResultEvent.java rename to src/generated/java/com/github/copilot/generated/ToolExecutionPartialResultEvent.java index 5fbddc5cca..9c43aa2ecc 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionPartialResultEvent.java +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionPartialResultEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code tool.execution_partial_result} session event. + * Session event "tool.execution_partial_result". Streaming tool execution output for incremental result display * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionProgressEvent.java b/src/generated/java/com/github/copilot/generated/ToolExecutionProgressEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/ToolExecutionProgressEvent.java rename to src/generated/java/com/github/copilot/generated/ToolExecutionProgressEvent.java index 2a77c05ffe..f3a7c1158a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionProgressEvent.java +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionProgressEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code tool.execution_progress} session event. + * Session event "tool.execution_progress". Tool execution progress notification with status message * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionStartEvent.java b/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/ToolExecutionStartEvent.java rename to src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java index 5a48cdd977..7a46ea88cb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ToolExecutionStartEvent.java +++ b/src/generated/java/com/github/copilot/generated/ToolExecutionStartEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code tool.execution_start} session event. + * Session event "tool.execution_start". Tool execution startup details including MCP server information when applicable * * @since 1.0.0 */ @@ -47,6 +47,8 @@ public record ToolExecutionStartEventData( @JsonProperty("mcpToolName") String mcpToolName, /** Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event */ @JsonProperty("turnId") String turnId, + /** When true, the tool output should be displayed expanded (verbatim) in the CLI timeline */ + @JsonProperty("displayVerbatim") Boolean displayVerbatim, /** Tool call ID of the parent tool invocation when this event originates from a sub-agent */ @JsonProperty("parentToolCallId") String parentToolCallId ) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/ToolUserRequestedEvent.java b/src/generated/java/com/github/copilot/generated/ToolUserRequestedEvent.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/ToolUserRequestedEvent.java rename to src/generated/java/com/github/copilot/generated/ToolUserRequestedEvent.java index ac798fd3f3..1b4d519a99 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/ToolUserRequestedEvent.java +++ b/src/generated/java/com/github/copilot/generated/ToolUserRequestedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code tool.user_requested} session event. + * Session event "tool.user_requested". User-initiated tool invocation request with tool name and arguments * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/UnknownSessionEvent.java b/src/generated/java/com/github/copilot/generated/UnknownSessionEvent.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/UnknownSessionEvent.java rename to src/generated/java/com/github/copilot/generated/UnknownSessionEvent.java index cf56b4b4f6..8f1257cf9c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/UnknownSessionEvent.java +++ b/src/generated/java/com/github/copilot/generated/UnknownSessionEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserInputCompletedEvent.java b/src/generated/java/com/github/copilot/generated/UserInputCompletedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/UserInputCompletedEvent.java rename to src/generated/java/com/github/copilot/generated/UserInputCompletedEvent.java index 7b69bfd926..7750c9e702 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/UserInputCompletedEvent.java +++ b/src/generated/java/com/github/copilot/generated/UserInputCompletedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * The {@code user_input.completed} session event. + * Session event "user_input.completed". User input request completion with the user's response * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserInputRequestedEvent.java b/src/generated/java/com/github/copilot/generated/UserInputRequestedEvent.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/UserInputRequestedEvent.java rename to src/generated/java/com/github/copilot/generated/UserInputRequestedEvent.java index 69581e20a2..e7ddb28592 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/UserInputRequestedEvent.java +++ b/src/generated/java/com/github/copilot/generated/UserInputRequestedEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code user_input.requested} session event. + * Session event "user_input.requested". User input request notification with question and optional predefined choices * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserMessageAgentMode.java b/src/generated/java/com/github/copilot/generated/UserMessageAgentMode.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/UserMessageAgentMode.java rename to src/generated/java/com/github/copilot/generated/UserMessageAgentMode.java index 6c1710602d..f6e7c60d7f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/UserMessageAgentMode.java +++ b/src/generated/java/com/github/copilot/generated/UserMessageAgentMode.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java b/src/generated/java/com/github/copilot/generated/UserMessageEvent.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java rename to src/generated/java/com/github/copilot/generated/UserMessageEvent.java index fa680d3e64..3e8e7520fb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/UserMessageEvent.java +++ b/src/generated/java/com/github/copilot/generated/UserMessageEvent.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The {@code user.message} session event. + * Session event "user.message". * * @since 1.0.0 */ @@ -44,7 +44,7 @@ public record UserMessageEventData( @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 */ + /** Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or 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, diff --git a/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContext.java b/src/generated/java/com/github/copilot/generated/WorkingDirectoryContext.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContext.java rename to src/generated/java/com/github/copilot/generated/WorkingDirectoryContext.java index b023859e2f..813cd5e02f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContext.java +++ b/src/generated/java/com/github/copilot/generated/WorkingDirectoryContext.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContextHostType.java b/src/generated/java/com/github/copilot/generated/WorkingDirectoryContextHostType.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContextHostType.java rename to src/generated/java/com/github/copilot/generated/WorkingDirectoryContextHostType.java index 4786b8bc0c..c87237a8de 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/WorkingDirectoryContextHostType.java +++ b/src/generated/java/com/github/copilot/generated/WorkingDirectoryContextHostType.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/WorkspaceFileChangedOperation.java b/src/generated/java/com/github/copilot/generated/WorkspaceFileChangedOperation.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/WorkspaceFileChangedOperation.java rename to src/generated/java/com/github/copilot/generated/WorkspaceFileChangedOperation.java index 7e21ec5484..a6347ed77c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/WorkspaceFileChangedOperation.java +++ b/src/generated/java/com/github/copilot/generated/WorkspaceFileChangedOperation.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/generated/rpc/AbortReason.java b/src/generated/java/com/github/copilot/generated/rpc/AbortReason.java new file mode 100644 index 0000000000..a486400778 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/AbortReason.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Finite reason code describing why the current turn was aborted + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AbortReason { + /** The {@code user_initiated} variant. */ + USER_INITIATED("user_initiated"), + /** The {@code remote_command} variant. */ + REMOTE_COMMAND("remote_command"), + /** The {@code user_abort} variant. */ + USER_ABORT("user_abort"); + + private final String value; + AbortReason(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AbortReason fromValue(String value) { + for (AbortReason v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AbortReason value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountGetQuotaResult.java b/src/generated/java/com/github/copilot/generated/rpc/AccountGetQuotaResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/AccountGetQuotaResult.java rename to src/generated/java/com/github/copilot/generated/rpc/AccountGetQuotaResult.java index 47e3b55ee6..257a087565 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountGetQuotaResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/AccountGetQuotaResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code account.getQuota} RPC method. + * Quota usage snapshots for the resolved user, keyed by quota type. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountQuotaSnapshot.java b/src/generated/java/com/github/copilot/generated/rpc/AccountQuotaSnapshot.java similarity index 77% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/AccountQuotaSnapshot.java rename to src/generated/java/com/github/copilot/generated/rpc/AccountQuotaSnapshot.java index c6d8149300..88e7ba9c64 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/AccountQuotaSnapshot.java +++ b/src/generated/java/com/github/copilot/generated/rpc/AccountQuotaSnapshot.java @@ -5,20 +5,26 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; import javax.annotation.processing.Generated; +/** + * Schema for the `AccountQuotaSnapshot` type. + * + * @since 1.0.0 + */ @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 */ + /** Number of requests included in the entitlement, or -1 for unlimited entitlements */ @JsonProperty("entitlementRequests") Long entitlementRequests, /** Number of requests used so far this period */ @JsonProperty("usedRequests") Long usedRequests, @@ -26,11 +32,11 @@ public record AccountQuotaSnapshot( @JsonProperty("usageAllowedWithExhaustedQuota") Boolean usageAllowedWithExhaustedQuota, /** Percentage of entitlement remaining */ @JsonProperty("remainingPercentage") Double remainingPercentage, - /** Number of overage requests made this period */ + /** Number of additional usage requests made this period */ @JsonProperty("overage") Double overage, - /** Whether overage is allowed when quota is exhausted */ + /** Whether additional usage is allowed when quota is exhausted */ @JsonProperty("overageAllowedWithExhaustedQuota") Boolean overageAllowedWithExhaustedQuota, /** Date when the quota resets (ISO 8601 string) */ - @JsonProperty("resetDate") String resetDate + @JsonProperty("resetDate") OffsetDateTime resetDate ) { } diff --git a/src/generated/java/com/github/copilot/generated/rpc/AgentInfo.java b/src/generated/java/com/github/copilot/generated/rpc/AgentInfo.java new file mode 100644 index 0000000000..ce80893730 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/AgentInfo.java @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.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; + +/** + * Schema for the `AgentInfo` type. + * + * @since 1.0.0 + */ +@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, + /** Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path. */ + @JsonProperty("path") String path, + /** Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned. */ + @JsonProperty("id") String id, + /** Where the agent definition was loaded from */ + @JsonProperty("source") AgentInfoSource source, + /** Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only. */ + @JsonProperty("userInvocable") Boolean userInvocable, + /** Allowed tool names for this agent. Empty array means none; omitted means inherit defaults. */ + @JsonProperty("tools") List tools, + /** Preferred model id for this agent. When omitted, inherits the outer agent's model. */ + @JsonProperty("model") String model, + /** MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema. */ + @JsonProperty("mcpServers") Map mcpServers, + /** Skill names preloaded into this agent's context. Omitted means none. */ + @JsonProperty("skills") List skills +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/AgentInfoSource.java b/src/generated/java/com/github/copilot/generated/rpc/AgentInfoSource.java new file mode 100644 index 0000000000..6f8afe71e8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/AgentInfoSource.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Where the agent definition was loaded from + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AgentInfoSource { + /** The {@code user} variant. */ + USER("user"), + /** The {@code project} variant. */ + PROJECT("project"), + /** The {@code inherited} variant. */ + INHERITED("inherited"), + /** The {@code remote} variant. */ + REMOTE("remote"), + /** The {@code plugin} variant. */ + PLUGIN("plugin"), + /** The {@code builtin} variant. */ + BUILTIN("builtin"); + + private final String value; + AgentInfoSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AgentInfoSource fromValue(String value) { + for (AgentInfoSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AgentInfoSource value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/AgentRegistrySpawnParams.java b/src/generated/java/com/github/copilot/generated/rpc/AgentRegistrySpawnParams.java new file mode 100644 index 0000000000..964aaede60 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/AgentRegistrySpawnParams.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.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; + +/** + * Inputs to spawn a managed-server child via the controller's spawn delegate. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record AgentRegistrySpawnParams( + /** Working directory for the spawned child (must be an existing directory) */ + @JsonProperty("cwd") String cwd, + /** Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own default. */ + @JsonProperty("agentName") String agentName, + /** Model identifier to apply to the new session */ + @JsonProperty("model") String model, + /** Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing whitespace, <=100 chars, no control chars, no double quotes. */ + @JsonProperty("name") String name, + /** Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode. */ + @JsonProperty("permissionMode") AgentRegistrySpawnPermissionMode permissionMode, + /** Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it post-attach via the standard LocalRpcSession.send path). */ + @JsonProperty("initialPrompt") String initialPrompt +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/AgentRegistrySpawnPermissionMode.java b/src/generated/java/com/github/copilot/generated/rpc/AgentRegistrySpawnPermissionMode.java new file mode 100644 index 0000000000..1d5b21fe0a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/AgentRegistrySpawnPermissionMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AgentRegistrySpawnPermissionMode { + /** The {@code default} variant. */ + DEFAULT("default"), + /** The {@code yolo} variant. */ + YOLO("yolo"); + + private final String value; + AgentRegistrySpawnPermissionMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AgentRegistrySpawnPermissionMode fromValue(String value) { + for (AgentRegistrySpawnPermissionMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AgentRegistrySpawnPermissionMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/AuthInfoType.java b/src/generated/java/com/github/copilot/generated/rpc/AuthInfoType.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/AuthInfoType.java rename to src/generated/java/com/github/copilot/generated/rpc/AuthInfoType.java index 89c5db85ce..1fb4b43ba4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/AuthInfoType.java +++ b/src/generated/java/com/github/copilot/generated/rpc/AuthInfoType.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/AgentInfo.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasAction.java similarity index 64% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/AgentInfo.java rename to src/generated/java/com/github/copilot/generated/rpc/CanvasAction.java index 4695ff9fb9..36554ed767 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/AgentInfo.java +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasAction.java @@ -5,24 +5,27 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Canvas action that the agent or host can invoke. To discover the input schema for a particular action, call the list_canvas_capabilities tool. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public record AgentInfo( - /** Unique identifier of the custom agent */ +public record CanvasAction( + /** Action name exposed by the canvas provider */ @JsonProperty("name") String name, - /** Human-readable display name */ - @JsonProperty("displayName") String displayName, - /** Description of the agent's purpose */ + /** Description of the action */ @JsonProperty("description") String description, - /** Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path. */ - @JsonProperty("path") String path + /** JSON Schema for the action input */ + @JsonProperty("inputSchema") Object inputSchema ) { } diff --git a/src/generated/java/com/github/copilot/generated/rpc/CanvasCloseParams.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasCloseParams.java new file mode 100644 index 0000000000..d692c07e76 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasCloseParams.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.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; + +/** + * Canvas close parameters sent to the provider. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CanvasCloseParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Host context supplied by the runtime. */ + @JsonProperty("host") CanvasHostContext host, + /** Session context supplied by the runtime. */ + @JsonProperty("session") CanvasSessionContext session +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentResult.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasHostContext.java similarity index 75% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentResult.java rename to src/generated/java/com/github/copilot/generated/rpc/CanvasHostContext.java index 7467fd4e8a..8dba8156e4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasHostContext.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,15 +13,15 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.model.getCurrent} RPC method. + * Host context supplied by the runtime. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public record SessionModelGetCurrentResult( - /** Currently active model identifier */ - @JsonProperty("modelId") String modelId +public record CanvasHostContext( + /** Host capabilities */ + @JsonProperty("capabilities") CanvasHostContextCapabilities capabilities ) { } diff --git a/src/generated/java/com/github/copilot/generated/rpc/CanvasHostContextCapabilities.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasHostContextCapabilities.java new file mode 100644 index 0000000000..a8118eeebf --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasHostContextCapabilities.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.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; + +/** + * Host capabilities + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CanvasHostContextCapabilities( + /** Whether canvas rendering is supported */ + @JsonProperty("canvases") Boolean canvases +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/CanvasInstanceAvailability.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasInstanceAvailability.java new file mode 100644 index 0000000000..aef2d81265 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasInstanceAvailability.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Runtime-controlled routing state for an open canvas instance. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum CanvasInstanceAvailability { + /** The {@code ready} variant. */ + READY("ready"), + /** The {@code stale} variant. */ + STALE("stale"); + + private final String value; + CanvasInstanceAvailability(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static CanvasInstanceAvailability fromValue(String value) { + for (CanvasInstanceAvailability v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown CanvasInstanceAvailability value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/CanvasInvokeActionParams.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasInvokeActionParams.java new file mode 100644 index 0000000000..8843a3bf04 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasInvokeActionParams.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Canvas action invocation parameters sent to the provider. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CanvasInvokeActionParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Action name to invoke */ + @JsonProperty("actionName") String actionName, + /** Action input */ + @JsonProperty("input") Object input, + /** Host context supplied by the runtime. */ + @JsonProperty("host") CanvasHostContext host, + /** Session context supplied by the runtime. */ + @JsonProperty("session") CanvasSessionContext session +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/CanvasOpenParams.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasOpenParams.java new file mode 100644 index 0000000000..95b0d8e643 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasOpenParams.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.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; + +/** + * Canvas open parameters sent to the provider. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CanvasOpenParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Stable caller-supplied canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Canvas open input */ + @JsonProperty("input") Object input, + /** Host context supplied by the runtime. */ + @JsonProperty("host") CanvasHostContext host, + /** Session context supplied by the runtime. */ + @JsonProperty("session") CanvasSessionContext session +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/CanvasOpenResult.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasOpenResult.java new file mode 100644 index 0000000000..9ce3aeede9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasOpenResult.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.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; + +/** + * Canvas open result returned by the provider. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CanvasOpenResult( + /** URL for web-rendered canvases */ + @JsonProperty("url") String url, + /** Provider-supplied title */ + @JsonProperty("title") String title, + /** Provider-supplied status text */ + @JsonProperty("status") String status +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/CanvasSessionContext.java b/src/generated/java/com/github/copilot/generated/rpc/CanvasSessionContext.java new file mode 100644 index 0000000000..422d32e542 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/CanvasSessionContext.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.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; + +/** + * Session context supplied by the runtime. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CanvasSessionContext( + /** Active session working directory, when known. */ + @JsonProperty("workingDirectory") String workingDirectory +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ConnectParams.java b/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ConnectParams.java rename to src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java index 665cd9694c..590dd01479 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ConnectParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code connect} RPC method. + * Optional connection token presented by the SDK client during the handshake. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ConnectResult.java b/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ConnectResult.java rename to src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java index 56666b2523..d24d120e12 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ConnectResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code connect} RPC method. + * Handshake result reporting the server's protocol version and package version on success. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadata.java b/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadata.java new file mode 100644 index 0000000000..9e3a4a57f2 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadata.java @@ -0,0 +1,48 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Metadata for a connected remote session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ConnectedRemoteSessionMetadata( + /** SDK session ID for the connected remote session. */ + @JsonProperty("sessionId") String sessionId, + /** Optional friendly session name. */ + @JsonProperty("name") String name, + /** Optional session summary. */ + @JsonProperty("summary") String summary, + /** Session start time as an ISO 8601 string. */ + @JsonProperty("startTime") OffsetDateTime startTime, + /** Last session update time as an ISO 8601 string. */ + @JsonProperty("modifiedTime") OffsetDateTime modifiedTime, + /** Repository associated with the connected remote session. */ + @JsonProperty("repository") ConnectedRemoteSessionMetadataRepository repository, + /** Pull request number associated with the session. */ + @JsonProperty("pullRequestNumber") Long pullRequestNumber, + /** Original remote resource identifier. */ + @JsonProperty("resourceId") String resourceId, + /** Neutral SDK discriminator for the connected remote session kind. */ + @JsonProperty("kind") ConnectedRemoteSessionMetadataKind kind, + /** Remote session staleness deadline as an ISO 8601 string. */ + @JsonProperty("staleAt") OffsetDateTime staleAt, + /** Remote session state returned by the backing service. */ + @JsonProperty("state") String state +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadataKind.java b/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadataKind.java new file mode 100644 index 0000000000..8d22c1dd4d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadataKind.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Neutral SDK discriminator for the connected remote session kind. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ConnectedRemoteSessionMetadataKind { + /** The {@code remote-session} variant. */ + REMOTE_SESSION("remote-session"), + /** The {@code coding-agent} variant. */ + CODING_AGENT("coding-agent"); + + private final String value; + ConnectedRemoteSessionMetadataKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ConnectedRemoteSessionMetadataKind fromValue(String value) { + for (ConnectedRemoteSessionMetadataKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ConnectedRemoteSessionMetadataKind value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadataRepository.java b/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadataRepository.java new file mode 100644 index 0000000000..7daa17bd16 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ConnectedRemoteSessionMetadataRepository.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.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; + +/** + * Repository associated with the connected remote session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ConnectedRemoteSessionMetadataRepository( + /** Repository owner or organization login. */ + @JsonProperty("owner") String owner, + /** Repository name. */ + @JsonProperty("name") String name, + /** Branch associated with the remote session. */ + @JsonProperty("branch") String branch +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/DiscoveredCanvas.java b/src/generated/java/com/github/copilot/generated/rpc/DiscoveredCanvas.java new file mode 100644 index 0000000000..e6e02745c8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/DiscoveredCanvas.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.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; + +/** + * Canvas available in the current session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record DiscoveredCanvas( + /** Human-readable canvas name */ + @JsonProperty("displayName") String displayName, + /** Short, single-sentence description shown to the agent in canvas catalogs. */ + @JsonProperty("description") String description, + /** JSON Schema for canvas open input */ + @JsonProperty("inputSchema") Object inputSchema, + /** Actions the agent or host may invoke on an open instance */ + @JsonProperty("actions") List actions, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Owning extension display name, when available */ + @JsonProperty("extensionName") String extensionName, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServer.java b/src/generated/java/com/github/copilot/generated/rpc/DiscoveredMcpServer.java similarity index 75% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServer.java rename to src/generated/java/com/github/copilot/generated/rpc/DiscoveredMcpServer.java index 0429b26e13..4f8fb22ac4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServer.java +++ b/src/generated/java/com/github/copilot/generated/rpc/DiscoveredMcpServer.java @@ -5,23 +5,28 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `DiscoveredMcpServer` type. + * + * @since 1.0.0 + */ @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) */ + /** Server transport type: stdio, http, sse (deprecated), or memory */ @JsonProperty("type") DiscoveredMcpServerType type, - /** Configuration source */ - @JsonProperty("source") DiscoveredMcpServerSource source, + /** Configuration source: user, workspace, plugin, or builtin */ + @JsonProperty("source") McpServerSource 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/generated/rpc/DiscoveredMcpServerSource.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerSource.java rename to src/generated/java/com/github/copilot/generated/rpc/DiscoveredMcpServerSource.java index 6bc451b349..89d7322fb7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerSource.java +++ b/src/generated/java/com/github/copilot/generated/rpc/DiscoveredMcpServerSource.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerType.java b/src/generated/java/com/github/copilot/generated/rpc/DiscoveredMcpServerType.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerType.java rename to src/generated/java/com/github/copilot/generated/rpc/DiscoveredMcpServerType.java index 1ed5520217..bc9b9cefd9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/DiscoveredMcpServerType.java +++ b/src/generated/java/com/github/copilot/generated/rpc/DiscoveredMcpServerType.java @@ -5,12 +5,12 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; /** - * Server transport type: stdio, http, sse, or memory (local configs are normalized to stdio) + * Server transport type: stdio, http, sse (deprecated), or memory * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/EventsAgentScope.java b/src/generated/java/com/github/copilot/generated/rpc/EventsAgentScope.java new file mode 100644 index 0000000000..5e85b19269 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/EventsAgentScope.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum EventsAgentScope { + /** The {@code primary} variant. */ + PRIMARY("primary"), + /** The {@code all} variant. */ + ALL("all"); + + private final String value; + EventsAgentScope(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static EventsAgentScope fromValue(String value) { + for (EventsAgentScope v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown EventsAgentScope value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java b/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.java new file mode 100644 index 0000000000..31c1fcab01 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/EventsCursorStatus.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum EventsCursorStatus { + /** The {@code ok} variant. */ + OK("ok"), + /** The {@code expired} variant. */ + EXPIRED("expired"); + + private final String value; + EventsCursorStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static EventsCursorStatus fromValue(String value) { + for (EventsCursorStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown EventsCursorStatus value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/Extension.java b/src/generated/java/com/github/copilot/generated/rpc/Extension.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/Extension.java rename to src/generated/java/com/github/copilot/generated/rpc/Extension.java index 14af4c77d8..13bb851b49 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/Extension.java +++ b/src/generated/java/com/github/copilot/generated/rpc/Extension.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `Extension` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionSource.java b/src/generated/java/com/github/copilot/generated/rpc/ExtensionSource.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionSource.java rename to src/generated/java/com/github/copilot/generated/rpc/ExtensionSource.java index 2ec3da3973..aeb7a144f6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionSource.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ExtensionSource.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionStatus.java b/src/generated/java/com/github/copilot/generated/rpc/ExtensionStatus.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionStatus.java rename to src/generated/java/com/github/copilot/generated/rpc/ExtensionStatus.java index 241a5cd60c..34592663f1 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ExtensionStatus.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ExtensionStatus.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/HistoryCompactContextWindow.java b/src/generated/java/com/github/copilot/generated/rpc/HistoryCompactContextWindow.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/HistoryCompactContextWindow.java rename to src/generated/java/com/github/copilot/generated/rpc/HistoryCompactContextWindow.java index 4ac1a8fa9e..6c223f029d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/HistoryCompactContextWindow.java +++ b/src/generated/java/com/github/copilot/generated/rpc/HistoryCompactContextWindow.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/rpc/InstalledPlugin.java b/src/generated/java/com/github/copilot/generated/rpc/InstalledPlugin.java new file mode 100644 index 0000000000..c274dfb1a2 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/InstalledPlugin.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.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; + +/** + * Schema for the `InstalledPlugin` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record InstalledPlugin( + /** Plugin name */ + @JsonProperty("name") String name, + /** Marketplace the plugin came from (empty string for direct repo installs) */ + @JsonProperty("marketplace") String marketplace, + /** Version installed (if available) */ + @JsonProperty("version") String version, + /** Installation timestamp */ + @JsonProperty("installed_at") String installedAt, + /** Whether the plugin is currently enabled */ + @JsonProperty("enabled") Boolean enabled, + /** Path where the plugin is cached locally */ + @JsonProperty("cache_path") String cachePath, + /** Source for direct repo installs (when marketplace is empty) */ + @JsonProperty("source") Object source +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSources.java b/src/generated/java/com/github/copilot/generated/rpc/InstructionsSources.java similarity index 74% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSources.java rename to src/generated/java/com/github/copilot/generated/rpc/InstructionsSources.java index 7ca267a1b8..9e6a458d40 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSources.java +++ b/src/generated/java/com/github/copilot/generated/rpc/InstructionsSources.java @@ -5,13 +5,19 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import javax.annotation.processing.Generated; +/** + * Schema for the `InstructionsSources` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @@ -28,9 +34,11 @@ public record InstructionsSources( @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, + /** Glob pattern(s) from frontmatter — when set, this instruction applies only to matching files */ + @JsonProperty("applyTo") List applyTo, /** Short description (body after frontmatter) for use in instruction tables */ - @JsonProperty("description") String description + @JsonProperty("description") String description, + /** When true, this source starts disabled and must be toggled on by the user */ + @JsonProperty("defaultDisabled") Boolean defaultDisabled ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesLocation.java b/src/generated/java/com/github/copilot/generated/rpc/InstructionsSourcesLocation.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesLocation.java rename to src/generated/java/com/github/copilot/generated/rpc/InstructionsSourcesLocation.java index 01b702cfe8..23db5a3671 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesLocation.java +++ b/src/generated/java/com/github/copilot/generated/rpc/InstructionsSourcesLocation.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; @@ -21,7 +21,9 @@ public enum InstructionsSourcesLocation { /** The {@code repository} variant. */ REPOSITORY("repository"), /** The {@code working-directory} variant. */ - WORKING_DIRECTORY("working-directory"); + WORKING_DIRECTORY("working-directory"), + /** The {@code plugin} variant. */ + PLUGIN("plugin"); private final String value; InstructionsSourcesLocation(String value) { this.value = value; } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesType.java b/src/generated/java/com/github/copilot/generated/rpc/InstructionsSourcesType.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesType.java rename to src/generated/java/com/github/copilot/generated/rpc/InstructionsSourcesType.java index 8de1319422..6fed6c4bf8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/InstructionsSourcesType.java +++ b/src/generated/java/com/github/copilot/generated/rpc/InstructionsSourcesType.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; @@ -27,7 +27,9 @@ public enum InstructionsSourcesType { /** The {@code nested-agents} variant. */ NESTED_AGENTS("nested-agents"), /** The {@code child-instructions} variant. */ - CHILD_INSTRUCTIONS("child-instructions"); + CHILD_INSTRUCTIONS("child-instructions"), + /** The {@code plugin} variant. */ + PLUGIN("plugin"); private final String value; InstructionsSourcesType(String value) { this.value = value; } diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsDiagnoseCapability.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsDiagnoseCapability.java new file mode 100644 index 0000000000..c4da1ff72e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsDiagnoseCapability.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.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; + +/** + * Capability negotiation snapshot + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpAppsDiagnoseCapability( + /** Whether the session has the `mcp-apps` capability */ + @JsonProperty("sessionHasMcpApps") Boolean sessionHasMcpApps, + /** Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on */ + @JsonProperty("featureFlagEnabled") Boolean featureFlagEnabled, + /** Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers */ + @JsonProperty("advertised") Boolean advertised +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsDiagnoseServer.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsDiagnoseServer.java new file mode 100644 index 0000000000..c63ef75bb4 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsDiagnoseServer.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.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; + +/** + * What the server returned for this session + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpAppsDiagnoseServer( + /** Whether the named server is currently connected */ + @JsonProperty("connected") Boolean connected, + /** Total tools returned by the server's tools/list */ + @JsonProperty("toolCount") Double toolCount, + /** Tools whose `_meta.ui` is populated (resourceUri and/or visibility set) */ + @JsonProperty("toolsWithUiMeta") Double toolsWithUiMeta, + /** Up to 5 tool names with `_meta.ui` for quick inspection */ + @JsonProperty("sampleToolNames") List sampleToolNames +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetails.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetails.java new file mode 100644 index 0000000000..dd98b2c354 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetails.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.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; + +/** + * Current host context + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpAppsHostContextDetails( + /** UI theme preference per SEP-1865 */ + @JsonProperty("theme") McpAppsHostContextDetailsTheme theme, + /** BCP-47 locale, e.g. 'en-US' */ + @JsonProperty("locale") String locale, + /** IANA timezone, e.g. 'America/New_York' */ + @JsonProperty("timeZone") String timeZone, + /** Current display mode (SEP-1865) */ + @JsonProperty("displayMode") McpAppsHostContextDetailsDisplayMode displayMode, + /** Display modes the host supports */ + @JsonProperty("availableDisplayModes") List availableDisplayModes, + /** Platform type for responsive design */ + @JsonProperty("platform") McpAppsHostContextDetailsPlatform platform, + /** Host application identifier */ + @JsonProperty("userAgent") String userAgent +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsAvailableDisplayMode.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsAvailableDisplayMode.java new file mode 100644 index 0000000000..b5588d611d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsAvailableDisplayMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpAppsHostContextDetailsAvailableDisplayMode { + /** The {@code inline} variant. */ + INLINE("inline"), + /** The {@code fullscreen} variant. */ + FULLSCREEN("fullscreen"), + /** The {@code pip} variant. */ + PIP("pip"); + + private final String value; + McpAppsHostContextDetailsAvailableDisplayMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpAppsHostContextDetailsAvailableDisplayMode fromValue(String value) { + for (McpAppsHostContextDetailsAvailableDisplayMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpAppsHostContextDetailsAvailableDisplayMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsDisplayMode.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsDisplayMode.java new file mode 100644 index 0000000000..56a03b007d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsDisplayMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Current display mode (SEP-1865) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpAppsHostContextDetailsDisplayMode { + /** The {@code inline} variant. */ + INLINE("inline"), + /** The {@code fullscreen} variant. */ + FULLSCREEN("fullscreen"), + /** The {@code pip} variant. */ + PIP("pip"); + + private final String value; + McpAppsHostContextDetailsDisplayMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpAppsHostContextDetailsDisplayMode fromValue(String value) { + for (McpAppsHostContextDetailsDisplayMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpAppsHostContextDetailsDisplayMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsPlatform.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsPlatform.java new file mode 100644 index 0000000000..4c03c3aec4 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsPlatform.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Platform type for responsive design + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpAppsHostContextDetailsPlatform { + /** The {@code web} variant. */ + WEB("web"), + /** The {@code desktop} variant. */ + DESKTOP("desktop"), + /** The {@code mobile} variant. */ + MOBILE("mobile"); + + private final String value; + McpAppsHostContextDetailsPlatform(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpAppsHostContextDetailsPlatform fromValue(String value) { + for (McpAppsHostContextDetailsPlatform v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpAppsHostContextDetailsPlatform value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsTheme.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsTheme.java new file mode 100644 index 0000000000..e80e3b5543 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsHostContextDetailsTheme.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * UI theme preference per SEP-1865 + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpAppsHostContextDetailsTheme { + /** The {@code light} variant. */ + LIGHT("light"), + /** The {@code dark} variant. */ + DARK("dark"); + + private final String value; + McpAppsHostContextDetailsTheme(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpAppsHostContextDetailsTheme fromValue(String value) { + for (McpAppsHostContextDetailsTheme v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpAppsHostContextDetailsTheme value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsResourceContent.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsResourceContent.java new file mode 100644 index 0000000000..25850f372a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsResourceContent.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.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; + +/** + * Schema for the `McpAppsResourceContent` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpAppsResourceContent( + /** The resource URI (typically ui://...) */ + @JsonProperty("uri") String uri, + /** MIME type of the content */ + @JsonProperty("mimeType") String mimeType, + /** Text content (e.g. HTML) */ + @JsonProperty("text") String text, + /** Base64-encoded binary content */ + @JsonProperty("blob") String blob, + /** Resource-level metadata (CSP, permissions, etc.) */ + @JsonProperty("_meta") Map meta +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetails.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetails.java new file mode 100644 index 0000000000..bb37e8d942 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetails.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.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; + +/** + * Host context advertised to MCP App guests + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpAppsSetHostContextDetails( + /** UI theme preference per SEP-1865 */ + @JsonProperty("theme") McpAppsSetHostContextDetailsTheme theme, + /** BCP-47 locale, e.g. 'en-US' */ + @JsonProperty("locale") String locale, + /** IANA timezone, e.g. 'America/New_York' */ + @JsonProperty("timeZone") String timeZone, + /** Current display mode (SEP-1865) */ + @JsonProperty("displayMode") McpAppsSetHostContextDetailsDisplayMode displayMode, + /** Display modes the host supports */ + @JsonProperty("availableDisplayModes") List availableDisplayModes, + /** Platform type for responsive design */ + @JsonProperty("platform") McpAppsSetHostContextDetailsPlatform platform, + /** Host application identifier */ + @JsonProperty("userAgent") String userAgent +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsAvailableDisplayMode.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsAvailableDisplayMode.java new file mode 100644 index 0000000000..e207f5416d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsAvailableDisplayMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpAppsSetHostContextDetailsAvailableDisplayMode { + /** The {@code inline} variant. */ + INLINE("inline"), + /** The {@code fullscreen} variant. */ + FULLSCREEN("fullscreen"), + /** The {@code pip} variant. */ + PIP("pip"); + + private final String value; + McpAppsSetHostContextDetailsAvailableDisplayMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpAppsSetHostContextDetailsAvailableDisplayMode fromValue(String value) { + for (McpAppsSetHostContextDetailsAvailableDisplayMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpAppsSetHostContextDetailsAvailableDisplayMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsDisplayMode.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsDisplayMode.java new file mode 100644 index 0000000000..a42a88a4a1 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsDisplayMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Current display mode (SEP-1865) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpAppsSetHostContextDetailsDisplayMode { + /** The {@code inline} variant. */ + INLINE("inline"), + /** The {@code fullscreen} variant. */ + FULLSCREEN("fullscreen"), + /** The {@code pip} variant. */ + PIP("pip"); + + private final String value; + McpAppsSetHostContextDetailsDisplayMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpAppsSetHostContextDetailsDisplayMode fromValue(String value) { + for (McpAppsSetHostContextDetailsDisplayMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpAppsSetHostContextDetailsDisplayMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsPlatform.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsPlatform.java new file mode 100644 index 0000000000..306b717d60 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsPlatform.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Platform type for responsive design + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpAppsSetHostContextDetailsPlatform { + /** The {@code web} variant. */ + WEB("web"), + /** The {@code desktop} variant. */ + DESKTOP("desktop"), + /** The {@code mobile} variant. */ + MOBILE("mobile"); + + private final String value; + McpAppsSetHostContextDetailsPlatform(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpAppsSetHostContextDetailsPlatform fromValue(String value) { + for (McpAppsSetHostContextDetailsPlatform v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpAppsSetHostContextDetailsPlatform value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsTheme.java b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsTheme.java new file mode 100644 index 0000000000..09e15319e8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpAppsSetHostContextDetailsTheme.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * UI theme preference per SEP-1865 + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpAppsSetHostContextDetailsTheme { + /** The {@code light} variant. */ + LIGHT("light"), + /** The {@code dark} variant. */ + DARK("dark"); + + private final String value; + McpAppsSetHostContextDetailsTheme(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpAppsSetHostContextDetailsTheme fromValue(String value) { + for (McpAppsSetHostContextDetailsTheme v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpAppsSetHostContextDetailsTheme value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigAddParams.java b/src/generated/java/com/github/copilot/generated/rpc/McpConfigAddParams.java similarity index 83% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigAddParams.java rename to src/generated/java/com/github/copilot/generated/rpc/McpConfigAddParams.java index 0f33fdcdad..64ffd39517 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigAddParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpConfigAddParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code mcp.config.add} RPC method. + * MCP server name and configuration to add to user configuration. * * @since 1.0.0 */ @@ -23,7 +23,7 @@ public record McpConfigAddParams( /** Unique name for the MCP server */ @JsonProperty("name") String name, - /** MCP server configuration (local/stdio or remote/http) */ + /** MCP server configuration (stdio process or remote HTTP/SSE) */ @JsonProperty("config") Object config ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigDisableParams.java b/src/generated/java/com/github/copilot/generated/rpc/McpConfigDisableParams.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigDisableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/McpConfigDisableParams.java index cef02e1ae8..e71c12f93c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigDisableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpConfigDisableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code mcp.config.disable} RPC method. + * MCP server names to disable for new sessions. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigEnableParams.java b/src/generated/java/com/github/copilot/generated/rpc/McpConfigEnableParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigEnableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/McpConfigEnableParams.java index 78ba76b7b8..952d6fb685 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigEnableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpConfigEnableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code mcp.config.enable} RPC method. + * MCP server names to enable for new sessions. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigListResult.java b/src/generated/java/com/github/copilot/generated/rpc/McpConfigListResult.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/McpConfigListResult.java index 1391b451cb..4d66442281 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpConfigListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code mcp.config.list} RPC method. + * User-configured MCP servers, keyed by server name. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigRemoveParams.java b/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigRemoveParams.java rename to src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java index 6c24be4311..840b72abf7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigRemoveParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code mcp.config.remove} RPC method. + * MCP server name to remove from user configuration. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigUpdateParams.java b/src/generated/java/com/github/copilot/generated/rpc/McpConfigUpdateParams.java similarity index 82% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigUpdateParams.java rename to src/generated/java/com/github/copilot/generated/rpc/McpConfigUpdateParams.java index 327234515f..f2c2b0faaf 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpConfigUpdateParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpConfigUpdateParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code mcp.config.update} RPC method. + * MCP server name and replacement configuration to write to user configuration. * * @since 1.0.0 */ @@ -23,7 +23,7 @@ public record McpConfigUpdateParams( /** Name of the MCP server to update */ @JsonProperty("name") String name, - /** MCP server configuration (local/stdio or remote/http) */ + /** MCP server configuration (stdio process or remote HTTP/SSE) */ @JsonProperty("config") Object config ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverParams.java b/src/generated/java/com/github/copilot/generated/rpc/McpDiscoverParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverParams.java rename to src/generated/java/com/github/copilot/generated/rpc/McpDiscoverParams.java index 24d52cffcd..ed7b32bb7d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpDiscoverParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code mcp.discover} RPC method. + * Optional working directory used as context for MCP server discovery. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverResult.java b/src/generated/java/com/github/copilot/generated/rpc/McpDiscoverResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverResult.java rename to src/generated/java/com/github/copilot/generated/rpc/McpDiscoverResult.java index 3f107275bf..b000b16ffc 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpDiscoverResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpDiscoverResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code mcp.discover} RPC method. + * MCP servers discovered from user, workspace, plugin, and built-in sources. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpExecuteSamplingRequest.java b/src/generated/java/com/github/copilot/generated/rpc/McpExecuteSamplingRequest.java new file mode 100644 index 0000000000..4fd862ebd0 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpExecuteSamplingRequest.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.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; + +/** + * Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpExecuteSamplingRequest() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpExecuteSamplingResult.java b/src/generated/java/com/github/copilot/generated/rpc/McpExecuteSamplingResult.java new file mode 100644 index 0000000000..18a838d30c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpExecuteSamplingResult.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.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; + +/** + * MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpExecuteSamplingResult() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpSamplingExecutionAction.java b/src/generated/java/com/github/copilot/generated/rpc/McpSamplingExecutionAction.java new file mode 100644 index 0000000000..d0a3802f7a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpSamplingExecutionAction.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpSamplingExecutionAction { + /** The {@code success} variant. */ + SUCCESS("success"), + /** The {@code failure} variant. */ + FAILURE("failure"), + /** The {@code cancelled} variant. */ + CANCELLED("cancelled"); + + private final String value; + McpSamplingExecutionAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpSamplingExecutionAction fromValue(String value) { + for (McpSamplingExecutionAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpSamplingExecutionAction value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServer.java b/src/generated/java/com/github/copilot/generated/rpc/McpServer.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpServer.java rename to src/generated/java/com/github/copilot/generated/rpc/McpServer.java index 2f4b2b36ef..7da05f6591 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServer.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpServer.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `McpServer` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerSource.java b/src/generated/java/com/github/copilot/generated/rpc/McpServerSource.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerSource.java rename to src/generated/java/com/github/copilot/generated/rpc/McpServerSource.java index 3ffe4b7978..f709df96dd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerSource.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpServerSource.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerStatus.java b/src/generated/java/com/github/copilot/generated/rpc/McpServerStatus.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerStatus.java rename to src/generated/java/com/github/copilot/generated/rpc/McpServerStatus.java index 06bec4f307..db463a7377 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/McpServerStatus.java +++ b/src/generated/java/com/github/copilot/generated/rpc/McpServerStatus.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/generated/rpc/McpSetEnvValueModeDetails.java b/src/generated/java/com/github/copilot/generated/rpc/McpSetEnvValueModeDetails.java new file mode 100644 index 0000000000..dda0c02ca3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/McpSetEnvValueModeDetails.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct". + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpSetEnvValueModeDetails { + /** The {@code direct} variant. */ + DIRECT("direct"), + /** The {@code indirect} variant. */ + INDIRECT("indirect"); + + private final String value; + McpSetEnvValueModeDetails(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpSetEnvValueModeDetails fromValue(String value) { + for (McpSetEnvValueModeDetails v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpSetEnvValueModeDetails value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotCurrentMode.java b/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotCurrentMode.java new file mode 100644 index 0000000000..2d6c7eb574 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotCurrentMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot') + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum MetadataSnapshotCurrentMode { + /** The {@code interactive} variant. */ + INTERACTIVE("interactive"), + /** The {@code plan} variant. */ + PLAN("plan"), + /** The {@code autopilot} variant. */ + AUTOPILOT("autopilot"); + + private final String value; + MetadataSnapshotCurrentMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static MetadataSnapshotCurrentMode fromValue(String value) { + for (MetadataSnapshotCurrentMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown MetadataSnapshotCurrentMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadata.java b/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadata.java new file mode 100644 index 0000000000..88b6dede32 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadata.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.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; + +/** + * Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record MetadataSnapshotRemoteMetadata( + /** The original resource identifier (task ID or PR node ID), preserved across event-replay reconstructions. Falls back to `sessionId` when absent. */ + @JsonProperty("resourceId") String resourceId, + /** The repository the remote session targets. */ + @JsonProperty("repository") MetadataSnapshotRemoteMetadataRepository repository, + /** The pull request number the remote session is associated with, if any. */ + @JsonProperty("pullRequestNumber") Long pullRequestNumber, + /** Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation. */ + @JsonProperty("taskType") MetadataSnapshotRemoteMetadataTaskType taskType +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadataRepository.java b/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadataRepository.java new file mode 100644 index 0000000000..cc0bb65329 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadataRepository.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.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; + +/** + * The repository the remote session targets. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record MetadataSnapshotRemoteMetadataRepository( + /** The GitHub owner (user or organization) of the target repository. */ + @JsonProperty("owner") String owner, + /** The GitHub repository name (without owner). */ + @JsonProperty("name") String name, + /** The branch the remote session is operating on. */ + @JsonProperty("branch") String branch +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadataTaskType.java b/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadataTaskType.java new file mode 100644 index 0000000000..da019b5f7c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/MetadataSnapshotRemoteMetadataTaskType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum MetadataSnapshotRemoteMetadataTaskType { + /** The {@code cca} variant. */ + CCA("cca"), + /** The {@code cli} variant. */ + CLI("cli"); + + private final String value; + MetadataSnapshotRemoteMetadataTaskType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static MetadataSnapshotRemoteMetadataTaskType fromValue(String value) { + for (MetadataSnapshotRemoteMetadataTaskType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown MetadataSnapshotRemoteMetadataTaskType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/Model.java b/src/generated/java/com/github/copilot/generated/rpc/Model.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/Model.java rename to src/generated/java/com/github/copilot/generated/rpc/Model.java index 9bda6a3007..0904519165 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/Model.java +++ b/src/generated/java/com/github/copilot/generated/rpc/Model.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,6 +13,11 @@ import java.util.List; import javax.annotation.processing.Generated; +/** + * Schema for the `Model` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBilling.java b/src/generated/java/com/github/copilot/generated/rpc/ModelBilling.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBilling.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelBilling.java index 9e634bb79a..94a8188f16 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBilling.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelBilling.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBillingTokenPrices.java b/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPrices.java similarity index 55% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBillingTokenPrices.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPrices.java index 34005daf1b..756ccaa025 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelBillingTokenPrices.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPrices.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -21,13 +21,17 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record ModelBillingTokenPrices( - /** Price per billing batch of input tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) */ - @JsonProperty("inputPrice") Long inputPrice, - /** Price per billing batch of output tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) */ - @JsonProperty("outputPrice") Long outputPrice, - /** Price per billing batch of cached tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) */ - @JsonProperty("cachePrice") Long cachePrice, + /** AI Credits cost per billing batch of input tokens */ + @JsonProperty("inputPrice") Double inputPrice, + /** AI Credits cost per billing batch of output tokens */ + @JsonProperty("outputPrice") Double outputPrice, + /** AI Credits cost per billing batch of cached tokens */ + @JsonProperty("cachePrice") Double cachePrice, /** Number of tokens per standard billing batch */ - @JsonProperty("batchSize") Long batchSize + @JsonProperty("batchSize") Long batchSize, + /** Maximum context window tokens for the default tier */ + @JsonProperty("contextMax") Long contextMax, + /** Long context tier pricing (available for models with extended context windows) */ + @JsonProperty("longContext") ModelBillingTokenPricesLongContext longContext ) { } diff --git a/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPricesLongContext.java b/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPricesLongContext.java new file mode 100644 index 0000000000..983742c19f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelBillingTokenPricesLongContext.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.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; + +/** + * Long context tier pricing (available for models with extended context windows) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ModelBillingTokenPricesLongContext( + /** AI Credits cost per billing batch of input tokens */ + @JsonProperty("inputPrice") Double inputPrice, + /** AI Credits cost per billing batch of output tokens */ + @JsonProperty("outputPrice") Double outputPrice, + /** AI Credits cost per billing batch of cached tokens */ + @JsonProperty("cachePrice") Double cachePrice, + /** Maximum context window tokens for the long context tier */ + @JsonProperty("contextMax") Long contextMax +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilities.java b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilities.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilities.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelCapabilities.java index 4c6b5e3af5..168a72099b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilities.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilities.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimits.java b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesLimits.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimits.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesLimits.java index 8adf6812b2..694e2a2ea5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimits.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesLimits.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimitsVision.java b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesLimitsVision.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimitsVision.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesLimitsVision.java index cbfc7c3b89..d7f8e71544 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesLimitsVision.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesLimitsVision.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverride.java b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverride.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverride.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverride.java index 1ec67824ec..1433a7b5e6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverride.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverride.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimits.java b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideLimits.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimits.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideLimits.java index 8794ae2589..c0de367f33 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimits.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideLimits.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -21,10 +21,13 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record ModelCapabilitiesOverrideLimits( + /** 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") ModelCapabilitiesOverrideLimitsVision vision ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimitsVision.java b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideLimitsVision.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimitsVision.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideLimitsVision.java index 5d53ca6b82..86339787d3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideLimitsVision.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideLimitsVision.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,6 +13,11 @@ 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) diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideSupports.java b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideSupports.java similarity index 84% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideSupports.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideSupports.java index bc8e3f4952..ec1da750d8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesOverrideSupports.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesOverrideSupports.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -21,7 +21,9 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record ModelCapabilitiesOverrideSupports( + /** 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/ModelCapabilitiesSupports.java b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesSupports.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesSupports.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesSupports.java index f898f130f5..91a98b423d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelCapabilitiesSupports.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelCapabilitiesSupports.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPickerCategory.java b/src/generated/java/com/github/copilot/generated/rpc/ModelPickerCategory.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPickerCategory.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelPickerCategory.java index ba0bdddfd1..ab36abfd9f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPickerCategory.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelPickerCategory.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPickerPriceCategory.java b/src/generated/java/com/github/copilot/generated/rpc/ModelPickerPriceCategory.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPickerPriceCategory.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelPickerPriceCategory.java index cf722e4968..8f70503957 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPickerPriceCategory.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelPickerPriceCategory.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPolicy.java b/src/generated/java/com/github/copilot/generated/rpc/ModelPolicy.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPolicy.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelPolicy.java index d3d218bec2..f37fb85d07 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelPolicy.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelPolicy.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,7 +22,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record ModelPolicy( /** Current policy state for this model */ - @JsonProperty("state") String state, + @JsonProperty("state") ModelPolicyState state, /** Usage terms or conditions for this model */ @JsonProperty("terms") String terms ) { diff --git a/src/generated/java/com/github/copilot/generated/rpc/ModelPolicyState.java b/src/generated/java/com/github/copilot/generated/rpc/ModelPolicyState.java new file mode 100644 index 0000000000..525d57ca6e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelPolicyState.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Current policy state for this model + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ModelPolicyState { + /** The {@code enabled} variant. */ + ENABLED("enabled"), + /** The {@code disabled} variant. */ + DISABLED("disabled"), + /** The {@code unconfigured} variant. */ + UNCONFIGURED("unconfigured"); + + private final String value; + ModelPolicyState(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ModelPolicyState fromValue(String value) { + for (ModelPolicyState v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ModelPolicyState value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelsListResult.java b/src/generated/java/com/github/copilot/generated/rpc/ModelsListResult.java similarity index 85% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ModelsListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/ModelsListResult.java index a56eeb9d6e..0ae1acfcec 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ModelsListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ModelsListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code models.list} RPC method. + * List of Copilot models available to the resolved user, including capabilities and billing metadata. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/OpenCanvasInstance.java b/src/generated/java/com/github/copilot/generated/rpc/OpenCanvasInstance.java new file mode 100644 index 0000000000..5b373ee23e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/OpenCanvasInstance.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.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; + +/** + * Open canvas instance snapshot. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record OpenCanvasInstance( + /** Stable caller-supplied canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Owning extension display name, when available */ + @JsonProperty("extensionName") String extensionName, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Rendered title */ + @JsonProperty("title") String title, + /** Provider-supplied status text */ + @JsonProperty("status") String status, + /** URL for web-rendered canvases */ + @JsonProperty("url") String url, + /** Input supplied when the instance was opened */ + @JsonProperty("input") Object input, + /** Whether this snapshot came from an idempotent reopen */ + @JsonProperty("reopen") Boolean reopen, + /** Runtime-controlled routing state for an open canvas instance. */ + @JsonProperty("availability") CanvasInstanceAvailability availability +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/OptionsUpdateEnvValueMode.java b/src/generated/java/com/github/copilot/generated/rpc/OptionsUpdateEnvValueMode.java new file mode 100644 index 0000000000..7be82f9d5b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/OptionsUpdateEnvValueMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum OptionsUpdateEnvValueMode { + /** The {@code direct} variant. */ + DIRECT("direct"), + /** The {@code indirect} variant. */ + INDIRECT("indirect"); + + private final String value; + OptionsUpdateEnvValueMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static OptionsUpdateEnvValueMode fromValue(String value) { + for (OptionsUpdateEnvValueMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown OptionsUpdateEnvValueMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/OptionsUpdateToolFilterPrecedence.java b/src/generated/java/com/github/copilot/generated/rpc/OptionsUpdateToolFilterPrecedence.java new file mode 100644 index 0000000000..57fdc6daea --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/OptionsUpdateToolFilterPrecedence.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum OptionsUpdateToolFilterPrecedence { + /** The {@code available} variant. */ + AVAILABLE("available"), + /** The {@code excluded} variant. */ + EXCLUDED("excluded"); + + private final String value; + OptionsUpdateToolFilterPrecedence(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static OptionsUpdateToolFilterPrecedence fromValue(String value) { + for (OptionsUpdateToolFilterPrecedence v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown OptionsUpdateToolFilterPrecedence value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PendingPermissionRequest.java b/src/generated/java/com/github/copilot/generated/rpc/PendingPermissionRequest.java new file mode 100644 index 0000000000..de370ca5d6 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PendingPermissionRequest.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.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; + +/** + * Schema for the `PendingPermissionRequest` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PendingPermissionRequest( + /** Unique identifier for the pending permission request */ + @JsonProperty("requestId") String requestId, + /** The user-facing permission prompt details (commands, write, read, mcp, url, memory, custom-tool, path, hook) */ + @JsonProperty("request") Object request +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionLocationType.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionLocationType.java new file mode 100644 index 0000000000..1b00c5bf55 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionLocationType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Whether the location is a git repo or directory + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PermissionLocationType { + /** The {@code repo} variant. */ + REPO("repo"), + /** The {@code dir} variant. */ + DIR("dir"); + + private final String value; + PermissionLocationType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionLocationType fromValue(String value) { + for (PermissionLocationType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionLocationType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionPathsConfig.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionPathsConfig.java new file mode 100644 index 0000000000..29aef6c66f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionPathsConfig.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.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; + +/** + * If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PermissionPathsConfig( + /** If true, the runtime allows access to all paths without prompting. Equivalent to constructing an UnrestrictedPathManager. */ + @JsonProperty("unrestricted") Boolean unrestricted, + /** Additional directories to allow tool access to (in addition to the session's working directory). When `unrestricted` is true, these are still pre-populated on the UnrestrictedPathManager so they remain visible via getDirectories() (e.g. for @-mention completion). */ + @JsonProperty("additionalDirectories") List additionalDirectories, + /** Whether to include the system temp directory in the allowed list (defaults to true). Ignored when `unrestricted` is true. */ + @JsonProperty("includeTempDirectory") Boolean includeTempDirectory, + /** Workspace root path (special-cased to be allowed even before the directory exists). Ignored when `unrestricted` is true. */ + @JsonProperty("workspacePath") String workspacePath +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionRule.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionRule.java new file mode 100644 index 0000000000..7980e0e832 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionRule.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.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; + +/** + * Schema for the `PermissionRule` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PermissionRule( + /** The rule kind, such as Shell or GitHubMCP */ + @JsonProperty("kind") String kind, + /** Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory'). */ + @JsonProperty("argument") String argument +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionRulesSet.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionRulesSet.java new file mode 100644 index 0000000000..7cc00563f5 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionRulesSet.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.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; + +/** + * If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PermissionRulesSet( + /** Rules that auto-approve matching requests */ + @JsonProperty("approved") List approved, + /** Rules that auto-deny matching requests */ + @JsonProperty("denied") List denied +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionUrlsConfig.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionUrlsConfig.java new file mode 100644 index 0000000000..728e7b40dd --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionUrlsConfig.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.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; + +/** + * If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PermissionUrlsConfig( + /** If true, the runtime allows access to all URLs without prompting. Initial allow-list is ignored when this is true. */ + @JsonProperty("unrestricted") Boolean unrestricted, + /** Initial list of allowed URL/domain patterns. Patterns may include path components. Ignored when `unrestricted` is true. */ + @JsonProperty("initialAllowed") List initialAllowed +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicy.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicy.java new file mode 100644 index 0000000000..61108c16bb --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicy.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.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; + +/** + * Schema for the `PermissionsConfigureAdditionalContentExclusionPolicy` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PermissionsConfigureAdditionalContentExclusionPolicy( + @JsonProperty("rules") List rules, + @JsonProperty("last_updated_at") Object lastUpdatedAt, + /** Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration. */ + @JsonProperty("scope") PermissionsConfigureAdditionalContentExclusionPolicyScope scope +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyRule.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyRule.java new file mode 100644 index 0000000000..c6c7f649a9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyRule.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.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; + +/** + * Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRule` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PermissionsConfigureAdditionalContentExclusionPolicyRule( + @JsonProperty("paths") List paths, + @JsonProperty("ifAnyMatch") List ifAnyMatch, + @JsonProperty("ifNoneMatch") List ifNoneMatch, + /** Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRuleSource` type. */ + @JsonProperty("source") PermissionsConfigureAdditionalContentExclusionPolicyRuleSource source +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyRuleSource.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyRuleSource.java new file mode 100644 index 0000000000..a5d4a45f32 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyRuleSource.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.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; + +/** + * Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRuleSource` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record PermissionsConfigureAdditionalContentExclusionPolicyRuleSource( + @JsonProperty("name") String name, + @JsonProperty("type") String type +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyScope.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyScope.java new file mode 100644 index 0000000000..f006888b79 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionsConfigureAdditionalContentExclusionPolicyScope.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PermissionsConfigureAdditionalContentExclusionPolicyScope { + /** The {@code repo} variant. */ + REPO("repo"), + /** The {@code all} variant. */ + ALL("all"); + + private final String value; + PermissionsConfigureAdditionalContentExclusionPolicyScope(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionsConfigureAdditionalContentExclusionPolicyScope fromValue(String value) { + for (PermissionsConfigureAdditionalContentExclusionPolicyScope v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionsConfigureAdditionalContentExclusionPolicyScope value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionsModifyRulesScope.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionsModifyRulesScope.java new file mode 100644 index 0000000000..f574befcfd --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionsModifyRulesScope.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PermissionsModifyRulesScope { + /** The {@code session} variant. */ + SESSION("session"), + /** The {@code location} variant. */ + LOCATION("location"); + + private final String value; + PermissionsModifyRulesScope(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionsModifyRulesScope fromValue(String value) { + for (PermissionsModifyRulesScope v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionsModifyRulesScope value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/PermissionsSetApproveAllSource.java b/src/generated/java/com/github/copilot/generated/rpc/PermissionsSetApproveAllSource.java new file mode 100644 index 0000000000..b86b09dfa3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/PermissionsSetApproveAllSource.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum PermissionsSetApproveAllSource { + /** The {@code cli_flag} variant. */ + CLI_FLAG("cli_flag"), + /** The {@code slash_command} variant. */ + SLASH_COMMAND("slash_command"), + /** The {@code autopilot_confirmation} variant. */ + AUTOPILOT_CONFIRMATION("autopilot_confirmation"), + /** The {@code rpc} variant. */ + RPC("rpc"); + + private final String value; + PermissionsSetApproveAllSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static PermissionsSetApproveAllSource fromValue(String value) { + for (PermissionsSetApproveAllSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown PermissionsSetApproveAllSource value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/PingParams.java b/src/generated/java/com/github/copilot/generated/rpc/PingParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/PingParams.java rename to src/generated/java/com/github/copilot/generated/rpc/PingParams.java index 892d5cbb2d..2e00e6cac2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/PingParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/PingParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code ping} RPC method. + * Optional message to echo back to the caller. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.java b/src/generated/java/com/github/copilot/generated/rpc/PingResult.java similarity index 75% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.java rename to src/generated/java/com/github/copilot/generated/rpc/PingResult.java index b91b2fb02b..ded50ecbdd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/PingResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/PingResult.java @@ -5,15 +5,16 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; import javax.annotation.processing.Generated; /** - * Result for the {@code ping} RPC method. + * Server liveness response, including the echoed message, current server timestamp, and protocol version. * * @since 1.0.0 */ @@ -23,8 +24,8 @@ public record PingResult( /** Echoed message (or default greeting) */ @JsonProperty("message") String message, - /** Server timestamp in milliseconds */ - @JsonProperty("timestamp") Long timestamp, + /** ISO 8601 timestamp when the server handled the ping */ + @JsonProperty("timestamp") OffsetDateTime timestamp, /** Server protocol version number */ @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/generated/rpc/Plugin.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/Plugin.java rename to src/generated/java/com/github/copilot/generated/rpc/Plugin.java index 64edf086ec..b10cd31cf7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/Plugin.java +++ b/src/generated/java/com/github/copilot/generated/rpc/Plugin.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `Plugin` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItems.java b/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItems.java new file mode 100644 index 0000000000..bfbc87f463 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItems.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.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; + +/** + * Schema for the `QueuePendingItems` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record QueuePendingItems( + /** Whether this item is a queued user message or a queued slash command / model change */ + @JsonProperty("kind") QueuePendingItemsKind kind, + /** Human-readable text to display for this queue entry in the UI */ + @JsonProperty("displayText") String displayText +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItemsKind.java b/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItemsKind.java new file mode 100644 index 0000000000..7cf13a2570 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/QueuePendingItemsKind.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Whether this item is a queued user message or a queued slash command / model change + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum QueuePendingItemsKind { + /** The {@code message} variant. */ + MESSAGE("message"), + /** The {@code command} variant. */ + COMMAND("command"); + + private final String value; + QueuePendingItemsKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static QueuePendingItemsKind fromValue(String value) { + for (QueuePendingItemsKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown QueuePendingItemsKind value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/ReasoningSummary.java b/src/generated/java/com/github/copilot/generated/rpc/ReasoningSummary.java new file mode 100644 index 0000000000..3b95a9e2b2 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ReasoningSummary.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Reasoning summary mode to request for supported model clients + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ReasoningSummary { + /** The {@code none} variant. */ + NONE("none"), + /** The {@code concise} variant. */ + CONCISE("concise"), + /** The {@code detailed} variant. */ + DETAILED("detailed"); + + private final String value; + ReasoningSummary(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ReasoningSummary fromValue(String value) { + for (ReasoningSummary v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ReasoningSummary value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/RemoteSessionMode.java b/src/generated/java/com/github/copilot/generated/rpc/RemoteSessionMode.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/RemoteSessionMode.java rename to src/generated/java/com/github/copilot/generated/rpc/RemoteSessionMode.java index 4f659bb6b6..68c3e66170 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/RemoteSessionMode.java +++ b/src/generated/java/com/github/copilot/generated/rpc/RemoteSessionMode.java @@ -5,12 +5,12 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; /** - * Per-session remote mode. "off" disables remote, "export" exports session events to Mission Control without enabling remote steering, "on" enables both export and remote steering. + * Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/RpcCaller.java b/src/generated/java/com/github/copilot/generated/rpc/RpcCaller.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/RpcCaller.java rename to src/generated/java/com/github/copilot/generated/rpc/RpcCaller.java index d15513ce0b..67e7571a16 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/RpcCaller.java +++ b/src/generated/java/com/github/copilot/generated/rpc/RpcCaller.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/RpcMapper.java b/src/generated/java/com/github/copilot/generated/rpc/RpcMapper.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/RpcMapper.java rename to src/generated/java/com/github/copilot/generated/rpc/RpcMapper.java index 87d4328209..0d2a4e8b73 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/RpcMapper.java +++ b/src/generated/java/com/github/copilot/generated/rpc/RpcMapper.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/generated/rpc/ScheduleEntry.java b/src/generated/java/com/github/copilot/generated/rpc/ScheduleEntry.java new file mode 100644 index 0000000000..fb41975bd1 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ScheduleEntry.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.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 javax.annotation.processing.Generated; + +/** + * Schema for the `ScheduleEntry` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ScheduleEntry( + /** Sequential id assigned by the runtime within the session. Stable across resumes (rebuilt from the event log). */ + @JsonProperty("id") Long id, + /** Interval between scheduled ticks, in milliseconds. */ + @JsonProperty("intervalMs") Long intervalMs, + /** Prompt text that gets enqueued on every tick. */ + @JsonProperty("prompt") String prompt, + /** Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). */ + @JsonProperty("recurring") Boolean recurring, + /** Display-only label for the prompt as shown in the UI (e.g. `/skill-name` for a skill-invocation schedule). The actual enqueued prompt is `prompt`. */ + @JsonProperty("displayPrompt") String displayPrompt, + /** ISO 8601 timestamp when the next tick is scheduled to fire. */ + @JsonProperty("nextRunAt") OffsetDateTime nextRunAt +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SecretsAddFilterValuesParams.java b/src/generated/java/com/github/copilot/generated/rpc/SecretsAddFilterValuesParams.java new file mode 100644 index 0000000000..3643773114 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SecretsAddFilterValuesParams.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.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; + +/** + * Secret values to add to the redaction filter. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SecretsAddFilterValuesParams( + /** Raw secret values to register for redaction */ + @JsonProperty("values") List values +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SecretsAddFilterValuesResult.java b/src/generated/java/com/github/copilot/generated/rpc/SecretsAddFilterValuesResult.java new file mode 100644 index 0000000000..f6261b638c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SecretsAddFilterValuesResult.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.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; + +/** + * Confirmation that the secret values were registered. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SecretsAddFilterValuesResult( + /** Whether the values were successfully registered */ + @JsonProperty("ok") Boolean ok +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SendAgentMode.java b/src/generated/java/com/github/copilot/generated/rpc/SendAgentMode.java new file mode 100644 index 0000000000..641a1ac474 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SendAgentMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * The UI mode the agent was in when this message was sent. Defaults to the session's current mode. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SendAgentMode { + /** 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; + SendAgentMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SendAgentMode fromValue(String value) { + for (SendAgentMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SendAgentMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SendMode.java b/src/generated/java/com/github/copilot/generated/rpc/SendMode.java new file mode 100644 index 0000000000..013f595971 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SendMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SendMode { + /** The {@code enqueue} variant. */ + ENQUEUE("enqueue"), + /** The {@code immediate} variant. */ + IMMEDIATE("immediate"); + + private final String value; + SendMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SendMode fromValue(String value) { + for (SendMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SendMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerAccountApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerAccountApi.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerAccountApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerAccountApi.java index ecbe8a1057..d3bd444608 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerAccountApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerAccountApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -26,7 +26,7 @@ public final class ServerAccountApi { } /** - * Invokes {@code account.getQuota}. + * Optional GitHub token used to look up quota for a specific user instead of the global auth context. * @since 1.0.0 */ public CompletableFuture getQuota() { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSessionsApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerAgentRegistryApi.java similarity index 64% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSessionsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerAgentRegistryApi.java index 6d1aa06519..f1a0d4bb5e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSessionsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerAgentRegistryApi.java @@ -5,34 +5,34 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; /** - * API methods for the {@code sessions} namespace. + * API methods for the {@code agentRegistry} namespace. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class ServerSessionsApi { +public final class ServerAgentRegistryApi { private final RpcCaller caller; /** @param caller the RPC transport function */ - ServerSessionsApi(RpcCaller caller) { + ServerAgentRegistryApi(RpcCaller caller) { this.caller = caller; } /** - * Invokes {@code sessions.fork}. + * Inputs to spawn a managed-server child via the controller's spawn delegate. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture fork(SessionsForkParams params) { - return caller.invoke("sessions.fork", params, SessionsForkResult.class); + public CompletableFuture spawn(AgentRegistrySpawnParams params) { + return caller.invoke("agentRegistry.spawn", params, Void.class); } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerMcpApi.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerMcpApi.java index 6c376d0fe9..6ff26e80dd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerMcpApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,7 @@ public final class ServerMcpApi { } /** - * Invokes {@code mcp.discover}. + * Optional working directory used as context for MCP server discovery. * @since 1.0.0 */ public CompletableFuture discover(McpDiscoverParams params) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpConfigApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerMcpConfigApi.java similarity index 82% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpConfigApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerMcpConfigApi.java index 9e9677e42a..6f0a2105d9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerMcpConfigApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerMcpConfigApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -26,7 +26,7 @@ public final class ServerMcpConfigApi { } /** - * Invokes {@code mcp.config.list}. + * User-configured MCP servers, keyed by server name. * @since 1.0.0 */ public CompletableFuture list() { @@ -34,7 +34,7 @@ public CompletableFuture list() { } /** - * Invokes {@code mcp.config.add}. + * MCP server name and configuration to add to user configuration. * @since 1.0.0 */ public CompletableFuture add(McpConfigAddParams params) { @@ -42,7 +42,7 @@ public CompletableFuture add(McpConfigAddParams params) { } /** - * Invokes {@code mcp.config.update}. + * MCP server name and replacement configuration to write to user configuration. * @since 1.0.0 */ public CompletableFuture update(McpConfigUpdateParams params) { @@ -50,7 +50,7 @@ public CompletableFuture update(McpConfigUpdateParams params) { } /** - * Invokes {@code mcp.config.remove}. + * MCP server name to remove from user configuration. * @since 1.0.0 */ public CompletableFuture remove(McpConfigRemoveParams params) { @@ -58,7 +58,7 @@ public CompletableFuture remove(McpConfigRemoveParams params) { } /** - * Invokes {@code mcp.config.enable}. + * MCP server names to enable for new sessions. * @since 1.0.0 */ public CompletableFuture enable(McpConfigEnableParams params) { @@ -66,7 +66,7 @@ public CompletableFuture enable(McpConfigEnableParams params) { } /** - * Invokes {@code mcp.config.disable}. + * MCP server names to disable for new sessions. * @since 1.0.0 */ public CompletableFuture disable(McpConfigDisableParams params) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerModelsApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerModelsApi.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerModelsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerModelsApi.java index c3f83b45cc..c0515a06f4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerModelsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerModelsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -26,7 +26,7 @@ public final class ServerModelsApi { } /** - * Invokes {@code models.list}. + * Optional GitHub token used to list models for a specific user instead of the global auth context. * @since 1.0.0 */ public CompletableFuture list() { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerRpc.java b/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java similarity index 82% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerRpc.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java index b82c49ec23..8d97676580 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerRpc.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerRpc.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,6 +30,8 @@ public final class ServerRpc { public final ServerToolsApi tools; /** API methods for the {@code account} namespace. */ public final ServerAccountApi account; + /** API methods for the {@code secrets} namespace. */ + public final ServerSecretsApi secrets; /** API methods for the {@code mcp} namespace. */ public final ServerMcpApi mcp; /** API methods for the {@code skills} namespace. */ @@ -38,6 +40,8 @@ public final class ServerRpc { public final ServerSessionFsApi sessionFs; /** API methods for the {@code sessions} namespace. */ public final ServerSessionsApi sessions; + /** API methods for the {@code agentRegistry} namespace. */ + public final ServerAgentRegistryApi agentRegistry; /** * Creates a new server RPC client. @@ -49,14 +53,16 @@ public ServerRpc(RpcCaller caller) { this.models = new ServerModelsApi(caller); this.tools = new ServerToolsApi(caller); this.account = new ServerAccountApi(caller); + this.secrets = new ServerSecretsApi(caller); this.mcp = new ServerMcpApi(caller); this.skills = new ServerSkillsApi(caller); this.sessionFs = new ServerSessionFsApi(caller); this.sessions = new ServerSessionsApi(caller); + this.agentRegistry = new ServerAgentRegistryApi(caller); } /** - * Invokes {@code ping}. + * Optional message to echo back to the caller. * @since 1.0.0 */ public CompletableFuture ping(PingParams params) { @@ -64,7 +70,7 @@ public CompletableFuture ping(PingParams params) { } /** - * Invokes {@code connect}. + * Optional connection token presented by the SDK client during the handshake. * @since 1.0.0 */ public CompletableFuture connect(ConnectParams params) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerSecretsApi.java similarity index 57% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerSecretsApi.java index 93624213e8..800722c858 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerSecretsApi.java @@ -5,34 +5,32 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; /** - * API methods for the {@code auth} namespace. + * API methods for the {@code secrets} namespace. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionAuthApi { +public final class ServerSecretsApi { private final RpcCaller caller; - private final String sessionId; /** @param caller the RPC transport function */ - SessionAuthApi(RpcCaller caller, String sessionId) { + ServerSecretsApi(RpcCaller caller) { this.caller = caller; - this.sessionId = sessionId; } /** - * Invokes {@code session.auth.getStatus}. + * Secret values to add to the redaction filter. * @since 1.0.0 */ - public CompletableFuture getStatus() { - return caller.invoke("session.auth.getStatus", java.util.Map.of("sessionId", this.sessionId), SessionAuthGetStatusResult.class); + public CompletableFuture addFilterValues(SecretsAddFilterValuesParams params) { + return caller.invoke("secrets.addFilterValues", params, SecretsAddFilterValuesResult.class); } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSessionFsApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerSessionFsApi.java similarity index 83% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSessionFsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerSessionFsApi.java index 068ff939f7..93022becf2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSessionFsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerSessionFsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -26,7 +26,7 @@ public final class ServerSessionFsApi { } /** - * Invokes {@code sessionFs.setProvider}. + * Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider. * @since 1.0.0 */ public CompletableFuture setProvider(SessionFsSetProviderParams params) { diff --git a/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java new file mode 100644 index 0000000000..ece70c84aa --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerSessionsApi.java @@ -0,0 +1,218 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code sessions} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class ServerSessionsApi { + + private final RpcCaller caller; + + /** @param caller the RPC transport function */ + ServerSessionsApi(RpcCaller caller) { + this.caller = caller; + } + + /** + * Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture fork(SessionsForkParams params) { + return caller.invoke("sessions.fork", params, SessionsForkResult.class); + } + + /** + * Remote session connection parameters. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture connect() { + return caller.invoke("sessions.connect", java.util.Map.of(), SessionsConnectResult.class); + } + + /** + * Optional metadata-load limit and filters applied to the returned sessions. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture list() { + return caller.invoke("sessions.list", java.util.Map.of(), SessionsListResult.class); + } + + /** + * GitHub task ID to look up. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture findByTaskId(SessionsFindByTaskIdParams params) { + return caller.invoke("sessions.findByTaskId", params, SessionsFindByTaskIdResult.class); + } + + /** + * UUID prefix to resolve to a unique session ID. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture findByPrefix(SessionsFindByPrefixParams params) { + return caller.invoke("sessions.findByPrefix", params, SessionsFindByPrefixResult.class); + } + + /** + * Optional working-directory context used to score session relevance. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getLastForContext(SessionsGetLastForContextParams params) { + return caller.invoke("sessions.getLastForContext", params, SessionsGetLastForContextResult.class); + } + + /** + * Session ID whose event-log file path to compute. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getEventFilePath() { + return caller.invoke("sessions.getEventFilePath", java.util.Map.of(), SessionsGetEventFilePathResult.class); + } + + /** + * Map of sessionId -> on-disk size in bytes for each session's workspace directory. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getSizes() { + return caller.invoke("sessions.getSizes", java.util.Map.of(), SessionsGetSizesResult.class); + } + + /** + * Session IDs to test for live in-use locks. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture checkInUse(SessionsCheckInUseParams params) { + return caller.invoke("sessions.checkInUse", params, SessionsCheckInUseResult.class); + } + + /** + * Session ID to look up the persisted remote-steerable flag for. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getPersistedRemoteSteerable() { + return caller.invoke("sessions.getPersistedRemoteSteerable", java.util.Map.of(), SessionsGetPersistedRemoteSteerableResult.class); + } + + /** + * Session ID to close. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture close() { + return caller.invoke("sessions.close", java.util.Map.of(), Void.class); + } + + /** + * Session IDs to close, deactivate, and delete from disk. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture bulkDelete(SessionsBulkDeleteParams params) { + return caller.invoke("sessions.bulkDelete", params, SessionsBulkDeleteResult.class); + } + + /** + * Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true). + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture pruneOld(SessionsPruneOldParams params) { + return caller.invoke("sessions.pruneOld", params, SessionsPruneOldResult.class); + } + + /** + * Session ID whose pending events should be flushed to disk. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture save() { + return caller.invoke("sessions.save", java.util.Map.of(), Void.class); + } + + /** + * Session ID whose in-use lock should be released. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture releaseLock() { + return caller.invoke("sessions.releaseLock", java.util.Map.of(), Void.class); + } + + /** + * Session metadata records to enrich with summary and context information. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture enrichMetadata(SessionsEnrichMetadataParams params) { + return caller.invoke("sessions.enrichMetadata", params, SessionsEnrichMetadataResult.class); + } + + /** + * Active session ID and an optional flag for deferring repo-level hooks until folder trust. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture reloadPluginHooks(SessionsReloadPluginHooksParams params) { + return caller.invoke("sessions.reloadPluginHooks", params, Void.class); + } + + /** + * Active session ID whose deferred repo-level hooks should be loaded. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture loadDeferredRepoHooks() { + return caller.invoke("sessions.loadDeferredRepoHooks", java.util.Map.of(), SessionsLoadDeferredRepoHooksResult.class); + } + + /** + * Manager-wide additional plugins to register; replaces any previously-configured set. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture setAdditionalPlugins(SessionsSetAdditionalPluginsParams params) { + return caller.invoke("sessions.setAdditionalPlugins", params, Void.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkill.java b/src/generated/java/com/github/copilot/generated/rpc/ServerSkill.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkill.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerSkill.java index 6cb4327176..ba02ea28d7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkill.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerSkill.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `ServerSkill` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @@ -21,7 +26,7 @@ public record ServerSkill( /** Description of what the skill does */ @JsonProperty("description") String description, /** Source location type (e.g., project, personal-copilot, plugin, builtin) */ - @JsonProperty("source") String source, + @JsonProperty("source") SkillSource 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) */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerSkillsApi.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerSkillsApi.java index 943f682584..6404ab6fda 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerSkillsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,7 @@ public final class ServerSkillsApi { } /** - * Invokes {@code skills.discover}. + * Optional project paths and additional skill directories to include in discovery. * @since 1.0.0 */ public CompletableFuture discover(SkillsDiscoverParams params) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsConfigApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerSkillsConfigApi.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsConfigApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerSkillsConfigApi.java index 41eaeab01e..e552227ccb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerSkillsConfigApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerSkillsConfigApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -26,7 +26,7 @@ public final class ServerSkillsConfigApi { } /** - * Invokes {@code skills.config.setDisabledSkills}. + * Skill names to mark as disabled in global configuration, replacing any previous list. * @since 1.0.0 */ public CompletableFuture setDisabledSkills(SkillsConfigSetDisabledSkillsParams params) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerToolsApi.java b/src/generated/java/com/github/copilot/generated/rpc/ServerToolsApi.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ServerToolsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/ServerToolsApi.java index 2eb2a90f54..10e64747ef 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ServerToolsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ServerToolsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -26,7 +26,7 @@ public final class ServerToolsApi { } /** - * Invokes {@code tools.list}. + * Optional model identifier whose tool overrides should be applied to the listing. * @since 1.0.0 */ public CompletableFuture list(ToolsListParams params) { diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionAbortParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAbortParams.java new file mode 100644 index 0000000000..4738643b86 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAbortParams.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.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; + +/** + * Parameters for aborting the current turn + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAbortParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Finite reason code describing why the current turn was aborted */ + @JsonProperty("reason") AbortReason reason +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionAbortResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAbortResult.java new file mode 100644 index 0000000000..9d75b5db5c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAbortResult.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.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 of aborting the current turn + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAbortResult( + /** Whether the abort completed successfully */ + @JsonProperty("success") Boolean success, + /** Error message if the abort failed */ + @JsonProperty("error") String error +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentApi.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentApi.java index 47192e6310..c992d36e33 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,7 @@ public final class SessionAgentApi { } /** - * Invokes {@code session.agent.list}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -40,7 +40,7 @@ public CompletableFuture list() { } /** - * Invokes {@code session.agent.getCurrent}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -50,7 +50,7 @@ public CompletableFuture getCurrent() { } /** - * Invokes {@code session.agent.select}. + * Name of the custom agent to select for subsequent turns. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -65,7 +65,7 @@ public CompletableFuture select(SessionAgentSelectPara } /** - * Invokes {@code session.agent.deselect}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -75,7 +75,7 @@ public CompletableFuture deselect() { } /** - * Invokes {@code session.agent.reload}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentDeselectParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentDeselectParams.java index cd101194c7..1b10947133 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentDeselectParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.agent.deselect} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentDeselectResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentDeselectResult.java index 81e2e3ebb9..679a3fb83d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentDeselectResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentDeselectResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentGetCurrentParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentGetCurrentParams.java index c05e5fa362..59774974f5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentGetCurrentParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.agent.getCurrent} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentGetCurrentResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentGetCurrentResult.java index fea4e47b63..d4dfe25b49 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentGetCurrentResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentGetCurrentResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.agent.getCurrent} RPC method. + * The currently selected custom agent, or null when using the default agent. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentListParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentListParams.java index e14ae40c0c..9763eb5c3e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentListParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.agent.list} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentListResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentListResult.java index f572bf9aed..d7cdd11271 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.agent.list} RPC method. + * Custom agents available to the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentReloadParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentReloadParams.java index ea1b4050b0..c3467c5e9e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentReloadParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.agent.reload} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentReloadResult.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentReloadResult.java index 32928e53a1..47eec9eae5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentReloadResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentReloadResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.agent.reload} RPC method. + * Custom agents available to the session after reloading definitions from disk. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentSelectParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentSelectParams.java index 61777dde33..372d1d1f69 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentSelectParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.agent.select} RPC method. + * Name of the custom agent to select for subsequent turns. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentSelectResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAgentSelectResult.java index ab9637568d..927352e2d8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAgentSelectResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAgentSelectResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.agent.select} RPC method. + * The newly selected custom agent. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionAuthApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthApi.java new file mode 100644 index 0000000000..0f5729fe56 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthApi.java @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.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 static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + 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; + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getStatus() { + return caller.invoke("session.auth.getStatus", java.util.Map.of("sessionId", this.sessionId), SessionAuthGetStatusResult.class); + } + + /** + * New auth credentials to install on the session. Omit to leave credentials unchanged. + *

+ * 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 setCredentials(SessionAuthSetCredentialsParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.auth.setCredentials", _p, SessionAuthSetCredentialsResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthGetStatusParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAuthGetStatusParams.java index 059833d374..d57a3ccccc 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthGetStatusParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.auth.getStatus} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthGetStatusResult.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionAuthGetStatusResult.java index 737c2ae9ea..3480257cc9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionAuthGetStatusResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthGetStatusResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.auth.getStatus} RPC method. + * Authentication status and account metadata for the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionAuthSetCredentialsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthSetCredentialsParams.java new file mode 100644 index 0000000000..0b3b7aa9d3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthSetCredentialsParams.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.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; + +/** + * New auth credentials to install on the session. Omit to leave credentials unchanged. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAuthSetCredentialsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime stores the value verbatim and uses it for outbound model/API requests; it does NOT re-validate or re-fetch the associated Copilot user response. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit. */ + @JsonProperty("credentials") Object credentials +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionAuthSetCredentialsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthSetCredentialsResult.java new file mode 100644 index 0000000000..ad53ee9192 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionAuthSetCredentialsResult.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.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; + +/** + * Indicates whether the credential update succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionAuthSetCredentialsResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasApi.java new file mode 100644 index 0000000000..8388c82a28 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasApi.java @@ -0,0 +1,97 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code canvas} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCanvasApi { + + 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 */ + SessionCanvasApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture list() { + return caller.invoke("session.canvas.list", java.util.Map.of("sessionId", this.sessionId), SessionCanvasListResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture listOpen() { + return caller.invoke("session.canvas.listOpen", java.util.Map.of("sessionId", this.sessionId), SessionCanvasListOpenResult.class); + } + + /** + * Canvas open parameters. + *

+ * 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 open(SessionCanvasOpenParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.canvas.open", _p, SessionCanvasOpenResult.class); + } + + /** + * Canvas close parameters. + *

+ * 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 close(SessionCanvasCloseParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.canvas.close", _p, Void.class); + } + + /** + * Canvas action invocation parameters. + *

+ * 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 invokeAction(SessionCanvasInvokeActionParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.canvas.invokeAction", _p, SessionCanvasInvokeActionResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasCloseParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasCloseParams.java new file mode 100644 index 0000000000..d87e837708 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasCloseParams.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.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; + +/** + * Canvas close parameters. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasCloseParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Open canvas instance identifier */ + @JsonProperty("instanceId") String instanceId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasInvokeActionParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasInvokeActionParams.java new file mode 100644 index 0000000000..3696e3e3ed --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasInvokeActionParams.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.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; + +/** + * Canvas action invocation parameters. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasInvokeActionParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Open canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Action name to invoke */ + @JsonProperty("actionName") String actionName, + /** Action input */ + @JsonProperty("input") Object input +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasInvokeActionResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasInvokeActionResult.java new file mode 100644 index 0000000000..117b618aea --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasInvokeActionResult.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.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; + +/** + * Canvas action invocation result. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasInvokeActionResult( + /** Provider-supplied action result */ + @JsonProperty("result") Object result +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListOpenParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListOpenParams.java new file mode 100644 index 0000000000..6015d9bd6f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListOpenParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasListOpenParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListOpenResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListOpenResult.java new file mode 100644 index 0000000000..f9af151e29 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListOpenResult.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.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; + +/** + * Live open-canvas snapshot. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasListOpenResult( + /** Currently open canvas instances */ + @JsonProperty("openCanvases") List openCanvases +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListParams.java new file mode 100644 index 0000000000..d49d90e6c7 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListResult.java new file mode 100644 index 0000000000..a4d33998a9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasListResult.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.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; + +/** + * Declared canvases available in this session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasListResult( + /** Declared canvases available in this session */ + @JsonProperty("canvases") List canvases +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenParams.java new file mode 100644 index 0000000000..8b56ad50a8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenParams.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.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; + +/** + * Canvas open parameters. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasOpenParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Owning provider identifier. Optional when the canvasId is unique across providers; required to disambiguate when multiple providers register the same canvasId. */ + @JsonProperty("extensionId") String extensionId, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Caller-supplied stable instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Canvas open input */ + @JsonProperty("input") Object input +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenResult.java new file mode 100644 index 0000000000..38f3a5f555 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenResult.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.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; + +/** + * Open canvas instance snapshot. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCanvasOpenResult( + /** Stable caller-supplied canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Owning extension display name, when available */ + @JsonProperty("extensionName") String extensionName, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Rendered title */ + @JsonProperty("title") String title, + /** Provider-supplied status text */ + @JsonProperty("status") String status, + /** URL for web-rendered canvases */ + @JsonProperty("url") String url, + /** Input supplied when the instance was opened */ + @JsonProperty("input") Object input, + /** Whether this snapshot came from an idempotent reopen */ + @JsonProperty("reopen") Boolean reopen, + /** Runtime-controlled routing state for an open canvas instance. */ + @JsonProperty("availability") CanvasInstanceAvailability availability +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsApi.java similarity index 57% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionCommandsApi.java index 6366af794a..b0bc291e69 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,9 @@ public final class SessionCommandsApi { } /** - * Invokes {@code session.commands.list}. + * Optional filters controlling which command sources to include in the listing. + * + * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ public CompletableFuture list() { @@ -38,10 +40,12 @@ public CompletableFuture list() { } /** - * Invokes {@code session.commands.invoke}. + * Slash command name and optional raw input string to invoke. *

* 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 invoke(SessionCommandsInvokeParams params) { @@ -51,10 +55,12 @@ public CompletableFuture invoke(SessionCommandsInvokeParams params) { } /** - * Invokes {@code session.commands.handlePendingCommand}. + * Pending command request ID and an optional error if the client handler failed. *

* 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 handlePendingCommand(SessionCommandsHandlePendingCommandParams params) { @@ -64,10 +70,42 @@ public CompletableFuture handlePendin } /** - * Invokes {@code session.commands.respondToQueuedCommand}. + * Slash command name and argument string to execute synchronously. *

* 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 execute(SessionCommandsExecuteParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.commands.execute", _p, SessionCommandsExecuteResult.class); + } + + /** + * Slash-prefixed command string to enqueue for FIFO processing. + *

+ * 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 enqueue(SessionCommandsEnqueueParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.commands.enqueue", _p, SessionCommandsEnqueueResult.class); + } + + /** + * Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands). + *

+ * 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 respondToQueuedCommand(SessionCommandsRespondToQueuedCommandParams params) { diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsEnqueueParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsEnqueueParams.java new file mode 100644 index 0000000000..f4ca14dfa5 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsEnqueueParams.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.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; + +/** + * Slash-prefixed command string to enqueue for FIFO processing. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCommandsEnqueueParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately. */ + @JsonProperty("command") String command +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsEnqueueResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsEnqueueResult.java new file mode 100644 index 0000000000..649f01ca49 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsEnqueueResult.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.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; + +/** + * Indicates whether the command was accepted into the local execution queue. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCommandsEnqueueResult( + /** True when the command was accepted into the local execution queue. False when the call targets a session that does not support local command queueing (e.g. remote sessions). */ + @JsonProperty("queued") Boolean queued +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsExecuteParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsExecuteParams.java new file mode 100644 index 0000000000..f88ac4c038 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsExecuteParams.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.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; + +/** + * Slash command name and argument string to execute synchronously. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCommandsExecuteParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the slash command to invoke (without the leading '/'). */ + @JsonProperty("commandName") String commandName, + /** Argument string to pass to the command (empty string if none). */ + @JsonProperty("args") String args +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsExecuteResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsExecuteResult.java new file mode 100644 index 0000000000..1b1c442990 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsExecuteResult.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.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; + +/** + * Error message produced while executing the command, if any. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionCommandsExecuteResult( + /** Error message produced while executing the command, if any. Omitted when the handler succeeded. */ + @JsonProperty("error") String error +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsHandlePendingCommandParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionCommandsHandlePendingCommandParams.java index e14d29486c..9b9c12514c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsHandlePendingCommandParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.commands.handlePendingCommand} RPC method. + * Pending command request ID and an optional error if the client handler failed. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsHandlePendingCommandResult.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionCommandsHandlePendingCommandResult.java index 8c79beaaee..9e3698702d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsHandlePendingCommandResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsHandlePendingCommandResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.commands.handlePendingCommand} RPC method. + * Indicates whether the pending client-handled command was completed successfully. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsInvokeParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsInvokeParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsInvokeParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionCommandsInvokeParams.java index 141ec9524d..21d92ebab2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsInvokeParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsInvokeParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.commands.invoke} RPC method. + * Slash command name and optional raw input string to invoke. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsListParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsListParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionCommandsListParams.java index dd51f0e768..d60a147d85 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsListParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsListParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.commands.list} RPC method. + * Optional filters controlling which command sources to include in the listing. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsListResult.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionCommandsListResult.java index e819ba64c1..8d532352a6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.commands.list} RPC method. + * Slash commands available in the session, after applying any include/exclude filters. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsRespondToQueuedCommandParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsRespondToQueuedCommandParams.java similarity index 75% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsRespondToQueuedCommandParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionCommandsRespondToQueuedCommandParams.java index 46796b728c..22b89f3645 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsRespondToQueuedCommandParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsRespondToQueuedCommandParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.commands.respondToQueuedCommand} RPC method. + * Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands). * * @since 1.0.0 */ @@ -23,9 +23,9 @@ public record SessionCommandsRespondToQueuedCommandParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, - /** Request ID from the queued command event */ + /** Request ID from the `command.queued` event the host is responding to. */ @JsonProperty("requestId") String requestId, - /** Result of the queued command execution */ + /** Result of the queued command execution. */ @JsonProperty("result") Object result ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsRespondToQueuedCommandResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsRespondToQueuedCommandResult.java similarity index 74% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsRespondToQueuedCommandResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionCommandsRespondToQueuedCommandResult.java index 272849411a..1cc3961391 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionCommandsRespondToQueuedCommandResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionCommandsRespondToQueuedCommandResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.commands.respondToQueuedCommand} RPC method. + * Indicates whether the queued-command response was matched to a pending request. * * @since 1.0.0 */ @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record SessionCommandsRespondToQueuedCommandResult( - /** Whether the response was accepted (false if the requestId was not found or already resolved) */ + /** Whether a pending queued command with the given request ID was found and resolved. False when the request was already resolved, cancelled, or unknown. */ @JsonProperty("success") Boolean success ) { } diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionContext.java b/src/generated/java/com/github/copilot/generated/rpc/SessionContext.java new file mode 100644 index 0000000000..50376a0f0a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionContext.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.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; + +/** + * Schema for the `SessionContext` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionContext( + /** Most recent working directory for this session */ + @JsonProperty("cwd") String cwd, + /** Git repository root, if the cwd was inside a git repo */ + @JsonProperty("gitRoot") String gitRoot, + /** Repository slug in `owner/name` form, when known */ + @JsonProperty("repository") String repository, + /** Repository host type */ + @JsonProperty("hostType") SessionContextHostType hostType, + /** Active git branch */ + @JsonProperty("branch") String branch +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionContextHostType.java b/src/generated/java/com/github/copilot/generated/rpc/SessionContextHostType.java new file mode 100644 index 0000000000..8eea0e7190 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionContextHostType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Repository host type + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionContextHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + SessionContextHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionContextHostType fromValue(String value) { + for (SessionContextHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionContextHostType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogApi.java new file mode 100644 index 0000000000..eac102aef1 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogApi.java @@ -0,0 +1,87 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code eventLog} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionEventLogApi { + + 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 */ + SessionEventLogApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Cursor, batch size, and optional long-poll/filter parameters for reading session events. + *

+ * 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 read(SessionEventLogReadParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.eventLog.read", _p, SessionEventLogReadResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture tail() { + return caller.invoke("session.eventLog.tail", java.util.Map.of("sessionId", this.sessionId), SessionEventLogTailResult.class); + } + + /** + * Event type to register consumer interest for, used by runtime gating logic. + *

+ * 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 registerInterest(SessionEventLogRegisterInterestParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.eventLog.registerInterest", _p, SessionEventLogRegisterInterestResult.class); + } + + /** + * Opaque handle previously returned by `registerInterest` to release. + *

+ * 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 releaseInterest(SessionEventLogReleaseInterestParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.eventLog.releaseInterest", _p, SessionEventLogReleaseInterestResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadParams.java new file mode 100644 index 0000000000..a77e8a8711 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadParams.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.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; + +/** + * Cursor, batch size, and optional long-poll/filter parameters for reading session events. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionEventLogReadParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history. */ + @JsonProperty("cursor") String cursor, + /** Maximum number of events to return in this batch (1–1000, default 200). */ + @JsonProperty("max") Long max, + /** Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). */ + @JsonProperty("waitMs") Long waitMs, + /** Either '*' to receive all event types, or a non-empty list of event types to receive */ + @JsonProperty("types") Object types, + /** Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. */ + @JsonProperty("agentScope") EventsAgentScope agentScope +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.java new file mode 100644 index 0000000000..dcd138e7ba --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReadResult.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.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; + +/** + * Batch of session events returned by a read, with cursor and continuation metadata. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionEventLogReadResult( + /** Events are delivered in two batches per read: persisted events first (in append order), then ephemeral events (in seq order). When `waitMs > 0` and the catch-up batches were empty, post-wait events follow the same two-batch ordering. Persisted and ephemeral events do not interleave within a single read. */ + @JsonProperty("events") List events, + /** Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. */ + @JsonProperty("cursor") String cursor, + /** True when the read returned `max` events and more events are available immediately. When false, the next read with a non-zero `waitMs` will block until a new event arrives or the wait expires. */ + @JsonProperty("hasMore") Boolean hasMore, + /** Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. */ + @JsonProperty("cursorStatus") EventsCursorStatus cursorStatus +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestParams.java new file mode 100644 index 0000000000..94f68bdf76 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestParams.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.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; + +/** + * Event type to register consumer interest for, used by runtime gating logic. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionEventLogRegisterInterestParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. */ + @JsonProperty("eventType") String eventType +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestResult.java new file mode 100644 index 0000000000..ac4da49d00 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogRegisterInterestResult.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.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; + +/** + * Opaque handle representing an event-type interest registration. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionEventLogRegisterInterestResult( + /** Opaque handle for this registration. Pass to releaseInterest to release. Each call to registerInterest produces a fresh handle, even when the same eventType is registered multiple times. */ + @JsonProperty("handle") String handle +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReleaseInterestParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReleaseInterestParams.java new file mode 100644 index 0000000000..1eea25f44f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReleaseInterestParams.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.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; + +/** + * Opaque handle previously returned by `registerInterest` to release. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionEventLogReleaseInterestParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type. */ + @JsonProperty("handle") String handle +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReleaseInterestResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReleaseInterestResult.java new file mode 100644 index 0000000000..39cf07afa1 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogReleaseInterestResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionEventLogReleaseInterestResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogTailParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogTailParams.java new file mode 100644 index 0000000000..3906d7e6e7 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogTailParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionEventLogTailParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogTailResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogTailResult.java new file mode 100644 index 0000000000..1b29827d38 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionEventLogTailResult.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.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; + +/** + * Snapshot of the current tail cursor without returning any events. Use this when a consumer wants to subscribe to live events going forward without first paginating through the entire persisted history (which would happen if `read` were called without a cursor on a long-lived session). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionEventLogTailResult( + /** Opaque cursor pointing at the current tail of the session's persisted-events history. Pass back to `read` to receive only events that arrive AFTER this snapshot. When the session has no events, this returns the same sentinel as an unset cursor (i.e. equivalent to omitting the cursor on a first read). */ + @JsonProperty("cursor") String cursor +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsApi.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsApi.java index 38f8dedf2a..337ba15cc8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,7 @@ public final class SessionExtensionsApi { } /** - * Invokes {@code session.extensions.list}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -40,7 +40,7 @@ public CompletableFuture list() { } /** - * Invokes {@code session.extensions.enable}. + * Source-qualified extension identifier to enable for the session. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -55,7 +55,7 @@ public CompletableFuture enable(SessionExtensionsEnableParams params) { } /** - * Invokes {@code session.extensions.disable}. + * Source-qualified extension identifier to disable for the session. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -70,7 +70,7 @@ public CompletableFuture disable(SessionExtensionsDisableParams params) { } /** - * Invokes {@code session.extensions.reload}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsDisableParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsDisableParams.java index 35d68997be..f4bf4d5b36 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsDisableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.extensions.disable} RPC method. + * Source-qualified extension identifier to disable for the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsDisableResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsDisableResult.java index 136e858fb9..ac057e5a27 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsDisableResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsDisableResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsEnableParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsEnableParams.java index 1161a7a739..5e00268af3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsEnableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.extensions.enable} RPC method. + * Source-qualified extension identifier to enable for the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsEnableResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsEnableResult.java index 1b7d328e05..82d9b9c6b8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsEnableResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsEnableResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsListParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsListParams.java index 340153ca11..52f9c08f92 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsListParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.extensions.list} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsListResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsListResult.java index 9ace814e0b..ba5ea94f11 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.extensions.list} RPC method. + * Extensions discovered for the session, with their current status. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsReloadParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsReloadParams.java index 36d1578416..ceaa990f15 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsReloadParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.extensions.reload} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsReloadResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsReloadResult.java index e4a1a22640..9d118b783d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionExtensionsReloadResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionExtensionsReloadResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFleetApi.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFleetApi.java index d7aa719a71..27023dc89b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFleetApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,7 @@ public final class SessionFleetApi { } /** - * Invokes {@code session.fleet.start}. + * Optional user prompt to combine with the fleet orchestration instructions. *

* 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/SessionFleetStartParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartParams.java index 871239460e..5d5e2c88c5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.fleet.start} RPC method. + * Optional user prompt to combine with the fleet orchestration instructions. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartResult.java index a52813aa06..c89f377d76 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFleetStartResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFleetStartResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.fleet.start} RPC method. + * Indicates whether fleet mode was successfully activated. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsAppendFileParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsAppendFileParams.java index 273031f17f..a3db24a0d9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsAppendFileParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsAppendFileParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.appendFile} RPC method. + * File path, content to append, and optional mode for the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsError.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsError.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsError.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsError.java index a78aa53748..349114dfde 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsError.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsError.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsErrorCode.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsErrorCode.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsErrorCode.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsErrorCode.java index 099ff1236b..4098d43abd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsErrorCode.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsErrorCode.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsExistsParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsExistsParams.java index c59031c57a..29b5107986 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsExistsParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.exists} RPC method. + * Path to test for existence in the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsExistsResult.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsExistsResult.java index 8822074652..0068ae3a32 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsExistsResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsExistsResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code sessionFs.exists} RPC method. + * Indicates whether the requested path exists in the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsMkdirParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsMkdirParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsMkdirParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsMkdirParams.java index 33ca53d0f3..c1ed1aec71 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsMkdirParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsMkdirParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.mkdir} RPC method. + * Directory path to create in the client-provided session filesystem, with options for recursive creation and POSIX mode. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReadFileParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsReadFileParams.java index f1cad41edd..d040129cc4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReadFileParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.readFile} RPC method. + * Path of the file to read from the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReadFileResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsReadFileResult.java index d222f88676..c71e1a5143 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReadFileResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReadFileResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code sessionFs.readFile} RPC method. + * File content as a UTF-8 string, or a filesystem error if the read failed. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirParams.java index e3f09c3702..00b865c334 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.readdir} RPC method. + * Directory path whose entries should be listed from the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirResult.java index 3f2201d2dc..745118beb3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code sessionFs.readdir} RPC method. + * Names of entries in the requested directory, or a filesystem error if the read failed. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntry.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesEntry.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntry.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesEntry.java index ff44088d4b..f4c755951d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntry.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesEntry.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `SessionFsReaddirWithTypesEntry` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntryType.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesEntryType.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntryType.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesEntryType.java index 71640ec347..67e62372ed 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesEntryType.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesEntryType.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesParams.java similarity index 85% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesParams.java index 533dbb4169..a6b80481d2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.readdirWithTypes} RPC method. + * Directory path whose entries (with type information) should be listed from the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesResult.java similarity index 85% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesResult.java index 0fecb63492..3fb693c809 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsReaddirWithTypesResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsReaddirWithTypesResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code sessionFs.readdirWithTypes} RPC method. + * Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRenameParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsRenameParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRenameParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsRenameParams.java index 6a18e80df5..76dbc8cfb9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRenameParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsRenameParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.rename} RPC method. + * Source and destination paths for renaming or moving an entry in the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRmParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsRmParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRmParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsRmParams.java index 50661a58e4..ed50649a30 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsRmParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsRmParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.rm} RPC method. + * Path to remove from the client-provided session filesystem, with options for recursive removal and force. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderCapabilities.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderCapabilities.java new file mode 100644 index 0000000000..7d6c0adb39 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderCapabilities.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.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; + +/** + * Optional capabilities declared by the provider + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSetProviderCapabilities( + /** Whether the provider supports SQLite query/exists operations */ + @JsonProperty("sqlite") Boolean sqlite +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderConventions.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderConventions.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderConventions.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderConventions.java index ac669a1891..abac4795f9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderConventions.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderConventions.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderParams.java similarity index 76% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderParams.java index e0c893db0d..d99a14862f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.setProvider} RPC method. + * Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider. * * @since 1.0.0 */ @@ -26,6 +26,8 @@ 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") SessionFsSetProviderConventions conventions + @JsonProperty("conventions") SessionFsSetProviderConventions conventions, + /** Optional capabilities declared by the provider */ + @JsonProperty("capabilities") SessionFsSetProviderCapabilities capabilities ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderResult.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderResult.java index dcda9e587a..6088729f56 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsSetProviderResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSetProviderResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code sessionFs.setProvider} RPC method. + * Indicates whether the calling client was registered as the session filesystem provider. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteExistsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteExistsParams.java new file mode 100644 index 0000000000..1956f804ba --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteExistsParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSqliteExistsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteExistsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteExistsResult.java new file mode 100644 index 0000000000..6c1328e9e9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteExistsResult.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.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; + +/** + * Indicates whether the per-session SQLite database already exists. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSqliteExistsResult( + /** Whether the session database already exists */ + @JsonProperty("exists") Boolean exists +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryParams.java new file mode 100644 index 0000000000..e489bb1222 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryParams.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.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; + +/** + * SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSqliteQueryParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** SQL query to execute */ + @JsonProperty("query") String query, + /** How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected) */ + @JsonProperty("queryType") SessionFsSqliteQueryType queryType, + /** Optional named bind parameters */ + @JsonProperty("params") Map params +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryResult.java new file mode 100644 index 0000000000..ff14d3ec1b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryResult.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.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; + +/** + * Query results including rows, columns, and rows affected, or a filesystem error if execution failed. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionFsSqliteQueryResult( + /** For SELECT: array of row objects. For others: empty array. */ + @JsonProperty("rows") List> rows, + /** Column names from the result set */ + @JsonProperty("columns") List columns, + /** Number of rows affected (for INSERT/UPDATE/DELETE) */ + @JsonProperty("rowsAffected") Long rowsAffected, + /** SQLite last_insert_rowid() value for INSERT. */ + @JsonProperty("lastInsertRowid") Long lastInsertRowid, + /** Describes a filesystem error. */ + @JsonProperty("error") SessionFsError error +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryType.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryType.java new file mode 100644 index 0000000000..a59bdd1f27 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsSqliteQueryType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionFsSqliteQueryType { + /** The {@code exec} variant. */ + EXEC("exec"), + /** The {@code query} variant. */ + QUERY("query"), + /** The {@code run} variant. */ + RUN("run"); + + private final String value; + SessionFsSqliteQueryType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionFsSqliteQueryType fromValue(String value) { + for (SessionFsSqliteQueryType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionFsSqliteQueryType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsStatParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsStatParams.java index 5d60281c8b..2e6ccfdeae 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsStatParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.stat} RPC method. + * Path whose metadata should be returned from the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsStatResult.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsStatResult.java index 28bb3a9fbd..56d883d106 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsStatResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsStatResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code sessionFs.stat} RPC method. + * Filesystem metadata for the requested path, or a filesystem error if the stat failed. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsWriteFileParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionFsWriteFileParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsWriteFileParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionFsWriteFileParams.java index 1c03df8a78..4f4e026361 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionFsWriteFileParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionFsWriteFileParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessionFs.writeFile} RPC method. + * File path, content to write, and optional mode for the client-provided session filesystem. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryAbortManualCompactionParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryAbortManualCompactionParams.java new file mode 100644 index 0000000000..04749d2b67 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryAbortManualCompactionParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryAbortManualCompactionParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryAbortManualCompactionResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryAbortManualCompactionResult.java new file mode 100644 index 0000000000..7767202d70 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryAbortManualCompactionResult.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.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; + +/** + * Indicates whether an in-progress manual compaction was aborted. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryAbortManualCompactionResult( + /** Whether an in-progress manual compaction was aborted. False when no manual compaction was running, when its abort controller was already aborted, or when the session is remote. */ + @JsonProperty("aborted") Boolean aborted +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryApi.java new file mode 100644 index 0000000000..91c7702f78 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryApi.java @@ -0,0 +1,87 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code history} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionHistoryApi { + + 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 */ + SessionHistoryApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Optional compaction parameters. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture compact() { + return caller.invoke("session.history.compact", java.util.Map.of("sessionId", this.sessionId), SessionHistoryCompactResult.class); + } + + /** + * Identifier of the event to truncate to; this event and all later events are removed. + *

+ * 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 truncate(SessionHistoryTruncateParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.history.truncate", _p, SessionHistoryTruncateResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture cancelBackgroundCompaction() { + return caller.invoke("session.history.cancelBackgroundCompaction", java.util.Map.of("sessionId", this.sessionId), SessionHistoryCancelBackgroundCompactionResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture abortManualCompaction() { + return caller.invoke("session.history.abortManualCompaction", java.util.Map.of("sessionId", this.sessionId), SessionHistoryAbortManualCompactionResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture summarizeForHandoff() { + return caller.invoke("session.history.summarizeForHandoff", java.util.Map.of("sessionId", this.sessionId), SessionHistorySummarizeForHandoffResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCancelBackgroundCompactionParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCancelBackgroundCompactionParams.java new file mode 100644 index 0000000000..56adc34ae9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCancelBackgroundCompactionParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryCancelBackgroundCompactionParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCancelBackgroundCompactionResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCancelBackgroundCompactionResult.java new file mode 100644 index 0000000000..c22fdd0928 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCancelBackgroundCompactionResult.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.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; + +/** + * Indicates whether an in-progress background compaction was cancelled. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistoryCancelBackgroundCompactionResult( + /** Whether an in-progress background compaction was cancelled. False when no compaction was running, when the session is remote, or when the underlying processor was unavailable. */ + @JsonProperty("cancelled") Boolean cancelled +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCompactParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCompactParams.java index 4b352cc623..cbb23e96fd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCompactParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.history.compact} RPC method. + * Optional compaction parameters. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCompactResult.java similarity index 77% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCompactResult.java index 060b97f48f..46a52f425b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryCompactResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryCompactResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.history.compact} RPC method. + * Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown. * * @since 1.0.0 */ @@ -27,6 +27,8 @@ public record SessionHistoryCompactResult( @JsonProperty("tokensRemoved") Long tokensRemoved, /** Number of messages removed during compaction */ @JsonProperty("messagesRemoved") Long messagesRemoved, + /** Summary text produced by compaction. Omitted when compaction did not produce a summary (e.g. failure path). */ + @JsonProperty("summaryContent") String summaryContent, /** Post-compaction context window usage breakdown */ @JsonProperty("contextWindow") HistoryCompactContextWindow contextWindow ) { diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionHistorySummarizeForHandoffParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistorySummarizeForHandoffParams.java new file mode 100644 index 0000000000..816af2cd1b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistorySummarizeForHandoffParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistorySummarizeForHandoffParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionHistorySummarizeForHandoffResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistorySummarizeForHandoffResult.java new file mode 100644 index 0000000000..3723aae25d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistorySummarizeForHandoffResult.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.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; + +/** + * Markdown summary of the conversation context (empty when not available). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionHistorySummarizeForHandoffResult( + /** Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization. */ + @JsonProperty("summary") String summary +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateParams.java index 09ddf68df1..70b1331e4f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.history.truncate} RPC method. + * Identifier of the event to truncate to; this event and all later events are removed. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateResult.java index a295cd1bd2..3c2a74ccbb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryTruncateResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionHistoryTruncateResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.history.truncate} RPC method. + * Number of events that were removed by the truncation. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionInstalledPlugin.java b/src/generated/java/com/github/copilot/generated/rpc/SessionInstalledPlugin.java new file mode 100644 index 0000000000..5d14285586 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionInstalledPlugin.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.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; + +/** + * Schema for the `SessionInstalledPlugin` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionInstalledPlugin( + /** Plugin name */ + @JsonProperty("name") String name, + /** Marketplace the plugin came from (empty string for direct repo installs) */ + @JsonProperty("marketplace") String marketplace, + /** Installed version, if known */ + @JsonProperty("version") String version, + /** Installation timestamp (ISO-8601) */ + @JsonProperty("installed_at") String installedAt, + /** Whether the plugin is currently enabled */ + @JsonProperty("enabled") Boolean enabled, + /** Path where the plugin is cached locally */ + @JsonProperty("cache_path") String cachePath, + /** Source descriptor for direct repo installs (when marketplace is empty) */ + @JsonProperty("source") Object source +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsApi.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsApi.java index 1458419504..15f3fce68c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -28,7 +28,9 @@ public final class SessionInstructionsApi { } /** - * Invokes {@code session.instructions.getSources}. + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ public CompletableFuture getSources() { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsGetSourcesParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsGetSourcesParams.java index 5fbe01602c..f9b683147d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsGetSourcesParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.instructions.getSources} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsGetSourcesResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsGetSourcesResult.java index 66ff52bd29..4d62780dae 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionInstructionsGetSourcesResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionInstructionsGetSourcesResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.instructions.getSources} RPC method. + * Instruction sources loaded for the session, in merge order. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogLevel.java b/src/generated/java/com/github/copilot/generated/rpc/SessionLogLevel.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogLevel.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionLogLevel.java index 7ec7361a74..e9ca23da2f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogLevel.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionLogLevel.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionLogParams.java similarity index 70% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionLogParams.java index 111e58cf51..edd160f82f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionLogParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.log} RPC method. + * Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip. * * @since 1.0.0 */ @@ -27,9 +27,13 @@ public record SessionLogParams( @JsonProperty("message") String message, /** Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". */ @JsonProperty("level") SessionLogLevel level, + /** Domain category for this log entry (e.g., "mcp", "subscription", "policy", "model"). Maps to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to "notification". */ + @JsonProperty("type") String type, /** 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 + @JsonProperty("url") String url, + /** Optional actionable tip displayed alongside the message. Only honored on `level: "info"`. */ + @JsonProperty("tip") String tip ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionLogResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionLogResult.java index 7ba330dac9..7d9d79d710 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionLogResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionLogResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.log} RPC method. + * Identifier of the session event that was emitted for the log message. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionLspApi.java similarity index 64% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionLspApi.java index 1700becb97..76678266c8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionLspApi.java @@ -5,18 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; /** - * API methods for the {@code name} namespace. + * API methods for the {@code lsp} namespace. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionNameApi { +public final class SessionLspApi { private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; @@ -24,30 +24,24 @@ public final class SessionNameApi { private final String sessionId; /** @param caller the RPC transport function */ - SessionNameApi(RpcCaller caller, String sessionId) { + SessionLspApi(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}. + * Parameters for (re)loading the merged LSP configuration set. *

* 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 set(SessionNameSetParams params) { + public CompletableFuture initialize(SessionLspInitializeParams 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); + return caller.invoke("session.lsp.initialize", _p, Void.class); } } diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionLspInitializeParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionLspInitializeParams.java new file mode 100644 index 0000000000..bd0387b88d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionLspInitializeParams.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.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; + +/** + * Parameters for (re)loading the merged LSP configuration set. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionLspInitializeParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted. */ + @JsonProperty("workingDirectory") String workingDirectory, + /** Git root used as the boundary when traversing for project-level LSP configs (supports monorepos). */ + @JsonProperty("gitRoot") String gitRoot, + /** Force re-initialization even when LSP configs were already loaded for the working directory. */ + @JsonProperty("force") Boolean force +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java new file mode 100644 index 0000000000..c9e577fd59 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java @@ -0,0 +1,144 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code mcp} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** API methods for the {@code mcp.oauth} sub-namespace. */ + public final SessionMcpOauthApi oauth; + /** API methods for the {@code mcp.apps} sub-namespace. */ + public final SessionMcpAppsApi apps; + + /** @param caller the RPC transport function */ + SessionMcpApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + this.oauth = new SessionMcpOauthApi(caller, sessionId); + this.apps = new SessionMcpAppsApi(caller, sessionId); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture list() { + return caller.invoke("session.mcp.list", java.util.Map.of("sessionId", this.sessionId), SessionMcpListResult.class); + } + + /** + * Name of the MCP server to enable for the session. + *

+ * 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 enable(SessionMcpEnableParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.enable", _p, Void.class); + } + + /** + * Name of the MCP server to disable for the session. + *

+ * 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 disable(SessionMcpDisableParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.disable", _p, Void.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture reload() { + return caller.invoke("session.mcp.reload", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + + /** + * Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference. + *

+ * 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 executeSampling(SessionMcpExecuteSamplingParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.executeSampling", _p, SessionMcpExecuteSamplingResult.class); + } + + /** + * The requestId previously passed to executeSampling that should be cancelled. + *

+ * 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 cancelSamplingExecution(SessionMcpCancelSamplingExecutionParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.cancelSamplingExecution", _p, SessionMcpCancelSamplingExecutionResult.class); + } + + /** + * Mode controlling how MCP server env values are resolved (`direct` or `indirect`). + *

+ * 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 setEnvValueMode(SessionMcpSetEnvValueModeParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.setEnvValueMode", _p, SessionMcpSetEnvValueModeResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture removeGitHub() { + return caller.invoke("session.mcp.removeGitHub", java.util.Map.of("sessionId", this.sessionId), SessionMcpRemoveGitHubResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsApi.java similarity index 63% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsApi.java index 6ee8ed2052..b6c131a6aa 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsApi.java @@ -5,18 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; /** - * API methods for the {@code tasks} namespace. + * API methods for the {@code mcp.apps} namespace. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionTasksApi { +public final class SessionMcpAppsApi { private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; @@ -24,13 +24,13 @@ public final class SessionTasksApi { private final String sessionId; /** @param caller the RPC transport function */ - SessionTasksApi(RpcCaller caller, String sessionId) { + SessionMcpAppsApi(RpcCaller caller, String sessionId) { this.caller = caller; this.sessionId = sessionId; } /** - * Invokes {@code session.tasks.startAgent}. + * MCP server and resource URI to fetch. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -38,24 +38,29 @@ public final class SessionTasksApi { * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture startAgent(SessionTasksStartAgentParams params) { + public CompletableFuture readResource(SessionMcpAppsReadResourceParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.tasks.startAgent", _p, SessionTasksStartAgentResult.class); + return caller.invoke("session.mcp.apps.readResource", _p, SessionMcpAppsReadResourceResult.class); } /** - * Invokes {@code session.tasks.list}. + * MCP server to list app-callable tools for. + *

+ * 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 list() { - return caller.invoke("session.tasks.list", java.util.Map.of("sessionId", this.sessionId), SessionTasksListResult.class); + public CompletableFuture listTools(SessionMcpAppsListToolsParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.apps.listTools", _p, SessionMcpAppsListToolsResult.class); } /** - * Invokes {@code session.tasks.promoteToBackground}. + * MCP server, tool name, and arguments to invoke from an MCP App view. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -63,14 +68,14 @@ public CompletableFuture list() { * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture promoteToBackground(SessionTasksPromoteToBackgroundParams params) { + public CompletableFuture callTool(SessionMcpAppsCallToolParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.tasks.promoteToBackground", _p, SessionTasksPromoteToBackgroundResult.class); + return caller.invoke("session.mcp.apps.callTool", _p, Void.class); } /** - * Invokes {@code session.tasks.cancel}. + * Host context to advertise to MCP App guests. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -78,29 +83,24 @@ public CompletableFuture promoteToBackgro * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture cancel(SessionTasksCancelParams params) { + public CompletableFuture setHostContext(SessionMcpAppsSetHostContextParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.tasks.cancel", _p, SessionTasksCancelResult.class); + return caller.invoke("session.mcp.apps.setHostContext", _p, Void.class); } /** - * Invokes {@code session.tasks.remove}. - *

- * Note: the {@code sessionId} field in the params record is overridden - * by the session-scoped wrapper; any value provided is ignored. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture remove(SessionTasksRemoveParams params) { - com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); - _p.put("sessionId", this.sessionId); - return caller.invoke("session.tasks.remove", _p, SessionTasksRemoveResult.class); + public CompletableFuture getHostContext() { + return caller.invoke("session.mcp.apps.getHostContext", java.util.Map.of("sessionId", this.sessionId), SessionMcpAppsGetHostContextResult.class); } /** - * Invokes {@code session.tasks.sendMessage}. + * MCP server to diagnose MCP Apps wiring for. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -108,10 +108,10 @@ public CompletableFuture remove(SessionTasksRemovePara * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture sendMessage(SessionTasksSendMessageParams params) { + public CompletableFuture diagnose(SessionMcpAppsDiagnoseParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.tasks.sendMessage", _p, SessionTasksSendMessageResult.class); + return caller.invoke("session.mcp.apps.diagnose", _p, SessionMcpAppsDiagnoseResult.class); } } diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsCallToolParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsCallToolParams.java new file mode 100644 index 0000000000..8c4788e471 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsCallToolParams.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.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; + +/** + * MCP server, tool name, and arguments to invoke from an MCP App view. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsCallToolParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** MCP server hosting the tool */ + @JsonProperty("serverName") String serverName, + /** MCP tool name */ + @JsonProperty("toolName") String toolName, + /** Tool arguments */ + @JsonProperty("arguments") Map arguments, + /** **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. */ + @JsonProperty("originServerName") String originServerName +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsDiagnoseParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsDiagnoseParams.java new file mode 100644 index 0000000000..cf700a3412 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsDiagnoseParams.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.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; + +/** + * MCP server to diagnose MCP Apps wiring for. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsDiagnoseParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** MCP server to probe */ + @JsonProperty("serverName") String serverName +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsDiagnoseResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsDiagnoseResult.java new file mode 100644 index 0000000000..144081f483 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsDiagnoseResult.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.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; + +/** + * Diagnostic snapshot of MCP Apps wiring for the named server. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsDiagnoseResult( + /** Capability negotiation snapshot */ + @JsonProperty("capability") McpAppsDiagnoseCapability capability, + /** What the server returned for this session */ + @JsonProperty("server") McpAppsDiagnoseServer server +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsGetHostContextParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsGetHostContextParams.java new file mode 100644 index 0000000000..380164b3cd --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsGetHostContextParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsGetHostContextParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsGetHostContextResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsGetHostContextResult.java new file mode 100644 index 0000000000..a543b48200 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsGetHostContextResult.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.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; + +/** + * Current host context advertised to MCP App guests. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsGetHostContextResult( + /** Current host context */ + @JsonProperty("context") McpAppsHostContextDetails context +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsListToolsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsListToolsParams.java new file mode 100644 index 0000000000..d5e0c578ac --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsListToolsParams.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.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; + +/** + * MCP server to list app-callable tools for. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsListToolsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** MCP server hosting the app */ + @JsonProperty("serverName") String serverName, + /** **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. */ + @JsonProperty("originServerName") String originServerName +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsListToolsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsListToolsResult.java new file mode 100644 index 0000000000..054ce56a8a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsListToolsResult.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.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; + +/** + * App-callable tools from the named MCP server. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsListToolsResult( + /** App-callable tools from the server */ + @JsonProperty("tools") List> tools +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceParams.java new file mode 100644 index 0000000000..26b29ee3d7 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceParams.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.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; + +/** + * MCP server and resource URI to fetch. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsReadResourceParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the MCP server hosting the resource */ + @JsonProperty("serverName") String serverName, + /** Resource URI (typically ui://...) */ + @JsonProperty("uri") String uri +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceResult.java new file mode 100644 index 0000000000..e0f9810a32 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceResult.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.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; + +/** + * Resource contents returned by the MCP server. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsReadResourceResult( + /** Resource contents returned by the server */ + @JsonProperty("contents") List contents +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsSetHostContextParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsSetHostContextParams.java new file mode 100644 index 0000000000..19c9347b70 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsSetHostContextParams.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.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; + +/** + * Host context to advertise to MCP App guests. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpAppsSetHostContextParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Host context advertised to MCP App guests */ + @JsonProperty("context") McpAppsSetHostContextDetails context +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpCancelSamplingExecutionParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpCancelSamplingExecutionParams.java new file mode 100644 index 0000000000..c00459e4b7 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpCancelSamplingExecutionParams.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.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; + +/** + * The requestId previously passed to executeSampling that should be cancelled. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpCancelSamplingExecutionParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The requestId previously passed to executeSampling that should be cancelled */ + @JsonProperty("requestId") String requestId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpCancelSamplingExecutionResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpCancelSamplingExecutionResult.java new file mode 100644 index 0000000000..9495602f65 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpCancelSamplingExecutionResult.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.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; + +/** + * Indicates whether an in-flight sampling execution with the given requestId was found and cancelled. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpCancelSamplingExecutionResult( + /** True if an in-flight execution with the given requestId was found and signalled to cancel. False when no such execution is in flight (already completed, never started, or cancelled by another caller). */ + @JsonProperty("cancelled") Boolean cancelled +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpDisableParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpDisableParams.java index ab0892a9ce..adee20ceb6 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpDisableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.mcp.disable} RPC method. + * Name of the MCP server to disable for the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpDisableResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpDisableResult.java index 0565cf8d1d..834dc2cb75 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpDisableResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpDisableResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpEnableParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpEnableParams.java index 0e6b1cf748..53b23f9eea 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpEnableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.mcp.enable} RPC method. + * Name of the MCP server to enable for the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpEnableResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpEnableResult.java index 43319c3a93..86b1a67163 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpEnableResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpEnableResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpExecuteSamplingParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpExecuteSamplingParams.java new file mode 100644 index 0000000000..b6f995971f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpExecuteSamplingParams.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.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; + +/** + * Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpExecuteSamplingParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call. */ + @JsonProperty("requestId") String requestId, + /** Name of the MCP server that initiated the sampling request */ + @JsonProperty("serverName") String serverName, + /** The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle). */ + @JsonProperty("mcpRequestId") Object mcpRequestId, + /** Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally. */ + @JsonProperty("request") McpExecuteSamplingRequest request +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpExecuteSamplingResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpExecuteSamplingResult.java new file mode 100644 index 0000000000..578cb10f2d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpExecuteSamplingResult.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.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; + +/** + * Outcome of an MCP sampling execution: success result, failure error, or cancellation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpExecuteSamplingResult( + /** Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution. */ + @JsonProperty("action") McpSamplingExecutionAction action, + /** MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape. */ + @JsonProperty("result") McpExecuteSamplingResult result, + /** Error description, present when action='failure'. */ + @JsonProperty("error") String error +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpListParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpListParams.java index c3a8a2b8dd..4ae5d6a2c2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpListParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.mcp.list} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpListResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpListResult.java index 8128229a04..220f663b6a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.mcp.list} RPC method. + * MCP servers configured for the session, with their connection status. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java index 4a864468e3..68535ebc42 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,7 @@ public final class SessionMcpOauthApi { } /** - * Invokes {@code session.mcp.oauth.login}. + * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. *

* 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/SessionMcpOauthLoginParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginParams.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginParams.java index ef336408d1..4fcca6618d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.mcp.oauth.login} RPC method. + * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginResult.java index e46ab39efb..e3d9071f7e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpOauthLoginResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.mcp.oauth.login} RPC method. + * OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpReloadParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpReloadParams.java index b3e3ccf28a..6df56c453c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpReloadParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.mcp.reload} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpReloadResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMcpReloadResult.java index 80a2c4c265..3f0d970fcb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpReloadResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpReloadResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpRemoveGitHubParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpRemoveGitHubParams.java new file mode 100644 index 0000000000..0213c76f53 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpRemoveGitHubParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpRemoveGitHubParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpRemoveGitHubResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpRemoveGitHubResult.java new file mode 100644 index 0000000000..1845649bc1 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpRemoveGitHubResult.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.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; + +/** + * Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpRemoveGitHubResult( + /** True when the auto-managed `github` MCP server was removed; false when no removal happened (e.g. user has explicitly configured a `github` server, or the server was not registered). */ + @JsonProperty("removed") Boolean removed +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpSetEnvValueModeParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpSetEnvValueModeParams.java new file mode 100644 index 0000000000..5a524cfb0c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpSetEnvValueModeParams.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.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; + +/** + * Mode controlling how MCP server env values are resolved (`direct` or `indirect`). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpSetEnvValueModeParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct". */ + @JsonProperty("mode") McpSetEnvValueModeDetails mode +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMcpSetEnvValueModeResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpSetEnvValueModeResult.java new file mode 100644 index 0000000000..300ef08e78 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMcpSetEnvValueModeResult.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.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; + +/** + * Env-value mode recorded on the session after the update. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpSetEnvValueModeResult( + /** Mode recorded on the session after the update */ + @JsonProperty("mode") McpSetEnvValueModeDetails mode +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadata.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadata.java new file mode 100644 index 0000000000..03a9e3280e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadata.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.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; + +/** + * Schema for the `SessionMetadata` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadata( + /** Stable session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Session creation time as an ISO 8601 timestamp */ + @JsonProperty("startTime") String startTime, + /** Last-modified time of the session's persisted state, as ISO 8601 */ + @JsonProperty("modifiedTime") String modifiedTime, + /** Short summary of the session, when one has been derived */ + @JsonProperty("summary") String summary, + /** Optional human-friendly name set via /rename */ + @JsonProperty("name") String name, + /** Runtime client name that created/last resumed this session */ + @JsonProperty("clientName") String clientName, + /** True for remote (GitHub) sessions; false for local */ + @JsonProperty("isRemote") Boolean isRemote, + /** True for detached maintenance sessions that should be hidden from normal resume lists. */ + @JsonProperty("isDetached") Boolean isDetached, + /** Schema for the `SessionContext` type. */ + @JsonProperty("context") SessionContext context, + /** GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control. */ + @JsonProperty("mcTaskId") String mcTaskId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataApi.java new file mode 100644 index 0000000000..7bd7e66bbf --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataApi.java @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code metadata} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMetadataApi { + + 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 */ + SessionMetadataApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture snapshot() { + return caller.invoke("session.metadata.snapshot", java.util.Map.of("sessionId", this.sessionId), SessionMetadataSnapshotResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture isProcessing() { + return caller.invoke("session.metadata.isProcessing", java.util.Map.of("sessionId", this.sessionId), SessionMetadataIsProcessingResult.class); + } + + /** + * Model identifier and token limits used to compute the context-info breakdown. + *

+ * 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 contextInfo(SessionMetadataContextInfoParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.metadata.contextInfo", _p, SessionMetadataContextInfoResult.class); + } + + /** + * Updated working-directory/git context to record on the session. + *

+ * 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 recordContextChange(SessionMetadataRecordContextChangeParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.metadata.recordContextChange", _p, Void.class); + } + + /** + * Absolute path to set as the session's new working directory. + *

+ * 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 setWorkingDirectory(SessionMetadataSetWorkingDirectoryParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.metadata.setWorkingDirectory", _p, SessionMetadataSetWorkingDirectoryResult.class); + } + + /** + * Model identifier to use when re-tokenizing the session's existing messages. + *

+ * 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 recomputeContextTokens(SessionMetadataRecomputeContextTokensParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.metadata.recomputeContextTokens", _p, SessionMetadataRecomputeContextTokensResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoParams.java new file mode 100644 index 0000000000..4b6bccf7e3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoParams.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.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 identifier and token limits used to compute the context-info breakdown. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataContextInfoParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default. */ + @JsonProperty("promptTokenLimit") Long promptTokenLimit, + /** Maximum output tokens allowed by the target model. Pass 0 if unknown. */ + @JsonProperty("outputTokenLimit") Long outputTokenLimit, + /** Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values. */ + @JsonProperty("selectedModel") String selectedModel +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoResult.java new file mode 100644 index 0000000000..de9074e8c9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataContextInfoResult.java @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.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 breakdown for the session's current context window, or null if uninitialized. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataContextInfoResult( + /** Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached). */ + @JsonProperty("contextInfo") SessionMetadataContextInfoResultContextInfo contextInfo +) { + + /** Token-usage breakdown for the session's current context window */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMetadataContextInfoResultContextInfo( + /** The model used for token counting */ + @JsonProperty("modelName") String modelName, + /** Tokens consumed by the system prompt */ + @JsonProperty("systemTokens") Long systemTokens, + /** Tokens consumed by user/assistant/tool messages */ + @JsonProperty("conversationTokens") Long conversationTokens, + /** Tokens consumed by tool definitions sent to the model (excludes deferred tools) */ + @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens, + /** Sum of system, conversation and tool-definition tokens */ + @JsonProperty("totalTokens") Long totalTokens, + /** Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified) */ + @JsonProperty("promptTokenLimit") Long promptTokenLimit, + /** Token count at which background compaction starts (configurable percentage of promptTokenLimit) */ + @JsonProperty("compactionThreshold") Long compactionThreshold, + /** Total context limit for /context display. promptTokenLimit + min(32k or 64k, outputTokenLimit) depending on model. */ + @JsonProperty("limit") Long limit, + /** Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%) */ + @JsonProperty("bufferTokens") Long bufferTokens + ) { + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataIsProcessingParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataIsProcessingParams.java new file mode 100644 index 0000000000..329dbea100 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataIsProcessingParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataIsProcessingParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataIsProcessingResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataIsProcessingResult.java new file mode 100644 index 0000000000..e496bb662e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataIsProcessingResult.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.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; + +/** + * Indicates whether the local session is currently processing a turn or background continuation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataIsProcessingResult( + /** Whether the session is currently processing user/agent messages. False for non-local sessions (which don't run a local agentic loop). Reflects an in-flight turn or background continuation. */ + @JsonProperty("processing") Boolean processing +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecomputeContextTokensParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecomputeContextTokensParams.java new file mode 100644 index 0000000000..979f8808da --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecomputeContextTokensParams.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.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 identifier to use when re-tokenizing the session's existing messages. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataRecomputeContextTokensParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Model identifier used for tokenization. The runtime token-counts both chat-context and system-context messages against this model. */ + @JsonProperty("modelId") String modelId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecomputeContextTokensResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecomputeContextTokensResult.java new file mode 100644 index 0000000000..4aab3841a4 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecomputeContextTokensResult.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.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; + +/** + * Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataRecomputeContextTokensResult( + /** Sum of tokens across chat-context and system-context messages currently held by the session. */ + @JsonProperty("totalTokens") Long totalTokens, + /** Tokens contributed by user/assistant/tool messages (excludes system/developer prompts). */ + @JsonProperty("messagesTokenCount") Long messagesTokenCount, + /** Tokens contributed by system/developer prompt snapshots. */ + @JsonProperty("systemTokenCount") Long systemTokenCount +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecordContextChangeParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecordContextChangeParams.java new file mode 100644 index 0000000000..6b42c822cc --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecordContextChangeParams.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.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; + +/** + * Updated working-directory/git context to record on the session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataRecordContextChangeParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Updated working directory and git context. Emitted as the new payload of `session.context_changed`. */ + @JsonProperty("context") SessionWorkingDirectoryContext context +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecordContextChangeResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecordContextChangeResult.java new file mode 100644 index 0000000000..41f252b20d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataRecordContextChangeResult.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.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; + +/** + * Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataRecordContextChangeResult() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSetWorkingDirectoryParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSetWorkingDirectoryParams.java new file mode 100644 index 0000000000..507b0a49fa --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSetWorkingDirectoryParams.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.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; + +/** + * Absolute path to set as the session's new working directory. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataSetWorkingDirectoryParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Absolute path to set as the session's working directory. The runtime updates the session's recorded cwd so subsequent operations (shell tools, file lookups, telemetry) anchor to it. */ + @JsonProperty("workingDirectory") String workingDirectory +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSetWorkingDirectoryResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSetWorkingDirectoryResult.java new file mode 100644 index 0000000000..85ef81026b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSetWorkingDirectoryResult.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.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; + +/** + * Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for `process.chdir` and any related side-effects (file index, etc.); this method only updates the session's own recorded path. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataSetWorkingDirectoryResult( + /** Working directory after the update */ + @JsonProperty("workingDirectory") String workingDirectory +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotParams.java new file mode 100644 index 0000000000..d3e94df435 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataSnapshotParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java new file mode 100644 index 0000000000..5b6ae7b8cf --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java @@ -0,0 +1,79 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Point-in-time snapshot of slow-changing session identifier and state fields + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMetadataSnapshotResult( + /** The unique identifier of the session */ + @JsonProperty("sessionId") String sessionId, + /** ISO 8601 timestamp of when the session started */ + @JsonProperty("startTime") OffsetDateTime startTime, + /** ISO 8601 timestamp of when the session's persisted state was last modified on disk. For new sessions, equals startTime. For resumed sessions, reflects the previous modification time at construction. */ + @JsonProperty("modifiedTime") OffsetDateTime modifiedTime, + /** Whether this is a remote session (i.e., one whose runtime executes elsewhere and is steered through this process) */ + @JsonProperty("isRemote") Boolean isRemote, + /** True when the session was detected to be in use by another process at construction time. Local consumers may surface a confirmation prompt before fully attaching. Always false for new sessions. */ + @JsonProperty("alreadyInUse") Boolean alreadyInUse, + /** Absolute path to the session's workspace directory on disk, or null if the session has no associated workspace */ + @JsonProperty("workspacePath") String workspacePath, + /** User-provided name supplied at session construction (via `--name`), if any. Immutable after construction. */ + @JsonProperty("initialName") String initialName, + /** Runtime client name associated with the session (telemetry identifier). */ + @JsonProperty("clientName") String clientName, + /** Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. */ + @JsonProperty("remoteMetadata") MetadataSnapshotRemoteMetadata remoteMetadata, + /** Short human-readable summary of the session, if known. Omitted when no summary has been generated. */ + @JsonProperty("summary") String summary, + /** Absolute path to the session's current working directory */ + @JsonProperty("workingDirectory") String workingDirectory, + /** The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot') */ + @JsonProperty("currentMode") MetadataSnapshotCurrentMode currentMode, + /** Currently selected model identifier, if any */ + @JsonProperty("selectedModel") String selectedModel, + /** Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags). */ + @JsonProperty("workspace") SessionMetadataSnapshotResultWorkspace workspace +) { + + /** Public-facing projection of workspace metadata for SDK / TUI consumers */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMetadataSnapshotResultWorkspace( + /** Workspace identifier (1:1 with sessionId) */ + @JsonProperty("id") String id, + /** Current working directory at session start */ + @JsonProperty("cwd") String cwd, + /** Resolved git root for cwd, if any */ + @JsonProperty("git_root") String gitRoot, + /** Repository identifier in 'owner/repo' or 'org/project/repo' format, if any */ + @JsonProperty("repository") String repository, + /** Repository host type, if known */ + @JsonProperty("host_type") WorkspaceSummaryHostType hostType, + /** Branch checked out at session start, if any */ + @JsonProperty("branch") String branch, + /** Display name for the session, if set */ + @JsonProperty("name") String name, + /** ISO 8601 timestamp when the workspace was created */ + @JsonProperty("created_at") OffsetDateTime createdAt, + /** ISO 8601 timestamp when the workspace was last updated */ + @JsonProperty("updated_at") OffsetDateTime updatedAt + ) { + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMode.java b/src/generated/java/com/github/copilot/generated/rpc/SessionMode.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMode.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionMode.java index 5b246bcb5a..e12db36240 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMode.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionMode.java @@ -5,12 +5,12 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; /** - * The agent mode. Valid values: "interactive", "plan", "autopilot". + * The session mode the agent is operating in * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModeApi.java similarity index 83% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModeApi.java index bf20ad088f..e5201bd6a5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModeApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,9 @@ public final class SessionModeApi { } /** - * The agent mode. Valid values: "interactive", "plan", "autopilot". + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ public CompletableFuture get() { @@ -38,10 +40,12 @@ public CompletableFuture get() { } /** - * Invokes {@code session.mode.set}. + * Agent interaction mode to apply to the session. *

* 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 set(SessionModeSetParams params) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModeGetParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModeGetParams.java index e62ab01d65..c1a4936214 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModeGetParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.mode.get} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModeGetResult.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModeGetResult.java index 595dff851b..b5123aebf7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeGetResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModeGetResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetParams.java similarity index 82% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModeSetParams.java index 4153014e5d..b12bea9ff0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.mode.set} RPC method. + * Agent interaction mode to apply to the session. * * @since 1.0.0 */ @@ -23,7 +23,7 @@ public record SessionModeSetParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, - /** The agent mode. Valid values: "interactive", "plan", "autopilot". */ + /** The session mode the agent is operating in */ @JsonProperty("mode") SessionMode mode ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetResult.java similarity index 97% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModeSetResult.java index f4609f6715..c796022723 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModeSetResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModeSetResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java similarity index 61% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java index 6c8099d0c3..eda751b3ee 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,9 @@ public final class SessionModelApi { } /** - * Invokes {@code session.model.getCurrent}. + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ public CompletableFuture getCurrent() { @@ -38,10 +40,12 @@ public CompletableFuture getCurrent() { } /** - * Invokes {@code session.model.switchTo}. + * Target model identifier and optional reasoning effort, summary, and capability overrides. *

* 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 switchTo(SessionModelSwitchToParams params) { @@ -50,4 +54,19 @@ public CompletableFuture switchTo(SessionModelSwitch return caller.invoke("session.model.switchTo", _p, SessionModelSwitchToResult.class); } + /** + * Reasoning effort level to apply to the currently selected model. + *

+ * 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 setReasoningEffort(SessionModelSetReasoningEffortParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.model.setReasoningEffort", _p, SessionModelSetReasoningEffortResult.class); + } + } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentParams.java index e49e4f2dfe..abcf1c2ab3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelGetCurrentParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.model.getCurrent} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java new file mode 100644 index 0000000000..7bb2f84968 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.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.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; + +/** + * The currently selected model and reasoning effort for the session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelGetCurrentResult( + /** Currently active model identifier */ + @JsonProperty("modelId") String modelId, + /** Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. */ + @JsonProperty("reasoningEffort") String reasoningEffort +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetReasoningEffortParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetReasoningEffortParams.java new file mode 100644 index 0000000000..6135c2e0a5 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetReasoningEffortParams.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.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; + +/** + * Reasoning effort level to apply to the currently selected model. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelSetReasoningEffortParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling. */ + @JsonProperty("reasoningEffort") String reasoningEffort +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetReasoningEffortResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetReasoningEffortResult.java new file mode 100644 index 0000000000..2d6cbd0a6a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModelSetReasoningEffortResult.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.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; + +/** + * Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelSetReasoningEffortResult( + /** Reasoning effort level recorded on the session after the update */ + @JsonProperty("reasoningEffort") String reasoningEffort +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java similarity index 76% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java index 4d69219fe2..c5c1cbbe02 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.model.switchTo} RPC method. + * Target model identifier and optional reasoning effort, summary, and capability overrides. * * @since 1.0.0 */ @@ -25,8 +25,10 @@ public record SessionModelSwitchToParams( @JsonProperty("sessionId") String sessionId, /** Model identifier to switch to */ @JsonProperty("modelId") String modelId, - /** Reasoning effort level to use for the model */ + /** Reasoning effort level to use for the model. "none" disables reasoning. */ @JsonProperty("reasoningEffort") String reasoningEffort, + /** Reasoning summary mode to request for supported model clients */ + @JsonProperty("reasoningSummary") ReasoningSummary reasoningSummary, /** Override individual model capabilities resolved by the runtime */ @JsonProperty("modelCapabilities") ModelCapabilitiesOverride modelCapabilities ) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java index 5e93b51aed..8bf6f2c8e5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionModelSwitchToResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.model.switchTo} RPC method. + * The model identifier active on the session after the switch. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionNameApi.java similarity index 58% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionNameApi.java index 2998ea6626..e7e1be58ae 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionMcpApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionNameApi.java @@ -5,46 +5,42 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; /** - * API methods for the {@code mcp} namespace. + * API methods for the {@code name} namespace. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionMcpApi { +public final class SessionNameApi { private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; 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) { + SessionNameApi(RpcCaller caller, String sessionId) { this.caller = caller; this.sessionId = sessionId; - this.oauth = new SessionMcpOauthApi(caller, sessionId); } /** - * Invokes {@code session.mcp.list}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture list() { - return caller.invoke("session.mcp.list", java.util.Map.of("sessionId", this.sessionId), SessionMcpListResult.class); + public CompletableFuture get() { + return caller.invoke("session.name.get", java.util.Map.of("sessionId", this.sessionId), SessionNameGetResult.class); } /** - * Invokes {@code session.mcp.enable}. + * New friendly name to apply to the session. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -52,14 +48,14 @@ public CompletableFuture list() { * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture enable(SessionMcpEnableParams params) { + public CompletableFuture set(SessionNameSetParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.mcp.enable", _p, Void.class); + return caller.invoke("session.name.set", _p, Void.class); } /** - * Invokes {@code session.mcp.disable}. + * Auto-generated session summary to apply as the session's name when no user-set name exists. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -67,20 +63,10 @@ public CompletableFuture enable(SessionMcpEnableParams params) { * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture disable(SessionMcpDisableParams params) { + public CompletableFuture setAuto(SessionNameSetAutoParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.mcp.disable", _p, Void.class); - } - - /** - * Invokes {@code session.mcp.reload}. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - public CompletableFuture reload() { - return caller.invoke("session.mcp.reload", java.util.Map.of("sessionId", this.sessionId), Void.class); + return caller.invoke("session.name.setAuto", _p, SessionNameSetAutoResult.class); } } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionNameGetParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionNameGetParams.java index 59b638e4c5..d3728d06d3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionNameGetParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.name.get} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionNameGetResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionNameGetResult.java index 82ba816531..b3e4599674 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameGetResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionNameGetResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.name.get} RPC method. + * The session's friendly name, or null when not yet set. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionNameSetAutoParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionNameSetAutoParams.java new file mode 100644 index 0000000000..8c69e0d5d7 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionNameSetAutoParams.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.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; + +/** + * Auto-generated session summary to apply as the session's name when no user-set name exists. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionNameSetAutoParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting. */ + @JsonProperty("summary") String summary +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionNameSetAutoResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionNameSetAutoResult.java new file mode 100644 index 0000000000..e84407d89c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionNameSetAutoResult.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.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; + +/** + * Indicates whether the auto-generated summary was applied as the session's name. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionNameSetAutoResult( + /** Whether the auto-generated summary was persisted. False if the session already has a user-set name, the summary normalized to empty, or the session does not have a workspace. */ + @JsonProperty("applied") Boolean applied +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameSetParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionNameSetParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameSetParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionNameSetParams.java index 45e93db451..7fd348c368 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionNameSetParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionNameSetParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.name.set} RPC method. + * New friendly name to apply to the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsApi.java new file mode 100644 index 0000000000..4e46d346ad --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsApi.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.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code options} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionOptionsApi { + + 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 */ + SessionOptionsApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Patch of mutable session options to apply to the running session. + *

+ * 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 update(SessionOptionsUpdateParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.options.update", _p, SessionOptionsUpdateResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java new file mode 100644 index 0000000000..8f9a06a4fc --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java @@ -0,0 +1,103 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * Patch of mutable session options to apply to the running session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionOptionsUpdateParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The model ID to use for assistant turns. */ + @JsonProperty("model") String model, + /** Reasoning effort for the selected model (model-defined enum). */ + @JsonProperty("reasoningEffort") String reasoningEffort, + /** Identifier of the client driving the session. */ + @JsonProperty("clientName") String clientName, + /** Identifier sent to LSP-style integrations. */ + @JsonProperty("lspClientName") String lspClientName, + /** Stable integration identifier used for analytics and rate-limit attribution. */ + @JsonProperty("integrationId") String integrationId, + /** Map of feature-flag IDs to their boolean enabled state. */ + @JsonProperty("featureFlags") Map featureFlags, + /** Whether experimental capabilities are enabled. */ + @JsonProperty("isExperimentalMode") Boolean isExperimentalMode, + /** Custom model-provider configuration (BYOK). Opaque shape; see `ProviderConfig` in the runtime. */ + @JsonProperty("provider") Object provider, + /** Absolute working-directory path for shell tools. */ + @JsonProperty("workingDirectory") String workingDirectory, + /** Allowlist of tool names available to this session. */ + @JsonProperty("availableTools") List availableTools, + /** Denylist of tool names for this session. */ + @JsonProperty("excludedTools") List excludedTools, + /** Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. */ + @JsonProperty("toolFilterPrecedence") OptionsUpdateToolFilterPrecedence toolFilterPrecedence, + /** Whether shell-script safety heuristics are enabled. */ + @JsonProperty("enableScriptSafety") Boolean enableScriptSafety, + /** Shell init profile (`None` or `NonInteractive`). */ + @JsonProperty("shellInitProfile") String shellInitProfile, + /** Per-shell process flags (e.g., `pwsh` arguments). */ + @JsonProperty("shellProcessFlags") List shellProcessFlags, + /** Sandbox configuration shape; opaque to SDK consumers. See `SandboxConfig` in the runtime. */ + @JsonProperty("sandboxConfig") Object sandboxConfig, + /** Whether interactive shell sessions are logged. */ + @JsonProperty("logInteractiveShells") Boolean logInteractiveShells, + /** How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). */ + @JsonProperty("envValueMode") OptionsUpdateEnvValueMode envValueMode, + /** Additional directories to search for skills. */ + @JsonProperty("skillDirectories") List skillDirectories, + /** Skill IDs that should be excluded from this session. */ + @JsonProperty("disabledSkills") List disabledSkills, + /** Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. */ + @JsonProperty("enableOnDemandInstructionDiscovery") Boolean enableOnDemandInstructionDiscovery, + /** Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes. */ + @JsonProperty("installedPlugins") List installedPlugins, + /** Whether to default custom agents to local-only execution. */ + @JsonProperty("customAgentsLocalOnly") Boolean customAgentsLocalOnly, + /** Whether to skip loading custom instruction sources. */ + @JsonProperty("skipCustomInstructions") Boolean skipCustomInstructions, + /** Instruction source IDs to exclude from the system prompt. */ + @JsonProperty("disabledInstructionSources") List disabledInstructionSources, + /** Whether to include the `Co-authored-by` trailer in commit messages. */ + @JsonProperty("coauthorEnabled") Boolean coauthorEnabled, + /** Optional path for trajectory output. */ + @JsonProperty("trajectoryFile") String trajectoryFile, + /** Whether to stream model responses. */ + @JsonProperty("enableStreaming") Boolean enableStreaming, + /** Override URL for the Copilot API endpoint. */ + @JsonProperty("copilotUrl") String copilotUrl, + /** Whether to disable the `ask_user` tool (encourages autonomous behavior). */ + @JsonProperty("askUserDisabled") Boolean askUserDisabled, + /** Whether to allow auto-mode continuation across turns. */ + @JsonProperty("continueOnAutoMode") Boolean continueOnAutoMode, + /** Whether the session is running in an interactive UI. */ + @JsonProperty("runningInInteractiveMode") Boolean runningInInteractiveMode, + /** Whether to surface reasoning-summary events from the model. */ + @JsonProperty("enableReasoningSummaries") Boolean enableReasoningSummaries, + /** Runtime context discriminator (e.g., `cli`, `actions`). */ + @JsonProperty("agentContext") String agentContext, + /** Override directory for the session-events log. When unset, the runtime's default events log directory is used. */ + @JsonProperty("eventsLogDirectory") String eventsLogDirectory, + /** Additional content-exclusion policies to merge into the session's policy set. Opaque shape; see `ContentExclusionApiResponse` in the runtime. */ + @JsonProperty("additionalContentExclusionPolicies") List additionalContentExclusionPolicies, + /** Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users). */ + @JsonProperty("manageScheduleEnabled") Boolean manageScheduleEnabled +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateResult.java new file mode 100644 index 0000000000..4e514944ca --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateResult.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.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; + +/** + * Indicates whether the session options patch was applied successfully. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionOptionsUpdateResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsApi.java new file mode 100644 index 0000000000..506f1ce31c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsApi.java @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code permissions} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionPermissionsApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** API methods for the {@code permissions.paths} sub-namespace. */ + public final SessionPermissionsPathsApi paths; + /** API methods for the {@code permissions.locations} sub-namespace. */ + public final SessionPermissionsLocationsApi locations; + /** API methods for the {@code permissions.folderTrust} sub-namespace. */ + public final SessionPermissionsFolderTrustApi folderTrust; + /** API methods for the {@code permissions.urls} sub-namespace. */ + public final SessionPermissionsUrlsApi urls; + + /** @param caller the RPC transport function */ + SessionPermissionsApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + this.paths = new SessionPermissionsPathsApi(caller, sessionId); + this.locations = new SessionPermissionsLocationsApi(caller, sessionId); + this.folderTrust = new SessionPermissionsFolderTrustApi(caller, sessionId); + this.urls = new SessionPermissionsUrlsApi(caller, sessionId); + } + + /** + * Patch of permission policy fields to apply (omit a field to leave it unchanged). + *

+ * 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 configure(SessionPermissionsConfigureParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.configure", _p, SessionPermissionsConfigureResult.class); + } + + /** + * Pending permission request ID and the decision to apply (approve/reject and scope). + *

+ * 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 handlePendingPermissionRequest(SessionPermissionsHandlePendingPermissionRequestParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.handlePendingPermissionRequest", _p, SessionPermissionsHandlePendingPermissionRequestResult.class); + } + + /** + * No parameters; returns currently-pending permission requests for the session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture pendingRequests() { + return caller.invoke("session.permissions.pendingRequests", java.util.Map.of("sessionId", this.sessionId), SessionPermissionsPendingRequestsResult.class); + } + + /** + * Allow-all toggle for tool permission requests, with an optional telemetry source. + *

+ * 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 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); + } + + /** + * Whether to enable full allow-all permissions for the session. + *

+ * 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 setAllowAll(SessionPermissionsSetAllowAllParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.setAllowAll", _p, SessionPermissionsSetAllowAllResult.class); + } + + /** + * No parameters. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getAllowAll() { + return caller.invoke("session.permissions.getAllowAll", java.util.Map.of("sessionId", this.sessionId), SessionPermissionsGetAllowAllResult.class); + } + + /** + * Scope and add/remove instructions for modifying session- or location-scoped permission rules. + *

+ * 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 modifyRules(SessionPermissionsModifyRulesParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.modifyRules", _p, SessionPermissionsModifyRulesResult.class); + } + + /** + * Toggles whether permission prompts should be bridged into session events for this client. + *

+ * 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 setRequired(SessionPermissionsSetRequiredParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.setRequired", _p, SessionPermissionsSetRequiredResult.class); + } + + /** + * No parameters; clears all session-scoped tool permission approvals. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture resetSessionApprovals() { + return caller.invoke("session.permissions.resetSessionApprovals", java.util.Map.of("sessionId", this.sessionId), SessionPermissionsResetSessionApprovalsResult.class); + } + + /** + * Notification payload describing the permission prompt that the client just rendered. + *

+ * 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 notifyPromptShown(SessionPermissionsNotifyPromptShownParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.notifyPromptShown", _p, SessionPermissionsNotifyPromptShownResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsConfigureParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsConfigureParams.java new file mode 100644 index 0000000000..0ae82cd21c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsConfigureParams.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.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; + +/** + * Patch of permission policy fields to apply (omit a field to leave it unchanged). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsConfigureParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged. */ + @JsonProperty("approveAllToolPermissionRequests") Boolean approveAllToolPermissionRequests, + /** If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged. */ + @JsonProperty("approveAllReadPermissionRequests") Boolean approveAllReadPermissionRequests, + /** If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged. */ + @JsonProperty("rules") PermissionRulesSet rules, + /** If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged. */ + @JsonProperty("paths") PermissionPathsConfig paths, + /** If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged. */ + @JsonProperty("urls") PermissionUrlsConfig urls, + /** If specified, replaces the host-supplied GitHub Content Exclusion policies on the session (combined with natively-discovered policies when evaluating tool/file access). Omit to leave the current policies unchanged. */ + @JsonProperty("additionalContentExclusionPolicies") List additionalContentExclusionPolicies +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsConfigureResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsConfigureResult.java new file mode 100644 index 0000000000..267403f092 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsConfigureResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsConfigureResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustAddTrustedParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustAddTrustedParams.java new file mode 100644 index 0000000000..27544af717 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustAddTrustedParams.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.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; + +/** + * Folder path to add to trusted folders. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsFolderTrustAddTrustedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Folder path to mark as trusted */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustAddTrustedResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustAddTrustedResult.java new file mode 100644 index 0000000000..d7181cd860 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustAddTrustedResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsFolderTrustAddTrustedResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustApi.java similarity index 58% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustApi.java index d6c1e3b4d3..00191e5c4b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustApi.java @@ -5,18 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; /** - * API methods for the {@code ui} namespace. + * API methods for the {@code permissions.folderTrust} namespace. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionUiApi { +public final class SessionPermissionsFolderTrustApi { private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; @@ -24,35 +24,39 @@ public final class SessionUiApi { private final String sessionId; /** @param caller the RPC transport function */ - SessionUiApi(RpcCaller caller, String sessionId) { + SessionPermissionsFolderTrustApi(RpcCaller caller, String sessionId) { this.caller = caller; this.sessionId = sessionId; } /** - * The elicitation response (accept with form values, decline, or cancel) + * Folder path to check for trust. *

* 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 elicitation(SessionUiElicitationParams params) { + public CompletableFuture isTrusted(SessionPermissionsFolderTrustIsTrustedParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.ui.elicitation", _p, SessionUiElicitationResult.class); + return caller.invoke("session.permissions.folderTrust.isTrusted", _p, SessionPermissionsFolderTrustIsTrustedResult.class); } /** - * Invokes {@code session.ui.handlePendingElicitation}. + * Folder path to add to trusted folders. *

* 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 handlePendingElicitation(SessionUiHandlePendingElicitationParams params) { + public CompletableFuture addTrusted(SessionPermissionsFolderTrustAddTrustedParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.ui.handlePendingElicitation", _p, SessionUiHandlePendingElicitationResult.class); + return caller.invoke("session.permissions.folderTrust.addTrusted", _p, SessionPermissionsFolderTrustAddTrustedResult.class); } } diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustIsTrustedParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustIsTrustedParams.java new file mode 100644 index 0000000000..f8d666a88f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustIsTrustedParams.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.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; + +/** + * Folder path to check for trust. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsFolderTrustIsTrustedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Folder path to check */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustIsTrustedResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustIsTrustedResult.java new file mode 100644 index 0000000000..c969d324b7 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsFolderTrustIsTrustedResult.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.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; + +/** + * Folder trust check result. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsFolderTrustIsTrustedResult( + /** Whether the folder is trusted */ + @JsonProperty("trusted") Boolean trusted +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsGetAllowAllParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsGetAllowAllParams.java new file mode 100644 index 0000000000..ff74dc08d3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsGetAllowAllParams.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.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; + +/** + * No parameters. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsGetAllowAllParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsGetAllowAllResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsGetAllowAllResult.java new file mode 100644 index 0000000000..84b7cfbf09 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsGetAllowAllResult.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.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; + +/** + * Current full allow-all permission state. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsGetAllowAllResult( + /** Whether full allow-all permissions are currently active */ + @JsonProperty("enabled") Boolean enabled +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java similarity index 84% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java index 016d2001c1..2f061ed0c7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsHandlePendingPermissionRequestParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.permissions.handlePendingPermissionRequest} RPC method. + * Pending permission request ID and the decision to apply (approve/reject and scope). * * @since 1.0.0 */ @@ -25,6 +25,7 @@ public record SessionPermissionsHandlePendingPermissionRequestParams( @JsonProperty("sessionId") String sessionId, /** Request ID of the pending permission request */ @JsonProperty("requestId") String requestId, + /** The client's response to the pending permission prompt */ @JsonProperty("result") Object result ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.java index cbbdd075bf..07bcc16e7d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsHandlePendingPermissionRequestResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.permissions.handlePendingPermissionRequest} RPC method. + * Indicates whether the permission decision was applied; false when the request was already resolved. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsAddToolApprovalParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsAddToolApprovalParams.java new file mode 100644 index 0000000000..bb99721ab6 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsAddToolApprovalParams.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.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; + +/** + * Location-scoped tool approval to persist. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsLocationsAddToolApprovalParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Location key (git root or cwd) to persist the approval to */ + @JsonProperty("locationKey") String locationKey, + /** Tool approval to persist and apply */ + @JsonProperty("approval") Object approval +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsAddToolApprovalResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsAddToolApprovalResult.java new file mode 100644 index 0000000000..0448517203 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsAddToolApprovalResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsLocationsAddToolApprovalResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApi.java new file mode 100644 index 0000000000..c40877b6b8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApi.java @@ -0,0 +1,77 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code permissions.locations} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionPermissionsLocationsApi { + + 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 */ + SessionPermissionsLocationsApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Working directory to resolve into a location-permissions key. + *

+ * 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 resolve(SessionPermissionsLocationsResolveParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.locations.resolve", _p, SessionPermissionsLocationsResolveResult.class); + } + + /** + * Working directory to load persisted location permissions for. + *

+ * 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 apply(SessionPermissionsLocationsApplyParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.locations.apply", _p, SessionPermissionsLocationsApplyResult.class); + } + + /** + * Location-scoped tool approval to persist. + *

+ * 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 addToolApproval(SessionPermissionsLocationsAddToolApprovalParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.locations.addToolApproval", _p, SessionPermissionsLocationsAddToolApprovalResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApplyParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApplyParams.java new file mode 100644 index 0000000000..aa40ddb2a8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApplyParams.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.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; + +/** + * Working directory to load persisted location permissions for. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsLocationsApplyParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Working directory whose persisted location permissions should be applied */ + @JsonProperty("workingDirectory") String workingDirectory +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApplyResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApplyResult.java new file mode 100644 index 0000000000..842226b325 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsApplyResult.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.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; + +/** + * Summary of persisted location permissions applied to the session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsLocationsApplyResult( + /** Location key used in the location-permissions store */ + @JsonProperty("locationKey") String locationKey, + /** Whether the location is a git repo or directory */ + @JsonProperty("locationType") PermissionLocationType locationType, + /** Whether a different location was applied since the previous apply call */ + @JsonProperty("changed") Boolean changed, + /** Number of location-scoped rules added to the live permission service */ + @JsonProperty("appliedRuleCount") Long appliedRuleCount, + /** Number of persisted allowed directories added to the live path manager */ + @JsonProperty("appliedDirectoryCount") Long appliedDirectoryCount, + /** Location-scoped rules applied to the live permission service */ + @JsonProperty("appliedRules") List appliedRules +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsResolveParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsResolveParams.java new file mode 100644 index 0000000000..2e4f5cf2fc --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsResolveParams.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.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; + +/** + * Working directory to resolve into a location-permissions key. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsLocationsResolveParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Working directory whose permission location should be resolved */ + @JsonProperty("workingDirectory") String workingDirectory +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsResolveResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsResolveResult.java new file mode 100644 index 0000000000..ff22dcafef --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsLocationsResolveResult.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.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; + +/** + * Resolved location-permissions key and type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsLocationsResolveResult( + /** Location key used in the location-permissions store */ + @JsonProperty("locationKey") String locationKey, + /** Whether the location is a git repo or directory */ + @JsonProperty("locationType") PermissionLocationType locationType +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsModifyRulesParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsModifyRulesParams.java new file mode 100644 index 0000000000..3243aea8b4 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsModifyRulesParams.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.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; + +/** + * Scope and add/remove instructions for modifying session- or location-scoped permission rules. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsModifyRulesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file. */ + @JsonProperty("scope") PermissionsModifyRulesScope scope, + /** Rules to add to the scope. Applied before `remove`/`removeAll`. */ + @JsonProperty("add") List add, + /** Specific rules to remove from the scope. Ignored when `removeAll` is true. */ + @JsonProperty("remove") List remove, + /** When true, removes every rule currently in the scope (after any `add` is applied). Useful for clearing the location scope wholesale. */ + @JsonProperty("removeAll") Boolean removeAll +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsModifyRulesResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsModifyRulesResult.java new file mode 100644 index 0000000000..6c5c83675d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsModifyRulesResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsModifyRulesResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsNotifyPromptShownParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsNotifyPromptShownParams.java new file mode 100644 index 0000000000..8c4b25c72a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsNotifyPromptShownParams.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.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; + +/** + * Notification payload describing the permission prompt that the client just rendered. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsNotifyPromptShownParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Human-readable description of the prompt the user is being asked to approve. Used by the runtime to fire the registered `permission_prompt` notification hook (e.g. terminal bell, desktop notification). */ + @JsonProperty("message") String message +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsNotifyPromptShownResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsNotifyPromptShownResult.java new file mode 100644 index 0000000000..092d8abf8b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsNotifyPromptShownResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsNotifyPromptShownResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsAddParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsAddParams.java new file mode 100644 index 0000000000..272408cce5 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsAddParams.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.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; + +/** + * Directory path to add to the session's allowed directories. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsAddParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Directory to add to the allow-list. The runtime resolves and validates the path before adding. */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsAddResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsAddResult.java new file mode 100644 index 0000000000..182c39b6f3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsAddResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsAddResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsApi.java new file mode 100644 index 0000000000..f4fc1a7709 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsApi.java @@ -0,0 +1,102 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code permissions.paths} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionPermissionsPathsApi { + + 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 */ + SessionPermissionsPathsApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * No parameters; returns the session's allow-listed directories. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture list() { + return caller.invoke("session.permissions.paths.list", java.util.Map.of("sessionId", this.sessionId), SessionPermissionsPathsListResult.class); + } + + /** + * Directory path to add to the session's allowed directories. + *

+ * 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 add(SessionPermissionsPathsAddParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.paths.add", _p, SessionPermissionsPathsAddResult.class); + } + + /** + * Directory path to set as the session's new primary working directory. + *

+ * 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 updatePrimary(SessionPermissionsPathsUpdatePrimaryParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.paths.updatePrimary", _p, SessionPermissionsPathsUpdatePrimaryResult.class); + } + + /** + * Path to evaluate against the session's allowed directories. + *

+ * 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 isPathWithinAllowedDirectories(SessionPermissionsPathsIsPathWithinAllowedDirectoriesParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.paths.isPathWithinAllowedDirectories", _p, SessionPermissionsPathsIsPathWithinAllowedDirectoriesResult.class); + } + + /** + * Path to evaluate against the session's workspace (primary) directory. + *

+ * 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 isPathWithinWorkspace(SessionPermissionsPathsIsPathWithinWorkspaceParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.paths.isPathWithinWorkspace", _p, SessionPermissionsPathsIsPathWithinWorkspaceResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinAllowedDirectoriesParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinAllowedDirectoriesParams.java new file mode 100644 index 0000000000..c9d43aeb21 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinAllowedDirectoriesParams.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.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; + +/** + * Path to evaluate against the session's allowed directories. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsIsPathWithinAllowedDirectoriesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path to check against the session's allowed directories */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinAllowedDirectoriesResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinAllowedDirectoriesResult.java new file mode 100644 index 0000000000..6e876bcca9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinAllowedDirectoriesResult.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.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; + +/** + * Indicates whether the supplied path is within the session's allowed directories. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsIsPathWithinAllowedDirectoriesResult( + /** Whether the path is within the session's allowed directories */ + @JsonProperty("allowed") Boolean allowed +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinWorkspaceParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinWorkspaceParams.java new file mode 100644 index 0000000000..c8fafd90cc --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinWorkspaceParams.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.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; + +/** + * Path to evaluate against the session's workspace (primary) directory. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsIsPathWithinWorkspaceParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Path to check against the session workspace directory */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinWorkspaceResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinWorkspaceResult.java new file mode 100644 index 0000000000..3eaf870520 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsIsPathWithinWorkspaceResult.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.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; + +/** + * Indicates whether the supplied path is within the session's workspace directory. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsIsPathWithinWorkspaceResult( + /** Whether the path is within the session workspace directory */ + @JsonProperty("allowed") Boolean allowed +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsListParams.java new file mode 100644 index 0000000000..43ae1f0404 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsListParams.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.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; + +/** + * No parameters; returns the session's allow-listed directories. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsListResult.java new file mode 100644 index 0000000000..78d86e370e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsListResult.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.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; + +/** + * Snapshot of the session's allow-listed directories and primary working directory. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsListResult( + /** All directories currently allowed for tool access on this session. */ + @JsonProperty("directories") List directories, + /** The primary working directory for this session. */ + @JsonProperty("primary") String primary +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsUpdatePrimaryParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsUpdatePrimaryParams.java new file mode 100644 index 0000000000..98a7ccfb21 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsUpdatePrimaryParams.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.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; + +/** + * Directory path to set as the session's new primary working directory. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsUpdatePrimaryParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Directory to set as the new primary working directory for the session's permission policy. */ + @JsonProperty("path") String path +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsUpdatePrimaryResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsUpdatePrimaryResult.java new file mode 100644 index 0000000000..7be2981321 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPathsUpdatePrimaryResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPathsUpdatePrimaryResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPendingRequestsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPendingRequestsParams.java new file mode 100644 index 0000000000..4e3f24cb7f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPendingRequestsParams.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.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; + +/** + * No parameters; returns currently-pending permission requests for the session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPendingRequestsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPendingRequestsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPendingRequestsResult.java new file mode 100644 index 0000000000..33769fa8bd --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsPendingRequestsResult.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.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; + +/** + * List of pending permission requests reconstructed from event history. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsPendingRequestsResult( + /** Pending permission prompts reconstructed from the session's event history. Equivalent to the set of `permission.requested` events that have not yet been followed by a matching `permission.completed` event. Used by clients (e.g. the CLI) to hydrate UI for prompts that were emitted before the client attached to the session. */ + @JsonProperty("items") List items +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java index 6fa1b0310f..dd369bf43d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.permissions.resetSessionApprovals} RPC method. + * No parameters; clears all session-scoped tool permission approvals. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsResult.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsResult.java index 91fa4c7822..2097ed0647 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsResetSessionApprovalsResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsResetSessionApprovalsResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.permissions.resetSessionApprovals} RPC method. + * Indicates whether the operation succeeded. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java similarity index 77% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java index cd6ad254cc..e6335f45bd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,17 +13,17 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.permissions.setApproveAll} RPC method. + * Whether to enable full allow-all permissions for the session. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public record SessionPermissionsSetApproveAllParams( +public record SessionPermissionsSetAllowAllParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, - /** Whether to auto-approve all tool permission requests */ + /** Whether to enable full allow-all permissions */ @JsonProperty("enabled") Boolean enabled ) { } diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllResult.java new file mode 100644 index 0000000000..5026dd78b6 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetAllowAllResult.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.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; + +/** + * Indicates whether the operation succeeded and reports the post-mutation state. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsSetAllowAllResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success, + /** Authoritative allow-all state after the mutation */ + @JsonProperty("enabled") Boolean enabled +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetApproveAllParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetApproveAllParams.java new file mode 100644 index 0000000000..0517a5d86d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetApproveAllParams.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.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; + +/** + * Allow-all toggle for tool permission requests, with an optional telemetry source. + * + * @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, + /** Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. */ + @JsonProperty("source") PermissionsSetApproveAllSource source +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetApproveAllResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetApproveAllResult.java index be59662460..7504cac18f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsSetApproveAllResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetApproveAllResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.permissions.setApproveAll} RPC method. + * Indicates whether the operation succeeded. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetRequiredParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetRequiredParams.java new file mode 100644 index 0000000000..e3c3e0e34b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetRequiredParams.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.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; + +/** + * Toggles whether permission prompts should be bridged into session events for this client. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsSetRequiredParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Whether the client wants `permission.requested` events bridged from the session-owned permission service. CLI clients that render prompt UI set this to `true` for as long as their listener is mounted; headless callers leave it unset (the default is `false`). */ + @JsonProperty("required") Boolean required +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetRequiredResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetRequiredResult.java new file mode 100644 index 0000000000..eaab9e3787 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsSetRequiredResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsSetRequiredResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsApi.java new file mode 100644 index 0000000000..71b97adff5 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsApi.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.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code permissions.urls} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionPermissionsUrlsApi { + + 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 */ + SessionPermissionsUrlsApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Whether the URL-permission policy should run in unrestricted mode. + *

+ * 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 setUnrestrictedMode(SessionPermissionsUrlsSetUnrestrictedModeParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.permissions.urls.setUnrestrictedMode", _p, SessionPermissionsUrlsSetUnrestrictedModeResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsSetUnrestrictedModeParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsSetUnrestrictedModeParams.java new file mode 100644 index 0000000000..6579489eb1 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsSetUnrestrictedModeParams.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.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; + +/** + * Whether the URL-permission policy should run in unrestricted mode. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsUrlsSetUnrestrictedModeParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Whether to allow access to all URLs without prompting. Toggles the runtime's URL-permission policy in place. */ + @JsonProperty("enabled") Boolean enabled +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsSetUnrestrictedModeResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsSetUnrestrictedModeResult.java new file mode 100644 index 0000000000..beef183a71 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPermissionsUrlsSetUnrestrictedModeResult.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.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; + +/** + * Indicates whether the operation succeeded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionPermissionsUrlsSetUnrestrictedModeResult( + /** Whether the operation succeeded */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanApi.java similarity index 80% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPlanApi.java index 8792bce7e0..25ff6884f2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,9 @@ public final class SessionPlanApi { } /** - * Invokes {@code session.plan.read}. + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ public CompletableFuture read() { @@ -38,10 +40,12 @@ public CompletableFuture read() { } /** - * Invokes {@code session.plan.update}. + * Replacement contents to write to the session plan file. *

* 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 update(SessionPlanUpdateParams params) { @@ -51,7 +55,9 @@ public CompletableFuture update(SessionPlanUpdateParams params) { } /** - * Invokes {@code session.plan.delete}. + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ public CompletableFuture delete() { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanDeleteParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPlanDeleteParams.java index ba09c2d660..d47bd774ea 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanDeleteParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.plan.delete} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanDeleteResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPlanDeleteResult.java index 6661099853..98cb199e6a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanDeleteResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanDeleteResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadParams.java index 23484403de..57949be2b5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.plan.read} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadResult.java similarity index 90% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadResult.java index ddfe1cf5c3..65a1ba75f1 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanReadResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.plan.read} RPC method. + * Existence, contents, and resolved path of the session plan file. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanUpdateParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPlanUpdateParams.java index 9bd69e3848..128a7b814f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanUpdateParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.plan.update} RPC method. + * Replacement contents to write to the session plan file. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanUpdateResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPlanUpdateResult.java index aa6c64aaf7..3e17cfedae 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPlanUpdateResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPlanUpdateResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPluginsApi.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPluginsApi.java index 897fecd162..e59e2b398f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPluginsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -28,7 +28,7 @@ public final class SessionPluginsApi { } /** - * Invokes {@code session.plugins.list}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPluginsListParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPluginsListParams.java index b3407dd520..7229b23a06 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPluginsListParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.plugins.list} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionPluginsListResult.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionPluginsListResult.java index 501e8760d0..bdf3e6dd81 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPluginsListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionPluginsListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.plugins.list} RPC method. + * Plugins installed for the session, with their enabled state and version metadata. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionQueueApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionQueueApi.java new file mode 100644 index 0000000000..9c4a13b557 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionQueueApi.java @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code queue} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionQueueApi { + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionQueueApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture pendingItems() { + return caller.invoke("session.queue.pendingItems", java.util.Map.of("sessionId", this.sessionId), SessionQueuePendingItemsResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture removeMostRecent() { + return caller.invoke("session.queue.removeMostRecent", java.util.Map.of("sessionId", this.sessionId), SessionQueueRemoveMostRecentResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture clear() { + return caller.invoke("session.queue.clear", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionQueueClearParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionQueueClearParams.java new file mode 100644 index 0000000000..38d4404c76 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionQueueClearParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueClearParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionQueuePendingItemsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionQueuePendingItemsParams.java new file mode 100644 index 0000000000..a4e2b10c21 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionQueuePendingItemsParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueuePendingItemsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionQueuePendingItemsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionQueuePendingItemsResult.java new file mode 100644 index 0000000000..0a8e6540e5 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionQueuePendingItemsResult.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.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; + +/** + * Snapshot of the session's pending queued items and immediate-steering messages. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueuePendingItemsResult( + /** Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items. */ + @JsonProperty("items") List items, + /** Display text for messages currently in the immediate steering queue (interjections sent during a running turn). */ + @JsonProperty("steeringMessages") List steeringMessages +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionQueueRemoveMostRecentParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionQueueRemoveMostRecentParams.java new file mode 100644 index 0000000000..26419bcea6 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionQueueRemoveMostRecentParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueRemoveMostRecentParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionQueueRemoveMostRecentResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionQueueRemoveMostRecentResult.java new file mode 100644 index 0000000000..ecd428322c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionQueueRemoveMostRecentResult.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.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; + +/** + * Indicates whether a user-facing pending item was removed. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionQueueRemoveMostRecentResult( + /** True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. */ + @JsonProperty("removed") Boolean removed +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteApi.java similarity index 67% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionRemoteApi.java index 790e1a7255..3e4f2ce8c3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,7 @@ public final class SessionRemoteApi { } /** - * Invokes {@code session.remote.enable}. + * Optional remote session mode ("off", "export", or "on"); defaults to enabling both export and remote steering. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -45,7 +45,7 @@ public CompletableFuture enable(SessionRemoteEnablePa } /** - * Invokes {@code session.remote.disable}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -54,4 +54,19 @@ public CompletableFuture disable() { return caller.invoke("session.remote.disable", java.util.Map.of("sessionId", this.sessionId), Void.class); } + /** + * New remote-steerability state to persist as a `session.remote_steerable_changed` event. + *

+ * 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 notifySteerableChanged(SessionRemoteNotifySteerableChangedParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.remote.notifySteerableChanged", _p, Void.class); + } + } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteDisableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteDisableParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteDisableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionRemoteDisableParams.java index 2de2190ecc..a49197aa14 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteDisableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteDisableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.remote.disable} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteEnableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteEnableParams.java similarity index 78% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteEnableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionRemoteEnableParams.java index aa1fff7a23..20c3db98a2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteEnableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteEnableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.remote.enable} RPC method. + * Optional remote session mode ("off", "export", or "on"); defaults to enabling both export and remote steering. * * @since 1.0.0 */ @@ -23,7 +23,7 @@ public record SessionRemoteEnableParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, - /** Per-session remote mode. "off" disables remote, "export" exports session events to Mission Control without enabling remote steering, "on" enables both export and remote steering. */ + /** Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering. */ @JsonProperty("mode") RemoteSessionMode mode ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteEnableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteEnableResult.java similarity index 83% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteEnableResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionRemoteEnableResult.java index bd8ccc48b5..5b282f91bd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRemoteEnableResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteEnableResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.remote.enable} RPC method. + * GitHub URL for the session and a flag indicating whether remote steering is enabled. * * @since 1.0.0 */ @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record SessionRemoteEnableResult( - /** Mission Control frontend URL for this session */ + /** GitHub frontend URL for this session */ @JsonProperty("url") String url, /** Whether remote steering is enabled */ @JsonProperty("remoteSteerable") Boolean remoteSteerable diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteNotifySteerableChangedParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteNotifySteerableChangedParams.java new file mode 100644 index 0000000000..13df7f676e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteNotifySteerableChangedParams.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.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; + +/** + * New remote-steerability state to persist as a `session.remote_steerable_changed` event. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionRemoteNotifySteerableChangedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Whether the session now supports remote steering via GitHub. The runtime persists this as a `session.remote_steerable_changed` event so resume/replay sees the up-to-date capability. */ + @JsonProperty("remoteSteerable") Boolean remoteSteerable +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteNotifySteerableChangedResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteNotifySteerableChangedResult.java new file mode 100644 index 0000000000..4d48e604d6 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionRemoteNotifySteerableChangedResult.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.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; + +/** + * Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionRemoteNotifySteerableChangedResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRpc.java b/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java similarity index 61% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRpc.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java index 60a741224c..37567e7a77 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionRpc.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionRpc.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,6 +30,8 @@ public final class SessionRpc { /** API methods for the {@code auth} namespace. */ public final SessionAuthApi auth; + /** API methods for the {@code canvas} namespace. */ + public final SessionCanvasApi canvas; /** API methods for the {@code model} namespace. */ public final SessionModelApi model; /** API methods for the {@code mode} namespace. */ @@ -54,24 +56,38 @@ public final class SessionRpc { public final SessionMcpApi mcp; /** API methods for the {@code plugins} namespace. */ public final SessionPluginsApi plugins; + /** API methods for the {@code options} namespace. */ + public final SessionOptionsApi options; + /** API methods for the {@code lsp} namespace. */ + public final SessionLspApi lsp; /** API methods for the {@code extensions} namespace. */ public final SessionExtensionsApi extensions; /** API methods for the {@code tools} namespace. */ public final SessionToolsApi tools; /** API methods for the {@code commands} namespace. */ public final SessionCommandsApi commands; + /** API methods for the {@code telemetry} namespace. */ + public final SessionTelemetryApi telemetry; /** API methods for the {@code ui} namespace. */ public final SessionUiApi ui; /** API methods for the {@code permissions} namespace. */ public final SessionPermissionsApi permissions; + /** API methods for the {@code metadata} namespace. */ + public final SessionMetadataApi metadata; /** API methods for the {@code shell} namespace. */ public final SessionShellApi shell; /** API methods for the {@code history} namespace. */ public final SessionHistoryApi history; + /** API methods for the {@code queue} namespace. */ + public final SessionQueueApi queue; + /** API methods for the {@code eventLog} namespace. */ + public final SessionEventLogApi eventLog; /** API methods for the {@code usage} namespace. */ public final SessionUsageApi usage; /** API methods for the {@code remote} namespace. */ public final SessionRemoteApi remote; + /** API methods for the {@code schedule} namespace. */ + public final SessionScheduleApi schedule; /** * Creates a new session RPC client. @@ -83,6 +99,7 @@ public SessionRpc(RpcCaller caller, String sessionId) { this.caller = caller; this.sessionId = sessionId; this.auth = new SessionAuthApi(caller, sessionId); + this.canvas = new SessionCanvasApi(caller, sessionId); this.model = new SessionModelApi(caller, sessionId); this.mode = new SessionModeApi(caller, sessionId); this.name = new SessionNameApi(caller, sessionId); @@ -95,19 +112,28 @@ public SessionRpc(RpcCaller caller, String sessionId) { this.skills = new SessionSkillsApi(caller, sessionId); this.mcp = new SessionMcpApi(caller, sessionId); this.plugins = new SessionPluginsApi(caller, sessionId); + this.options = new SessionOptionsApi(caller, sessionId); + this.lsp = new SessionLspApi(caller, sessionId); this.extensions = new SessionExtensionsApi(caller, sessionId); this.tools = new SessionToolsApi(caller, sessionId); this.commands = new SessionCommandsApi(caller, sessionId); + this.telemetry = new SessionTelemetryApi(caller, sessionId); this.ui = new SessionUiApi(caller, sessionId); this.permissions = new SessionPermissionsApi(caller, sessionId); + this.metadata = new SessionMetadataApi(caller, sessionId); this.shell = new SessionShellApi(caller, sessionId); this.history = new SessionHistoryApi(caller, sessionId); + this.queue = new SessionQueueApi(caller, sessionId); + this.eventLog = new SessionEventLogApi(caller, sessionId); this.usage = new SessionUsageApi(caller, sessionId); this.remote = new SessionRemoteApi(caller, sessionId); + this.schedule = new SessionScheduleApi(caller, sessionId); } /** - * Invokes {@code session.suspend}. + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ public CompletableFuture suspend() { @@ -115,10 +141,57 @@ public CompletableFuture suspend() { } /** - * Invokes {@code session.log}. + * Parameters for sending a user message to the session + *

+ * 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 send(SessionSendParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.send", _p, SessionSendResult.class); + } + + /** + * Parameters for aborting the current turn *

* 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 abort(SessionAbortParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.abort", _p, SessionAbortResult.class); + } + + /** + * Parameters for shutting down the session + *

+ * 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 shutdown(SessionShutdownParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.shutdown", _p, Void.class); + } + + /** + * Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip. + *

+ * 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 log(SessionLogParams params) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleApi.java similarity index 65% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionScheduleApi.java index e1f179e53b..e35fb21979 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionHistoryApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleApi.java @@ -5,18 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; /** - * API methods for the {@code history} namespace. + * API methods for the {@code schedule} namespace. * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionHistoryApi { +public final class SessionScheduleApi { private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; @@ -24,23 +24,23 @@ public final class SessionHistoryApi { private final String sessionId; /** @param caller the RPC transport function */ - SessionHistoryApi(RpcCaller caller, String sessionId) { + SessionScheduleApi(RpcCaller caller, String sessionId) { this.caller = caller; this.sessionId = sessionId; } /** - * Invokes {@code session.history.compact}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture compact() { - return caller.invoke("session.history.compact", java.util.Map.of("sessionId", this.sessionId), SessionHistoryCompactResult.class); + public CompletableFuture list() { + return caller.invoke("session.schedule.list", java.util.Map.of("sessionId", this.sessionId), SessionScheduleListResult.class); } /** - * Invokes {@code session.history.truncate}. + * Identifier of the scheduled prompt to remove. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -48,10 +48,10 @@ public CompletableFuture compact() { * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ - public CompletableFuture truncate(SessionHistoryTruncateParams params) { + public CompletableFuture stop(SessionScheduleStopParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); _p.put("sessionId", this.sessionId); - return caller.invoke("session.history.truncate", _p, SessionHistoryTruncateResult.class); + return caller.invoke("session.schedule.stop", _p, SessionScheduleStopResult.class); } } diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleListParams.java new file mode 100644 index 0000000000..3dda01502b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleListParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleListResult.java new file mode 100644 index 0000000000..6a5ec101c3 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleListResult.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.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; + +/** + * Snapshot of the currently active recurring prompts for this session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleListResult( + /** Active scheduled prompts, ordered by id. */ + @JsonProperty("entries") List entries +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleStopParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleStopParams.java new file mode 100644 index 0000000000..3215999914 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleStopParams.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.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; + +/** + * Identifier of the scheduled prompt to remove. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleStopParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Id of the scheduled prompt to remove. */ + @JsonProperty("id") Long id +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleStopResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleStopResult.java new file mode 100644 index 0000000000..b61b0bb9ed --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionScheduleStopResult.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.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; + +/** + * Remove a scheduled prompt by id. The result entry is omitted if the id was unknown. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionScheduleStopResult( + /** The removed entry, or omitted if no entry matched. */ + @JsonProperty("entry") ScheduleEntry entry +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java new file mode 100644 index 0000000000..42177c82d8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSendParams.java @@ -0,0 +1,55 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * Parameters for sending a user message to the session + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSendParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The user message text */ + @JsonProperty("prompt") String prompt, + /** If provided, this is shown in the timeline instead of `prompt` */ + @JsonProperty("displayPrompt") String displayPrompt, + /** Optional attachments (files, directories, selections, blobs, GitHub references) to include with the message */ + @JsonProperty("attachments") List attachments, + /** How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. */ + @JsonProperty("mode") SendMode mode, + /** If true, adds the message to the front of the queue instead of the end */ + @JsonProperty("prepend") Boolean prepend, + /** If false, this message will not trigger a Premium Request Unit charge. User messages default to billable. */ + @JsonProperty("billable") Boolean billable, + /** If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange */ + @JsonProperty("requiredTool") String requiredTool, + /** Optional provenance tag copied to the resulting user.message event. Supported values are `system`, `command-*`, and `schedule-*`. */ + @JsonProperty("source") Object source, + /** The UI mode the agent was in when this message was sent. Defaults to the session's current mode. */ + @JsonProperty("agentMode") SendAgentMode agentMode, + /** Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. */ + @JsonProperty("requestHeaders") Map requestHeaders, + /** W3C Trace Context traceparent header for distributed tracing of this agent turn */ + @JsonProperty("traceparent") String traceparent, + /** W3C Trace Context tracestate header for distributed tracing */ + @JsonProperty("tracestate") String tracestate, + /** If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. */ + @JsonProperty("wait") Boolean wait_ +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionSendResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSendResult.java new file mode 100644 index 0000000000..747435e18e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSendResult.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.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 of sending a user message + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSendResult( + /** Unique identifier assigned to the message */ + @JsonProperty("messageId") String messageId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionShellApi.java similarity index 83% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionShellApi.java index b86074342c..9abf8a626f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionShellApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,10 +30,12 @@ public final class SessionShellApi { } /** - * Invokes {@code session.shell.exec}. + * Shell command to run, with optional working directory and timeout in milliseconds. *

* 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 exec(SessionShellExecParams params) { @@ -43,10 +45,12 @@ public CompletableFuture exec(SessionShellExecParams par } /** - * Invokes {@code session.shell.kill}. + * Identifier of a process previously returned by "shell.exec" and the signal to send. *

* 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 kill(SessionShellKillParams params) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionShellExecParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionShellExecParams.java index 3aeeebff05..817adc93c8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionShellExecParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.shell.exec} RPC method. + * Shell command to run, with optional working directory and timeout in milliseconds. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionShellExecResult.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionShellExecResult.java index 34288630b4..28a7565353 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellExecResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionShellExecResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.shell.exec} RPC method. + * Identifier of the spawned process, used to correlate streamed output and exit notifications. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionShellKillParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionShellKillParams.java index cb0e128b6d..1b26f1cb49 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionShellKillParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.shell.kill} RPC method. + * Identifier of a process previously returned by "shell.exec" and the signal to send. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionShellKillResult.java similarity index 85% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionShellKillResult.java index e786d93c40..db3ff08cf4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionShellKillResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionShellKillResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.shell.kill} RPC method. + * Indicates whether the signal was delivered; false if the process was unknown or already exited. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionShutdownParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionShutdownParams.java new file mode 100644 index 0000000000..c17bef956d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionShutdownParams.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.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; + +/** + * Parameters for shutting down the session + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionShutdownParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Why the session is being shut down. Defaults to "routine" when omitted. */ + @JsonProperty("type") ShutdownType type, + /** Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'. */ + @JsonProperty("reason") String reason +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsApi.java similarity index 74% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsApi.java index 6f46d19d75..0d6a2fec37 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,7 +30,7 @@ public final class SessionSkillsApi { } /** - * Invokes {@code session.skills.list}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -40,7 +40,17 @@ public CompletableFuture list() { } /** - * Invokes {@code session.skills.enable}. + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getInvoked() { + return caller.invoke("session.skills.getInvoked", java.util.Map.of("sessionId", this.sessionId), SessionSkillsGetInvokedResult.class); + } + + /** + * Name of the skill to enable for the session. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -55,7 +65,7 @@ public CompletableFuture enable(SessionSkillsEnableParams params) { } /** - * Invokes {@code session.skills.disable}. + * Name of the skill to disable for the session. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -70,7 +80,7 @@ public CompletableFuture disable(SessionSkillsDisableParams params) { } /** - * Invokes {@code session.skills.reload}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -79,4 +89,14 @@ public CompletableFuture reload() { return caller.invoke("session.skills.reload", java.util.Map.of("sessionId", this.sessionId), SessionSkillsReloadResult.class); } + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture ensureLoaded() { + return caller.invoke("session.skills.ensureLoaded", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsDisableParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsDisableParams.java index 163df3a0a0..ba1df8ea2c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsDisableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.skills.disable} RPC method. + * Name of the skill to disable for the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsDisableResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsDisableResult.java index 7f3fe40b88..3bd4b7dadb 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsDisableResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsDisableResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnableParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnableParams.java index 72b1944cd5..6e6a7fd628 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnableParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.skills.enable} RPC method. + * Name of the skill to enable for the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnableResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnableResult.java index 1e7ea4c7fd..e8684ddc1f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsEnableResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnableResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnsureLoadedParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnsureLoadedParams.java new file mode 100644 index 0000000000..1d5a7f102c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsEnsureLoadedParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsEnsureLoadedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsGetInvokedParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsGetInvokedParams.java new file mode 100644 index 0000000000..c17c00d07b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsGetInvokedParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsGetInvokedParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsGetInvokedResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsGetInvokedResult.java new file mode 100644 index 0000000000..ed62e0fc7d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsGetInvokedResult.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.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; + +/** + * Skills invoked during this session, ordered by invocation time (most recent last). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionSkillsGetInvokedResult( + /** Skills invoked during this session, ordered by invocation time (most recent last) */ + @JsonProperty("skills") List skills +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsListParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsListParams.java index 5575ef4789..1d45d8fa96 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsListParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.skills.list} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsListResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsListResult.java index cd8e8ea8c8..ded58a52f2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.skills.list} RPC method. + * Skills available to the session, with their enabled state. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsReloadParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsReloadParams.java index 664fd836a0..3d580001c0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsReloadParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.skills.reload} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsReloadResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSkillsReloadResult.java index 1333d57cc1..38c426e5be 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSkillsReloadResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSkillsReloadResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.skills.reload} RPC method. + * Diagnostics from reloading skill definitions, with warnings and errors as separate lists. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSuspendParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionSuspendParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSuspendParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionSuspendParams.java index 300b1e4cba..4ca1c33ab4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionSuspendParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionSuspendParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.suspend} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java new file mode 100644 index 0000000000..f203c536c4 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code tasks} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionTasksApi { + + 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 */ + SessionTasksApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Agent type, prompt, name, and optional description and model override for the new task. + *

+ * 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 startAgent(SessionTasksStartAgentParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.startAgent", _p, SessionTasksStartAgentResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture list() { + return caller.invoke("session.tasks.list", java.util.Map.of("sessionId", this.sessionId), SessionTasksListResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture refresh() { + return caller.invoke("session.tasks.refresh", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture waitForPending() { + return caller.invoke("session.tasks.waitForPending", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + + /** + * Identifier of the background task to fetch progress for. + *

+ * 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 getProgress(SessionTasksGetProgressParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.getProgress", _p, SessionTasksGetProgressResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getCurrentPromotable() { + return caller.invoke("session.tasks.getCurrentPromotable", java.util.Map.of("sessionId", this.sessionId), SessionTasksGetCurrentPromotableResult.class); + } + + /** + * Identifier of the task to promote to background mode. + *

+ * 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 promoteToBackground(SessionTasksPromoteToBackgroundParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.promoteToBackground", _p, SessionTasksPromoteToBackgroundResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture promoteCurrentToBackground() { + return caller.invoke("session.tasks.promoteCurrentToBackground", java.util.Map.of("sessionId", this.sessionId), SessionTasksPromoteCurrentToBackgroundResult.class); + } + + /** + * Identifier of the background task to cancel. + *

+ * 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 cancel(SessionTasksCancelParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.cancel", _p, SessionTasksCancelResult.class); + } + + /** + * Identifier of the completed or cancelled task to remove from tracking. + *

+ * 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 remove(SessionTasksRemoveParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.remove", _p, SessionTasksRemoveResult.class); + } + + /** + * Identifier of the target agent task, message content, and optional sender agent ID. + *

+ * 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 sendMessage(SessionTasksSendMessageParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.sendMessage", _p, SessionTasksSendMessageResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksCancelParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksCancelParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksCancelParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksCancelParams.java index 7f3ba8a5a8..56fab2d640 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksCancelParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksCancelParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.tasks.cancel} RPC method. + * Identifier of the background task to cancel. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksCancelResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksCancelResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksCancelResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksCancelResult.java index 976e75d646..ffb17a6f04 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksCancelResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksCancelResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.tasks.cancel} RPC method. + * Indicates whether the background task was successfully cancelled. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetCurrentPromotableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetCurrentPromotableParams.java new file mode 100644 index 0000000000..25a78bbc76 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetCurrentPromotableParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksGetCurrentPromotableParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetCurrentPromotableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetCurrentPromotableResult.java new file mode 100644 index 0000000000..4ca2200ec2 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetCurrentPromotableResult.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.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; + +/** + * The first sync-waiting task that can currently be promoted to background mode. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksGetCurrentPromotableResult( + /** The first sync-waiting task (agent first, then shell) that can currently be promoted to background mode. Omitted if no such task exists. The returned task is guaranteed to have executionMode='sync' and canPromoteToBackground=true at the time of the call. */ + @JsonProperty("task") Object task +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetProgressParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetProgressParams.java new file mode 100644 index 0000000000..0081430c52 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetProgressParams.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.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; + +/** + * Identifier of the background task to fetch progress for. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksGetProgressParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Task identifier (agent ID or shell ID) */ + @JsonProperty("id") String id +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetProgressResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetProgressResult.java new file mode 100644 index 0000000000..6f24e4bc91 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksGetProgressResult.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.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; + +/** + * Progress information for the task, or null when no task with that ID is tracked. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksGetProgressResult( + /** Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. */ + @JsonProperty("progress") Object progress +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksListParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksListParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksListParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksListParams.java index 379221deb1..d645ee3480 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksListParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksListParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.tasks.list} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksListResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksListResult.java index 47c5b1bec1..ec52af7515 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.tasks.list} RPC method. + * Background tasks currently tracked by the session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteCurrentToBackgroundParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteCurrentToBackgroundParams.java new file mode 100644 index 0000000000..b7ec7e39ee --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteCurrentToBackgroundParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksPromoteCurrentToBackgroundParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteCurrentToBackgroundResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteCurrentToBackgroundResult.java new file mode 100644 index 0000000000..702aa1c4e0 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteCurrentToBackgroundResult.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.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; + +/** + * The promoted task as it now exists in background mode, omitted if no promotable task was waiting. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksPromoteCurrentToBackgroundResult( + /** The promoted task as it now exists in background mode, omitted if no promotable task was waiting. Atomic operation: avoids the race window of getCurrentPromotable + promoteToBackground. */ + @JsonProperty("task") Object task +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksPromoteToBackgroundParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteToBackgroundParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksPromoteToBackgroundParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteToBackgroundParams.java index 14aca99e38..f75e97f393 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksPromoteToBackgroundParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteToBackgroundParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.tasks.promoteToBackground} RPC method. + * Identifier of the task to promote to background mode. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksPromoteToBackgroundResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteToBackgroundResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksPromoteToBackgroundResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteToBackgroundResult.java index 87f09638f6..5ed332b17c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksPromoteToBackgroundResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksPromoteToBackgroundResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.tasks.promoteToBackground} RPC method. + * Indicates whether the task was successfully promoted to background mode. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRefreshParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRefreshParams.java new file mode 100644 index 0000000000..da6e164dff --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRefreshParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksRefreshParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRefreshResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRefreshResult.java new file mode 100644 index 0000000000..497d412336 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRefreshResult.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.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; + +/** + * Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksRefreshResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksRemoveParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRemoveParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksRemoveParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksRemoveParams.java index 16e3bbf413..66a730590b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksRemoveParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRemoveParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.tasks.remove} RPC method. + * Identifier of the completed or cancelled task to remove from tracking. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksRemoveResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRemoveResult.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksRemoveResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksRemoveResult.java index c2f10222d1..0d4173cacd 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksRemoveResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRemoveResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.tasks.remove} RPC method. + * Indicates whether the task was removed. False when the task does not exist or is still running/idle. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksSendMessageParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksSendMessageParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksSendMessageParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksSendMessageParams.java index 70c70eed75..841ad104ae 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksSendMessageParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksSendMessageParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.tasks.sendMessage} RPC method. + * Identifier of the target agent task, message content, and optional sender agent ID. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksSendMessageResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksSendMessageResult.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksSendMessageResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksSendMessageResult.java index f4aabb1710..dee710d956 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksSendMessageResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksSendMessageResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.tasks.sendMessage} RPC method. + * Indicates whether the message was delivered, with an error message when delivery failed. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksStartAgentParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksStartAgentParams.java similarity index 91% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksStartAgentParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksStartAgentParams.java index 74a2ba3097..f146e6e91c 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksStartAgentParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksStartAgentParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.tasks.startAgent} RPC method. + * Agent type, prompt, name, and optional description and model override for the new task. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksStartAgentResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksStartAgentResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksStartAgentResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionTasksStartAgentResult.java index 34a5dd4921..24cd051ce7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionTasksStartAgentResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksStartAgentResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.tasks.startAgent} RPC method. + * Identifier assigned to the newly started background agent task. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksWaitForPendingParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksWaitForPendingParams.java new file mode 100644 index 0000000000..916c9f424a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksWaitForPendingParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksWaitForPendingParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTasksWaitForPendingResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksWaitForPendingResult.java new file mode 100644 index 0000000000..b8ec86d123 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTasksWaitForPendingResult.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.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; + +/** + * Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksWaitForPendingResult() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTelemetryApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTelemetryApi.java new file mode 100644 index 0000000000..92c24b4e8d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTelemetryApi.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.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code telemetry} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionTelemetryApi { + + 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 */ + SessionTelemetryApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Feature override key/value pairs to attach to subsequent telemetry events from this session. + *

+ * 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 setFeatureOverrides(SessionTelemetrySetFeatureOverridesParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.telemetry.setFeatureOverrides", _p, Void.class); + } + +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionTelemetrySetFeatureOverridesParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionTelemetrySetFeatureOverridesParams.java new file mode 100644 index 0000000000..d0f364e232 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionTelemetrySetFeatureOverridesParams.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.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; + +/** + * Feature override key/value pairs to attach to subsequent telemetry events from this session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTelemetrySetFeatureOverridesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides. */ + @JsonProperty("features") Map features +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsApi.java similarity index 72% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionToolsApi.java index 91d0587c72..81c04f2ca3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -30,10 +30,12 @@ public final class SessionToolsApi { } /** - * Invokes {@code session.tools.handlePendingToolCall}. + * Pending external tool call request ID, with the tool result or an error describing why it failed. *

* 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 handlePendingToolCall(SessionToolsHandlePendingToolCallParams params) { @@ -42,4 +44,14 @@ public CompletableFuture handlePendingT return caller.invoke("session.tools.handlePendingToolCall", _p, SessionToolsHandlePendingToolCallResult.class); } + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture initializeAndValidate() { + return caller.invoke("session.tools.initializeAndValidate", java.util.Map.of("sessionId", this.sessionId), Void.class); + } + } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsHandlePendingToolCallParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionToolsHandlePendingToolCallParams.java index 796001d8f1..a5bfa4cca4 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsHandlePendingToolCallParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.tools.handlePendingToolCall} RPC method. + * Pending external tool call request ID, with the tool result or an error describing why it failed. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsHandlePendingToolCallResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionToolsHandlePendingToolCallResult.java index 3f7a2acc1e..fefaa652e8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionToolsHandlePendingToolCallResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsHandlePendingToolCallResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.tools.handlePendingToolCall} RPC method. + * Indicates whether the external tool call result was handled successfully. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionToolsInitializeAndValidateParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsInitializeAndValidateParams.java new file mode 100644 index 0000000000..f605cb8170 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsInitializeAndValidateParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionToolsInitializeAndValidateParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionToolsInitializeAndValidateResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsInitializeAndValidateResult.java new file mode 100644 index 0000000000..b4126b3906 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionToolsInitializeAndValidateResult.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.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; + +/** + * Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionToolsInitializeAndValidateResult() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiApi.java new file mode 100644 index 0000000000..c3116fe58c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiApi.java @@ -0,0 +1,147 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code ui} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionUiApi { + + 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 */ + SessionUiApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * Prompt message and JSON schema describing the form fields to elicit from the user. + *

+ * 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 elicitation(SessionUiElicitationParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.ui.elicitation", _p, SessionUiElicitationResult.class); + } + + /** + * Pending elicitation request ID and the user's response (accept/decline/cancel + form values). + *

+ * 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 handlePendingElicitation(SessionUiHandlePendingElicitationParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.ui.handlePendingElicitation", _p, SessionUiHandlePendingElicitationResult.class); + } + + /** + * Request ID of a pending `user_input.requested` event and the user's response. + *

+ * 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 handlePendingUserInput(SessionUiHandlePendingUserInputParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.ui.handlePendingUserInput", _p, SessionUiHandlePendingUserInputResult.class); + } + + /** + * Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject). + *

+ * 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 handlePendingSampling(SessionUiHandlePendingSamplingParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.ui.handlePendingSampling", _p, SessionUiHandlePendingSamplingResult.class); + } + + /** + * Request ID of a pending `auto_mode_switch.requested` event and the user's response. + *

+ * 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 handlePendingAutoModeSwitch(SessionUiHandlePendingAutoModeSwitchParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.ui.handlePendingAutoModeSwitch", _p, SessionUiHandlePendingAutoModeSwitchResult.class); + } + + /** + * Request ID of a pending `exit_plan_mode.requested` event and the user's response. + *

+ * 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 handlePendingExitPlanMode(SessionUiHandlePendingExitPlanModeParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.ui.handlePendingExitPlanMode", _p, SessionUiHandlePendingExitPlanModeResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture registerDirectAutoModeSwitchHandler() { + return caller.invoke("session.ui.registerDirectAutoModeSwitchHandler", java.util.Map.of("sessionId", this.sessionId), SessionUiRegisterDirectAutoModeSwitchHandlerResult.class); + } + + /** + * Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release. + *

+ * 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 unregisterDirectAutoModeSwitchHandler(SessionUiUnregisterDirectAutoModeSwitchHandlerParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.ui.unregisterDirectAutoModeSwitchHandler", _p, SessionUiUnregisterDirectAutoModeSwitchHandlerResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiElicitationParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionUiElicitationParams.java index 315a857f5d..d684167040 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiElicitationParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.ui.elicitation} RPC method. + * Prompt message and JSON schema describing the form fields to elicit from the user. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiElicitationResult.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionUiElicitationResult.java index 4be941e08b..d08d7453ef 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiElicitationResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiElicitationResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingAutoModeSwitchParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingAutoModeSwitchParams.java new file mode 100644 index 0000000000..1afe7d5e7a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingAutoModeSwitchParams.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.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 ID of a pending `auto_mode_switch.requested` event and the user's response. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingAutoModeSwitchParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The unique request ID from the auto_mode_switch.requested event */ + @JsonProperty("requestId") String requestId, + /** User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline). */ + @JsonProperty("response") UIAutoModeSwitchResponse response +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingAutoModeSwitchResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingAutoModeSwitchResult.java new file mode 100644 index 0000000000..335f5d8940 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingAutoModeSwitchResult.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.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; + +/** + * Indicates whether the pending UI request was resolved by this call. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingAutoModeSwitchResult( + /** True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingElicitationParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingElicitationParams.java index 23fd0759de..73d97220f8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingElicitationParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.ui.handlePendingElicitation} RPC method. + * Pending elicitation request ID and the user's response (accept/decline/cancel + form values). * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingElicitationResult.java similarity index 85% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingElicitationResult.java index 549609a87b..bb2c91b6ec 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUiHandlePendingElicitationResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingElicitationResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.ui.handlePendingElicitation} RPC method. + * Indicates whether the elicitation response was accepted; false if it was already resolved by another client. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingExitPlanModeParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingExitPlanModeParams.java new file mode 100644 index 0000000000..87c492bdbf --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingExitPlanModeParams.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.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 ID of a pending `exit_plan_mode.requested` event and the user's response. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingExitPlanModeParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The unique request ID from the exit_plan_mode.requested event */ + @JsonProperty("requestId") String requestId, + /** Schema for the `UIExitPlanModeResponse` type. */ + @JsonProperty("response") UIExitPlanModeResponse response +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingExitPlanModeResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingExitPlanModeResult.java new file mode 100644 index 0000000000..69fc6586d2 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingExitPlanModeResult.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.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; + +/** + * Indicates whether the pending UI request was resolved by this call. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingExitPlanModeResult( + /** True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSamplingParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSamplingParams.java new file mode 100644 index 0000000000..8ce2ad2e12 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSamplingParams.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.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 ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingSamplingParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The unique request ID from the sampling.requested event */ + @JsonProperty("requestId") String requestId, + /** Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result. */ + @JsonProperty("response") UIHandlePendingSamplingResponse response +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSamplingResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSamplingResult.java new file mode 100644 index 0000000000..ced26ad66b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingSamplingResult.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.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; + +/** + * Indicates whether the pending UI request was resolved by this call. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingSamplingResult( + /** True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingUserInputParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingUserInputParams.java new file mode 100644 index 0000000000..89034cbd2c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingUserInputParams.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.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 ID of a pending `user_input.requested` event and the user's response. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingUserInputParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** The unique request ID from the user_input.requested event */ + @JsonProperty("requestId") String requestId, + /** Schema for the `UIUserInputResponse` type. */ + @JsonProperty("response") UIUserInputResponse response +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingUserInputResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingUserInputResult.java new file mode 100644 index 0000000000..ae6369ee0e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiHandlePendingUserInputResult.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.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; + +/** + * Indicates whether the pending UI request was resolved by this call. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiHandlePendingUserInputResult( + /** True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. */ + @JsonProperty("success") Boolean success +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiRegisterDirectAutoModeSwitchHandlerParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiRegisterDirectAutoModeSwitchHandlerParams.java new file mode 100644 index 0000000000..f778d3164a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiRegisterDirectAutoModeSwitchHandlerParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiRegisterDirectAutoModeSwitchHandlerParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiRegisterDirectAutoModeSwitchHandlerResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiRegisterDirectAutoModeSwitchHandlerResult.java new file mode 100644 index 0000000000..991954a268 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiRegisterDirectAutoModeSwitchHandlerResult.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.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; + +/** + * Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiRegisterDirectAutoModeSwitchHandlerResult( + /** Opaque handle representing the registration. Pass this same handle to `unregisterDirectAutoModeSwitchHandler` when the in-process handler is no longer active. Multiple registrations are reference-counted; the server bridge will only dispatch auto-mode-switch requests when no handles are active. */ + @JsonProperty("handle") String handle +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiUnregisterDirectAutoModeSwitchHandlerParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiUnregisterDirectAutoModeSwitchHandlerParams.java new file mode 100644 index 0000000000..beab56aa28 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiUnregisterDirectAutoModeSwitchHandlerParams.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.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; + +/** + * Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiUnregisterDirectAutoModeSwitchHandlerParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Handle previously returned by `registerDirectAutoModeSwitchHandler` */ + @JsonProperty("handle") String handle +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionUiUnregisterDirectAutoModeSwitchHandlerResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUiUnregisterDirectAutoModeSwitchHandlerResult.java new file mode 100644 index 0000000000..0836c5c16b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUiUnregisterDirectAutoModeSwitchHandlerResult.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.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; + +/** + * Indicates whether the handle was active and the registration count was decremented. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionUiUnregisterDirectAutoModeSwitchHandlerResult( + /** True if the handle was active and decremented the counter; false if the handle was unknown. */ + @JsonProperty("unregistered") Boolean unregistered +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUsageApi.java similarity index 92% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionUsageApi.java index 7b34027327..b9a5a14a84 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUsageApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; @@ -28,7 +28,7 @@ public final class SessionUsageApi { } /** - * Invokes {@code session.usage.getMetrics}. + * Identifies the target session. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUsageGetMetricsParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionUsageGetMetricsParams.java index 4696c7fc98..035bf64982 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUsageGetMetricsParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.usage.getMetrics} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionUsageGetMetricsResult.java similarity index 81% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionUsageGetMetricsResult.java index cb1897d279..e51b9453f9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionUsageGetMetricsResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionUsageGetMetricsResult.java @@ -5,16 +5,17 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; import java.util.Map; import javax.annotation.processing.Generated; /** - * Result for the {@code session.usage.getMetrics} RPC method. + * Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals. * * @since 1.0.0 */ @@ -27,13 +28,13 @@ public record SessionUsageGetMetricsResult( /** Raw count of user-initiated API requests */ @JsonProperty("totalUserRequests") Long totalUserRequests, /** Session-wide accumulated nano-AI units cost */ - @JsonProperty("totalNanoAiu") Long totalNanoAiu, + @JsonProperty("totalNanoAiu") Double totalNanoAiu, /** Session-wide per-token-type accumulated token counts */ @JsonProperty("tokenDetails") Map tokenDetails, /** Total time spent in model API calls (milliseconds) */ - @JsonProperty("totalApiDurationMs") Double totalApiDurationMs, - /** Session start timestamp (epoch milliseconds) */ - @JsonProperty("sessionStartTime") Long sessionStartTime, + @JsonProperty("totalApiDurationMs") Long totalApiDurationMs, + /** ISO 8601 timestamp when the session started */ + @JsonProperty("sessionStartTime") OffsetDateTime sessionStartTime, /** Aggregated code change metrics */ @JsonProperty("codeChanges") UsageMetricsCodeChanges codeChanges, /** Per-model token and request metrics, keyed by model identifier */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkingDirectoryContext.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkingDirectoryContext.java new file mode 100644 index 0000000000..b16ef01e83 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkingDirectoryContext.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Updated working directory and git context. Emitted as the new payload of `session.context_changed`. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkingDirectoryContext( + /** 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 */ + @JsonProperty("hostType") SessionWorkingDirectoryContextHostType hostType, + /** Raw host string from the git remote URL (e.g. "github.com", "dev.azure.com") */ + @JsonProperty("repositoryHost") String repositoryHost, + /** Current git branch name */ + @JsonProperty("branch") String branch, + /** Head commit of the current git branch */ + @JsonProperty("headCommit") String headCommit, + /** Merge-base commit SHA (fork point from the remote default branch) */ + @JsonProperty("baseCommit") String baseCommit +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkingDirectoryContextHostType.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkingDirectoryContextHostType.java new file mode 100644 index 0000000000..1ed7e60d0e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkingDirectoryContextHostType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Hosting platform type of the repository + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SessionWorkingDirectoryContextHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + SessionWorkingDirectoryContextHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SessionWorkingDirectoryContextHostType fromValue(String value) { + for (SessionWorkingDirectoryContextHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SessionWorkingDirectoryContextHostType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceApi.java similarity index 98% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceApi.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceApi.java index 8fd7d7467d..d74f670477 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceApi.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceApi.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import java.util.concurrent.CompletableFuture; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceCreateFileParams.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceCreateFileParams.java index c25fdd7903..94efe93132 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceCreateFileParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceCreateFileResult.java similarity index 94% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceCreateFileResult.java index e77cf58c56..f0bf113bac 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceCreateFileResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceCreateFileResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceListFilesParams.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceListFilesParams.java index 0fb6431c96..a2fd1407c3 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceListFilesParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceListFilesResult.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceListFilesResult.java index 1b46df541b..96e7ce9c45 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceListFilesResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceListFilesResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceReadFileParams.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceReadFileParams.java index ded74763a3..c39a8a5254 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceReadFileParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceReadFileResult.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceReadFileResult.java index c8705581e8..b4ece91ef7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspaceReadFileResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspaceReadFileResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesApi.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesApi.java new file mode 100644 index 0000000000..54a79c0c59 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesApi.java @@ -0,0 +1,137 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import 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; + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture getWorkspace() { + return caller.invoke("session.workspaces.getWorkspace", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesGetWorkspaceResult.class); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture listFiles() { + return caller.invoke("session.workspaces.listFiles", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesListFilesResult.class); + } + + /** + * Relative path of the workspace file to read. + *

+ * 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 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); + } + + /** + * Relative path and UTF-8 content for the workspace file to create or overwrite. + *

+ * 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 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); + } + + /** + * Identifies the target session. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + public CompletableFuture listCheckpoints() { + return caller.invoke("session.workspaces.listCheckpoints", java.util.Map.of("sessionId", this.sessionId), SessionWorkspacesListCheckpointsResult.class); + } + + /** + * Checkpoint number to read. + *

+ * 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 readCheckpoint(SessionWorkspacesReadCheckpointParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.readCheckpoint", _p, SessionWorkspacesReadCheckpointResult.class); + } + + /** + * Pasted content to save as a UTF-8 file in the session workspace. + *

+ * 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 saveLargePaste(SessionWorkspacesSaveLargePasteParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.saveLargePaste", _p, SessionWorkspacesSaveLargePasteResult.class); + } + + /** + * Parameters for computing a workspace diff. + *

+ * 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 diff(SessionWorkspacesDiffParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.workspaces.diff", _p, SessionWorkspacesDiffResult.class); + } + +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesCreateFileParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesCreateFileParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesCreateFileParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesCreateFileParams.java index def2ffe373..3d757f852a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesCreateFileParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesCreateFileParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.workspaces.createFile} RPC method. + * Relative path and UTF-8 content for the workspace file to create or overwrite. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffParams.java new file mode 100644 index 0000000000..02a2668c30 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffParams.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.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; + +/** + * Parameters for computing a workspace diff. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesDiffParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Diff mode requested by the client. */ + @JsonProperty("mode") WorkspaceDiffMode mode +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffResult.java new file mode 100644 index 0000000000..2800f24e36 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesDiffResult.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.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; + +/** + * Workspace diff result for the requested mode. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesDiffResult( + /** Diff mode requested by the client. */ + @JsonProperty("requestedMode") WorkspaceDiffMode requestedMode, + /** Effective mode used for the returned changes. */ + @JsonProperty("mode") WorkspaceDiffMode mode, + /** Changed files and their unified diffs. */ + @JsonProperty("changes") List changes, + /** Default branch used for a branch diff, when branch mode was requested. */ + @JsonProperty("baseBranch") String baseBranch, + /** Whether a requested branch diff fell back to unstaged changes because branch diff failed. */ + @JsonProperty("isFallback") Boolean isFallback +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceParams.java index c2f0e5a16d..6a7482af75 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.workspaces.getWorkspace} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceResult.java similarity index 60% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceResult.java index 6474c29822..8e79a82a19 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesGetWorkspaceResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceResult.java @@ -5,17 +5,16 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -import java.util.UUID; import javax.annotation.processing.Generated; /** - * Result for the {@code session.workspaces.getWorkspace} RPC method. + * Current workspace metadata for the session, including its absolute filesystem path when available. * * @since 1.0.0 */ @@ -24,19 +23,23 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionWorkspacesGetWorkspaceResult( /** Current workspace metadata, or null if not available */ - @JsonProperty("workspace") SessionWorkspacesGetWorkspaceResultWorkspace workspace + @JsonProperty("workspace") SessionWorkspacesGetWorkspaceResultWorkspace workspace, + /** Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ + @JsonProperty("path") String path ) { @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public record SessionWorkspacesGetWorkspaceResultWorkspace( - @JsonProperty("id") UUID id, + @JsonProperty("id") String id, @JsonProperty("cwd") String cwd, @JsonProperty("git_root") String gitRoot, @JsonProperty("repository") String repository, - @JsonProperty("host_type") SessionWorkspacesGetWorkspaceResultWorkspaceHostType hostType, + /** Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. */ + @JsonProperty("host_type") WorkspacesWorkspaceDetailsHostType hostType, @JsonProperty("branch") String branch, @JsonProperty("name") String name, + @JsonProperty("client_name") String clientName, @JsonProperty("user_named") Boolean userNamed, @JsonProperty("summary_count") Long summaryCount, @JsonProperty("created_at") OffsetDateTime createdAt, @@ -47,24 +50,5 @@ public record SessionWorkspacesGetWorkspaceResultWorkspace( @JsonProperty("mc_last_event_id") String mcLastEventId, @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); - } - } } } diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListCheckpointsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListCheckpointsParams.java new file mode 100644 index 0000000000..3d55cf43a0 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListCheckpointsParams.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.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; + +/** + * Identifies the target session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesListCheckpointsParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListCheckpointsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListCheckpointsResult.java new file mode 100644 index 0000000000..b6f562c66f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListCheckpointsResult.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.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; + +/** + * Workspace checkpoints in chronological order; empty when the workspace is not enabled. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesListCheckpointsResult( + /** Workspace checkpoints in chronological order. Empty when workspace is not enabled. */ + @JsonProperty("checkpoints") List checkpoints +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListFilesParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListFilesParams.java index 7bcee441ed..7fd4771a1e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListFilesParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.workspaces.listFiles} RPC method. + * Identifies the target session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListFilesResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListFilesResult.java index 26064cde40..90a7cf2ce0 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesListFilesResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesListFilesResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.workspaces.listFiles} RPC method. + * Relative paths of files stored in the session workspace files directory. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointParams.java new file mode 100644 index 0000000000..8266acab46 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointParams.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.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; + +/** + * Checkpoint number to read. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesReadCheckpointParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Checkpoint number to read */ + @JsonProperty("number") Long number +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointResult.java new file mode 100644 index 0000000000..1b4322994f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointResult.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.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; + +/** + * Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesReadCheckpointResult( + /** Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing */ + @JsonProperty("content") String content +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadFileParams.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadFileParams.java index 40b2778542..85f44b6080 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadFileParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code session.workspaces.readFile} RPC method. + * Relative path of the workspace file to read. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadFileResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadFileResult.java index c0ce5e7c7a..b85ce3f6ef 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesReadFileResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadFileResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code session.workspaces.readFile} RPC method. + * Contents of the requested workspace file as a UTF-8 string. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteParams.java new file mode 100644 index 0000000000..23def325c2 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteParams.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.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; + +/** + * Pasted content to save as a UTF-8 file in the session workspace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesSaveLargePasteParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Pasted content to save as a UTF-8 file */ + @JsonProperty("content") String content +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteResult.java new file mode 100644 index 0000000000..523b124889 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteResult.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.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; + +/** + * Descriptor for the saved paste file, or null when the workspace is unavailable. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionWorkspacesSaveLargePasteResult( + /** Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions) */ + @JsonProperty("saved") SessionWorkspacesSaveLargePasteResultSaved saved +) { + + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionWorkspacesSaveLargePasteResultSaved( + /** Absolute filesystem path to the saved paste file */ + @JsonProperty("filePath") String filePath, + /** Filename within the workspace files directory */ + @JsonProperty("filename") String filename, + /** Size of the saved file in bytes */ + @JsonProperty("sizeBytes") Long sizeBytes + ) { + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsBulkDeleteParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsBulkDeleteParams.java new file mode 100644 index 0000000000..e1aa506977 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsBulkDeleteParams.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.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; + +/** + * Session IDs to close, deactivate, and delete from disk. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsBulkDeleteParams( + /** Session IDs to close, deactivate, and delete from disk */ + @JsonProperty("sessionIds") List sessionIds +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsBulkDeleteResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsBulkDeleteResult.java new file mode 100644 index 0000000000..2447d409da --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsBulkDeleteResult.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.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; + +/** + * Map of sessionId -> bytes freed by removing the session's workspace directory. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsBulkDeleteResult( + /** Map of sessionId -> bytes freed by removing the session's workspace directory. Sessions whose deletion failed are omitted from this map (failures are logged on the server but not surfaced per-id; check the map for absent IDs to detect them). */ + @JsonProperty("freedBytes") Map freedBytes +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsCheckInUseParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsCheckInUseParams.java new file mode 100644 index 0000000000..4be30632d8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsCheckInUseParams.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.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; + +/** + * Session IDs to test for live in-use locks. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsCheckInUseParams( + /** Session IDs to test for live in-use locks */ + @JsonProperty("sessionIds") List sessionIds +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsCheckInUseResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsCheckInUseResult.java new file mode 100644 index 0000000000..1ab7edab79 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsCheckInUseResult.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.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; + +/** + * Session IDs from the input set that are currently in use by another process. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsCheckInUseResult( + /** Session IDs from the input set that are currently held by another running process via an alive lock file */ + @JsonProperty("inUse") List inUse +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsCloseParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsCloseParams.java new file mode 100644 index 0000000000..667e18a4cf --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsCloseParams.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.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; + +/** + * Session ID to close. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsCloseParams( + /** Session ID to close */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsCloseResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsCloseResult.java new file mode 100644 index 0000000000..a63c446338 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsCloseResult.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.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; + +/** + * Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsCloseResult() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsConnectParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsConnectParams.java new file mode 100644 index 0000000000..5d0dfffeb9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsConnectParams.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.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; + +/** + * Remote session connection parameters. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsConnectParams( + /** Session ID to connect to. */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsConnectResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsConnectResult.java new file mode 100644 index 0000000000..42c5d7e2e2 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsConnectResult.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.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; + +/** + * Remote session connection result. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsConnectResult( + /** SDK session ID for the connected remote session. */ + @JsonProperty("sessionId") String sessionId, + /** Metadata for a connected remote session. */ + @JsonProperty("metadata") ConnectedRemoteSessionMetadata metadata +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsEnrichMetadataParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsEnrichMetadataParams.java new file mode 100644 index 0000000000..973c952e9e --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsEnrichMetadataParams.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.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; + +/** + * Session metadata records to enrich with summary and context information. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsEnrichMetadataParams( + /** Session metadata records to enrich. Records that already have summary and context are returned unchanged. */ + @JsonProperty("sessions") List sessions +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsEnrichMetadataResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsEnrichMetadataResult.java new file mode 100644 index 0000000000..7457b84897 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsEnrichMetadataResult.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.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; + +/** + * The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsEnrichMetadataResult( + /** Enriched records, with summary and context backfilled. Sessions confirmed empty and unnamed may be omitted. */ + @JsonProperty("sessions") List sessions +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByPrefixParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByPrefixParams.java new file mode 100644 index 0000000000..285876be02 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByPrefixParams.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.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; + +/** + * UUID prefix to resolve to a unique session ID. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsFindByPrefixParams( + /** UUID prefix (>=7 hex chars, <36 chars). Returns the unique session ID, or undefined when there is no match or the prefix matches multiple sessions. */ + @JsonProperty("prefix") String prefix +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByPrefixResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByPrefixResult.java new file mode 100644 index 0000000000..27ceb29501 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByPrefixResult.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.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; + +/** + * Session ID matching the prefix, omitted when no unique match exists. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsFindByPrefixResult( + /** Omitted when no unique session matches the prefix (no match or ambiguous) */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByTaskIdParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByTaskIdParams.java new file mode 100644 index 0000000000..cd643796cc --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByTaskIdParams.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.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; + +/** + * GitHub task ID to look up. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsFindByTaskIdParams( + /** GitHub task ID to look up */ + @JsonProperty("taskId") String taskId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByTaskIdResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByTaskIdResult.java new file mode 100644 index 0000000000..d276340587 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsFindByTaskIdResult.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.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; + +/** + * ID of the local session bound to the given GitHub task, or omitted when none. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsFindByTaskIdResult( + /** Omitted when no local session is bound to that GitHub task */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsForkParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionsForkParams.java index 644be05ee0..33bfb3a81e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsForkParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code sessions.fork} RPC method. + * Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsForkResult.java similarity index 88% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SessionsForkResult.java index 77543916ec..5e67f101ee 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionsForkResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsForkResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code sessions.fork} RPC method. + * Identifier and optional friendly name assigned to the newly forked session. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsGetEventFilePathParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetEventFilePathParams.java new file mode 100644 index 0000000000..a0d19b5a4f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetEventFilePathParams.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.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; + +/** + * Session ID whose event-log file path to compute. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetEventFilePathParams( + /** Session ID whose event-log file path to compute */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsGetEventFilePathResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetEventFilePathResult.java new file mode 100644 index 0000000000..9d77f105f6 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetEventFilePathResult.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.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; + +/** + * Absolute path to the session's events.jsonl file on disk. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetEventFilePathResult( + /** Absolute path to the session's events.jsonl file */ + @JsonProperty("filePath") String filePath +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsGetLastForContextParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetLastForContextParams.java new file mode 100644 index 0000000000..43a23a89b6 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetLastForContextParams.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.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; + +/** + * Optional working-directory context used to score session relevance. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetLastForContextParams( + /** Optional working-directory context used to score session relevance. When omitted the most-recently-modified session wins. */ + @JsonProperty("context") SessionContext context +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsGetLastForContextResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetLastForContextResult.java new file mode 100644 index 0000000000..018b96f71f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetLastForContextResult.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.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; + +/** + * Most-relevant session ID for the supplied context, or omitted when no sessions exist. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetLastForContextResult( + /** Most-relevant session ID for the supplied context, or omitted when no sessions exist */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsGetPersistedRemoteSteerableParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetPersistedRemoteSteerableParams.java new file mode 100644 index 0000000000..21f26bfcda --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetPersistedRemoteSteerableParams.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.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; + +/** + * Session ID to look up the persisted remote-steerable flag for. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetPersistedRemoteSteerableParams( + /** Session ID to look up the persisted remote-steerable flag for */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsGetPersistedRemoteSteerableResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetPersistedRemoteSteerableResult.java new file mode 100644 index 0000000000..9dedef9818 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetPersistedRemoteSteerableResult.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.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; + +/** + * The session's persisted remote-steerable flag, or omitted when no value has been persisted. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetPersistedRemoteSteerableResult( + /** The session's persisted remote-steerable flag if recorded; omitted when no value has been persisted */ + @JsonProperty("remoteSteerable") Boolean remoteSteerable +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsGetSizesResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetSizesResult.java new file mode 100644 index 0000000000..958f6e2424 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsGetSizesResult.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.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; + +/** + * Map of sessionId -> on-disk size in bytes for each session's workspace directory. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsGetSizesResult( + /** Map of sessionId -> on-disk size in bytes for the session's workspace directory */ + @JsonProperty("sizes") Map sizes +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsListResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsListResult.java new file mode 100644 index 0000000000..7608fe3f35 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsListResult.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.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; + +/** + * Persisted sessions matching the filter, ordered most-recently-modified first. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsListResult( + /** Sessions ordered most-recently-modified first */ + @JsonProperty("sessions") List sessions +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsLoadDeferredRepoHooksParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsLoadDeferredRepoHooksParams.java new file mode 100644 index 0000000000..347b7c7e7f --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsLoadDeferredRepoHooksParams.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.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; + +/** + * Active session ID whose deferred repo-level hooks should be loaded. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsLoadDeferredRepoHooksParams( + /** Active session ID whose deferred repo-level hooks should be loaded */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsLoadDeferredRepoHooksResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsLoadDeferredRepoHooksResult.java new file mode 100644 index 0000000000..194ce088de --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsLoadDeferredRepoHooksResult.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.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; + +/** + * Queued repo-level startup prompts and the total hook command count after loading. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsLoadDeferredRepoHooksResult( + /** Repo-level startup prompts queued from repo hook configs. Empty on resume, when no repo configs were pending, or when disableAllHooks is set. */ + @JsonProperty("startupPrompts") List startupPrompts, + /** Total hook command count (user + plugin + repo) loaded for the session by this call. Captured atomically with startupPrompts so callers don't need to read a separate counter. */ + @JsonProperty("hookCount") Long hookCount +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsPruneOldParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsPruneOldParams.java new file mode 100644 index 0000000000..d854387303 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsPruneOldParams.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.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; + +/** + * Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsPruneOldParams( + /** Delete sessions whose modifiedTime is at least this many days old */ + @JsonProperty("olderThanDays") Long olderThanDays, + /** When true, only report what would be deleted without performing any deletion */ + @JsonProperty("dryRun") Boolean dryRun, + /** When true, named sessions (set via /rename) are also eligible for pruning */ + @JsonProperty("includeNamed") Boolean includeNamed, + /** Session IDs that should never be considered for pruning */ + @JsonProperty("excludeSessionIds") List excludeSessionIds +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsPruneOldResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsPruneOldResult.java new file mode 100644 index 0000000000..c04389b0cc --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsPruneOldResult.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.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; + +/** + * Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsPruneOldResult( + /** Session IDs that were deleted (always empty in dry-run mode) */ + @JsonProperty("deleted") List deleted, + /** Session IDs that would be deleted in dry-run mode (always empty otherwise) */ + @JsonProperty("candidates") List candidates, + /** Session IDs that were skipped (e.g., named sessions) */ + @JsonProperty("skipped") List skipped, + /** Total bytes freed (actual when not dry-run, projected when dry-run) */ + @JsonProperty("freedBytes") Long freedBytes, + /** True when no deletions were actually performed */ + @JsonProperty("dryRun") Boolean dryRun +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsReleaseLockParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsReleaseLockParams.java new file mode 100644 index 0000000000..76add5bcb7 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsReleaseLockParams.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.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; + +/** + * Session ID whose in-use lock should be released. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsReleaseLockParams( + /** Session ID whose in-use lock should be released */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsReleaseLockResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsReleaseLockResult.java new file mode 100644 index 0000000000..dde0c445e8 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsReleaseLockResult.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.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; + +/** + * Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsReleaseLockResult() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsReloadPluginHooksParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsReloadPluginHooksParams.java new file mode 100644 index 0000000000..82978334f1 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsReloadPluginHooksParams.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.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; + +/** + * Active session ID and an optional flag for deferring repo-level hooks until folder trust. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsReloadPluginHooksParams( + /** Active session ID to reload hooks for */ + @JsonProperty("sessionId") String sessionId, + /** When true, skip repo-level hooks. Use before folder trust is confirmed; loadDeferredRepoHooks loads them post-trust. */ + @JsonProperty("deferRepoHooks") Boolean deferRepoHooks +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsReloadPluginHooksResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsReloadPluginHooksResult.java new file mode 100644 index 0000000000..835641e4db --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsReloadPluginHooksResult.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.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; + +/** + * Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsReloadPluginHooksResult() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsSaveParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsSaveParams.java new file mode 100644 index 0000000000..27f49adddb --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsSaveParams.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.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; + +/** + * Session ID whose pending events should be flushed to disk. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsSaveParams( + /** Session ID whose pending events should be flushed to disk */ + @JsonProperty("sessionId") String sessionId +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsSaveResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsSaveResult.java new file mode 100644 index 0000000000..758d11885b --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsSaveResult.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.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; + +/** + * Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsSaveResult() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsSetAdditionalPluginsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsSetAdditionalPluginsParams.java new file mode 100644 index 0000000000..d03706e3a9 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsSetAdditionalPluginsParams.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.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; + +/** + * Manager-wide additional plugins to register; replaces any previously-configured set. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsSetAdditionalPluginsParams( + /** Manager-wide additional plugins to register. Replaces any previously-configured set. Pass an empty array to clear. */ + @JsonProperty("plugins") List plugins +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/SessionsSetAdditionalPluginsResult.java b/src/generated/java/com/github/copilot/generated/rpc/SessionsSetAdditionalPluginsResult.java new file mode 100644 index 0000000000..848ff9e086 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SessionsSetAdditionalPluginsResult.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.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; + +/** + * Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionsSetAdditionalPluginsResult() { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ShellKillSignal.java b/src/generated/java/com/github/copilot/generated/rpc/ShellKillSignal.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ShellKillSignal.java rename to src/generated/java/com/github/copilot/generated/rpc/ShellKillSignal.java index 92700c5c0f..646fa2be83 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ShellKillSignal.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ShellKillSignal.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/generated/rpc/ShutdownType.java b/src/generated/java/com/github/copilot/generated/rpc/ShutdownType.java new file mode 100644 index 0000000000..1b4e79dd48 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/ShutdownType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Why the session is being shut down. Defaults to "routine" when omitted. + * + * @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/rpc/Skill.java b/src/generated/java/com/github/copilot/generated/rpc/Skill.java similarity index 74% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/Skill.java rename to src/generated/java/com/github/copilot/generated/rpc/Skill.java index 7f3c2a4010..d64f015157 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/Skill.java +++ b/src/generated/java/com/github/copilot/generated/rpc/Skill.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `Skill` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @@ -20,13 +25,15 @@ public record 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, + /** Source location type (e.g., project, personal-copilot, plugin, builtin) */ + @JsonProperty("source") SkillSource 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 + @JsonProperty("path") String path, + /** Name of the plugin that provides the skill, when source is 'plugin' */ + @JsonProperty("pluginName") String pluginName ) { } diff --git a/src/generated/java/com/github/copilot/generated/rpc/SkillSource.java b/src/generated/java/com/github/copilot/generated/rpc/SkillSource.java new file mode 100644 index 0000000000..8d723548be --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SkillSource.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Source location type (e.g., project, personal-copilot, plugin, builtin) + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum SkillSource { + /** The {@code project} variant. */ + PROJECT("project"), + /** The {@code inherited} variant. */ + INHERITED("inherited"), + /** The {@code personal-copilot} variant. */ + PERSONAL_COPILOT("personal-copilot"), + /** The {@code personal-agents} variant. */ + PERSONAL_AGENTS("personal-agents"), + /** The {@code plugin} variant. */ + PLUGIN("plugin"), + /** The {@code custom} variant. */ + CUSTOM("custom"), + /** The {@code builtin} variant. */ + BUILTIN("builtin"); + + private final String value; + SkillSource(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static SkillSource fromValue(String value) { + for (SkillSource v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown SkillSource value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsConfigSetDisabledSkillsParams.java b/src/generated/java/com/github/copilot/generated/rpc/SkillsConfigSetDisabledSkillsParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsConfigSetDisabledSkillsParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SkillsConfigSetDisabledSkillsParams.java index 94a32b573b..200e88cd7a 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsConfigSetDisabledSkillsParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SkillsConfigSetDisabledSkillsParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code skills.config.setDisabledSkills} RPC method. + * Skill names to mark as disabled in global configuration, replacing any previous list. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverParams.java b/src/generated/java/com/github/copilot/generated/rpc/SkillsDiscoverParams.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverParams.java rename to src/generated/java/com/github/copilot/generated/rpc/SkillsDiscoverParams.java index 053d42585a..1176806996 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SkillsDiscoverParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code skills.discover} RPC method. + * Optional project paths and additional skill directories to include in discovery. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverResult.java b/src/generated/java/com/github/copilot/generated/rpc/SkillsDiscoverResult.java similarity index 89% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverResult.java rename to src/generated/java/com/github/copilot/generated/rpc/SkillsDiscoverResult.java index a2f0efe971..f56c814bce 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SkillsDiscoverResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SkillsDiscoverResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code skills.discover} RPC method. + * Skills discovered across global and project sources. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/SkillsInvokedSkill.java b/src/generated/java/com/github/copilot/generated/rpc/SkillsInvokedSkill.java new file mode 100644 index 0000000000..697e18fa4c --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/SkillsInvokedSkill.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.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; + +/** + * Schema for the `SkillsInvokedSkill` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SkillsInvokedSkill( + /** Unique identifier for the skill */ + @JsonProperty("name") String name, + /** Path to the SKILL.md file */ + @JsonProperty("path") String path, + /** Full content of the skill file */ + @JsonProperty("content") String content, + /** Tools that should be auto-approved when this skill is active, captured at invocation time */ + @JsonProperty("allowedTools") List allowedTools, + /** Turn number when the skill was invoked */ + @JsonProperty("invokedAtTurn") Long invokedAtTurn +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInfo.java b/src/generated/java/com/github/copilot/generated/rpc/SlashCommandInfo.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInfo.java rename to src/generated/java/com/github/copilot/generated/rpc/SlashCommandInfo.java index e494f4894c..722274524f 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInfo.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SlashCommandInfo.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,6 +13,11 @@ import java.util.List; import javax.annotation.processing.Generated; +/** + * Schema for the `SlashCommandInfo` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInput.java b/src/generated/java/com/github/copilot/generated/rpc/SlashCommandInput.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInput.java rename to src/generated/java/com/github/copilot/generated/rpc/SlashCommandInput.java index 186dec5a81..dcfc2a36e7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInput.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SlashCommandInput.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInputCompletion.java b/src/generated/java/com/github/copilot/generated/rpc/SlashCommandInputCompletion.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInputCompletion.java rename to src/generated/java/com/github/copilot/generated/rpc/SlashCommandInputCompletion.java index c192fa9c0f..bfd2e77874 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandInputCompletion.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SlashCommandInputCompletion.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandKind.java b/src/generated/java/com/github/copilot/generated/rpc/SlashCommandKind.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandKind.java rename to src/generated/java/com/github/copilot/generated/rpc/SlashCommandKind.java index 1f08c4efcd..1f05c47735 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SlashCommandKind.java +++ b/src/generated/java/com/github/copilot/generated/rpc/SlashCommandKind.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/Tool.java b/src/generated/java/com/github/copilot/generated/rpc/Tool.java similarity index 93% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/Tool.java rename to src/generated/java/com/github/copilot/generated/rpc/Tool.java index 53fbdcb8ed..e4b1361c87 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/Tool.java +++ b/src/generated/java/com/github/copilot/generated/rpc/Tool.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,6 +13,11 @@ import java.util.Map; import javax.annotation.processing.Generated; +/** + * Schema for the `Tool` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListParams.java b/src/generated/java/com/github/copilot/generated/rpc/ToolsListParams.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListParams.java rename to src/generated/java/com/github/copilot/generated/rpc/ToolsListParams.java index 2c5aa5b09e..6523f4bdc2 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListParams.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ToolsListParams.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,7 +13,7 @@ import javax.annotation.processing.Generated; /** - * Request parameters for the {@code tools.list} RPC method. + * Optional model identifier whose tool overrides should be applied to the listing. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListResult.java b/src/generated/java/com/github/copilot/generated/rpc/ToolsListResult.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListResult.java rename to src/generated/java/com/github/copilot/generated/rpc/ToolsListResult.java index 3a1b7c29d5..5127277fb7 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/ToolsListResult.java +++ b/src/generated/java/com/github/copilot/generated/rpc/ToolsListResult.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Result for the {@code tools.list} RPC method. + * Built-in tools available for the requested model, with their parameters and instructions. * * @since 1.0.0 */ diff --git a/src/generated/java/com/github/copilot/generated/rpc/UIAutoModeSwitchResponse.java b/src/generated/java/com/github/copilot/generated/rpc/UIAutoModeSwitchResponse.java new file mode 100644 index 0000000000..f6a3534d88 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/UIAutoModeSwitchResponse.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline). + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum UIAutoModeSwitchResponse { + /** The {@code yes} variant. */ + YES("yes"), + /** The {@code yes_always} variant. */ + YES_ALWAYS("yes_always"), + /** The {@code no} variant. */ + NO("no"); + + private final String value; + UIAutoModeSwitchResponse(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static UIAutoModeSwitchResponse fromValue(String value) { + for (UIAutoModeSwitchResponse v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown UIAutoModeSwitchResponse value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponse.java b/src/generated/java/com/github/copilot/generated/rpc/UIElicitationResponse.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponse.java rename to src/generated/java/com/github/copilot/generated/rpc/UIElicitationResponse.java index 058a68c0df..e157ee727b 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponse.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UIElicitationResponse.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponseAction.java b/src/generated/java/com/github/copilot/generated/rpc/UIElicitationResponseAction.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponseAction.java rename to src/generated/java/com/github/copilot/generated/rpc/UIElicitationResponseAction.java index e4811ef956..4ce8d95cd8 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationResponseAction.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UIElicitationResponseAction.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import javax.annotation.processing.Generated; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationSchema.java b/src/generated/java/com/github/copilot/generated/rpc/UIElicitationSchema.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationSchema.java rename to src/generated/java/com/github/copilot/generated/rpc/UIElicitationSchema.java index 171f5c6883..d4f0a26845 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UIElicitationSchema.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UIElicitationSchema.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeAction.java b/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeAction.java new file mode 100644 index 0000000000..1670701e10 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeAction.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum UIExitPlanModeAction { + /** The {@code exit_only} variant. */ + EXIT_ONLY("exit_only"), + /** The {@code interactive} variant. */ + INTERACTIVE("interactive"), + /** The {@code autopilot} variant. */ + AUTOPILOT("autopilot"), + /** The {@code autopilot_fleet} variant. */ + AUTOPILOT_FLEET("autopilot_fleet"); + + private final String value; + UIExitPlanModeAction(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static UIExitPlanModeAction fromValue(String value) { + for (UIExitPlanModeAction v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown UIExitPlanModeAction value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeResponse.java b/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeResponse.java new file mode 100644 index 0000000000..50e2011427 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/UIExitPlanModeResponse.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.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; + +/** + * Schema for the `UIExitPlanModeResponse` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UIExitPlanModeResponse( + /** Whether the plan was approved. */ + @JsonProperty("approved") Boolean approved, + /** The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'. */ + @JsonProperty("selectedAction") UIExitPlanModeAction selectedAction, + /** Whether subsequent edits should be auto-approved without confirmation. */ + @JsonProperty("autoApproveEdits") Boolean autoApproveEdits, + /** Feedback from the user when they declined the plan or requested changes. */ + @JsonProperty("feedback") String feedback +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/UIHandlePendingSamplingResponse.java b/src/generated/java/com/github/copilot/generated/rpc/UIHandlePendingSamplingResponse.java new file mode 100644 index 0000000000..590061f4cc --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/UIHandlePendingSamplingResponse.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.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; + +/** + * Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UIHandlePendingSamplingResponse() { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/UIUserInputResponse.java b/src/generated/java/com/github/copilot/generated/rpc/UIUserInputResponse.java new file mode 100644 index 0000000000..d4ce9899dd --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/UIUserInputResponse.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.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; + +/** + * Schema for the `UIUserInputResponse` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record UIUserInputResponse( + /** The user's answer text */ + @JsonProperty("answer") String answer, + /** True if the user typed a freeform response, false if they selected a presented choice. Used by telemetry to differentiate between free text input and choice selection. */ + @JsonProperty("wasFreeform") Boolean wasFreeform +) { +} diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsCodeChanges.java b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsCodeChanges.java similarity index 80% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsCodeChanges.java rename to src/generated/java/com/github/copilot/generated/rpc/UsageMetricsCodeChanges.java index 442c88da21..4c445efe1e 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsCodeChanges.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsCodeChanges.java @@ -5,11 +5,12 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import javax.annotation.processing.Generated; /** @@ -26,6 +27,8 @@ public record UsageMetricsCodeChanges( /** Total lines of code removed */ @JsonProperty("linesRemoved") Long linesRemoved, /** Number of distinct files modified */ - @JsonProperty("filesModifiedCount") Long filesModifiedCount + @JsonProperty("filesModifiedCount") Long filesModifiedCount, + /** Distinct file paths modified during the session */ + @JsonProperty("filesModified") List filesModified ) { } diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetric.java b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetric.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetric.java rename to src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetric.java index 844d4a1bf8..7e34f43b38 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetric.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetric.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -13,6 +13,11 @@ import java.util.Map; import javax.annotation.processing.Generated; +/** + * Schema for the `UsageMetricsModelMetric` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @@ -22,7 +27,7 @@ public record UsageMetricsModelMetric( /** Token usage metrics for this model */ @JsonProperty("usage") UsageMetricsModelMetricUsage usage, /** Accumulated nano-AI units cost for this model */ - @JsonProperty("totalNanoAiu") Long totalNanoAiu, + @JsonProperty("totalNanoAiu") Double totalNanoAiu, /** Token count details per type */ @JsonProperty("tokenDetails") Map tokenDetails ) { diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricRequests.java b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricRequests.java similarity index 95% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricRequests.java rename to src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricRequests.java index ac18ded858..ef9fbe47d1 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricRequests.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricRequests.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricTokenDetail.java b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricTokenDetail.java similarity index 86% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricTokenDetail.java rename to src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricTokenDetail.java index 51ef4f3ee2..e47a45fde9 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricTokenDetail.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricTokenDetail.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `UsageMetricsModelMetricTokenDetail` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricUsage.java b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricUsage.java similarity index 96% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricUsage.java rename to src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricUsage.java index f7c556a0f8..112c2c06d5 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsModelMetricUsage.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsModelMetricUsage.java @@ -5,7 +5,7 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsTokenDetail.java b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsTokenDetail.java similarity index 87% rename from src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsTokenDetail.java rename to src/generated/java/com/github/copilot/generated/rpc/UsageMetricsTokenDetail.java index 1f763f0281..55d0b81c8d 100644 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/UsageMetricsTokenDetail.java +++ b/src/generated/java/com/github/copilot/generated/rpc/UsageMetricsTokenDetail.java @@ -5,13 +5,18 @@ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.schema.json -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import javax.annotation.processing.Generated; +/** + * Schema for the `UsageMetricsTokenDetail` type. + * + * @since 1.0.0 + */ @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChange.java b/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChange.java new file mode 100644 index 0000000000..f091bc2799 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChange.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.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; + +/** + * A single changed file and its unified diff. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record WorkspaceDiffFileChange( + /** Path to the changed file, relative to the workspace root. */ + @JsonProperty("path") String path, + /** Unified diff content for the file. Empty when the diff was truncated. */ + @JsonProperty("diff") String diff, + /** Type of change represented by this file diff. */ + @JsonProperty("changeType") WorkspaceDiffFileChangeType changeType, + /** Original file path for renamed files. */ + @JsonProperty("oldPath") String oldPath, + /** Whether the diff content was omitted because it exceeded the per-file size limit. */ + @JsonProperty("isTruncated") Boolean isTruncated +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChangeType.java b/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChangeType.java new file mode 100644 index 0000000000..678ecd187a --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffFileChangeType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Type of change represented by this file diff. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum WorkspaceDiffFileChangeType { + /** The {@code added} variant. */ + ADDED("added"), + /** The {@code modified} variant. */ + MODIFIED("modified"), + /** The {@code deleted} variant. */ + DELETED("deleted"), + /** The {@code renamed} variant. */ + RENAMED("renamed"); + + private final String value; + WorkspaceDiffFileChangeType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static WorkspaceDiffFileChangeType fromValue(String value) { + for (WorkspaceDiffFileChangeType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown WorkspaceDiffFileChangeType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.java b/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.java new file mode 100644 index 0000000000..a2762954b2 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Diff mode requested by the client. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum WorkspaceDiffMode { + /** The {@code unstaged} variant. */ + UNSTAGED("unstaged"), + /** The {@code branch} variant. */ + BRANCH("branch"); + + private final String value; + WorkspaceDiffMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static WorkspaceDiffMode fromValue(String value) { + for (WorkspaceDiffMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown WorkspaceDiffMode value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/WorkspaceSummaryHostType.java b/src/generated/java/com/github/copilot/generated/rpc/WorkspaceSummaryHostType.java new file mode 100644 index 0000000000..71ce8e4b6d --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/WorkspaceSummaryHostType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Repository host type, if known + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum WorkspaceSummaryHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + WorkspaceSummaryHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static WorkspaceSummaryHostType fromValue(String value) { + for (WorkspaceSummaryHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown WorkspaceSummaryHostType value: " + value); + } +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/WorkspacesCheckpoints.java b/src/generated/java/com/github/copilot/generated/rpc/WorkspacesCheckpoints.java new file mode 100644 index 0000000000..07de034a96 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/WorkspacesCheckpoints.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.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; + +/** + * Schema for the `WorkspacesCheckpoints` type. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record WorkspacesCheckpoints( + /** Checkpoint number assigned by the workspace manager */ + @JsonProperty("number") Long number, + /** Human-readable checkpoint title */ + @JsonProperty("title") String title, + /** Filename of the checkpoint within the workspace checkpoints directory */ + @JsonProperty("filename") String filename +) { +} diff --git a/src/generated/java/com/github/copilot/generated/rpc/WorkspacesWorkspaceDetailsHostType.java b/src/generated/java/com/github/copilot/generated/rpc/WorkspacesWorkspaceDetailsHostType.java new file mode 100644 index 0000000000..aca85030e0 --- /dev/null +++ b/src/generated/java/com/github/copilot/generated/rpc/WorkspacesWorkspaceDetailsHostType.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.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum WorkspacesWorkspaceDetailsHostType { + /** The {@code github} variant. */ + GITHUB("github"), + /** The {@code ado} variant. */ + ADO("ado"); + + private final String value; + WorkspacesWorkspaceDetailsHostType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static WorkspacesWorkspaceDetailsHostType fromValue(String value) { + for (WorkspacesWorkspaceDetailsHostType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown WorkspacesWorkspaceDetailsHostType value: " + value); + } +} 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 deleted file mode 100644 index 31edf36b7e..0000000000 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionPermissionsApi.java +++ /dev/null @@ -1,66 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 permissions} namespace. - * - * @since 1.0.0 - */ -@javax.annotation.processing.Generated("copilot-sdk-codegen") -public final class SessionPermissionsApi { - - 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 */ - SessionPermissionsApi(RpcCaller caller, String sessionId) { - this.caller = caller; - this.sessionId = sessionId; - } - - /** - * Invokes {@code session.permissions.handlePendingPermissionRequest}. - *

- * 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 handlePendingPermissionRequest(SessionPermissionsHandlePendingPermissionRequestParams params) { - com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); - _p.put("sessionId", this.sessionId); - 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/SessionWorkspacesApi.java b/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesApi.java deleted file mode 100644 index b9a5238fac..0000000000 --- a/src/generated/java/com/github/copilot/sdk/generated/rpc/SessionWorkspacesApi.java +++ /dev/null @@ -1,74 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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/main/java/com/github/copilot/sdk/CliServerManager.java b/src/main/java/com/github/copilot/CliServerManager.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/CliServerManager.java rename to src/main/java/com/github/copilot/CliServerManager.java index bd4effe5a8..a6a08a8482 100644 --- a/src/main/java/com/github/copilot/sdk/CliServerManager.java +++ b/src/main/java/com/github/copilot/CliServerManager.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.io.BufferedReader; import java.io.File; @@ -19,7 +19,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.github.copilot.sdk.json.CopilotClientOptions; +import com.github.copilot.rpc.CopilotClientOptions; /** * Manages the lifecycle of the Copilot CLI server process. diff --git a/src/main/java/com/github/copilot/sdk/ConnectionState.java b/src/main/java/com/github/copilot/ConnectionState.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/ConnectionState.java rename to src/main/java/com/github/copilot/ConnectionState.java index d35528006b..5ce3782d16 100644 --- a/src/main/java/com/github/copilot/sdk/ConnectionState.java +++ b/src/main/java/com/github/copilot/ConnectionState.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; /** * Represents the connection state of a {@link CopilotClient}. diff --git a/src/main/java/com/github/copilot/sdk/CopilotClient.java b/src/main/java/com/github/copilot/CopilotClient.java similarity index 69% rename from src/main/java/com/github/copilot/sdk/CopilotClient.java rename to src/main/java/com/github/copilot/CopilotClient.java index 4d0770319a..662b66c7b4 100644 --- a/src/main/java/com/github/copilot/sdk/CopilotClient.java +++ b/src/main/java/com/github/copilot/CopilotClient.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.io.IOException; import java.net.URI; @@ -19,25 +19,28 @@ import java.util.logging.Level; import java.util.logging.Logger; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.CreateSessionResponse; -import com.github.copilot.sdk.generated.rpc.ConnectParams; -import com.github.copilot.sdk.generated.rpc.ServerRpc; -import com.github.copilot.sdk.json.DeleteSessionResponse; -import com.github.copilot.sdk.json.GetAuthStatusResponse; -import com.github.copilot.sdk.json.GetLastSessionIdResponse; -import com.github.copilot.sdk.json.GetSessionMetadataResponse; -import com.github.copilot.sdk.json.GetModelsResponse; -import com.github.copilot.sdk.json.GetStatusResponse; -import com.github.copilot.sdk.json.ListSessionsResponse; -import com.github.copilot.sdk.json.ModelInfo; -import com.github.copilot.sdk.json.PingResponse; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.ResumeSessionResponse; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionLifecycleHandler; -import com.github.copilot.sdk.json.SessionListFilter; -import com.github.copilot.sdk.json.SessionMetadata; +import com.github.copilot.rpc.CopilotClientMode; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.CreateSessionResponse; +import com.github.copilot.generated.rpc.SessionOptionsUpdateParams; +import com.github.copilot.generated.rpc.SessionInstalledPlugin; +import com.github.copilot.generated.rpc.ConnectParams; +import com.github.copilot.generated.rpc.ServerRpc; +import com.github.copilot.rpc.DeleteSessionResponse; +import com.github.copilot.rpc.GetAuthStatusResponse; +import com.github.copilot.rpc.GetLastSessionIdResponse; +import com.github.copilot.rpc.GetSessionMetadataResponse; +import com.github.copilot.rpc.GetModelsResponse; +import com.github.copilot.rpc.GetStatusResponse; +import com.github.copilot.rpc.ListSessionsResponse; +import com.github.copilot.rpc.ModelInfo; +import com.github.copilot.rpc.PingResponse; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.ResumeSessionResponse; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionLifecycleHandler; +import com.github.copilot.rpc.SessionListFilter; +import com.github.copilot.rpc.SessionMetadata; /** * Provides a client for interacting with the Copilot CLI server. @@ -143,6 +146,18 @@ public CopilotClient(CopilotClientOptions options) { ? this.options.getTcpConnectionToken() : (sdkSpawnsCli ? java.util.UUID.randomUUID().toString() : null); + // Empty mode: validate at construction time that the app supplied a + // per-session persistence location. + if (this.options.getMode() == CopilotClientMode.EMPTY) { + boolean hasPersistence = (this.options.getCopilotHome() != null && !this.options.getCopilotHome().isEmpty()) + || (this.options.getCliUrl() != null && !this.options.getCliUrl().isEmpty()); + if (!hasPersistence) { + throw new IllegalArgumentException( + "CopilotClient was created with Mode = EMPTY but neither CopilotHome nor CliUrl was set. " + + "Empty mode requires an explicit per-session persistence location."); + } + } + // Parse CliUrl if provided if (this.options.getCliUrl() != null && !this.options.getCliUrl().isEmpty()) { URI uri = CliServerManager.parseCliUrl(this.options.getCliUrl()); @@ -249,7 +264,7 @@ private void verifyProtocolVersion(Connection connection) throws Exception { // Try the new 'connect' RPC which supports connection tokens var connectParams = new ConnectParams(effectiveConnectionToken); var connectResponse = connection.rpc - .invoke("connect", connectParams, com.github.copilot.sdk.generated.rpc.ConnectResult.class) + .invoke("connect", connectParams, com.github.copilot.generated.rpc.ConnectResult.class) .get(30, TimeUnit.SECONDS); serverVersion = connectResponse.protocolVersion() != null ? connectResponse.protocolVersion().intValue() @@ -397,8 +412,8 @@ private static void cleanupCliProcess(Process process) { * receive responses. Remember to close the session when done. *

* A permission handler is required when creating a session. Use - * {@link com.github.copilot.sdk.json.PermissionHandler#APPROVE_ALL} to approve - * all permission requests, or provide a custom handler to control permissions + * {@link com.github.copilot.rpc.PermissionHandler#APPROVE_ALL} to approve all + * permission requests, or provide a custom handler to control permissions * selectively. * *

@@ -410,14 +425,14 @@ private static void cleanupCliProcess(Process process) { * * @param config * configuration for the session, including the required - * {@link SessionConfig#setOnPermissionRequest(com.github.copilot.sdk.json.PermissionHandler)} + * {@link SessionConfig#setOnPermissionRequest(com.github.copilot.rpc.PermissionHandler)} * handler * @return a future that resolves with the created CopilotSession * @throws IllegalArgumentException * if {@code config} is {@code null} or does not have a permission * handler set * @see SessionConfig - * @see com.github.copilot.sdk.json.PermissionHandler#APPROVE_ALL + * @see com.github.copilot.rpc.PermissionHandler#APPROVE_ALL */ public CompletableFuture createSession(SessionConfig config) { if (config == null || config.getOnPermissionRequest() == null) { @@ -459,31 +474,57 @@ public CompletableFuture createSession(SessionConfig config) { request.setSystemMessage(extracted.wireSystemMessage()); } - long rpcNanos = System.nanoTime(); - return connection.rpc.invoke("session.create", request, CreateSessionResponse.class).thenApply(response -> { - LoggingHelpers.logTiming(LOG, Level.FINE, - "CopilotClient.createSession session creation request completed. Elapsed={Elapsed}, SessionId=" - + sessionId, - rpcNanos); - session.setWorkspacePath(response.workspacePath()); - session.setCapabilities(response.capabilities()); - // If the server returned a different sessionId (e.g. a v2 CLI that ignores - // the client-supplied ID), re-key the sessions map. - String returnedId = response.sessionId(); - if (returnedId != null && !returnedId.equals(sessionId)) { - sessions.remove(sessionId); - session.setActiveSessionId(returnedId); - sessions.put(returnedId, session); + // Empty mode: validate availableTools and set toolFilterPrecedence + if (options.getMode() == CopilotClientMode.EMPTY) { + if (config.getAvailableTools() == null) { + throw new IllegalArgumentException( + "CopilotClient is in Mode = EMPTY but the session config did not specify " + + "availableTools. Empty mode requires every session to explicitly opt into " + + "the tools it wants — e.g. setAvailableTools(new ToolSet().addBuiltIn(BuiltInTools.ISOLATED))."); } - LoggingHelpers.logTiming(LOG, Level.FINE, - "CopilotClient.createSession complete. Elapsed={Elapsed}, SessionId=" + sessionId, totalNanos); - return session; - }).exceptionally(ex -> { - sessions.remove(sessionId); - LoggingHelpers.logTiming(LOG, Level.WARNING, ex, - "CopilotClient.createSession failed. Elapsed={Elapsed}, SessionId=" + sessionId, totalNanos); - throw ex instanceof RuntimeException re ? re : new RuntimeException(ex); - }); + request.setToolFilterPrecedence("excluded"); + } + + long rpcNanos = System.nanoTime(); + return connection.rpc.invoke("session.create", request, CreateSessionResponse.class) + .thenCompose(response -> { + LoggingHelpers.logTiming(LOG, Level.FINE, + "CopilotClient.createSession session creation request completed. Elapsed={Elapsed}, SessionId=" + + sessionId, + rpcNanos); + session.setWorkspacePath(response.workspacePath()); + session.setCapabilities(response.capabilities()); + // If the server returned a different sessionId (e.g. a v2 CLI that ignores + // the client-supplied ID), re-key the sessions map. + String returnedId = response.sessionId(); + if (returnedId != null && !returnedId.equals(sessionId)) { + sessions.remove(sessionId); + session.setActiveSessionId(returnedId); + sessions.put(returnedId, session); + } + + return updateSessionOptionsForMode(session, config.getSkipCustomInstructions().orElse(null), + config.getCustomAgentsLocalOnly().orElse(null), + config.getCoauthorEnabled().orElse(null), + config.getManageScheduleEnabled().orElse(null)).thenApply(v -> { + LoggingHelpers.logTiming(LOG, Level.FINE, + "CopilotClient.createSession complete. Elapsed={Elapsed}, SessionId=" + + sessionId, + totalNanos); + return session; + }); + }).exceptionally(ex -> { + sessions.remove(sessionId); + // Also remove the re-keyed entry if the server returned a different ID + String activeId = session.getSessionId(); + if (!sessionId.equals(activeId)) { + sessions.remove(activeId); + } + LoggingHelpers.logTiming(LOG, Level.WARNING, ex, + "CopilotClient.createSession failed. Elapsed={Elapsed}, SessionId=" + sessionId, + totalNanos); + throw ex instanceof RuntimeException re ? re : new RuntimeException(ex); + }); }); } @@ -494,15 +535,15 @@ public CompletableFuture createSession(SessionConfig config) { * conversation. The session's history is preserved. *

* A permission handler is required when resuming a session. Use - * {@link com.github.copilot.sdk.json.PermissionHandler#APPROVE_ALL} to approve - * all permission requests, or provide a custom handler to control permissions + * {@link com.github.copilot.rpc.PermissionHandler#APPROVE_ALL} to approve all + * permission requests, or provide a custom handler to control permissions * selectively. * * @param sessionId * the ID of the session to resume * @param config * configuration for the resumed session, including the required - * {@link ResumeSessionConfig#setOnPermissionRequest(com.github.copilot.sdk.json.PermissionHandler)} + * {@link ResumeSessionConfig#setOnPermissionRequest(com.github.copilot.rpc.PermissionHandler)} * handler * @return a future that resolves with the resumed CopilotSession * @throws IllegalArgumentException @@ -510,7 +551,7 @@ public CompletableFuture createSession(SessionConfig config) { * handler set * @see #listSessions() * @see #getLastSessionId() - * @see com.github.copilot.sdk.json.PermissionHandler#APPROVE_ALL + * @see com.github.copilot.rpc.PermissionHandler#APPROVE_ALL */ public CompletableFuture resumeSession(String sessionId, ResumeSessionConfig config) { if (config == null || config.getOnPermissionRequest() == null) { @@ -544,30 +585,177 @@ public CompletableFuture resumeSession(String sessionId, ResumeS request.setSystemMessage(extracted.wireSystemMessage()); } - long rpcNanos = System.nanoTime(); - return connection.rpc.invoke("session.resume", request, ResumeSessionResponse.class).thenApply(response -> { - LoggingHelpers.logTiming(LOG, Level.FINE, - "CopilotClient.resumeSession session resume request completed. Elapsed={Elapsed}, SessionId=" - + sessionId, - rpcNanos); - session.setWorkspacePath(response.workspacePath()); - session.setCapabilities(response.capabilities()); - // If the server returned a different sessionId than what was requested, re-key. - String returnedId = response.sessionId(); - if (returnedId != null && !returnedId.equals(sessionId)) { - sessions.remove(sessionId); - session.setActiveSessionId(returnedId); - sessions.put(returnedId, session); + // Empty mode: validate availableTools and set toolFilterPrecedence for resume + // path + if (options.getMode() == CopilotClientMode.EMPTY) { + if (config.getAvailableTools() == null) { + throw new IllegalArgumentException( + "CopilotClient is in Mode = EMPTY but the resume session config did not specify " + + "availableTools. Empty mode requires every session to explicitly opt into " + + "the tools it wants — e.g. setAvailableTools(new ToolSet().addBuiltIn(BuiltInTools.ISOLATED))."); } - LoggingHelpers.logTiming(LOG, Level.FINE, - "CopilotClient.resumeSession complete. Elapsed={Elapsed}, SessionId=" + sessionId, totalNanos); - return session; - }).exceptionally(ex -> { - sessions.remove(sessionId); - LoggingHelpers.logTiming(LOG, Level.WARNING, ex, - "CopilotClient.resumeSession failed. Elapsed={Elapsed}, SessionId=" + sessionId, totalNanos); - throw ex instanceof RuntimeException re ? re : new RuntimeException(ex); - }); + request.setToolFilterPrecedence("excluded"); + } + + long rpcNanos = System.nanoTime(); + return connection.rpc.invoke("session.resume", request, ResumeSessionResponse.class) + .thenCompose(response -> { + LoggingHelpers.logTiming(LOG, Level.FINE, + "CopilotClient.resumeSession session resume request completed. Elapsed={Elapsed}, SessionId=" + + sessionId, + rpcNanos); + session.setWorkspacePath(response.workspacePath()); + session.setCapabilities(response.capabilities()); + // If the server returned a different sessionId than what was requested, + // re-key. + String returnedId = response.sessionId(); + if (returnedId != null && !returnedId.equals(sessionId)) { + sessions.remove(sessionId); + session.setActiveSessionId(returnedId); + sessions.put(returnedId, session); + } + + return updateSessionOptionsForMode(session, config.getSkipCustomInstructions().orElse(null), + config.getCustomAgentsLocalOnly().orElse(null), + config.getCoauthorEnabled().orElse(null), + config.getManageScheduleEnabled().orElse(null)).thenApply(v -> { + LoggingHelpers.logTiming(LOG, Level.FINE, + "CopilotClient.resumeSession complete. Elapsed={Elapsed}, SessionId=" + + sessionId, + totalNanos); + return session; + }); + }).exceptionally(ex -> { + sessions.remove(sessionId); + // Also remove the re-keyed entry if the server returned a different ID + String activeId = session.getSessionId(); + if (!sessionId.equals(activeId)) { + sessions.remove(activeId); + } + LoggingHelpers.logTiming(LOG, Level.WARNING, ex, + "CopilotClient.resumeSession failed. Elapsed={Elapsed}, SessionId=" + sessionId, + totalNanos); + throw ex instanceof RuntimeException re ? re : new RuntimeException(ex); + }); + }); + } + + /** + * Applies the post-create / post-resume {@code session.options.update} patch. + *

+ * In {@link CopilotClientMode#EMPTY EMPTY} mode this defaults the four + * overridable feature flags to safe values (caller values from the config win); + * {@code installedPlugins=[]} is unconditional under empty mode so apps that + * need plugins must switch modes. In {@link CopilotClientMode#COPILOT_CLI + * COPILOT_CLI} mode only explicitly-set fields are forwarded. + * + * @param session + * the session to patch + * @param skipCustomInstructions + * caller-supplied value, or {@code null} if not set + * @param customAgentsLocalOnly + * caller-supplied value, or {@code null} if not set + * @param coauthorEnabled + * caller-supplied value, or {@code null} if not set + * @param manageScheduleEnabled + * caller-supplied value, or {@code null} if not set + * @return a future that completes when the patch has been applied + */ + CompletableFuture updateSessionOptionsForMode(CopilotSession session, Boolean skipCustomInstructions, + Boolean customAgentsLocalOnly, Boolean coauthorEnabled, Boolean manageScheduleEnabled) { + + Boolean patchSkip = null; + Boolean patchAgents = null; + Boolean patchCoauthor = null; + Boolean patchSchedule = null; + List patchPlugins = null; + boolean hasAnyPatch = false; + + if (options.getMode() == CopilotClientMode.EMPTY) { + patchSkip = skipCustomInstructions != null ? skipCustomInstructions : true; + patchAgents = customAgentsLocalOnly != null ? customAgentsLocalOnly : true; + patchCoauthor = coauthorEnabled != null ? coauthorEnabled : false; + patchSchedule = manageScheduleEnabled != null ? manageScheduleEnabled : false; + patchPlugins = List.of(); + hasAnyPatch = true; + } else { + if (skipCustomInstructions != null) { + patchSkip = skipCustomInstructions; + hasAnyPatch = true; + } + if (customAgentsLocalOnly != null) { + patchAgents = customAgentsLocalOnly; + hasAnyPatch = true; + } + if (coauthorEnabled != null) { + patchCoauthor = coauthorEnabled; + hasAnyPatch = true; + } + if (manageScheduleEnabled != null) { + patchSchedule = manageScheduleEnabled; + hasAnyPatch = true; + } + } + + if (!hasAnyPatch) { + return CompletableFuture.completedFuture(null); + } + + var params = new SessionOptionsUpdateParams(null, // sessionId — set by SessionOptionsApi + null, // model + null, // reasoningEffort + null, // clientName + null, // lspClientName + null, // integrationId + null, // featureFlags + null, // isExperimentalMode + null, // provider + null, // workingDirectory + null, // availableTools + null, // excludedTools + null, // toolFilterPrecedence + null, // enableScriptSafety + null, // shellInitProfile + null, // shellProcessFlags + null, // sandboxConfig + null, // logInteractiveShells + null, // envValueMode + null, // skillDirectories + null, // disabledSkills + null, // enableOnDemandInstructionDiscovery + patchPlugins, // installedPlugins + patchAgents, // customAgentsLocalOnly + patchSkip, // skipCustomInstructions + null, // disabledInstructionSources + patchCoauthor, // coauthorEnabled + null, // trajectoryFile + null, // enableStreaming + null, // copilotUrl + null, // askUserDisabled + null, // continueOnAutoMode + null, // runningInInteractiveMode + null, // enableReasoningSummaries + null, // agentContext + null, // eventsLogDirectory + null, // additionalContentExclusionPolicies + patchSchedule // manageScheduleEnabled + ); + + return session.getRpc().options.update(params).thenCompose(result -> { + LOG.fine("session.options.update applied for session " + session.getSessionId()); + return CompletableFuture.completedFuture(null); + }).exceptionally(ex -> { + // The runtime session exists but the post-create options patch failed. + // Best-effort disconnect so we don't leak it (in empty mode it would + // otherwise stay alive with permissive defaults). + LOG.log(Level.WARNING, "session.options.update failed for session " + session.getSessionId(), ex); + sessions.remove(session.getSessionId()); + try { + session.close(); + } catch (Exception closeEx) { + // Swallow: original error is the one the caller needs. + } + throw ex instanceof RuntimeException re ? re : new RuntimeException(ex); }); } @@ -659,8 +847,8 @@ public CompletableFuture getAuthStatus() { * The cache is cleared when the client disconnects. *

* If an {@code onListModels} handler was provided in - * {@link com.github.copilot.sdk.json.CopilotClientOptions}, it is called - * instead of querying the CLI server. This is useful in BYOK mode. + * {@link com.github.copilot.rpc.CopilotClientOptions}, it is called instead of + * querying the CLI server. This is useful in BYOK mode. * * @return a future that resolves with a list of available models * @see ModelInfo @@ -714,7 +902,7 @@ public CompletableFuture> listModels() { * * @return a future that resolves with the last session ID, or {@code null} if * no sessions exist - * @see #resumeSession(String, com.github.copilot.sdk.json.ResumeSessionConfig) + * @see #resumeSession(String, com.github.copilot.rpc.ResumeSessionConfig) */ public CompletableFuture getLastSessionId() { return ensureConnected().thenCompose( @@ -755,7 +943,7 @@ public CompletableFuture deleteSession(String sessionId) { * * @return a future that resolves with a list of session metadata * @see SessionMetadata - * @see #resumeSession(String, com.github.copilot.sdk.json.ResumeSessionConfig) + * @see #resumeSession(String, com.github.copilot.rpc.ResumeSessionConfig) */ public CompletableFuture> listSessions() { return listSessions(null); @@ -785,7 +973,7 @@ public CompletableFuture> listSessions() { * @return a future that resolves with a list of session metadata * @see SessionMetadata * @see SessionListFilter - * @see #resumeSession(String, com.github.copilot.sdk.json.ResumeSessionConfig) + * @see #resumeSession(String, com.github.copilot.rpc.ResumeSessionConfig) */ public CompletableFuture> listSessions(SessionListFilter filter) { return ensureConnected().thenCompose(connection -> { @@ -834,9 +1022,8 @@ public CompletableFuture getSessionMetadata(String sessionId) { */ public CompletableFuture getForegroundSessionId() { return ensureConnected().thenCompose(connection -> connection.rpc - .invoke("session.getForeground", Map.of(), - com.github.copilot.sdk.json.GetForegroundSessionResponse.class) - .thenApply(com.github.copilot.sdk.json.GetForegroundSessionResponse::sessionId)); + .invoke("session.getForeground", Map.of(), com.github.copilot.rpc.GetForegroundSessionResponse.class) + .thenApply(com.github.copilot.rpc.GetForegroundSessionResponse::sessionId)); } /** @@ -853,8 +1040,8 @@ public CompletableFuture getForegroundSessionId() { */ public CompletableFuture setForegroundSessionId(String sessionId) { return ensureConnected().thenCompose(connection -> connection.rpc - .invoke("session.setForeground", new com.github.copilot.sdk.json.SetForegroundSessionRequest(sessionId), - com.github.copilot.sdk.json.SetForegroundSessionResponse.class) + .invoke("session.setForeground", new com.github.copilot.rpc.SetForegroundSessionRequest(sessionId), + com.github.copilot.rpc.SetForegroundSessionResponse.class) .thenAccept(response -> { if (!response.success()) { throw new RuntimeException( @@ -882,7 +1069,7 @@ public AutoCloseable onLifecycle(SessionLifecycleHandler handler) { * * @param eventType * the event type to listen for (use - * {@link com.github.copilot.sdk.json.SessionLifecycleEventTypes} + * {@link com.github.copilot.rpc.SessionLifecycleEventTypes} * constants) * @param handler * a callback that receives events of the specified type diff --git a/src/main/java/com/github/copilot/sdk/CopilotSession.java b/src/main/java/com/github/copilot/CopilotSession.java similarity index 91% rename from src/main/java/com/github/copilot/sdk/CopilotSession.java rename to src/main/java/com/github/copilot/CopilotSession.java index 79a7f343b7..2651edb0b7 100644 --- a/src/main/java/com/github/copilot/sdk/CopilotSession.java +++ b/src/main/java/com/github/copilot/CopilotSession.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.io.Closeable; import java.io.IOException; @@ -29,74 +29,76 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -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.SessionUiHandlePendingElicitationParams; -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; -import com.github.copilot.sdk.generated.ExternalToolRequestedEvent; -import com.github.copilot.sdk.generated.PermissionRequestedEvent; -import com.github.copilot.sdk.generated.SessionErrorEvent; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.json.AgentInfo; -import com.github.copilot.sdk.json.AutoModeSwitchHandler; -import com.github.copilot.sdk.json.AutoModeSwitchInvocation; -import com.github.copilot.sdk.json.AutoModeSwitchRequest; -import com.github.copilot.sdk.json.AutoModeSwitchResponse; -import com.github.copilot.sdk.json.CommandContext; -import com.github.copilot.sdk.json.CommandDefinition; -import com.github.copilot.sdk.json.CommandHandler; -import com.github.copilot.sdk.json.ElicitationContext; -import com.github.copilot.sdk.json.ElicitationHandler; -import com.github.copilot.sdk.json.ElicitationParams; -import com.github.copilot.sdk.json.ElicitationResult; -import com.github.copilot.sdk.json.ElicitationResultAction; -import com.github.copilot.sdk.json.ExitPlanModeHandler; -import com.github.copilot.sdk.json.ExitPlanModeInvocation; -import com.github.copilot.sdk.json.ExitPlanModeRequest; -import com.github.copilot.sdk.json.ExitPlanModeResult; -import com.github.copilot.sdk.json.ElicitationSchema; -import com.github.copilot.sdk.json.GetMessagesResponse; -import com.github.copilot.sdk.json.HookInvocation; -import com.github.copilot.sdk.json.InputOptions; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.PermissionInvocation; -import com.github.copilot.sdk.json.PermissionRequest; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PermissionRequestResultKind; -import com.github.copilot.sdk.json.PostToolUseHookInput; -import com.github.copilot.sdk.json.PreToolUseHookInput; -import com.github.copilot.sdk.json.SendMessageRequest; -import com.github.copilot.sdk.json.SendMessageResponse; -import com.github.copilot.sdk.json.SessionCapabilities; -import com.github.copilot.sdk.json.SessionEndHookInput; -import com.github.copilot.sdk.json.SessionHooks; -import com.github.copilot.sdk.json.SessionStartHookInput; -import com.github.copilot.sdk.json.SessionUiApi; -import com.github.copilot.sdk.json.SessionUiCapabilities; -import com.github.copilot.sdk.json.ToolDefinition; -import com.github.copilot.sdk.json.ToolResultObject; -import com.github.copilot.sdk.json.UserInputHandler; -import com.github.copilot.sdk.json.UserInputInvocation; -import com.github.copilot.sdk.json.UserInputRequest; -import com.github.copilot.sdk.json.UserInputResponse; -import com.github.copilot.sdk.json.UserPromptSubmittedHookInput; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.rpc.SessionCommandsHandlePendingCommandParams; +import com.github.copilot.generated.rpc.SessionLogParams; +import com.github.copilot.generated.rpc.SessionLogLevel; +import com.github.copilot.generated.rpc.ModelCapabilitiesOverride; +import com.github.copilot.generated.rpc.ModelCapabilitiesOverrideLimits; +import com.github.copilot.generated.rpc.ModelCapabilitiesOverrideSupports; +import com.github.copilot.generated.rpc.SessionModelSwitchToParams; +import com.github.copilot.generated.rpc.SessionPermissionsHandlePendingPermissionRequestParams; +import com.github.copilot.generated.rpc.SessionRpc; +import com.github.copilot.generated.rpc.SessionToolsHandlePendingToolCallParams; +import com.github.copilot.generated.rpc.SessionUiElicitationParams; +import com.github.copilot.generated.rpc.SessionUiHandlePendingElicitationParams; +import com.github.copilot.generated.rpc.UIElicitationResponse; +import com.github.copilot.generated.rpc.UIElicitationResponseAction; +import com.github.copilot.generated.rpc.UIElicitationSchema; +import com.github.copilot.generated.CapabilitiesChangedEvent; +import com.github.copilot.generated.CommandExecuteEvent; +import com.github.copilot.generated.ElicitationRequestedEvent; +import com.github.copilot.generated.ExternalToolRequestedEvent; +import com.github.copilot.generated.PermissionRequestedEvent; +import com.github.copilot.generated.SessionErrorEvent; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.rpc.AgentInfo; +import com.github.copilot.rpc.AutoModeSwitchHandler; +import com.github.copilot.rpc.AutoModeSwitchInvocation; +import com.github.copilot.rpc.AutoModeSwitchRequest; +import com.github.copilot.rpc.AutoModeSwitchResponse; +import com.github.copilot.rpc.CommandContext; +import com.github.copilot.rpc.CommandDefinition; +import com.github.copilot.rpc.CommandHandler; +import com.github.copilot.rpc.ElicitationContext; +import com.github.copilot.rpc.ElicitationHandler; +import com.github.copilot.rpc.ElicitationParams; +import com.github.copilot.rpc.ElicitationResult; +import com.github.copilot.rpc.ElicitationResultAction; +import com.github.copilot.rpc.ExitPlanModeHandler; +import com.github.copilot.rpc.ExitPlanModeInvocation; +import com.github.copilot.rpc.ExitPlanModeRequest; +import com.github.copilot.rpc.ExitPlanModeResult; +import com.github.copilot.rpc.ElicitationSchema; +import com.github.copilot.rpc.GetMessagesResponse; +import com.github.copilot.rpc.HookInvocation; +import com.github.copilot.rpc.InputOptions; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.PermissionInvocation; +import com.github.copilot.rpc.PermissionRequest; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PermissionRequestResultKind; +import com.github.copilot.rpc.PostToolUseHookInput; +import com.github.copilot.rpc.PostToolUseFailureHookInput; +import com.github.copilot.rpc.PreMcpToolCallHookInput; +import com.github.copilot.rpc.PreToolUseHookInput; +import com.github.copilot.rpc.SendMessageRequest; +import com.github.copilot.rpc.SendMessageResponse; +import com.github.copilot.rpc.SessionCapabilities; +import com.github.copilot.rpc.SessionEndHookInput; +import com.github.copilot.rpc.SessionHooks; +import com.github.copilot.rpc.SessionStartHookInput; +import com.github.copilot.rpc.SessionUiApi; +import com.github.copilot.rpc.SessionUiCapabilities; +import com.github.copilot.rpc.ToolDefinition; +import com.github.copilot.rpc.ToolResultObject; +import com.github.copilot.rpc.UserInputHandler; +import com.github.copilot.rpc.UserInputInvocation; +import com.github.copilot.rpc.UserInputRequest; +import com.github.copilot.rpc.UserInputResponse; +import com.github.copilot.rpc.UserPromptSubmittedHookInput; /** * Represents a single conversation session with the Copilot CLI. @@ -135,9 +137,9 @@ * session.close(); * } * - * @see CopilotClient#createSession(com.github.copilot.sdk.json.SessionConfig) + * @see CopilotClient#createSession(com.github.copilot.rpc.SessionConfig) * @see CopilotClient#resumeSession(String, - * com.github.copilot.sdk.json.ResumeSessionConfig) + * com.github.copilot.rpc.ResumeSessionConfig) * @see SessionEvent * @since 1.0.0 */ @@ -474,6 +476,7 @@ public CompletableFuture send(MessageOptions options) { request.setPrompt(options.getPrompt()); request.setAttachments(options.getAttachments()); request.setMode(options.getMode()); + request.setAgentMode(options.getAgentMode()); request.setRequestHeaders(options.getRequestHeaders()); return rpc.invoke("session.send", request, SendMessageResponse.class).thenApply(SendMessageResponse::messageId); @@ -866,7 +869,7 @@ private void executeToolAndRespondAsync(String requestId, String toolName, Strin JsonNode argumentsNode = arguments instanceof JsonNode jn ? jn : (arguments != null ? MAPPER.valueToTree(arguments) : null); - var invocation = new com.github.copilot.sdk.json.ToolInvocation().setSessionId(sessionId) + var invocation = new com.github.copilot.rpc.ToolInvocation().setSessionId(sessionId) .setToolCallId(toolCallId).setToolName(toolName).setArguments(argumentsNode); tool.handler().invoke(invocation).thenAccept(result -> { @@ -1462,7 +1465,7 @@ void registerHooks(SessionHooks hooks) { * Registers transform callbacks for system message sections. *

* Called internally when creating or resuming a session with - * {@link com.github.copilot.sdk.SystemMessageMode#CUSTOMIZE} and transform + * {@link com.github.copilot.SystemMessageMode#CUSTOMIZE} and transform * callbacks. * * @param callbacks @@ -1543,37 +1546,73 @@ CompletableFuture handleHooksInvoke(String hookType, JsonNode input) { case "preToolUse" : if (hooks.getOnPreToolUse() != null) { PreToolUseHookInput preInput = MAPPER.treeToValue(input, PreToolUseHookInput.class); - return hooks.getOnPreToolUse().handle(preInput, invocation) - .thenApply(output -> (Object) output); + var preResult = hooks.getOnPreToolUse().handle(preInput, invocation); + if (preResult == null) { + return CompletableFuture.completedFuture(null); + } + return preResult.thenApply(output -> (Object) output); + } + break; + case "preMcpToolCall" : + if (hooks.getOnPreMcpToolCall() != null) { + PreMcpToolCallHookInput mcpInput = MAPPER.treeToValue(input, PreMcpToolCallHookInput.class); + var mcpResult = hooks.getOnPreMcpToolCall().handle(mcpInput, invocation); + if (mcpResult == null) { + return CompletableFuture.completedFuture(null); + } + return mcpResult.thenApply(output -> (Object) output); } break; case "postToolUse" : if (hooks.getOnPostToolUse() != null) { PostToolUseHookInput postInput = MAPPER.treeToValue(input, PostToolUseHookInput.class); - return hooks.getOnPostToolUse().handle(postInput, invocation) - .thenApply(output -> (Object) output); + var postResult = hooks.getOnPostToolUse().handle(postInput, invocation); + if (postResult == null) { + return CompletableFuture.completedFuture(null); + } + return postResult.thenApply(output -> (Object) output); + } + break; + case "postToolUseFailure" : + if (hooks.getOnPostToolUseFailure() != null) { + PostToolUseFailureHookInput failureInput = MAPPER.treeToValue(input, + PostToolUseFailureHookInput.class); + var failureResult = hooks.getOnPostToolUseFailure().handle(failureInput, invocation); + if (failureResult == null) { + return CompletableFuture.completedFuture(null); + } + return failureResult.thenApply(output -> (Object) output); } break; case "userPromptSubmitted" : if (hooks.getOnUserPromptSubmitted() != null) { UserPromptSubmittedHookInput promptInput = MAPPER.treeToValue(input, UserPromptSubmittedHookInput.class); - return hooks.getOnUserPromptSubmitted().handle(promptInput, invocation) - .thenApply(output -> (Object) output); + var promptResult = hooks.getOnUserPromptSubmitted().handle(promptInput, invocation); + if (promptResult == null) { + return CompletableFuture.completedFuture(null); + } + return promptResult.thenApply(output -> (Object) output); } break; case "sessionStart" : if (hooks.getOnSessionStart() != null) { SessionStartHookInput startInput = MAPPER.treeToValue(input, SessionStartHookInput.class); - return hooks.getOnSessionStart().handle(startInput, invocation) - .thenApply(output -> (Object) output); + var startResult = hooks.getOnSessionStart().handle(startInput, invocation); + if (startResult == null) { + return CompletableFuture.completedFuture(null); + } + return startResult.thenApply(output -> (Object) output); } break; case "sessionEnd" : if (hooks.getOnSessionEnd() != null) { SessionEndHookInput endInput = MAPPER.treeToValue(input, SessionEndHookInput.class); - return hooks.getOnSessionEnd().handle(endInput, invocation) - .thenApply(output -> (Object) output); + var endResult = hooks.getOnSessionEnd().handle(endInput, invocation); + if (endResult == null) { + return CompletableFuture.completedFuture(null); + } + return endResult.thenApply(output -> (Object) output); } break; default : @@ -1657,7 +1696,7 @@ public CompletableFuture abort() { */ public CompletableFuture setModel(String model, String reasoningEffort) { ensureNotTerminated(); - return getRpc().model.switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, null)) + return getRpc().model.switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, null, null)) .thenApply(r -> null); } @@ -1688,7 +1727,7 @@ public CompletableFuture setModel(String model, String reasoningEffort) { * @since 1.3.0 */ public CompletableFuture setModel(String model, String reasoningEffort, - com.github.copilot.sdk.json.ModelCapabilitiesOverride modelCapabilities) { + com.github.copilot.rpc.ModelCapabilitiesOverride modelCapabilities) { ensureNotTerminated(); ModelCapabilitiesOverride generatedCapabilities = null; if (modelCapabilities != null) { @@ -1706,7 +1745,8 @@ public CompletableFuture setModel(String model, String reasoningEffort, generatedCapabilities = new ModelCapabilitiesOverride(supports, limits); } return getRpc().model - .switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, generatedCapabilities)) + .switchTo( + new SessionModelSwitchToParams(sessionId, model, reasoningEffort, null, generatedCapabilities)) .thenApply(r -> null); } @@ -1773,7 +1813,8 @@ public CompletableFuture log(String message, String level, Boolean ephemer rpcLevel = SessionLogLevel.INFO; } } - return getRpc().log(new SessionLogParams(sessionId, message, rpcLevel, ephemeral, url)).thenApply(r -> null); + return getRpc().log(new SessionLogParams(sessionId, message, rpcLevel, null, ephemeral, url, null)) + .thenApply(r -> null); } /** diff --git a/src/main/java/com/github/copilot/sdk/EventErrorHandler.java b/src/main/java/com/github/copilot/EventErrorHandler.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/EventErrorHandler.java rename to src/main/java/com/github/copilot/EventErrorHandler.java index 2ff77d9718..20510f463d 100644 --- a/src/main/java/com/github/copilot/sdk/EventErrorHandler.java +++ b/src/main/java/com/github/copilot/EventErrorHandler.java @@ -2,9 +2,9 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; -import com.github.copilot.sdk.generated.SessionEvent; +import com.github.copilot.generated.SessionEvent; /** * A handler for errors thrown by event handlers during event dispatch. diff --git a/src/main/java/com/github/copilot/sdk/EventErrorPolicy.java b/src/main/java/com/github/copilot/EventErrorPolicy.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/EventErrorPolicy.java rename to src/main/java/com/github/copilot/EventErrorPolicy.java index b7c3dca212..288af00e05 100644 --- a/src/main/java/com/github/copilot/sdk/EventErrorPolicy.java +++ b/src/main/java/com/github/copilot/EventErrorPolicy.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; /** * Controls how event dispatch behaves when an event handler throws an diff --git a/src/main/java/com/github/copilot/sdk/ExtractedTransforms.java b/src/main/java/com/github/copilot/ExtractedTransforms.java similarity index 93% rename from src/main/java/com/github/copilot/sdk/ExtractedTransforms.java rename to src/main/java/com/github/copilot/ExtractedTransforms.java index 717d873d33..bae60fc7c5 100644 --- a/src/main/java/com/github/copilot/sdk/ExtractedTransforms.java +++ b/src/main/java/com/github/copilot/ExtractedTransforms.java @@ -2,13 +2,13 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.function.Function; -import com.github.copilot.sdk.json.SystemMessageConfig; +import com.github.copilot.rpc.SystemMessageConfig; /** * Result of extracting transform callbacks from a {@link SystemMessageConfig}. diff --git a/src/main/java/com/github/copilot/sdk/JsonRpcClient.java b/src/main/java/com/github/copilot/JsonRpcClient.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/JsonRpcClient.java rename to src/main/java/com/github/copilot/JsonRpcClient.java index 73db478ca9..a7cd0e120d 100644 --- a/src/main/java/com/github/copilot/sdk/JsonRpcClient.java +++ b/src/main/java/com/github/copilot/JsonRpcClient.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.io.BufferedInputStream; import java.io.IOException; @@ -28,9 +28,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.github.copilot.sdk.json.JsonRpcError; -import com.github.copilot.sdk.json.JsonRpcRequest; -import com.github.copilot.sdk.json.JsonRpcResponse; +import com.github.copilot.rpc.JsonRpcError; +import com.github.copilot.rpc.JsonRpcRequest; +import com.github.copilot.rpc.JsonRpcResponse; /** * JSON-RPC 2.0 client implementation for communicating with the Copilot CLI. diff --git a/src/main/java/com/github/copilot/sdk/JsonRpcException.java b/src/main/java/com/github/copilot/JsonRpcException.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/JsonRpcException.java rename to src/main/java/com/github/copilot/JsonRpcException.java index dbc3ab77b7..1786466bdd 100644 --- a/src/main/java/com/github/copilot/sdk/JsonRpcException.java +++ b/src/main/java/com/github/copilot/JsonRpcException.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; /** * Exception thrown when a JSON-RPC error occurs during communication with the diff --git a/src/main/java/com/github/copilot/sdk/LifecycleEventManager.java b/src/main/java/com/github/copilot/LifecycleEventManager.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/LifecycleEventManager.java rename to src/main/java/com/github/copilot/LifecycleEventManager.java index 21c00e2337..673b9d10ed 100644 --- a/src/main/java/com/github/copilot/sdk/LifecycleEventManager.java +++ b/src/main/java/com/github/copilot/LifecycleEventManager.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.util.ArrayList; import java.util.List; @@ -11,8 +11,8 @@ import java.util.logging.Level; import java.util.logging.Logger; -import com.github.copilot.sdk.json.SessionLifecycleEvent; -import com.github.copilot.sdk.json.SessionLifecycleHandler; +import com.github.copilot.rpc.SessionLifecycleEvent; +import com.github.copilot.rpc.SessionLifecycleHandler; /** * Manages lifecycle event subscriptions and dispatching. diff --git a/src/main/java/com/github/copilot/sdk/LoggingHelpers.java b/src/main/java/com/github/copilot/LoggingHelpers.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/LoggingHelpers.java rename to src/main/java/com/github/copilot/LoggingHelpers.java index 654494ef13..c80e8fb698 100644 --- a/src/main/java/com/github/copilot/sdk/LoggingHelpers.java +++ b/src/main/java/com/github/copilot/LoggingHelpers.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.util.concurrent.TimeUnit; import java.util.logging.Level; diff --git a/src/main/java/com/github/copilot/sdk/RpcHandlerDispatcher.java b/src/main/java/com/github/copilot/RpcHandlerDispatcher.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/RpcHandlerDispatcher.java rename to src/main/java/com/github/copilot/RpcHandlerDispatcher.java index 1d76d8b88a..391f270dbf 100644 --- a/src/main/java/com/github/copilot/sdk/RpcHandlerDispatcher.java +++ b/src/main/java/com/github/copilot/RpcHandlerDispatcher.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.io.IOException; import java.util.ArrayList; @@ -16,17 +16,17 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.json.AutoModeSwitchRequest; -import com.github.copilot.sdk.json.ExitPlanModeRequest; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PermissionRequestResultKind; -import com.github.copilot.sdk.json.SessionLifecycleEvent; -import com.github.copilot.sdk.json.SessionLifecycleEventMetadata; -import com.github.copilot.sdk.json.ToolDefinition; -import com.github.copilot.sdk.json.ToolInvocation; -import com.github.copilot.sdk.json.ToolResultObject; -import com.github.copilot.sdk.json.UserInputRequest; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.rpc.AutoModeSwitchRequest; +import com.github.copilot.rpc.ExitPlanModeRequest; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PermissionRequestResultKind; +import com.github.copilot.rpc.SessionLifecycleEvent; +import com.github.copilot.rpc.SessionLifecycleEventMetadata; +import com.github.copilot.rpc.ToolDefinition; +import com.github.copilot.rpc.ToolInvocation; +import com.github.copilot.rpc.ToolResultObject; +import com.github.copilot.rpc.UserInputRequest; /** * Dispatches incoming JSON-RPC method calls to the appropriate handlers. diff --git a/src/main/java/com/github/copilot/sdk/SdkProtocolVersion.java b/src/main/java/com/github/copilot/SdkProtocolVersion.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/SdkProtocolVersion.java rename to src/main/java/com/github/copilot/SdkProtocolVersion.java index 3b00a88aee..8569b0104f 100644 --- a/src/main/java/com/github/copilot/sdk/SdkProtocolVersion.java +++ b/src/main/java/com/github/copilot/SdkProtocolVersion.java @@ -4,7 +4,7 @@ // Code generated by update-protocol-version.ts. DO NOT EDIT. -package com.github.copilot.sdk; +package com.github.copilot; /** * Provides the SDK protocol version. This must match the version expected by diff --git a/src/main/java/com/github/copilot/sdk/SessionRequestBuilder.java b/src/main/java/com/github/copilot/SessionRequestBuilder.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/SessionRequestBuilder.java rename to src/main/java/com/github/copilot/SessionRequestBuilder.java index 52bfb3337f..d9ad69282d 100644 --- a/src/main/java/com/github/copilot/sdk/SessionRequestBuilder.java +++ b/src/main/java/com/github/copilot/SessionRequestBuilder.java @@ -2,21 +2,21 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.util.HashMap; import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.function.Function; -import com.github.copilot.sdk.json.CreateSessionRequest; -import com.github.copilot.sdk.json.CommandWireDefinition; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.ResumeSessionRequest; -import com.github.copilot.sdk.json.SectionOverride; -import com.github.copilot.sdk.json.SectionOverrideAction; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SystemMessageConfig; +import com.github.copilot.rpc.CreateSessionRequest; +import com.github.copilot.rpc.CommandWireDefinition; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.ResumeSessionRequest; +import com.github.copilot.rpc.SectionOverride; +import com.github.copilot.rpc.SectionOverrideAction; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SystemMessageConfig; /** * Builds JSON-RPC request objects from session configuration. @@ -152,6 +152,7 @@ static CreateSessionRequest buildCreateRequest(SessionConfig config, String sess } request.setGitHubToken(config.getGitHubToken()); request.setRemoteSession(config.getRemoteSession()); + request.setCloud(config.getCloud()); return request; } diff --git a/src/main/java/com/github/copilot/sdk/SystemMessageMode.java b/src/main/java/com/github/copilot/SystemMessageMode.java similarity index 80% rename from src/main/java/com/github/copilot/sdk/SystemMessageMode.java rename to src/main/java/com/github/copilot/SystemMessageMode.java index 67fb5ea5e0..d693535f92 100644 --- a/src/main/java/com/github/copilot/sdk/SystemMessageMode.java +++ b/src/main/java/com/github/copilot/SystemMessageMode.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import com.fasterxml.jackson.annotation.JsonValue; @@ -13,7 +13,7 @@ * This enum determines whether to append custom instructions to the default * system message or replace it entirely. * - * @see com.github.copilot.sdk.json.SystemMessageConfig + * @see com.github.copilot.rpc.SystemMessageConfig * @since 1.0.0 */ public enum SystemMessageMode { @@ -37,10 +37,10 @@ public enum SystemMessageMode { * Override individual sections of the system prompt. *

* Use this mode with - * {@link com.github.copilot.sdk.json.SystemMessageConfig#setSections} to - * selectively replace, remove, append, prepend, or transform individual - * sections of the default system prompt. An optional {@code content} string is - * appended after all sections when provided. + * {@link com.github.copilot.rpc.SystemMessageConfig#setSections} to selectively + * replace, remove, append, prepend, or transform individual sections of the + * default system prompt. An optional {@code content} string is appended after + * all sections when provided. * * @since 1.2.0 */ diff --git a/src/main/java/com/github/copilot/sdk/package-info.java b/src/main/java/com/github/copilot/package-info.java similarity index 60% rename from src/main/java/com/github/copilot/sdk/package-info.java rename to src/main/java/com/github/copilot/package-info.java index f775d575f2..71025f07af 100644 --- a/src/main/java/com/github/copilot/sdk/package-info.java +++ b/src/main/java/com/github/copilot/package-info.java @@ -13,16 +13,16 @@ * *

Main Classes

*
    - *
  • {@link com.github.copilot.sdk.CopilotClient} - The main client for - * connecting to and communicating with the Copilot CLI. Manages the lifecycle - * of the CLI process and provides methods for creating sessions, querying - * models, and checking authentication status.
  • - *
  • {@link com.github.copilot.sdk.CopilotSession} - Represents a single + *
  • {@link com.github.copilot.CopilotClient} - The main client for connecting + * to and communicating with the Copilot CLI. Manages the lifecycle of the CLI + * process and provides methods for creating sessions, querying models, and + * checking authentication status.
  • + *
  • {@link com.github.copilot.CopilotSession} - Represents a single * conversation session with Copilot. Sessions maintain context across multiple * messages and support streaming responses, tool invocations, and event * handling.
  • - *
  • {@link com.github.copilot.sdk.JsonRpcClient} - Low-level JSON-RPC client - * for communication with the Copilot CLI process.
  • + *
  • {@link com.github.copilot.JsonRpcClient} - Low-level JSON-RPC client for + * communication with the Copilot CLI process.
  • *
* *

Quick Start

@@ -43,15 +43,15 @@ * *

Related Packages

*
    - *
  • {@link com.github.copilot.sdk.generated} - Auto-generated event types - * emitted during session processing
  • - *
  • {@link com.github.copilot.sdk.json} - Configuration and data transfer + *
  • {@link com.github.copilot.generated} - Auto-generated event types emitted + * during session processing
  • + *
  • {@link com.github.copilot.rpc} - Configuration and data transfer * objects
  • *
* - * @see com.github.copilot.sdk.CopilotClient - * @see com.github.copilot.sdk.CopilotSession - * @see GitHub + * @see com.github.copilot.CopilotClient + * @see com.github.copilot.CopilotSession + * @see GitHub * Repository */ -package com.github.copilot.sdk; +package com.github.copilot; diff --git a/src/main/java/com/github/copilot/sdk/json/AgentInfo.java b/src/main/java/com/github/copilot/rpc/AgentInfo.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/AgentInfo.java rename to src/main/java/com/github/copilot/rpc/AgentInfo.java index 1cc10a91d9..84e5126449 100644 --- a/src/main/java/com/github/copilot/sdk/json/AgentInfo.java +++ b/src/main/java/com/github/copilot/rpc/AgentInfo.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/rpc/AgentMode.java b/src/main/java/com/github/copilot/rpc/AgentMode.java new file mode 100644 index 0000000000..4a286dca3b --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/AgentMode.java @@ -0,0 +1,72 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The UI mode the agent is in for a given turn. + *

+ * Set on {@link MessageOptions#setAgentMode(AgentMode)} to send a message in a + * specific mode; defaults to the session's current mode when unset. + * + * @see MessageOptions + * @since 1.0.0 + */ +public enum AgentMode { + + /** The agent is responding interactively to the user. */ + INTERACTIVE("interactive"), + + /** The agent is preparing a plan before making changes. */ + PLAN("plan"), + + /** The agent is working autonomously toward task completion. */ + AUTOPILOT("autopilot"), + + /** The agent is in shell-focused UI mode. */ + SHELL("shell"); + + private final String value; + + AgentMode(String value) { + this.value = value; + } + + /** + * Returns the JSON value for this agent mode. + * + * @return the string value used in JSON serialization + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * Deserializes a JSON string value into the corresponding {@code AgentMode} + * enum constant. + * + * @param value + * the JSON string value + * @return the matching {@code AgentMode}, or {@code null} if value is + * {@code null} + * @throws IllegalArgumentException + * if the value does not match any known agent mode + */ + @JsonCreator + public static AgentMode fromValue(String value) { + if (value == null) { + return null; + } + for (AgentMode mode : values()) { + if (mode.value.equals(value)) { + return mode; + } + } + throw new IllegalArgumentException("Unknown AgentMode value: " + value); + } +} diff --git a/src/main/java/com/github/copilot/sdk/json/Attachment.java b/src/main/java/com/github/copilot/rpc/Attachment.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/Attachment.java rename to src/main/java/com/github/copilot/rpc/Attachment.java index 04011d6f13..68f66af5b9 100644 --- a/src/main/java/com/github/copilot/sdk/json/Attachment.java +++ b/src/main/java/com/github/copilot/rpc/Attachment.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/AutoModeSwitchHandler.java b/src/main/java/com/github/copilot/rpc/AutoModeSwitchHandler.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/AutoModeSwitchHandler.java rename to src/main/java/com/github/copilot/rpc/AutoModeSwitchHandler.java index 5fa19f4b1f..781088ba98 100644 --- a/src/main/java/com/github/copilot/sdk/json/AutoModeSwitchHandler.java +++ b/src/main/java/com/github/copilot/rpc/AutoModeSwitchHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/AutoModeSwitchInvocation.java b/src/main/java/com/github/copilot/rpc/AutoModeSwitchInvocation.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/AutoModeSwitchInvocation.java rename to src/main/java/com/github/copilot/rpc/AutoModeSwitchInvocation.java index 278d10ccfd..9dd4994a04 100644 --- a/src/main/java/com/github/copilot/sdk/json/AutoModeSwitchInvocation.java +++ b/src/main/java/com/github/copilot/rpc/AutoModeSwitchInvocation.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Context for an auto-mode-switch request invocation. diff --git a/src/main/java/com/github/copilot/sdk/json/AutoModeSwitchRequest.java b/src/main/java/com/github/copilot/rpc/AutoModeSwitchRequest.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/AutoModeSwitchRequest.java rename to src/main/java/com/github/copilot/rpc/AutoModeSwitchRequest.java index 0ef784c02a..5b0f0d4919 100644 --- a/src/main/java/com/github/copilot/sdk/json/AutoModeSwitchRequest.java +++ b/src/main/java/com/github/copilot/rpc/AutoModeSwitchRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/AutoModeSwitchResponse.java b/src/main/java/com/github/copilot/rpc/AutoModeSwitchResponse.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/AutoModeSwitchResponse.java rename to src/main/java/com/github/copilot/rpc/AutoModeSwitchResponse.java index c072b73e2b..a254f9ca88 100644 --- a/src/main/java/com/github/copilot/sdk/json/AutoModeSwitchResponse.java +++ b/src/main/java/com/github/copilot/rpc/AutoModeSwitchResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/github/copilot/sdk/json/AzureOptions.java b/src/main/java/com/github/copilot/rpc/AzureOptions.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/AzureOptions.java rename to src/main/java/com/github/copilot/rpc/AzureOptions.java index c2e146c196..7adbc5656b 100644 --- a/src/main/java/com/github/copilot/sdk/json/AzureOptions.java +++ b/src/main/java/com/github/copilot/rpc/AzureOptions.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/BlobAttachment.java b/src/main/java/com/github/copilot/rpc/BlobAttachment.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/BlobAttachment.java rename to src/main/java/com/github/copilot/rpc/BlobAttachment.java index d58a1e15e7..fe15293c62 100644 --- a/src/main/java/com/github/copilot/sdk/json/BlobAttachment.java +++ b/src/main/java/com/github/copilot/rpc/BlobAttachment.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/rpc/BuiltInTools.java b/src/main/java/com/github/copilot/rpc/BuiltInTools.java new file mode 100644 index 0000000000..090c362ceb --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/BuiltInTools.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import java.util.Collections; +import java.util.List; + +/** + * Curated sets of built-in tool names for common scenarios. Each constant is + * meant to be passed to {@link ToolSet#addBuiltIn(java.util.Collection)}. + * + * @since 1.3.0 + */ +public final class BuiltInTools { + + /** + * Built-in tools that operate only within the bounds of a single session — no + * host filesystem access outside the session, no cross-session state, no host + * environment access, no network. Safe to enable in + * {@link CopilotClientMode#EMPTY} scenarios (e.g. multi-tenant servers) without + * leaking host capabilities. + *

+ * Contract: tools in this set MUST NOT be extended (even behind options + * or args) to read or write state outside the session boundary. Adding + * cross-session or host-state behavior to one of these tools is a breaking + * change that requires removing it from this set. + */ + public static final List ISOLATED = Collections + .unmodifiableList(List.of("ask_user", "task_complete", "exit_plan_mode", "task", "read_agent", + "write_agent", "list_agents", "send_inbox", "context_board", "skill")); + + private BuiltInTools() { + // utility class + } +} diff --git a/src/main/java/com/github/copilot/rpc/CloudSessionOptions.java b/src/main/java/com/github/copilot/rpc/CloudSessionOptions.java new file mode 100644 index 0000000000..b63bfbbcd5 --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/CloudSessionOptions.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Options for creating a remote session in the cloud. + * + * @since 1.5.0 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CloudSessionOptions { + + @JsonProperty("repository") + private CloudSessionRepository repository; + + /** + * Gets the optional GitHub repository metadata to associate with the cloud + * session. + * + * @return the repository metadata, or {@code null} if not set + */ + public CloudSessionRepository getRepository() { + return repository; + } + + /** + * Sets the optional GitHub repository metadata to associate with the cloud + * session. + * + * @param repository + * the repository metadata + * @return this instance for method chaining + */ + public CloudSessionOptions setRepository(CloudSessionRepository repository) { + this.repository = repository; + return this; + } +} diff --git a/src/main/java/com/github/copilot/rpc/CloudSessionRepository.java b/src/main/java/com/github/copilot/rpc/CloudSessionRepository.java new file mode 100644 index 0000000000..c502693c3d --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/CloudSessionRepository.java @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * GitHub repository metadata to associate with a cloud session. + * + * @since 1.5.0 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CloudSessionRepository { + + @JsonProperty("owner") + private String owner; + + @JsonProperty("name") + private String name; + + @JsonProperty("branch") + private String branch; + + /** + * Gets the repository owner. + * + * @return the repository owner + */ + public String getOwner() { + return owner; + } + + /** + * Sets the repository owner. + * + * @param owner + * the repository owner + * @return this instance for method chaining + */ + public CloudSessionRepository setOwner(String owner) { + this.owner = owner; + return this; + } + + /** + * Gets the repository name. + * + * @return the repository name + */ + public String getName() { + return name; + } + + /** + * Sets the repository name. + * + * @param name + * the repository name + * @return this instance for method chaining + */ + public CloudSessionRepository setName(String name) { + this.name = name; + return this; + } + + /** + * Gets the optional branch name. + * + * @return the branch name, or {@code null} if not set + */ + public String getBranch() { + return branch; + } + + /** + * Sets the optional branch name. + * + * @param branch + * the branch name + * @return this instance for method chaining + */ + public CloudSessionRepository setBranch(String branch) { + this.branch = branch; + return this; + } +} diff --git a/src/main/java/com/github/copilot/sdk/json/CommandContext.java b/src/main/java/com/github/copilot/rpc/CommandContext.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/CommandContext.java rename to src/main/java/com/github/copilot/rpc/CommandContext.java index 4657699bb9..ec423831b6 100644 --- a/src/main/java/com/github/copilot/sdk/json/CommandContext.java +++ b/src/main/java/com/github/copilot/rpc/CommandContext.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Context passed to a {@link CommandHandler} when a slash command is executed. diff --git a/src/main/java/com/github/copilot/sdk/json/CommandDefinition.java b/src/main/java/com/github/copilot/rpc/CommandDefinition.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/CommandDefinition.java rename to src/main/java/com/github/copilot/rpc/CommandDefinition.java index 33a6cbada5..c64c71cd9e 100644 --- a/src/main/java/com/github/copilot/sdk/json/CommandDefinition.java +++ b/src/main/java/com/github/copilot/rpc/CommandDefinition.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Defines a slash command that users can invoke from the CLI TUI. diff --git a/src/main/java/com/github/copilot/sdk/json/CommandHandler.java b/src/main/java/com/github/copilot/rpc/CommandHandler.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/CommandHandler.java rename to src/main/java/com/github/copilot/rpc/CommandHandler.java index d63955638b..1d54c9535d 100644 --- a/src/main/java/com/github/copilot/sdk/json/CommandHandler.java +++ b/src/main/java/com/github/copilot/rpc/CommandHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/CommandWireDefinition.java b/src/main/java/com/github/copilot/rpc/CommandWireDefinition.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/CommandWireDefinition.java rename to src/main/java/com/github/copilot/rpc/CommandWireDefinition.java index 2ee65c58ed..20b8d5b63d 100644 --- a/src/main/java/com/github/copilot/sdk/json/CommandWireDefinition.java +++ b/src/main/java/com/github/copilot/rpc/CommandWireDefinition.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/rpc/CopilotClientMode.java b/src/main/java/com/github/copilot/rpc/CopilotClientMode.java new file mode 100644 index 0000000000..9298f76b5d --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/CopilotClientMode.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +/** + * Selects the defaulting strategy used by + * {@link com.github.copilot.CopilotClient}. + * + * @since 1.3.0 + */ +public enum CopilotClientMode { + + /** + * Disables optional features by default. The app must explicitly opt into + * anything it needs. Required for any scenario where CLI-like ambient behavior + * is unsafe (e.g., multi-user servers). + *

+ * When this mode is selected: + *

    + *
  • The client constructor requires + * {@link CopilotClientOptions#getCopilotHome()} or + * {@link CopilotClientOptions#getCliUrl()} to be set.
  • + *
  • {@link SessionConfig#getAvailableTools()} must be supplied on every + * session — no tools are exposed by default.
  • + *
  • {@code session.create} always sets + * {@code toolFilterPrecedence: "excluded"} so the allowlist and denylist + * compose naturally.
  • + *
  • The SDK injects safe defaults for ambient session features (telemetry, + * custom instructions, plugins, environment context, etc.).
  • + *
+ */ + EMPTY, + + /** + * Uses defaults equivalent to GitHub Copilot CLI. The default. Useful when + * building a coding agent that shares sessions with Copilot CLI. + *

+ * Do not use this mode for server-based multi-user applications — the + * default coding agent has tools and capabilities that operate across sessions + * and can access the host OS environment. + */ + COPILOT_CLI +} diff --git a/src/main/java/com/github/copilot/sdk/json/CopilotClientOptions.java b/src/main/java/com/github/copilot/rpc/CopilotClientOptions.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/CopilotClientOptions.java rename to src/main/java/com/github/copilot/rpc/CopilotClientOptions.java index e4605ffe10..69464aa724 100644 --- a/src/main/java/com/github/copilot/sdk/json/CopilotClientOptions.java +++ b/src/main/java/com/github/copilot/rpc/CopilotClientOptions.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Arrays; import java.util.HashMap; @@ -20,7 +20,7 @@ /** * Configuration options for creating a - * {@link com.github.copilot.sdk.CopilotClient}. + * {@link com.github.copilot.CopilotClient}. *

* This class provides a fluent API for configuring how the client connects to * and manages the Copilot CLI server. All setter methods return {@code this} @@ -35,7 +35,7 @@ * var client = new CopilotClient(options); * } * - * @see com.github.copilot.sdk.CopilotClient + * @see com.github.copilot.CopilotClient * @since 1.0.0 */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -53,6 +53,7 @@ public class CopilotClientOptions { private Executor executor; private String gitHubToken; private String logLevel = "info"; + private CopilotClientMode mode = CopilotClientMode.COPILOT_CLI; private Supplier>> onListModels; private int port; private TelemetryConfig telemetry; @@ -391,6 +392,35 @@ public CopilotClientOptions setLogLevel(String logLevel) { return this; } + /** + * Gets the SDK defaulting strategy. + * + * @return the client mode (never {@code null}) + * @since 1.3.0 + */ + public CopilotClientMode getMode() { + return mode; + } + + /** + * Sets the SDK defaulting strategy. + *

+ * When set to {@link CopilotClientMode#EMPTY}, the SDK validates that the app + * has supplied the required configuration (e.g. + * {@link #setCopilotHome(String)}) and translates session creation requests + * into runtime options that flip tool filter precedence to + * {@code excluded}-wins so exclusions are expressible. + * + * @param mode + * the client mode + * @return this options instance for method chaining + * @since 1.3.0 + */ + public CopilotClientOptions setMode(CopilotClientMode mode) { + this.mode = Objects.requireNonNull(mode, "mode must not be null"); + return this; + } + /** * Gets the custom handler for listing available models. * diff --git a/src/main/java/com/github/copilot/sdk/json/CreateSessionRequest.java b/src/main/java/com/github/copilot/rpc/CreateSessionRequest.java similarity index 94% rename from src/main/java/com/github/copilot/sdk/json/CreateSessionRequest.java rename to src/main/java/com/github/copilot/rpc/CreateSessionRequest.java index d6bcc7b2b7..1354e8c336 100644 --- a/src/main/java/com/github/copilot/sdk/json/CreateSessionRequest.java +++ b/src/main/java/com/github/copilot/rpc/CreateSessionRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; @@ -15,10 +15,9 @@ * Internal request object for creating a new session. *

* This is a low-level class for JSON-RPC communication. For creating sessions, - * use - * {@link com.github.copilot.sdk.CopilotClient#createSession(SessionConfig)}. + * use {@link com.github.copilot.CopilotClient#createSession(SessionConfig)}. * - * @see com.github.copilot.sdk.CopilotClient#createSession(SessionConfig) + * @see com.github.copilot.CopilotClient#createSession(SessionConfig) * @see SessionConfig * @since 1.0.0 */ @@ -49,6 +48,9 @@ public final class CreateSessionRequest { @JsonProperty("excludedTools") private List excludedTools; + @JsonProperty("toolFilterPrecedence") + private String toolFilterPrecedence; + @JsonProperty("provider") private ProviderConfig provider; @@ -127,6 +129,9 @@ public final class CreateSessionRequest { @JsonProperty("remoteSession") private String remoteSession; + @JsonProperty("cloud") + private CloudSessionOptions cloud; + /** Gets the model name. @return the model */ public String getModel() { return model; @@ -209,6 +214,19 @@ public void setExcludedTools(List excludedTools) { this.excludedTools = excludedTools; } + /** Gets the tool filter precedence. @return the precedence value */ + public String getToolFilterPrecedence() { + return toolFilterPrecedence; + } + + /** + * Sets the tool filter precedence. @param toolFilterPrecedence the precedence + * ("excluded" or null) + */ + public void setToolFilterPrecedence(String toolFilterPrecedence) { + this.toolFilterPrecedence = toolFilterPrecedence; + } + /** Gets the provider config. @return the provider */ public ProviderConfig getProvider() { return provider; @@ -543,4 +561,14 @@ public String getRemoteSession() { public void setRemoteSession(String remoteSession) { this.remoteSession = remoteSession; } + + /** Gets the cloud session options. @return the cloud session options */ + public CloudSessionOptions getCloud() { + return cloud; + } + + /** Sets the cloud session options. @param cloud the cloud session options */ + public void setCloud(CloudSessionOptions cloud) { + this.cloud = cloud; + } } diff --git a/src/main/java/com/github/copilot/sdk/json/CreateSessionResponse.java b/src/main/java/com/github/copilot/rpc/CreateSessionResponse.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/CreateSessionResponse.java rename to src/main/java/com/github/copilot/rpc/CreateSessionResponse.java index b47af050bc..e109267692 100644 --- a/src/main/java/com/github/copilot/sdk/json/CreateSessionResponse.java +++ b/src/main/java/com/github/copilot/rpc/CreateSessionResponse.java @@ -1,4 +1,4 @@ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/CustomAgentConfig.java b/src/main/java/com/github/copilot/rpc/CustomAgentConfig.java similarity index 90% rename from src/main/java/com/github/copilot/sdk/json/CustomAgentConfig.java rename to src/main/java/com/github/copilot/rpc/CustomAgentConfig.java index bb9520055e..5136f77786 100644 --- a/src/main/java/com/github/copilot/sdk/json/CustomAgentConfig.java +++ b/src/main/java/com/github/copilot/rpc/CustomAgentConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; @@ -60,6 +60,9 @@ public class CustomAgentConfig { @JsonProperty("skills") private List skills; + @JsonProperty("model") + private String model; + /** * Gets the unique identifier name for this agent. * @@ -255,4 +258,28 @@ public CustomAgentConfig setSkills(List skills) { this.skills = skills; return this; } + + /** + * Gets the model identifier for this agent. + * + * @return the model identifier, or {@code null} if not set + */ + public String getModel() { + return model; + } + + /** + * Sets the model identifier for this agent. + *

+ * When set, the runtime will attempt to use this model for the agent, falling + * back to the parent session model if unavailable. + * + * @param model + * the model identifier (e.g., "claude-haiku-4.5") + * @return this config for method chaining + */ + public CustomAgentConfig setModel(String model) { + this.model = model; + return this; + } } diff --git a/src/main/java/com/github/copilot/sdk/json/DefaultAgentConfig.java b/src/main/java/com/github/copilot/rpc/DefaultAgentConfig.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/DefaultAgentConfig.java rename to src/main/java/com/github/copilot/rpc/DefaultAgentConfig.java index 88f39ecff9..4be5dbbb9b 100644 --- a/src/main/java/com/github/copilot/sdk/json/DefaultAgentConfig.java +++ b/src/main/java/com/github/copilot/rpc/DefaultAgentConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/DeleteSessionResponse.java b/src/main/java/com/github/copilot/rpc/DeleteSessionResponse.java similarity index 89% rename from src/main/java/com/github/copilot/sdk/json/DeleteSessionResponse.java rename to src/main/java/com/github/copilot/rpc/DeleteSessionResponse.java index 1f53dfac3a..33e7091830 100644 --- a/src/main/java/com/github/copilot/sdk/json/DeleteSessionResponse.java +++ b/src/main/java/com/github/copilot/rpc/DeleteSessionResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,7 +13,7 @@ * This is a low-level class for JSON-RPC communication containing the result of * a session deletion operation. * - * @see com.github.copilot.sdk.CopilotClient#deleteSession(String) + * @see com.github.copilot.CopilotClient#deleteSession(String) * @since 1.0.0 */ @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/src/main/java/com/github/copilot/sdk/json/ElicitationContext.java b/src/main/java/com/github/copilot/rpc/ElicitationContext.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/ElicitationContext.java rename to src/main/java/com/github/copilot/rpc/ElicitationContext.java index 87687b1940..84c870e93a 100644 --- a/src/main/java/com/github/copilot/sdk/json/ElicitationContext.java +++ b/src/main/java/com/github/copilot/rpc/ElicitationContext.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Context for an elicitation request received from the server or MCP tools. diff --git a/src/main/java/com/github/copilot/sdk/json/ElicitationHandler.java b/src/main/java/com/github/copilot/rpc/ElicitationHandler.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/ElicitationHandler.java rename to src/main/java/com/github/copilot/rpc/ElicitationHandler.java index d0a0d06163..ed62d1248f 100644 --- a/src/main/java/com/github/copilot/sdk/json/ElicitationHandler.java +++ b/src/main/java/com/github/copilot/rpc/ElicitationHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/ElicitationParams.java b/src/main/java/com/github/copilot/rpc/ElicitationParams.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/ElicitationParams.java rename to src/main/java/com/github/copilot/rpc/ElicitationParams.java index 8bd81022e0..273681bba9 100644 --- a/src/main/java/com/github/copilot/sdk/json/ElicitationParams.java +++ b/src/main/java/com/github/copilot/rpc/ElicitationParams.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Parameters for an elicitation request sent from the SDK to the host. diff --git a/src/main/java/com/github/copilot/sdk/json/ElicitationResult.java b/src/main/java/com/github/copilot/rpc/ElicitationResult.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/ElicitationResult.java rename to src/main/java/com/github/copilot/rpc/ElicitationResult.java index 3ba30b83d9..42073de351 100644 --- a/src/main/java/com/github/copilot/sdk/json/ElicitationResult.java +++ b/src/main/java/com/github/copilot/rpc/ElicitationResult.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Map; diff --git a/src/main/java/com/github/copilot/sdk/json/ElicitationResultAction.java b/src/main/java/com/github/copilot/rpc/ElicitationResultAction.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/ElicitationResultAction.java rename to src/main/java/com/github/copilot/rpc/ElicitationResultAction.java index fd280cdebb..51fea7852d 100644 --- a/src/main/java/com/github/copilot/sdk/json/ElicitationResultAction.java +++ b/src/main/java/com/github/copilot/rpc/ElicitationResultAction.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Action value for an {@link ElicitationResult}. diff --git a/src/main/java/com/github/copilot/sdk/json/ElicitationSchema.java b/src/main/java/com/github/copilot/rpc/ElicitationSchema.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/ElicitationSchema.java rename to src/main/java/com/github/copilot/rpc/ElicitationSchema.java index c3d5487753..6111bf53b3 100644 --- a/src/main/java/com/github/copilot/sdk/json/ElicitationSchema.java +++ b/src/main/java/com/github/copilot/rpc/ElicitationSchema.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.List; import java.util.Map; diff --git a/src/main/java/com/github/copilot/sdk/json/ExitPlanModeHandler.java b/src/main/java/com/github/copilot/rpc/ExitPlanModeHandler.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/ExitPlanModeHandler.java rename to src/main/java/com/github/copilot/rpc/ExitPlanModeHandler.java index 13ecbe075c..28addcb0c2 100644 --- a/src/main/java/com/github/copilot/sdk/json/ExitPlanModeHandler.java +++ b/src/main/java/com/github/copilot/rpc/ExitPlanModeHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/ExitPlanModeInvocation.java b/src/main/java/com/github/copilot/rpc/ExitPlanModeInvocation.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/ExitPlanModeInvocation.java rename to src/main/java/com/github/copilot/rpc/ExitPlanModeInvocation.java index 6fd0231266..934c77d65f 100644 --- a/src/main/java/com/github/copilot/sdk/json/ExitPlanModeInvocation.java +++ b/src/main/java/com/github/copilot/rpc/ExitPlanModeInvocation.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Context for an exit-plan-mode request invocation. diff --git a/src/main/java/com/github/copilot/sdk/json/ExitPlanModeRequest.java b/src/main/java/com/github/copilot/rpc/ExitPlanModeRequest.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/ExitPlanModeRequest.java rename to src/main/java/com/github/copilot/rpc/ExitPlanModeRequest.java index be09350ef3..63499ee570 100644 --- a/src/main/java/com/github/copilot/sdk/json/ExitPlanModeRequest.java +++ b/src/main/java/com/github/copilot/rpc/ExitPlanModeRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/ExitPlanModeResult.java b/src/main/java/com/github/copilot/rpc/ExitPlanModeResult.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/ExitPlanModeResult.java rename to src/main/java/com/github/copilot/rpc/ExitPlanModeResult.java index 876e750b46..d61377cbcc 100644 --- a/src/main/java/com/github/copilot/sdk/json/ExitPlanModeResult.java +++ b/src/main/java/com/github/copilot/rpc/ExitPlanModeResult.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/GetAuthStatusResponse.java b/src/main/java/com/github/copilot/rpc/GetAuthStatusResponse.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/GetAuthStatusResponse.java rename to src/main/java/com/github/copilot/rpc/GetAuthStatusResponse.java index 4cf5d80c6a..d2e65c89b5 100644 --- a/src/main/java/com/github/copilot/sdk/json/GetAuthStatusResponse.java +++ b/src/main/java/com/github/copilot/rpc/GetAuthStatusResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/GetForegroundSessionResponse.java b/src/main/java/com/github/copilot/rpc/GetForegroundSessionResponse.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/GetForegroundSessionResponse.java rename to src/main/java/com/github/copilot/rpc/GetForegroundSessionResponse.java index 96962c6903..65c0557cac 100644 --- a/src/main/java/com/github/copilot/sdk/json/GetForegroundSessionResponse.java +++ b/src/main/java/com/github/copilot/rpc/GetForegroundSessionResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/GetLastSessionIdResponse.java b/src/main/java/com/github/copilot/rpc/GetLastSessionIdResponse.java similarity index 89% rename from src/main/java/com/github/copilot/sdk/json/GetLastSessionIdResponse.java rename to src/main/java/com/github/copilot/rpc/GetLastSessionIdResponse.java index 52042f57c1..3f488d0e9e 100644 --- a/src/main/java/com/github/copilot/sdk/json/GetLastSessionIdResponse.java +++ b/src/main/java/com/github/copilot/rpc/GetLastSessionIdResponse.java @@ -1,4 +1,4 @@ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/GetMessagesResponse.java b/src/main/java/com/github/copilot/rpc/GetMessagesResponse.java similarity index 91% rename from src/main/java/com/github/copilot/sdk/json/GetMessagesResponse.java rename to src/main/java/com/github/copilot/rpc/GetMessagesResponse.java index 1a3ed6aaec..7726ab649f 100644 --- a/src/main/java/com/github/copilot/sdk/json/GetMessagesResponse.java +++ b/src/main/java/com/github/copilot/rpc/GetMessagesResponse.java @@ -1,4 +1,4 @@ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/GetModelsResponse.java b/src/main/java/com/github/copilot/rpc/GetModelsResponse.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/GetModelsResponse.java rename to src/main/java/com/github/copilot/rpc/GetModelsResponse.java index 8f13912b99..b5eefa9ef2 100644 --- a/src/main/java/com/github/copilot/sdk/json/GetModelsResponse.java +++ b/src/main/java/com/github/copilot/rpc/GetModelsResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/GetSessionMetadataResponse.java b/src/main/java/com/github/copilot/rpc/GetSessionMetadataResponse.java similarity index 94% rename from src/main/java/com/github/copilot/sdk/json/GetSessionMetadataResponse.java rename to src/main/java/com/github/copilot/rpc/GetSessionMetadataResponse.java index eeceb41776..7ffeb29d03 100644 --- a/src/main/java/com/github/copilot/sdk/json/GetSessionMetadataResponse.java +++ b/src/main/java/com/github/copilot/rpc/GetSessionMetadataResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/GetStatusResponse.java b/src/main/java/com/github/copilot/rpc/GetStatusResponse.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/GetStatusResponse.java rename to src/main/java/com/github/copilot/rpc/GetStatusResponse.java index a77f378abe..434f00353b 100644 --- a/src/main/java/com/github/copilot/sdk/json/GetStatusResponse.java +++ b/src/main/java/com/github/copilot/rpc/GetStatusResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/HookInvocation.java b/src/main/java/com/github/copilot/rpc/HookInvocation.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/HookInvocation.java rename to src/main/java/com/github/copilot/rpc/HookInvocation.java index 39ab506862..40d807246a 100644 --- a/src/main/java/com/github/copilot/sdk/json/HookInvocation.java +++ b/src/main/java/com/github/copilot/rpc/HookInvocation.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Context for a hook invocation. diff --git a/src/main/java/com/github/copilot/sdk/json/InfiniteSessionConfig.java b/src/main/java/com/github/copilot/rpc/InfiniteSessionConfig.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/InfiniteSessionConfig.java rename to src/main/java/com/github/copilot/rpc/InfiniteSessionConfig.java index 561796ede7..02718d6a2f 100644 --- a/src/main/java/com/github/copilot/sdk/json/InfiniteSessionConfig.java +++ b/src/main/java/com/github/copilot/rpc/InfiniteSessionConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/InputOptions.java b/src/main/java/com/github/copilot/rpc/InputOptions.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/InputOptions.java rename to src/main/java/com/github/copilot/rpc/InputOptions.java index ca1cc5d385..db938a3f49 100644 --- a/src/main/java/com/github/copilot/sdk/json/InputOptions.java +++ b/src/main/java/com/github/copilot/rpc/InputOptions.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/com/github/copilot/sdk/json/JsonRpcError.java b/src/main/java/com/github/copilot/rpc/JsonRpcError.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/JsonRpcError.java rename to src/main/java/com/github/copilot/rpc/JsonRpcError.java index e7f021f43d..f270c43274 100644 --- a/src/main/java/com/github/copilot/sdk/json/JsonRpcError.java +++ b/src/main/java/com/github/copilot/rpc/JsonRpcError.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/JsonRpcRequest.java b/src/main/java/com/github/copilot/rpc/JsonRpcRequest.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/JsonRpcRequest.java rename to src/main/java/com/github/copilot/rpc/JsonRpcRequest.java index 1921370e25..6bef7f370f 100644 --- a/src/main/java/com/github/copilot/sdk/json/JsonRpcRequest.java +++ b/src/main/java/com/github/copilot/rpc/JsonRpcRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/JsonRpcResponse.java b/src/main/java/com/github/copilot/rpc/JsonRpcResponse.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/JsonRpcResponse.java rename to src/main/java/com/github/copilot/rpc/JsonRpcResponse.java index 1a78ed0174..6c80474afd 100644 --- a/src/main/java/com/github/copilot/sdk/json/JsonRpcResponse.java +++ b/src/main/java/com/github/copilot/rpc/JsonRpcResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/ListSessionsResponse.java b/src/main/java/com/github/copilot/rpc/ListSessionsResponse.java similarity index 89% rename from src/main/java/com/github/copilot/sdk/json/ListSessionsResponse.java rename to src/main/java/com/github/copilot/rpc/ListSessionsResponse.java index b535ee396a..61955eb422 100644 --- a/src/main/java/com/github/copilot/sdk/json/ListSessionsResponse.java +++ b/src/main/java/com/github/copilot/rpc/ListSessionsResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.List; @@ -15,7 +15,7 @@ * This is a low-level class for JSON-RPC communication containing the list of * available sessions. * - * @see com.github.copilot.sdk.CopilotClient#listSessions() + * @see com.github.copilot.CopilotClient#listSessions() * @see SessionMetadata * @since 1.0.0 */ diff --git a/src/main/java/com/github/copilot/sdk/json/McpHttpServerConfig.java b/src/main/java/com/github/copilot/rpc/McpHttpServerConfig.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/McpHttpServerConfig.java rename to src/main/java/com/github/copilot/rpc/McpHttpServerConfig.java index 7017db3d2d..83a42a88f8 100644 --- a/src/main/java/com/github/copilot/sdk/json/McpHttpServerConfig.java +++ b/src/main/java/com/github/copilot/rpc/McpHttpServerConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/McpServerConfig.java b/src/main/java/com/github/copilot/rpc/McpServerConfig.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/McpServerConfig.java rename to src/main/java/com/github/copilot/rpc/McpServerConfig.java index 7cf39af6b6..aef365d3f3 100644 --- a/src/main/java/com/github/copilot/sdk/json/McpServerConfig.java +++ b/src/main/java/com/github/copilot/rpc/McpServerConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/McpStdioServerConfig.java b/src/main/java/com/github/copilot/rpc/McpStdioServerConfig.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/McpStdioServerConfig.java rename to src/main/java/com/github/copilot/rpc/McpStdioServerConfig.java index 900034be61..8ce739ffbd 100644 --- a/src/main/java/com/github/copilot/sdk/json/McpStdioServerConfig.java +++ b/src/main/java/com/github/copilot/rpc/McpStdioServerConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/MessageAttachment.java b/src/main/java/com/github/copilot/rpc/MessageAttachment.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/MessageAttachment.java rename to src/main/java/com/github/copilot/rpc/MessageAttachment.java index 3371a56ba3..e28c5da2ea 100644 --- a/src/main/java/com/github/copilot/sdk/json/MessageAttachment.java +++ b/src/main/java/com/github/copilot/rpc/MessageAttachment.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/src/main/java/com/github/copilot/sdk/json/MessageOptions.java b/src/main/java/com/github/copilot/rpc/MessageOptions.java similarity index 86% rename from src/main/java/com/github/copilot/sdk/json/MessageOptions.java rename to src/main/java/com/github/copilot/rpc/MessageOptions.java index 21909d5766..a6cd02b0a7 100644 --- a/src/main/java/com/github/copilot/sdk/json/MessageOptions.java +++ b/src/main/java/com/github/copilot/rpc/MessageOptions.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.ArrayList; import java.util.Collections; @@ -36,7 +36,7 @@ * session.send(options).get(); * } * - * @see com.github.copilot.sdk.CopilotSession#send(MessageOptions) + * @see com.github.copilot.CopilotSession#send(MessageOptions) * @since 1.0.0 */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -45,6 +45,7 @@ public class MessageOptions { private String prompt; private List attachments; private String mode; + private AgentMode agentMode; private Map requestHeaders; /** @@ -126,6 +127,30 @@ public String getMode() { return mode; } + /** + * Sets the per-message agent UI mode. + *

+ * Defaults to the session's current mode when unset. + * + * @param agentMode + * the agent mode (for example {@link AgentMode#PLAN} or + * {@link AgentMode#AUTOPILOT}) + * @return this options instance for method chaining + */ + public MessageOptions setAgentMode(AgentMode agentMode) { + this.agentMode = agentMode; + return this; + } + + /** + * Gets the per-message agent UI mode. + * + * @return the agent mode, or {@code null} if not set + */ + public AgentMode getAgentMode() { + return agentMode; + } + /** * Gets the custom per-turn HTTP headers for outbound model requests. * @@ -167,6 +192,7 @@ public MessageOptions clone() { copy.prompt = this.prompt; copy.attachments = this.attachments != null ? new ArrayList<>(this.attachments) : null; copy.mode = this.mode; + copy.agentMode = this.agentMode; copy.requestHeaders = this.requestHeaders != null ? new HashMap<>(this.requestHeaders) : null; return copy; } diff --git a/src/main/java/com/github/copilot/sdk/json/ModelBilling.java b/src/main/java/com/github/copilot/rpc/ModelBilling.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/ModelBilling.java rename to src/main/java/com/github/copilot/rpc/ModelBilling.java index d04ef0d3e5..c7bfc72b59 100644 --- a/src/main/java/com/github/copilot/sdk/json/ModelBilling.java +++ b/src/main/java/com/github/copilot/rpc/ModelBilling.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/ModelCapabilities.java b/src/main/java/com/github/copilot/rpc/ModelCapabilities.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/ModelCapabilities.java rename to src/main/java/com/github/copilot/rpc/ModelCapabilities.java index 1cadcb05e4..2a71601cfd 100644 --- a/src/main/java/com/github/copilot/sdk/json/ModelCapabilities.java +++ b/src/main/java/com/github/copilot/rpc/ModelCapabilities.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/ModelCapabilitiesOverride.java b/src/main/java/com/github/copilot/rpc/ModelCapabilitiesOverride.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/ModelCapabilitiesOverride.java rename to src/main/java/com/github/copilot/rpc/ModelCapabilitiesOverride.java index 02727d4b5c..6a670252a4 100644 --- a/src/main/java/com/github/copilot/sdk/json/ModelCapabilitiesOverride.java +++ b/src/main/java/com/github/copilot/rpc/ModelCapabilitiesOverride.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -16,7 +16,7 @@ * defaults. *

* Use this to override specific model capabilities when creating a session or - * switching models with {@link com.github.copilot.sdk.CopilotSession#setModel}. + * switching models with {@link com.github.copilot.CopilotSession#setModel}. * Only non-null fields are applied; unset fields retain their runtime defaults. * *

Example: Disable vision for a session

@@ -33,7 +33,7 @@ * new ModelCapabilitiesOverride().setSupports(new ModelCapabilitiesOverride.Supports().setVision(true))).get(); * } * - * @see com.github.copilot.sdk.CopilotSession#setModel(String, String, + * @see com.github.copilot.CopilotSession#setModel(String, String, * ModelCapabilitiesOverride) * @see SessionConfig#setModelCapabilities(ModelCapabilitiesOverride) * @since 1.3.0 diff --git a/src/main/java/com/github/copilot/sdk/json/ModelInfo.java b/src/main/java/com/github/copilot/rpc/ModelInfo.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/ModelInfo.java rename to src/main/java/com/github/copilot/rpc/ModelInfo.java index e047900698..b9331c8681 100644 --- a/src/main/java/com/github/copilot/sdk/json/ModelInfo.java +++ b/src/main/java/com/github/copilot/rpc/ModelInfo.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/ModelLimits.java b/src/main/java/com/github/copilot/rpc/ModelLimits.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/ModelLimits.java rename to src/main/java/com/github/copilot/rpc/ModelLimits.java index 734a50deda..a27741823b 100644 --- a/src/main/java/com/github/copilot/sdk/json/ModelLimits.java +++ b/src/main/java/com/github/copilot/rpc/ModelLimits.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/ModelPolicy.java b/src/main/java/com/github/copilot/rpc/ModelPolicy.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/ModelPolicy.java rename to src/main/java/com/github/copilot/rpc/ModelPolicy.java index 9cf2262722..75fe36b11e 100644 --- a/src/main/java/com/github/copilot/sdk/json/ModelPolicy.java +++ b/src/main/java/com/github/copilot/rpc/ModelPolicy.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/ModelSupports.java b/src/main/java/com/github/copilot/rpc/ModelSupports.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/ModelSupports.java rename to src/main/java/com/github/copilot/rpc/ModelSupports.java index 905ac68235..1462cdd983 100644 --- a/src/main/java/com/github/copilot/sdk/json/ModelSupports.java +++ b/src/main/java/com/github/copilot/rpc/ModelSupports.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/ModelVisionLimits.java b/src/main/java/com/github/copilot/rpc/ModelVisionLimits.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/ModelVisionLimits.java rename to src/main/java/com/github/copilot/rpc/ModelVisionLimits.java index 331985e539..204099adfd 100644 --- a/src/main/java/com/github/copilot/sdk/json/ModelVisionLimits.java +++ b/src/main/java/com/github/copilot/rpc/ModelVisionLimits.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/PermissionHandler.java b/src/main/java/com/github/copilot/rpc/PermissionHandler.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/PermissionHandler.java rename to src/main/java/com/github/copilot/rpc/PermissionHandler.java index d230748fcf..bd8e70b750 100644 --- a/src/main/java/com/github/copilot/sdk/json/PermissionHandler.java +++ b/src/main/java/com/github/copilot/rpc/PermissionHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/PermissionInvocation.java b/src/main/java/com/github/copilot/rpc/PermissionInvocation.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/PermissionInvocation.java rename to src/main/java/com/github/copilot/rpc/PermissionInvocation.java index 218a570cf5..bda5bdde0a 100644 --- a/src/main/java/com/github/copilot/sdk/json/PermissionInvocation.java +++ b/src/main/java/com/github/copilot/rpc/PermissionInvocation.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Context information for a permission request invocation. diff --git a/src/main/java/com/github/copilot/sdk/json/PermissionRequest.java b/src/main/java/com/github/copilot/rpc/PermissionRequest.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/PermissionRequest.java rename to src/main/java/com/github/copilot/rpc/PermissionRequest.java index 99dc7018ab..51a303feb0 100644 --- a/src/main/java/com/github/copilot/sdk/json/PermissionRequest.java +++ b/src/main/java/com/github/copilot/rpc/PermissionRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Map; diff --git a/src/main/java/com/github/copilot/sdk/json/PermissionRequestResult.java b/src/main/java/com/github/copilot/rpc/PermissionRequestResult.java similarity index 54% rename from src/main/java/com/github/copilot/sdk/json/PermissionRequestResult.java rename to src/main/java/com/github/copilot/rpc/PermissionRequestResult.java index 3d7390f036..2e5c60100a 100644 --- a/src/main/java/com/github/copilot/sdk/json/PermissionRequestResult.java +++ b/src/main/java/com/github/copilot/rpc/PermissionRequestResult.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.List; @@ -39,6 +39,56 @@ public final class PermissionRequestResult { @JsonProperty("rules") private List rules; + @JsonProperty("feedback") + private String feedback; + + /** + * Creates a result that approves this single request. + * + * @return a new approved result + * @since 1.3.0 + */ + public static PermissionRequestResult approveOnce() { + return new PermissionRequestResult().setKind(PermissionRequestResultKind.APPROVED); + } + + /** + * Creates a result that rejects the request, optionally forwarding feedback to + * the LLM. + * + * @param feedback + * optional feedback message, or {@code null} + * @return a new rejected result + * @since 1.3.0 + */ + public static PermissionRequestResult reject(String feedback) { + var result = new PermissionRequestResult().setKind(PermissionRequestResultKind.REJECTED); + result.setFeedback(feedback); + return result; + } + + /** + * Creates a result denying the request because no user is available to confirm + * it. + * + * @return a new user-not-available result + * @since 1.3.0 + */ + public static PermissionRequestResult userNotAvailable() { + return new PermissionRequestResult().setKind(PermissionRequestResultKind.USER_NOT_AVAILABLE); + } + + /** + * Creates a result that declines to respond to this permission request, + * allowing another connected client to answer instead. + * + * @return a new no-result result + * @since 1.3.0 + */ + public static PermissionRequestResult noResult() { + return new PermissionRequestResult().setKind(PermissionRequestResultKind.NO_RESULT); + } + /** * Gets the result kind as a string. * @@ -93,4 +143,29 @@ public PermissionRequestResult setRules(List rules) { this.rules = rules; return this; } + + /** + * Gets optional human-readable feedback to forward to the LLM along with the + * decision. + * + * @return the feedback message, or {@code null} + * @since 1.3.0 + */ + public String getFeedback() { + return feedback; + } + + /** + * Sets optional human-readable feedback to forward to the LLM along with the + * decision. + * + * @param feedback + * the feedback message + * @return this result for method chaining + * @since 1.3.0 + */ + public PermissionRequestResult setFeedback(String feedback) { + this.feedback = feedback; + return this; + } } diff --git a/src/main/java/com/github/copilot/sdk/json/PermissionRequestResultKind.java b/src/main/java/com/github/copilot/rpc/PermissionRequestResultKind.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/PermissionRequestResultKind.java rename to src/main/java/com/github/copilot/rpc/PermissionRequestResultKind.java index f782fd76b6..95476c36f6 100644 --- a/src/main/java/com/github/copilot/sdk/json/PermissionRequestResultKind.java +++ b/src/main/java/com/github/copilot/rpc/PermissionRequestResultKind.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Objects; diff --git a/src/main/java/com/github/copilot/sdk/json/PingResponse.java b/src/main/java/com/github/copilot/rpc/PingResponse.java similarity index 82% rename from src/main/java/com/github/copilot/sdk/json/PingResponse.java rename to src/main/java/com/github/copilot/rpc/PingResponse.java index e86499b2f3..efa607c6b1 100644 --- a/src/main/java/com/github/copilot/sdk/json/PingResponse.java +++ b/src/main/java/com/github/copilot/rpc/PingResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,15 +13,15 @@ * The ping response confirms connectivity and provides information about the * server, including the protocol version. * - * @see com.github.copilot.sdk.CopilotClient#ping(String) + * @see com.github.copilot.CopilotClient#ping(String) * @since 1.0.0 */ @JsonInclude(JsonInclude.Include.NON_NULL) public record PingResponse( /** The echo message from the server. */ @JsonProperty("message") String message, - /** The server timestamp in milliseconds since epoch. */ - @JsonProperty("timestamp") long timestamp, + /** The server timestamp as an ISO 8601 string. */ + @JsonProperty("timestamp") String timestamp, /** * The SDK protocol version supported by the server. The SDK validates that this * version matches the expected version to ensure compatibility. diff --git a/src/main/java/com/github/copilot/rpc/PostToolUseFailureHandler.java b/src/main/java/com/github/copilot/rpc/PostToolUseFailureHandler.java new file mode 100644 index 0000000000..0b648ecbfb --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/PostToolUseFailureHandler.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import java.util.concurrent.CompletableFuture; + +/** + * Handler for post-tool-use-failure hooks. + *

+ * This hook is called after a tool execution whose result was a failure. + * {@link PostToolUseHandler} only fires for successful tool executions; + * register this handler in addition to observe failed tool calls. + * + * @since 1.3.0 + */ +@FunctionalInterface +public interface PostToolUseFailureHandler { + + /** + * Handles a post-tool-use-failure hook invocation. + * + * @param input + * the hook input containing tool name, arguments, and error message + * @param invocation + * context information about the invocation + * @return a future that resolves with the hook output, or {@code null} to use + * defaults + */ + CompletableFuture handle(PostToolUseFailureHookInput input, + HookInvocation invocation); +} diff --git a/src/main/java/com/github/copilot/rpc/PostToolUseFailureHookInput.java b/src/main/java/com/github/copilot/rpc/PostToolUseFailureHookInput.java new file mode 100644 index 0000000000..820976b96f --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/PostToolUseFailureHookInput.java @@ -0,0 +1,166 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + +/** + * Input for a post-tool-use-failure hook. + *

+ * Fires after a tool execution whose result was "failure". The CLI extracts the + * failure message from the tool result and passes it as the {@link #getError()} + * field (rather than passing the full result object). + * + * @since 1.3.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public class PostToolUseFailureHookInput { + + @JsonProperty("sessionId") + private String sessionId; + + @JsonProperty("timestamp") + private long timestamp; + + @JsonProperty("cwd") + private String cwd; + + @JsonProperty("toolName") + private String toolName; + + @JsonProperty("toolArgs") + private JsonNode toolArgs; + + @JsonProperty("error") + private String error; + + /** + * Gets the runtime session ID of the session that triggered the hook. + * + * @return the session ID + */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the runtime session ID of the session that triggered the hook. + * + * @param sessionId + * the session ID + * @return this instance for method chaining + */ + public PostToolUseFailureHookInput setSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Gets the timestamp of the hook invocation. + * + * @return the timestamp in milliseconds + */ + public long getTimestamp() { + return timestamp; + } + + /** + * Sets the timestamp of the hook invocation. + * + * @param timestamp + * the timestamp in milliseconds + * @return this instance for method chaining + */ + public PostToolUseFailureHookInput setTimestamp(long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Gets the current working directory. + * + * @return the working directory path + */ + public String getCwd() { + return cwd; + } + + /** + * Sets the current working directory. + * + * @param cwd + * the working directory path + * @return this instance for method chaining + */ + public PostToolUseFailureHookInput setCwd(String cwd) { + this.cwd = cwd; + return this; + } + + /** + * Gets the name of the tool that failed. + * + * @return the tool name + */ + public String getToolName() { + return toolName; + } + + /** + * Sets the name of the tool that failed. + * + * @param toolName + * the tool name + * @return this instance for method chaining + */ + public PostToolUseFailureHookInput setToolName(String toolName) { + this.toolName = toolName; + return this; + } + + /** + * Gets the arguments passed to the tool. + * + * @return the tool arguments as a JSON node + */ + public JsonNode getToolArgs() { + return toolArgs; + } + + /** + * Sets the arguments passed to the tool. + * + * @param toolArgs + * the tool arguments as a JSON node + * @return this instance for method chaining + */ + public PostToolUseFailureHookInput setToolArgs(JsonNode toolArgs) { + this.toolArgs = toolArgs; + return this; + } + + /** + * Gets the failure message extracted from the tool's result. + * + * @return the error message + */ + public String getError() { + return error; + } + + /** + * Sets the failure message extracted from the tool's result. + * + * @param error + * the error message + * @return this instance for method chaining + */ + public PostToolUseFailureHookInput setError(String error) { + this.error = error; + return this; + } +} diff --git a/src/main/java/com/github/copilot/rpc/PostToolUseFailureHookOutput.java b/src/main/java/com/github/copilot/rpc/PostToolUseFailureHookOutput.java new file mode 100644 index 0000000000..ec37cc2f3a --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/PostToolUseFailureHookOutput.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output for a post-tool-use-failure hook. + *

+ * Only {@link #getAdditionalContext()} is consumed by the host CLI — it is + * appended as hidden guidance to the model alongside the failed tool result. + * + * @since 1.3.0 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class PostToolUseFailureHookOutput { + + @JsonProperty("additionalContext") + private String additionalContext; + + /** + * Gets the additional context to inject into the conversation. + * + * @return the additional context, or {@code null} + */ + public String getAdditionalContext() { + return additionalContext; + } + + /** + * Sets the additional context to inject into the conversation for the language + * model. + * + * @param additionalContext + * the additional context + * @return this instance for method chaining + */ + public PostToolUseFailureHookOutput setAdditionalContext(String additionalContext) { + this.additionalContext = additionalContext; + return this; + } +} diff --git a/src/main/java/com/github/copilot/sdk/json/PostToolUseHandler.java b/src/main/java/com/github/copilot/rpc/PostToolUseHandler.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/PostToolUseHandler.java rename to src/main/java/com/github/copilot/rpc/PostToolUseHandler.java index 12688e63c4..7b5f1601cd 100644 --- a/src/main/java/com/github/copilot/sdk/json/PostToolUseHandler.java +++ b/src/main/java/com/github/copilot/rpc/PostToolUseHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/PostToolUseHookInput.java b/src/main/java/com/github/copilot/rpc/PostToolUseHookInput.java similarity index 84% rename from src/main/java/com/github/copilot/sdk/json/PostToolUseHookInput.java rename to src/main/java/com/github/copilot/rpc/PostToolUseHookInput.java index 18e9201b54..9da5aee883 100644 --- a/src/main/java/com/github/copilot/sdk/json/PostToolUseHookInput.java +++ b/src/main/java/com/github/copilot/rpc/PostToolUseHookInput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,6 +16,9 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class PostToolUseHookInput { + @JsonProperty("sessionId") + private String sessionId; + @JsonProperty("timestamp") private long timestamp; @@ -31,6 +34,27 @@ public class PostToolUseHookInput { @JsonProperty("toolResult") private JsonNode toolResult; + /** + * Gets the runtime session ID of the session that triggered the hook. + * + * @return the session ID + */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the runtime session ID of the session that triggered the hook. + * + * @param sessionId + * the session ID + * @return this instance for method chaining + */ + public PostToolUseHookInput setSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + /** * Gets the timestamp of the hook invocation. * diff --git a/src/main/java/com/github/copilot/sdk/json/PostToolUseHookOutput.java b/src/main/java/com/github/copilot/rpc/PostToolUseHookOutput.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/PostToolUseHookOutput.java rename to src/main/java/com/github/copilot/rpc/PostToolUseHookOutput.java index a532bf15e6..24af027076 100644 --- a/src/main/java/com/github/copilot/sdk/json/PostToolUseHookOutput.java +++ b/src/main/java/com/github/copilot/rpc/PostToolUseHookOutput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/rpc/PreMcpToolCallHandler.java b/src/main/java/com/github/copilot/rpc/PreMcpToolCallHandler.java new file mode 100644 index 0000000000..9e7d147edd --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/PreMcpToolCallHandler.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import java.util.concurrent.CompletableFuture; + +/** + * Handler for pre-MCP-tool-call hooks. + *

+ * This hook is called before an MCP tool call is dispatched to an MCP server, + * allowing you to: + *

    + *
  • Inspect the tool call arguments and server name
  • + *
  • Set, replace, or remove MCP request metadata ({@code _meta})
  • + *
+ * + * @since 1.0.8 + */ +@FunctionalInterface +public interface PreMcpToolCallHandler { + + /** + * Handles a pre-MCP-tool-call hook invocation. + * + * @param input + * the hook input containing server name, tool name, and arguments + * @param invocation + * context information about the invocation + * @return a future that resolves with the hook output, or {@code null} to + * preserve existing metadata (no-op) + */ + CompletableFuture handle(PreMcpToolCallHookInput input, HookInvocation invocation); +} diff --git a/src/main/java/com/github/copilot/rpc/PreMcpToolCallHookInput.java b/src/main/java/com/github/copilot/rpc/PreMcpToolCallHookInput.java new file mode 100644 index 0000000000..881065aa86 --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/PreMcpToolCallHookInput.java @@ -0,0 +1,215 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + +/** + * Input for a pre-MCP-tool-call hook. + *

+ * This hook fires before an MCP tool call is dispatched to an MCP server, + * allowing you to inspect or modify the request metadata. + * + * @since 1.0.8 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public class PreMcpToolCallHookInput { + + @JsonProperty("sessionId") + private String sessionId; + + @JsonProperty("timestamp") + private long timestamp; + + @JsonProperty("cwd") + private String cwd; + + @JsonProperty("serverName") + private String serverName; + + @JsonProperty("toolName") + private String toolName; + + @JsonProperty("arguments") + private JsonNode arguments; + + @JsonProperty("toolCallId") + private String toolCallId; + + @JsonProperty("_meta") + private Map meta; + + /** + * Gets the runtime session ID of the session that triggered the hook. + * + * @return the session ID + */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the runtime session ID of the session that triggered the hook. + * + * @param sessionId + * the session ID + * @return this instance for method chaining + */ + public PreMcpToolCallHookInput setSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Gets the timestamp of the hook invocation. + * + * @return the timestamp in milliseconds + */ + public long getTimestamp() { + return timestamp; + } + + /** + * Sets the timestamp of the hook invocation. + * + * @param timestamp + * the timestamp in milliseconds + * @return this instance for method chaining + */ + public PreMcpToolCallHookInput setTimestamp(long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Gets the current working directory. + * + * @return the working directory path + */ + public String getCwd() { + return cwd; + } + + /** + * Sets the current working directory. + * + * @param cwd + * the working directory path + * @return this instance for method chaining + */ + public PreMcpToolCallHookInput setCwd(String cwd) { + this.cwd = cwd; + return this; + } + + /** + * Gets the name of the MCP server being called. + * + * @return the server name + */ + public String getServerName() { + return serverName; + } + + /** + * Sets the name of the MCP server being called. + * + * @param serverName + * the server name + * @return this instance for method chaining + */ + public PreMcpToolCallHookInput setServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Gets the name of the MCP tool being called. + * + * @return the tool name + */ + public String getToolName() { + return toolName; + } + + /** + * Sets the name of the MCP tool being called. + * + * @param toolName + * the tool name + * @return this instance for method chaining + */ + public PreMcpToolCallHookInput setToolName(String toolName) { + this.toolName = toolName; + return this; + } + + /** + * Gets the arguments for the MCP tool call. + * + * @return the arguments as a JSON node, or {@code null} + */ + public JsonNode getArguments() { + return arguments; + } + + /** + * Sets the arguments for the MCP tool call. + * + * @param arguments + * the arguments as a JSON node + * @return this instance for method chaining + */ + public PreMcpToolCallHookInput setArguments(JsonNode arguments) { + this.arguments = arguments; + return this; + } + + /** + * Gets the tool call ID, if available. + * + * @return the tool call ID, or {@code null} + */ + public String getToolCallId() { + return toolCallId; + } + + /** + * Sets the tool call ID. + * + * @param toolCallId + * the tool call ID + * @return this instance for method chaining + */ + public PreMcpToolCallHookInput setToolCallId(String toolCallId) { + this.toolCallId = toolCallId; + return this; + } + + /** + * Gets the MCP request metadata, if present. + * + * @return the metadata map, or {@code null} + */ + public Map getMeta() { + return meta; + } + + /** + * Sets the MCP request metadata. + * + * @param meta + * the metadata map + * @return this instance for method chaining + */ + public PreMcpToolCallHookInput setMeta(Map meta) { + this.meta = meta; + return this; + } +} diff --git a/src/main/java/com/github/copilot/rpc/PreMcpToolCallHookOutput.java b/src/main/java/com/github/copilot/rpc/PreMcpToolCallHookOutput.java new file mode 100644 index 0000000000..21da35e5e6 --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/PreMcpToolCallHookOutput.java @@ -0,0 +1,72 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; + +/** + * Output for a pre-MCP-tool-call hook. + *

+ * The {@link #metaToUse} property controls outgoing MCP request metadata: + *

    + *
  • Return {@code null} from the hook handler: preserve existing + * {@code _meta} (no-op).
  • + *
  • Return a {@code PreMcpToolCallHookOutput} with {@code metaToUse} left as + * {@code null}: remove {@code _meta} from the request.
  • + *
  • Return a {@code PreMcpToolCallHookOutput} with {@code metaToUse} set to a + * JSON object: replace {@code _meta} with that object.
  • + *
+ * + * @since 1.0.8 + */ +@JsonInclude(JsonInclude.Include.ALWAYS) +public class PreMcpToolCallHookOutput { + + @JsonProperty("metaToUse") + private JsonNode metaToUse; + + /** + * Gets the metadata to use for the outgoing MCP request. + * + * @return the metadata JSON node, or {@code null} to remove metadata + */ + public JsonNode getMetaToUse() { + return metaToUse; + } + + /** + * Sets the metadata to use for the outgoing MCP request. + * + * @param metaToUse + * the metadata JSON node, or {@code null} to remove metadata + * @return this instance for method chaining + */ + public PreMcpToolCallHookOutput setMetaToUse(JsonNode metaToUse) { + this.metaToUse = metaToUse; + return this; + } + + /** + * Creates a hook output that sets the given metadata on the MCP request. + * + * @param metaToUse + * the metadata JSON node to use + * @return the hook output + */ + public static PreMcpToolCallHookOutput withMeta(JsonNode metaToUse) { + return new PreMcpToolCallHookOutput().setMetaToUse(metaToUse); + } + + /** + * Creates a hook output that removes metadata from the MCP request. + * + * @return the hook output with {@code null} metaToUse + */ + public static PreMcpToolCallHookOutput removeMeta() { + return new PreMcpToolCallHookOutput(); + } +} diff --git a/src/main/java/com/github/copilot/sdk/json/PreToolUseHandler.java b/src/main/java/com/github/copilot/rpc/PreToolUseHandler.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/PreToolUseHandler.java rename to src/main/java/com/github/copilot/rpc/PreToolUseHandler.java index 3f98972e54..94f17acab4 100644 --- a/src/main/java/com/github/copilot/sdk/json/PreToolUseHandler.java +++ b/src/main/java/com/github/copilot/rpc/PreToolUseHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/PreToolUseHookInput.java b/src/main/java/com/github/copilot/rpc/PreToolUseHookInput.java similarity index 81% rename from src/main/java/com/github/copilot/sdk/json/PreToolUseHookInput.java rename to src/main/java/com/github/copilot/rpc/PreToolUseHookInput.java index 63785e98d3..b6cb118590 100644 --- a/src/main/java/com/github/copilot/sdk/json/PreToolUseHookInput.java +++ b/src/main/java/com/github/copilot/rpc/PreToolUseHookInput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,6 +16,9 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class PreToolUseHookInput { + @JsonProperty("sessionId") + private String sessionId; + @JsonProperty("timestamp") private long timestamp; @@ -28,6 +31,27 @@ public class PreToolUseHookInput { @JsonProperty("toolArgs") private JsonNode toolArgs; + /** + * Gets the runtime session ID of the session that triggered the hook. + * + * @return the session ID + */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the runtime session ID of the session that triggered the hook. + * + * @param sessionId + * the session ID + * @return this instance for method chaining + */ + public PreToolUseHookInput setSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + /** * Gets the timestamp of the hook invocation. * diff --git a/src/main/java/com/github/copilot/sdk/json/PreToolUseHookOutput.java b/src/main/java/com/github/copilot/rpc/PreToolUseHookOutput.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/PreToolUseHookOutput.java rename to src/main/java/com/github/copilot/rpc/PreToolUseHookOutput.java index a92c8f01a9..25d49a54d5 100644 --- a/src/main/java/com/github/copilot/sdk/json/PreToolUseHookOutput.java +++ b/src/main/java/com/github/copilot/rpc/PreToolUseHookOutput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/ProviderConfig.java b/src/main/java/com/github/copilot/rpc/ProviderConfig.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/ProviderConfig.java rename to src/main/java/com/github/copilot/rpc/ProviderConfig.java index 1c5e6fcc7f..6c9cf379fe 100644 --- a/src/main/java/com/github/copilot/sdk/json/ProviderConfig.java +++ b/src/main/java/com/github/copilot/rpc/ProviderConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.Map; diff --git a/src/main/java/com/github/copilot/sdk/json/ResumeSessionConfig.java b/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java similarity index 83% rename from src/main/java/com/github/copilot/sdk/json/ResumeSessionConfig.java rename to src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java index 72c9f6f47a..fa28258b37 100644 --- a/src/main/java/com/github/copilot/sdk/json/ResumeSessionConfig.java +++ b/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.ArrayList; import java.util.Collections; @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.github.copilot.sdk.generated.SessionEvent; +import com.github.copilot.generated.SessionEvent; import java.util.Optional; /** @@ -31,7 +31,7 @@ * var session = client.resumeSession(sessionId, config).get(); * } * - * @see com.github.copilot.sdk.CopilotClient#resumeSession(String, + * @see com.github.copilot.CopilotClient#resumeSession(String, * ResumeSessionConfig) * @since 1.0.0 */ @@ -46,6 +46,10 @@ public class ResumeSessionConfig { private List excludedTools; private ProviderConfig provider; private Boolean enableSessionTelemetry; + private Boolean skipCustomInstructions; + private Boolean customAgentsLocalOnly; + private Boolean coauthorEnabled; + private Boolean manageScheduleEnabled; private String reasoningEffort; private ModelCapabilitiesOverride modelCapabilities; private PermissionHandler onPermissionRequest; @@ -241,7 +245,7 @@ public ResumeSessionConfig setProvider(ProviderConfig provider) { * {@code true}, telemetry is enabled for GitHub-authenticated sessions. When a * custom {@link ProviderConfig} (BYOK) is configured, session telemetry is * always disabled regardless of this setting. This is independent of - * {@link com.github.copilot.sdk.json.CopilotClientOptions#getTelemetry() + * {@link com.github.copilot.rpc.CopilotClientOptions#getTelemetry() * CopilotClientOptions.TelemetryConfig}, which configures OpenTelemetry export * for observability. * @@ -279,6 +283,168 @@ public ResumeSessionConfig clearEnableSessionTelemetry() { return this; } + /** + * Gets whether custom instruction file loading is suppressed. + * + * @return {@code true} to suppress, or empty if not explicitly set + * @since 1.3.0 + */ + @JsonIgnore + public Optional getSkipCustomInstructions() { + return Optional.ofNullable(skipCustomInstructions); + } + + /** + * Sets whether to suppress loading of custom instruction files. + *

+ * This option is sent to the server via a {@code session.options.update} + * JSON-RPC call immediately after session resume. In + * {@link CopilotClientMode#EMPTY EMPTY} mode the default is {@code true} + * (skip); in {@link CopilotClientMode#COPILOT_CLI COPILOT_CLI} mode the value + * is forwarded only when explicitly set. + * + * @param skipCustomInstructions + * whether to skip custom instructions + * @return this config instance for method chaining + * @since 1.3.0 + */ + public ResumeSessionConfig setSkipCustomInstructions(boolean skipCustomInstructions) { + this.skipCustomInstructions = skipCustomInstructions; + return this; + } + + /** + * Clears the skipCustomInstructions setting. + * + * @return this instance for method chaining + */ + public ResumeSessionConfig clearSkipCustomInstructions() { + this.skipCustomInstructions = null; + return this; + } + + /** + * Gets whether custom-agent discovery is restricted to local only. + * + * @return {@code true} for local only, or empty if not explicitly set + * @since 1.3.0 + */ + @JsonIgnore + public Optional getCustomAgentsLocalOnly() { + return Optional.ofNullable(customAgentsLocalOnly); + } + + /** + * Sets whether custom-agent discovery is restricted to the session's local + * working directory. + *

+ * This option is sent to the server via a {@code session.options.update} + * JSON-RPC call immediately after session resume. In + * {@link CopilotClientMode#EMPTY EMPTY} mode the default is {@code true} (local + * only); in {@link CopilotClientMode#COPILOT_CLI COPILOT_CLI} mode the value is + * forwarded only when explicitly set. + * + * @param customAgentsLocalOnly + * whether to restrict to local agents + * @return this config instance for method chaining + * @since 1.3.0 + */ + public ResumeSessionConfig setCustomAgentsLocalOnly(boolean customAgentsLocalOnly) { + this.customAgentsLocalOnly = customAgentsLocalOnly; + return this; + } + + /** + * Clears the customAgentsLocalOnly setting. + * + * @return this instance for method chaining + */ + public ResumeSessionConfig clearCustomAgentsLocalOnly() { + this.customAgentsLocalOnly = null; + return this; + } + + /** + * Gets whether the runtime may append a Co-authored-by trailer. + * + * @return the coauthor enabled flag, or empty if not explicitly set + * @since 1.3.0 + */ + @JsonIgnore + public Optional getCoauthorEnabled() { + return Optional.ofNullable(coauthorEnabled); + } + + /** + * Sets whether the runtime is allowed to append a {@code Co-authored-by} + * trailer. + *

+ * This option is sent to the server via a {@code session.options.update} + * JSON-RPC call immediately after session resume. In + * {@link CopilotClientMode#EMPTY EMPTY} mode the default is {@code false} + * (disabled); in {@link CopilotClientMode#COPILOT_CLI COPILOT_CLI} mode the + * value is forwarded only when explicitly set. + * + * @param coauthorEnabled + * whether coauthor is enabled + * @return this config instance for method chaining + * @since 1.3.0 + */ + public ResumeSessionConfig setCoauthorEnabled(boolean coauthorEnabled) { + this.coauthorEnabled = coauthorEnabled; + return this; + } + + /** + * Clears the coauthorEnabled setting. + * + * @return this instance for method chaining + */ + public ResumeSessionConfig clearCoauthorEnabled() { + this.coauthorEnabled = null; + return this; + } + + /** + * Gets whether the manage_schedule tool is enabled. + * + * @return the manage schedule flag, or empty if not explicitly set + * @since 1.3.0 + */ + @JsonIgnore + public Optional getManageScheduleEnabled() { + return Optional.ofNullable(manageScheduleEnabled); + } + + /** + * Sets whether to enable the {@code manage_schedule} tool. + *

+ * This option is sent to the server via a {@code session.options.update} + * JSON-RPC call immediately after session resume. In + * {@link CopilotClientMode#EMPTY EMPTY} mode the default is {@code false} + * (disabled); in {@link CopilotClientMode#COPILOT_CLI COPILOT_CLI} mode the + * value is forwarded only when explicitly set. + * + * @param manageScheduleEnabled + * whether manage schedule is enabled + * @return this config instance for method chaining + * @since 1.3.0 + */ + public ResumeSessionConfig setManageScheduleEnabled(boolean manageScheduleEnabled) { + this.manageScheduleEnabled = manageScheduleEnabled; + return this; + } + + /** + * Clears the manageScheduleEnabled setting. + * + * @return this instance for method chaining + */ + public ResumeSessionConfig clearManageScheduleEnabled() { + this.manageScheduleEnabled = null; + return this; + } + /** * Gets the reasoning effort level. * @@ -743,9 +909,9 @@ public Consumer getOnEvent() { * Sets an event handler that is registered on the session before the * {@code session.resume} RPC is issued. *

- * Equivalent to calling - * {@link com.github.copilot.sdk.CopilotSession#on(Consumer)} immediately after - * resumption, but executes earlier in the lifecycle so no events are missed. + * Equivalent to calling {@link com.github.copilot.CopilotSession#on(Consumer)} + * immediately after resumption, but executes earlier in the lifecycle so no + * events are missed. * * @param onEvent * the event handler to register before session resumption diff --git a/src/main/java/com/github/copilot/sdk/json/ResumeSessionRequest.java b/src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/ResumeSessionRequest.java rename to src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java index 8aca77b7d2..4321a24aa3 100644 --- a/src/main/java/com/github/copilot/sdk/json/ResumeSessionRequest.java +++ b/src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; @@ -16,9 +16,9 @@ *

* This is a low-level class for JSON-RPC communication. For resuming sessions, * use - * {@link com.github.copilot.sdk.CopilotClient#resumeSession(String, ResumeSessionConfig)}. + * {@link com.github.copilot.CopilotClient#resumeSession(String, ResumeSessionConfig)}. * - * @see com.github.copilot.sdk.CopilotClient#resumeSession(String, + * @see com.github.copilot.CopilotClient#resumeSession(String, * ResumeSessionConfig) * @see ResumeSessionConfig * @since 1.0.0 @@ -50,6 +50,9 @@ public final class ResumeSessionRequest { @JsonProperty("excludedTools") private List excludedTools; + @JsonProperty("toolFilterPrecedence") + private String toolFilterPrecedence; + @JsonProperty("provider") private ProviderConfig provider; @@ -216,6 +219,19 @@ public void setExcludedTools(List excludedTools) { this.excludedTools = excludedTools; } + /** Gets the tool filter precedence. @return the precedence value */ + public String getToolFilterPrecedence() { + return toolFilterPrecedence; + } + + /** + * Sets the tool filter precedence. @param toolFilterPrecedence the precedence + * ("excluded" or null) + */ + public void setToolFilterPrecedence(String toolFilterPrecedence) { + this.toolFilterPrecedence = toolFilterPrecedence; + } + /** Gets the provider config. @return the provider */ public ProviderConfig getProvider() { return provider; diff --git a/src/main/java/com/github/copilot/sdk/json/ResumeSessionResponse.java b/src/main/java/com/github/copilot/rpc/ResumeSessionResponse.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/ResumeSessionResponse.java rename to src/main/java/com/github/copilot/rpc/ResumeSessionResponse.java index 8349c5d307..cd787d37fb 100644 --- a/src/main/java/com/github/copilot/sdk/json/ResumeSessionResponse.java +++ b/src/main/java/com/github/copilot/rpc/ResumeSessionResponse.java @@ -1,4 +1,4 @@ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/SectionOverride.java b/src/main/java/com/github/copilot/rpc/SectionOverride.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/SectionOverride.java rename to src/main/java/com/github/copilot/rpc/SectionOverride.java index 40a58449d3..0b4dd05ce9 100644 --- a/src/main/java/com/github/copilot/sdk/json/SectionOverride.java +++ b/src/main/java/com/github/copilot/rpc/SectionOverride.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; import java.util.function.Function; diff --git a/src/main/java/com/github/copilot/sdk/json/SectionOverrideAction.java b/src/main/java/com/github/copilot/rpc/SectionOverrideAction.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/SectionOverrideAction.java rename to src/main/java/com/github/copilot/rpc/SectionOverrideAction.java index 2d179f753f..f3569009b8 100644 --- a/src/main/java/com/github/copilot/sdk/json/SectionOverrideAction.java +++ b/src/main/java/com/github/copilot/rpc/SectionOverrideAction.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/github/copilot/sdk/json/SendMessageRequest.java b/src/main/java/com/github/copilot/rpc/SendMessageRequest.java similarity index 82% rename from src/main/java/com/github/copilot/sdk/json/SendMessageRequest.java rename to src/main/java/com/github/copilot/rpc/SendMessageRequest.java index 2ef39770f0..b73d2caa22 100644 --- a/src/main/java/com/github/copilot/sdk/json/SendMessageRequest.java +++ b/src/main/java/com/github/copilot/rpc/SendMessageRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; @@ -15,10 +15,10 @@ * Internal request object for sending a message to a session. *

* This is a low-level class for JSON-RPC communication. For sending messages, - * use {@link com.github.copilot.sdk.CopilotSession#send(String)} or - * {@link com.github.copilot.sdk.CopilotSession#sendAndWait(String)}. + * use {@link com.github.copilot.CopilotSession#send(String)} or + * {@link com.github.copilot.CopilotSession#sendAndWait(String)}. * - * @see com.github.copilot.sdk.CopilotSession + * @see com.github.copilot.CopilotSession * @see MessageOptions * @since 1.0.0 */ @@ -37,6 +37,9 @@ public final class SendMessageRequest { @JsonProperty("mode") private String mode; + @JsonProperty("agentMode") + private AgentMode agentMode; + @JsonProperty("requestHeaders") private Map requestHeaders; @@ -80,6 +83,16 @@ public void setMode(String mode) { this.mode = mode; } + /** Gets the per-message agent UI mode. @return the agent mode */ + public AgentMode getAgentMode() { + return agentMode; + } + + /** Sets the per-message agent UI mode. @param agentMode the agent mode */ + public void setAgentMode(AgentMode agentMode) { + this.agentMode = agentMode; + } + /** Gets the per-turn request headers. @return the headers map */ public Map getRequestHeaders() { return requestHeaders == null ? null : Collections.unmodifiableMap(requestHeaders); diff --git a/src/main/java/com/github/copilot/sdk/json/SendMessageResponse.java b/src/main/java/com/github/copilot/rpc/SendMessageResponse.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/SendMessageResponse.java rename to src/main/java/com/github/copilot/rpc/SendMessageResponse.java index 7d79a7a2b2..b3d158864d 100644 --- a/src/main/java/com/github/copilot/sdk/json/SendMessageResponse.java +++ b/src/main/java/com/github/copilot/rpc/SendMessageResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/SessionCapabilities.java b/src/main/java/com/github/copilot/rpc/SessionCapabilities.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/SessionCapabilities.java rename to src/main/java/com/github/copilot/rpc/SessionCapabilities.java index 4eb4fc025c..b0daf4a5b9 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionCapabilities.java +++ b/src/main/java/com/github/copilot/rpc/SessionCapabilities.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Represents the capabilities reported by the host for a session. diff --git a/src/main/java/com/github/copilot/sdk/json/SessionConfig.java b/src/main/java/com/github/copilot/rpc/SessionConfig.java similarity index 80% rename from src/main/java/com/github/copilot/sdk/json/SessionConfig.java rename to src/main/java/com/github/copilot/rpc/SessionConfig.java index f1a383402f..2a42df6108 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionConfig.java +++ b/src/main/java/com/github/copilot/rpc/SessionConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.ArrayList; import java.util.Collections; @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.github.copilot.sdk.generated.SessionEvent; +import com.github.copilot.generated.SessionEvent; import java.util.Optional; /** @@ -32,7 +32,7 @@ * var session = client.createSession(config).get(); * } * - * @see com.github.copilot.sdk.CopilotClient#createSession(SessionConfig) + * @see com.github.copilot.CopilotClient#createSession(SessionConfig) * @since 1.0.0 */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -48,6 +48,10 @@ public class SessionConfig { private List excludedTools; private ProviderConfig provider; private Boolean enableSessionTelemetry; + private Boolean skipCustomInstructions; + private Boolean customAgentsLocalOnly; + private Boolean coauthorEnabled; + private Boolean manageScheduleEnabled; private PermissionHandler onPermissionRequest; private UserInputHandler onUserInputRequest; private SessionHooks hooks; @@ -72,6 +76,7 @@ public class SessionConfig { private AutoModeSwitchHandler onAutoModeSwitch; private String gitHubToken; private String remoteSession; + private CloudSessionOptions cloud; /** * Gets the custom session ID. @@ -204,9 +209,9 @@ public SystemMessageConfig getSystemMessage() { * Sets the system message configuration. *

* The system message controls the behavior and personality of the assistant. - * Use {@link com.github.copilot.sdk.SystemMessageMode#APPEND} to add - * instructions while preserving default behavior, or - * {@link com.github.copilot.sdk.SystemMessageMode#REPLACE} to fully customize. + * Use {@link com.github.copilot.SystemMessageMode#APPEND} to add instructions + * while preserving default behavior, or + * {@link com.github.copilot.SystemMessageMode#REPLACE} to fully customize. * * @param systemMessage * the system message configuration @@ -295,7 +300,7 @@ public SessionConfig setProvider(ProviderConfig provider) { * {@code true}, telemetry is enabled for GitHub-authenticated sessions. When a * custom {@link ProviderConfig} (BYOK) is configured, session telemetry is * always disabled regardless of this setting. This is independent of - * {@link com.github.copilot.sdk.json.CopilotClientOptions#getTelemetry() + * {@link com.github.copilot.rpc.CopilotClientOptions#getTelemetry() * CopilotClientOptions.TelemetryConfig}, which configures OpenTelemetry export * for observability. * @@ -333,6 +338,175 @@ public SessionConfig clearEnableSessionTelemetry() { return this; } + /** + * Gets whether custom instruction file loading is suppressed. + * + * @return {@code true} to suppress, or empty if not explicitly set + * @since 1.3.0 + */ + @JsonIgnore + public Optional getSkipCustomInstructions() { + return Optional.ofNullable(skipCustomInstructions); + } + + /** + * Sets whether to suppress loading of custom instruction files (e.g. + * {@code .github/copilot-instructions.md}, {@code AGENTS.md}) from the working + * directory. + *

+ * This option is sent to the server via a {@code session.options.update} + * JSON-RPC call immediately after session creation. In + * {@link CopilotClientMode#EMPTY EMPTY} mode the default is {@code true} + * (skip); in {@link CopilotClientMode#COPILOT_CLI COPILOT_CLI} mode the value + * is forwarded only when explicitly set. + * + * @param skipCustomInstructions + * whether to skip custom instructions + * @return this config instance for method chaining + * @since 1.3.0 + */ + public SessionConfig setSkipCustomInstructions(boolean skipCustomInstructions) { + this.skipCustomInstructions = skipCustomInstructions; + return this; + } + + /** + * Clears the skipCustomInstructions setting. + * + * @return this instance for method chaining + * @since 1.3.0 + */ + public SessionConfig clearSkipCustomInstructions() { + this.skipCustomInstructions = null; + return this; + } + + /** + * Gets whether custom-agent discovery is restricted to local only. + * + * @return {@code true} for local only, or empty if not explicitly set + * @since 1.3.0 + */ + @JsonIgnore + public Optional getCustomAgentsLocalOnly() { + return Optional.ofNullable(customAgentsLocalOnly); + } + + /** + * Sets whether custom-agent discovery is restricted to the session's local + * working directory (no organisation-level discovery). + *

+ * This option is sent to the server via a {@code session.options.update} + * JSON-RPC call immediately after session creation. In + * {@link CopilotClientMode#EMPTY EMPTY} mode the default is {@code true} (local + * only); in {@link CopilotClientMode#COPILOT_CLI COPILOT_CLI} mode the value is + * forwarded only when explicitly set. + * + * @param customAgentsLocalOnly + * whether to restrict to local agents + * @return this config instance for method chaining + * @since 1.3.0 + */ + public SessionConfig setCustomAgentsLocalOnly(boolean customAgentsLocalOnly) { + this.customAgentsLocalOnly = customAgentsLocalOnly; + return this; + } + + /** + * Clears the customAgentsLocalOnly setting. + * + * @return this instance for method chaining + * @since 1.3.0 + */ + public SessionConfig clearCustomAgentsLocalOnly() { + this.customAgentsLocalOnly = null; + return this; + } + + /** + * Gets whether the runtime may append a Co-authored-by trailer. + * + * @return the coauthor enabled flag, or empty if not explicitly set + * @since 1.3.0 + */ + @JsonIgnore + public Optional getCoauthorEnabled() { + return Optional.ofNullable(coauthorEnabled); + } + + /** + * Sets whether the runtime is allowed to append a {@code Co-authored-by} + * trailer when it commits on behalf of the user. + *

+ * This option is sent to the server via a {@code session.options.update} + * JSON-RPC call immediately after session creation. In + * {@link CopilotClientMode#EMPTY EMPTY} mode the default is {@code false} + * (disabled); in {@link CopilotClientMode#COPILOT_CLI COPILOT_CLI} mode the + * value is forwarded only when explicitly set. + * + * @param coauthorEnabled + * whether coauthor is enabled + * @return this config instance for method chaining + * @since 1.3.0 + */ + public SessionConfig setCoauthorEnabled(boolean coauthorEnabled) { + this.coauthorEnabled = coauthorEnabled; + return this; + } + + /** + * Clears the coauthorEnabled setting. + * + * @return this instance for method chaining + * @since 1.3.0 + */ + public SessionConfig clearCoauthorEnabled() { + this.coauthorEnabled = null; + return this; + } + + /** + * Gets whether the manage_schedule tool is enabled. + * + * @return the manage schedule flag, or empty if not explicitly set + * @since 1.3.0 + */ + @JsonIgnore + public Optional getManageScheduleEnabled() { + return Optional.ofNullable(manageScheduleEnabled); + } + + /** + * Sets whether to enable the {@code manage_schedule} tool (host scheduler + * integration). + *

+ * This option is sent to the server via a {@code session.options.update} + * JSON-RPC call immediately after session creation. In + * {@link CopilotClientMode#EMPTY EMPTY} mode the default is {@code false} + * (disabled); in {@link CopilotClientMode#COPILOT_CLI COPILOT_CLI} mode the + * value is forwarded only when explicitly set. + * + * @param manageScheduleEnabled + * whether manage schedule is enabled + * @return this config instance for method chaining + * @since 1.3.0 + */ + public SessionConfig setManageScheduleEnabled(boolean manageScheduleEnabled) { + this.manageScheduleEnabled = manageScheduleEnabled; + return this; + } + + /** + * Clears the manageScheduleEnabled setting. + * + * @return this instance for method chaining + * @since 1.3.0 + */ + public SessionConfig clearManageScheduleEnabled() { + this.manageScheduleEnabled = null; + return this; + } + /** * Gets the permission request handler. * @@ -793,12 +967,12 @@ public Consumer getOnEvent() { * Sets an event handler that is registered on the session before the * {@code session.create} RPC is issued. *

- * Equivalent to calling - * {@link com.github.copilot.sdk.CopilotSession#on(Consumer)} immediately after - * creation, but executes earlier in the lifecycle so no events are missed. - * Using this property rather than {@code CopilotSession.on()} guarantees that - * early events emitted by the CLI during session creation (e.g. - * {@code session.start}) are delivered to the handler. + * Equivalent to calling {@link com.github.copilot.CopilotSession#on(Consumer)} + * immediately after creation, but executes earlier in the lifecycle so no + * events are missed. Using this property rather than + * {@code CopilotSession.on()} guarantees that early events emitted by the CLI + * during session creation (e.g. {@code session.start}) are delivered to the + * handler. * * @param onEvent * the event handler to register before session creation @@ -979,6 +1153,35 @@ public SessionConfig setRemoteSession(String remoteSession) { return this; } + /** + * Gets the cloud session options. + *

+ * When set, creates a remote session in the cloud instead of a local session. + * The optional repository is associated with the cloud session. + * + * @return the cloud session options, or {@code null} if not set + * @since 1.5.0 + */ + public CloudSessionOptions getCloud() { + return cloud; + } + + /** + * Sets the cloud session options. + *

+ * When set, creates a remote session in the cloud instead of a local session. + * The optional repository is associated with the cloud session. + * + * @param cloud + * the cloud session options + * @return this config instance for method chaining + * @since 1.5.0 + */ + public SessionConfig setCloud(CloudSessionOptions cloud) { + this.cloud = cloud; + return this; + } + /** * Creates a shallow clone of this {@code SessionConfig} instance. *

@@ -1003,6 +1206,10 @@ public SessionConfig clone() { copy.excludedTools = this.excludedTools != null ? new ArrayList<>(this.excludedTools) : null; copy.provider = this.provider; copy.enableSessionTelemetry = this.enableSessionTelemetry; + copy.skipCustomInstructions = this.skipCustomInstructions; + copy.customAgentsLocalOnly = this.customAgentsLocalOnly; + copy.coauthorEnabled = this.coauthorEnabled; + copy.manageScheduleEnabled = this.manageScheduleEnabled; copy.onPermissionRequest = this.onPermissionRequest; copy.onUserInputRequest = this.onUserInputRequest; copy.hooks = this.hooks; @@ -1029,6 +1236,7 @@ public SessionConfig clone() { copy.onAutoModeSwitch = this.onAutoModeSwitch; copy.gitHubToken = this.gitHubToken; copy.remoteSession = this.remoteSession; + copy.cloud = this.cloud; return copy; } } diff --git a/src/main/java/com/github/copilot/sdk/json/SessionContext.java b/src/main/java/com/github/copilot/rpc/SessionContext.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/SessionContext.java rename to src/main/java/com/github/copilot/rpc/SessionContext.java index fb6e16f8c6..1703082671 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionContext.java +++ b/src/main/java/com/github/copilot/rpc/SessionContext.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/SessionEndHandler.java b/src/main/java/com/github/copilot/rpc/SessionEndHandler.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/SessionEndHandler.java rename to src/main/java/com/github/copilot/rpc/SessionEndHandler.java index e8fc908df8..d7d6082618 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionEndHandler.java +++ b/src/main/java/com/github/copilot/rpc/SessionEndHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/SessionEndHookInput.java b/src/main/java/com/github/copilot/rpc/SessionEndHookInput.java similarity index 79% rename from src/main/java/com/github/copilot/sdk/json/SessionEndHookInput.java rename to src/main/java/com/github/copilot/rpc/SessionEndHookInput.java index 79f63fbb93..f29b698385 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionEndHookInput.java +++ b/src/main/java/com/github/copilot/rpc/SessionEndHookInput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,6 +13,8 @@ * This hook is invoked when a session ends, allowing you to perform cleanup or * logging. * + * @param sessionId + * the runtime session ID of the session that triggered the hook * @param timestamp * the timestamp in milliseconds since epoch when the session ended * @param cwd @@ -27,7 +29,8 @@ * @since 1.0.7 */ @JsonIgnoreProperties(ignoreUnknown = true) -public record SessionEndHookInput(@JsonProperty("timestamp") long timestamp, @JsonProperty("cwd") String cwd, +public record SessionEndHookInput(@JsonProperty("sessionId") String sessionId, + @JsonProperty("timestamp") long timestamp, @JsonProperty("cwd") String cwd, @JsonProperty("reason") String reason, @JsonProperty("finalMessage") String finalMessage, @JsonProperty("error") String error) { } diff --git a/src/main/java/com/github/copilot/sdk/json/SessionEndHookOutput.java b/src/main/java/com/github/copilot/rpc/SessionEndHookOutput.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/SessionEndHookOutput.java rename to src/main/java/com/github/copilot/rpc/SessionEndHookOutput.java index 23ebf958e0..068e85682a 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionEndHookOutput.java +++ b/src/main/java/com/github/copilot/rpc/SessionEndHookOutput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/SessionHooks.java b/src/main/java/com/github/copilot/rpc/SessionHooks.java similarity index 72% rename from src/main/java/com/github/copilot/sdk/json/SessionHooks.java rename to src/main/java/com/github/copilot/rpc/SessionHooks.java index 8e22c3ee88..f13e081316 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionHooks.java +++ b/src/main/java/com/github/copilot/rpc/SessionHooks.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Hook handlers configuration for a session. @@ -38,7 +38,9 @@ public class SessionHooks { private PreToolUseHandler onPreToolUse; + private PreMcpToolCallHandler onPreMcpToolCall; private PostToolUseHandler onPostToolUse; + private PostToolUseFailureHandler onPostToolUseFailure; private UserPromptSubmittedHandler onUserPromptSubmitted; private SessionStartHandler onSessionStart; private SessionEndHandler onSessionEnd; @@ -64,6 +66,30 @@ public SessionHooks setOnPreToolUse(PreToolUseHandler onPreToolUse) { return this; } + /** + * Gets the pre-MCP-tool-call handler. + * + * @return the handler, or {@code null} if not set + * @since 1.0.8 + */ + public PreMcpToolCallHandler getOnPreMcpToolCall() { + return onPreMcpToolCall; + } + + /** + * Sets the handler called before an MCP tool call is dispatched to an MCP + * server. + * + * @param onPreMcpToolCall + * the handler + * @return this instance for method chaining + * @since 1.0.8 + */ + public SessionHooks setOnPreMcpToolCall(PreMcpToolCallHandler onPreMcpToolCall) { + this.onPreMcpToolCall = onPreMcpToolCall; + return this; + } + /** * Gets the post-tool-use handler. * @@ -85,6 +111,32 @@ public SessionHooks setOnPostToolUse(PostToolUseHandler onPostToolUse) { return this; } + /** + * Gets the post-tool-use-failure handler. + * + * @return the handler, or {@code null} if not set + * @since 1.3.0 + */ + public PostToolUseFailureHandler getOnPostToolUseFailure() { + return onPostToolUseFailure; + } + + /** + * Sets the handler called after a tool execution whose result was a failure. + *

+ * {@link #getOnPostToolUse()} only fires for successful tool executions; + * register this handler in addition to observe failed tool calls. + * + * @param onPostToolUseFailure + * the handler + * @return this instance for method chaining + * @since 1.3.0 + */ + public SessionHooks setOnPostToolUseFailure(PostToolUseFailureHandler onPostToolUseFailure) { + this.onPostToolUseFailure = onPostToolUseFailure; + return this; + } + /** * Gets the user-prompt-submitted handler. * @@ -160,7 +212,7 @@ public SessionHooks setOnSessionEnd(SessionEndHandler onSessionEnd) { * @return {@code true} if at least one hook handler is set */ public boolean hasHooks() { - return onPreToolUse != null || onPostToolUse != null || onUserPromptSubmitted != null || onSessionStart != null - || onSessionEnd != null; + return onPreToolUse != null || onPreMcpToolCall != null || onPostToolUse != null || onPostToolUseFailure != null + || onUserPromptSubmitted != null || onSessionStart != null || onSessionEnd != null; } } diff --git a/src/main/java/com/github/copilot/sdk/json/SessionLifecycleEvent.java b/src/main/java/com/github/copilot/rpc/SessionLifecycleEvent.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/SessionLifecycleEvent.java rename to src/main/java/com/github/copilot/rpc/SessionLifecycleEvent.java index 59d1e252fa..55857a74a8 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionLifecycleEvent.java +++ b/src/main/java/com/github/copilot/rpc/SessionLifecycleEvent.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/SessionLifecycleEventMetadata.java b/src/main/java/com/github/copilot/rpc/SessionLifecycleEventMetadata.java similarity index 94% rename from src/main/java/com/github/copilot/sdk/json/SessionLifecycleEventMetadata.java rename to src/main/java/com/github/copilot/rpc/SessionLifecycleEventMetadata.java index 7c76c07aae..bf384a7ce7 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionLifecycleEventMetadata.java +++ b/src/main/java/com/github/copilot/rpc/SessionLifecycleEventMetadata.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/SessionLifecycleEventTypes.java b/src/main/java/com/github/copilot/rpc/SessionLifecycleEventTypes.java similarity index 90% rename from src/main/java/com/github/copilot/sdk/json/SessionLifecycleEventTypes.java rename to src/main/java/com/github/copilot/rpc/SessionLifecycleEventTypes.java index b3eb35598b..109c85b940 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionLifecycleEventTypes.java +++ b/src/main/java/com/github/copilot/rpc/SessionLifecycleEventTypes.java @@ -2,13 +2,13 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Types of session lifecycle events. *

* Constants for session lifecycle event types used with - * {@link com.github.copilot.sdk.CopilotClient#onLifecycle(String, SessionLifecycleHandler)}. + * {@link com.github.copilot.CopilotClient#onLifecycle(String, SessionLifecycleHandler)}. * * @since 1.0.0 */ diff --git a/src/main/java/com/github/copilot/sdk/json/SessionLifecycleHandler.java b/src/main/java/com/github/copilot/rpc/SessionLifecycleHandler.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/SessionLifecycleHandler.java rename to src/main/java/com/github/copilot/rpc/SessionLifecycleHandler.java index 11937ee643..755f2aa4ea 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionLifecycleHandler.java +++ b/src/main/java/com/github/copilot/rpc/SessionLifecycleHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Handler for session lifecycle events. diff --git a/src/main/java/com/github/copilot/sdk/json/SessionListFilter.java b/src/main/java/com/github/copilot/rpc/SessionListFilter.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/SessionListFilter.java rename to src/main/java/com/github/copilot/rpc/SessionListFilter.java index f62f7674f1..d6c4548525 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionListFilter.java +++ b/src/main/java/com/github/copilot/rpc/SessionListFilter.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Filter options for listing sessions. @@ -22,7 +22,7 @@ * var sessions = client.listSessions(filter).get(); * } * - * @see com.github.copilot.sdk.CopilotClient#listSessions(SessionListFilter) + * @see com.github.copilot.CopilotClient#listSessions(SessionListFilter) * @since 1.0.0 */ public class SessionListFilter extends SessionContext { diff --git a/src/main/java/com/github/copilot/sdk/json/SessionMetadata.java b/src/main/java/com/github/copilot/rpc/SessionMetadata.java similarity index 94% rename from src/main/java/com/github/copilot/sdk/json/SessionMetadata.java rename to src/main/java/com/github/copilot/rpc/SessionMetadata.java index cb2690d199..90207b9c7c 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionMetadata.java +++ b/src/main/java/com/github/copilot/rpc/SessionMetadata.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -11,7 +11,7 @@ * Metadata about an existing Copilot session. *

* This class represents session information returned when listing available - * sessions via {@link com.github.copilot.sdk.CopilotClient#listSessions()}. It + * sessions via {@link com.github.copilot.CopilotClient#listSessions()}. It * includes timing information, a summary of the conversation, and whether the * session is stored remotely. * @@ -26,8 +26,8 @@ * } * } * - * @see com.github.copilot.sdk.CopilotClient#listSessions() - * @see com.github.copilot.sdk.CopilotClient#resumeSession(String, + * @see com.github.copilot.CopilotClient#listSessions() + * @see com.github.copilot.CopilotClient#resumeSession(String, * ResumeSessionConfig) * @since 1.0.0 */ diff --git a/src/main/java/com/github/copilot/sdk/json/SessionStartHandler.java b/src/main/java/com/github/copilot/rpc/SessionStartHandler.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/SessionStartHandler.java rename to src/main/java/com/github/copilot/rpc/SessionStartHandler.java index fd631cb7f1..3c65a6944a 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionStartHandler.java +++ b/src/main/java/com/github/copilot/rpc/SessionStartHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/SessionStartHookInput.java b/src/main/java/com/github/copilot/rpc/SessionStartHookInput.java similarity index 77% rename from src/main/java/com/github/copilot/sdk/json/SessionStartHookInput.java rename to src/main/java/com/github/copilot/rpc/SessionStartHookInput.java index 2047175572..d6e5b37596 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionStartHookInput.java +++ b/src/main/java/com/github/copilot/rpc/SessionStartHookInput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,6 +13,8 @@ * This hook is invoked when a session starts, allowing you to perform * initialization or modify the session configuration. * + * @param sessionId + * the runtime session ID of the session that triggered the hook * @param timestamp * the timestamp in milliseconds since epoch when the session started * @param cwd @@ -24,6 +26,7 @@ * @since 1.0.7 */ @JsonIgnoreProperties(ignoreUnknown = true) -public record SessionStartHookInput(@JsonProperty("timestamp") long timestamp, @JsonProperty("cwd") String cwd, +public record SessionStartHookInput(@JsonProperty("sessionId") String sessionId, + @JsonProperty("timestamp") long timestamp, @JsonProperty("cwd") String cwd, @JsonProperty("source") String source, @JsonProperty("initialPrompt") String initialPrompt) { } diff --git a/src/main/java/com/github/copilot/sdk/json/SessionStartHookOutput.java b/src/main/java/com/github/copilot/rpc/SessionStartHookOutput.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/SessionStartHookOutput.java rename to src/main/java/com/github/copilot/rpc/SessionStartHookOutput.java index 3ef5971c43..2650a5efa1 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionStartHookOutput.java +++ b/src/main/java/com/github/copilot/rpc/SessionStartHookOutput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Map; diff --git a/src/main/java/com/github/copilot/sdk/json/SessionUiApi.java b/src/main/java/com/github/copilot/rpc/SessionUiApi.java similarity index 94% rename from src/main/java/com/github/copilot/sdk/json/SessionUiApi.java rename to src/main/java/com/github/copilot/rpc/SessionUiApi.java index f0a43f2610..1cf32e4680 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionUiApi.java +++ b/src/main/java/com/github/copilot/rpc/SessionUiApi.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; @@ -11,7 +11,7 @@ *

* All methods on this interface throw {@link IllegalStateException} if the host * does not report elicitation support via - * {@link com.github.copilot.sdk.CopilotSession#getCapabilities()}. Check + * {@link com.github.copilot.CopilotSession#getCapabilities()}. Check * {@code session.getCapabilities().getUi() != null && * Boolean.TRUE.equals(session.getCapabilities().getUi().getElicitation())} * before calling. @@ -25,7 +25,7 @@ * } * } * - * @see com.github.copilot.sdk.CopilotSession#getUi() + * @see com.github.copilot.CopilotSession#getUi() * @since 1.0.0 */ public interface SessionUiApi { diff --git a/src/main/java/com/github/copilot/sdk/json/SessionUiCapabilities.java b/src/main/java/com/github/copilot/rpc/SessionUiCapabilities.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/SessionUiCapabilities.java rename to src/main/java/com/github/copilot/rpc/SessionUiCapabilities.java index d19d531eef..015220d0c1 100644 --- a/src/main/java/com/github/copilot/sdk/json/SessionUiCapabilities.java +++ b/src/main/java/com/github/copilot/rpc/SessionUiCapabilities.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Optional; diff --git a/src/main/java/com/github/copilot/sdk/json/SetForegroundSessionRequest.java b/src/main/java/com/github/copilot/rpc/SetForegroundSessionRequest.java similarity index 94% rename from src/main/java/com/github/copilot/sdk/json/SetForegroundSessionRequest.java rename to src/main/java/com/github/copilot/rpc/SetForegroundSessionRequest.java index d3944871a0..faa35406b5 100644 --- a/src/main/java/com/github/copilot/sdk/json/SetForegroundSessionRequest.java +++ b/src/main/java/com/github/copilot/rpc/SetForegroundSessionRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/SetForegroundSessionResponse.java b/src/main/java/com/github/copilot/rpc/SetForegroundSessionResponse.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/SetForegroundSessionResponse.java rename to src/main/java/com/github/copilot/rpc/SetForegroundSessionResponse.java index c4680c95dd..43bc907359 100644 --- a/src/main/java/com/github/copilot/sdk/json/SetForegroundSessionResponse.java +++ b/src/main/java/com/github/copilot/rpc/SetForegroundSessionResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/SystemMessageConfig.java b/src/main/java/com/github/copilot/rpc/SystemMessageConfig.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/SystemMessageConfig.java rename to src/main/java/com/github/copilot/rpc/SystemMessageConfig.java index 94af117ea5..973168f4d4 100644 --- a/src/main/java/com/github/copilot/sdk/json/SystemMessageConfig.java +++ b/src/main/java/com/github/copilot/rpc/SystemMessageConfig.java @@ -2,12 +2,12 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Map; import com.fasterxml.jackson.annotation.JsonInclude; -import com.github.copilot.sdk.SystemMessageMode; +import com.github.copilot.SystemMessageMode; /** * Configuration for customizing the system message. diff --git a/src/main/java/com/github/copilot/sdk/json/SystemPromptSections.java b/src/main/java/com/github/copilot/rpc/SystemPromptSections.java similarity index 88% rename from src/main/java/com/github/copilot/sdk/json/SystemPromptSections.java rename to src/main/java/com/github/copilot/rpc/SystemPromptSections.java index fa512d032b..0aaf0113e6 100644 --- a/src/main/java/com/github/copilot/sdk/json/SystemPromptSections.java +++ b/src/main/java/com/github/copilot/rpc/SystemPromptSections.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Well-known system prompt section identifiers for use with @@ -54,6 +54,15 @@ public final class SystemPromptSections { /** Repository and organization custom instructions. */ public static final String CUSTOM_INSTRUCTIONS = "custom_instructions"; + /** + * Runtime-provided context and instructions (e.g. system notifications, + * memories, workspace context, mode-specific instructions, content-exclusion + * policy). + * + * @since 1.3.0 + */ + public static final String RUNTIME_INSTRUCTIONS = "runtime_instructions"; + /** * End-of-prompt instructions: parallel tool calling, persistence, task * completion. diff --git a/src/main/java/com/github/copilot/sdk/json/TelemetryConfig.java b/src/main/java/com/github/copilot/rpc/TelemetryConfig.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/TelemetryConfig.java rename to src/main/java/com/github/copilot/rpc/TelemetryConfig.java index 7272c98841..c0b75f29d6 100644 --- a/src/main/java/com/github/copilot/sdk/json/TelemetryConfig.java +++ b/src/main/java/com/github/copilot/rpc/TelemetryConfig.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Optional; diff --git a/src/main/java/com/github/copilot/sdk/json/ToolBinaryResult.java b/src/main/java/com/github/copilot/rpc/ToolBinaryResult.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/ToolBinaryResult.java rename to src/main/java/com/github/copilot/rpc/ToolBinaryResult.java index e00fce9cf6..f89b6a55f7 100644 --- a/src/main/java/com/github/copilot/sdk/json/ToolBinaryResult.java +++ b/src/main/java/com/github/copilot/rpc/ToolBinaryResult.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/ToolDefinition.java b/src/main/java/com/github/copilot/rpc/ToolDefinition.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/ToolDefinition.java rename to src/main/java/com/github/copilot/rpc/ToolDefinition.java index ba33ce1e35..c880e5a77a 100644 --- a/src/main/java/com/github/copilot/sdk/json/ToolDefinition.java +++ b/src/main/java/com/github/copilot/rpc/ToolDefinition.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Map; diff --git a/src/main/java/com/github/copilot/sdk/json/ToolHandler.java b/src/main/java/com/github/copilot/rpc/ToolHandler.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/ToolHandler.java rename to src/main/java/com/github/copilot/rpc/ToolHandler.java index e3e421b65f..15e52512e3 100644 --- a/src/main/java/com/github/copilot/sdk/json/ToolHandler.java +++ b/src/main/java/com/github/copilot/rpc/ToolHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/ToolInvocation.java b/src/main/java/com/github/copilot/rpc/ToolInvocation.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/ToolInvocation.java rename to src/main/java/com/github/copilot/rpc/ToolInvocation.java index e5febba6ff..dddfdd06f0 100644 --- a/src/main/java/com/github/copilot/sdk/json/ToolInvocation.java +++ b/src/main/java/com/github/copilot/rpc/ToolInvocation.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Map; diff --git a/src/main/java/com/github/copilot/sdk/json/ToolResultObject.java b/src/main/java/com/github/copilot/rpc/ToolResultObject.java similarity index 99% rename from src/main/java/com/github/copilot/sdk/json/ToolResultObject.java rename to src/main/java/com/github/copilot/rpc/ToolResultObject.java index dcb5ad78f1..e55ff9ab6e 100644 --- a/src/main/java/com/github/copilot/sdk/json/ToolResultObject.java +++ b/src/main/java/com/github/copilot/rpc/ToolResultObject.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.List; import java.util.Map; diff --git a/src/main/java/com/github/copilot/rpc/ToolSet.java b/src/main/java/com/github/copilot/rpc/ToolSet.java new file mode 100644 index 0000000000..5009223a16 --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/ToolSet.java @@ -0,0 +1,122 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot.rpc; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Objects; +import java.util.regex.Pattern; + +/** + * Builder for {@link SessionConfig#setAvailableTools(java.util.List)} / + * {@link SessionConfig#setExcludedTools(java.util.List)} using source-qualified + * filter patterns ({@code builtin:*}, {@code mcp:}, {@code custom:*}, + * etc.). + *

+ * Tools are classified by the runtime at registration time (not from name + * parsing), so {@link #addBuiltIn(String)} matches only tools the runtime + * registered as built-in, even if an MCP server or custom-agent extension + * happens to register a tool with the same wire name. + *

+ * {@code ToolSet} extends {@link ArrayList} so instances can be passed directly + * to {@link SessionConfig#setAvailableTools(java.util.List)} or + * {@link SessionConfig#setExcludedTools(java.util.List)}. + * + *

Example

+ * + *
{@code
+ * var session = client
+ * 		.createSession(new SessionConfig()
+ * 				.setAvailableTools(new ToolSet().addBuiltIn(BuiltInTools.ISOLATED).addMcp("*").addCustom("*")))
+ * 		.get();
+ * }
+ * + * @since 1.3.0 + */ +public class ToolSet extends ArrayList { + + private static final Pattern VALID_TOOL_NAME = Pattern.compile("^[a-zA-Z0-9_-]+$"); + + /** + * Adds a built-in tool pattern. + * + * @param name + * a specific built-in tool name (e.g. {@code "bash"}) or {@code "*"} + * to match all built-in tools + * @return this {@code ToolSet} for chaining + * @throws IllegalArgumentException + * if name is null, empty, or contains invalid characters + */ + public ToolSet addBuiltIn(String name) { + validateName("builtin", name); + add("builtin:" + name); + return this; + } + + /** + * Adds a list of built-in tool patterns (e.g. {@link BuiltInTools#ISOLATED}). + * + * @param names + * built-in tool names to add + * @return this {@code ToolSet} for chaining + * @throws NullPointerException + * if names is null + */ + public ToolSet addBuiltIn(Collection names) { + Objects.requireNonNull(names, "names must not be null"); + for (String name : names) { + addBuiltIn(name); + } + return this; + } + + /** + * Adds a custom tool pattern. Matches tools registered via the SDK's + * {@link SessionConfig#setTools(java.util.List)} option or via custom agents. + * + * @param name + * a specific custom tool name or {@code "*"} to match all custom + * tools + * @return this {@code ToolSet} for chaining + * @throws IllegalArgumentException + * if name is null, empty, or contains invalid characters + */ + public ToolSet addCustom(String name) { + validateName("custom", name); + add("custom:" + name); + return this; + } + + /** + * Adds an MCP tool pattern. Matches tools advertised by any configured MCP + * server. + * + * @param toolName + * the runtime's canonical wire name for the MCP tool (e.g. + * {@code "github-list_issues"}), or {@code "*"} to match all MCP + * tools from any server + * @return this {@code ToolSet} for chaining + * @throws IllegalArgumentException + * if toolName is null, empty, or contains invalid characters + */ + public ToolSet addMcp(String toolName) { + validateName("mcp", toolName); + add("mcp:" + toolName); + return this; + } + + private static void validateName(String kind, String name) { + if (name == null || name.isEmpty()) { + throw new IllegalArgumentException("Invalid " + kind + " tool name: must not be null or empty."); + } + if ("*".equals(name)) { + return; + } + if (!VALID_TOOL_NAME.matcher(name).matches()) { + throw new IllegalArgumentException("Invalid " + kind + " tool name '" + name + + "': tool names must match /^[a-zA-Z0-9_-]+$/ or be the wildcard '*'."); + } + } +} diff --git a/src/main/java/com/github/copilot/sdk/json/UserInputHandler.java b/src/main/java/com/github/copilot/rpc/UserInputHandler.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/UserInputHandler.java rename to src/main/java/com/github/copilot/rpc/UserInputHandler.java index e5d1710989..7595bc5b97 100644 --- a/src/main/java/com/github/copilot/sdk/json/UserInputHandler.java +++ b/src/main/java/com/github/copilot/rpc/UserInputHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/UserInputInvocation.java b/src/main/java/com/github/copilot/rpc/UserInputInvocation.java similarity index 95% rename from src/main/java/com/github/copilot/sdk/json/UserInputInvocation.java rename to src/main/java/com/github/copilot/rpc/UserInputInvocation.java index 3232b0c344..3eed480ca3 100644 --- a/src/main/java/com/github/copilot/sdk/json/UserInputInvocation.java +++ b/src/main/java/com/github/copilot/rpc/UserInputInvocation.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; /** * Context for a user input request invocation. diff --git a/src/main/java/com/github/copilot/sdk/json/UserInputRequest.java b/src/main/java/com/github/copilot/rpc/UserInputRequest.java similarity index 98% rename from src/main/java/com/github/copilot/sdk/json/UserInputRequest.java rename to src/main/java/com/github/copilot/rpc/UserInputRequest.java index 23b0d88123..8e3551c5ac 100644 --- a/src/main/java/com/github/copilot/sdk/json/UserInputRequest.java +++ b/src/main/java/com/github/copilot/rpc/UserInputRequest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.Collections; import java.util.List; diff --git a/src/main/java/com/github/copilot/sdk/json/UserInputResponse.java b/src/main/java/com/github/copilot/rpc/UserInputResponse.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/UserInputResponse.java rename to src/main/java/com/github/copilot/rpc/UserInputResponse.java index 4cfaa13f02..c9e0133c74 100644 --- a/src/main/java/com/github/copilot/sdk/json/UserInputResponse.java +++ b/src/main/java/com/github/copilot/rpc/UserInputResponse.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHandler.java b/src/main/java/com/github/copilot/rpc/UserPromptSubmittedHandler.java similarity index 97% rename from src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHandler.java rename to src/main/java/com/github/copilot/rpc/UserPromptSubmittedHandler.java index 0dc59762be..e0953ed7f7 100644 --- a/src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHandler.java +++ b/src/main/java/com/github/copilot/rpc/UserPromptSubmittedHandler.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHookInput.java b/src/main/java/com/github/copilot/rpc/UserPromptSubmittedHookInput.java similarity index 75% rename from src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHookInput.java rename to src/main/java/com/github/copilot/rpc/UserPromptSubmittedHookInput.java index bbfdf85bb3..8b37df6773 100644 --- a/src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHookInput.java +++ b/src/main/java/com/github/copilot/rpc/UserPromptSubmittedHookInput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -13,6 +13,8 @@ * This hook is invoked when the user submits a prompt, allowing you to * intercept and modify the prompt before it is processed. * + * @param sessionId + * the runtime session ID of the session that triggered the hook * @param timestamp * the timestamp in milliseconds since epoch when the prompt was * submitted @@ -23,6 +25,7 @@ * @since 1.0.7 */ @JsonIgnoreProperties(ignoreUnknown = true) -public record UserPromptSubmittedHookInput(@JsonProperty("timestamp") long timestamp, @JsonProperty("cwd") String cwd, +public record UserPromptSubmittedHookInput(@JsonProperty("sessionId") String sessionId, + @JsonProperty("timestamp") long timestamp, @JsonProperty("cwd") String cwd, @JsonProperty("prompt") String prompt) { } diff --git a/src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHookOutput.java b/src/main/java/com/github/copilot/rpc/UserPromptSubmittedHookOutput.java similarity index 96% rename from src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHookOutput.java rename to src/main/java/com/github/copilot/rpc/UserPromptSubmittedHookOutput.java index d5b345556d..ac37f2bd98 100644 --- a/src/main/java/com/github/copilot/sdk/json/UserPromptSubmittedHookOutput.java +++ b/src/main/java/com/github/copilot/rpc/UserPromptSubmittedHookOutput.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.json; +package com.github.copilot.rpc; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/github/copilot/rpc/package-info.java b/src/main/java/com/github/copilot/rpc/package-info.java new file mode 100644 index 0000000000..edc7dedcfc --- /dev/null +++ b/src/main/java/com/github/copilot/rpc/package-info.java @@ -0,0 +1,95 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +/** + * Configuration classes and data transfer objects for the Copilot SDK. + * + *

+ * This package contains all the configuration, request, response, and data + * transfer objects used throughout the SDK. These classes are designed for JSON + * serialization with Jackson and provide fluent setter methods for convenient + * configuration. + * + *

Client Configuration

+ *
    + *
  • {@link com.github.copilot.rpc.CopilotClientOptions} - Options for + * configuring the {@link com.github.copilot.CopilotClient}, including CLI path, + * port, transport mode, and auto-start behavior.
  • + *
+ * + *

Session Configuration

+ *
    + *
  • {@link com.github.copilot.rpc.SessionConfig} - Configuration for creating + * a new session, including model selection, tools, system message, and MCP + * server configuration.
  • + *
  • {@link com.github.copilot.rpc.ResumeSessionConfig} - Configuration for + * resuming an existing session.
  • + *
  • {@link com.github.copilot.rpc.InfiniteSessionConfig} - Configuration for + * infinite sessions with automatic context compaction.
  • + *
  • {@link com.github.copilot.rpc.SystemMessageConfig} - System message + * customization options.
  • + *
+ * + *

Message and Tool Configuration

+ *
    + *
  • {@link com.github.copilot.rpc.MessageOptions} - Options for sending + * messages, including prompt text and attachments.
  • + *
  • {@link com.github.copilot.rpc.ToolDefinition} - Definition of a custom + * tool that can be invoked by the assistant.
  • + *
  • {@link com.github.copilot.rpc.ToolInvocation} - Represents a tool + * invocation request from the assistant.
  • + *
  • {@link com.github.copilot.rpc.Attachment} - File attachment for + * messages.
  • + *
+ * + *

Provider Configuration (BYOK)

+ *
    + *
  • {@link com.github.copilot.rpc.ProviderConfig} - Configuration for using + * your own API keys with custom providers (OpenAI, Azure, etc.).
  • + *
  • {@link com.github.copilot.rpc.AzureOptions} - Azure-specific + * configuration options.
  • + *
+ * + *

Model Information

+ *
    + *
  • {@link com.github.copilot.rpc.ModelInfo} - Information about an available + * AI model.
  • + *
  • {@link com.github.copilot.rpc.ModelCapabilities} - Model capabilities and + * limits.
  • + *
  • {@link com.github.copilot.rpc.ModelPolicy} - Model policy and state + * information.
  • + *
+ * + *

Custom Agents

+ *
    + *
  • {@link com.github.copilot.rpc.CustomAgentConfig} - Configuration for + * custom agents with specialized behaviors and tools.
  • + *
+ * + *

Permissions

+ *
    + *
  • {@link com.github.copilot.rpc.PermissionHandler} - Handler for permission + * requests from the assistant.
  • + *
  • {@link com.github.copilot.rpc.PermissionRequest} - A permission request + * from the assistant.
  • + *
  • {@link com.github.copilot.rpc.PermissionRequestResult} - Result of a + * permission request decision.
  • + *
+ * + *

Usage Example

+ * + *
{@code
+ * var config = new SessionConfig().setModel("gpt-4.1").setStreaming(true)
+ * 		.setSystemMessage(new SystemMessageConfig().setMode(SystemMessageMode.APPEND)
+ * 				.setContent("Be concise in your responses."))
+ * 		.setTools(List.of(ToolDefinition.create("my_tool", "Description", schema, handler)));
+ *
+ * var session = client.createSession(config).get();
+ * }
+ * + * @see com.github.copilot.CopilotClient + * @see com.github.copilot.CopilotSession + */ +@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "DTOs for JSON deserialization - low risk") +package com.github.copilot.rpc; diff --git a/src/main/java/com/github/copilot/sdk/json/package-info.java b/src/main/java/com/github/copilot/sdk/json/package-info.java deleted file mode 100644 index aabf620691..0000000000 --- a/src/main/java/com/github/copilot/sdk/json/package-info.java +++ /dev/null @@ -1,95 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------------------------------------------*/ - -/** - * Configuration classes and data transfer objects for the Copilot SDK. - * - *

- * This package contains all the configuration, request, response, and data - * transfer objects used throughout the SDK. These classes are designed for JSON - * serialization with Jackson and provide fluent setter methods for convenient - * configuration. - * - *

Client Configuration

- *
    - *
  • {@link com.github.copilot.sdk.json.CopilotClientOptions} - Options for - * configuring the {@link com.github.copilot.sdk.CopilotClient}, including CLI - * path, port, transport mode, and auto-start behavior.
  • - *
- * - *

Session Configuration

- *
    - *
  • {@link com.github.copilot.sdk.json.SessionConfig} - Configuration for - * creating a new session, including model selection, tools, system message, and - * MCP server configuration.
  • - *
  • {@link com.github.copilot.sdk.json.ResumeSessionConfig} - Configuration - * for resuming an existing session.
  • - *
  • {@link com.github.copilot.sdk.json.InfiniteSessionConfig} - Configuration - * for infinite sessions with automatic context compaction.
  • - *
  • {@link com.github.copilot.sdk.json.SystemMessageConfig} - System message - * customization options.
  • - *
- * - *

Message and Tool Configuration

- *
    - *
  • {@link com.github.copilot.sdk.json.MessageOptions} - Options for sending - * messages, including prompt text and attachments.
  • - *
  • {@link com.github.copilot.sdk.json.ToolDefinition} - Definition of a - * custom tool that can be invoked by the assistant.
  • - *
  • {@link com.github.copilot.sdk.json.ToolInvocation} - Represents a tool - * invocation request from the assistant.
  • - *
  • {@link com.github.copilot.sdk.json.Attachment} - File attachment for - * messages.
  • - *
- * - *

Provider Configuration (BYOK)

- *
    - *
  • {@link com.github.copilot.sdk.json.ProviderConfig} - Configuration for - * using your own API keys with custom providers (OpenAI, Azure, etc.).
  • - *
  • {@link com.github.copilot.sdk.json.AzureOptions} - Azure-specific - * configuration options.
  • - *
- * - *

Model Information

- *
    - *
  • {@link com.github.copilot.sdk.json.ModelInfo} - Information about an - * available AI model.
  • - *
  • {@link com.github.copilot.sdk.json.ModelCapabilities} - Model - * capabilities and limits.
  • - *
  • {@link com.github.copilot.sdk.json.ModelPolicy} - Model policy and state - * information.
  • - *
- * - *

Custom Agents

- *
    - *
  • {@link com.github.copilot.sdk.json.CustomAgentConfig} - Configuration for - * custom agents with specialized behaviors and tools.
  • - *
- * - *

Permissions

- *
    - *
  • {@link com.github.copilot.sdk.json.PermissionHandler} - Handler for - * permission requests from the assistant.
  • - *
  • {@link com.github.copilot.sdk.json.PermissionRequest} - A permission - * request from the assistant.
  • - *
  • {@link com.github.copilot.sdk.json.PermissionRequestResult} - Result of a - * permission request decision.
  • - *
- * - *

Usage Example

- * - *
{@code
- * var config = new SessionConfig().setModel("gpt-4.1").setStreaming(true)
- * 		.setSystemMessage(new SystemMessageConfig().setMode(SystemMessageMode.APPEND)
- * 				.setContent("Be concise in your responses."))
- * 		.setTools(List.of(ToolDefinition.create("my_tool", "Description", schema, handler)));
- *
- * var session = client.createSession(config).get();
- * }
- * - * @see com.github.copilot.sdk.CopilotClient - * @see com.github.copilot.sdk.CopilotSession - */ -@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "DTOs for JSON deserialization - low risk") -package com.github.copilot.sdk.json; diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index d912fb420f..01b7416949 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -5,7 +5,7 @@ /** * GitHub Copilot SDK for Java. */ -module com.github.copilot.sdk.java { +module com.github.copilot.java { requires transitive com.fasterxml.jackson.annotation; requires com.fasterxml.jackson.core; requires transitive com.fasterxml.jackson.databind; @@ -15,12 +15,12 @@ requires static java.net.http; requires java.logging; - exports com.github.copilot.sdk; - exports com.github.copilot.sdk.generated; - exports com.github.copilot.sdk.generated.rpc; - exports com.github.copilot.sdk.json; + exports com.github.copilot; + exports com.github.copilot.generated; + exports com.github.copilot.generated.rpc; + exports com.github.copilot.rpc; - opens com.github.copilot.sdk to com.fasterxml.jackson.databind; - opens com.github.copilot.sdk.generated to com.fasterxml.jackson.databind; - opens com.github.copilot.sdk.json to com.fasterxml.jackson.databind; + opens com.github.copilot to com.fasterxml.jackson.databind; + opens com.github.copilot.generated to com.fasterxml.jackson.databind; + opens com.github.copilot.rpc to com.fasterxml.jackson.databind; } diff --git a/src/site/markdown/advanced.md b/src/site/markdown/advanced.md index 9b5d00c5ac..5a2cafda37 100644 --- a/src/site/markdown/advanced.md +++ b/src/site/markdown/advanced.md @@ -90,7 +90,7 @@ var session = client.createSession( ).get(); ``` -See [ToolDefinition](apidocs/com/github/copilot/sdk/json/ToolDefinition.html) Javadoc for schema details. +See [ToolDefinition](apidocs/com/github/copilot/rpc/ToolDefinition.html) Javadoc for schema details. ### Overriding Built-in Tools @@ -149,7 +149,7 @@ var safeLookup = ToolDefinition.createSkipPermission( The CLI bypasses the permission request for this tool invocation, so no `PermissionRequestedEvent` is emitted and the `onPermissionRequest` handler is not called. -See [ToolDefinition](apidocs/com/github/copilot/sdk/json/ToolDefinition.html) Javadoc for details. +See [ToolDefinition](apidocs/com/github/copilot/rpc/ToolDefinition.html) Javadoc for details. --- @@ -177,10 +177,10 @@ session.sendAndWait(new MessageOptions().setPrompt("Continue with the new model" The `reasoningEffort` parameter accepts `"low"`, `"medium"`, `"high"`, or `"xhigh"` for models that support reasoning. Pass `null` (or use the single-argument overload) to use the default. -The session emits a [`SessionModelChangeEvent`](apidocs/com/github/copilot/sdk/generated/SessionModelChangeEvent.html) +The session emits a [`SessionModelChangeEvent`](apidocs/com/github/copilot/generated/SessionModelChangeEvent.html) when the switch completes, which you can observe with `session.on(SessionModelChangeEvent.class, event -> ...)`. -See [CopilotSession.setModel()](apidocs/com/github/copilot/sdk/CopilotSession.html#setModel(java.lang.String)) Javadoc for details. +See [CopilotSession.setModel()](apidocs/com/github/copilot/CopilotSession.html#setModel(java.lang.String)) Javadoc for details. --- @@ -265,9 +265,9 @@ var session = client.createSession( ).get(); ``` -See [SystemMessageConfig](apidocs/com/github/copilot/sdk/json/SystemMessageConfig.html), -[SectionOverride](apidocs/com/github/copilot/sdk/json/SectionOverride.html), and -[SystemPromptSections](apidocs/com/github/copilot/sdk/json/SystemPromptSections.html) Javadoc for details. +See [SystemMessageConfig](apidocs/com/github/copilot/rpc/SystemMessageConfig.html), +[SectionOverride](apidocs/com/github/copilot/rpc/SectionOverride.html), and +[SystemPromptSections](apidocs/com/github/copilot/rpc/SystemPromptSections.html) Javadoc for details. --- @@ -323,7 +323,7 @@ session.send(new MessageOptions() ).get(); ``` -See [BlobAttachment](apidocs/com/github/copilot/sdk/json/BlobAttachment.html) Javadoc for details. +See [BlobAttachment](apidocs/com/github/copilot/rpc/BlobAttachment.html) Javadoc for details. Both `Attachment` and `BlobAttachment` implement the sealed `MessageAttachment` interface. For a mixed list with both types, use an explicit type hint: @@ -565,6 +565,8 @@ session.send("@code-reviewer Review src/Main.java").get(); | `tools` | List<String> | Tool names available to this agent | | `mcpServers` | Map | MCP servers available to this agent | | `infer` | Boolean | Whether the agent can be auto-selected based on context | +| `skills` | List<String> | Skill names to preload into the agent's context | +| `model` | String | Model identifier for this agent (e.g., "claude-haiku-4.5"); falls back to the parent session model if unavailable | ### Multiple Agents @@ -588,7 +590,7 @@ var session = client.createSession( ).get(); ``` -See [CustomAgentConfig](apidocs/com/github/copilot/sdk/json/CustomAgentConfig.html) Javadoc for full details. +See [CustomAgentConfig](apidocs/com/github/copilot/rpc/CustomAgentConfig.html) Javadoc for full details. ### Programmatic Agent Selection @@ -715,7 +717,7 @@ Use cases: - Sending status updates to the session log - Debugging session behavior with contextual messages -See [CopilotSession.log()](apidocs/com/github/copilot/sdk/CopilotSession.html#log(java.lang.String)) Javadoc for details. +See [CopilotSession.log()](apidocs/com/github/copilot/CopilotSession.html#log(java.lang.String)) Javadoc for details. --- @@ -781,7 +783,7 @@ The `UserInputResponse` should include: - `setAnswer(String)` - The user's answer - `setWasFreeform(boolean)` - `true` if the answer was freeform text, `false` if it was from the provided choices -See [UserInputHandler](apidocs/com/github/copilot/sdk/json/UserInputHandler.html) Javadoc for more details. +See [UserInputHandler](apidocs/com/github/copilot/rpc/UserInputHandler.html) Javadoc for more details. --- @@ -810,7 +812,7 @@ The `PermissionRequestResultKind` class provides well-known constants for common | `PermissionRequestResultKind.NO_RESULT` | `"no-result"` | No permission decision was made (protocol v3 only) | You can also pass a raw string to `setKind(String)` for custom or extension values. Use -[`PermissionHandler.APPROVE_ALL`](apidocs/com/github/copilot/sdk/json/PermissionHandler.html) to approve all +[`PermissionHandler.APPROVE_ALL`](apidocs/com/github/copilot/rpc/PermissionHandler.html) to approve all requests without writing a handler. --- @@ -825,6 +827,12 @@ var hooks = new SessionHooks() System.out.println("Tool: " + input.getToolName()); return CompletableFuture.completedFuture(PreToolUseHookOutput.allow()); }) + .setOnPreMcpToolCall((input, invocation) -> { + System.out.println("MCP Tool: " + input.getServerName() + "/" + input.getToolName()); + // Set metadata on the MCP request + JsonNode meta = mapper.valueToTree(Map.of("source", "my-app")); + return CompletableFuture.completedFuture(PreMcpToolCallHookOutput.withMeta(meta)); + }) .setOnPostToolUse((input, invocation) -> { System.out.println("Result: " + input.getToolResult()); return CompletableFuture.completedFuture(null); @@ -835,7 +843,7 @@ var session = client.createSession( ).get(); ``` -📖 **[Full Session Hooks documentation →](hooks.html)** for all 5 hook types, inputs/outputs, and examples. +📖 **[Full Session Hooks documentation →](hooks.html)** for all 6 hook types, inputs/outputs, and examples. --- @@ -962,7 +970,7 @@ subscription.close(); ### Subscribing to Specific Event Types ```java -import com.github.copilot.sdk.json.SessionLifecycleEventTypes; +import com.github.copilot.rpc.SessionLifecycleEventTypes; // Listen only for session creation var subscription = client.onLifecycle( @@ -1110,7 +1118,7 @@ session.setEventErrorPolicy(EventErrorPolicy.PROPAGATE_AND_LOG_ERRORS); session.setEventErrorPolicy(EventErrorPolicy.SUPPRESS_AND_LOG_ERRORS); ``` -See [EventErrorPolicy](apidocs/com/github/copilot/sdk/EventErrorPolicy.html) and [EventErrorHandler](apidocs/com/github/copilot/sdk/EventErrorHandler.html) Javadoc for details. +See [EventErrorPolicy](apidocs/com/github/copilot/EventErrorPolicy.html) and [EventErrorHandler](apidocs/com/github/copilot/EventErrorHandler.html) Javadoc for details. --- @@ -1147,7 +1155,7 @@ var options = new CopilotClientOptions() | `sourceName` | `COPILOT_OTEL_SOURCE_NAME` | Source name for telemetry spans | | `captureContent` | `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` | Whether to capture message content | -See [TelemetryConfig](apidocs/com/github/copilot/sdk/json/TelemetryConfig.html) Javadoc for details. +See [TelemetryConfig](apidocs/com/github/copilot/rpc/TelemetryConfig.html) Javadoc for details. --- @@ -1379,12 +1387,32 @@ try (var client = new CopilotClient(options)) { - The session's working directory must be a GitHub repository - This option is only used when the SDK spawns the CLI process; it is ignored when connecting to an external server via `setCliUrl()` +### Cloud Sessions + +Cloud sessions create a remote session in the cloud instead of a local session. Optionally associate repository metadata with the cloud session: + +```java +var cloudOptions = new CloudSessionOptions() + .setRepository(new CloudSessionRepository() + .setOwner("my-org") + .setName("my-repo") + .setBranch("main")); + +var session = client.createSession( + new SessionConfig() + .setOnPermissionRequest(PermissionHandler.APPROVE_ALL) + .setCloud(cloudOptions) +).get(); +``` + +See [CloudSessionOptions](apidocs/com/github/copilot/rpc/CloudSessionOptions.html) and [CloudSessionRepository](apidocs/com/github/copilot/rpc/CloudSessionRepository.html) Javadoc for details. + --- ## Next Steps - 📖 **[Documentation](documentation.html)** - Core concepts, events, streaming, models, tool filtering, reasoning effort -- 📖 **[Session Hooks](hooks.html)** - All 5 hook types with inputs, outputs, and examples +- 📖 **[Session Hooks](hooks.html)** - All 6 hook types with inputs, outputs, and examples - 📖 **[MCP Servers](mcp.html)** - Local and remote MCP server integration - 📖 **[Setup & Deployment](setup.html)** - OAuth, backend services, scaling, configuration reference - 📖 **[API Javadoc](apidocs/index.html)** - Complete API reference diff --git a/src/site/markdown/cookbook/error-handling.md b/src/site/markdown/cookbook/error-handling.md index 963b8b0933..0f07e10ff5 100644 --- a/src/site/markdown/cookbook/error-handling.md +++ b/src/site/markdown/cookbook/error-handling.md @@ -30,12 +30,12 @@ jbang BasicErrorHandling.java **Code:** ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; public class BasicErrorHandling { public static void main(String[] args) { @@ -64,8 +64,8 @@ public class BasicErrorHandling { ## Handling specific error types ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; import java.util.concurrent.ExecutionException; public class SpecificErrorHandling { @@ -99,10 +99,10 @@ public class SpecificErrorHandling { ## Timeout handling ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotSession; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotSession; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -130,9 +130,9 @@ public class TimeoutHandling { ## Aborting a request ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotSession; -import com.github.copilot.sdk.json.MessageOptions; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotSession; +import com.github.copilot.rpc.MessageOptions; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -162,8 +162,8 @@ public class AbortRequest { ## Graceful shutdown ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; public class GracefulShutdown { public static void main(String[] args) { @@ -192,12 +192,12 @@ public class GracefulShutdown { ## Try-with-resources pattern ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; public class TryWithResources { public static void doWork() throws Exception { @@ -224,14 +224,14 @@ public class TryWithResources { ## Handling tool errors ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.ToolDefinition; -import com.github.copilot.sdk.json.ToolResultObject; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.ToolDefinition; +import com.github.copilot.rpc.ToolResultObject; import java.util.Map; import java.util.List; import java.util.concurrent.CompletableFuture; diff --git a/src/site/markdown/cookbook/managing-local-files.md b/src/site/markdown/cookbook/managing-local-files.md index 2a7b5540f9..2e986850e1 100644 --- a/src/site/markdown/cookbook/managing-local-files.md +++ b/src/site/markdown/cookbook/managing-local-files.md @@ -34,15 +34,15 @@ jbang ManagingLocalFiles.java **Code:** ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.generated.ToolExecutionCompleteEvent; -import com.github.copilot.sdk.generated.ToolExecutionStartEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.generated.ToolExecutionCompleteEvent; +import com.github.copilot.generated.ToolExecutionStartEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; import java.nio.file.Paths; import java.util.concurrent.CountDownLatch; @@ -161,7 +161,7 @@ session.send(new MessageOptions().setPrompt(prompt)); ## Interactive file organization ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 import java.io.BufferedReader; import java.io.InputStreamReader; diff --git a/src/site/markdown/cookbook/multiple-sessions.md b/src/site/markdown/cookbook/multiple-sessions.md index 84da5a2556..653f8edeff 100644 --- a/src/site/markdown/cookbook/multiple-sessions.md +++ b/src/site/markdown/cookbook/multiple-sessions.md @@ -30,12 +30,12 @@ jbang MultipleSessions.java **Code:** ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; public class MultipleSessions { public static void main(String[] args) throws Exception { @@ -123,7 +123,7 @@ try { ## Managing session lifecycle with CompletableFuture ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 import java.util.concurrent.CompletableFuture; import java.util.List; @@ -177,11 +177,11 @@ common-pool threads: ```java //DEPS com.github:copilot-sdk-java:${project.version} -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; +import com.github.copilot.CopilotClient; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; diff --git a/src/site/markdown/cookbook/persisting-sessions.md b/src/site/markdown/cookbook/persisting-sessions.md index ef80fd3d09..478502e887 100644 --- a/src/site/markdown/cookbook/persisting-sessions.md +++ b/src/site/markdown/cookbook/persisting-sessions.md @@ -30,12 +30,12 @@ jbang PersistingSessions.java **Code:** ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; public class PersistingSessions { public static void main(String[] args) throws Exception { @@ -127,12 +127,12 @@ public class DeleteSession { ## Getting session history ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.UserMessageEvent; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.ResumeSessionConfig; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.UserMessageEvent; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.ResumeSessionConfig; public class SessionHistory { public static void main(String[] args) throws Exception { @@ -162,7 +162,7 @@ public class SessionHistory { ## Complete example with session management ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 import java.util.Scanner; public class SessionManager { diff --git a/src/site/markdown/cookbook/pr-visualization.md b/src/site/markdown/cookbook/pr-visualization.md index 1036bb0f7d..7f45b94883 100644 --- a/src/site/markdown/cookbook/pr-visualization.md +++ b/src/site/markdown/cookbook/pr-visualization.md @@ -34,14 +34,14 @@ jbang PRVisualization.java github/copilot-sdk ## Full example: PRVisualization.java ```java -//DEPS com.github:copilot-sdk-java:1.0.0-beta-java.4 -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.ToolExecutionStartEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SystemMessageConfig; +//DEPS com.github:copilot-sdk-java:1.0.0-beta-8-java.0 +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.ToolExecutionStartEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SystemMessageConfig; import java.io.BufferedReader; import java.io.EOFException; import java.io.IOException; diff --git a/src/site/markdown/documentation.md b/src/site/markdown/documentation.md index 7b0c958e3d..5812e83fdf 100644 --- a/src/site/markdown/documentation.md +++ b/src/site/markdown/documentation.md @@ -27,9 +27,9 @@ This guide covers common use cases for the GitHub Copilot SDK for Java. For comp Create a client, start a session, and send a message: ```java -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.CopilotClient; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; try (var client = new CopilotClient()) { client.start().get(); @@ -266,7 +266,7 @@ The SDK supports event types organized by category. All events extend `SessionEv | `ExitPlanModeRequestedEvent` | `exit_plan_mode.requested` | Exit from plan mode was requested | | `ExitPlanModeCompletedEvent` | `exit_plan_mode.completed` | Exit from plan mode completed | -See the [generated package Javadoc](apidocs/com/github/copilot/sdk/generated/package-summary.html) for detailed event data structures. +See the [generated package Javadoc](apidocs/com/github/copilot/generated/package-summary.html) for detailed event data structures. --- @@ -563,7 +563,7 @@ var pong = client.ping("hello").get(); System.out.println("Server responded, protocol version: " + pong.protocolVersion()); ``` -See [ConnectionState](apidocs/com/github/copilot/sdk/ConnectionState.html), [GetStatusResponse](apidocs/com/github/copilot/sdk/json/GetStatusResponse.html), and [GetAuthStatusResponse](apidocs/com/github/copilot/sdk/json/GetAuthStatusResponse.html) Javadoc for details. +See [ConnectionState](apidocs/com/github/copilot/ConnectionState.html), [GetStatusResponse](apidocs/com/github/copilot/rpc/GetStatusResponse.html), and [GetAuthStatusResponse](apidocs/com/github/copilot/rpc/GetAuthStatusResponse.html) Javadoc for details. --- @@ -662,7 +662,7 @@ var config = new ResumeSessionConfig().setOnPermissionRequest(PermissionHandler. var session = client.resumeSession("user-123-task-456", config).get(); ``` -See [ResumeSessionConfig](apidocs/com/github/copilot/sdk/json/ResumeSessionConfig.html) Javadoc for complete options. +See [ResumeSessionConfig](apidocs/com/github/copilot/rpc/ResumeSessionConfig.html) Javadoc for complete options. ### Clean Up Sessions @@ -725,7 +725,7 @@ var derived = base.clone() `clone()` creates a shallow copy. Collection fields are copied into new collection instances, while nested objects/handlers are shared references. -See [SessionConfig](apidocs/com/github/copilot/sdk/json/SessionConfig.html) Javadoc for full details. +See [SessionConfig](apidocs/com/github/copilot/rpc/SessionConfig.html) Javadoc for full details. --- diff --git a/src/site/markdown/getting-started.md b/src/site/markdown/getting-started.md index 724b1a2dd5..0bde2ef50d 100644 --- a/src/site/markdown/getting-started.md +++ b/src/site/markdown/getting-started.md @@ -64,10 +64,10 @@ For the fastest way to try the SDK without setting up a project, use [JBang](htt Create a new file and add the following code. This is the simplest way to use the SDK. ```java -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.CopilotClient; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; public class HelloCopilot { public static void main(String[] args) throws Exception { @@ -109,12 +109,12 @@ Congratulations! You just built your first Copilot-powered app. Right now, you wait for the complete response before seeing anything. Let's make it interactive by streaming the response as it's generated. ```java -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageDeltaEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageDeltaEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; import java.util.concurrent.CompletableFuture; public class StreamingExample { @@ -156,13 +156,13 @@ Run the code again. You'll see the response appear word by word. Now for the powerful part. Let's give Copilot the ability to call your code by defining a custom tool. We'll create a simple weather lookup tool. ```java -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageDeltaEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.ToolDefinition; +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageDeltaEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.ToolDefinition; import java.util.List; import java.util.Map; import java.util.Random; @@ -238,13 +238,13 @@ Run it and you'll see Copilot call your tool to get weather data, then respond w Let's put it all together into a useful interactive assistant: ```java -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageDeltaEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.ToolDefinition; +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageDeltaEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.ToolDefinition; import java.util.List; import java.util.Map; import java.util.Random; diff --git a/src/site/markdown/hooks.md b/src/site/markdown/hooks.md index 97c7468915..3bed031df8 100644 --- a/src/site/markdown/hooks.md +++ b/src/site/markdown/hooks.md @@ -9,6 +9,7 @@ Session hooks allow you to intercept and modify tool execution, user prompts, an | Hook | When It's Called | Can Modify | |------|------------------|------------| | [Pre-Tool Use](#Pre-Tool_Use_Hook) | Before a tool executes | Tool arguments, permission decision | +| [Pre-MCP-Tool-Call](#Pre-MCP-Tool-Call_Hook) | Before an MCP tool call is dispatched | MCP request metadata (`_meta`) | | [Post-Tool Use](#Post-Tool_Use_Hook) | After a tool executes | Tool result, additional context | | [User Prompt Submitted](#User_Prompt_Submitted_Hook) | When user sends a message | Nothing (observation only) | | [Session Start](#Session_Start_Hook) | When session begins | Nothing (observation only) | @@ -53,6 +54,7 @@ Called **before** a tool executes. Use this to: | Field | Type | Description | |-------|------|-------------| +| `getSessionId()` | `String` | Runtime session ID of the session that triggered the hook | | `getToolName()` | `String` | Name of the tool being called | | `getToolArgs()` | `JsonNode` | Arguments passed to the tool | | `getCwd()` | `String` | Current working directory | @@ -118,6 +120,53 @@ var hooks = new SessionHooks() --- +## Pre-MCP-Tool-Call Hook + +Called **before** an MCP tool call is dispatched to an MCP server. Use this to: +- Inspect or log MCP tool calls +- Set, replace, or remove MCP request metadata (`_meta`) + +### Input + +| Field | Type | Description | +|-------|------|-------------| +| `getSessionId()` | `String` | Runtime session ID of the session that triggered the hook | +| `getTimestamp()` | `long` | Unix timestamp in milliseconds | +| `getCwd()` | `String` | Current working directory | +| `getServerName()` | `String` | Name of the MCP server being called | +| `getToolName()` | `String` | Name of the MCP tool being called | +| `getArguments()` | `JsonNode` | Arguments for the MCP tool call | +| `getToolCallId()` | `String` | Tool call ID (may be null) | +| `getMeta()` | `Map` | Existing MCP request metadata (may be null) | + +### Output + +Return `null` from the handler to preserve existing `_meta` (no-op). Otherwise, return a `PreMcpToolCallHookOutput`: + +| Factory Method | Effect | +|----------------|--------| +| `PreMcpToolCallHookOutput.withMeta(jsonNode)` | Replace `_meta` with the given JSON object | +| `PreMcpToolCallHookOutput.removeMeta()` | Remove `_meta` from the request | + +### Example: Inject metadata into MCP requests + +```java +var hooks = new SessionHooks() + .setOnPreMcpToolCall((input, invocation) -> { + System.out.println("MCP call: " + input.getServerName() + "/" + input.getToolName()); + + // Inject custom metadata into the MCP request + var mapper = new ObjectMapper(); + JsonNode meta = mapper.valueToTree(Map.of( + "source", "my-application", + "requestId", UUID.randomUUID().toString() + )); + return CompletableFuture.completedFuture(PreMcpToolCallHookOutput.withMeta(meta)); + }); +``` + +--- + ## Post-Tool Use Hook Called **after** a tool executes. Use this to: @@ -130,6 +179,7 @@ Called **after** a tool executes. Use this to: | Field | Type | Description | |-------|------|-------------| +| `getSessionId()` | `String` | Runtime session ID of the session that triggered the hook | | `getToolName()` | `String` | Name of the tool that was called | | `getToolArgs()` | `JsonNode` | Arguments that were passed | | `getToolResult()` | `JsonNode` | Result from the tool | @@ -187,8 +237,9 @@ Called when the user submits a prompt, before the LLM processes it. This is an o | Field | Type | Description | |-------|------|-------------| +| `sessionId()` | `String` | Runtime session ID of the session that triggered the hook | | `prompt()` | `String` | The user's prompt text | -| `getTimestamp()` | `long` | Timestamp in milliseconds | +| `timestamp()` | `long` | Timestamp in milliseconds | ### Output @@ -221,8 +272,9 @@ Called when a session starts (either new or resumed). | Field | Type | Description | |-------|------|-------------| +| `sessionId()` | `String` | Runtime session ID of the session that triggered the hook | | `source()` | `String` | `"startup"`, `"resume"`, or `"new"` | -| `getTimestamp()` | `long` | Timestamp in milliseconds | +| `timestamp()` | `long` | Timestamp in milliseconds | ### Output @@ -253,8 +305,9 @@ Called when a session ends. | Field | Type | Description | |-------|------|-------------| +| `sessionId()` | `String` | Runtime session ID of the session that triggered the hook | | `reason()` | `String` | Why the session ended | -| `getTimestamp()` | `long` | Timestamp in milliseconds | +| `timestamp()` | `long` | Timestamp in milliseconds | ### Output @@ -284,11 +337,11 @@ var hooks = new SessionHooks() Combining multiple hooks for comprehensive session control: ```java -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.PreToolUseHookOutput; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionHooks; +import com.github.copilot.CopilotClient; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.PreToolUseHookOutput; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionHooks; import java.util.concurrent.CompletableFuture; public class HooksExample { @@ -406,11 +459,11 @@ To handle errors gracefully in your hooks: ## See Also -- [SessionHooks Javadoc](apidocs/com/github/copilot/sdk/json/SessionHooks.html) -- [PreToolUseHookInput Javadoc](apidocs/com/github/copilot/sdk/json/PreToolUseHookInput.html) -- [PreToolUseHookOutput Javadoc](apidocs/com/github/copilot/sdk/json/PreToolUseHookOutput.html) -- [PostToolUseHookInput Javadoc](apidocs/com/github/copilot/sdk/json/PostToolUseHookInput.html) -- [PostToolUseHookOutput Javadoc](apidocs/com/github/copilot/sdk/json/PostToolUseHookOutput.html) +- [SessionHooks Javadoc](apidocs/com/github/copilot/rpc/SessionHooks.html) +- [PreToolUseHookInput Javadoc](apidocs/com/github/copilot/rpc/PreToolUseHookInput.html) +- [PreToolUseHookOutput Javadoc](apidocs/com/github/copilot/rpc/PreToolUseHookOutput.html) +- [PostToolUseHookInput Javadoc](apidocs/com/github/copilot/rpc/PostToolUseHookInput.html) +- [PostToolUseHookOutput Javadoc](apidocs/com/github/copilot/rpc/PostToolUseHookOutput.html) --- diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index a097da69e4..645645d4bc 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -36,12 +36,12 @@ implementation 'com.github:copilot-sdk-java:${project.version}' ### Quick Example ```java -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; import java.util.concurrent.CompletableFuture; public class Example { @@ -87,12 +87,12 @@ You can quickly try the SDK without setting up a full project using [JBang](http # Create a simple script cat > hello-copilot.java << 'EOF' //DEPS com.github:copilot-sdk-java:${project.version} -import com.github.copilot.sdk.CopilotClient; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.CopilotClient; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; import java.util.concurrent.CompletableFuture; class hello { diff --git a/src/test/java/com/github/copilot/sdk/AgentInfoTest.java b/src/test/java/com/github/copilot/AgentInfoTest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/AgentInfoTest.java rename to src/test/java/com/github/copilot/AgentInfoTest.java index 0893773e71..3b15f5582c 100644 --- a/src/test/java/com/github/copilot/sdk/AgentInfoTest.java +++ b/src/test/java/com/github/copilot/AgentInfoTest.java @@ -2,13 +2,13 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.AgentInfo; +import com.github.copilot.rpc.AgentInfo; /** * Unit tests for {@link AgentInfo} getters, setters, and fluent chaining. diff --git a/src/test/java/com/github/copilot/AgentModeTest.java b/src/test/java/com/github/copilot/AgentModeTest.java new file mode 100644 index 0000000000..dd1aa01de3 --- /dev/null +++ b/src/test/java/com/github/copilot/AgentModeTest.java @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.copilot.rpc.AgentMode; + +/** + * Unit tests for {@link AgentMode} serialization, deserialization, and + * unknown-value behavior. + */ +public class AgentModeTest { + + private final ObjectMapper mapper = new ObjectMapper(); + + @ParameterizedTest + @EnumSource(AgentMode.class) + void jsonRoundTrip_allValues(AgentMode mode) throws Exception { + String json = mapper.writeValueAsString(mode); + AgentMode deserialized = mapper.readValue(json, AgentMode.class); + assertEquals(mode, deserialized); + } + + @Test + void getValue_returnsExpectedStrings() { + assertEquals("interactive", AgentMode.INTERACTIVE.getValue()); + assertEquals("plan", AgentMode.PLAN.getValue()); + assertEquals("autopilot", AgentMode.AUTOPILOT.getValue()); + assertEquals("shell", AgentMode.SHELL.getValue()); + } + + @Test + void fromValue_knownValues_returnsCorrectEnum() { + assertEquals(AgentMode.INTERACTIVE, AgentMode.fromValue("interactive")); + assertEquals(AgentMode.PLAN, AgentMode.fromValue("plan")); + assertEquals(AgentMode.AUTOPILOT, AgentMode.fromValue("autopilot")); + assertEquals(AgentMode.SHELL, AgentMode.fromValue("shell")); + } + + @Test + void fromValue_null_returnsNull() { + assertNull(AgentMode.fromValue(null)); + } + + @Test + void fromValue_unknownValue_throwsWithConsistentMessage() { + var ex = assertThrows(IllegalArgumentException.class, () -> AgentMode.fromValue("unknown")); + assertEquals("Unknown AgentMode value: unknown", ex.getMessage()); + } + + @Test + void jsonDeserialize_unknownValue_throws() { + String json = "\"not-a-mode\""; + assertThrows(Exception.class, () -> mapper.readValue(json, AgentMode.class)); + } + + @Test + void jsonSerialize_writesStringValue() throws Exception { + String json = mapper.writeValueAsString(AgentMode.AUTOPILOT); + assertEquals("\"autopilot\"", json); + } +} diff --git a/src/test/java/com/github/copilot/sdk/AskUserTest.java b/src/test/java/com/github/copilot/AskUserTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/AskUserTest.java rename to src/test/java/com/github/copilot/AskUserTest.java index a2ad13b188..f32a6632d1 100644 --- a/src/test/java/com/github/copilot/sdk/AskUserTest.java +++ b/src/test/java/com/github/copilot/AskUserTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -14,11 +14,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.UserInputRequest; -import com.github.copilot.sdk.json.UserInputResponse; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.UserInputRequest; +import com.github.copilot.rpc.UserInputResponse; /** * Tests for user input handler (ask_user) functionality. diff --git a/src/test/java/com/github/copilot/sdk/CapiProxy.java b/src/test/java/com/github/copilot/CapiProxy.java similarity index 99% rename from src/test/java/com/github/copilot/sdk/CapiProxy.java rename to src/test/java/com/github/copilot/CapiProxy.java index 09c4e20161..90c2dd0a75 100644 --- a/src/test/java/com/github/copilot/sdk/CapiProxy.java +++ b/src/test/java/com/github/copilot/CapiProxy.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.io.BufferedReader; import java.io.IOException; diff --git a/src/test/java/com/github/copilot/sdk/CliServerManagerTest.java b/src/test/java/com/github/copilot/CliServerManagerTest.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/CliServerManagerTest.java rename to src/test/java/com/github/copilot/CliServerManagerTest.java index 90e6dcc3c3..2df5dafabb 100644 --- a/src/test/java/com/github/copilot/sdk/CliServerManagerTest.java +++ b/src/test/java/com/github/copilot/CliServerManagerTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.TelemetryConfig; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.TelemetryConfig; /** * Unit tests for {@link CliServerManager} covering parseCliUrl, diff --git a/src/test/java/com/github/copilot/sdk/ClosedSessionGuardTest.java b/src/test/java/com/github/copilot/ClosedSessionGuardTest.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/ClosedSessionGuardTest.java rename to src/test/java/com/github/copilot/ClosedSessionGuardTest.java index edc503f948..12636fb77e 100644 --- a/src/test/java/com/github/copilot/sdk/ClosedSessionGuardTest.java +++ b/src/test/java/com/github/copilot/ClosedSessionGuardTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -13,10 +13,10 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; /** * Tests for closed-session guard functionality in CopilotSession. diff --git a/src/test/java/com/github/copilot/sdk/CommandsTest.java b/src/test/java/com/github/copilot/CommandsTest.java similarity index 93% rename from src/test/java/com/github/copilot/sdk/CommandsTest.java rename to src/test/java/com/github/copilot/CommandsTest.java index 6bddbed288..0da8822a2b 100644 --- a/src/test/java/com/github/copilot/sdk/CommandsTest.java +++ b/src/test/java/com/github/copilot/CommandsTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -11,13 +11,13 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.CommandContext; -import com.github.copilot.sdk.json.CommandDefinition; -import com.github.copilot.sdk.json.CommandHandler; -import com.github.copilot.sdk.json.CommandWireDefinition; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.rpc.CommandContext; +import com.github.copilot.rpc.CommandDefinition; +import com.github.copilot.rpc.CommandHandler; +import com.github.copilot.rpc.CommandWireDefinition; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; /** * Unit tests for the Commands feature (CommandDefinition, CommandContext, diff --git a/src/test/java/com/github/copilot/sdk/CompactionTest.java b/src/test/java/com/github/copilot/CompactionTest.java similarity index 93% rename from src/test/java/com/github/copilot/sdk/CompactionTest.java rename to src/test/java/com/github/copilot/CompactionTest.java index 306eeb6c72..100b8e8fe1 100644 --- a/src/test/java/com/github/copilot/sdk/CompactionTest.java +++ b/src/test/java/com/github/copilot/CompactionTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -16,14 +16,14 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionCompactionCompleteEvent; -import com.github.copilot.sdk.generated.SessionCompactionStartEvent; -import com.github.copilot.sdk.json.InfiniteSessionConfig; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionCompactionCompleteEvent; +import com.github.copilot.generated.SessionCompactionStartEvent; +import com.github.copilot.rpc.InfiniteSessionConfig; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; /** * Tests for compaction and infinite sessions functionality. diff --git a/src/test/java/com/github/copilot/sdk/ConfigCloneTest.java b/src/test/java/com/github/copilot/ConfigCloneTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/ConfigCloneTest.java rename to src/test/java/com/github/copilot/ConfigCloneTest.java index 09bd3ee385..f26f67ed91 100644 --- a/src/test/java/com/github/copilot/sdk/ConfigCloneTest.java +++ b/src/test/java/com/github/copilot/ConfigCloneTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -15,18 +15,18 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.json.AutoModeSwitchResponse; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.DefaultAgentConfig; -import com.github.copilot.sdk.json.ExitPlanModeResult; -import com.github.copilot.sdk.json.InfiniteSessionConfig; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.ModelInfo; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SystemMessageConfig; -import com.github.copilot.sdk.json.TelemetryConfig; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.rpc.AutoModeSwitchResponse; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.DefaultAgentConfig; +import com.github.copilot.rpc.ExitPlanModeResult; +import com.github.copilot.rpc.InfiniteSessionConfig; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.ModelInfo; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SystemMessageConfig; +import com.github.copilot.rpc.TelemetryConfig; class ConfigCloneTest { diff --git a/src/test/java/com/github/copilot/CopilotClientModeTest.java b/src/test/java/com/github/copilot/CopilotClientModeTest.java new file mode 100644 index 0000000000..3b70174050 --- /dev/null +++ b/src/test/java/com/github/copilot/CopilotClientModeTest.java @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import com.github.copilot.rpc.CopilotClientMode; +import com.github.copilot.rpc.CopilotClientOptions; + +/** + * Tests for {@link CopilotClientMode} and Empty mode validation. + */ +public class CopilotClientModeTest { + + @Test + void testDefaultModeIsCopilotCli() { + var opts = new CopilotClientOptions(); + assertEquals(CopilotClientMode.COPILOT_CLI, opts.getMode()); + } + + @Test + void testSetModeEmpty() { + var opts = new CopilotClientOptions(); + opts.setMode(CopilotClientMode.EMPTY); + assertEquals(CopilotClientMode.EMPTY, opts.getMode()); + } + + @Test + void testEmptyModeRequiresCopilotHome() { + var opts = new CopilotClientOptions().setMode(CopilotClientMode.EMPTY).setAutoStart(false); + // Empty mode without copilotHome should throw + var ex = assertThrows(IllegalArgumentException.class, () -> new CopilotClient(opts)); + assertTrue(ex.getMessage().contains("Empty mode")); + } + + @Test + void testEmptyModeWithCopilotHome() { + var opts = new CopilotClientOptions().setMode(CopilotClientMode.EMPTY).setCopilotHome("/tmp/copilot-home") + .setAutoStart(false); + // Should not throw - copilotHome is set + var client = new CopilotClient(opts); + assertEquals(ConnectionState.DISCONNECTED, client.getState()); + client.close(); + } + + @Test + void testCopilotClientModeEnumValues() { + assertEquals(2, CopilotClientMode.values().length); + assertEquals(CopilotClientMode.EMPTY, CopilotClientMode.valueOf("EMPTY")); + assertEquals(CopilotClientMode.COPILOT_CLI, CopilotClientMode.valueOf("COPILOT_CLI")); + } + + @Test + void testEnumSerializationNames() { + // CopilotClientMode is a plain enum; verify the values exist + assertNotNull(CopilotClientMode.EMPTY); + assertNotNull(CopilotClientMode.COPILOT_CLI); + } +} diff --git a/src/test/java/com/github/copilot/sdk/CopilotClientTest.java b/src/test/java/com/github/copilot/CopilotClientTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/CopilotClientTest.java rename to src/test/java/com/github/copilot/CopilotClientTest.java index 14ed8ca89e..1d6bfc7044 100644 --- a/src/test/java/com/github/copilot/sdk/CopilotClientTest.java +++ b/src/test/java/com/github/copilot/CopilotClientTest.java @@ -2,17 +2,17 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.PingResponse; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionLifecycleEvent; -import com.github.copilot.sdk.json.SessionLifecycleEventTypes; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.PingResponse; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionLifecycleEvent; +import com.github.copilot.rpc.SessionLifecycleEventTypes; import java.lang.reflect.Field; import java.util.ArrayList; @@ -92,7 +92,7 @@ void testStartAndConnectUsingStdio() throws Exception { PingResponse pong = client.ping("test message").get(); assertEquals("pong: test message", pong.message()); - assertTrue(pong.timestamp() >= 0); + assertNotNull(pong.timestamp()); client.stop().get(); assertEquals(ConnectionState.DISCONNECTED, client.getState()); @@ -473,8 +473,8 @@ void testNullOptionsDefaultsToEmpty() { @Test void testListModels_WithCustomHandler_CallsHandler() throws Exception { - var customModels = new ArrayList(); - var model = new com.github.copilot.sdk.json.ModelInfo(); + var customModels = new ArrayList(); + var model = new com.github.copilot.rpc.ModelInfo(); model.setId("my-custom-model"); customModels.add(model); @@ -494,8 +494,8 @@ void testListModels_WithCustomHandler_CallsHandler() throws Exception { @Test void testListModels_WithCustomHandler_CachesResults() throws Exception { - var customModels = new ArrayList(); - var model = new com.github.copilot.sdk.json.ModelInfo(); + var customModels = new ArrayList(); + var model = new com.github.copilot.rpc.ModelInfo(); model.setId("cached-model"); customModels.add(model); @@ -514,8 +514,8 @@ void testListModels_WithCustomHandler_CachesResults() throws Exception { @Test void testListModels_WithCustomHandler_WorksWithoutStart() throws Exception { - var customModels = new ArrayList(); - var model = new com.github.copilot.sdk.json.ModelInfo(); + var customModels = new ArrayList(); + var model = new com.github.copilot.rpc.ModelInfo(); model.setId("no-start-model"); customModels.add(model); diff --git a/src/test/java/com/github/copilot/sdk/CopilotSessionTest.java b/src/test/java/com/github/copilot/CopilotSessionTest.java similarity index 91% rename from src/test/java/com/github/copilot/sdk/CopilotSessionTest.java rename to src/test/java/com/github/copilot/CopilotSessionTest.java index fc44880cf8..9c74d49464 100644 --- a/src/test/java/com/github/copilot/sdk/CopilotSessionTest.java +++ b/src/test/java/com/github/copilot/CopilotSessionTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -23,21 +23,21 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.AbortEvent; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.generated.SessionStartEvent; -import com.github.copilot.sdk.generated.ToolExecutionStartEvent; -import com.github.copilot.sdk.generated.UserMessageEvent; -import com.github.copilot.sdk.generated.rpc.SessionRpc; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.DefaultAgentConfig; -import com.github.copilot.sdk.json.SystemMessageConfig; -import com.github.copilot.sdk.json.ToolDefinition; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.AbortEvent; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.generated.SessionStartEvent; +import com.github.copilot.generated.ToolExecutionStartEvent; +import com.github.copilot.generated.UserMessageEvent; +import com.github.copilot.generated.rpc.SessionRpc; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.DefaultAgentConfig; +import com.github.copilot.rpc.SystemMessageConfig; +import com.github.copilot.rpc.ToolDefinition; /** * Tests for CopilotSession. @@ -760,12 +760,30 @@ void testShouldGetLastSessionId() throws Exception { .createSession(new SessionConfig().setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get(); session.sendAndWait(new MessageOptions().setPrompt("Say hello")).get(60, TimeUnit.SECONDS); + String sessionId = session.getSessionId(); + session.close(); - String lastId = client.getLastSessionId().get(30, TimeUnit.SECONDS); + // Poll until getLastSessionId returns the expected value. + // Session state is persisted asynchronously; polling keeps fast + // machines fast and slow CI safe (mirrors Node.js/.NET patterns). + String lastId = null; + long deadline = System.currentTimeMillis() + 10_000; + while (System.currentTimeMillis() < deadline) { + long remaining = Math.max(1, deadline - System.currentTimeMillis()); + long iterationTimeout = Math.min(remaining, 500); + try { + lastId = client.getLastSessionId().get(iterationTimeout, TimeUnit.MILLISECONDS); + } catch (java.util.concurrent.TimeoutException ignored) { + // RPC call took longer than the per-iteration cap; retry + continue; + } + if (sessionId.equals(lastId)) { + break; + } + Thread.sleep(50); + } assertNotNull(lastId, "Last session ID should not be null"); - assertEquals(session.getSessionId(), lastId, "Last session ID should match the current session ID"); - - session.close(); + assertEquals(sessionId, lastId, "Last session ID should match the current session ID"); } } @@ -812,8 +830,8 @@ void testSessionListFilterFluentAPI() throws Exception { var session = client .createSession(new SessionConfig().setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get(); - var filter = new com.github.copilot.sdk.json.SessionListFilter().setCwd("/test/path") - .setRepository("owner/repo").setBranch("main").setGitRoot("/test"); + var filter = new com.github.copilot.rpc.SessionListFilter().setCwd("/test/path").setRepository("owner/repo") + .setBranch("main").setGitRoot("/test"); assertEquals("/test/path", filter.getCwd()); assertEquals("owner/repo", filter.getRepository()); @@ -840,11 +858,31 @@ void testShouldGetSessionMetadataById() throws Exception { var session = client .createSession(new SessionConfig().setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get(); + // Send a message to persist the session to disk session.sendAndWait(new MessageOptions().setPrompt("Say hello")).get(60, TimeUnit.SECONDS); - var metadata = client.getSessionMetadata(session.getSessionId()).get(30, TimeUnit.SECONDS); - assertNotNull(metadata, "Metadata should not be null for known session"); - assertEquals(session.getSessionId(), metadata.getSessionId(), "Metadata session ID should match"); + // Poll until metadata becomes available; the CLI persists session + // state asynchronously so it may not be queryable immediately + // (mirrors .NET WaitForConditionAsync pattern). + var sessionId = session.getSessionId(); + com.github.copilot.rpc.SessionMetadata metadata = null; + long deadline = System.currentTimeMillis() + 10_000; + while (System.currentTimeMillis() < deadline) { + long remaining = Math.max(1, deadline - System.currentTimeMillis()); + long iterationTimeout = Math.min(remaining, 500); + try { + metadata = client.getSessionMetadata(sessionId).get(iterationTimeout, TimeUnit.MILLISECONDS); + } catch (java.util.concurrent.TimeoutException ignored) { + // RPC call took longer than the per-iteration cap; retry + continue; + } + if (metadata != null) { + break; + } + Thread.sleep(50); + } + assertNotNull(metadata, "Timed out waiting for getSessionMetadata() to return the persisted session"); + assertEquals(sessionId, metadata.getSessionId(), "Metadata session ID should match"); // A non-existent session should return null var notFound = client.getSessionMetadata("non-existent-session-id").get(30, TimeUnit.SECONDS); diff --git a/src/test/java/com/github/copilot/CreateSessionReKeyEntryTest.java b/src/test/java/com/github/copilot/CreateSessionReKeyEntryTest.java new file mode 100644 index 0000000000..94f4edbdf1 --- /dev/null +++ b/src/test/java/com/github/copilot/CreateSessionReKeyEntryTest.java @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot; + +import static org.junit.jupiter.api.Assertions.*; + +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.net.ServerSocket; +import java.net.Socket; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +import org.junit.jupiter.api.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; + +/** + * Tests for the session-map re-key cleanup paths in CopilotClient when the + * server returns a different session ID than the client-supplied one. + */ +class CreateSessionReKeyEntryTest { + + private static final ObjectMapper MAPPER = JsonRpcClient.getObjectMapper(); + + /** + * A connected socket pair where the server replies to "session.create" with a + * configurable sessionId and then replies to "session.options.update" with + * success or failure. + */ + private static final class ReKeyServer implements AutoCloseable { + + final Socket clientSocket; + final Socket serverSocket; + final JsonRpcClient rpcClient; + private volatile boolean running = true; + private final Thread replyThread; + + /** The sessionId to return in the session.create response. */ + private final String returnedSessionId; + /** If true, the session.options.update call will fail. */ + private final boolean failOptionsUpdate; + + ReKeyServer(String returnedSessionId, boolean failOptionsUpdate) throws Exception { + this.returnedSessionId = returnedSessionId; + this.failOptionsUpdate = failOptionsUpdate; + + try (var ss = new ServerSocket(0)) { + clientSocket = new Socket("localhost", ss.getLocalPort()); + serverSocket = ss.accept(); + } + serverSocket.setSoTimeout(5000); + rpcClient = JsonRpcClient.fromSocket(clientSocket); + + replyThread = new Thread(() -> { + try { + var in = serverSocket.getInputStream(); + var out = serverSocket.getOutputStream(); + while (running) { + // Read Content-Length header + var header = new StringBuilder(); + int b; + while ((b = in.read()) != -1) { + if (b == '\n' && header.toString().endsWith("\r")) { + break; + } + header.append((char) b); + } + if (b == -1) + break; + // Skip blank line + in.read(); // '\r' + in.read(); // '\n' + + String hdr = header.toString().trim(); + int colon = hdr.indexOf(':'); + int len = Integer.parseInt(hdr.substring(colon + 1).trim()); + byte[] body = in.readNBytes(len); + JsonNode msg = MAPPER.readTree(body); + + String method = msg.get("method").asText(); + long id = msg.get("id").asLong(); + + if ("session.create".equals(method)) { + // Return a response with the (possibly different) session ID + ObjectNode result = MAPPER.createObjectNode(); + result.put("sessionId", returnedSessionId); + String response = MAPPER.writeValueAsString(MAPPER.createObjectNode().put("jsonrpc", "2.0") + .put("id", id).set("result", result)); + sendRpcMessage(out, response); + } else if ("session.options.update".equals(method)) { + if (failOptionsUpdate) { + // Send an error response + ObjectNode error = MAPPER.createObjectNode(); + error.put("code", -32000); + error.put("message", "simulated options update failure"); + String response = MAPPER.writeValueAsString(MAPPER.createObjectNode() + .put("jsonrpc", "2.0").put("id", id).set("error", error)); + sendRpcMessage(out, response); + } else { + // Send a success response + String response = MAPPER.writeValueAsString( + MAPPER.createObjectNode().put("jsonrpc", "2.0").put("id", id).set("result", + MAPPER.createObjectNode().put("success", true))); + sendRpcMessage(out, response); + } + } else { + // Generic success for anything else + String response = MAPPER.writeValueAsString(MAPPER.createObjectNode().put("jsonrpc", "2.0") + .put("id", id).set("result", MAPPER.createObjectNode().put("success", true))); + sendRpcMessage(out, response); + } + } + } catch (Exception e) { + if (running) { + // Ignore expected exceptions on shutdown + } + } + }); + replyThread.setDaemon(true); + replyThread.start(); + } + + private static void sendRpcMessage(OutputStream out, String json) throws Exception { + byte[] bytes = json.getBytes(StandardCharsets.UTF_8); + String header = "Content-Length: " + bytes.length + "\r\n\r\n"; + out.write(header.getBytes(StandardCharsets.UTF_8)); + out.write(bytes); + out.flush(); + } + + @Override + public void close() throws Exception { + running = false; + rpcClient.close(); + clientSocket.close(); + serverSocket.close(); + replyThread.join(3000); + } + } + + @SuppressWarnings("unchecked") + private static Map getSessionsMap(CopilotClient client) throws Exception { + Field f = CopilotClient.class.getDeclaredField("sessions"); + f.setAccessible(true); + return (Map) f.get(client); + } + + private static void injectConnection(CopilotClient client, JsonRpcClient rpc) throws Exception { + // Build a Connection record via the private record constructor + Class connClass = null; + for (Class c : CopilotClient.class.getDeclaredClasses()) { + if (c.getSimpleName().equals("Connection")) { + connClass = c; + break; + } + } + assertNotNull(connClass, "Could not find Connection inner class"); + + var ctor = connClass.getDeclaredConstructors()[0]; + ctor.setAccessible(true); + // Connection(JsonRpcClient rpc, Process process, ServerRpc serverRpc) + Object connection = ctor.newInstance(rpc, null, null); + + Field f = CopilotClient.class.getDeclaredField("connectionFuture"); + f.setAccessible(true); + f.set(client, CompletableFuture.completedFuture(connection)); + } + + @Test + void createSessionReKeyEntry_successfulReKey_removesOldKeyAndAddsNewKey() throws Exception { + String clientSessionId = "client-supplied-id"; + String serverSessionId = "server-returned-id"; + + try (var server = new ReKeyServer(serverSessionId, false)) { + var client = new CopilotClient(new CopilotClientOptions().setAutoStart(false)); + injectConnection(client, server.rpcClient); + + var config = new SessionConfig().setSessionId(clientSessionId) + .setOnPermissionRequest(PermissionHandler.APPROVE_ALL); + + CopilotSession session = client.createSession(config).get(); + + Map sessions = getSessionsMap(client); + + // The old client-supplied key should be removed + assertNull(sessions.get(clientSessionId), + "Old client-supplied sessionId should be removed from sessions map after re-key"); + // The new server-returned key should be present + assertSame(session, sessions.get(serverSessionId), + "Server-returned sessionId should be the key in sessions map"); + // The session object should report the server-returned ID + assertEquals(serverSessionId, session.getSessionId(), + "Session should report the server-returned sessionId"); + + client.close(); + } + } + + @Test + void createSessionReKeyEntry_failureAfterReKey_removesBothKeys() throws Exception { + String clientSessionId = "client-supplied-id"; + String serverSessionId = "server-returned-id"; + + try (var server = new ReKeyServer(serverSessionId, true)) { + var client = new CopilotClient(new CopilotClientOptions().setAutoStart(false)); + injectConnection(client, server.rpcClient); + + // Set skipCustomInstructions so that session.options.update is actually invoked + var config = new SessionConfig().setSessionId(clientSessionId) + .setOnPermissionRequest(PermissionHandler.APPROVE_ALL).setSkipCustomInstructions(true); + + // The session.options.update will fail, triggering the exceptionally handler + ExecutionException ex = assertThrows(ExecutionException.class, () -> client.createSession(config).get()); + assertNotNull(ex.getCause()); + + Map sessions = getSessionsMap(client); + + // Both the original and re-keyed entries should be cleaned up + assertNull(sessions.get(clientSessionId), + "Original client-supplied sessionId should be removed on failure"); + assertNull(sessions.get(serverSessionId), + "Re-keyed server-returned sessionId should be removed on failure"); + assertTrue(sessions.isEmpty(), "Sessions map should be empty after failed create with re-key"); + + client.close(); + } + } + + @Test + void createSessionReKeyEntry_noReKey_sameIdKept() throws Exception { + String sessionId = "same-id-for-both"; + + try (var server = new ReKeyServer(sessionId, false)) { + var client = new CopilotClient(new CopilotClientOptions().setAutoStart(false)); + injectConnection(client, server.rpcClient); + + var config = new SessionConfig().setSessionId(sessionId) + .setOnPermissionRequest(PermissionHandler.APPROVE_ALL); + + CopilotSession session = client.createSession(config).get(); + + Map sessions = getSessionsMap(client); + + // When IDs match, the session stays under the original key + assertSame(session, sessions.get(sessionId), + "Session should remain under original key when server returns same ID"); + assertEquals(1, sessions.size(), "Should have exactly one entry in sessions map"); + + client.close(); + } + } +} diff --git a/src/test/java/com/github/copilot/sdk/DataObjectCoverageTest.java b/src/test/java/com/github/copilot/DataObjectCoverageTest.java similarity index 73% rename from src/test/java/com/github/copilot/sdk/DataObjectCoverageTest.java rename to src/test/java/com/github/copilot/DataObjectCoverageTest.java index 2ff3600200..ece824234b 100644 --- a/src/test/java/com/github/copilot/sdk/DataObjectCoverageTest.java +++ b/src/test/java/com/github/copilot/DataObjectCoverageTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -10,21 +10,22 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.github.copilot.sdk.json.GetForegroundSessionResponse; -import com.github.copilot.sdk.json.McpHttpServerConfig; -import com.github.copilot.sdk.json.McpStdioServerConfig; -import com.github.copilot.sdk.json.ModelCapabilitiesOverride; -import com.github.copilot.sdk.json.PermissionRequest; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PostToolUseHookInput; -import com.github.copilot.sdk.json.PostToolUseHookOutput; -import com.github.copilot.sdk.json.PreToolUseHookInput; -import com.github.copilot.sdk.json.PreToolUseHookOutput; -import com.github.copilot.sdk.json.SectionOverride; -import com.github.copilot.sdk.json.SetForegroundSessionRequest; -import com.github.copilot.sdk.json.SetForegroundSessionResponse; -import com.github.copilot.sdk.json.ToolBinaryResult; -import com.github.copilot.sdk.json.ToolResultObject; +import com.github.copilot.rpc.CustomAgentConfig; +import com.github.copilot.rpc.GetForegroundSessionResponse; +import com.github.copilot.rpc.McpHttpServerConfig; +import com.github.copilot.rpc.McpStdioServerConfig; +import com.github.copilot.rpc.ModelCapabilitiesOverride; +import com.github.copilot.rpc.PermissionRequest; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PostToolUseHookInput; +import com.github.copilot.rpc.PostToolUseHookOutput; +import com.github.copilot.rpc.PreToolUseHookInput; +import com.github.copilot.rpc.PreToolUseHookOutput; +import com.github.copilot.rpc.SectionOverride; +import com.github.copilot.rpc.SetForegroundSessionRequest; +import com.github.copilot.rpc.SetForegroundSessionResponse; +import com.github.copilot.rpc.ToolBinaryResult; +import com.github.copilot.rpc.ToolResultObject; /** * Unit tests for various data transfer objects and record types that were @@ -156,6 +157,14 @@ void preToolUseHookInputGetters() { assertEquals(0L, input.getTimestamp()); assertNull(input.getCwd()); assertNull(input.getToolArgs()); + assertNull(input.getSessionId()); + } + + @Test + void preToolUseHookInputSessionIdRoundTrip() { + var input = new PreToolUseHookInput(); + input.setSessionId("session-abc"); + assertEquals("session-abc", input.getSessionId()); } // ===== PostToolUseHookInput getters ===== @@ -167,6 +176,55 @@ void postToolUseHookInputGetters() { assertEquals(0L, input.getTimestamp()); assertNull(input.getCwd()); assertNull(input.getToolArgs()); + assertNull(input.getSessionId()); + } + + @Test + void postToolUseHookInputSessionIdRoundTrip() { + var input = new PostToolUseHookInput(); + input.setSessionId("session-xyz"); + assertEquals("session-xyz", input.getSessionId()); + } + + // ===== CustomAgentConfig model field ===== + + @Test + void customAgentConfigModelGetterAndSetter() { + var cfg = new CustomAgentConfig(); + assertNull(cfg.getModel()); + + cfg.setModel("claude-haiku-4.5"); + assertEquals("claude-haiku-4.5", cfg.getModel()); + } + + @Test + void customAgentConfigModelFluentChaining() { + var cfg = new CustomAgentConfig().setName("reviewer").setModel("gpt-5").setDescription("Code reviewer"); + assertEquals("reviewer", cfg.getName()); + assertEquals("gpt-5", cfg.getModel()); + assertEquals("Code reviewer", cfg.getDescription()); + } + + @Test + void customAgentConfigModelSerializationRoundTrip() throws Exception { + var mapper = JsonRpcClient.getObjectMapper(); + var cfg = new CustomAgentConfig().setName("my-agent").setModel("claude-haiku-4.5"); + + var json = mapper.writeValueAsString(cfg); + assertTrue(json.contains("\"model\":\"claude-haiku-4.5\"")); + + var deserialized = mapper.readValue(json, CustomAgentConfig.class); + assertEquals("my-agent", deserialized.getName()); + assertEquals("claude-haiku-4.5", deserialized.getModel()); + } + + @Test + void customAgentConfigModelOmittedWhenNull() throws Exception { + var mapper = JsonRpcClient.getObjectMapper(); + var cfg = new CustomAgentConfig().setName("no-model-agent"); + + var json = mapper.writeValueAsString(cfg); + assertFalse(json.contains("\"model\"")); } // ===== PermissionRequestResult setRules ===== diff --git a/src/test/java/com/github/copilot/sdk/DocumentationSamplesTest.java b/src/test/java/com/github/copilot/DocumentationSamplesTest.java similarity index 94% rename from src/test/java/com/github/copilot/sdk/DocumentationSamplesTest.java rename to src/test/java/com/github/copilot/DocumentationSamplesTest.java index bb8a6f07e2..f7170f4fde 100644 --- a/src/test/java/com/github/copilot/sdk/DocumentationSamplesTest.java +++ b/src/test/java/com/github/copilot/DocumentationSamplesTest.java @@ -1,4 +1,4 @@ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -7,7 +7,6 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import java.util.stream.Stream; import org.junit.jupiter.api.Test; @@ -135,11 +134,6 @@ private static List documentationFiles() throws IOException { List files = new ArrayList<>(); files.add(root.resolve("README.md")); files.add(root.resolve("jbang-example.java")); - - try (Stream markdownFiles = Files.walk(root.resolve("src/site/markdown"))) { - markdownFiles.filter(Files::isRegularFile).filter(path -> path.toString().endsWith(".md")) - .forEach(files::add); - } return files; } } diff --git a/src/test/java/com/github/copilot/sdk/E2ETestContext.java b/src/test/java/com/github/copilot/E2ETestContext.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/E2ETestContext.java rename to src/test/java/com/github/copilot/E2ETestContext.java index 9680148ff6..2bc139d940 100644 --- a/src/test/java/com/github/copilot/sdk/E2ETestContext.java +++ b/src/test/java/com/github/copilot/E2ETestContext.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.io.BufferedReader; import java.io.IOException; @@ -18,7 +18,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.github.copilot.sdk.json.CopilotClientOptions; +import com.github.copilot.rpc.CopilotClientOptions; /** * E2E test context that manages the test environment including the CapiProxy, @@ -121,6 +121,13 @@ public Path getWorkDir() { return workDir; } + /** + * Gets the repository root for locating shared test assets. + */ + public Path getRepoRoot() { + return repoRoot; + } + /** * Gets the proxy URL. */ diff --git a/src/test/java/com/github/copilot/sdk/ElicitationTest.java b/src/test/java/com/github/copilot/ElicitationTest.java similarity index 90% rename from src/test/java/com/github/copilot/sdk/ElicitationTest.java rename to src/test/java/com/github/copilot/ElicitationTest.java index 1f62451276..2fcb03fe5e 100644 --- a/src/test/java/com/github/copilot/sdk/ElicitationTest.java +++ b/src/test/java/com/github/copilot/ElicitationTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -12,18 +12,18 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.ElicitationContext; -import com.github.copilot.sdk.json.ElicitationHandler; -import com.github.copilot.sdk.json.ElicitationParams; -import com.github.copilot.sdk.json.ElicitationResult; -import com.github.copilot.sdk.json.ElicitationResultAction; -import com.github.copilot.sdk.json.ElicitationSchema; -import com.github.copilot.sdk.json.InputOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionCapabilities; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionUiCapabilities; +import com.github.copilot.rpc.ElicitationContext; +import com.github.copilot.rpc.ElicitationHandler; +import com.github.copilot.rpc.ElicitationParams; +import com.github.copilot.rpc.ElicitationResult; +import com.github.copilot.rpc.ElicitationResultAction; +import com.github.copilot.rpc.ElicitationSchema; +import com.github.copilot.rpc.InputOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionCapabilities; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionUiCapabilities; /** * Unit tests for the Elicitation feature and Session Capabilities. diff --git a/src/test/java/com/github/copilot/sdk/ErrorHandlingTest.java b/src/test/java/com/github/copilot/ErrorHandlingTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/ErrorHandlingTest.java rename to src/test/java/com/github/copilot/ErrorHandlingTest.java index 8c606930a7..32579ffc4e 100644 --- a/src/test/java/com/github/copilot/sdk/ErrorHandlingTest.java +++ b/src/test/java/com/github/copilot/ErrorHandlingTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -16,13 +16,13 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionErrorEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.ToolDefinition; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionErrorEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.ToolDefinition; import java.util.Map; @@ -84,7 +84,7 @@ void testHandlesToolCallingErrors_toolErrorDoesNotCrashSession() throws Exceptio assertNotNull(response, "Should receive a response even when tool fails"); // Should have received session.idle (indicating successful completion) - assertTrue(allEvents.stream().anyMatch(e -> e instanceof com.github.copilot.sdk.generated.SessionIdleEvent), + assertTrue(allEvents.stream().anyMatch(e -> e instanceof com.github.copilot.generated.SessionIdleEvent), "Session should reach idle state after handling tool error"); session.close(); diff --git a/src/test/java/com/github/copilot/sdk/EventFidelityTest.java b/src/test/java/com/github/copilot/EventFidelityTest.java similarity index 91% rename from src/test/java/com/github/copilot/sdk/EventFidelityTest.java rename to src/test/java/com/github/copilot/EventFidelityTest.java index 60b8e13275..cca63b4d67 100644 --- a/src/test/java/com/github/copilot/sdk/EventFidelityTest.java +++ b/src/test/java/com/github/copilot/EventFidelityTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -14,12 +14,12 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.AssistantUsageEvent; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.SessionUsageInfoEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.generated.AssistantUsageEvent; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.SessionUsageInfoEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; /** * E2E tests for event fidelity — verifying the shape, ordering, and presence of diff --git a/src/test/java/com/github/copilot/sdk/ExecutorWiringTest.java b/src/test/java/com/github/copilot/ExecutorWiringTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/ExecutorWiringTest.java rename to src/test/java/com/github/copilot/ExecutorWiringTest.java index a5eb3a62dc..78764db0fb 100644 --- a/src/test/java/com/github/copilot/sdk/ExecutorWiringTest.java +++ b/src/test/java/com/github/copilot/ExecutorWiringTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -21,17 +21,17 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PermissionRequestResultKind; -import com.github.copilot.sdk.json.PreToolUseHookOutput; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionHooks; -import com.github.copilot.sdk.json.ToolDefinition; -import com.github.copilot.sdk.json.UserInputResponse; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PermissionRequestResultKind; +import com.github.copilot.rpc.PreToolUseHookOutput; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionHooks; +import com.github.copilot.rpc.ToolDefinition; +import com.github.copilot.rpc.UserInputResponse; /** * Tests verifying that when an {@link Executor} is provided via diff --git a/src/test/java/com/github/copilot/sdk/ForwardCompatibilityTest.java b/src/test/java/com/github/copilot/ForwardCompatibilityTest.java similarity index 94% rename from src/test/java/com/github/copilot/sdk/ForwardCompatibilityTest.java rename to src/test/java/com/github/copilot/ForwardCompatibilityTest.java index 06e2af5cf0..40166307e3 100644 --- a/src/test/java/com/github/copilot/sdk/ForwardCompatibilityTest.java +++ b/src/test/java/com/github/copilot/ForwardCompatibilityTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -10,9 +10,9 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.UnknownSessionEvent; -import com.github.copilot.sdk.generated.UserMessageEvent; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.UnknownSessionEvent; +import com.github.copilot.generated.UserMessageEvent; /** * Unit tests for forward-compatible handling of unknown session event types. diff --git a/src/test/java/com/github/copilot/sdk/HooksTest.java b/src/test/java/com/github/copilot/HooksTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/HooksTest.java rename to src/test/java/com/github/copilot/HooksTest.java index 1278d082b5..4608848f19 100644 --- a/src/test/java/com/github/copilot/sdk/HooksTest.java +++ b/src/test/java/com/github/copilot/HooksTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -18,13 +18,13 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.PostToolUseHookInput; -import com.github.copilot.sdk.json.PreToolUseHookInput; -import com.github.copilot.sdk.json.PreToolUseHookOutput; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionHooks; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.PostToolUseHookInput; +import com.github.copilot.rpc.PreToolUseHookInput; +import com.github.copilot.rpc.PreToolUseHookOutput; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionHooks; /** * Tests for hooks functionality (pre-tool-use and post-tool-use hooks). diff --git a/src/test/java/com/github/copilot/sdk/JsonIncludeNonNullTest.java b/src/test/java/com/github/copilot/JsonIncludeNonNullTest.java similarity index 89% rename from src/test/java/com/github/copilot/sdk/JsonIncludeNonNullTest.java rename to src/test/java/com/github/copilot/JsonIncludeNonNullTest.java index 7465507f50..7a9554b7b4 100644 --- a/src/test/java/com/github/copilot/sdk/JsonIncludeNonNullTest.java +++ b/src/test/java/com/github/copilot/JsonIncludeNonNullTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -12,20 +12,20 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.CustomAgentConfig; -import com.github.copilot.sdk.json.InfiniteSessionConfig; -import com.github.copilot.sdk.json.InputOptions; -import com.github.copilot.sdk.json.ModelCapabilitiesOverride; -import com.github.copilot.sdk.json.ProviderConfig; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionUiCapabilities; -import com.github.copilot.sdk.json.TelemetryConfig; -import com.github.copilot.sdk.json.UserInputRequest; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.CustomAgentConfig; +import com.github.copilot.rpc.InfiniteSessionConfig; +import com.github.copilot.rpc.InputOptions; +import com.github.copilot.rpc.ModelCapabilitiesOverride; +import com.github.copilot.rpc.ProviderConfig; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionUiCapabilities; +import com.github.copilot.rpc.TelemetryConfig; +import com.github.copilot.rpc.UserInputRequest; /** - * Verifies that public DTO classes in the {@code com.github.copilot.sdk.json} + * Verifies that public DTO classes in the {@code com.github.copilot.rpc} * package are annotated with {@code @JsonInclude(JsonInclude.Include.NON_NULL)} * so that null-valued fields are omitted during JSON serialization. */ diff --git a/src/test/java/com/github/copilot/sdk/JsonRpcClientTest.java b/src/test/java/com/github/copilot/JsonRpcClientTest.java similarity index 99% rename from src/test/java/com/github/copilot/sdk/JsonRpcClientTest.java rename to src/test/java/com/github/copilot/JsonRpcClientTest.java index 4fb43f4b62..3491ac8ab4 100644 --- a/src/test/java/com/github/copilot/sdk/JsonRpcClientTest.java +++ b/src/test/java/com/github/copilot/JsonRpcClientTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; diff --git a/src/test/java/com/github/copilot/sdk/LifecycleEventManagerTest.java b/src/test/java/com/github/copilot/LifecycleEventManagerTest.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/LifecycleEventManagerTest.java rename to src/test/java/com/github/copilot/LifecycleEventManagerTest.java index 1500f2794f..6ec6fb5a32 100644 --- a/src/test/java/com/github/copilot/sdk/LifecycleEventManagerTest.java +++ b/src/test/java/com/github/copilot/LifecycleEventManagerTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -11,7 +11,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.SessionLifecycleEvent; +import com.github.copilot.rpc.SessionLifecycleEvent; /** * Unit tests for {@link LifecycleEventManager} covering subscribe, unsubscribe, diff --git a/src/test/java/com/github/copilot/sdk/McpAndAgentsTest.java b/src/test/java/com/github/copilot/McpAndAgentsTest.java similarity index 80% rename from src/test/java/com/github/copilot/sdk/McpAndAgentsTest.java rename to src/test/java/com/github/copilot/McpAndAgentsTest.java index a7d81646b3..f39e56eab3 100644 --- a/src/test/java/com/github/copilot/sdk/McpAndAgentsTest.java +++ b/src/test/java/com/github/copilot/McpAndAgentsTest.java @@ -2,10 +2,11 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.Path; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -16,16 +17,17 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.CustomAgentConfig; -import com.github.copilot.sdk.json.DefaultAgentConfig; -import com.github.copilot.sdk.json.McpServerConfig; -import com.github.copilot.sdk.json.McpStdioServerConfig; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.ToolDefinition; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.rpc.McpServerStatus; +import com.github.copilot.rpc.CustomAgentConfig; +import com.github.copilot.rpc.DefaultAgentConfig; +import com.github.copilot.rpc.McpServerConfig; +import com.github.copilot.rpc.McpStdioServerConfig; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.ToolDefinition; /** * Tests for MCP Servers and Custom Agents functionality. @@ -51,9 +53,33 @@ static void teardown() throws Exception { } } - // Helper method to create an MCP stdio server configuration - private McpStdioServerConfig createLocalMcpServer(String command, List args) { - return new McpStdioServerConfig().setCommand(command).setArgs(args).setTools(List.of("*")); + private Map createTestMcpServers(String... serverNames) { + Map servers = new HashMap<>(); + for (String serverName : serverNames) { + servers.put(serverName, createTestMcpServer()); + } + return servers; + } + + private McpStdioServerConfig createTestMcpServer() { + Path harnessDir = ctx.getRepoRoot().resolve("test").resolve("harness"); + return new McpStdioServerConfig().setCommand("node") + .setArgs(List.of(harnessDir.resolve("test-mcp-server.mjs").toString())) + .setWorkingDirectory(harnessDir.toString()).setTools(List.of("*")); + } + + private void waitForMcpServerStatus(CopilotSession session, String serverName, McpServerStatus expectedStatus) + throws Exception { + long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(60); + while (System.nanoTime() < deadline) { + var result = session.getRpc().mcp.list().get(5, TimeUnit.SECONDS); + if (result.servers() != null && result.servers().stream() + .anyMatch(server -> serverName.equals(server.name()) && expectedStatus == server.status())) { + return; + } + Thread.sleep(200); + } + fail(serverName + " did not reach " + expectedStatus); } // ============ MCP Server Tests ============ @@ -68,8 +94,7 @@ private McpStdioServerConfig createLocalMcpServer(String command, List a void testShouldAcceptMcpServerConfigurationOnSessionCreate() throws Exception { ctx.configureForTest("mcp_and_agents", "should_accept_mcp_server_configuration_on_session_create"); - var mcpServers = new HashMap(); - mcpServers.put("test-server", createLocalMcpServer("echo", List.of("hello"))); + var mcpServers = createTestMcpServers("test-server"); try (CopilotClient client = ctx.createClient()) { CopilotSession session = client.createSession( @@ -77,6 +102,7 @@ void testShouldAcceptMcpServerConfigurationOnSessionCreate() throws Exception { .get(); assertNotNull(session.getSessionId()); + waitForMcpServerStatus(session, "test-server", McpServerStatus.CONNECTED); // Simple interaction to verify session works AssistantMessageEvent response = session.sendAndWait(new MessageOptions().setPrompt("What is 2+2?")).get(60, @@ -108,20 +134,13 @@ void testShouldAcceptMcpServerConfigurationOnSessionResume() throws Exception { session1.sendAndWait(new MessageOptions().setPrompt("What is 1+1?")).get(60, TimeUnit.SECONDS); // Resume with MCP servers - var mcpServers = new HashMap(); - mcpServers.put("test-server", createLocalMcpServer("echo", List.of("hello"))); + var mcpServers = createTestMcpServers("test-server"); CopilotSession session2 = client.resumeSession(sessionId, new ResumeSessionConfig() .setMcpServers(mcpServers).setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get(); assertEquals(sessionId, session2.getSessionId()); - - AssistantMessageEvent response = session2.sendAndWait(new MessageOptions().setPrompt("What is 3+3?")) - .get(60, TimeUnit.SECONDS); - - assertNotNull(response); - assertTrue(response.getData().content().contains("6"), - "Response should contain 6: " + response.getData().content()); + waitForMcpServerStatus(session2, "test-server", McpServerStatus.CONNECTED); session2.close(); } @@ -139,9 +158,36 @@ void testShouldHandleMultipleMcpServers() throws Exception { // count ctx.configureForTest("mcp_and_agents", "should_accept_mcp_server_configuration_on_session_create"); + var mcpServers = createTestMcpServers("server1", "server2"); + + try (CopilotClient client = ctx.createClient()) { + CopilotSession session = client.createSession( + new SessionConfig().setMcpServers(mcpServers).setOnPermissionRequest(PermissionHandler.APPROVE_ALL)) + .get(); + + assertNotNull(session.getSessionId()); + waitForMcpServerStatus(session, "server1", McpServerStatus.CONNECTED); + waitForMcpServerStatus(session, "server2", McpServerStatus.CONNECTED); + session.close(); + } + } + + // ============ Custom Agent Tests ============ + + /** + * Verifies that MCP server configuration is accepted without args. + * + * @see Snapshot: + * mcp_and_agents/should_accept_mcp_server_configuration_on_session_create + */ + @Test + void testAcceptMcpServerConfigWithoutArgs() throws Exception { + // Reuse existing snapshot - this test validates that args can be omitted + ctx.configureForTest("mcp_and_agents", "should_accept_mcp_server_configuration_on_session_create"); + var mcpServers = new HashMap(); - mcpServers.put("server1", createLocalMcpServer("echo", List.of("server1"))); - mcpServers.put("server2", createLocalMcpServer("echo", List.of("server2"))); + // Create MCP server config without specifying args + mcpServers.put("test-server", new McpStdioServerConfig().setCommand("echo").setTools(List.of("*"))); try (CopilotClient client = ctx.createClient()) { CopilotSession session = client.createSession( @@ -149,6 +195,14 @@ void testShouldHandleMultipleMcpServers() throws Exception { .get(); assertNotNull(session.getSessionId()); + + AssistantMessageEvent response = session.sendAndWait(new MessageOptions().setPrompt("What is 2+2?")).get(60, + TimeUnit.SECONDS); + + assertNotNull(response); + assertTrue(response.getData().content().contains("4"), + "Response should contain 4: " + response.getData().content()); + session.close(); } } @@ -261,8 +315,7 @@ void testShouldAcceptCustomAgentWithMcpServers() throws Exception { // Use combined snapshot since this uses both MCP servers and custom agents ctx.configureForTest("mcp_and_agents", "should_accept_both_mcp_servers_and_custom_agents"); - var agentMcpServers = new HashMap(); - agentMcpServers.put("agent-server", createLocalMcpServer("echo", List.of("agent-mcp"))); + var agentMcpServers = createTestMcpServers("agent-server"); List customAgents = List.of(new CustomAgentConfig().setName("mcp-agent") .setDisplayName("MCP Agent").setDescription("An agent with its own MCP servers") @@ -315,8 +368,7 @@ void testShouldAcceptMultipleCustomAgents() throws Exception { void testShouldAcceptBothMcpServersAndCustomAgents() throws Exception { ctx.configureForTest("mcp_and_agents", "should_accept_both_mcp_servers_and_custom_agents"); - var mcpServers = new HashMap(); - mcpServers.put("shared-server", createLocalMcpServer("echo", List.of("shared"))); + var mcpServers = createTestMcpServers("shared-server"); List customAgents = List.of(new CustomAgentConfig().setName("combined-agent") .setDisplayName("Combined Agent").setDescription("An agent using shared MCP servers") @@ -327,6 +379,7 @@ void testShouldAcceptBothMcpServersAndCustomAgents() throws Exception { .setCustomAgents(customAgents).setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get(); assertNotNull(session.getSessionId()); + waitForMcpServerStatus(session, "shared-server", McpServerStatus.CONNECTED); AssistantMessageEvent response = session.sendAndWait(new MessageOptions().setPrompt("What is 7+7?")).get(60, TimeUnit.SECONDS); diff --git a/src/test/java/com/github/copilot/sdk/MessageAttachmentTest.java b/src/test/java/com/github/copilot/MessageAttachmentTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/MessageAttachmentTest.java rename to src/test/java/com/github/copilot/MessageAttachmentTest.java index 3150cecc2e..27e9f56cc3 100644 --- a/src/test/java/com/github/copilot/sdk/MessageAttachmentTest.java +++ b/src/test/java/com/github/copilot/MessageAttachmentTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -12,11 +12,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.json.Attachment; -import com.github.copilot.sdk.json.BlobAttachment; -import com.github.copilot.sdk.json.MessageAttachment; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.SendMessageRequest; +import com.github.copilot.rpc.Attachment; +import com.github.copilot.rpc.BlobAttachment; +import com.github.copilot.rpc.MessageAttachment; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.SendMessageRequest; /** * Tests for the {@link MessageAttachment} sealed interface and type-safe diff --git a/src/test/java/com/github/copilot/sdk/MetadataApiTest.java b/src/test/java/com/github/copilot/MetadataApiTest.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/MetadataApiTest.java rename to src/test/java/com/github/copilot/MetadataApiTest.java index 3a9120a525..b2c775eb13 100644 --- a/src/test/java/com/github/copilot/sdk/MetadataApiTest.java +++ b/src/test/java/com/github/copilot/MetadataApiTest.java @@ -2,12 +2,12 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.ToolExecutionProgressEvent; -import com.github.copilot.sdk.json.*; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.ToolExecutionProgressEvent; +import com.github.copilot.rpc.*; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/github/copilot/sdk/ModeHandlersTest.java b/src/test/java/com/github/copilot/ModeHandlersTest.java similarity index 87% rename from src/test/java/com/github/copilot/sdk/ModeHandlersTest.java rename to src/test/java/com/github/copilot/ModeHandlersTest.java index 0c84b05736..62202c903e 100644 --- a/src/test/java/com/github/copilot/sdk/ModeHandlersTest.java +++ b/src/test/java/com/github/copilot/ModeHandlersTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -15,16 +15,17 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.ExitPlanModeCompletedEvent; -import com.github.copilot.sdk.generated.ExitPlanModeRequestedEvent; -import com.github.copilot.sdk.json.AutoModeSwitchRequest; -import com.github.copilot.sdk.json.AutoModeSwitchResponse; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.ExitPlanModeRequest; -import com.github.copilot.sdk.json.ExitPlanModeResult; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.generated.ExitPlanModeAction; +import com.github.copilot.generated.ExitPlanModeCompletedEvent; +import com.github.copilot.generated.ExitPlanModeRequestedEvent; +import com.github.copilot.rpc.AutoModeSwitchRequest; +import com.github.copilot.rpc.AutoModeSwitchResponse; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.ExitPlanModeRequest; +import com.github.copilot.rpc.ExitPlanModeResult; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; /** * E2E tests for exit-plan-mode and auto-mode-switch handler APIs. @@ -89,7 +90,7 @@ void shouldInvokeExitPlanModeHandlerWhenModelUsesTool() throws Exception { requestedEvent.complete(requested); } else if (event instanceof ExitPlanModeCompletedEvent completed && Boolean.TRUE.equals(completed.getData().approved()) - && "interactive".equals(completed.getData().selectedAction())) { + && ExitPlanModeAction.INTERACTIVE == completed.getData().selectedAction()) { completedEvent.complete(completed); } }); @@ -109,7 +110,7 @@ void shouldInvokeExitPlanModeHandlerWhenModelUsesTool() throws Exception { var compEvent = completedEvent.get(10, TimeUnit.SECONDS); assertTrue(compEvent.getData().approved()); - assertEquals("interactive", compEvent.getData().selectedAction()); + assertEquals(ExitPlanModeAction.INTERACTIVE, compEvent.getData().selectedAction()); assertNotNull(response); diff --git a/src/test/java/com/github/copilot/sdk/ModelInfoTest.java b/src/test/java/com/github/copilot/ModelInfoTest.java similarity index 91% rename from src/test/java/com/github/copilot/sdk/ModelInfoTest.java rename to src/test/java/com/github/copilot/ModelInfoTest.java index f36d0c4bd7..b4936d1cca 100644 --- a/src/test/java/com/github/copilot/sdk/ModelInfoTest.java +++ b/src/test/java/com/github/copilot/ModelInfoTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -10,9 +10,9 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.ModelInfo; -import com.github.copilot.sdk.json.ModelSupports; -import com.github.copilot.sdk.json.SessionMetadata; +import com.github.copilot.rpc.ModelInfo; +import com.github.copilot.rpc.ModelSupports; +import com.github.copilot.rpc.SessionMetadata; /** * Unit tests for {@link ModelInfo}, {@link ModelSupports}, and diff --git a/src/test/java/com/github/copilot/sdk/ModuleDescriptorTest.java b/src/test/java/com/github/copilot/ModuleDescriptorTest.java similarity index 75% rename from src/test/java/com/github/copilot/sdk/ModuleDescriptorTest.java rename to src/test/java/com/github/copilot/ModuleDescriptorTest.java index 36be137345..f7c16bb233 100644 --- a/src/test/java/com/github/copilot/sdk/ModuleDescriptorTest.java +++ b/src/test/java/com/github/copilot/ModuleDescriptorTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -16,12 +16,11 @@ class ModuleDescriptorTest { void sdkHasExplicitModuleDescriptor() { Module module = CopilotClient.class.getModule(); assertTrue(module.isNamed()); - assertEquals("com.github.copilot.sdk.java", module.getName()); + assertEquals("com.github.copilot.java", module.getName()); ModuleDescriptor descriptor = module.getDescriptor(); - assertTrue(descriptor.exports().stream().anyMatch(export -> export.source().equals("com.github.copilot.sdk"))); - assertTrue(descriptor.exports().stream() - .anyMatch(export -> export.source().equals("com.github.copilot.sdk.json"))); + assertTrue(descriptor.exports().stream().anyMatch(export -> export.source().equals("com.github.copilot"))); + assertTrue(descriptor.exports().stream().anyMatch(export -> export.source().equals("com.github.copilot.rpc"))); assertTrue(descriptor.requires().stream() .anyMatch(require -> require.name().equals("com.fasterxml.jackson.databind"))); } diff --git a/src/test/java/com/github/copilot/sdk/OptionalApiAndJacksonTest.java b/src/test/java/com/github/copilot/OptionalApiAndJacksonTest.java similarity index 97% rename from src/test/java/com/github/copilot/sdk/OptionalApiAndJacksonTest.java rename to src/test/java/com/github/copilot/OptionalApiAndJacksonTest.java index 2a9770e2e2..1db593dbe2 100644 --- a/src/test/java/com/github/copilot/sdk/OptionalApiAndJacksonTest.java +++ b/src/test/java/com/github/copilot/OptionalApiAndJacksonTest.java @@ -2,22 +2,22 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.CustomAgentConfig; -import com.github.copilot.sdk.json.InfiniteSessionConfig; -import com.github.copilot.sdk.json.InputOptions; -import com.github.copilot.sdk.json.ModelCapabilitiesOverride; -import com.github.copilot.sdk.json.ProviderConfig; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionUiCapabilities; -import com.github.copilot.sdk.json.TelemetryConfig; -import com.github.copilot.sdk.json.UserInputRequest; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.CustomAgentConfig; +import com.github.copilot.rpc.InfiniteSessionConfig; +import com.github.copilot.rpc.InputOptions; +import com.github.copilot.rpc.ModelCapabilitiesOverride; +import com.github.copilot.rpc.ProviderConfig; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionUiCapabilities; +import com.github.copilot.rpc.TelemetryConfig; +import com.github.copilot.rpc.UserInputRequest; import org.junit.jupiter.api.Test; /** diff --git a/src/test/java/com/github/copilot/sdk/PerSessionAuthTest.java b/src/test/java/com/github/copilot/PerSessionAuthTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/PerSessionAuthTest.java rename to src/test/java/com/github/copilot/PerSessionAuthTest.java index dd5de81b83..000d36e4ba 100644 --- a/src/test/java/com/github/copilot/sdk/PerSessionAuthTest.java +++ b/src/test/java/com/github/copilot/PerSessionAuthTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -13,10 +13,10 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.rpc.SessionAuthGetStatusResult; -import com.github.copilot.sdk.json.CopilotClientOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.generated.rpc.SessionAuthGetStatusResult; +import com.github.copilot.rpc.CopilotClientOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; /** * Tests for per-session GitHub authentication. diff --git a/src/test/java/com/github/copilot/sdk/PermissionRequestResultKindTest.java b/src/test/java/com/github/copilot/PermissionRequestResultKindTest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/PermissionRequestResultKindTest.java rename to src/test/java/com/github/copilot/PermissionRequestResultKindTest.java index ab81966dc9..0bd08f47d7 100644 --- a/src/test/java/com/github/copilot/sdk/PermissionRequestResultKindTest.java +++ b/src/test/java/com/github/copilot/PermissionRequestResultKindTest.java @@ -2,15 +2,15 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PermissionRequestResultKind; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PermissionRequestResultKind; /** * Unit tests for {@link PermissionRequestResultKind}. diff --git a/src/test/java/com/github/copilot/PermissionRequestResultTest.java b/src/test/java/com/github/copilot/PermissionRequestResultTest.java new file mode 100644 index 0000000000..4a1ff03137 --- /dev/null +++ b/src/test/java/com/github/copilot/PermissionRequestResultTest.java @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import com.github.copilot.rpc.PermissionRequestResult; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.annotation.JsonInclude; + +/** + * Tests for {@link PermissionRequestResult} factory methods and feedback field. + */ +public class PermissionRequestResultTest { + + private static final ObjectMapper MAPPER = JsonMapper.builder().serializationInclusion(JsonInclude.Include.NON_NULL) + .build(); + + @Test + void testApproveOnce() { + var result = PermissionRequestResult.approveOnce(); + assertEquals("approve-once", result.getKind()); + assertNull(result.getFeedback()); + } + + @Test + void testRejectWithFeedback() { + var result = PermissionRequestResult.reject("Not allowed"); + assertEquals("reject", result.getKind()); + assertEquals("Not allowed", result.getFeedback()); + } + + @Test + void testRejectWithoutFeedback() { + var result = PermissionRequestResult.reject(null); + assertEquals("reject", result.getKind()); + assertNull(result.getFeedback()); + } + + @Test + void testUserNotAvailable() { + var result = PermissionRequestResult.userNotAvailable(); + assertEquals("user-not-available", result.getKind()); + assertNull(result.getFeedback()); + } + + @Test + void testNoResult() { + var result = PermissionRequestResult.noResult(); + assertEquals("no-result", result.getKind()); + assertNull(result.getFeedback()); + } + + @Test + void testFeedbackSerialized() throws Exception { + var result = PermissionRequestResult.reject("Unsafe operation"); + var json = MAPPER.writeValueAsString(result); + assertTrue(json.contains("\"feedback\":\"Unsafe operation\"")); + assertTrue(json.contains("\"kind\":\"reject\"")); + } + + @Test + void testFeedbackNotSerializedWhenNull() throws Exception { + var result = PermissionRequestResult.approveOnce(); + var json = MAPPER.writeValueAsString(result); + assertFalse(json.contains("feedback")); + } +} diff --git a/src/test/java/com/github/copilot/sdk/PermissionsTest.java b/src/test/java/com/github/copilot/PermissionsTest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/PermissionsTest.java rename to src/test/java/com/github/copilot/PermissionsTest.java index 041d8181cb..6f10f353c2 100644 --- a/src/test/java/com/github/copilot/sdk/PermissionsTest.java +++ b/src/test/java/com/github/copilot/PermissionsTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -17,15 +17,15 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.ToolExecutionCompleteEvent; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.PermissionRequest; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PermissionRequestResultKind; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.MessageOptions; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.ToolExecutionCompleteEvent; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.PermissionRequest; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PermissionRequestResultKind; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.MessageOptions; /** * Tests for permission callback functionality. @@ -417,8 +417,8 @@ void testShouldShortCircuitPermissionHandlerWhenSetApproveAllEnabled() throws Ex // Set approve-all so the runtime short-circuits var setResult = session.getRpc().permissions - .setApproveAll(new com.github.copilot.sdk.generated.rpc.SessionPermissionsSetApproveAllParams( - session.getSessionId(), true)) + .setApproveAll(new com.github.copilot.generated.rpc.SessionPermissionsSetApproveAllParams( + session.getSessionId(), true, null)) .get(10, TimeUnit.SECONDS); assertTrue(setResult.success(), "setApproveAll should succeed"); diff --git a/src/test/java/com/github/copilot/PreMcpToolCallHookTest.java b/src/test/java/com/github/copilot/PreMcpToolCallHookTest.java new file mode 100644 index 0000000000..5da0d2002f --- /dev/null +++ b/src/test/java/com/github/copilot/PreMcpToolCallHookTest.java @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.McpServerConfig; +import com.github.copilot.rpc.McpStdioServerConfig; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.PreMcpToolCallHookInput; +import com.github.copilot.rpc.PreMcpToolCallHookOutput; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionHooks; + +/** + * Tests for preMcpToolCall hook functionality. + * + *

+ * These tests use the shared CapiProxy infrastructure for deterministic API + * response replay. Snapshots are stored in + * test/snapshots/pre_mcp_tool_call_hook/. + *

+ */ +public class PreMcpToolCallHookTest { + + private static final ObjectMapper MAPPER = JsonRpcClient.getObjectMapper(); + private static E2ETestContext ctx; + + @BeforeAll + static void setup() throws Exception { + ctx = E2ETestContext.create(); + } + + @AfterAll + static void teardown() throws Exception { + if (ctx != null) { + ctx.close(); + } + } + + /** + * Verifies that preMcpToolCall hook can set metadata on the MCP request. + * + * @see Snapshot: pre_mcp_tool_call_hook/should_set_meta_via_premcptoolcall_hook + */ + @Disabled("Requires snapshot: pre_mcp_tool_call_hook/should_set_meta_via_premcptoolcall_hook") + @Test + void testShouldSetMetaViaPreMcpToolCallHook() throws Exception { + ctx.configureForTest("pre_mcp_tool_call_hook", "should_set_meta_via_premcptoolcall_hook"); + + var hookInputs = new java.util.ArrayList(); + + var mcpServers = new HashMap(); + mcpServers.put("meta-echo", new McpStdioServerConfig().setCommand("npx").setArgs(List.of("-y", "mcp-meta-echo")) + .setTools(List.of("*")).setWorkingDirectory(ctx.getWorkDir().toString())); + + var hooks = new SessionHooks().setOnPreMcpToolCall((input, invocation) -> { + hookInputs.add(input); + JsonNode metaNode = MAPPER.valueToTree(Map.of("injected", "by-hook", "source", "test")); + return CompletableFuture.completedFuture(PreMcpToolCallHookOutput.withMeta(metaNode)); + }); + + try (CopilotClient client = ctx.createClient()) { + CopilotSession session = client.createSession(new SessionConfig().setMcpServers(mcpServers).setHooks(hooks) + .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get(); + + AssistantMessageEvent response = session.sendAndWait(new MessageOptions().setPrompt( + "Use the meta-echo/echo_meta tool with value 'test-set'. Reply with just the raw tool result.")) + .get(60, TimeUnit.SECONDS); + + assertNotNull(response); + assertFalse(hookInputs.isEmpty(), "Should have received preMcpToolCall hook calls"); + + // Verify hook input fields + PreMcpToolCallHookInput hookInput = hookInputs.get(0); + assertEquals("meta-echo", hookInput.getServerName()); + assertNotNull(hookInput.getToolName()); + assertNotNull(hookInput.getCwd()); + assertTrue(hookInput.getTimestamp() > 0); + + // Verify the response contains the injected metadata + String content = response.getData().content(); + assertTrue(content.contains("by-hook"), "Response should contain injected metadata: " + content); + + session.close(); + } + } + + /** + * Verifies that preMcpToolCall hook can replace existing metadata. + * + * @see Snapshot: + * pre_mcp_tool_call_hook/should_replace_meta_via_premcptoolcall_hook + */ + @Disabled("Requires snapshot: pre_mcp_tool_call_hook/should_replace_meta_via_premcptoolcall_hook") + @Test + void testShouldReplaceMetaViaPreMcpToolCallHook() throws Exception { + ctx.configureForTest("pre_mcp_tool_call_hook", "should_replace_meta_via_premcptoolcall_hook"); + + var mcpServers = new HashMap(); + mcpServers.put("meta-echo", new McpStdioServerConfig().setCommand("npx").setArgs(List.of("-y", "mcp-meta-echo")) + .setTools(List.of("*")).setWorkingDirectory(ctx.getWorkDir().toString())); + + var hooks = new SessionHooks().setOnPreMcpToolCall((input, invocation) -> { + JsonNode metaNode = MAPPER.valueToTree(Map.of("replaced", "true", "original", "gone")); + return CompletableFuture.completedFuture(PreMcpToolCallHookOutput.withMeta(metaNode)); + }); + + try (CopilotClient client = ctx.createClient()) { + CopilotSession session = client.createSession(new SessionConfig().setMcpServers(mcpServers).setHooks(hooks) + .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get(); + + AssistantMessageEvent response = session.sendAndWait(new MessageOptions().setPrompt( + "Use the meta-echo/echo_meta tool with value 'test-replace'. Reply with just the raw tool result.")) + .get(60, TimeUnit.SECONDS); + + assertNotNull(response); + + // Verify the response contains the replaced metadata + String content = response.getData().content(); + assertTrue(content.contains("replaced"), "Response should contain replaced metadata: " + content); + + session.close(); + } + } + + /** + * Verifies that preMcpToolCall hook can remove metadata from the MCP request. + * + * @see Snapshot: + * pre_mcp_tool_call_hook/should_remove_meta_via_premcptoolcall_hook + */ + @Disabled("Requires snapshot: pre_mcp_tool_call_hook/should_remove_meta_via_premcptoolcall_hook") + @Test + void testShouldRemoveMetaViaPreMcpToolCallHook() throws Exception { + ctx.configureForTest("pre_mcp_tool_call_hook", "should_remove_meta_via_premcptoolcall_hook"); + + var mcpServers = new HashMap(); + mcpServers.put("meta-echo", new McpStdioServerConfig().setCommand("npx").setArgs(List.of("-y", "mcp-meta-echo")) + .setTools(List.of("*")).setWorkingDirectory(ctx.getWorkDir().toString())); + + var hooks = new SessionHooks().setOnPreMcpToolCall((input, invocation) -> { + // Return output with null metaToUse to remove metadata + return CompletableFuture.completedFuture(PreMcpToolCallHookOutput.removeMeta()); + }); + + try (CopilotClient client = ctx.createClient()) { + CopilotSession session = client.createSession(new SessionConfig().setMcpServers(mcpServers).setHooks(hooks) + .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)).get(); + + AssistantMessageEvent response = session.sendAndWait(new MessageOptions().setPrompt( + "Use the meta-echo/echo_meta tool with value 'test-remove'. Reply with just the raw tool result.")) + .get(60, TimeUnit.SECONDS); + + assertNotNull(response); + + session.close(); + } + } +} diff --git a/src/test/java/com/github/copilot/sdk/ProviderConfigTest.java b/src/test/java/com/github/copilot/ProviderConfigTest.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/ProviderConfigTest.java rename to src/test/java/com/github/copilot/ProviderConfigTest.java index 6bbb3ae284..5c40230ecc 100644 --- a/src/test/java/com/github/copilot/sdk/ProviderConfigTest.java +++ b/src/test/java/com/github/copilot/ProviderConfigTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -14,10 +14,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.json.AzureOptions; -import com.github.copilot.sdk.json.ProviderConfig; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.rpc.AzureOptions; +import com.github.copilot.rpc.ProviderConfig; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; /** * Tests for {@link ProviderConfig} and {@link AzureOptions} BYOK (Bring Your diff --git a/src/test/java/com/github/copilot/sdk/RemoteSessionTest.java b/src/test/java/com/github/copilot/RemoteSessionTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/RemoteSessionTest.java rename to src/test/java/com/github/copilot/RemoteSessionTest.java index 6e093db6ca..67c5f5bb6a 100644 --- a/src/test/java/com/github/copilot/sdk/RemoteSessionTest.java +++ b/src/test/java/com/github/copilot/RemoteSessionTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -12,10 +12,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.json.CreateSessionRequest; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.ResumeSessionRequest; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.rpc.CreateSessionRequest; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.ResumeSessionRequest; +import com.github.copilot.rpc.SessionConfig; /** * Tests for the {@code remoteSession} feature across all session config types. @@ -368,12 +368,12 @@ void handoffEvent_withRemoteSourceType_containsRemoteSessionId() throws Exceptio } """; - var event = (com.github.copilot.sdk.generated.SessionHandoffEvent) MAPPER.readValue(json, - com.github.copilot.sdk.generated.SessionEvent.class); + var event = (com.github.copilot.generated.SessionHandoffEvent) MAPPER.readValue(json, + com.github.copilot.generated.SessionEvent.class); assertNotNull(event); var data = event.getData(); assertEquals("remote-sess-42", data.remoteSessionId()); - assertEquals(com.github.copilot.sdk.generated.HandoffSourceType.REMOTE, data.sourceType()); + assertEquals(com.github.copilot.generated.HandoffSourceType.REMOTE, data.sourceType()); assertEquals("Session exported for remote execution", data.summary()); assertEquals("test-org", data.repository().owner()); assertEquals("test-repo", data.repository().name()); @@ -391,8 +391,8 @@ void handoffEvent_withoutRemoteSessionId_fieldIsNull() throws Exception { } """; - var event = (com.github.copilot.sdk.generated.SessionHandoffEvent) MAPPER.readValue(json, - com.github.copilot.sdk.generated.SessionEvent.class); + var event = (com.github.copilot.generated.SessionHandoffEvent) MAPPER.readValue(json, + com.github.copilot.generated.SessionEvent.class); assertNotNull(event); assertNull(event.getData().remoteSessionId()); } diff --git a/src/test/java/com/github/copilot/sdk/RpcHandlerDispatcherTest.java b/src/test/java/com/github/copilot/RpcHandlerDispatcherTest.java similarity index 97% rename from src/test/java/com/github/copilot/sdk/RpcHandlerDispatcherTest.java rename to src/test/java/com/github/copilot/RpcHandlerDispatcherTest.java index 7453a7b266..76c2d41b29 100644 --- a/src/test/java/com/github/copilot/sdk/RpcHandlerDispatcherTest.java +++ b/src/test/java/com/github/copilot/RpcHandlerDispatcherTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -24,14 +24,14 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PermissionRequestResultKind; -import com.github.copilot.sdk.json.PreToolUseHookOutput; -import com.github.copilot.sdk.json.SessionHooks; -import com.github.copilot.sdk.json.SessionLifecycleEvent; -import com.github.copilot.sdk.json.ToolDefinition; -import com.github.copilot.sdk.json.ToolResultObject; -import com.github.copilot.sdk.json.UserInputResponse; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PermissionRequestResultKind; +import com.github.copilot.rpc.PreToolUseHookOutput; +import com.github.copilot.rpc.SessionHooks; +import com.github.copilot.rpc.SessionLifecycleEvent; +import com.github.copilot.rpc.ToolDefinition; +import com.github.copilot.rpc.ToolResultObject; +import com.github.copilot.rpc.UserInputResponse; /** * Unit tests for {@link RpcHandlerDispatcher} focusing on coverage gaps diff --git a/src/test/java/com/github/copilot/sdk/RpcWrappersTest.java b/src/test/java/com/github/copilot/RpcWrappersTest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/RpcWrappersTest.java rename to src/test/java/com/github/copilot/RpcWrappersTest.java index 519f9ebd43..7b01e1d386 100644 --- a/src/test/java/com/github/copilot/sdk/RpcWrappersTest.java +++ b/src/test/java/com/github/copilot/RpcWrappersTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -15,13 +15,13 @@ import org.junit.jupiter.api.Test; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.generated.rpc.McpConfigAddParams; -import com.github.copilot.sdk.generated.rpc.McpDiscoverParams; -import com.github.copilot.sdk.generated.rpc.RpcCaller; -import com.github.copilot.sdk.generated.rpc.ServerRpc; -import com.github.copilot.sdk.generated.rpc.SessionAgentSelectParams; -import com.github.copilot.sdk.generated.rpc.SessionModelSwitchToParams; -import com.github.copilot.sdk.generated.rpc.SessionRpc; +import com.github.copilot.generated.rpc.McpConfigAddParams; +import com.github.copilot.generated.rpc.McpDiscoverParams; +import com.github.copilot.generated.rpc.RpcCaller; +import com.github.copilot.generated.rpc.ServerRpc; +import com.github.copilot.generated.rpc.SessionAgentSelectParams; +import com.github.copilot.generated.rpc.SessionModelSwitchToParams; +import com.github.copilot.generated.rpc.SessionRpc; /** * Unit tests for the generated RPC wrapper classes ({@link ServerRpc} and @@ -90,7 +90,7 @@ void serverRpc_ping_passes_params_directly() { var stub = new StubCaller(); var server = new ServerRpc(stub); - var params = new com.github.copilot.sdk.generated.rpc.PingParams(null); + var params = new com.github.copilot.generated.rpc.PingParams(null); server.ping(params); assertEquals(1, stub.calls.size()); @@ -183,7 +183,7 @@ void sessionRpc_model_switchTo_merges_sessionId_with_extra_params() { var session = new SessionRpc(stub, "sess-xyz"); // switchTo takes extra params beyond sessionId - var switchParams = new SessionModelSwitchToParams(null, "gpt-5", null, null); + var switchParams = new SessionModelSwitchToParams(null, "gpt-5", null, null, null); session.model.switchTo(switchParams); assertEquals(1, stub.calls.size()); diff --git a/src/test/java/com/github/copilot/sdk/SchedulerShutdownRaceTest.java b/src/test/java/com/github/copilot/SchedulerShutdownRaceTest.java similarity index 97% rename from src/test/java/com/github/copilot/sdk/SchedulerShutdownRaceTest.java rename to src/test/java/com/github/copilot/SchedulerShutdownRaceTest.java index e60e4aa345..48a58bbc90 100644 --- a/src/test/java/com/github/copilot/sdk/SchedulerShutdownRaceTest.java +++ b/src/test/java/com/github/copilot/SchedulerShutdownRaceTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; @@ -16,7 +16,7 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.MessageOptions; +import com.github.copilot.rpc.MessageOptions; /** * Regression coverage for the race between {@code sendAndWait()} and diff --git a/src/test/java/com/github/copilot/sdk/SessionConfigE2ETest.java b/src/test/java/com/github/copilot/SessionConfigE2ETest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/SessionConfigE2ETest.java rename to src/test/java/com/github/copilot/SessionConfigE2ETest.java index 4c2691d86f..dbae0fe9f9 100644 --- a/src/test/java/com/github/copilot/sdk/SessionConfigE2ETest.java +++ b/src/test/java/com/github/copilot/SessionConfigE2ETest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -16,11 +16,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.ProviderConfig; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.ProviderConfig; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; /** * E2E tests for session configuration features. diff --git a/src/test/java/com/github/copilot/sdk/SessionEventDeserializationTest.java b/src/test/java/com/github/copilot/SessionEventDeserializationTest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/SessionEventDeserializationTest.java rename to src/test/java/com/github/copilot/SessionEventDeserializationTest.java index 109144e00e..07b4c2eed2 100644 --- a/src/test/java/com/github/copilot/sdk/SessionEventDeserializationTest.java +++ b/src/test/java/com/github/copilot/SessionEventDeserializationTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -12,7 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.generated.*; +import com.github.copilot.generated.*; /** * Tests for session event deserialization. @@ -792,10 +792,10 @@ void testParseSessionShutdownEvent() throws Exception { var shutdownEvent = (SessionShutdownEvent) event; assertEquals(ShutdownType.ROUTINE, shutdownEvent.getData().shutdownType()); - assertEquals(5.0, shutdownEvent.getData().totalPremiumRequests()); + assertEquals(Double.valueOf(5.0), shutdownEvent.getData().totalPremiumRequests()); assertEquals("gpt-4", shutdownEvent.getData().currentModel()); assertNotNull(shutdownEvent.getData().codeChanges()); - assertEquals(10.0, shutdownEvent.getData().codeChanges().linesAdded()); + assertEquals((Long) 10L, shutdownEvent.getData().codeChanges().linesAdded()); } @Test @@ -841,7 +841,7 @@ void testParseUnknownEventType() throws Exception { SessionEvent event = parseJson(json); assertNotNull(event, "Unknown event types should return an UnknownSessionEvent"); - assertInstanceOf(com.github.copilot.sdk.generated.UnknownSessionEvent.class, event, + assertInstanceOf(com.github.copilot.generated.UnknownSessionEvent.class, event, "Unknown event types should return UnknownSessionEvent for forward compatibility"); assertEquals("unknown.event.type", event.getType(), "UnknownSessionEvent should preserve the original type from JSON"); @@ -859,7 +859,7 @@ void testParseMissingTypeField() throws Exception { SessionEvent event = parseJson(json); assertNotNull(event, "Events without type field should return UnknownSessionEvent"); - assertInstanceOf(com.github.copilot.sdk.generated.UnknownSessionEvent.class, event); + assertInstanceOf(com.github.copilot.generated.UnknownSessionEvent.class, event); } @Test @@ -887,7 +887,7 @@ void testParseEmptyJson() throws Exception { SessionEvent event = parseJson(json); assertNotNull(event, "Empty JSON should return UnknownSessionEvent"); - assertInstanceOf(com.github.copilot.sdk.generated.UnknownSessionEvent.class, event); + assertInstanceOf(com.github.copilot.generated.UnknownSessionEvent.class, event); } // ========================================================================= @@ -1054,7 +1054,7 @@ void testSessionStartEventAllFields() throws Exception { assertNotNull(event); var data = event.getData(); assertEquals("sess-full", data.sessionId()); - assertEquals(2.0, data.version()); + assertEquals((Long) 2L, data.version()); assertEquals("copilot-cli", data.producer()); assertEquals("1.2.3", data.copilotVersion()); assertNotNull(data.startTime()); @@ -1077,7 +1077,7 @@ void testSessionResumeEventAllFields() throws Exception { assertNotNull(event); var data = event.getData(); assertNotNull(data.resumeTime()); - assertEquals(42.0, data.eventCount()); + assertEquals((Long) 42L, data.eventCount()); } @Test @@ -1178,13 +1178,13 @@ void testSessionTruncationEventAllFields() throws Exception { var event = (SessionTruncationEvent) parseJson(json); assertNotNull(event); var data = event.getData(); - assertEquals(128000.0, data.tokenLimit()); - assertEquals(150000.0, data.preTruncationTokensInMessages()); - assertEquals(100.0, data.preTruncationMessagesLength()); - assertEquals(120000.0, data.postTruncationTokensInMessages()); - assertEquals(80.0, data.postTruncationMessagesLength()); - assertEquals(30000.0, data.tokensRemovedDuringTruncation()); - assertEquals(20.0, data.messagesRemovedDuringTruncation()); + assertEquals((Long) 128000L, data.tokenLimit()); + assertEquals((Long) 150000L, data.preTruncationTokensInMessages()); + assertEquals((Long) 100L, data.preTruncationMessagesLength()); + assertEquals((Long) 120000L, data.postTruncationTokensInMessages()); + assertEquals((Long) 80L, data.postTruncationMessagesLength()); + assertEquals((Long) 30000L, data.tokensRemovedDuringTruncation()); + assertEquals((Long) 20L, data.messagesRemovedDuringTruncation()); assertEquals("system", data.performedBy()); } @@ -1204,9 +1204,9 @@ void testSessionUsageInfoEventAllFields() throws Exception { var event = (SessionUsageInfoEvent) parseJson(json); assertNotNull(event); var data = event.getData(); - assertEquals(128000.0, data.tokenLimit()); - assertEquals(50000.0, data.currentTokens()); - assertEquals(25.0, data.messagesLength()); + assertEquals((Long) 128000L, data.tokenLimit()); + assertEquals((Long) 50000L, data.currentTokens()); + assertEquals((Long) 25L, data.messagesLength()); } @Test @@ -1240,21 +1240,21 @@ void testSessionCompactionCompleteEventAllFields() throws Exception { var data = event.getData(); assertTrue(data.success()); assertNull(data.error()); - assertEquals(150000.0, data.preCompactionTokens()); - assertEquals(60000.0, data.postCompactionTokens()); - assertEquals(100.0, data.preCompactionMessagesLength()); - assertEquals(50.0, data.messagesRemoved()); - assertEquals(90000.0, data.tokensRemoved()); + assertEquals((Long) 150000L, data.preCompactionTokens()); + assertEquals((Long) 60000L, data.postCompactionTokens()); + assertEquals((Long) 100L, data.preCompactionMessagesLength()); + assertEquals((Long) 50L, data.messagesRemoved()); + assertEquals((Long) 90000L, data.tokensRemoved()); assertEquals("Compacted conversation", data.summaryContent()); - assertEquals(3.0, data.checkpointNumber()); + assertEquals((Long) 3L, data.checkpointNumber()); assertEquals("/checkpoints/3", data.checkpointPath()); assertEquals("req-compact-1", data.requestId()); var tokens = data.compactionTokensUsed(); assertNotNull(tokens); - assertEquals(1000.0, tokens.inputTokens()); - assertEquals(500.0, tokens.outputTokens()); - assertEquals(200.0, tokens.cacheReadTokens()); + assertEquals((Long) 1000L, tokens.inputTokens()); + assertEquals((Long) 500L, tokens.outputTokens()); + assertEquals((Long) 200L, tokens.cacheReadTokens()); } @Test @@ -1288,16 +1288,16 @@ void testSessionShutdownEventAllFields() throws Exception { var data = event.getData(); assertEquals(ShutdownType.ERROR, data.shutdownType()); assertEquals("OOM", data.errorReason()); - assertEquals(10.0, data.totalPremiumRequests()); - assertEquals(5000.5, data.totalApiDurationMs()); - assertEquals(1700000000000.0, data.sessionStartTime()); + assertEquals(Double.valueOf(10.0), data.totalPremiumRequests()); + assertEquals((Long) 5000L, data.totalApiDurationMs()); + assertEquals((Long) 1700000000000L, data.sessionStartTime()); assertEquals("gpt-4-turbo", data.currentModel()); assertNotNull(data.modelMetrics()); var changes = data.codeChanges(); assertNotNull(changes); - assertEquals(50.0, changes.linesAdded()); - assertEquals(20.0, changes.linesRemoved()); + assertEquals((Long) 50L, changes.linesAdded()); + assertEquals((Long) 20L, changes.linesRemoved()); assertNotNull(changes.filesModified()); assertEquals(3, changes.filesModified().size()); assertEquals("a.java", changes.filesModified().get(0)); @@ -1391,7 +1391,7 @@ void testAssistantStreamingDeltaEventAllFields() throws Exception { var event = (AssistantStreamingDeltaEvent) parseJson(json); assertNotNull(event); assertEquals("assistant.streaming_delta", event.getType()); - assertEquals(4096.0, event.getData().totalResponseSizeBytes()); + assertEquals((Long) 4096L, event.getData().totalResponseSizeBytes()); } @Test @@ -1482,12 +1482,12 @@ void testAssistantUsageEventAllFields() throws Exception { assertNotNull(event); var data = event.getData(); assertEquals("gpt-4-turbo", data.model()); - assertEquals(500.0, data.inputTokens()); - assertEquals(200.0, data.outputTokens()); - assertEquals(50.0, data.cacheReadTokens()); - assertEquals(150.0, data.cacheWriteTokens()); + assertEquals((Long) 500L, data.inputTokens()); + assertEquals((Long) 200L, data.outputTokens()); + assertEquals((Long) 50L, data.cacheReadTokens()); + assertEquals((Long) 150L, data.cacheWriteTokens()); assertEquals(0.05, data.cost()); - assertEquals(1234.5, data.duration()); + assertEquals((Long) 1234L, data.duration()); assertEquals("user", data.initiator()); assertEquals("api-1", data.apiCallId()); assertEquals("prov-1", data.providerCallId()); @@ -1497,11 +1497,11 @@ void testAssistantUsageEventAllFields() throws Exception { // Verify copilotUsage assertNotNull(data.copilotUsage()); - assertEquals(1234567.0, data.copilotUsage().totalNanoAiu()); + assertEquals(Double.valueOf(1234567.0), data.copilotUsage().totalNanoAiu()); assertNotNull(data.copilotUsage().tokenDetails()); assertEquals(2, data.copilotUsage().tokenDetails().size()); assertEquals("input", data.copilotUsage().tokenDetails().get(0).tokenType()); - assertEquals(500.0, data.copilotUsage().tokenDetails().get(0).tokenCount()); + assertEquals((Long) 500L, data.copilotUsage().tokenDetails().get(0).tokenCount()); assertEquals("output", data.copilotUsage().tokenDetails().get(1).tokenType()); } @@ -1522,10 +1522,8 @@ void testAssistantUsageEventWithNullQuotaSnapshots() throws Exception { assertNotNull(event); var data = event.getData(); assertEquals("gpt-4-turbo", data.model()); - assertEquals(500.0, data.inputTokens()); - assertEquals(200.0, data.outputTokens()); - // quotaSnapshots is null when absent in JSON (generated class uses nullable - // fields) + assertEquals((Long) 500L, data.inputTokens()); + assertEquals((Long) 200L, data.outputTokens()); assertNull(data.quotaSnapshots()); } @@ -2147,7 +2145,7 @@ void testParseJsonNodeSessionShutdownWithCodeChanges() throws Exception { var event = (SessionShutdownEvent) parseJson(json); assertNotNull(event); assertEquals(ShutdownType.ROUTINE, event.getData().shutdownType()); - assertEquals(100.0, event.getData().codeChanges().linesAdded()); + assertEquals((Long) 100L, event.getData().codeChanges().linesAdded()); assertEquals(1, event.getData().codeChanges().filesModified().size()); } @@ -2326,8 +2324,8 @@ void testParseExitPlanModeRequestedEvent() throws Exception { "requestId": "plan-req-001", "summary": "Plan is ready", "planContent": "## Plan\\n1. Do thing", - "actions": ["approve", "edit", "reject"], - "recommendedAction": "approve" + "actions": ["exit_only", "interactive", "autopilot"], + "recommendedAction": "interactive" } } """; @@ -2338,7 +2336,7 @@ void testParseExitPlanModeRequestedEvent() throws Exception { assertEquals("plan-req-001", event.getData().requestId()); assertEquals("Plan is ready", event.getData().summary()); assertEquals(3, event.getData().actions().size()); - assertEquals("approve", event.getData().recommendedAction()); + assertEquals(ExitPlanModeAction.INTERACTIVE, event.getData().recommendedAction()); } @Test @@ -2401,7 +2399,8 @@ void testParseCapabilitiesChangedEvent() throws Exception { assertTrue(castedEvent.getData().ui().elicitation()); // Verify setData round-trip - var newData = new CapabilitiesChangedEvent.CapabilitiesChangedEventData(new CapabilitiesChangedUI(false)); + var newData = new CapabilitiesChangedEvent.CapabilitiesChangedEventData( + new CapabilitiesChangedUI(false, null, null)); castedEvent.setData(newData); assertFalse(castedEvent.getData().ui().elicitation()); } diff --git a/src/test/java/com/github/copilot/sdk/SessionEventHandlingTest.java b/src/test/java/com/github/copilot/SessionEventHandlingTest.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/SessionEventHandlingTest.java rename to src/test/java/com/github/copilot/SessionEventHandlingTest.java index d9f22e7813..8ab6f9bfeb 100644 --- a/src/test/java/com/github/copilot/sdk/SessionEventHandlingTest.java +++ b/src/test/java/com/github/copilot/SessionEventHandlingTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -21,10 +21,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.generated.SessionStartEvent; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.generated.SessionStartEvent; /** * Unit tests for session event handling API. @@ -180,7 +180,7 @@ void testHandlerReceivesCorrectEventData() { SessionStartEvent startEvent = createSessionStartEvent(); startEvent.setData(new SessionStartEvent.SessionStartEventData("my-session-123", null, null, null, null, null, - null, null, null, null, null)); + null, null, null, null, null, null)); dispatchEvent(startEvent); AssistantMessageEvent msgEvent = createAssistantMessageEvent("Test content"); @@ -857,7 +857,7 @@ private SessionStartEvent createSessionStartEvent() { private SessionStartEvent createSessionStartEvent(String sessionId) { var event = new SessionStartEvent(); var data = new SessionStartEvent.SessionStartEventData(sessionId, null, null, null, null, null, null, null, - null, null, null); + null, null, null, null); event.setData(data); return event; } @@ -865,7 +865,7 @@ private SessionStartEvent createSessionStartEvent(String sessionId) { private AssistantMessageEvent createAssistantMessageEvent(String content) { var event = new AssistantMessageEvent(); var data = new AssistantMessageEvent.AssistantMessageEventData(null, null, content, null, null, null, null, - null, null, null, null, null, null, null, null); + null, null, null, null, null, null, null, null, null); event.setData(data); return event; } diff --git a/src/test/java/com/github/copilot/sdk/SessionEventsE2ETest.java b/src/test/java/com/github/copilot/SessionEventsE2ETest.java similarity index 94% rename from src/test/java/com/github/copilot/sdk/SessionEventsE2ETest.java rename to src/test/java/com/github/copilot/SessionEventsE2ETest.java index d13c84247d..161839a533 100644 --- a/src/test/java/com/github/copilot/sdk/SessionEventsE2ETest.java +++ b/src/test/java/com/github/copilot/SessionEventsE2ETest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -16,18 +16,18 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.generated.AssistantTurnEndEvent; -import com.github.copilot.sdk.generated.AssistantTurnStartEvent; -import com.github.copilot.sdk.generated.AssistantUsageEvent; -import com.github.copilot.sdk.generated.SessionIdleEvent; -import com.github.copilot.sdk.generated.ToolExecutionCompleteEvent; -import com.github.copilot.sdk.generated.ToolExecutionStartEvent; -import com.github.copilot.sdk.generated.UserMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.generated.AssistantTurnEndEvent; +import com.github.copilot.generated.AssistantTurnStartEvent; +import com.github.copilot.generated.AssistantUsageEvent; +import com.github.copilot.generated.SessionIdleEvent; +import com.github.copilot.generated.ToolExecutionCompleteEvent; +import com.github.copilot.generated.ToolExecutionStartEvent; +import com.github.copilot.generated.UserMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; /** * E2E tests for session events to verify event lifecycle. diff --git a/src/test/java/com/github/copilot/sdk/SessionHandlerTest.java b/src/test/java/com/github/copilot/SessionHandlerTest.java similarity index 82% rename from src/test/java/com/github/copilot/sdk/SessionHandlerTest.java rename to src/test/java/com/github/copilot/SessionHandlerTest.java index 847734b4a0..1b672e6e25 100644 --- a/src/test/java/com/github/copilot/sdk/SessionHandlerTest.java +++ b/src/test/java/com/github/copilot/SessionHandlerTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -16,15 +16,15 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PermissionRequestResultKind; -import com.github.copilot.sdk.json.SessionEndHookOutput; -import com.github.copilot.sdk.json.SessionHooks; -import com.github.copilot.sdk.json.SessionStartHookOutput; -import com.github.copilot.sdk.json.ToolDefinition; -import com.github.copilot.sdk.json.UserInputRequest; -import com.github.copilot.sdk.json.UserInputResponse; -import com.github.copilot.sdk.json.UserPromptSubmittedHookOutput; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PermissionRequestResultKind; +import com.github.copilot.rpc.SessionEndHookOutput; +import com.github.copilot.rpc.SessionHooks; +import com.github.copilot.rpc.SessionStartHookOutput; +import com.github.copilot.rpc.ToolDefinition; +import com.github.copilot.rpc.UserInputRequest; +import com.github.copilot.rpc.UserInputResponse; +import com.github.copilot.rpc.UserPromptSubmittedHookOutput; /** * Unit tests for CopilotSession internal handler methods. @@ -262,6 +262,54 @@ void testHandleHooksInvokeSessionEnd() throws Exception { assertEquals("summary", output.sessionSummary()); } + // ===== handleHooksInvoke: sessionId deserialization on hook inputs ===== + + @Test + void testHookInputSessionIdDeserializedForSessionStart() throws Exception { + var hooks = new SessionHooks().setOnSessionStart((hookInput, invocation) -> { + assertEquals("runtime-session-123", hookInput.sessionId()); + assertEquals(1735689600L, hookInput.timestamp()); + assertEquals("/tmp", hookInput.cwd()); + return CompletableFuture.completedFuture(new SessionStartHookOutput(null, null)); + }); + session.registerHooks(hooks); + + JsonNode input = MAPPER.valueToTree( + Map.of("sessionId", "runtime-session-123", "timestamp", 1735689600L, "cwd", "/tmp", "source", "new")); + + session.handleHooksInvoke("sessionStart", input).get(); + } + + @Test + void testHookInputSessionIdDeserializedForSessionEnd() throws Exception { + var hooks = new SessionHooks().setOnSessionEnd((hookInput, invocation) -> { + assertEquals("runtime-session-456", hookInput.sessionId()); + assertEquals("user_closed", hookInput.reason()); + return CompletableFuture.completedFuture(new SessionEndHookOutput(false, null, null)); + }); + session.registerHooks(hooks); + + JsonNode input = MAPPER.valueToTree(Map.of("sessionId", "runtime-session-456", "timestamp", 1735689600L, "cwd", + "/tmp", "reason", "user_closed")); + + session.handleHooksInvoke("sessionEnd", input).get(); + } + + @Test + void testHookInputSessionIdDeserializedForUserPromptSubmitted() throws Exception { + var hooks = new SessionHooks().setOnUserPromptSubmitted((hookInput, invocation) -> { + assertEquals("runtime-session-789", hookInput.sessionId()); + assertEquals("hello", hookInput.prompt()); + return CompletableFuture.completedFuture(new UserPromptSubmittedHookOutput(null, null, null)); + }); + session.registerHooks(hooks); + + JsonNode input = MAPPER.valueToTree( + Map.of("sessionId", "runtime-session-789", "timestamp", 1735689600L, "cwd", "/tmp", "prompt", "hello")); + + session.handleHooksInvoke("userPromptSubmitted", input).get(); + } + // ===== handleHooksInvoke: unhandled hook type ===== @Test diff --git a/src/test/java/com/github/copilot/sdk/SessionRequestBuilderTest.java b/src/test/java/com/github/copilot/SessionRequestBuilderTest.java similarity index 87% rename from src/test/java/com/github/copilot/sdk/SessionRequestBuilderTest.java rename to src/test/java/com/github/copilot/SessionRequestBuilderTest.java index 43703831a8..49a4c9c308 100644 --- a/src/test/java/com/github/copilot/sdk/SessionRequestBuilderTest.java +++ b/src/test/java/com/github/copilot/SessionRequestBuilderTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -12,19 +12,21 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.AutoModeSwitchResponse; -import com.github.copilot.sdk.json.CreateSessionRequest; -import com.github.copilot.sdk.json.DefaultAgentConfig; -import com.github.copilot.sdk.json.ElicitationHandler; -import com.github.copilot.sdk.json.ElicitationResult; -import com.github.copilot.sdk.json.ElicitationResultAction; -import com.github.copilot.sdk.json.ExitPlanModeResult; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.ResumeSessionRequest; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.SessionHooks; -import com.github.copilot.sdk.json.ToolDefinition; -import com.github.copilot.sdk.json.UserInputResponse; +import com.github.copilot.rpc.AutoModeSwitchResponse; +import com.github.copilot.rpc.CloudSessionOptions; +import com.github.copilot.rpc.CloudSessionRepository; +import com.github.copilot.rpc.CreateSessionRequest; +import com.github.copilot.rpc.DefaultAgentConfig; +import com.github.copilot.rpc.ElicitationHandler; +import com.github.copilot.rpc.ElicitationResult; +import com.github.copilot.rpc.ElicitationResultAction; +import com.github.copilot.rpc.ExitPlanModeResult; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.ResumeSessionRequest; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.SessionHooks; +import com.github.copilot.rpc.ToolDefinition; +import com.github.copilot.rpc.UserInputResponse; /** * Unit tests for {@link SessionRequestBuilder} branch coverage. @@ -243,7 +245,7 @@ void testConfigureResumeSessionWithUserInputHandler() throws Exception { // Handler was registered — verify by calling handleUserInputRequest // (package-private) - var response = session.handleUserInputRequest(new com.github.copilot.sdk.json.UserInputRequest()).get(); + var response = session.handleUserInputRequest(new com.github.copilot.rpc.UserInputRequest()).get(); assertNotNull(response); } @@ -299,8 +301,8 @@ void extractTransformCallbacks_nullSystemMessage_returnsNull() { @Test void extractTransformCallbacks_appendMode_returnsOriginalConfig() { - var config = new com.github.copilot.sdk.json.SystemMessageConfig() - .setMode(com.github.copilot.sdk.SystemMessageMode.APPEND).setContent("extra content"); + var config = new com.github.copilot.rpc.SystemMessageConfig() + .setMode(com.github.copilot.SystemMessageMode.APPEND).setContent("extra content"); ExtractedTransforms result = SessionRequestBuilder.extractTransformCallbacks(config); assertSame(config, result.wireSystemMessage()); assertNull(result.transformCallbacks()); @@ -308,10 +310,10 @@ void extractTransformCallbacks_appendMode_returnsOriginalConfig() { @Test void extractTransformCallbacks_customizeModeNoTransforms_returnsOriginalConfig() { - var sections = Map.of("tone", new com.github.copilot.sdk.json.SectionOverride() - .setAction(com.github.copilot.sdk.json.SectionOverrideAction.REMOVE)); - var config = new com.github.copilot.sdk.json.SystemMessageConfig() - .setMode(com.github.copilot.sdk.SystemMessageMode.CUSTOMIZE).setSections(sections); + var sections = Map.of("tone", new com.github.copilot.rpc.SectionOverride() + .setAction(com.github.copilot.rpc.SectionOverrideAction.REMOVE)); + var config = new com.github.copilot.rpc.SystemMessageConfig() + .setMode(com.github.copilot.SystemMessageMode.CUSTOMIZE).setSections(sections); ExtractedTransforms result = SessionRequestBuilder.extractTransformCallbacks(config); assertSame(config, result.wireSystemMessage()); assertNull(result.transformCallbacks()); @@ -321,9 +323,9 @@ void extractTransformCallbacks_customizeModeNoTransforms_returnsOriginalConfig() void extractTransformCallbacks_customizeModeWithTransform_extractsCallbacks() { var transformFn = (java.util.function.Function>) content -> CompletableFuture .completedFuture(content + " modified"); - var sections = Map.of("identity", new com.github.copilot.sdk.json.SectionOverride().setTransform(transformFn)); - var config = new com.github.copilot.sdk.json.SystemMessageConfig() - .setMode(com.github.copilot.sdk.SystemMessageMode.CUSTOMIZE).setSections(sections); + var sections = Map.of("identity", new com.github.copilot.rpc.SectionOverride().setTransform(transformFn)); + var config = new com.github.copilot.rpc.SystemMessageConfig() + .setMode(com.github.copilot.SystemMessageMode.CUSTOMIZE).setSections(sections); ExtractedTransforms result = SessionRequestBuilder.extractTransformCallbacks(config); @@ -336,7 +338,7 @@ void extractTransformCallbacks_customizeModeWithTransform_extractsCallbacks() { assertNotNull(result.wireSystemMessage().getSections()); var wireSection = result.wireSystemMessage().getSections().get("identity"); assertNotNull(wireSection); - assertEquals(com.github.copilot.sdk.json.SectionOverrideAction.TRANSFORM, wireSection.getAction()); + assertEquals(com.github.copilot.rpc.SectionOverrideAction.TRANSFORM, wireSection.getAction()); assertNull(wireSection.getTransform()); } @@ -364,7 +366,7 @@ void configureSessionWithNullConfig_returnsEarly() { void configureSessionWithCommands_registersCommands() { CopilotSession session = new CopilotSession("session-1", null); - var cmd = new com.github.copilot.sdk.json.CommandDefinition().setName("deploy") + var cmd = new com.github.copilot.rpc.CommandDefinition().setName("deploy") .setHandler(ctx -> CompletableFuture.completedFuture(null)); var config = new SessionConfig().setCommands(List.of(cmd)); @@ -400,7 +402,7 @@ void configureSessionWithOnEvent_registersEventHandler() { void configureResumedSessionWithCommands_registersCommands() { CopilotSession session = new CopilotSession("session-1", null); - var cmd = new com.github.copilot.sdk.json.CommandDefinition().setName("rollback") + var cmd = new com.github.copilot.rpc.CommandDefinition().setName("rollback") .setHandler(ctx -> CompletableFuture.completedFuture(null)); var config = new ResumeSessionConfig().setCommands(List.of(cmd)); @@ -659,4 +661,50 @@ void testResumeRequestSerializesModeFlags() throws Exception { assertTrue(json.contains("\"requestExitPlanMode\":true")); assertTrue(json.contains("\"requestAutoModeSwitch\":true")); } + + // ========================================================================= + // Cloud session options wiring + // ========================================================================= + + @Test + void testBuildCreateRequestPropagatesCloudSessionOptions() throws Exception { + var cloud = new CloudSessionOptions() + .setRepository(new CloudSessionRepository().setOwner("my-org").setName("my-repo").setBranch("main")); + var config = new SessionConfig().setCloud(cloud); + + CreateSessionRequest request = SessionRequestBuilder.buildCreateRequest(config); + + assertNotNull(request.getCloud()); + assertEquals("my-org", request.getCloud().getRepository().getOwner()); + assertEquals("my-repo", request.getCloud().getRepository().getName()); + assertEquals("main", request.getCloud().getRepository().getBranch()); + } + + @Test + void testBuildCreateRequestOmitsCloudWhenNull() throws Exception { + var config = new SessionConfig(); + + CreateSessionRequest request = SessionRequestBuilder.buildCreateRequest(config); + var mapper = JsonRpcClient.getObjectMapper(); + var json = mapper.writeValueAsString(request); + + assertNull(request.getCloud()); + assertFalse(json.contains("\"cloud\""), "cloud should be omitted when null"); + } + + @Test + void testCloudSessionOptionsSerializesCorrectly() throws Exception { + var cloud = new CloudSessionOptions() + .setRepository(new CloudSessionRepository().setOwner("acme").setName("widgets").setBranch("feature-1")); + var config = new SessionConfig().setCloud(cloud); + + CreateSessionRequest request = SessionRequestBuilder.buildCreateRequest(config); + var mapper = JsonRpcClient.getObjectMapper(); + var json = mapper.writeValueAsString(request); + + assertTrue(json.contains("\"cloud\"")); + assertTrue(json.contains("\"owner\":\"acme\"")); + assertTrue(json.contains("\"name\":\"widgets\"")); + assertTrue(json.contains("\"branch\":\"feature-1\"")); + } } diff --git a/src/test/java/com/github/copilot/sdk/SkillsTest.java b/src/test/java/com/github/copilot/SkillsTest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/SkillsTest.java rename to src/test/java/com/github/copilot/SkillsTest.java index 6cf34044fe..6d4b7e1f76 100644 --- a/src/test/java/com/github/copilot/sdk/SkillsTest.java +++ b/src/test/java/com/github/copilot/SkillsTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -17,11 +17,11 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.CustomAgentConfig; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.CustomAgentConfig; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; /** * Tests for skills configuration functionality. diff --git a/src/test/java/com/github/copilot/sdk/StreamingFidelityTest.java b/src/test/java/com/github/copilot/StreamingFidelityTest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/StreamingFidelityTest.java rename to src/test/java/com/github/copilot/StreamingFidelityTest.java index d3df63eb06..631496a8f7 100644 --- a/src/test/java/com/github/copilot/sdk/StreamingFidelityTest.java +++ b/src/test/java/com/github/copilot/StreamingFidelityTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -17,13 +17,13 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.AssistantMessageDeltaEvent; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.ResumeSessionConfig; -import com.github.copilot.sdk.json.SessionConfig; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.AssistantMessageDeltaEvent; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.ResumeSessionConfig; +import com.github.copilot.rpc.SessionConfig; /** * E2E tests for streaming fidelity — verifying that delta events are produced diff --git a/src/test/java/com/github/copilot/sdk/TelemetryConfigTest.java b/src/test/java/com/github/copilot/TelemetryConfigTest.java similarity index 96% rename from src/test/java/com/github/copilot/sdk/TelemetryConfigTest.java rename to src/test/java/com/github/copilot/TelemetryConfigTest.java index 278777ce13..2dd41c28a7 100644 --- a/src/test/java/com/github/copilot/sdk/TelemetryConfigTest.java +++ b/src/test/java/com/github/copilot/TelemetryConfigTest.java @@ -2,13 +2,13 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.json.TelemetryConfig; +import com.github.copilot.rpc.TelemetryConfig; /** * Unit tests for {@link TelemetryConfig} getters, setters, and fluent chaining. diff --git a/src/test/java/com/github/copilot/sdk/TestUtil.java b/src/test/java/com/github/copilot/TestUtil.java similarity index 94% rename from src/test/java/com/github/copilot/sdk/TestUtil.java rename to src/test/java/com/github/copilot/TestUtil.java index d9462af87f..cadef040b6 100644 --- a/src/test/java/com/github/copilot/sdk/TestUtil.java +++ b/src/test/java/com/github/copilot/TestUtil.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import java.io.BufferedReader; import java.io.InputStreamReader; @@ -36,9 +36,9 @@ public static String tempPath(String filename) { *

* Resolution order: *

    - *
  1. Search the system PATH using {@code where.exe} (Windows) or {@code which} - * (Linux/macOS).
  2. - *
  3. Fall back to the {@code COPILOT_CLI_PATH} environment variable.
  4. + *
  5. Use the {@code COPILOT_CLI_PATH} environment variable when set.
  6. + *
  7. Otherwise search the system PATH using {@code where.exe} (Windows) or + * {@code which} (Linux/macOS).
  8. *
  9. Walk parent directories looking for * {@code nodejs/node_modules/@github/copilot/index.js}.
  10. *
@@ -55,16 +55,16 @@ public static String tempPath(String filename) { * {@code null} if none was found */ static String findCliPath() { - String copilotInPath = findCopilotInPath(); - if (copilotInPath != null) { - return copilotInPath; - } - String envPath = System.getenv("COPILOT_CLI_PATH"); if (envPath != null && !envPath.isEmpty()) { return envPath; } + String copilotInPath = findCopilotInPath(); + if (copilotInPath != null) { + return copilotInPath; + } + Path current = Paths.get(System.getProperty("user.dir")); while (current != null) { Path cliPath = current.resolve("nodejs/node_modules/@github/copilot/index.js"); diff --git a/src/test/java/com/github/copilot/sdk/TimeoutEdgeCaseTest.java b/src/test/java/com/github/copilot/TimeoutEdgeCaseTest.java similarity index 97% rename from src/test/java/com/github/copilot/sdk/TimeoutEdgeCaseTest.java rename to src/test/java/com/github/copilot/TimeoutEdgeCaseTest.java index b771f65b2c..17e1851bb4 100644 --- a/src/test/java/com/github/copilot/sdk/TimeoutEdgeCaseTest.java +++ b/src/test/java/com/github/copilot/TimeoutEdgeCaseTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -15,8 +15,8 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; /** * Regression tests for timeout edge cases in diff --git a/src/test/java/com/github/copilot/sdk/ToolInvocationTest.java b/src/test/java/com/github/copilot/ToolInvocationTest.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/ToolInvocationTest.java rename to src/test/java/com/github/copilot/ToolInvocationTest.java index 3dcbf7c9ac..2bc9edb1b4 100644 --- a/src/test/java/com/github/copilot/sdk/ToolInvocationTest.java +++ b/src/test/java/com/github/copilot/ToolInvocationTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -10,7 +10,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.github.copilot.sdk.json.ToolInvocation; +import com.github.copilot.rpc.ToolInvocation; /** * Unit tests for {@link ToolInvocation}. diff --git a/src/test/java/com/github/copilot/sdk/ToolResultsTest.java b/src/test/java/com/github/copilot/ToolResultsTest.java similarity index 93% rename from src/test/java/com/github/copilot/sdk/ToolResultsTest.java rename to src/test/java/com/github/copilot/ToolResultsTest.java index 31f9d1b07d..54216d9216 100644 --- a/src/test/java/com/github/copilot/sdk/ToolResultsTest.java +++ b/src/test/java/com/github/copilot/ToolResultsTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -16,13 +16,13 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.SessionEvent; -import com.github.copilot.sdk.generated.ToolExecutionCompleteEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.ToolDefinition; -import com.github.copilot.sdk.json.ToolResultObject; +import com.github.copilot.generated.SessionEvent; +import com.github.copilot.generated.ToolExecutionCompleteEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.ToolDefinition; +import com.github.copilot.rpc.ToolResultObject; /** * E2E tests for tool result types — verifying that rejected and denied result diff --git a/src/test/java/com/github/copilot/ToolSetTest.java b/src/test/java/com/github/copilot/ToolSetTest.java new file mode 100644 index 0000000000..0415a74fac --- /dev/null +++ b/src/test/java/com/github/copilot/ToolSetTest.java @@ -0,0 +1,100 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.Collection; +import java.util.List; + +import org.junit.jupiter.api.Test; + +import com.github.copilot.rpc.BuiltInTools; +import com.github.copilot.rpc.ToolSet; + +/** + * Tests for {@link ToolSet} and {@link BuiltInTools}. + */ +public class ToolSetTest { + + @Test + void testAddBuiltIn() { + var ts = new ToolSet().addBuiltIn("bash"); + assertEquals(1, ts.size()); + assertEquals("builtin:bash", ts.get(0)); + } + + @Test + void testAddBuiltInWildcard() { + var ts = new ToolSet().addBuiltIn("*"); + assertEquals("builtin:*", ts.get(0)); + } + + @Test + void testAddCustom() { + var ts = new ToolSet().addCustom("my_tool"); + assertEquals("custom:my_tool", ts.get(0)); + } + + @Test + void testAddMcp() { + var ts = new ToolSet().addMcp("github-list_issues"); + assertEquals("mcp:github-list_issues", ts.get(0)); + } + + @Test + void testAddMcpWildcard() { + var ts = new ToolSet().addMcp("*"); + assertEquals("mcp:*", ts.get(0)); + } + + @Test + void testChaining() { + var ts = new ToolSet().addBuiltIn("bash").addMcp("*").addCustom("my_tool"); + assertEquals(3, ts.size()); + assertEquals("builtin:bash", ts.get(0)); + assertEquals("mcp:*", ts.get(1)); + assertEquals("custom:my_tool", ts.get(2)); + } + + @Test + void testAddBuiltInCollection() { + var ts = new ToolSet(); + ts.addBuiltIn((Collection) BuiltInTools.ISOLATED); + assertEquals(BuiltInTools.ISOLATED.size(), ts.size()); + assertTrue(ts.contains("builtin:ask_user")); + assertTrue(ts.contains("builtin:task_complete")); + } + + @Test + void testInvalidNameThrows() { + assertThrows(IllegalArgumentException.class, () -> new ToolSet().addBuiltIn("")); + assertThrows(IllegalArgumentException.class, () -> new ToolSet().addBuiltIn((String) null)); + assertThrows(IllegalArgumentException.class, () -> new ToolSet().addBuiltIn("bad/name")); + assertThrows(IllegalArgumentException.class, () -> new ToolSet().addBuiltIn("bad name")); + assertThrows(IllegalArgumentException.class, () -> new ToolSet().addMcp("bad.name")); + assertThrows(IllegalArgumentException.class, () -> new ToolSet().addCustom("bad:name")); + } + + @Test + void testValidNamePatterns() { + // Names with letters, digits, hyphens, underscores are valid + assertDoesNotThrow(() -> new ToolSet().addBuiltIn("my-tool_123")); + assertDoesNotThrow(() -> new ToolSet().addMcp("github-list_issues")); + } + + @Test + void testBuiltInToolsIsolatedIsUnmodifiable() { + assertThrows(UnsupportedOperationException.class, () -> BuiltInTools.ISOLATED.add("new_tool")); + } + + @Test + void testToolSetIsListOfStrings() { + var ts = new ToolSet().addBuiltIn("bash").addMcp("*"); + // ToolSet extends ArrayList, so it is a List + List list = ts; + assertEquals(2, list.size()); + } +} diff --git a/src/test/java/com/github/copilot/sdk/ToolsTest.java b/src/test/java/com/github/copilot/ToolsTest.java similarity index 97% rename from src/test/java/com/github/copilot/sdk/ToolsTest.java rename to src/test/java/com/github/copilot/ToolsTest.java index 6cd0c99bd3..3bbe767847 100644 --- a/src/test/java/com/github/copilot/sdk/ToolsTest.java +++ b/src/test/java/com/github/copilot/ToolsTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; @@ -20,14 +20,14 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; -import com.github.copilot.sdk.json.PermissionHandler; -import com.github.copilot.sdk.json.PermissionRequest; -import com.github.copilot.sdk.json.PermissionRequestResult; -import com.github.copilot.sdk.json.PermissionRequestResultKind; -import com.github.copilot.sdk.json.SessionConfig; -import com.github.copilot.sdk.json.ToolDefinition; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; +import com.github.copilot.rpc.PermissionHandler; +import com.github.copilot.rpc.PermissionRequest; +import com.github.copilot.rpc.PermissionRequestResult; +import com.github.copilot.rpc.PermissionRequestResultKind; +import com.github.copilot.rpc.SessionConfig; +import com.github.copilot.rpc.ToolDefinition; /** * Tests for custom tools functionality. diff --git a/src/test/java/com/github/copilot/UpdateSessionOptionsForModeTest.java b/src/test/java/com/github/copilot/UpdateSessionOptionsForModeTest.java new file mode 100644 index 0000000000..d02ea3097d --- /dev/null +++ b/src/test/java/com/github/copilot/UpdateSessionOptionsForModeTest.java @@ -0,0 +1,260 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +package com.github.copilot; + +import static org.junit.jupiter.api.Assertions.*; + +import java.io.OutputStream; +import java.net.ServerSocket; +import java.net.Socket; +import java.nio.charset.StandardCharsets; + +import org.junit.jupiter.api.Test; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.copilot.rpc.CopilotClientMode; +import com.github.copilot.rpc.CopilotClientOptions; + +/** + * Tests for {@link CopilotClient#updateSessionOptionsForMode}. + */ +class UpdateSessionOptionsForModeTest { + + private static final ObjectMapper MAPPER = JsonRpcClient.getObjectMapper(); + + /** + * A connected socket pair where the "server" side auto-replies to every + * JSON-RPC request with {@code {"success": true}}. + */ + private static final class AutoReplyPair implements AutoCloseable { + + final Socket clientSocket; + final Socket serverSocket; + final JsonRpcClient rpcClient; + private volatile boolean running = true; + private final Thread replyThread; + /** The last JSON-RPC params node received by the stub server. */ + volatile JsonNode lastParams; + /** The last JSON-RPC method received by the stub server. */ + volatile String lastMethod; + + AutoReplyPair() throws Exception { + try (var ss = new ServerSocket(0)) { + clientSocket = new Socket("localhost", ss.getLocalPort()); + serverSocket = ss.accept(); + } + serverSocket.setSoTimeout(5000); + rpcClient = JsonRpcClient.fromSocket(clientSocket); + + // Background thread that reads requests and sends back success responses + replyThread = new Thread(() -> { + try { + var in = serverSocket.getInputStream(); + var out = serverSocket.getOutputStream(); + while (running) { + // Read Content-Length header + var header = new StringBuilder(); + int b; + while ((b = in.read()) != -1) { + if (b == '\n' && header.toString().endsWith("\r")) { + break; + } + header.append((char) b); + } + if (b == -1) + break; + // Skip blank line + in.read(); // '\r' + in.read(); // '\n' + + String hdr = header.toString().trim(); + int colon = hdr.indexOf(':'); + int len = Integer.parseInt(hdr.substring(colon + 1).trim()); + byte[] body = in.readNBytes(len); + JsonNode msg = MAPPER.readTree(body); + + lastMethod = msg.get("method").asText(); + lastParams = msg.get("params"); + long id = msg.get("id").asLong(); + + // Send back a success response + String response = MAPPER.writeValueAsString(MAPPER.createObjectNode().put("jsonrpc", "2.0") + .put("id", id).set("result", MAPPER.createObjectNode().put("success", true))); + sendRpcMessage(out, response); + } + } catch (Exception e) { + if (running) { + // Ignore expected exceptions on shutdown + } + } + }); + replyThread.setDaemon(true); + replyThread.start(); + } + + private static void sendRpcMessage(OutputStream out, String json) throws Exception { + byte[] bytes = json.getBytes(StandardCharsets.UTF_8); + String header = "Content-Length: " + bytes.length + "\r\n\r\n"; + out.write(header.getBytes(StandardCharsets.UTF_8)); + out.write(bytes); + out.flush(); + } + + @Override + public void close() throws Exception { + running = false; + rpcClient.close(); + clientSocket.close(); + serverSocket.close(); + replyThread.join(3000); + } + } + + // ── COPILOT_CLI mode tests ──────────────────────────────────────────────── + + @Test + void copilotCliMode_noFieldsSet_noPatchSent() throws Exception { + try (var pair = new AutoReplyPair()) { + var session = new CopilotSession("sess-1", pair.rpcClient); + var client = new CopilotClient(new CopilotClientOptions().setAutoStart(false)); + + client.updateSessionOptionsForMode(session, null, null, null, null).get(); + + assertNull(pair.lastMethod, "No RPC call should be made when no fields are set in COPILOT_CLI mode"); + client.close(); + } + } + + @Test + void copilotCliMode_skipCustomInstructionsSet_patchContainsOnlyThatField() throws Exception { + try (var pair = new AutoReplyPair()) { + var session = new CopilotSession("sess-1", pair.rpcClient); + var client = new CopilotClient(new CopilotClientOptions().setAutoStart(false)); + + client.updateSessionOptionsForMode(session, true, null, null, null).get(); + + assertEquals("session.options.update", pair.lastMethod); + assertTrue(pair.lastParams.get("skipCustomInstructions").asBoolean()); + assertTrue(pair.lastParams.path("customAgentsLocalOnly").isMissingNode(), + "customAgentsLocalOnly should be absent"); + assertTrue(pair.lastParams.path("coauthorEnabled").isMissingNode(), "coauthorEnabled should be absent"); + assertTrue(pair.lastParams.path("manageScheduleEnabled").isMissingNode(), + "manageScheduleEnabled should be absent"); + assertTrue(pair.lastParams.path("installedPlugins").isMissingNode(), "installedPlugins should be absent"); + client.close(); + } + } + + @Test + void copilotCliMode_allFieldsSet_allPropagated() throws Exception { + try (var pair = new AutoReplyPair()) { + var session = new CopilotSession("sess-1", pair.rpcClient); + var client = new CopilotClient(new CopilotClientOptions().setAutoStart(false)); + + client.updateSessionOptionsForMode(session, false, true, true, false).get(); + + assertEquals("session.options.update", pair.lastMethod); + assertFalse(pair.lastParams.get("skipCustomInstructions").asBoolean()); + assertTrue(pair.lastParams.get("customAgentsLocalOnly").asBoolean()); + assertTrue(pair.lastParams.get("coauthorEnabled").asBoolean()); + assertFalse(pair.lastParams.get("manageScheduleEnabled").asBoolean()); + client.close(); + } + } + + @Test + void copilotCliMode_onlyCoauthorEnabled_patchSent() throws Exception { + try (var pair = new AutoReplyPair()) { + var session = new CopilotSession("sess-1", pair.rpcClient); + var client = new CopilotClient(new CopilotClientOptions().setAutoStart(false)); + + client.updateSessionOptionsForMode(session, null, null, true, null).get(); + + assertEquals("session.options.update", pair.lastMethod); + assertTrue(pair.lastParams.get("coauthorEnabled").asBoolean()); + client.close(); + } + } + + // ── EMPTY mode tests ────────────────────────────────────────────────────── + + @Test + void emptyMode_noFieldsSet_safeDefaultsSent() throws Exception { + try (var pair = new AutoReplyPair()) { + var session = new CopilotSession("sess-1", pair.rpcClient); + var client = new CopilotClient(new CopilotClientOptions().setMode(CopilotClientMode.EMPTY) + .setCopilotHome("/tmp/copilot-home").setAutoStart(false)); + + client.updateSessionOptionsForMode(session, null, null, null, null).get(); + + assertEquals("session.options.update", pair.lastMethod); + assertTrue(pair.lastParams.get("skipCustomInstructions").asBoolean(), "default: skip custom instructions"); + assertTrue(pair.lastParams.get("customAgentsLocalOnly").asBoolean(), "default: local agents only"); + assertFalse(pair.lastParams.get("coauthorEnabled").asBoolean(), "default: coauthor disabled"); + assertFalse(pair.lastParams.get("manageScheduleEnabled").asBoolean(), "default: schedule disabled"); + assertTrue(pair.lastParams.get("installedPlugins").isArray(), "installedPlugins should be empty array"); + assertEquals(0, pair.lastParams.get("installedPlugins").size()); + client.close(); + } + } + + @Test + void emptyMode_callerOverridesWin() throws Exception { + try (var pair = new AutoReplyPair()) { + var session = new CopilotSession("sess-1", pair.rpcClient); + var client = new CopilotClient(new CopilotClientOptions().setMode(CopilotClientMode.EMPTY) + .setCopilotHome("/tmp/copilot-home").setAutoStart(false)); + + client.updateSessionOptionsForMode(session, false, false, true, true).get(); + + assertEquals("session.options.update", pair.lastMethod); + assertFalse(pair.lastParams.get("skipCustomInstructions").asBoolean(), "caller override: don't skip"); + assertFalse(pair.lastParams.get("customAgentsLocalOnly").asBoolean(), "caller override: not local only"); + assertTrue(pair.lastParams.get("coauthorEnabled").asBoolean(), "caller override: coauthor enabled"); + assertTrue(pair.lastParams.get("manageScheduleEnabled").asBoolean(), "caller override: schedule enabled"); + assertTrue(pair.lastParams.get("installedPlugins").isArray(), + "installedPlugins always empty in EMPTY mode"); + assertEquals(0, pair.lastParams.get("installedPlugins").size()); + client.close(); + } + } + + @Test + void emptyMode_partialOverrides_restGetDefaults() throws Exception { + try (var pair = new AutoReplyPair()) { + var session = new CopilotSession("sess-1", pair.rpcClient); + var client = new CopilotClient(new CopilotClientOptions().setMode(CopilotClientMode.EMPTY) + .setCopilotHome("/tmp/copilot-home").setAutoStart(false)); + + // Only override coauthorEnabled, rest should use safe defaults + client.updateSessionOptionsForMode(session, null, null, true, null).get(); + + assertEquals("session.options.update", pair.lastMethod); + assertTrue(pair.lastParams.get("skipCustomInstructions").asBoolean(), "default: skip"); + assertTrue(pair.lastParams.get("customAgentsLocalOnly").asBoolean(), "default: local only"); + assertTrue(pair.lastParams.get("coauthorEnabled").asBoolean(), "override: coauthor enabled"); + assertFalse(pair.lastParams.get("manageScheduleEnabled").asBoolean(), "default: schedule disabled"); + client.close(); + } + } + + // ── SessionId injection ─────────────────────────────────────────────────── + + @Test + void sessionIdInjectedBySessionOptionsApi() throws Exception { + try (var pair = new AutoReplyPair()) { + var session = new CopilotSession("my-session-id", pair.rpcClient); + var client = new CopilotClient(new CopilotClientOptions().setAutoStart(false)); + + client.updateSessionOptionsForMode(session, true, null, null, null).get(); + + assertEquals("session.options.update", pair.lastMethod); + assertEquals("my-session-id", pair.lastParams.get("sessionId").asText(), + "SessionOptionsApi should inject sessionId"); + client.close(); + } + } +} diff --git a/src/test/java/com/github/copilot/sdk/ZeroTimeoutContractTest.java b/src/test/java/com/github/copilot/ZeroTimeoutContractTest.java similarity index 94% rename from src/test/java/com/github/copilot/sdk/ZeroTimeoutContractTest.java rename to src/test/java/com/github/copilot/ZeroTimeoutContractTest.java index 524026e698..3d986566dc 100644 --- a/src/test/java/com/github/copilot/sdk/ZeroTimeoutContractTest.java +++ b/src/test/java/com/github/copilot/ZeroTimeoutContractTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk; +package com.github.copilot; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; @@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.generated.AssistantMessageEvent; -import com.github.copilot.sdk.json.MessageOptions; +import com.github.copilot.generated.AssistantMessageEvent; +import com.github.copilot.rpc.MessageOptions; /** * Verifies the documented contract that {@code timeoutMs <= 0} means "no diff --git a/src/test/java/com/github/copilot/sdk/generated/GeneratedEventTypesCoverageTest.java b/src/test/java/com/github/copilot/generated/GeneratedEventTypesCoverageTest.java similarity index 98% rename from src/test/java/com/github/copilot/sdk/generated/GeneratedEventTypesCoverageTest.java rename to src/test/java/com/github/copilot/generated/GeneratedEventTypesCoverageTest.java index 2e0b2ed094..28e2aba3b3 100644 --- a/src/test/java/com/github/copilot/sdk/generated/GeneratedEventTypesCoverageTest.java +++ b/src/test/java/com/github/copilot/generated/GeneratedEventTypesCoverageTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.generated; +package com.github.copilot.generated; import static org.junit.jupiter.api.Assertions.*; @@ -15,8 +15,8 @@ /** * Deserialization tests for generated session event types that are not covered - * in {@link com.github.copilot.sdk.SessionEventDeserializationTest}. Verifies - * that each event deserializes correctly from JSON and that the {@code type} + * in {@link com.github.copilot.SessionEventDeserializationTest}. Verifies that + * each event deserializes correctly from JSON and that the {@code type} * discriminator and {@code data} fields are accessible. */ public class GeneratedEventTypesCoverageTest { @@ -45,7 +45,7 @@ void testParseAssistantStreamingDeltaEvent() throws Exception { assertInstanceOf(AssistantStreamingDeltaEvent.class, event); assertEquals("assistant.streaming_delta", event.getType()); var typed = (AssistantStreamingDeltaEvent) event; - assertEquals(1024.0, typed.getData().totalResponseSizeBytes()); + assertEquals((Long) 1024L, typed.getData().totalResponseSizeBytes()); } // ── CapabilitiesChangedEvent ─────────────────────────────────────────── @@ -210,14 +210,14 @@ void testParseElicitationCompletedEventCancel() throws Exception { void testParseExitPlanModeRequestedEvent() throws Exception { var event = parse( """ - {"type":"exit_plan_mode.requested","data":{"requestId":"epm-1","summary":"Implement login","planContent":"# Plan\\n1. Create login","actions":["approve","edit","reject"],"recommendedAction":"approve"}} + {"type":"exit_plan_mode.requested","data":{"requestId":"epm-1","summary":"Implement login","planContent":"# Plan\\n1. Create login","actions":["exit_only","interactive","autopilot"],"recommendedAction":"interactive"}} """); assertInstanceOf(ExitPlanModeRequestedEvent.class, event); assertEquals("exit_plan_mode.requested", event.getType()); var typed = (ExitPlanModeRequestedEvent) event; assertEquals("epm-1", typed.getData().requestId()); assertEquals("Implement login", typed.getData().summary()); - assertEquals("approve", typed.getData().recommendedAction()); + assertEquals(ExitPlanModeAction.INTERACTIVE, typed.getData().recommendedAction()); assertEquals(3, typed.getData().actions().size()); } @@ -464,7 +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(McpServersLoadedServerStatus.CONNECTED, typed.getData().servers().get(0).status()); + assertEquals(McpServerStatus.CONNECTED, typed.getData().servers().get(0).status()); } @Test @@ -529,7 +529,7 @@ void testParseSessionSkillsLoadedEvent() throws Exception { assertEquals(1, typed.getData().skills().size()); var skill = typed.getData().skills().get(0); assertEquals("deploy", skill.name()); - assertEquals("project", skill.source()); + assertEquals(SkillSource.PROJECT, skill.source()); assertTrue(skill.userInvocable()); assertTrue(skill.enabled()); } @@ -699,6 +699,6 @@ void testSessionContextChangedHostTypeEnumFromValue() { @Test void testSessionMcpServersLoadedStatusEnumFromValue() { - assertThrows(IllegalArgumentException.class, () -> McpServersLoadedServerStatus.fromValue("unknown")); + assertThrows(IllegalArgumentException.class, () -> McpServerStatus.fromValue("unknown")); } } diff --git a/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcApiCoverageTest.java b/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcApiCoverageTest.java similarity index 99% rename from src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcApiCoverageTest.java rename to src/test/java/com/github/copilot/generated/rpc/GeneratedRpcApiCoverageTest.java index 10393abe09..4bc1cc06bf 100644 --- a/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcApiCoverageTest.java +++ b/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcApiCoverageTest.java @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import static org.junit.jupiter.api.Assertions.*; @@ -58,7 +58,7 @@ void serverRpc_sessionFs_setProvider_invokes_correct_method() { var stub = new StubCaller(); var server = new ServerRpc(stub); - var params = new SessionFsSetProviderParams("/workspace", "/state", null); + var params = new SessionFsSetProviderParams("/workspace", "/state", null, null); server.sessionFs.setProvider(params); assertEquals(1, stub.calls.size()); @@ -633,7 +633,7 @@ void sessionRpc_log_merges_sessionId() { var stub = new StubCaller(); var session = new SessionRpc(stub, "sess-log"); - var logParams = new SessionLogParams(null, "Hello from test", null, null, null); + var logParams = new SessionLogParams(null, "Hello from test", null, null, null, null, null); session.log(logParams); assertEquals(1, stub.calls.size()); @@ -649,10 +649,11 @@ void sessionRpc_log_merges_sessionId() { @Test void serverRpc_sessionFs_setProvider_params_record() { - var params = new SessionFsSetProviderParams("/workspace", "/state", null); + var params = new SessionFsSetProviderParams("/workspace", "/state", null, null); assertEquals("/workspace", params.initialCwd()); assertEquals("/state", params.sessionStatePath()); assertNull(params.conventions()); + assertNull(params.capabilities()); } @Test diff --git a/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcRecordsCoverageTest.java b/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java similarity index 95% rename from src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcRecordsCoverageTest.java rename to src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java index 50e65d3779..d34fa76b1b 100644 --- a/src/test/java/com/github/copilot/sdk/generated/rpc/GeneratedRpcRecordsCoverageTest.java +++ b/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java @@ -2,17 +2,18 @@ * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ -package com.github.copilot.sdk.generated.rpc; +package com.github.copilot.generated.rpc; import static org.junit.jupiter.api.Assertions.*; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; import java.util.UUID; import org.junit.jupiter.api.Test; -import com.github.copilot.sdk.TestUtil; +import com.github.copilot.TestUtil; /** * Tests for generated RPC param and result record types. Exercises @@ -32,9 +33,9 @@ void pingParams_record() { @Test void pingResult_record() { - var result = new PingResult("pong", 1234L, 2L); + var result = new PingResult("pong", null, 2L); assertEquals("pong", result.message()); - assertEquals(1234L, result.timestamp()); + assertNull(result.timestamp()); assertEquals(2L, result.protocolVersion()); } @@ -246,7 +247,7 @@ void sessionHistoryTruncateParams_record() { @Test void sessionLogParams_record() { - var params = new SessionLogParams("sess-24", "test message", SessionLogLevel.INFO, false, null); + var params = new SessionLogParams("sess-24", "test message", SessionLogLevel.INFO, null, false, null, null); assertEquals("sess-24", params.sessionId()); assertEquals("test message", params.message()); assertEquals(SessionLogLevel.INFO, params.level()); @@ -320,10 +321,11 @@ void sessionModelGetCurrentParams_record() { @Test void sessionModelSwitchToParams_record() { - var params = new SessionModelSwitchToParams("sess-32", "claude-sonnet-4.5", "high", null); + var params = new SessionModelSwitchToParams("sess-32", "claude-sonnet-4.5", "high", null, null); assertEquals("sess-32", params.sessionId()); assertEquals("claude-sonnet-4.5", params.modelId()); assertEquals("high", params.reasoningEffort()); + assertNull(params.reasoningSummary()); assertNull(params.modelCapabilities()); } @@ -470,9 +472,10 @@ void sessionWorkspaceReadFileParams_record() { @Test void pingResult_fields() { - var result = new PingResult("pong", 9999L, 1L); + var ts = OffsetDateTime.now(); + var result = new PingResult("pong", ts, 1L); assertEquals("pong", result.message()); - assertEquals(9999L, result.timestamp()); + assertEquals(ts, result.timestamp()); assertEquals(1L, result.protocolVersion()); } @@ -483,7 +486,8 @@ void sessionAgentDeselectResult_empty() { @Test void sessionAgentListResult_with_items() { - var item = new AgentInfo("name1", "Name One", "Desc 1", "/path/to/agent1"); + var item = new AgentInfo("name1", "Name One", "Desc 1", "/path/to/agent1", null, null, null, null, null, null, + null); var result = new SessionAgentListResult(List.of(item)); assertEquals(1, result.agents().size()); assertEquals("name1", result.agents().get(0).name()); @@ -494,7 +498,8 @@ void sessionAgentListResult_with_items() { @Test void sessionAgentGetCurrentResult_nested() { - var agent = new AgentInfo("agent-1", "Agent One", "Does things", null); + var agent = new AgentInfo("agent-1", "Agent One", "Does things", null, null, null, null, null, null, null, + null); var result = new SessionAgentGetCurrentResult(agent); assertEquals("agent-1", result.agent().name()); assertEquals("Agent One", result.agent().displayName()); @@ -510,7 +515,7 @@ void sessionAgentGetCurrentResult_null_agent() { @Test void sessionAgentReloadResult_with_items() { - var item = new AgentInfo("a", "A", "Desc", "/path/to/a"); + var item = new AgentInfo("a", "A", "Desc", "/path/to/a", null, null, null, null, null, null, null); var result = new SessionAgentReloadResult(List.of(item)); assertEquals(1, result.agents().size()); assertEquals("a", result.agents().get(0).name()); @@ -518,7 +523,8 @@ void sessionAgentReloadResult_with_items() { @Test void sessionAgentSelectResult_nested() { - var agent = new AgentInfo("selected", "Selected", "The selected agent", "/path/to/selected"); + var agent = new AgentInfo("selected", "Selected", "The selected agent", "/path/to/selected", null, null, null, + null, null, null, null); var result = new SessionAgentSelectResult(agent); assertEquals("selected", result.agent().name()); } @@ -637,7 +643,7 @@ void sessionFsStatResult_record() { @Test void sessionHistoryCompactResult_nested() { var ctx = new HistoryCompactContextWindow(100000L, 5000L, 20L, 1000L, 3000L, 500L); - var result = new SessionHistoryCompactResult(true, 2000L, 5L, ctx); + var result = new SessionHistoryCompactResult(true, 2000L, 5L, null, ctx); assertTrue(result.success()); assertEquals(2000L, result.tokensRemoved()); assertEquals(5L, result.messagesRemoved()); @@ -714,7 +720,7 @@ void sessionModeSetResult_enum() { @Test void sessionModelGetCurrentResult_record() { - var result = new SessionModelGetCurrentResult("claude-sonnet-4.5"); + var result = new SessionModelGetCurrentResult("claude-sonnet-4.5", null); assertEquals("claude-sonnet-4.5", result.modelId()); } @@ -785,11 +791,11 @@ void sessionSkillsEnableResult_empty() { @Test void sessionSkillsListResult_nested() { - var item = new Skill("deploy", "Deploy the app", "project", true, true, "/skills/deploy.md"); + var item = new Skill("deploy", "Deploy the app", SkillSource.PROJECT, true, true, "/skills/deploy.md", null); var result = new SessionSkillsListResult(List.of(item)); assertEquals(1, result.skills().size()); assertEquals("deploy", result.skills().get(0).name()); - assertEquals("project", result.skills().get(0).source()); + assertEquals(SkillSource.PROJECT, result.skills().get(0).source()); assertTrue(result.skills().get(0).enabled()); } @@ -831,9 +837,9 @@ void sessionUiHandlePendingElicitationResult_record() { @Test void sessionUsageGetMetricsResult_nested() { - var changes = new UsageMetricsCodeChanges(100L, 50L, 5L); - var result = new SessionUsageGetMetricsResult(0.5, 10L, null, null, 2000.0, 1700000000000L, changes, null, - "gpt-5", 1000L, 500L); + var changes = new UsageMetricsCodeChanges(100L, 50L, 5L, null); + var result = new SessionUsageGetMetricsResult(0.5, 10L, null, null, 2000L, null, changes, null, "gpt-5", 1000L, + 500L); assertEquals(0.5, result.totalPremiumRequestCost()); assertEquals(10L, result.totalUserRequests()); assertNotNull(result.codeChanges()); @@ -871,7 +877,8 @@ void sessionsForkResult_record() { @Test void accountGetQuotaResult_nested() { - var snapshot = new AccountQuotaSnapshot(null, 100L, 40L, null, 60.0, 5.0, true, "2026-05-01"); + var snapshot = new AccountQuotaSnapshot(null, 100L, 40L, null, 60.0, 5.0, true, + java.time.OffsetDateTime.parse("2026-05-01T00:00:00Z")); var result = new AccountGetQuotaResult(Map.of("chat", snapshot)); assertEquals(1, result.quotaSnapshots().size()); var s = result.quotaSnapshots().get("chat"); @@ -880,7 +887,7 @@ void accountGetQuotaResult_nested() { assertEquals(60.0, s.remainingPercentage()); assertEquals(5.0, s.overage()); assertTrue(s.overageAllowedWithExhaustedQuota()); - assertEquals("2026-05-01", s.resetDate()); + assertEquals(java.time.OffsetDateTime.parse("2026-05-01T00:00:00Z"), s.resetDate()); } @Test @@ -892,13 +899,13 @@ void mcpConfigListResult_record() { @Test void mcpDiscoverResult_nested() { - var server = new DiscoveredMcpServer("discovered-server", DiscoveredMcpServerType.STDIO, - DiscoveredMcpServerSource.USER, true); + var server = new DiscoveredMcpServer("discovered-server", DiscoveredMcpServerType.STDIO, McpServerSource.USER, + true); var result = new McpDiscoverResult(List.of(server)); assertEquals(1, result.servers().size()); assertEquals("discovered-server", result.servers().get(0).name()); assertEquals(DiscoveredMcpServerType.STDIO, result.servers().get(0).type()); - assertEquals(DiscoveredMcpServerSource.USER, result.servers().get(0).source()); + assertEquals(McpServerSource.USER, result.servers().get(0).source()); assertTrue(result.servers().get(0).enabled()); } @@ -916,7 +923,7 @@ void modelsListResult_nested() { 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 policy = new ModelPolicy(ModelPolicyState.ENABLED, null); var billing = new ModelBilling(1.0, null); var modelItem = new Model("gpt-5", "GPT-5", capabilities, policy, billing, null, null, null, null); var result = new ModelsListResult(List.of(modelItem)); @@ -927,7 +934,7 @@ void modelsListResult_nested() { assertTrue(result.models().get(0).capabilities().supports().vision()); assertFalse(result.models().get(0).capabilities().supports().reasoningEffort()); assertEquals(100000L, result.models().get(0).capabilities().limits().maxPromptTokens()); - assertEquals("active", result.models().get(0).policy().state()); + assertEquals(ModelPolicyState.ENABLED, result.models().get(0).policy().state()); assertEquals(Double.valueOf(1.0), result.models().get(0).billing().multiplier()); } @@ -950,7 +957,7 @@ void sessionModelSwitchToParams_nested_records() { 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); + var params = new SessionModelSwitchToParams("sess-m", "gpt-5", null, null, capabilities); assertEquals("gpt-5", params.modelId()); assertNotNull(params.modelCapabilities()); diff --git a/src/test/resources/logging-debug.properties b/src/test/resources/logging-debug.properties index 096ed002e7..d461aa1e3c 100644 --- a/src/test/resources/logging-debug.properties +++ b/src/test/resources/logging-debug.properties @@ -15,7 +15,7 @@ java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter java.util.logging.SimpleFormatter.format=%1$tF %1$tT.%1$tL %4$-7s [%3$s] %5$s%6$s%n # Set FINE level for Copilot SDK classes -com.github.copilot.sdk.level=FINE +com.github.copilot.level=FINE # Root logger level .level=INFO diff --git a/src/test/resources/logging.properties b/src/test/resources/logging.properties index d294b56610..6aff48d466 100644 --- a/src/test/resources/logging.properties +++ b/src/test/resources/logging.properties @@ -3,6 +3,6 @@ java.util.logging.ConsoleHandler.level=INFO java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter java.util.logging.SimpleFormatter.format=%1$tF %1$tT.%1$tL %4$-7s [%3$s] %5$s%6$s%n -com.github.copilot.sdk.level=INFO +com.github.copilot.level=INFO .level=INFO