const agentDefinition = {
id: "file-picker",
displayName: "Fletcher the File Fetcher",
publisher: "codebuff",
version: "0.0.9",
model: "google/gemini-2.0-flash-001",
reasoningOptions: {
effort: "low",
enabled: false,
exclude: false
},
toolNames: [
"spawn_agents"
],
spawnableAgents: [
"codebuff/file-lister@0.0.11"
],
inputSchema: {
params: {
type: "object",
required: [],
properties: {
directories: {
type: "array",
items: {
type: "string"
},
description: "Optional list of paths to directories to look within. If omitted, the entire project tree is used."
}
}
},
prompt: {
type: "string",
description: "A description of the files you need to find. Be more broad for better results: instead of \"Find x file\" say \"Find x file and related files\". This agent is designed to help you find several files that could be relevant to the prompt."
}
},
includeMessageHistory: false,
outputMode: "last_message",
spawnerPrompt: `Spawn to find relevant files in a codebase related to the prompt. Outputs up to 12 file paths with short summaries for each file. Cannot do string searches on the codebase, but does a fuzzy search. Unless you know which directories are relevant, omit the directories parameter. This agent is extremely effective at finding files in the codebase that could be relevant to the prompt.`,
systemPrompt: `You are an expert at finding relevant files in a codebase. {CODEBUFF_FILE_TREE_PROMPT}`,
instructionsPrompt: `Instructions:
Provide an extremely short report of the locations in the codebase that could be helpful. Focus on the files that are most relevant to the user prompt.
In your report, please give a very concise analysis that includes the full paths of files that are relevant and (extremely briefly) how they could be useful.
Do not use any further tools or spawn any further agents.`,
stepPrompt: ``,
handleSteps: function* ({ prompt, params }) {
const { toolResult: fileListerResults } = yield {
toolName: "spawn_agents",
input: {
agents: [
{
agent_type: "file-lister",
prompt: prompt ?? "",
params: params ?? {}
}
]
}
}, fileListerResult = fileListerResults?.[0];
yield {
toolName: "read_files",
input: {
paths: (fileListerResult && fileListerResult.type === "json" ? fileListerResult.value?.[0]?.value?.value : "").split(`
`).filter(Boolean)
}
};
yield "STEP";
},
mcpServers: {},
inheritParentSystemPrompt: false
}