mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 06:12:50 -07:00
feat(core): transition sub-agents to XML format and improve definitions (#18555)
This commit is contained in:
@@ -9,6 +9,8 @@ import process from 'node:process';
|
||||
import { homedir } from '../utils/paths.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
import type { Config } from '../config/config.js';
|
||||
import * as snippets from './snippets.js';
|
||||
import * as legacySnippets from './snippets.legacy.js';
|
||||
|
||||
export type ResolvedPath = {
|
||||
isSwitch: boolean;
|
||||
@@ -63,15 +65,25 @@ export function applySubstitutions(
|
||||
prompt: string,
|
||||
config: Config,
|
||||
skillsPrompt: string,
|
||||
isGemini3: boolean = false,
|
||||
): string {
|
||||
let result = prompt;
|
||||
|
||||
result = result.replace(/\${AgentSkills}/g, skillsPrompt);
|
||||
result = result.replace(
|
||||
/\${SubAgents}/g,
|
||||
config.getAgentRegistry().getDirectoryContext(),
|
||||
|
||||
const activeSnippets = isGemini3 ? snippets : legacySnippets;
|
||||
const subAgentsContent = activeSnippets.renderSubAgents(
|
||||
config
|
||||
.getAgentRegistry()
|
||||
.getAllDefinitions()
|
||||
.map((d) => ({
|
||||
name: d.displayName || d.name,
|
||||
description: d.description,
|
||||
})),
|
||||
);
|
||||
|
||||
result = result.replace(/\${SubAgents}/g, subAgentsContent);
|
||||
|
||||
const toolRegistry = config.getToolRegistry();
|
||||
const allToolNames = toolRegistry.getAllToolNames();
|
||||
const availableToolsList =
|
||||
|
||||
Reference in New Issue
Block a user