mcp-subagents
Version:
Multi-Agent AI Orchestration via Model Context Protocol - Access specialized CLI AI agents (Aider, Qwen, Gemini, Goose, etc.) with intelligent fallback and configuration
40 lines • 1.49 kB
JavaScript
import { BaseAgent } from './base.js';
export class GooseAgent extends BaseAgent {
buildCommand(_task, taskConfig) {
const cmd = ['goose', 'run'];
// Use stdin with -i - flag
cmd.push('-i', '-');
// Get custom flags to check for duplicates
const customFlags = taskConfig.flags || [];
// Add quiet mode only if not already specified
if (!customFlags.includes('--quiet')) {
cmd.push('--quiet');
}
// Model selection with proper priority:
// 1. Task config model (highest priority)
// 2. GOOSE_MODEL from task env (config file/MCP config)
// 3. GOOSE_MODEL from process env (system environment)
// 4. Config file model (from this.config.defaults)
// 5. Built-in default (lowest priority, handled in registry)
const model = taskConfig.model ||
taskConfig.env?.['GOOSE_MODEL'] ||
process.env['GOOSE_MODEL'] ||
this.config.defaults['model'];
if (model) {
cmd.push('--model', String(model));
}
// Add no-session only if not already specified
if (!customFlags.includes('--no-session')) {
cmd.push('--no-session');
}
// Add custom flags
if (customFlags.length > 0) {
cmd.push(...customFlags);
}
return this.validateCommand(cmd);
}
getInputMethod() {
return 'stdin';
}
}
//# sourceMappingURL=goose.js.map