Add a command line option to enable and list extensions (#3191)

This commit is contained in:
Billy Biggs
2025-07-08 12:57:34 -04:00
committed by GitHub
parent f1647d9e19
commit c0940a194e
8 changed files with 220 additions and 10 deletions

View File

@@ -66,6 +66,11 @@ export interface TelemetrySettings {
logPrompts?: boolean;
}
export interface ActiveExtension {
name: string;
version: string;
}
export class MCPServerConfig {
constructor(
// For stdio transport
@@ -133,6 +138,8 @@ export interface ConfigParameters {
bugCommand?: BugCommandSettings;
model: string;
extensionContextFilePaths?: string[];
listExtensions?: boolean;
activeExtensions?: ActiveExtension[];
}
export class Config {
@@ -172,6 +179,8 @@ export class Config {
private readonly model: string;
private readonly extensionContextFilePaths: string[];
private modelSwitchedDuringSession: boolean = false;
private readonly listExtensions: boolean;
private readonly _activeExtensions: ActiveExtension[];
flashFallbackHandler?: FlashFallbackHandler;
constructor(params: ConfigParameters) {
@@ -214,6 +223,8 @@ export class Config {
this.bugCommand = params.bugCommand;
this.model = params.model;
this.extensionContextFilePaths = params.extensionContextFilePaths ?? [];
this.listExtensions = params.listExtensions ?? false;
this._activeExtensions = params.activeExtensions ?? [];
if (params.contextFileName) {
setGeminiMdFilename(params.contextFileName);
@@ -446,6 +457,14 @@ export class Config {
return this.extensionContextFilePaths;
}
getListExtensions(): boolean {
return this.listExtensions;
}
getActiveExtensions(): ActiveExtension[] {
return this._activeExtensions;
}
async getGitService(): Promise<GitService> {
if (!this.gitService) {
this.gitService = new GitService(this.targetDir);