feat(sdk): initial package bootstrap for SDK (#18861)

This commit is contained in:
Michael Bleigh
2026-02-12 22:08:27 -08:00
committed by GitHub
parent d82f66973f
commit bed3eae0e1
14 changed files with 451 additions and 15 deletions

View File

@@ -56,6 +56,27 @@ export enum AuthType {
COMPUTE_ADC = 'compute-default-credentials',
}
/**
* Detects the best authentication type based on environment variables.
*
* Checks in order:
* 1. GOOGLE_GENAI_USE_GCA=true -> LOGIN_WITH_GOOGLE
* 2. GOOGLE_GENAI_USE_VERTEXAI=true -> USE_VERTEX_AI
* 3. GEMINI_API_KEY -> USE_GEMINI
*/
export function getAuthTypeFromEnv(): AuthType | undefined {
if (process.env['GOOGLE_GENAI_USE_GCA'] === 'true') {
return AuthType.LOGIN_WITH_GOOGLE;
}
if (process.env['GOOGLE_GENAI_USE_VERTEXAI'] === 'true') {
return AuthType.USE_VERTEX_AI;
}
if (process.env['GEMINI_API_KEY']) {
return AuthType.USE_GEMINI;
}
return undefined;
}
export type ContentGeneratorConfig = {
apiKey?: string;
vertexai?: boolean;

View File

@@ -140,6 +140,7 @@ export * from './prompts/mcp-prompts.js';
export * from './agents/types.js';
export * from './agents/agentLoader.js';
export * from './agents/local-executor.js';
export * from './agents/agent-scheduler.js';
// Export specific tool logic
export * from './tools/read-file.js';