mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 00:09:30 +01:00
add instructions for agent host development
This commit is contained in:
@@ -11,24 +11,39 @@ const minimist = require('minimist');
|
||||
|
||||
async function main() {
|
||||
const args = minimist(process.argv.slice(2), {
|
||||
boolean: ['help', 'no-launch'],
|
||||
string: ['port'],
|
||||
boolean: ['help', 'enable-mock-agent', 'quiet'],
|
||||
string: ['port', 'log'],
|
||||
});
|
||||
|
||||
if (args.help) {
|
||||
console.log(
|
||||
'Usage: ./scripts/code-agent-host.sh [options]\n' +
|
||||
'\n' +
|
||||
'Options:\n' +
|
||||
' --port <number> Port to listen on (default: 8081, or VSCODE_AGENT_HOST_PORT env)\n' +
|
||||
' --no-launch Start server without additional actions\n' +
|
||||
' --help Show this help message',
|
||||
'\n' +
|
||||
'Options:\n' +
|
||||
' --port <number> Port to listen on (default: 8081, or VSCODE_AGENT_HOST_PORT env)\n' +
|
||||
' --enable-mock-agent Enable the mock agent for testing\n' +
|
||||
' --quiet Suppress logging output\n' +
|
||||
' --log <level> Log level to use (trace, debug, info, warning, error, off)\n' +
|
||||
' --help Show this help message',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const port = args.port || process.env['VSCODE_AGENT_HOST_PORT'] || '8081';
|
||||
const addr = await startServer(['--port', String(port)]);
|
||||
|
||||
/** @type {string[]} */
|
||||
const serverArgs = ['--port', String(port)];
|
||||
if (args['enable-mock-agent']) {
|
||||
serverArgs.push('--enable-mock-agent');
|
||||
}
|
||||
if (args.quiet) {
|
||||
serverArgs.push('--quiet');
|
||||
}
|
||||
if (args.log) {
|
||||
serverArgs.push('--log', String(args.log));
|
||||
}
|
||||
|
||||
const addr = await startServer(serverArgs);
|
||||
console.log(`Agent Host server listening on ${addr}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user