feat(runner): migrate vibn-agent-runner to use frontend MCP proxy tools and updated headless prompt
This commit is contained in:
69
patch_runner_server.js
Normal file
69
patch_runner_server.js
Normal 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");
|
||||
Reference in New Issue
Block a user