Load and use MCP server prompts as slash commands in the CLI (#4828)

Co-authored-by: harold <haroldmciver@google.com>
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
christine betts
2025-07-25 20:56:33 +00:00
committed by GitHub
parent de96887789
commit eb65034117
19 changed files with 761 additions and 100 deletions

View File

@@ -11,6 +11,7 @@ import {
ContentGeneratorConfig,
createContentGeneratorConfig,
} from '../core/contentGenerator.js';
import { PromptRegistry } from '../prompts/prompt-registry.js';
import { ToolRegistry } from '../tools/tool-registry.js';
import { LSTool } from '../tools/ls.js';
import { ReadFileTool } from '../tools/read-file.js';
@@ -186,6 +187,7 @@ export interface ConfigParameters {
export class Config {
private toolRegistry!: ToolRegistry;
private promptRegistry!: PromptRegistry;
private readonly sessionId: string;
private contentGeneratorConfig!: ContentGeneratorConfig;
private readonly embeddingModel: string;
@@ -314,6 +316,7 @@ export class Config {
if (this.getCheckpointingEnabled()) {
await this.getGitService();
}
this.promptRegistry = new PromptRegistry();
this.toolRegistry = await this.createToolRegistry();
}
@@ -396,6 +399,10 @@ export class Config {
return Promise.resolve(this.toolRegistry);
}
getPromptRegistry(): PromptRegistry {
return this.promptRegistry;
}
getDebugMode(): boolean {
return this.debugMode;
}