fix: align embedded runner with pi-coding-agent API

This commit is contained in:
Peter Steinberger
2026-02-01 15:50:09 -08:00
parent 411d5fda58
commit e58291e070
3 changed files with 10 additions and 25 deletions

View File

@@ -15,10 +15,15 @@ import { ensureAuthStoreFile, resolveAuthStorePath } from "./paths.js";
import { suggestOAuthProfileIdForLegacyDefault } from "./repair.js";
import { ensureAuthProfileStore, saveAuthProfileStore } from "./store.js";
const OAUTH_PROVIDER_IDS = new Set(getOAuthProviders().map((provider) => provider.id));
const OAUTH_PROVIDER_IDS = new Set<OAuthProvider>(
getOAuthProviders().map((provider) => provider.id as OAuthProvider),
);
const isOAuthProvider = (provider: string): provider is OAuthProvider =>
OAUTH_PROVIDER_IDS.has(provider as OAuthProvider);
const resolveOAuthProvider = (provider: string): OAuthProvider | null =>
OAUTH_PROVIDER_IDS.has(provider) ? provider : null;
isOAuthProvider(provider) ? provider : null;
function buildOAuthApiKey(provider: string, credentials: OAuthCredentials): string {
const needsProjectId = provider === "google-gemini-cli" || provider === "google-antigravity";