ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
IAuthenticationService manages GitHub and Copilot authentication. It provides GitHub sessions (OAuth tokens) and Copilot tokens (CAPI tokens).
getGitHubSession requires a kind parameter. Choose thoughtfully:
user:email). Use this when you only need basic access and don't require repo or write permissions.read:user, user:email, repo, workflow). Use when you need private repo access or write permissions.getGitHubSessionReturns AuthenticationSession (never undefined). Throws if the user cancels.
Requires createIfNone with a StrictAuthenticationPresentationOptions containing a localized `detail` string explaining why auth is needed:
const session = await authService.getGitHubSession('any', {
createIfNone: { detail: l10n.t('Sign in to GitHub to use feature X.') }
});Same as above but forces re-authentication even if a session exists. Use when the current token has lost authorization:
const session = await authService.getGitHubSession('any', {
forceNewSession: { detail: l10n.t('Sign in again to restore access.') }
});Returns AuthenticationSession | undefined. Never shows UI. Use when auth is optional:
const session = await authService.getGitHubSession('any', { silent: true });
if (!session) {
// No session available, handle gracefully
}StrictAuthenticationPresentationOptions with a required detail string. Passing true, false, or {} will not compile.l10n.t('...').Omit<AuthenticationGetSessionOptions, 'createIfNone' | 'forceNewSession'> — you cannot sneak a boolean createIfNone through it.For non-blocking checks (no network, no UI), use the cached properties:
authService.anyGitHubSession — cached 'any' session or undefinedauthService.permissiveGitHubSession — cached 'permissive' session or undefinedauthService.copilotToken — cached Copilot token (without the raw token string) or undefinedReact to onDidAuthenticationChange for identity changes (sign in/out, account switch). React to onDidCopilotTokenChange for token-level updates (quota, feature flags, routine ~20-minute refreshes).
Most callers just need a valid CAPI token. getCopilotToken() handles refresh automatically:
const token = await authService.getCopilotToken();When authService.isMinimalMode is true, the service will not fetch permissive tokens:
'permissive' calls throw MinimalModeError'permissive' calls return undefinedThere are three states a user can be in:
1. Not signed in — No 'any' session exists. The user has no GitHub session at all. An interactive createIfNone call will show VS Code's built-in sign-in dialog.
2. Signed in from VS Code — The user explicitly signed in through VS Code (e.g., via Accounts menu or a createIfNone prompt). In this case, VS Code automatically acquires the permissive token since it requests the broader scopes upfront. Both 'any' and 'permissive' sessions are available.
3. Signed in passively (e.g., via Settings Sync) — The user is signed into GitHub through a passive mechanism that only grants minimal scopes. Copilot Chat works with the 'any' token, but no 'permissive' token is available. A 'permissive' call with createIfNone will prompt the user to grant additional permissions.