fix(coding-agent): use async operations in tools
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { readFile as fsReadFile, stat as fsStat } from "node:fs/promises";
|
||||
import { createInterface } from "node:readline";
|
||||
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
||||
import { Text } from "@earendil-works/pi-tui";
|
||||
import { spawn } from "child_process";
|
||||
import { readFileSync, statSync } from "fs";
|
||||
import path from "path";
|
||||
import { type Static, Type } from "typebox";
|
||||
import { keyHint } from "../../modes/interactive/components/keybinding-hints.ts";
|
||||
@@ -55,8 +55,8 @@ export interface GrepOperations {
|
||||
}
|
||||
|
||||
const defaultGrepOperations: GrepOperations = {
|
||||
isDirectory: (p) => statSync(p).isDirectory(),
|
||||
readFile: (p) => readFileSync(p, "utf-8"),
|
||||
isDirectory: async (p) => (await fsStat(p)).isDirectory(),
|
||||
readFile: (p) => fsReadFile(p, "utf-8"),
|
||||
};
|
||||
|
||||
export interface GrepToolOptions {
|
||||
|
||||
Reference in New Issue
Block a user