feat(runner): migrate vibn-agent-runner to use frontend MCP proxy tools and updated headless prompt

This commit is contained in:
2026-05-19 14:06:12 -07:00
parent bbcd4ad55e
commit 67fa4a2ccc
32 changed files with 2275 additions and 1418 deletions

69
patch_runner_server.js Normal file
View File

@@ -0,0 +1,69 @@
const fs = require('fs');
const file = 'vibn-agent-runner/src/server.ts';
let code = fs.readFileSync(file, 'utf8');
// Update the type signature for the request body
const oldSig = ` } = req.body as {
sessionId?: string;
projectId?: string;
appName?: string;
appPath?: string;
giteaRepo?: string;
task?: string;
continueTask?: boolean;
autoApprove?: boolean;
coolifyAppUuid?: string;
};`;
const newSig = ` mcpToken, vibnApiUrl
} = req.body as {
sessionId?: string;
projectId?: string;
appName?: string;
appPath?: string;
giteaRepo?: string;
task?: string;
continueTask?: boolean;
autoApprove?: boolean;
coolifyAppUuid?: string;
mcpToken?: string;
vibnApiUrl?: string;
};`;
code = code.replace(oldSig, newSig);
const oldCtx = ` const ctx: ToolContext = {
workspaceRoot: repoRoot,
gitea: {
apiUrl: GITEA_API_URL,
apiToken: GITEA_API_TOKEN,
username: GITEA_USERNAME,
},
coolify: {
apiUrl: process.env.COOLIFY_API_URL || '',
apiToken: process.env.COOLIFY_API_TOKEN || '',
},
memoryUpdates: [],
};`;
const newCtx = ` const ctx: ToolContext = {
workspaceRoot: repoRoot,
gitea: {
apiUrl: GITEA_API_URL,
apiToken: GITEA_API_TOKEN,
username: GITEA_USERNAME,
},
coolify: {
apiUrl: process.env.COOLIFY_API_URL || '',
apiToken: process.env.COOLIFY_API_TOKEN || '',
},
mcpToken: mcpToken || '',
vibnApiUrl: vibnApiUrl || 'http://localhost:3000',
projectId,
memoryUpdates: [],
};`;
code = code.replace(oldCtx, newCtx);
fs.writeFileSync(file, code);
console.log("Patched Runner server.ts");