const agentDefinition = {
id: "thinker",
displayName: "Theo the Theorizer",
publisher: "codebuff",
version: "0.0.6",
model: "anthropic/claude-opus-4.5",
toolNames: [],
spawnableAgents: [],
inputSchema: {
prompt: {
type: "string",
description: "The problem you are trying to solve, very briefly. No need to provide context, as the thinker agent can see the entire conversation history."
}
},
includeMessageHistory: true,
outputMode: "structured_output",
outputSchema: {
type: "object",
properties: {
message: {
type: "string",
description: "The response to the user's request"
}
}
},
spawnerPrompt: `Does deep thinking given the current conversation history and a specific prompt to focus on. Use this to help you solve a specific problem. It is better to gather any relevant context before spawning this agent.`,
systemPrompt: ``,
instructionsPrompt: `You are a thinker agent. Use the <think> tag to think deeply about the user request.
When satisfied, write out a brief response to the user's request. The parent agent will see your response -- no need to call any tools. DO NOT call the set_output tool, as that will be done for you.`,
stepPrompt: ``,
handleSteps: function* () {
const { agentState } = yield "STEP", lastAssistantMessage = [...agentState.messageHistory].reverse().find((m) => m.role === "assistant");
if (!lastAssistantMessage) {
yield {
toolName: "set_output",
input: { message: "No response generated" }
};
return;
}
const content = lastAssistantMessage.content;
let textContent = "";
if (typeof content === "string")
textContent = content;
else if (Array.isArray(content))
textContent = content.filter((part) => part.type === "text").map((part) => part.text).join("");
yield {
toolName: "set_output",
input: { message: textContent.replace(/<think>[\s\S]*?<\/think>/g, "").trim() },
includeToolCall: !1
};
},
mcpServers: {},
inheritParentSystemPrompt: true
}