feat: letta code

This commit is contained in:
cpacker
2025-10-24 21:19:24 -07:00
commit 70ac76040d
139 changed files with 15340 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import { backgroundProcesses } from "./process_manager.js";
interface BashOutputArgs {
bash_id: string;
filter?: string;
}
interface BashOutputResult {
message: string;
}
export async function bash_output(
args: BashOutputArgs,
): Promise<BashOutputResult> {
const { bash_id, filter } = args;
const proc = backgroundProcesses.get(bash_id);
if (!proc)
return { message: `No background process found with ID: ${bash_id}` };
const stdout = proc.stdout.join("\n");
const stderr = proc.stderr.join("\n");
let text = stdout;
if (stderr) text = text ? `${text}\n${stderr}` : stderr;
if (filter) {
text = text
.split("\n")
.filter((line) => line.includes(filter))
.join("\n");
}
return { message: text || "(no output yet)" };
}