diff --git a/.gitignore b/.gitignore index 6ff86481d..e0933e2cd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ # Documentation validation output docs/.validation/ .DS_Store +changebundle.txt* +*.sln diff --git a/test/harness/cliCompatibility.test.ts b/test/harness/cliCompatibility.test.ts new file mode 100644 index 000000000..c220846c8 --- /dev/null +++ b/test/harness/cliCompatibility.test.ts @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +import { readFileSync } from "fs"; +import path from "path"; +import { describe, expect, test } from "vitest"; + +/** + * Validates that the test harness CLI binary is compatible with the SDK + * protocol. This prevents regressions where the SDK advances its protocol + * (e.g., new permission kind values or RPC methods) but the harness CLI + * is not bumped to a version that supports them. + * + * See: https://github.com/github/copilot-sdk/issues/1146 + */ +describe("Test harness CLI compatibility", () => { + const cliAppPath = path.resolve( + import.meta.dirname, + "node_modules/@github/copilot/app.js", + ); + + const appContent = readFileSync(cliAppPath, "utf-8"); + + test("CLI app.js bundle exists", () => { + expect(appContent.length).toBeGreaterThan(0); + }); + + test("CLI supports new permission decision kinds (approve-once, reject, user-not-available)", () => { + // The handlePendingPermissionRequest RPC handler must accept the new + // PermissionDecision kinds introduced alongside the SDK's + // PermissionRequestResultKind changes (approve-once replaces approved, + // reject replaces denied-interactively-by-user, user-not-available + // replaces denied-no-approval-rule-and-could-not-request-from-user). + expect(appContent).toContain("handlePendingPermissionRequest"); + expect(appContent).toContain("approve-once"); + expect(appContent).toContain("reject"); + expect(appContent).toContain("user-not-available"); + }); + + test("CLI supports per-session auth (auth.getStatus)", () => { + // Per-session GitHub authentication requires the CLI to implement + // the session.auth.getStatus RPC method and accept gitHubToken in + // session creation. + expect(appContent).toContain("auth.getStatus"); + expect(appContent).toContain("gitHubToken"); + expect(appContent).toContain("isAuthenticated"); + }); +}); diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 51538fe1d..e55645e8a 100644 --- a/test/harness/package-lock.json +++ b/test/harness/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@github/copilot": "^1.0.32", + "@github/copilot": "^1.0.36-0", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "openai": "^6.17.0", @@ -462,27 +462,27 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.32.tgz", - "integrity": "sha512-ydEYAztJQa1sLQw+WPmnkkt3Sf/k2Smn/7szzYvt1feUOdNIak1gHpQhKcgPr2w252gjVLRWjOiynoeLVW0Fbw==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.36.tgz", + "integrity": "sha512-x0N5wLzw+tANzb+vCFYLHn3BV3qii2oyn14wC20RO7SsS8/YeBH8olvwlDLJ4PB0mL17QOiytNCdkvjvprm28w==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.32", - "@github/copilot-darwin-x64": "1.0.32", - "@github/copilot-linux-arm64": "1.0.32", - "@github/copilot-linux-x64": "1.0.32", - "@github/copilot-win32-arm64": "1.0.32", - "@github/copilot-win32-x64": "1.0.32" + "@github/copilot-darwin-arm64": "1.0.36", + "@github/copilot-darwin-x64": "1.0.36", + "@github/copilot-linux-arm64": "1.0.36", + "@github/copilot-linux-x64": "1.0.36", + "@github/copilot-win32-arm64": "1.0.36", + "@github/copilot-win32-x64": "1.0.36" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.32.tgz", - "integrity": "sha512-RtGHpnrbP1eVtpzitLqC0jkBlo63PJiByv6W/NTtLw4ZAllumb5kMk8JaTtydKl9DCOHA0wfXbG5/JkGXuQ81g==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.36.tgz", + "integrity": "sha512-5qkb7frTS4K/LdTDLrzKo78VR4aw/EZ6JzLz4KfmaW4UYyPiNirExDFXa/By22X0o8YMfOp4MCA2KSCAxKdgTg==", "cpu": [ "arm64" ], @@ -497,9 +497,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.32.tgz", - "integrity": "sha512-eyF6uy8gcZ4m/0UdM9UoykMDotZ8hZPJ1xIg0iHy4wrNtkYOaAspAoVpOkm50ODOQAHJ5PVV+9LuT6IoeL+wHQ==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.36.tgz", + "integrity": "sha512-AdsM8QtM5QSzMLpavLREh8HALO5G+VWzGNQqIHu4f0YQC/s1cGoiwo3wsgkpxRcLGBykFc+bDX3yK3MDQ8XvSw==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.32.tgz", - "integrity": "sha512-acRAu5ehFPnw3hQSIxcmi7wzv8PAYd+nqdxZXizOi++en3QWgez7VEXiKLe9Ukf50iiGReg19yvWV4iDOGC0HQ==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.36.tgz", + "integrity": "sha512-n7K1I6r0ggOJ4A9uAMS11USTvn6BKtAwvrOkzEaeRK89VNUJzpTe6p0mE13ItzRe5eot9WLBQOxvXLtL9f6E+g==", "cpu": [ "arm64" ], @@ -531,9 +531,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.32.tgz", - "integrity": "sha512-lw86YDwkTKwmeVpfnPErDe9DhemrOHN+l92xOU9wQSH5/d+HguXwRb3e4cQjlxsGLS+/fWRGtwf+u2fbQ37avw==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.36.tgz", + "integrity": "sha512-wBtCdR3ITZcq07BJbkwHfwI6ayiwbH5pF1ex+Ycl4UI+Lf1vP9eQD6wJppPgsrjwFcdeWRThaYTPCRTkSGHv5g==", "cpu": [ "x64" ], @@ -548,9 +548,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.32.tgz", - "integrity": "sha512-+eZpuzgBbLHMIzltH541wfbbMy0HEdG91ISzRae3qPCssf3Ad85sat6k7FWTRBSZBFrN7z4yMQm5gROqDJYGSA==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.36.tgz", + "integrity": "sha512-0GzZUZQn07alI8BgbzK0NlR5+ta/Rd0sWmd8kbRCns7oybAIkSALy6BKVwJmVHtXUi6h4iUE8oiFhkn0spymvw==", "cpu": [ "arm64" ], @@ -565,9 +565,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.32.tgz", - "integrity": "sha512-R6SW1dsEVmPMhrN/WRTetS4gVxcuYcxi2zfDPOfcjW3W0iD0Vwpt3MlqwBaU2UL36j+rnTnmiOA+g82FIBCYVg==", + "version": "1.0.36", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.36.tgz", + "integrity": "sha512-UBX9qj0McCK/SLq93XIr1i80fj3b3XmE3befVFrzxQuTeOoxLURN35vi7W+4x+4ZfsDHQpRTlJNjZw9w0fPr+Q==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index af521775b..06741e6d3 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -11,7 +11,7 @@ "test": "vitest run" }, "devDependencies": { - "@github/copilot": "^1.0.32", + "@github/copilot": "^1.0.36-0", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "openai": "^6.17.0",