Skip to content

Commit bfe0930

Browse files
saltboCopilot
andcommitted
feat(providers): add GitHub Copilot provider via @github/copilot-sdk
- Add 'copilot' to AgentRuntime union, AGENT_RUNTIMES, RUNTIME_LABELS, RUNTIME_ALIASES in shared types - Implement CopilotProvider with execute(), getHistory(), fetchUsage() - Map SDK SessionEvent → AgentEvent via mapCopilotEvent() generator - Track active sessions for concurrency-safe getHistory() during execution - Fetch usage via GET /copilot_internal/user with gh auth token - Register provider in registry.ts and add COPILOT_CLI env var detection in runtime.ts - Add 43 unit tests for mapCopilotEvent and copilot.test.ts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7ec5232 commit bfe0930

8 files changed

Lines changed: 1057 additions & 2 deletions

File tree

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"dependencies": {
2121
"@anthropic-ai/claude-agent-sdk": "^0.2.96",
2222
"@auth/agent": "^0.3.0",
23+
"@github/copilot-sdk": "^0.2.2",
2324
"@openai/codex-sdk": "^0.118.0",
2425
"commander": "^13.1.0",
2526
"jose": "^6.2.2",

packages/cli/src/agent/runtime.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { execFileSync } from "node:child_process";
22

33
interface RuntimeSpec {
4+
/** Environment variable set by the runtime when it spawns subprocesses. */
45
envVar: string;
56
commandPattern: RegExp;
67
}
@@ -9,6 +10,7 @@ const RUNTIMES: Record<string, RuntimeSpec> = {
910
claude: { envVar: "CLAUDECODE", commandPattern: /(^|\/)claude(\s|$)/ },
1011
codex: { envVar: "CODEX_CI", commandPattern: /(^|\/)codex(\s|$)/ },
1112
gemini: { envVar: "GEMINI_CLI", commandPattern: /(^|\/)gemini(\s|$)/ },
13+
copilot: { envVar: "COPILOT_CLI", commandPattern: /(^|\/)copilot(\s|$)/ },
1214
};
1315

1416
export function detectRuntime(): string | null {

0 commit comments

Comments
 (0)