chore(agent): drop bash tool alias
This commit is contained in:
parent
307e7fa8ee
commit
3e7fa97296
2 changed files with 12 additions and 3 deletions
|
|
@ -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 "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<any>, processTool as AgentTool<any>];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue