morphbox
Version:
Docker-based AI sandbox for development with Claude integration
25 lines (22 loc) • 736 B
JavaScript
import { j as json } from './index-3BbzJtgI.js';
import { exec } from 'child_process';
import { promisify } from 'util';
import { W as WORKSPACE_DIR } from './workspace-CcQOwpY7.js';
import 'fs';
import 'path';
const execAsync = promisify(exec);
const POST = async ({ request }) => {
try {
const { path } = await request.json();
if (!path) {
return json({ error: "Path is required" }, { status: 400 });
}
await execAsync(`git add "${path}"`, { cwd: WORKSPACE_DIR });
return json({ success: true });
} catch (error) {
console.error("Git stage error:", error);
return json({ error: "Failed to stage file" }, { status: 500 });
}
};
export { POST };
//# sourceMappingURL=_server.ts-CDs3_6FJ.js.map