feat: add exec pty support

This commit is contained in:
Peter Steinberger
2026-01-17 04:57:04 +00:00
parent 312cb75c50
commit c4ea25a509
11 changed files with 244 additions and 32 deletions

View File

@@ -0,0 +1,20 @@
import { afterEach, expect, test } from "vitest";
import { createExecTool } from "./bash-tools.exec";
import { resetProcessRegistryForTests } from "./bash-process-registry";
afterEach(() => {
resetProcessRegistryForTests();
});
test("exec supports pty output", async () => {
const tool = createExecTool({ allowBackground: false });
const result = await tool.execute("toolcall", {
command: "node -e 'process.stdout.write(\"ok\")'",
pty: true,
});
expect(result.details.status).toBe("completed");
const text = result.content?.[0]?.text ?? "";
expect(text).toContain("ok");
});