@twai/tool-node
v0.0.7
Published
Node.js utilities tool for TWAI (Test With AI) testing framework
Downloads
782
Readme
@twai/tool-node
Node.js filesystem and execution tool for the TWAI (Test With AI) testing framework.
Installation
pnpm add @twai/tool-nodeUsage
import { NodeTool, createNodeTools } from "@twai/tool-node";
const node = new NodeTool(process.cwd());
// File operations
const content = await node.readFile("package.json");
await node.writeFile("output.txt", "Hello World");
const files = await node.listDir("./src");
// Command execution
const result = await node.exec("npm test");
console.log(result.stdout);
// As AI tool definitions
const tools = createNodeTools(node);Exports
NodeTool- Node.js utilities classcreateNodeTools- Create AI tool definitions- Types:
ExecResult,FileInfo
