diff --git a/src/agent/output.ts b/src/agent/output.ts index f7335cf1..e14e546b 100644 --- a/src/agent/output.ts +++ b/src/agent/output.ts @@ -26,7 +26,8 @@ function toolDisplayName(name: string): string { read: "ReadFile", write: "WriteFile", edit: "EditFile", - bash: "Bash", + exec: "Exec", + process: "Process", grep: "Grep", find: "FindFiles", ls: "ListDir", @@ -51,8 +52,10 @@ function formatToolArgs(name: string, args: unknown): string { return [get("glob") || get("pattern"), get("path") || get("directory")].filter(Boolean).join(" "); case "ls": return get("path") || get("directory"); - case "bash": + case "exec": return get("command"); + case "process": + return [get("action"), get("id")].filter(Boolean).join(" "); default: return ""; } diff --git a/src/agent/tools.ts b/src/agent/tools.ts index 59710f59..45aeeb26 100644 --- a/src/agent/tools.ts +++ b/src/agent/tools.ts @@ -1,6 +1,9 @@ import type { AgentOptions } from "./types.js"; import { getModel } from "@mariozechner/pi-ai"; import { createCodingTools } from "@mariozechner/pi-coding-agent"; +import type { AgentTool } from "@mariozechner/pi-agent-core"; +import { createExecTool } from "./tools/exec.js"; +import { createProcessTool } from "./tools/process.js"; export function resolveModel(options: AgentOptions) { if (options.provider && options.model) { @@ -11,5 +14,8 @@ export function resolveModel(options: AgentOptions) { export function resolveTools(options: AgentOptions) { const cwd = options.cwd ?? process.cwd(); - return createCodingTools(cwd); + const baseTools = createCodingTools(cwd).filter((tool) => tool.name !== "bash"); + const execTool = createExecTool(cwd); + const processTool = createProcessTool(cwd); + return [...baseTools, execTool as AgentTool, processTool as AgentTool]; }