feat(cliproxy): add kiro and ghcp OAuth configurations

- add OAUTH_CONFIGS entries for kiro (authorization_code) and ghcp (device_code)

- update getAllAuthStatus providers array
This commit is contained in:
kaitranntt
2025-12-22 00:44:26 -05:00
parent 036714c774
commit a01abe181b
2 changed files with 8 additions and 16 deletions
+7 -7
View File
@@ -17,7 +17,7 @@ import { AccountInfo } from '../account-manager';
* - Agy: Authorization Code Flow with local callback server on port 51121 * - Agy: Authorization Code Flow with local callback server on port 51121
* - Qwen: Device Code Flow (polling-based, NO callback port needed) * - Qwen: Device Code Flow (polling-based, NO callback port needed)
* - Kiro: Authorization Code Flow with local callback server on port 9876 * - Kiro: Authorization Code Flow with local callback server on port 9876
* - Copilot: Device Code Flow (polling-based, NO callback port needed) * - GHCP: Device Code Flow (polling-based, NO callback port needed)
*/ */
export const OAUTH_CALLBACK_PORTS: Partial<Record<CLIProxyProvider, number>> = { export const OAUTH_CALLBACK_PORTS: Partial<Record<CLIProxyProvider, number>> = {
gemini: 8085, gemini: 8085,
@@ -25,7 +25,7 @@ export const OAUTH_CALLBACK_PORTS: Partial<Record<CLIProxyProvider, number>> = {
// codex uses 1455 // codex uses 1455
// agy uses 51121 // agy uses 51121
// qwen uses Device Code Flow - no callback port needed // qwen uses Device Code Flow - no callback port needed
// copilot uses Device Code Flow - no callback port needed // ghcp uses Device Code Flow - no callback port needed
}; };
/** /**
@@ -111,9 +111,9 @@ export const OAUTH_CONFIGS: Record<CLIProxyProvider, ProviderOAuthConfig> = {
scopes: ['codewhisperer:completions', 'codewhisperer:conversations'], scopes: ['codewhisperer:completions', 'codewhisperer:conversations'],
authFlag: '--kiro-login', authFlag: '--kiro-login',
}, },
copilot: { ghcp: {
provider: 'copilot', provider: 'ghcp',
displayName: 'GitHub Copilot', displayName: 'GitHub Copilot (OAuth)',
authUrl: 'https://github.com/login/device/code', authUrl: 'https://github.com/login/device/code',
scopes: ['copilot'], scopes: ['copilot'],
authFlag: '--github-copilot-login', authFlag: '--github-copilot-login',
@@ -132,7 +132,7 @@ export const PROVIDER_AUTH_PREFIXES: Record<CLIProxyProvider, string[]> = {
qwen: ['qwen-'], qwen: ['qwen-'],
iflow: ['iflow-'], iflow: ['iflow-'],
kiro: ['kiro-', 'aws-', 'codewhisperer-'], kiro: ['kiro-', 'aws-', 'codewhisperer-'],
copilot: ['github-copilot-', 'copilot-', 'gh-'], ghcp: ['github-copilot-', 'copilot-', 'gh-'],
}; };
/** /**
@@ -146,7 +146,7 @@ export const PROVIDER_TYPE_VALUES: Record<CLIProxyProvider, string[]> = {
qwen: ['qwen'], qwen: ['qwen'],
iflow: ['iflow'], iflow: ['iflow'],
kiro: ['kiro', 'codewhisperer'], kiro: ['kiro', 'codewhisperer'],
copilot: ['github-copilot', 'copilot'], ghcp: ['github-copilot', 'copilot'],
}; };
/** /**
+1 -9
View File
@@ -145,15 +145,7 @@ export function getAuthStatus(provider: CLIProxyProvider): AuthStatus {
* Get auth status for all providers * Get auth status for all providers
*/ */
export function getAllAuthStatus(): AuthStatus[] { export function getAllAuthStatus(): AuthStatus[] {
const providers: CLIProxyProvider[] = [ const providers: CLIProxyProvider[] = ['gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp'];
'gemini',
'codex',
'agy',
'qwen',
'iflow',
'kiro',
'copilot',
];
return providers.map(getAuthStatus); return providers.map(getAuthStatus);
} }