mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 09:01:17 +00:00
Configure lefthook formatter checks (#231)
* Add lefthook formatter checks * Fix SDK mode hydration * Stabilize SDK mode integration test
This commit is contained in:
parent
0471214d65
commit
d2346bafb3
282 changed files with 5840 additions and 8399 deletions
|
|
@ -23,10 +23,7 @@ console.log("Uploading MCP server bundle...");
|
|||
const client = await SandboxAgent.connect({ baseUrl });
|
||||
|
||||
const bundle = await fs.promises.readFile(serverFile);
|
||||
const written = await client.writeFsFile(
|
||||
{ path: "/opt/mcp/custom-tools/mcp-server.cjs" },
|
||||
bundle,
|
||||
);
|
||||
const written = await client.writeFsFile({ path: "/opt/mcp/custom-tools/mcp-server.cjs" }, bundle);
|
||||
console.log(` Written: ${written.path} (${written.bytesWritten} bytes)`);
|
||||
|
||||
// Create a session with the uploaded MCP server as a local command.
|
||||
|
|
@ -35,12 +32,14 @@ const session = await client.createSession({
|
|||
agent: detectAgent(),
|
||||
sessionInit: {
|
||||
cwd: "/root",
|
||||
mcpServers: [{
|
||||
name: "customTools",
|
||||
command: "node",
|
||||
args: ["/opt/mcp/custom-tools/mcp-server.cjs"],
|
||||
env: [],
|
||||
}],
|
||||
mcpServers: [
|
||||
{
|
||||
name: "customTools",
|
||||
command: "node",
|
||||
args: ["/opt/mcp/custom-tools/mcp-server.cjs"],
|
||||
env: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
const sessionId = session.id;
|
||||
|
|
@ -49,4 +48,7 @@ console.log(' Try: "generate a random number between 1 and 100"');
|
|||
console.log(" Press Ctrl+C to stop.");
|
||||
|
||||
const keepAlive = setInterval(() => {}, 60_000);
|
||||
process.on("SIGINT", () => { clearInterval(keepAlive); cleanup().then(() => process.exit(0)); });
|
||||
process.on("SIGINT", () => {
|
||||
clearInterval(keepAlive);
|
||||
cleanup().then(() => process.exit(0));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue