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

@@ -302,7 +302,8 @@ export function createProcessTool(
details: { status: "failed" },
};
}
if (!scopedSession.child?.stdin || scopedSession.child.stdin.destroyed) {
const stdin = scopedSession.stdin ?? scopedSession.child?.stdin;
if (!stdin || stdin.destroyed) {
return {
content: [
{
@@ -314,13 +315,13 @@ export function createProcessTool(
};
}
await new Promise<void>((resolve, reject) => {
scopedSession.child?.stdin.write(params.data ?? "", (err) => {
stdin.write(params.data ?? "", (err) => {
if (err) reject(err);
else resolve();
});
});
if (params.eof) {
scopedSession.child.stdin.end();
stdin.end();
}
return {
content: [